2014-11-26 22:49:48 +00:00
|
|
|
import logic
|
|
|
|
|
|
|
|
theorem tst {a b c : Prop} : a → b → c → a ∧ b :=
|
|
|
|
begin
|
2015-03-28 00:26:06 +00:00
|
|
|
intros [Ha, Hb, Hc],
|
|
|
|
reverts [Hb, Ha],
|
|
|
|
intros [Hb2, Ha2],
|
2014-11-26 22:49:48 +00:00
|
|
|
apply (and.intro Ha2 Hb2),
|
|
|
|
end
|
|
|
|
|
|
|
|
theorem foo1 {A : Type} (a b c : A) (P : A → Prop) : P a → a = b → P b :=
|
|
|
|
begin
|
2015-03-28 00:26:06 +00:00
|
|
|
intros [Hp, Heq],
|
|
|
|
reverts [Heq, Hp],
|
2014-11-26 22:49:48 +00:00
|
|
|
intro Heq,
|
2015-05-01 22:07:28 +00:00
|
|
|
eapply (eq.rec_on Heq),
|
2014-11-26 22:49:48 +00:00
|
|
|
intro Pa,
|
|
|
|
apply Pa
|
|
|
|
end
|
|
|
|
|
|
|
|
theorem foo2 {A : Type} (a b c : A) (P : A → Prop) : P a → a = b → P b :=
|
|
|
|
begin
|
2015-03-28 00:26:06 +00:00
|
|
|
intros [Hp, Heq],
|
2014-11-26 22:49:48 +00:00
|
|
|
apply (eq.rec_on Heq Hp)
|
|
|
|
end
|
|
|
|
|
|
|
|
print definition foo1
|
|
|
|
print definition foo2
|