ACPOG: A Lean 4 Verified Algebraic Proof System for Exact Model Counting

We present ACPOG (Algebraic Certified Partitioned-Operation Graph), a certificate format and formally verified checker for exact weighted model counts over the Gaussian rationals ā„š(i). A single 92-line specification (Acpog/Syntax.lean) covers #SAT, rational weighted model counting (WMC), and complex algebraic model counting (AMC). The Lean 4 development totals 11,532 implementation lines across 19 files (11,587 lines across all 21 .lean files) built on core Lean v4.19.0 with zero Mathlib or external dependencies. The main theorem Acpog.acpog_sound proves with zero external hypotheses that every accepted certificate establishes the exact weighted count of the input formula. The verified checker implements five rules: raw clause import (R-Import), single-pivot š”½2 affine elimination (R-Affine), local signed linear identities (R-Linear), exact table contraction with a ℤ2 Gauss-sum step (R-Contract), and a non-crossing Pfaffian rule with Valiant's holographic basis change (R-Pfaffian), proved sound from two linear-order stack tests, a fraction-free skew eliminator, and Valiant's Lemma G without Kasteleyn orientations or planar embeddings. We formalize linear-token XOR completeness in Lean and prove on paper that the unmodified five-rule checker already certifies all three tractable classes (š’œ, š’«, ℳ) of the Cai-Fu planar #CSP trichotomy over ā„š(i) in polynomial size, deriving the ℤ4 Gauss sum inside join and marg (alongside a standalone Lean-verified stepGauss4_sound optimization). We establish unconditional exponential separations beyond Tseitin: 2Ī©(√N) on Valiant's triangular grids against d-DNNF, decision-DNNF, MICE, and dense/sparse tensor proof systems, and 2Ī©(n) on unweighted quadratic-parity expander level sets against parity-augmented DNNF[āŠ•] (plus exact 2nāˆ’Ī±(G) for AFF[∨]), while four-rule ACPOG certifies both in O(n(m+n)) steps. Against the compiled Lean binary, 64 end-to-end tests, 24 adversarial Pfaffian forgeries, and 27 affine and DNNF[āŠ•] runs all match expected verdicts. Source code, Lean 4 proofs, and exact verification scripts: https://github.com/dvgyl/subsat and archive DOI 10.5281/zenodo.24689870.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-30
DOI
https://doi.org/10.5281/zenodo.24689867
Primary Topic
Formal Methods in Verification
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

ACPOG: A Lean 4 Verified Algebraic Proof System for Exact Model Counting

Dev D. Goyal
Zenodo (CERN European Organization for Nuclear Research)
Formal Methods in Verification
preprint

ACPOG: A Lean 4 Verified Algebraic Proof System for Exact Model Counting

Dev D. Goyal
preprint en

Abstract

We present ACPOG (Algebraic Certified Partitioned-Operation Graph), a certificate format and formally verified checker for exact weighted model counts over the Gaussian rationals ā„š(i). A single 92-line specification (Acpog/Syntax.lean) covers #SAT, rational weighted model counting (WMC), and complex algebraic model counting (AMC). The Lean 4 development totals 11,532 implementation lines across 19 files (11,587 lines across all 21 .lean files) built on core Lean v4.19.0 with zero Mathlib or external dependencies. The main theorem Acpog.acpog_sound proves with zero external hypotheses that every accepted certificate establishes the exact weighted count of the input formula. The verified checker implements five rules: raw clause import (R-Import), single-pivot š”½2 affine elimination (R-Affine), local signed linear identities (R-Linear), exact table contraction with a ℤ2 Gauss-sum step (R-Contract), and a non-crossing Pfaffian rule with Valiant's holographic basis change (R-Pfaffian), proved sound from two linear-order stack tests, a fraction-free skew eliminator, and Valiant's Lemma G without Kasteleyn orientations or planar embeddings. We formalize linear-token XOR completeness in Lean and prove on paper that the unmodified five-rule checker already certifies all three tractable classes (š’œ, š’«, ℳ) of the Cai-Fu planar #CSP trichotomy over ā„š(i) in polynomial size, deriving the ℤ4 Gauss sum inside join and marg (alongside a standalone Lean-verified stepGauss4_sound optimization). We establish unconditional exponential separations beyond Tseitin: 2Ī©(√N) on Valiant's triangular grids against d-DNNF, decision-DNNF, MICE, and dense/sparse tensor proof systems, and 2Ī©(n) on unweighted quadratic-parity expander level sets against parity-augmented DNNF[āŠ•] (plus exact 2nāˆ’Ī±(G) for AFF[∨]), while four-rule ACPOG certifies both in O(n(m+n)) steps. Against the compiled Lean binary, 64 end-to-end tests, 24 adversarial Pfaffian forgeries, and 27 affine and DNNF[āŠ•] runs all match expected verdicts. Source code, Lean 4 proofs, and exact verification scripts: https://github.com/dvgyl/subsat and archive DOI 10.5281/zenodo.24689870.

Zenodo (CERN European Organization for Nuclear Research)
Formal Methods in Verification
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
ACPOG: A Lean 4 Verified Algebraic Proof System for Exact Model Counting — Dev D. Goyal Ā· Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS