proof(#2080): split populated internal-table naming invariant over helper segment#2120
Merged
Th0rgal merged 1 commit intoJul 8, 2026
Conversation
…gment Add a reusable structural lemma `InternalTableNamesInternalPrefixed_of_internalFunctions_append` that distributes the internal-table naming invariant over a segmented `helpers ++ internalDefs` table (the shape `compileValidatedCore` actually emits), plus a consumer seam `InternalTableNamesInternalPrefixed_of_helpers_append_compiledInternalTable` that discharges the `internalFuncDefs` segment from the pipeline's `mapM` output and leaves only the helper-segment prefix obligation. This is the non-empty-table analogue of `compiledInternalTable_of_compileValidatedCore`, feeding the naming invariant consumed by the `internalNamesPrefixed` dispatch seam with no `internalFunctions = []` default-empty assumption. Refs #2080
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ff78713d-2f94-440b-b58b-6fdc80975bde) |
0be7791
into
paloma/issue-2080-dispatch-compiled-internal-table
21 checks passed
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.
Summary
Tier-2 internal-helper-call preservation (proof/L2) for #2080. This slice
generalizes the compiled-internal-table naming machinery from the pure
mapM-image table to the populated table shape thatcompileValidatedCoreactually emits, namely<prebuilt helper segments> ++ internalFuncDefs(see
internalFunctions :=inCompiler/CompilationModel/Dispatch.lean).Two additions in
Compiler/Proofs/IRGeneration/Contract.lean:Reusable structural lemma
InternalTableNamesInternalPrefixed_of_internalFunctions_append:distributes
InternalTableNamesInternalPrefixedover a segmentedhelpers ++ internalDefsinternal table viaList.mem_append, so thewhole-table naming obligation splits into two independent per-segment
obligations (helper segment +
internalFuncDefssegment). Provedwithout any
filterMap-append rewriting.Consumer seam
InternalTableNamesInternalPrefixed_of_helpers_append_compiledInternalTable:for a contract whose internal table is
helpers ++ internalDefswithinternalDefsthecompileInternalFunctionmapMimage, derivesInternalTableNamesInternalPrefixed— discharging theinternalFuncDefssegment structurally from the pipeline's
mapMequation(
compileInternalFunction_mapM_mem_exists+Function.InternalTableNamesInternalPrefixed_of_all_compiledInternal)and leaving only the helper-segment prefix obligation for a later slice.
This is the non-empty-table analogue of
compiledInternalTable_of_compileValidatedCore, feeding the naminginvariant consumed by
..._of_body_goal_of_internalNamesPrefixedwith nointernalFunctions = []default-empty assumption.PrintAxioms.leanregenerated to register the two new public theorems(0 sorry'd).
Base / dependency / stack
paloma/issue-2080-dispatch-compiled-internal-table(PR proof(#2080): feed compiled-internal-table dispatch seam from pipeline output #2119, still open).Validation
lean-slot lake build Compiler.Proofs.IRGeneration.Contract->✔ [1144/1144] Built ... Build completed successfully.python3 scripts/generate_print_axioms.py --check->OK: PrintAxioms.lean is up to date.python3 scripts/check_proof_length.py-> passed (no new proof over the 50-line hard limit).git diff --check-> clean.sorry/admit/axiomin touched proof files.Refs #2080
Note
Low Risk
Proof-only additions in IR generation contract lemmas plus axiom index regeneration; no runtime or compilation behavior changes.
Overview
Adds proof infrastructure so
InternalTableNamesInternalPrefixedcan be shown for the populated internal table shapehelpers ++ internalFuncDefsthatcompileValidatedCoreemits, not only a puremapMimage.InternalTableNamesInternalPrefixed_of_internalFunctions_appendsplits the whole-table naming obligation into independent per-segment checks viaList.mem_append, withoutfilterMap-append rewriting.InternalTableNamesInternalPrefixed_of_helpers_append_compiledInternalTableis the consumer seam: giveninternalFunctions = helpers ++ internalDefsand a successfulcompileInternalFunctionmapM, it proves the invariant when the helper segment is already prefix-correct—theinternalDefsside is discharged from existingmapM/ compiled-internal lemmas. That feeds the same naming premise used by..._of_body_goal_of_internalNamesPrefixedwithout assuming an empty internal table.PrintAxioms.leanregisters both new public theorems (count 5561 → 5563).Reviewed by Cursor Bugbot for commit f8e8295. Bugbot is set up for automated code reviews on this repo. Configure here.