lean4-htt/tests/lean/run/def8.lean
Leonardo de Moura f0f9880ece refactor(library/equations_compiler/elim_match,library/tactic/cases_tactic):
new design for elim_match

I still need to fix lemma generation, and refactor induction/subst tactics
2016-08-28 13:15:10 -07:00

31 lines
704 B
Text

set_option new_elaborator true
inductive imf {A B : Type} (f : A → B) : B → Type
| mk : ∀ (a : A), imf (f a)
definition g {A B : Type} {f : A → B} : ∀ {b : B}, imf f b → A
| .(f a) (imf.mk .f a) := a
example {A B : Type} (f : A → B) (a : A) : g (imf.mk f a) = a :=
rfl
definition v₁ : imf nat.succ 1 :=
(imf.mk nat.succ 0)
definition v₂ : imf (λ x, 1 + x) 1 :=
(imf.mk (λ x, 1 + x) 0)
example : g v₁ = 0 :=
rfl
example : g v₂ = 0 :=
rfl
lemma ex1 (A : Type) : ∀ (a b : A) (H : a = b), b = a
| a .a rfl := rfl
lemma ex2 (A : Type) : ∀ a b : A, a = b → b = a
| a .a (eq.refl .a) := rfl
lemma ex3 (A : Type) : ∀ a b : A, a = b → b = a
| a ._ (eq.refl ._) := rfl