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)
|
2014-01-04 02:11:01 +00:00
|
|
|
|
:= Assume H_ab, Conj (Conjunct2 H_ab) (Conjunct1 H_ab).
|
2014-01-01 22:01:12 +00:00
|
|
|
|
|
|
|
|
|
Theorem or_comm (a b : Bool) : (a ∨ b) ⇒ (b ∨ a)
|
2014-01-04 02:11:01 +00:00
|
|
|
|
:= Assume H_ab,
|
2014-01-01 22:01:12 +00:00
|
|
|
|
DisjCases H_ab
|
|
|
|
|
(λ H_a, Disj2 b H_a)
|
|
|
|
|
(λ H_b, Disj1 H_b a).
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-05 16:52:46 +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
|
2014-01-04 02:11:01 +00:00
|
|
|
|
:= Assume H, DisjCases (EM a)
|
2014-01-01 22:01:12 +00:00
|
|
|
|
(λ 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.
|