lean4-htt/tests
Kim Morrison 2eca5ca6e4
fix: getEqnsFor? should not panic on matchers (#11463)
This PR fixes a panic in `getEqnsFor?` when called on matchers generated
from match expressions in theorem types.

When a theorem's type contains a match expression (e.g., `theorem bar :
(match ... with ...) = 0`), the compiler generates a matcher like
`bar.match_1`. Calling `getEqnsFor?` on this matcher would panic with:

```
PANIC: duplicate normalized declaration name bar.match_1.eq_1 vs. _private...bar.match_1.eq_1
```

This also affected the `try?` tactic, which internally uses
`getEqnsFor?`.

We make `shouldGenerateEqnThms` return `false` for matchers, since their
equations are already generated separately by
`Lean.Meta.Match.MatchEqs`. This prevents the equation generation
machinery from attempting to create duplicate equation theorems.

Closes #11461
Closes #10390


🤖 Prepared with Claude Code

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-02 07:53:50 +00:00
..
bench doc: correct typos in documentation and comments (#11465) 2025-12-02 06:38:05 +00:00
bench-radar chore: update and add benchmark metrics (#11420) 2025-11-28 14:40:43 +00:00
compiler chore: minor String API improvements (#11439) 2025-12-01 11:44:14 +00:00
elabissues
ir
lake chore: lake: update tests/toml (#11314) 2025-11-22 04:41:58 +00:00
lean fix: getEqnsFor? should not panic on matchers (#11463) 2025-12-02 07:53:50 +00:00
pkg feat: dedicated fix operator for well-founded recursion on Nat (#7965) 2025-12-01 12:51:55 +00:00
playground
plugin
simpperf
.gitignore
common.sh
lakefile.toml
lean-toolchain