Repository navigation
feat: vcgen destructures binders by @[vcgen_rintro] rules - #16291
Merged
Merged
Conversation
The attribute `@[vcgen_rintro]` registers a theorem whose conclusion is a `∀` telescope ending in an application of a parameter `G`. `vcgen` keys the rules in a discrimination tree by their conclusion. At each binder of a `∀` target, it applies the first matching rule as a backward rule, and otherwise introduces the binder. With rules for `x ∈ a :: l` and `x ∈ []`, the target `∀ n, n ∈ [1, 2, 3] → G n` splits into the goals `G 1`, `G 2` and `G 3`. `vcgen` always uses the rules `Prod.forall_intro`, `PUnit.forall_intro` and `True.forall_intro`. `Prod.forall_intro` replaces the special case for binders over pairs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QPKmiUooPkkAEYh2giBqfH
sgraf812
force-pushed
the
sg/vcgen-rintro
branch
from
November 5, 2026 23:01
44a0a52 to
7a1ec17
Compare
vcgen destructures premises by @[vcgen_rintro] rulesvcgen destructures binders by @[vcgen_rintro] rules
Member
Author
|
!bench |
|
Benchmark results for 7a1ec17 against 7633a28 are in. There are significant results. @sgraf812
Large changes (15🟥)
Medium changes (3✅, 6🟥)
Small changes (11✅, 146🟥)
|
…efixes at once `vcgen` uses `Prod.forall_intro` as its only built-in `@[vcgen_rintro]` rule. `PUnit.forall_intro` and `True.forall_intro` stay available for registration. `forallIntro?` introduces the binders before the first `∀` that a rule matches in one step, and `getRIntros` computes the entries of the built-in rules once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QPKmiUooPkkAEYh2giBqfH
Member
Author
|
!bench |
|
Benchmark results for 77ff450 against 7633a28 are in. There are significant results. @sgraf812
Large changes (6🟥)
Medium changes (1🟥)
Small changes (5✅, 172🟥)
|
`forallIntro?` walks the binders of the target in one pass. It matches each `∀` binder against the rule tree once, introduces the binders between two matches at once, and continues after a matched rule that does not apply without rescanning the telescope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74FF61KPDjY3k6hEEbrmc
Member
Author
|
!bench |
|
Benchmark results for 5292c98 against 7633a28 are in. There are significant results. @sgraf812
Large changes (3✅, 6🟥)
Medium changes (14✅, 1🟥)
Small changes (11✅, 174🟥)
|
sgraf812
marked this pull request as ready for review
November 6, 2026 11:14
sgraf812
enabled auto-merge
November 6, 2026 11:14
`PUnit.forall_intro` and `True.forall_intro` move from `Std.WP.Automation` into `tests/elab/vcgenRIntro.lean`. `vcgen` uses only `Prod.forall_intro` as a built-in rule, and `True.forall_intro` showed up in the completions of `True.` in `travellingCompletions`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D74FF61KPDjY3k6hEEbrmc
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 adds the attribute
@[vcgen_rintro], which tellsvcgenhow to destructure a binder while it introduces the binders of a goal, like a fixedrintropattern. For example, withthe goal
∀ n, n ∈ [1, 2, 3] → G nyields the verification conditionsG 1,G 2andG 3.🤖 Generated with Claude Code