lean4-htt/tests/lean/run/univ_bug2.lean
Daniel Selsam a9b01991c2 feat(frontends/lean/inductive_cmd): new frontend for the inductive cmd
Conflicts:
	src/frontends/lean/CMakeLists.txt
	src/frontends/lean/structure_cmd.h
2016-08-17 07:34:03 -07:00

22 lines
889 B
Text

----------------------------------------------------------------------------------------------------
--- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
--- Released under Apache 2.0 license as described in the file LICENSE.
--- Author: Jeremy Avigad
----------------------------------------------------------------------------------------------------
open nat
-- first define a class of homogeneous equality
inductive [class] simplifies_to {T : Type} (t1 t2 : T) : Prop
| mk : t1 = t2 → simplifies_to
namespace simplifies_to
theorem get_eq {T : Type} {t1 t2 : T} (C : simplifies_to t1 t2) : t1 = t2 :=
simplifies_to.rec (λx, x) C
attribute [instance]
theorem simp_app (S : Type) (T : Type) (f1 f2 : S → T) (s1 s2 : S)
[C1 : simplifies_to f1 f2] [C2 : simplifies_to s1 s2] : simplifies_to (f1 s1) (f2 s2) :=
mk (congr (get_eq C1) (get_eq C2))
end simplifies_to