2014-01-01 22:01:12 +00:00
|
|
|
|
Import macros.
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-01 22:01:12 +00:00
|
|
|
|
Theorem and_comm (a b : Bool) : (a ∧ b) ⇒ (b ∧ a)
|
|
|
|
|
:= assume H_ab, Conj (Conjunct2 H_ab) (Conjunct1 H_ab).
|
|
|
|
|
|
|
|
|
|
Theorem or_comm (a b : Bool) : (a ∨ b) ⇒ (b ∨ a)
|
|
|
|
|
:= assume H_ab,
|
|
|
|
|
DisjCases H_ab
|
|
|
|
|
(λ H_a, Disj2 b H_a)
|
|
|
|
|
(λ H_b, Disj1 H_b a).
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
|
|
|
|
(* ---------------------------------
|
|
|
|
|
(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
|
|
|
|
|
----------------------------------- *)
|
2014-01-01 22:01:12 +00:00
|
|
|
|
Theorem pierce (a b : Bool) : ((a ⇒ b) ⇒ a) ⇒ a
|
|
|
|
|
:= assume H, DisjCases (EM a)
|
|
|
|
|
(λ H_a, H_a)
|
|
|
|
|
(λ H_na, NotImp1 (MT H H_na)).
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-01 22:01:12 +00:00
|
|
|
|
Show Environment 3.
|