Skip to content

joachim/issue14961 - #14964

Closed
nomeata wants to merge 1 commit into
masterfrom
joachim/issue14961
Closed

joachim/issue14961#14964
nomeata wants to merge 1 commit into
masterfrom
joachim/issue14961

Conversation

@nomeata

@nomeata nomeata commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

…ee variables

This PR fixes `simp` producing a proof with free variables, rejected by the kernel with "declaration has free variables", when the same `match` application occurs in two branches of a `dite`. This also affected the equation lemmas generated for well-founded definitions containing such a term.

`simp` caches results by expression, so the proof of a cached result must not mention local hypotheses that `simp` introduced itself while descending into the term (see `Methods.wellBehavedDischarge`). `dischargeEqnThmHypothesis?` violated this: proving a match-equation side condition substitutes a discriminant, and `subst` reverts every hypothesis depending on it, pulling e.g. the `dite` hypothesis into the proof. It now clears those hypotheses from the goal first; `tryClearMany` keeps the ones the side condition itself depends on.

Closes #14961.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk92q7cJwjqGyg8kep2Gyi
@nomeata nomeata closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant