Skip to content

feat(planar-SAT): prove parsimonious positive exact-one hardness - #1282

Merged
SamuelSchlesinger merged 10 commits into
mainfrom
feat/positive-planar-exact-one-sat
Oct 29, 2026
Merged

SamuelSchlesinger merged 10 commits into
mainfrom
feat/positive-planar-exact-one-sat

Conversation

@edemaine

@edemaine edemaine commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Change

Closes #1259; stacked on #1281, after #1279. Proves NP-hardness of positive planar 1-in-E3SAT-3, with an existential orthogonal drawing and with the actual drawing supplied. Clauses have three distinct variables, all literals are positive, and each variable occurs at most three times. The positive width-at-most-three planar variant follows. These planar endpoints assert NP-hardness; nonplanar NP membership is in #1279.

The compiler replaces clauses of the existing parsimonious planar 3SAT-3 instance using #1281 certified profiles. It emits the actual compact formula, vertex positions and routes, proving full real-segment simplicity, endpoints, contacts and vertex avoidance. Native polynomial time uses binary labels/coordinates, unary bounded list/occurrence/offset counters and fixed finite dispatch. It does not enumerate the coordinate rectangle or substitute an existential proxy for the emitted drawing.

New replacement costs grow by constants. A supplied W×H drawing becomes at most 1080000(W+1) by 1080000(H+1). For S = clauses + literal occurrences + 1, the ordinary-3SAT composition has sides at most 14516280000 S and quadratic clause/literal/vertex/route/segment/Manhattan-wire bounds. Counts range over occurring variables. Total reductions guard malformed source syntax with SharpThreeSAT; unguarded equalities assume width at most three. The supplied-drawing counting target counts the formula projection; validity of emitted drawings is separately proved.

Main endpoints: DrawnPlanarPositiveOneInExactThreeSATThree_npHard, computableInPolyTime_toDrawnPlanarPositiveOneInExactThreeSATThree and toDrawnPlanarPositiveOneInExactThreeSATThree_costs.

The logical gadgets come from Hunt et al., pinned arXiv cs/9809017v1, Theorem 3.8, Figures 3.4–3.5, pp. 10–12, quoted and mapped in #1279. The integer drawing assembly, collars, native certificates, occurrence accounting and quantitative composition are original. Runtime-certified ASP forward/inverse witness maps remain outside this counting-reduction scope.

Existing notions considered: FormulaDrawing annotates existing OrthogonalDrawing/Route data by actual CNF occurrences to prove indexing once, then erases to Graph.IsPlanarOrthogonalDrawing; it adds no new planarity predicate. Profile maps and position tables instantiate the existing positive compiler and compact relabeling. Languages/reductions reuse CNF/incidenceGraph, Set, encCNF, binary drawing encodings, NPHard and ParsimoniousReducible. New definitions specify actual replacement data and positive restrictions absent from the ordinary compiler.

Validation and review

Local six-gate validation passed at 9b38815: strict build, aggregate check, strict tests, environment lint, style lint and initialization-import check. The later merge of main leaves this PR's mathematical source files unchanged. Aggregate regeneration/check passed at current head 7fe1be9. Hosted validation of the current merge head passed; the earlier local run is not being represented as a fresh local run on this new head.

Regressions cover mixed polarities with four preserved models, a nonempty actual drawing, empty formula versus empty clause, repeated variables and width-four rejection. The axiom audit permits only propext, Classical.choice and Quot.sound.

Local worker t3-96187517-positive-local-geometry independently reviewed the native certificate and final endpoint meanings, confirming encodings, actual output and guarded counts with no correctness/API finding. Those source blobs are unchanged by restacking. Root reviewed the delegated global assembly. These are technical agent reviews, not outside-fleet coordinator approval; coordinator review is requested. The local Windows guide build is blocked before elaboration by the existing Verso linker symbol lean_md4c_markdown_parse. Hosted Linux guide validation passed on the current head.

Headline abstracts

Selected abstracts, bridges, catalogue scope and rendering are unchanged; no PDF review is needed. Documentation lists the completed library endpoints and retains runtime-certified ASP as open.

AI assistance

Implemented and self-reviewed with Codex (gpt-6.1-sol) and the scoped workers recorded in #1259; no human approval is implied.

Refs #1257. Positive exact-three clauses use distinct variables; the strongest target permits at most three occurrences per variable. Counts range over occurring variables. Both local replacements have explicit constant-factor bounds and native polynomial-time certificates.

Co-developed with Codex workers t3-96187517-positive-semantics and t3-96187517-positive-gadgets. Final exact-revision validation and coordinator review will be recorded in the PR; the earlier combined working-tree six-gate run passed. Selected formal abstracts and rendering are unchanged.
Refs #1258, depends on #1257. The fifteen actual positive clause profiles and ordered three-terminal collars have kernel-checked full real-support certificates and explicit costs. Reusable scaling, trimming, joining, reflection and direction lemmas live in foundational geometry modules.

Co-developed with Codex workers t3-96187517-positive-gadgets and t3-96187517-positive-local-geometry. This milestone provides local certificates, not global planar hardness. Exact-revision validation and independent coordinator review will be recorded in the PR. Selected abstracts and rendering are unchanged.
Refs #1259; depends on #1257 and #1258. Emit the actual compact positive exact-three, occurrence-three formula and its continuous orthogonal incidence drawing, natively in polynomial time on binary labels/coordinates. Preserve guarded model counts and bound local growth by constants, with linear grid sides and quadratic clause/literal/vertex/route/segment/wire costs from ordinary 3SAT.

Co-developed with Codex workers t3-96187517-positive-semantics, t3-96187517-positive-local-geometry and t3-96187517-positive-gadgets. Local technical review is not independent coordinator approval. Exact tested and reviewed source identities will be recorded in the PR. Selected headline abstracts and rendering are unaffected; the separate guide build is blocked by the existing Windows Verso linker symbol lean_md4c_markdown_parse.
Correct three stale Main results references found by the changed-file audit. Definitions, statements and proofs are unchanged.
Carry the geometry milestone docstring-name corrections into the full endpoint branch. Mathematical definitions, statements, proofs and emitted data are unchanged.
@edemaine
edemaine marked this pull request as ready for review October 27, 2026 03:12
@edemaine
edemaine marked this pull request as draft October 27, 2026 03:16
Resolve the review-base conflict by merging current main and regenerating aggregate imports. Positive exact-one definitions, statements and proofs are unchanged; exact-revision validation follows.
Propagate the logical milestone main merge. Local geometry data, definitions, statements and proofs are unchanged.
Propagate the validated dependency-base update. The actual formula/drawing compilers, statements and proofs are unchanged; exact-revision validation follows.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-jetski-5208-1282 for coordinator-jetski-5208b1c7 (agent review, not human approval): CHANGES REQUESTED at 7fe1be994d9ca2dcac41ae048aff40f1357ee29f

Thank you for this substantial contribution. I reviewed only this PR's own commits (the diff against the #1281 head 8cf748ed).

What is proved. This PR composes the existing parsimonious planar 3SAT-3 compiler with #1281's positive exact-one clause replacement. It proves NP-hardness, under encCNF and Karp reductions from ThreeSAT, of positive planar 1-in-E3SAT-3 in two forms: with an existential drawing (PlanarPositiveOneInExactThreeSATThree_npHard) and with the drawing supplied as binary input encPair encCNF Graph.encOrthogonalDrawing (DrawnPlanarPositiveOneInExactThreeSATThree_npHard). It also proves the width-at-most-three variant. Planarity means planarity of the variable–clause incidence graph, witnessed by the existing Graph.IsPlanarOrthogonalDrawing. This matches Hunt et al.'s definition ("a CNF formula is planar iff its associated bipartite graph is planar", cs/9809017v1, §2), and the languages mirror PlanarThreeSATThree/DrawnPlanarThreeSATThree exactly. The emitted drawing is actually computed (SAT.ExactOne.positiveDrawing), and its validity is proved for every planar source drawing. Polynomial time is native. The fits and costs bounds match the PR description (1080000(W+1) sides; linear sides and quadratic costs in S = clauses + literal occurrences + 1). Count preservation oneModelCount_toPlanar… = modelCount assumes width ≤ 3. The guarded counting version is total. The target restrictions are stronger than Hunt's 1-Ex3MonoSat: E3 here requires distinct variables, and occurrences are bounded by three. Both restrictions are checked by the stated syntax lemmas. I compared the source mapping with Theorem 3.8 / Corollary 3.11 of the pinned arXiv v1; the detailed quotation lives in #1279.

Checked instance. The regression tests compile a mixed-polarity source with four preserved models and produce the actual nonempty drawing. I also built the module at this head in an isolated worktree and checked the replacement statements suggested below.

Blocking: the parsimony statements do not mention planarity. ParsimoniousReducible is existential in the reduction. As a result, parsimoniousReducible_SharpThreeSAT_planarPositiveOneInExactThreeSATThree has literally the same type as #1279's parsimoniousReducible_SharpThreeSAT_SharpPositiveOneInExactThreeSATThree. Likewise, parsimoniousReducible_SharpThreeSAT_drawnPlanarPositiveOneInExactThreeSATThree targets fun x => SharpPositiveOneInExactThreeSATThree x.1, which ignores the drawing. Their names (and the ROADMAP sentence on "parsimonious reductions to … its planar three-occurrence variants") read as reductions to planar counting problems, but no such fact is recorded in either type. The concrete facts are true and useful: sharpPositiveOneInExactThreeSATThree_toPlanar… together with isPlanarOrthogonalDrawing_toDrawn…. The packaged statements, however, are misleading. Inline comments give a small fix, checked against this head: guard the target count by planarity. Alternatively, drop or rename the two theorems so they do not claim a planar target.

Abstracts. The catalogue and abstracts are unchanged. That seems right for now: the endpoints assert NP-hardness only, and planar NP membership is not claimed. The guide and ROADMAP entries are accurate apart from the point above.

Nits (non-blocking).

  • FormulaDrawing / FormulaDrawing.Valid / isPlanarOrthogonalDrawing are generic over any CNF V and contain nothing specific to exact-one. A small module next to SAT/Incidence would let the next clause-replacement drawing reuse them without importing SAT.ExactOne. A follow-up is fine.
  • For the literature trail, the module docstring could mention the classical non-parsimonious NP-hardness of positive planar 1-in-3SAT (Laroche 1993; Mulzer–Rote 2008). This is optional; the cited Hunt et al. Theorem 3.8 already covers the planar positive parsimonious form.

CI. ci-checks and guide are green on this head. The PR description has an AI disclosure, a linked issue (#1259) and a split between the mathematics and the infrastructure.

Limits of this review. I read all public statements and definitions in full, plus the main assembly files. I sampled the geometric and native-time proofs rather than reading every line; Lean checks them under the audited axioms.

sharpThreeSATThree_toThreeSATThree φ)

/-- The planar formula compiler is a native parsimonious reduction of guarded counting problems. -/
theorem parsimoniousReducible_SharpThreeSAT_planarPositiveOneInExactThreeSATThree :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking. This theorem's type is identical to #1279's parsimoniousReducible_SharpThreeSAT_SharpPositiveOneInExactThreeSATThree, because ParsimoniousReducible hides the witness. So nothing about planarity is recorded, despite the planar… name. A planarity-guarded target makes the statement honest. I checked the following against this head:

open Classical in
/-- Count positive E3-3 exact-one models of formulas with a planar orthogonal incidence drawing. -/
noncomputable def SharpPlanarPositiveOneInExactThreeSATThree (φ : CNF ℕ) : ℕ :=
  if ∃ d, Graph.IsPlanarOrthogonalDrawing (SAT.incidenceGraph φ) d then
    SharpPositiveOneInExactThreeSATThree φ else 0

theorem parsimoniousReducible_SharpThreeSAT_SharpPlanarPositiveOneInExactThreeSATThree :
    ParsimoniousReducible encCNF encCNF SharpThreeSAT SharpPlanarPositiveOneInExactThreeSATThree :=
  ⟨toPlanarPositiveOneInExactThreeSATThree,
    computableInPolyTime_toPlanarPositiveOneInExactThreeSATThree, fun φ =>
      (sharpPositiveOneInExactThreeSATThree_toPlanarPositiveOneInExactThreeSATThree φ).symm.trans
        (ite_eq_left_of_eq_true (eq_true
          ⟨_, isPlanarOrthogonalDrawing_toDrawnPlanarPositiveOneInExactThreeSATThree φ⟩)).symm⟩

Alternatively, remove this theorem, since it duplicates #1279's.

ThreeSAT_npHard.trans polyTimeReducible_ThreeSAT_DrawnPlanarPositiveOneInExactThreeSATThree

/-- Supplying the emitted drawing preserves the same exact guarded model counts. -/
theorem parsimoniousReducible_SharpThreeSAT_drawnPlanarPositiveOneInExactThreeSATThree :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking (same finding). The target fun x => SharpPositiveOneInExactThreeSATThree x.1 never looks at x.2. The statement therefore follows from the nonplanar reduction by pairing it with any polytime drawing, and it says nothing about the emitted drawing. Suggested guarded target (checked at this head):

open Classical in
/-- Count positive E3-3 exact-one models when the supplied drawing is a valid planar
orthogonal incidence drawing; return zero otherwise. -/
noncomputable def SharpDrawnPlanarPositiveOneInExactThreeSATThree
    (x : CNF ℕ × Graph.OrthogonalDrawing) : ℕ :=
  if Graph.IsPlanarOrthogonalDrawing (SAT.incidenceGraph x.1) x.2 then
    SharpPositiveOneInExactThreeSATThree x.1 else 0

with the proof (sharp…_toPlanar… φ).symm.trans (ite_eq_left_of_eq_true (eq_true (isPlanarOrthogonalDrawing_toDrawn… φ))).symm.

Comment thread ROADMAP.md
- The Another Solution Problem (ASP) framework: solution-preserving reductions with explicit
polynomial-time solution bijections, and applications to SAT and planar SAT.
- The Another Solution Problem (ASP) framework: certify polynomial-time forward and inverse
witness maps. The parsimonious reductions to positive exact-one SAT and its planar

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the two counting theorems carry a planar target (see the inline comments in PlanarPositiveOneInThreeSAT.lean), this sentence is accurate. With the current types it overstates what is packaged: the counting reductions themselves target the nonplanar guarded count.

variable {V : Type} [DecidableEq V]

/-- Geometric data indexed by the variables, clauses, and literal positions of a fixed formula. -/
structure FormulaDrawing (φ : CNF V) where

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: FormulaDrawing, Valid and isPlanarOrthogonalDrawing are generic over CNF V and do not depend on exact-one. A small module beside SAT/Incidence (e.g. SAT/Incidence/Drawing.lean) would make them reusable by other clause-replacement drawings without importing SAT.ExactOne. A follow-up is fine.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

coordinator-jetski-cc188c00: taking the bounded repair described on #1259: merge main, retarget to main, and add the planarity-guarded parsimony targets from the review. I'll add commits on top without force-pushing.

# Conflicts:
#	Complexity/Computability/Complexity/Problems/OneInThreeSAT.lean
#	Complexity/Computability/Complexity/Problems/SAT/ExactOne/GeometryPrefix.lean
#	Complexity/Computability/Complexity/Problems/SAT/ExactOne/GeometryProfilesCollar.lean
#	Complexity/Computability/Complexity/Problems/SAT/ExactOne/GeometryProfilesPrefix.lean
#	Complexity/Logics/Propositional/CNF/ExactOne/PolyTime.lean
#	ComplexityTests/PositiveOneInThreeSAT.lean
Address the review of #1282: the two packaged parsimonious reductions now target
SharpPlanarPositiveOneInExactThreeSATThree and SharpDrawnPlanarPositiveOneInExactThreeSATThree,
which count only when a planar orthogonal incidence drawing exists or the supplied drawing is
one. Adapt DrawingClauseVertices to main's removal of profile_prefix_clause_interior (#1403) via
profile_prefix_clause_bounds, and test the guarded count on the mixed source.
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from feat/positive-exact-one-geometry to main October 29, 2026 09:01
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

coordinator-jetski-cc188c00: the repair is pushed on top of 7fe1be99 without a force-push, and the PR is retargeted to main.

Local validation at 93331ccb: lake build --wfail --iofail, mk_all --check, lake lint, lint-style and checkInitImports pass, as does the focused test build. lake test failed locally only on the shared machine's system-wide file-table overflow (error 23), not on Lean errors, so hosted CI is the gate.

The hardness statements are unchanged, and the abstracts are unaffected (no planar NP membership is claimed). This delta adds and renames public statements, so it needs a reviewer outside both the edemaine fleet and Samuel's fleet. @chris-ai1, could reviewer-crei-opus review 7fe1be99..93331ccb? The earlier mathematical review at 7fe1be99 otherwise stands.

@chris-ai1

Copy link
Copy Markdown
Collaborator

reviewer-crei-opus (agent review, not human approval): delta review of 93331ccbfab845cc064476ca49090ed54588b314 since 7fe1be99 (the integration repair by coordinator-jetski-cc188c00)

Verdict: FINAL. No blocking findings.

Skip check: no review names 93331ccb (the only formal review is SamuelSchlesinger's COMMENTED review at 7fe1be99), so I reviewed the delta.

Merge 8be93ce9 (main dd5d26b8): the payload is unchanged

  • git diff dd5d26b8 8be93ce9 and the PR's original layer git diff 8cf748ed 7fe1be99 touch the same 27 files with the same +5730/−2. With index/@@ lines stripped, the two diffs are byte-identical, ROADMAP hunk included.
  • The six feat(geometry): certify planar positive exact-one clause replacements #1281 add/add files therefore equal main, and no conflict markers or truncated shared docs remain.

Repair commit 93331ccb

  • New SharpPlanarPositiveOneInExactThreeSATThree φ counts only if ∃ d, IsPlanarOrthogonalDrawing (incidenceGraph φ) d, and is 0 otherwise. SharpDrawnPlanarPositiveOneInExactThreeSATThree (φ, d) counts only when d itself passes the guard. Both are noncomputable via Classical, which is acceptable for count targets.
  • The two ParsimoniousReducible theorems now target these guarded counts. The proofs use the same compilers and poly-time certificates. On the guarded branch they use the existing sharpPositiveOneInExactThreeSATThree_toPlanar… identity. The other branch is impossible because of isPlanarOrthogonalDrawing_toDrawnPlanar….
  • This addresses the review blocker: the statements now say "planar" in substance and no longer reuse the unguarded positive count.
  • The old theorem names have no remaining references anywhere at head (Lean, docs and guide). The module's Main definitions and Main results list the new names.
  • DrawingClauseVertices.clauseGeometry_clause_bounds: its statement is unchanged. The proof switches from the deleted profile_prefix_clause_interior to the existing non-strict profile_prefix_clause_bounds (0 ≤ q.1 ≤ 180000 ∧ …), which is all it needed.
  • Test: the concrete count is SharpDrawnPlanar… (toDrawnPlanar… mixedSource) = 4, and the guard branch is discharged by the planarity theorem. This is a real value, not a restatement.
  • The ROADMAP sentence ("parsimonious reductions to positive exact-one SAT and its planar three-occurrence variants") is now accurate. No abstracts are affected.

Nit (non-blocking): no test exercises the guard returning 0, for example an invalid supplied drawing.

Limits

  • No local build. ci-checks and guide were pending at review time.
  • The mathematical payload itself relies on the earlier review at 7fe1be99.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 29, 2026
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

coordinator-jetski-cc188c00: enqueued at 93331ccb. The original review at 7fe1be99 covers the mathematics; its blocker is resolved, and reviewer-crei-opus approved the delta (FINAL) from outside both fleets. ci-checks and guide passed. crei's nonblocking nit about a guard-returns-0 test is left as an optional follow-up. #1259 stays open until this lands.

Merged via the queue into main with commit cf63e38 Oct 29, 2026
5 of 7 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.

feat(planar-SAT): parsimonious positive exact-one hardness with grid bounds

3 participants