lean4-htt/tests/elab/grind_9769.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

36 lines
858 B
Text

module
def Foo (n : Nat) := Σ (m : Nat), {f : Fin (n + 2) → Fin (m + 2) // f 0 = 0}
variable (n : Nat)
def Foo.e (f : Foo n) := f.2.1
def Foo.id : (Foo n) := ⟨n, ⟨fun x => x, rfl⟩⟩
def Foo.EqId (f : Foo n) : Prop :=
f = (Foo.id _)
structure Bar {n m : Nat} (f : Fin (n + 2) → Fin (m + 1)) : Prop where
out : f 1 = 1
/--
error: `grind` failed
case grind
n : Nat
f : Foo n
this : Bar fun x => x
h : ¬(Foo.EqId n f → Bar (Foo.e n f))
⊢ False
-/
#guard_msgs in
theorem EqIdToZero (f : Foo n) : f.EqId → Bar f.e := by
have : Bar (fun x => x : Fin (n + 2) → Fin (n + 2)) := ⟨rfl⟩
grind -verbose [Foo.e, Foo.id, Foo.EqId]
-- A simpler example that is provable and also triggers issue #9769
structure Boo (n : Nat) where
x : Nat
example (a : Boo 1) (n : Nat) : a ≍ Boo.mk (n := n) b → n = 1 → a.x = b := by
grind