fix: getEqnsFor? should not panic on matchers
#11463
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 likebar.match_1. CallinggetEqnsFor?on this matcher would panic with:This also affected the
try?tactic, which internally usesgetEqnsFor?.We make
shouldGenerateEqnThmsreturnfalsefor matchers, since their equations are already generated separately byLean.Meta.Match.MatchEqs. This prevents the equation generation machinery from attempting to create duplicate equation theorems.Closes #11461
Closes #10390
🤖 Prepared with Claude Code