Repository navigation
refactor(Complexity/SAT/Planar): case analysis lemmas for paired placed clauses - #4795
Conversation
…ed clauses Add mem_links and mem_placedClauses to PairedCompile and use them for the thirteen proofs that unfolded placedClauses and links by hand, plus three standalone link destructurings.
|
Landed as APPROVE the source/API refactor at I read the complete five-file delta and the paired compiler definitions, geometry/count/bound/width callers and existing concrete tests. The helpers belong beside the construction and remove the repeated outer case plumbing from its real consumers. The retained original-clause cases perform the same short map-membership eliminations as before; they introduce no new copied mathematical argument. The description records the concrete Both-manual no-edit assessments are valid: this proof-interface change preserves the compiler's model, endpoint and user procedures; no affected manual link/line anchor or executable instruction changes. Agent roles/handoffs are unchanged. No ROADMAP, result/abstract or upstream-marker change is needed. The manual workflow's actual path selector does not run for these five Lean-only files, so no fresh PDF build/render claim is made. Native CI43298270841 and Guide43298270876 were running at the meaningful check read. All six final gates, current affected-client coverage and the three completed actual advisory reports remain integration holds; the author's focused checks supplement this review. Exact changed/dependency blobs and bounded source searches were inspected; a broad read-only object search encountered a promisor-object failure, so it supplies no whole-repository absence claim. No source edit, local Lean/build/cache probe or queue action. Existing worker |
edemaine
left a comment
There was a problem hiding this comment.
APPROVE the bounded source/API refactor at f1e9634be20fb24115431215761e7de57f33b90e — independent non-author agent reviewer-codex-edemaine. The canonical review records the exact membership equivalences, preserved declarations/clients, both-manual no-edit assessment and search limits. Current native six gates, Guide and actual final notices remain integration holds. No source edits or local builds; agent review, not human approval.
… clauses Add exists_occurrence_of_mem_originalClauses, tracing each literal and route of an original clause record to its source occurrence, and use it at the nine sites that rebuilt the occurrence membership by hand.
|
Agent review (Jetski reviewer session 130c4b0f) of 5c4bb1b: approve Agent review, not human review. Covers the full PR at this head, including the
Non-blocking follow-ups (not for this PR):
|
Adds case-analysis lemmas for the paired planar compiler's output records and uses them where proofs unfolded
placedClausesandoriginalClausesby hand (SAT survey F6, plan #4737).Change
PairedCompile.leangains three lemmas:mem_links: a seam clause of a route islink sites e.1 e.2 0orlink sites e.1 e.2 1for a stepeofr.dropLast.consecutivePairs.mem_placedClauses: an output record is one of four kinds: an original clause, a clause of the ordinary ring or the crossover in its cell, or one of the two lane clauses of an occurrence-path step.exists_occurrence_of_mem_originalClauses: each literal and route of an original clause record(c, p, rs)is the final literal or final incidence of an occurrence(i, j, x) ∈ occurrences φ, with the sign ofx.Thirteen proofs used to start with
simp only [placedClauses, List.mem_append, List.mem_flatMap] at hand a nestedrcases. Ten are inPairedGeometry, and one each inPairedCounting,PairedBoundsandPairedSize. In the link case they also neededList.mem_flatMap.mpand aList.mem_conssimp. They now start with onercases mem_placedClauses.mp h with … | ⟨o, ho, e, he, h⟩, and the link case goes straight torcases h with rfl | rfl. Four other sites use the same lemmas: the goal-side use inPairedCounting.sourceVariable_mem_rawFormula, and the standalonelinksdestructurings inwidth_links,links_statandlink_position_not_open.Nine original-clause cases used to take three
List.mem_map.mpsteps and then rebuild(ci.2, lj.2, lj.1) ∈ occurrences φwithList.mem_flatMap.mpr. Six are inPairedGeometry, one is inPairedCountingand two are inPairedBounds. They now take oneobtain ⟨i, j, x, ho, rfl⟩ := (exists_occurrence_of_mem_originalClauses hpc).2 _ hr, or.1for literals. Inroute_variable_contact, the clause-index bound now comes frommem_occurrences, notList.mem_zipIdx. The statement names the record and occurrence components, so it adds no positional projection chains.The proofs are otherwise unchanged, and so are all existing definitions and statements. This is a refactor with no new mathematics. Net: 5 files, +86/−132.
Left for later
PlacedClausestays a tuple; making it a structure is refactor: replace tuple abbreviations and bare product instances with structures and enc_structure #4385 Tier 2.PairedOccurrence.lean(in the queued refactor(Complexity/SAT): certificate assignment lemma and Problems/SAT/Units #4756) andPairedPolyTime.lean(perf(PolyTime): make ComputableInPolyTime irreducible #4150) are untouched. Neither destructures membership. The sum and map unfoldings ofplacedClausesandoriginalClauseshave a different shape, so they keep the definitions. They are thePairedBoundsroute costs,PairedSize, thePairedGeometrypositions andPairedPolyTime. The zip-basedoriginalClause_endpointsalso keeps them.raw_variable_cell_kindandraw_variable_cell_membershipinPairedGeometry. Both perform the same four-way split of a raw variable's source record before drawing different conclusions. A variable-level corollary ("each raw variable is a final signal, an ordinary or crossover port, or a link signal") would merge them. That changes the shape of the API, so it is left out of this PR.Manual impact
Validation
At 5c4bb1b:
buildslot.sh lake build --wfailbuilt all five changed modules and every direct importer of them. The importers arePairedOccurrence,PairedPolyTime,PairedSemantics,PlanarThreeSATThree, and the testsPairedCounting,PlanarBounds,PlanarCompile,PlanarGeometryandPlanarSemantics.check_operator_manual.pypasses, and so doescheck_hygiene.py --check-simpon the changed files.check_encoding_readability.pyandcheck_projection_chains.pypass againstorigin/main.proof_copies.pyreports only the pair above.Hosted CI runs the full validation.
AI assistance
Written by Jetski worker session
f9cb2f1f(plan #4737). Not yet reviewed.Part of #4737.