lean2/examples/lean/ex3.lean
Leonardo de Moura 9f34f96b08 Add another example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-04 05:40:28 -07:00

27 lines
No EOL
854 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Theorem and_comm (a b : Bool) : (a ∧ b) ⇒ (b ∧ a) :=
Discharge (λ H_ab, Conj (Conjunct2 H_ab) (Conjunct1 H_ab))
Theorem or_comm (a b : Bool) : (a b) ⇒ (b a) :=
Discharge (λ H_ab, DisjCases H_ab
(λ H_a, Disj2 b H_a)
(λ H_b, Disj1 a H_b))
(* ---------------------------------
(EM a) is the excluded middle a ¬a
(MT H H_na) is Modus Tollens with
H : (a ⇒ b) ⇒ a)
H_na : ¬a
produces
¬(a ⇒ b)
NotImp1 applied to
(MT H H_na) : ¬(a ⇒ b)
produces
a
----------------------------------- *)
Theorem pierce (a b : Bool) : ((a ⇒ b) ⇒ a) ⇒ a :=
Discharge (λ H, DisjCases (EM a)
(λ H_a, H_a)
(λ H_na, NotImp1 (MT H H_na)))
Show Environment 3