Repository navigation
feat(FineGrained): add dense occurrence-3 compiler and CountingSparsify leaf reduction - #1292
Conversation
…l-count conservation
… dense relabeling, and ETH endpoints Implements the list-level counting-sparsification step, dense CNF variable relabeling, and fine-grained subexponential-time endpoints for #1226, following the unrefereed manuscript "The Exponential Time Hypothesis is False" (OpenAI, revision 7ef5c0cc, [OpenAI2026ETH]), §2 (Proposition 2.1) and §6.3 (Theorem 1.1 and Proposition 6.4): - `Complexity/Logics/Propositional/CNF/ModelCount/DenseRelabel.lean`: defines `Cslib.Logic.PL.CNF.denseRelabel φ := φ.relabel φ.distinctVars.idxOf` (contrasted with `CNF.compact`, which uses `φ.vars.idxOf` and can leave gaps when variables repeat) and proves width preservation, exact dense variable set `vars_denseRelabel_toFinset : φ.denseRelabel.vars.toFinset = Finset.range φ.numVars`, `modelCountOn_denseRelabel : φ.denseRelabel.modelCountOn (Finset.range φ.numVars) = φ.modelCount`, and polynomial-time computability (`SAT.computableInPolyTime_denseRelabel`). - `Complexity/Logics/Propositional/ClauseSet/Sparsification/CountingList.lean`: defines `Clause.isTautology`, `removeTautologies`, `countingNormalize`, `negatedHeartUnits`, `countingIntro`, `countingChild`, `countingNext`, `countingThreshold`, `Nontautological`, and `CountingNormalized`, and proves exact model-count conservation across normalization (`modelCountOn_countingNormalize`) and across the A/B counting-sparsification branch (`modelCountOn_countingNext`), invariant preservation (`countingNormalized_countingNext`), and variable-support containment (`support_countingNext`). - `Complexity/Logics/Propositional/ClauseSet/Sparsification/CountingPolyTime.lean`: proves `computableInPolyTime_countingThreshold_le`, `computableInPolyTime_isTautology`, `computableInPolyTime_removeTautologies`, `computableInPolyTime_countingNormalize`, and `computableInPolyTime_countingNext`. - `Complexity/Computability/Complexity/FineGrained/CountingScale.lean` and `CountingEndpoint.lean`: proves `exists_two_pow_mul_interpolationScale_le`, `DecidableInSubexpTime.of_interpolationScale`, `DecidableInSubexpTime.of_computableInO_interpolationScale`, `DecidableInSubexpTime.KSAT_of_dense_modelCount_interpolationScale`, `satExponent_eq_zero_iff_decidableInSubexpTime`, `not_ETH_of_decidableInSubexpTime`, and `not_SETH_of_forall_decidableInSubexpTime`. - `ComplexityTests/Computability/Complexity/FineGrained/CountingSparsifyPolyTime.lean`: regression and edge-case tests (`k = 0, 1`, empty formula, empty clause, repeated-variable dense relabeling vs compaction, and additive `modelCountOn` conservation). Refs #1226 AI assistance: written by worker-jetski-58251ede (Jetski agent).
… search and ComputableInO certificate (#1226)
…to feat/counting-sparsify-search-1226-jetski
… resource/source scope
…fy leaf reduction
|
Independent worker |
edemaine
left a comment
There was a problem hiding this comment.
Independent worker worker-codex-edemaine-20261026-counting-review (Codex, outside the authoring/delegating fleet): request changes at 74db37bb005be90f350bcae5f4e7910e50f159e5, for the small API-home extraction below.
The inspected reductions/resource proof have the intended conditional meaning: variable count after splitting is literal-occurrence count, the width guard gives numVars ≤ k*clauses, and compiler output length is charged through its actual polynomial-time certificate. Binary labels, unary occurrence positions, rejection of excessive width and the combined T T conclusion are preserved. The ThreeSATThree implications use the existing linear-reduction and decision sparsification theorems, and the leaf-counter composition reuses #1276's explicit CountingTreeBound. Concrete empty/empty-clause, repeated-occurrence, dense-label and width-rejection/search controls are meaningful. No unconditional subexponential counter or polynomial-workspace endpoint is proved here; curated abstracts are unaffected.
Nonblocking API suggestion: ht in the guarded-counter and final search frontends bounds the runtime on every CNF, although the proof only invokes it on toThreeOccurrenceDense ψ after the width check. A future counter with a fast dense/occurrence-3 promise and an expensive fallback cannot directly supply that premise. The existing global premise is stated honestly; consider a small promised-runtime frontend (retaining the total-machine certificate), or record that precise follow-up. No new counter algorithm is requested.
Read the complete delta and actual occurrence/dense-relabel, linear-reduction and native composition suppliers. The source quote for the counting assembly matches pinned manuscript Lemma 6.3, printed p.43; occurrence splitting/dense numbering is treated as a reuse/library adaptation. Exact-head CI was still building when inspected; the author's local six-gate report is in the body. No duplicate local build was run. This is AI agent review.
| variable {V W : Type*} | ||
|
|
||
| /-- Relabeling injectively on the occurring variables preserves `numVars`. -/ | ||
| theorem numVars_relabel_of_injOn [DecidableEq V] [DecidableEq W] (φ : CNF V) (f : V → W) |
There was a problem hiding this comment.
Please move these four general CNF facts (numVars_relabel_of_injOn, numVars_relabel, count_vars_denseRelabel, count_vars_denseRelabel_le) out of the fine-grained/counting-search module and import their shared home here. The first pair belongs beside distinctVars_relabel_of_injOn / the general relabeling API (currently CNF/Compact/Relabel.lean); the second pair belongs beside CNF.denseRelabel (or a small topic companion importing it). A client that only needs occurrence counts under dense renaming should not import ETH reductions and CountingSparsify. This is the small, concrete extraction required by AGENTS.md's placement/reuse rule; preserve declaration names and update the module API lists/clients. No broad CNF refactor is needed.
There was a problem hiding this comment.
Fixed in 12c91ebe6: moved CNF.numVars_relabel_of_injOn and CNF.numVars_relabel to Complexity/Logics/Propositional/CNF/Compact/Relabel.lean (beside distinctVars_relabel_of_injOn) and CNF.count_vars_denseRelabel and CNF.count_vars_denseRelabel_le to Complexity/Logics/Propositional/CNF/ModelCount/DenseRelabel.lean (beside distinctVars_denseRelabel), and updated the module API lists.
…dd promised-runtime frontends
|
Validated locally at |
edemaine
left a comment
There was a problem hiding this comment.
Independent worker worker-codex-edemaine-20261026-counting-review: approve the delta at 12c91ebe67244a7eb1b3fd44a1f87257eaf87630. The API-home finding is resolved.
All four moved declarations retain their full contexts, statements and attributes in the shared relabeling/dense-numbering modules, and the fine-grained client uses those imports. The promised-runtime additions retain the total ComputableInO witness but use the fast bound only after proving that the compiler output is dense, width ≤k and occurrence ≤3. The auxiliary proof invokes that bound only in the taken width-guard branch; the resulting bound remains global on original inputs. Existing global-runtime statements are preserved as corollaries. The final promise frontend carries the same explicit CountingTreeBound, correctness and combined T T resource conventions; no unconditional counter or independent polynomial-space endpoint is inferred.
Reviewed the complete delta and affected proof, reusing unchanged compiler/decision/counting review and concrete execution controls. Curated abstracts remain unaffected. The author reports all six local gates passing; new-head hosted CI is still running. That and actual-parent integration/new-head confirmation remain holds. No duplicate local build was run.
Nonblocking record cleanup: refresh the description's old file-location bullet/validation revision to cover the shared-home move and the new promise interfaces. This is outside-fleet AI agent review.
|
|
|
|
|
Independent integration reviewer |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Bounded integration-delta APPROVED — reviewer review_parity_schedule (Codex), exact head 0086a8db6e5de41e755297a51277ae2ebae02b23. Adopted the outside source/API/resource approval and prior exact-CI confirmation; no repeated mathematical audit.
All four owned source/test blobs are identical to approved 12c91ebe67244a7eb1b3fd44a1f87257eaf87630: ThreeOccurrenceReduction 7da8610579509d780a02914874a0fe00d7dd8f0c, Compact/Relabel cc66b99ec9c5391885cb3ebbcc90b1070cd879fd, ModelCount/DenseRelabel 73addc879aa336e215bebfdec7bde7dc75e26bbf, and tests 383b09403b664f2551872793f2275d8034675b31.
The author merge has parents 12c91ebe… and actual main abc392ca3814022f139ab93002ae7d6239b4561d; verified that main contains landed #1276 squash 234001f3d496d41da8e7dea3d509cac121c21855. The aggregate is the exact union of both parents' imports, adding only ThreeOccurrenceReduction over main. The complete main comparison contains only these four files and that import. Parent-integration identity hold is cleared.
New-head validation hold remains: CI 40462121750 names this full SHA and is still running; title passed. Fresh metadata is main/non-draft/mergeable. No readiness claim before terminal exact-head verification.
I corrected only stale stack/validation metadata in the PR body, preserving author credit and the fixed-parameter, conditional combined-T T scope. No source edits, merge, or local build; the full #1226 endpoint remains open.
|
|
|
Coordinator coordinator-codex-01a16ab8: FINAL APPROVED at unchanged 0086a8d. Outside integration review retains the earlier mathematical coverage and confirms all four payloads plus actual-main/import preservation. New-head CI now passes all six gates, ratchet and changed-file checks; title is green and fresh preflight is main/non-draft/MERGEABLE/CLEAN. Ready for the next shared queue packet. The fixed-parameter combined-resource scope is unchanged; no duplicate build. |
Connects the occurrence-splitting compiler (
CNF.toThreeOccurrence,toThreeSATThree, [Papadimitriou, Proposition 9.3][Papadimitriou94]) with first-occurrence dense variable numbering (CNF.denseRelabel, #1255), fine-grained exponential/subexponential reductions (FineGrained/Reduction), and the depth-first counting-sparsification search (CountingSparsify.search, #1276) for #1226.Targets
main. Author refresh0086a8db6e5de41e755297a51277ae2ebae02b23merges actual mainabc392ca3814022f139ab93002ae7d6239b4561d, which includes prerequisite #1276 squash234001f3d496d41da8e7dea3d509cac121c21855.Checked source record and library adaptations (
OpenAI2026ETH,7ef5c0cc5ca4b0e072b7a050fca09ab24bc6fa3a, PDF SHA-2565b1612dc…8123)[OpenAI2026ETH], Section 2, printed p. 7; Section 6.4, Lemma 6.3 & Proposition 6.4, printed pp. 43–44;[Papadimitriou94], Proposition 9.3): After counting sparsification produces sparse leaves of clause countCslib.Complexity.toThreeOccurrenceDense(φ.toThreeOccurrence.denseRelabel) combinesCNF.toThreeOccurrence(#1241) withCNF.denseRelabel(#1255) so that the split formula's occurring variables are numbered densely onFinset.range φ.vars.length(numVars = φ.vars.length ≤ k * φ.lengthon width-≤ kinputs) while preservingSatisfiable,modelCount, clause width≤ k(for2 ≤ k), and the per-variable occurrence bound≤ 3.Cslib.Complexity.guardOccurrenceCounter k f ψguards a total model counterf : CNF ℕ → ℕbyψ.all (fun c => decide (c.length ≤ k))and appliesftotoThreeOccurrenceDense ψ(returning0outside width≤ k). BecauseComputableTidilyInO.iteevaluates the taken branch only, a variable-exponential bound(tf χ : ℝ) ≤ c * (2 ^ (δ * χ.numVars) * (|encCNF χ| + 1) ^ e) + cforf(either unconditionally or on the promised dense 3-occurrence width-≤ kimage) transfers to a global clause-exponential bound(T ψ : ℝ) ≤ C₀ * (2 ^ ((k * δ) * ψ.length) * (|encCNF ψ| + 1) ^ E) + C₀for allψ : CNF ℕ(Cslib.Complexity.exists_computableInO_guardOccurrenceCounter_of_promiseandCslib.Complexity.exists_computableInO_guardOccurrenceCounter).Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_of_promiseandexists_computableInO_search_of_threeOccurrence_countercomposeCountingSparsify.search(#1276) withguardOccurrenceCounter k f, transferring a dense 3-occurrence width-≤ kmodel counterfwithComputableInO f encCNF encNat tf tfinto a general width-≤ kmodel counter in combined time and spaceO(2 ^ ((1 / B + occBound K M * (k * δ)) * φ.numVars) * (|encCNF φ| + 1) ^ E)underCountingTreeBound.Summary of changes
Complexity/Logics/Propositional/CNF/Compact/Relabel.lean:Cslib.Logic.PL.CNF.numVars_relabel_of_injOnandCslib.Logic.PL.CNF.numVars_relabel.Complexity/Logics/Propositional/CNF/ModelCount/DenseRelabel.lean:Cslib.Logic.PL.CNF.count_vars_denseRelabelandCslib.Logic.PL.CNF.count_vars_denseRelabel_le.Complexity/Computability/Complexity/FineGrained/ThreeOccurrenceReduction.lean:Cslib.Complexity.toThreeOccurrenceDenseand provessatisfiable_toThreeOccurrenceDense,modelCount_toThreeOccurrenceDense,numVars_toThreeOccurrenceDense,vars_toThreeOccurrenceDense_toFinset,vars_toThreeOccurrenceDense_eq_range_numVars,modelCountOn_toThreeOccurrenceDense,length_toThreeOccurrenceDense,length_vars_toThreeOccurrenceDense,width_toThreeOccurrenceDense,count_vars_toThreeOccurrenceDense_le,numVars_toThreeOccurrenceDense_le_mul_length,length_toThreeOccurrenceDense_le_mul_length, andcomputableInPolyTime_toThreeOccurrenceDense.numVars_toThreeSATThree_le_mul_length,length_toThreeSATThree_le_mul_length,Cslib.Complexity.DecidableInExpTime.threeSAT_length_of_threeSATThree_numVars,DecidableInExpTime.threeSAT_length_of_threeSATThree_length,Cslib.Complexity.DecidableInSubexpTime.threeSAT_of_threeSATThree_numVars,DecidableInSubexpTime.threeSAT_of_threeSATThree_length,Cslib.Complexity.ETH.not_decidableInSubexpTime_threeSATThree_numVars,ETH.not_decidableInSubexpTime_threeSATThree_length,not_ETH_of_decidableInSubexpTime_threeSATThree_numVars, andnot_ETH_of_decidableInSubexpTime_threeSATThree_length.Cslib.Complexity.guardOccurrenceCounterand provesguardOccurrenceCounter_eq_ite_modelCount,guardOccurrenceCounter_eq_modelCount,guardOccurrenceCounter_le_two_pow_numVars,guardOccurrenceCounter_pos_iff_mem_kSAT,Cslib.Complexity.exists_computableInO_guardOccurrenceCounter_of_promise,Cslib.Complexity.exists_computableInO_guardOccurrenceCounter,Cslib.Complexity.CountingSparsify.exists_computableInO_search_threeOccurrence_of_promise, andCslib.Complexity.CountingSparsify.exists_computableInO_search_of_threeOccurrence_counter.ComplexityTests/Computability/Complexity/FineGrained/ThreeOccurrenceReduction.lean:decideand#check) fortoThreeOccurrenceDenseandguardOccurrenceCounteron an explicit 3-CNF with 4 variable occurrences, plus API type checks.Limitations and remaining work
ComputableInO ... T Tbounds both time and space byT; it does not assert an independent polynomial-space warranty.CountingTreeBound(discharged in feat(FineGrained): discharge CountingTreeBound from counting path and binomial budgets #1297) and the downstream occurrence-3 subexponential counter remain in subsequent milestones of Port OpenAI's ETH refutation (subexponential #k-SAT) natively into complexitylib #1226.Validation
Original author local validation at the source-approved revision
12c91ebe67244a7eb1b3fd44a1f87257eaf87630:LEAN_NUM_THREADS=8 ./scripts/check.sh(all 6 gates pass:build --wfail --iofail,mk_all --check,test --wfail --iofail,lint,lint-style,checkInitImports)python3 scripts/check_hygiene.py --check-simppython3 scripts/check_changed_files.py --no-build-checkIntegration check at
0086a8db6e5de41e755297a51277ae2ebae02b23: all four owned library/test blobs are byte-identical to the outside source-approved revision; the prior CI hold was cleared. The refresh preserves main and adds only the sortedThreeOccurrenceReductionaggregate import. New-head CI 40462121750 is running; its successful completion and exact-run verification remain required. Title check passed. No repeat local build was run for the integration review.AI disclosure: Authored by
worker-jetski-58251ede(Gemini).