2014-01-05 20:05:08 +00:00
|
|
|
|
import macros.
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
|
theorem and_comm (a b : Bool) : (a ∧ b) → (b ∧ a)
|
|
|
|
|
:= λ H_ab, and::intro (and::elimr H_ab) (and::eliml H_ab).
|
2014-01-01 22:01:12 +00:00
|
|
|
|
|
2014-01-08 08:38:39 +00:00
|
|
|
|
theorem or_comm (a b : Bool) : (a ∨ b) → (b ∨ a)
|
|
|
|
|
:= λ H_ab,
|
2014-01-06 03:10:21 +00:00
|
|
|
|
or::elim H_ab
|
|
|
|
|
(λ H_a, or::intror b H_a)
|
|
|
|
|
(λ H_b, or::introl H_b a).
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-06 03:10:21 +00:00
|
|
|
|
-- (em a) is the excluded middle a ∨ ¬a
|
|
|
|
|
-- (mt H H_na) is Modus Tollens with
|
2014-01-08 08:38:39 +00:00
|
|
|
|
-- H : (a → b) → a)
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- H_na : ¬a
|
|
|
|
|
-- produces
|
2014-01-08 08:38:39 +00:00
|
|
|
|
-- ¬(a → b)
|
2014-01-05 16:52:46 +00:00
|
|
|
|
--
|
2014-01-06 03:10:21 +00:00
|
|
|
|
-- not::imp::eliml applied to
|
2014-01-08 08:38:39 +00:00
|
|
|
|
-- (MT H H_na) : ¬(a → b)
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- produces
|
|
|
|
|
-- a
|
2014-01-08 08:38:39 +00:00
|
|
|
|
theorem pierce (a b : Bool) : ((a → b) → a) → a
|
|
|
|
|
:= λ H, or::elim (em a)
|
|
|
|
|
(λ H_a, H_a)
|
|
|
|
|
(λ H_na, not::imp::eliml (mt H H_na)).
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
|
print environment 3.
|