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

20 lines
788 B
Text

/-!
# Regression test for perm lemma fvar ordering
This test guards against a regression where `simp` incorrectly rejects valid rewrites
for perm lemmas when fvar ids don't maintain declaration order in their `Name.lt` comparison.
The issue was introduced when `NameGenerator.mkChild` started being used for async elaboration,
creating fvar names like `_uniq.102.2` that compare smaller than `_uniq.7` under `Name.lt`,
even though they were created later.
This breaks the assumption in `acLt` that later-declared fvars compare greater,
causing perm lemmas like `Nat.add_comm` to be incorrectly rejected.
See https://github.com/leanprover/lean4/issues/12136
-/
variable {a : Nat}
theorem permLemmaFvarOrderingTest (b : Nat) (h : a + b = 3) : b + a = 3 := by
simp [Nat.add_comm, h]