fix: fun_induction rejecting names for all hypotheses with let and generalizing - #14475
Merged
Conversation
…d `generalizing` This PR fixes a spurious "Too many variable names provided" error from `fun_induction` (and `induction`/`cases`) when an alternative had a `let`-bound field, so that all hypotheses of such an alternative can now be named. The error came from `getNumExplicitFields`, which counted nameable fields with a telescope that reduces `let` bindings away and then over-reads into later binders, disagreeing with the `introN` that actually names them. It now introduces the fields via the same `introN` path and counts the explicit (and `let`-bound) ones, so the count and the naming can no longer diverge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019PWpd2DPNidwHGtS7mvGpf
nomeata
enabled auto-merge
July 21, 2026 09:48
Collaborator
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
robsimmons
pushed a commit
that referenced
this pull request
Jul 29, 2026
…d `generalizing` (#14475) This PR fixes a spurious "Too many variable names provided" error from `fun_induction` (and `induction`/`cases`) when an alternative had a `let`-bound field, so that all hypotheses of such an alternative can now be named. The error came from `getNumExplicitFields`, which counted nameable fields with a telescope that reduces `let` bindings away and then over-reads into later binders, disagreeing with the `introN` that actually names them. It now introduces the fields via the same `introN` path and counts the explicit (and `let`-bound) ones, so the count and the naming can no longer diverge. Fixes: #14472 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 spurious "Too many variable names provided" error from
fun_induction(andinduction/cases) when an alternative had alet-bound field, so that all hypotheses of such an alternative can now be named.The error came from
getNumExplicitFields, which counted nameable fields with a telescope that reducesletbindings away and then over-reads into later binders, disagreeing with theintroNthat actually names them. It now introduces the fields via the sameintroNpath and counts the explicit (andlet-bound) ones, so the count and the naming can no longer diverge.Fixes: #14472
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com