2014-01-05 20:05:08 +00:00
|
|
|
|
import macros.
|
2013-09-04 12:39:35 +00:00
|
|
|
|
|
2014-01-09 16:33:52 +00:00
|
|
|
|
theorem my_and_comm (a b : Bool) : (a ∧ b) → (b ∧ a)
|
2014-01-12 02:36:37 +00:00
|
|
|
|
:= assume H_ab, and_intro (and_elimr H_ab) (and_eliml H_ab).
|
2014-01-01 22:01:12 +00:00
|
|
|
|
|
2014-01-09 16:33:52 +00:00
|
|
|
|
theorem my_or_comm (a b : Bool) : (a ∨ b) → (b ∨ a)
|
2014-01-12 02:36:37 +00:00
|
|
|
|
:= assume H_ab,
|
2014-01-09 16:33:52 +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-09 16:33:52 +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
|
2014-01-12 02:36:37 +00:00
|
|
|
|
:= assume 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.
|