Skip to content

proof: thread spec functions through stmt list seam#2107

Merged
Th0rgal merged 2 commits into
paloma/issue-2080-spec-functions-stmt-witnessfrom
paloma/issue-2080-spec-functions-stmt-list
Jul 8, 2026
Merged

proof: thread spec functions through stmt list seam#2107
Th0rgal merged 2 commits into
paloma/issue-2080-spec-functions-stmt-witnessfrom
paloma/issue-2080-spec-functions-stmt-list

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Jul 5, 2026

Copy link
Copy Markdown
Member

Continues #2080 as the next proof-tier slice after phase 12 / #2106.

Stacked on #2106 (paloma/issue-2080-spec-functions-stmt-witness) because #2106 and the earlier #2102-#2105 chain are still open. Please review/merge this after #2106.

What changed

  • Add compileStmtList_cons_eq_ok_with_internals, a narrow internal-functions-parametric cons reconstruction lemma for compileStmtList.
  • Add StmtListGenericWithHelpersAndHelperIRWithInternals, a spec-functions-aware statement-list seam whose heads carry CompiledStmtStepWithHelpersAndHelperIRWithInternals.
  • Add exact-scope reconstruction theorem compileStmtList_ok_of_stmtListGenericWithHelpersAndHelperIRWithInternals_exact, compiling statement lists with spec.functions.
  • Compose the phase-12 ExprInternalHelperHeadStepBridgeWithInternals witness through the new list seam with cons and all-heads assemblers.
  • Regenerate PrintAxioms.lean for the new theorem declarations.

Current blocker / next API

This closes exact-scope list reconstruction for the spec.functions world. Full replacement of compileStmtList_ok_of_stmtListGenericWithHelpersAndHelperIR still needs an internalFunctions-parametric version of FunctionBody.compileStmt_ok_any_scope_with_surface / compileStmtList_ok_any_scope_with_surface, because the existing scope-lift proof recursively hardcodes the default empty internal-function world.

Validation

  • lake env lean Compiler/Proofs/IRGeneration/GenericInduction/ResultRelation.lean
  • lake env lean Compiler/Proofs/HelperStepProofs.lean
  • lean-slot lake build Compiler.Proofs.IRGeneration.GenericInduction.ResultRelation
  • lean-slot lake build Compiler.Proofs.HelperStepProofs
  • python3 scripts/lean_lint.py --only lean_hygiene
  • python3 scripts/lean_lint.py --only proof_length
  • make check

Note: lean-slot attempted Spark offload but Spark returned HTTP 403 for this isolated worktree path, so the builds ran locally and passed.


Note

Medium Risk
Changes sit on the formal compiler correctness proof chain (stmt-list compilation and helper IR), but are additive Lean scaffolding with no runtime or security surface.

Overview
Extends the phase-12 WithInternals helper proof path so statement lists compile and assemble under spec.functions instead of the legacy empty internal-function world.

Compiler lemmas: Adds compileStmtList_cons_eq_ok_with_internals / compileStmtList_cons_ok_inv_with_internals, generalizes compileStmt_ok_any_scope_with_surface_aux to take internalFunctions, and exposes compileStmt_*_with_internals / compileStmtList_*_with_internals scope-lift theorems.

New list seams: Introduces StmtListGenericWithHelpersAndHelperIRWithInternals and StmtListExprInternalHelperStepInterfaceWithInternals, with exact- and scope-lifted compileStmtList_ok_of_stmtListGenericWithHelpersAndHelperIRWithInternals* reconstruction and an assembly bridge from the expression-helper interface.

Composition: Wires ExprInternalHelperHeadStepBridgeWithInternals through cons / all-heads list assemblers in HelperStepProofs; updates PrintAxioms.lean.

Scope is intentionally narrow (e.g. all expression-helper heads for the whole-list bridge); mixed lists still use legacy assembly until more WithInternals interfaces exist.

Reviewed by Cursor Bugbot for commit 73564ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Ready Ready Preview, Comment Jul 7, 2026 6:36am

Request Review

@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_a8a64fb4-cb76-4f19-9f1b-65b585350d14)

@Th0rgal Th0rgal force-pushed the paloma/issue-2080-spec-functions-stmt-witness branch from 537afbf to 4f6e96c Compare July 6, 2026 06:52
@Th0rgal Th0rgal force-pushed the paloma/issue-2080-spec-functions-stmt-list branch from 6abf2ac to 3469224 Compare July 6, 2026 06:52
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_66ce5f6b-3c54-4f27-b732-9e8cbad042e7)

@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_e0c9cc8d-c77f-4cf4-95f5-5db12230885c)

* proof: make scope lift helper-world parametric

* proof: route expr helper lists through WithInternals assembly
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_8161597a-6a15-48d0-94fa-d933eb664848)

@Th0rgal Th0rgal merged commit 98ac7a0 into paloma/issue-2080-spec-functions-stmt-witness Jul 8, 2026
21 checks passed
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