lean4-htt/tests/lean/run/reductionBug.lean
2021-05-07 14:21:37 -07:00

19 lines
415 B
Text

abbrev VName := String
inductive Ty where
| Bool
| Int
def Ctxt := VName → Option Ty
variable (Γ : Ctxt) in
inductive Expr : Ty → Type where
| var (h : Γ x = some τ) : Expr τ
def Expr.constFold : Expr Γ τ → Option Unit
| var n => none
theorem Expr.constFold_sound {e : Expr Γ τ} : constFold e = some v → True := by
intro h
induction e with
| var => simp only [constFold] at h