proof: make scope lift helper-world parametric#2108
Conversation
|
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_08066779-d64c-4d5f-8415-02ee523fb8cc) |
6abf2ac to
3469224
Compare
dde60b3 to
0ed2d68
Compare
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_8c03b631-4e2d-407f-a746-73c6d9bedd85) |
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_797323e3-5e4d-4294-af41-df52fdc3b9d5) |
…nals-retarget proof: route expr helper lists through WithInternals assembly
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_388ed252-17fa-40e1-bb20-dea362f4f596) |
Summary
Continues #2080 after phase 13 / #2107.
This PR is stacked on #2107 and targets
paloma/issue-2080-spec-functions-stmt-list. It should be reviewed/merged after the existing #2102 -> #2107 chain lands.FunctionBody.compileStmt_ok_any_scope_with_surfaceinduction parametric overinternalFunctions*_with_internalswrappers for statement and statement-list scope liftingcompileStmtListcons reconstruction/inversion helpers under an arbitrary internal helper worldcompileStmtList_ok_of_stmtListGenericWithHelpersAndHelperIRWithInternalsPrintAxioms.leanProof status
The internal-functions-parametric any-scope path now works for the
StmtListGenericWithHelpersAndHelperIRWithInternalsseam: exactspec.functionshead compiles can be retargeted to the caller-provided scope and reconstructed as a compiled statement list under the samespec.functionsworld.This does not close every legacy/default-empty consumer yet. The next dispatch should retarget remaining consumers of
StmtListGenericWithHelpersAndHelperIR/ helper-free compiled compatibility inInterfaceAssemblyand adjacent call sites to theWithInternalswitness where expression helper payloads enter, then continue removing default-empty seams that still rely on helper-free compatibility orruntimeContract.internalFunctions = []-style assumptions.Validation
lake env lean Compiler/Proofs/IRGeneration/FunctionBody/Stmt.lean && lake env lean Compiler/Proofs/IRGeneration/GenericInduction/ResultRelation.leanpassedlean-slot lake build Compiler.Proofs.IRGeneration.FunctionBody.Stmtpassed; Spark offload attempted and fell back locally after HTTP 403 (host_dir does not belong to this mission or an ancestor)lean-slot lake build Compiler.Proofs.IRGeneration.GenericInduction.ResultRelationpassed with the same Spark 403 fallbacklean-slot lake build Compiler.Proofs.HelperStepProofspassed with the same Spark 403 fallbacklean-slot lake build Compiler.Proofs.IRGeneration.FunctionBody.Stmt Compiler.Proofs.IRGeneration.GenericInduction.ResultRelation Compiler.Proofs.HelperStepProofspassed with the same Spark 403 fallbackpython3 scripts/lean_lint.py --only lean_hygienepassed: 0 debug commands in proofs, 0 allowUnsafeReducibility, 0 sorry, 0 native_decide in proofspython3 scripts/lean_lint.py --only proof_lengthpassedpython3 scripts/generate_print_axioms.py --checkpassedlean-slot lake build PrintAxiomspassed with the same Spark 403 fallbacklake env lean PrintAxioms.lean > axiom-report-raw.log 2>&1passedmake checkpassed fully:Ran 607 tests in 308.106s,OK,All checks passed.Note
Medium Risk
Changes are confined to Lean proof infrastructure around compilation and helper-aware IR seams; mistakes could weaken verified compile/scope claims but do not touch runtime execution paths directly.
Overview
Makes statement compilation proofs respect an arbitrary internal-helper world (
spec.functions) instead of assuming an empty helper table, and wires that through the WithInternals statement-list seam.FunctionBody now threads
internalFunctionsthrough thecompileStmt_ok_any_scope_with_surfaceinduction (includingcompileExprWithInternalsand list compilation). It adds*_with_internalsscope-lift lemmas for single statements and lists, pluscompileStmtListcons reconstruction and inversion under that same helper world. Existing entry points still call the aux lemma with[].ResultRelation introduces
StmtListExprInternalHelperStepInterfaceWithInternalsandcompileStmtList_ok_of_stmtListGenericWithHelpersAndHelperIRWithInternals, which lifts exact-scope generic witnesses to a callerinScopeNamesby retargeting each head compile via the new scope API and rebuilding the list withspec.functions.InterfaceAssembly adds assembly from the WithInternals expression-helper list interface into
StmtListGenericWithHelpersAndHelperIRWithInternals. HelperStepProofs adds matching cons/whole-list builders for expression-helper bridges and refactorsstmtListGenericWithHelpersAndHelperIRWithInternals_of_exprHeadStepBridgesto route through that path (with an explicit “all heads are expression-helper surface” hypothesis). PrintAxioms is regenerated.Reviewed by Cursor Bugbot for commit a29959d. Bugbot is set up for automated code reviews on this repo. Configure here.