lean4-htt/tests/elab/issue2237.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

35 lines
1.2 KiB
Text

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`
failed to generate equality theorems for `match` expression `plus.match_1`
Γ✝ : Context
a✝ : Ty
motive✝ : Term Γ✝ a✝ → Sort u_1
n✝ : Term ( ✶ :: Γ✝) ✶
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)
⊢ (⋯ ▸ fun x motive h_1 h_2 h_3 h_4 h => ⋯ ▸ h_2 n✝) n✝.lam motive✝ h_1✝ h_2✝ h_3✝ h_4✝ ⋯ = h_2✝ n✝
-/
#guard_msgs in
#print equations plus