2014-01-05 19:10:21 -08:00
|
|
|
import macros
|
|
|
|
|
2014-01-05 12:05:08 -08:00
|
|
|
scope
|
|
|
|
theorem ReflIf (A : Type)
|
2013-12-18 18:00:37 -08:00
|
|
|
(R : A → A → Bool)
|
2014-01-08 00:38:39 -08:00
|
|
|
(Symm : ∀ x y, R x y → R y x)
|
|
|
|
(Trans : ∀ x y z, R x y → R y z → R x z)
|
|
|
|
(Linked : ∀ x, ∃ y, R x y)
|
2013-12-18 17:40:21 -08:00
|
|
|
:
|
2014-01-08 00:38:39 -08:00
|
|
|
∀ x, R x x :=
|
2014-01-11 18:36:37 -08:00
|
|
|
take x,
|
|
|
|
obtain (w : A) (H : R x w), from (Linked x),
|
2014-01-05 19:10:21 -08:00
|
|
|
let L1 : R w x := Symm x w H
|
|
|
|
in Trans x w x H L1
|
|
|
|
|
2014-01-09 08:33:52 -08:00
|
|
|
pop_scope
|
2013-12-18 17:40:21 -08:00
|
|
|
|
2014-01-05 12:05:08 -08:00
|
|
|
scope
|
2014-01-05 08:52:46 -08:00
|
|
|
-- Same example again.
|
2014-01-05 12:05:08 -08:00
|
|
|
variable A : Type
|
|
|
|
variable R : A → A → Bool
|
2014-01-05 19:10:21 -08:00
|
|
|
axiom Symm {x y : A} : R x y → R y x
|
|
|
|
axiom Trans {x y z : A} : R x y → R y z → R x z
|
2014-01-05 12:05:08 -08:00
|
|
|
axiom Linked (x : A) : ∃ y, R x y
|
2013-12-18 17:40:21 -08:00
|
|
|
|
2014-01-05 12:05:08 -08:00
|
|
|
theorem ReflIf (x : A) : R x x :=
|
2014-01-05 19:10:21 -08:00
|
|
|
obtain (w : A) (H : R x w), from (Linked x),
|
|
|
|
let L1 : R w x := Symm H
|
|
|
|
in Trans H L1
|
2013-12-18 17:40:21 -08:00
|
|
|
|
2014-01-05 12:05:08 -08:00
|
|
|
end
|
2013-12-18 17:40:21 -08:00
|
|
|
|
2014-01-05 08:52:46 -08:00
|
|
|
-- Display the last two theorems
|
2014-01-05 12:05:08 -08:00
|
|
|
print environment 2
|