2014-01-05 20:05:08 +00:00
|
|
|
|
variable N : Type
|
|
|
|
|
variable h : N -> N -> N
|
2013-09-01 02:30:42 +00:00
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- Specialize congruence theorem for h-applications
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem CongrH {a1 a2 b1 b2 : N} (H1 : a1 = b1) (H2 : a2 = b2) : (h a1 a2) = (h b1 b2) :=
|
2013-09-01 02:30:42 +00:00
|
|
|
|
Congr (Congr (Refl h) H1) H2
|
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- Declare some variables
|
2014-01-05 20:05:08 +00:00
|
|
|
|
variable a : N
|
|
|
|
|
variable b : N
|
|
|
|
|
variable c : N
|
|
|
|
|
variable d : N
|
|
|
|
|
variable e : N
|
2013-09-01 02:30:42 +00:00
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- Add axioms stating facts about these variables
|
2014-01-05 20:05:08 +00:00
|
|
|
|
axiom H1 : (a = b ∧ b = c) ∨ (d = c ∧ a = d)
|
|
|
|
|
axiom H2 : b = e
|
2013-09-01 02:30:42 +00:00
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- Proof that (h a b) = (h c e)
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem T1 : (h a b) = (h c e) :=
|
2013-09-01 02:30:42 +00:00
|
|
|
|
DisjCases H1
|
2013-09-04 01:00:30 +00:00
|
|
|
|
(λ C1, CongrH (Trans (Conjunct1 C1) (Conjunct2 C1)) H2)
|
2013-09-04 01:12:46 +00:00
|
|
|
|
(λ C2, CongrH (Trans (Conjunct2 C2) (Conjunct1 C2)) H2)
|
2013-09-01 02:30:42 +00:00
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- We can use theorem T1 to prove other theorems
|
2014-01-05 20:05:08 +00:00
|
|
|
|
theorem T2 : (h a (h a b)) = (h a (h c e)) :=
|
2013-09-01 02:30:42 +00:00
|
|
|
|
CongrH (Refl a) T1
|
|
|
|
|
|
2014-01-05 16:52:46 +00:00
|
|
|
|
-- Display the last two objects (i.e., theorems) added to the environment
|
2014-01-05 20:05:08 +00:00
|
|
|
|
print environment 2
|
2013-09-01 02:30:42 +00:00
|
|
|
|
|
2014-01-05 19:03:35 +00:00
|
|
|
|
-- print implicit arguments
|
2014-01-05 20:05:08 +00:00
|
|
|
|
setoption lean::pp::implicit true
|
|
|
|
|
setoption pp::width 150
|
|
|
|
|
print environment 2
|