blob: 1f9fa30ef165ddf173ec83c0894f556aee1af123 [file] [edit]
inductive Ty where
| star: Ty
notation " ✶ " => Ty.star
abbrev Context : Type := List Ty
inductive Lookup : Context → Ty → Type where
| z : Lookup (t :: Γ) t
inductive Term : Context → Ty → Type where
| var : Lookup Γ a → Term Γ a
| lam : Term (✶ :: Γ) ✶ → Term Γ ✶
| ap : Term Γ ✶ → Term Γ ✶ → Term Γ ✶
abbrev plus : Term Γ a → Term Γ a
| .var i => .var i
| .lam n => .lam (plus n)
| .ap (.lam _) m => plus m -- This case takes precedence over the next one.
| .ap l m => (plus l).ap (plus m)
/--
error: failed to generate equational theorem for `plus`
Tactic `subst` failed: invalid equality proof, it is not of the form (x = t) or (t = x)
x✝ ≍ n✝.lam
Γ✝ : Context
a✝ : Ty
motive✝ : Term Γ✝ a✝ → Sort u_1
x✝ : Term Γ✝ a✝
h_1✝ : (i : Lookup Γ✝ a✝) → motive✝ (Term.var i)
h_2✝ : (n : Term ( ✶ :: Γ✝) ✶ ) → motive✝ n.lam
h_3✝ : (a : Term ( ✶ :: Γ✝) ✶ ) → (m : Term Γ✝ ✶ ) → motive✝ (a.lam.ap m)
h_4✝ : (l m : Term Γ✝ ✶ ) → motive✝ (l.ap m)
n✝ : Term ( ✶ :: Γ✝) ✶
heq_1✝ : x✝ ≍ n✝.lam
⊢ (match x✝ with
| Term.var i => h_1✝ i
| n.lam => h_2✝ n
| a.lam.ap m => h_3✝ a m
| l.ap m => h_4✝ l m) ≍
h_2✝ n✝
-/
#guard_msgs in
#print equations plus