lean2/tests/lean/run/assert_tac.lean
Leonardo de Moura 96b54a8007 feat(frontends/lean/builtin_exprs): add 'have' notation in 'begin-end' blocks
It is notation for the assert tactic.
2015-02-25 14:04:17 -08:00

58 lines
1.3 KiB
Text

import logic
variables {A : Type} {a a' : A}
definition to_eq₁ (H : a == a') : a = a' :=
begin
assert (H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a),
intro Ht,
exact (eq.refl (eq.rec_on Ht a)),
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end
definition to_eq₂ (H : a == a') : a = a' :=
begin
have H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a,
begin
intro Ht,
exact (eq.refl (eq.rec_on Ht a))
end,
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end
definition to_eq₃ (H : a == a') : a = a' :=
begin
have H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a,
by intro Ht; exact (eq.refl (eq.rec_on Ht a)),
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end
definition to_eq₄ (H : a == a') : a = a' :=
begin
have H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a,
from assume Ht, eq.refl (eq.rec_on Ht a),
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end
definition to_eq₅ (H : a == a') : a = a' :=
begin
have H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a,
proof
λ Ht, eq.refl (eq.rec_on Ht a)
qed,
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end
definition to_eq₆ (H : a == a') : a = a' :=
begin
have H₁ : ∀ (Ht : A = A), eq.rec_on Ht a = a, from
assume Ht,
eq.refl (eq.rec_on Ht a),
show a = a', from
heq.rec_on H H₁ (eq.refl A)
end