Manuscript Offprint
arXiv:2610.36196count-catcher: Lean Theorems from Model Counting Certificates
Abstract
We present count-catcher, a tool that turns a CPOG certificate of a count by the exact model counter d4 into a Lean theorem that a CNF formula defined in Lean has exactly N models over V variables. With an encoding lemma, this theorem becomes a theorem about the number of combinatorial objects. A CPOG certificate consists of a Boolean circuit equivalent to the formula and a proof of equivalence. count-catcher checks in Lean that the formula implies the circuit (forward check) and the circuit implies the formula (reverse check). For the forward check, irat-catcher streams a refutation through the LRAT checker of Lean's standard library. The reverse check and the validity check of the circuit are computations proved correct in Lean. Lean runs all three checks as compiled code, so the theorem depends on Lean's kernel, compiler and runtime, as does CPOG's verified checker. We combine the theorem with results from Mathlib, for instance with Burnside's lemma to count graphs up to isomorphism. We prove the number of Latin squares of order 8 as a weighted sum of hundreds of certified counts from about eight terabytes of certificates. We turn about half of the 2022 Model Counting Competition formulas into theorems, with the three checks taking about a quarter of the time of CPOG's verified checker. We found that CPOG's unverified checker reported wrong counts, and removed its verified checker's dependence on two unproved lemmas. End to end, a theorem costs about the same as a checked count.
1 Introduction
There are exactly 108,776,032,459,082,956,800 Latin squares of order 8. Numbers like this are established by computation. A common approach is to encode the objects as models of a propositional formula and run an exact model counter. For the Latin squares, the formula has one variable per cell and symbol, and its clauses ensure that every row and column forms a permutation. In Lean, we state the number using the following definition of a Latin square:
def IsLatin {n : N} (L : Fin n → Fin n → Fin n) : Prop := (∀ i, Function.Bijective (L i)) ∧ ∀ j, Function.Bijective fun i => L i j theorem latin8_all : Nat.card {L : Fin 8 → Fin 8 → Fin 8 // IsLatin L} = 108776032459082956800
The first thing we need to prove is an encoding lemma that ensures that the Latin squares are in bijection with the models of the formula. The user provides this lemma. The second thing is the count theorem, that a CNF formula F given as a Lean term has exactly N models over a universe of V variables that contains the variables of F. The following is the soundness theorem of our checker:
theorem checkAll_sound (h : checkAll V F pogStr lratStr N = true) : Fintype.card {a : Fin V → Bool // F.eval (ext a) = true} = N
The listing shows that the hypothesis h says that the checker accepts a certificate, given as the strings pogStr and lratStr, and the part after the colon is the count theorem. So once the checker has accepted, the count theorem follows from the soundness theorem. Here, ext a extends the assignment a of the universe by false on all other variables. From the encoding lemma and the count theorem, we obtain an end-to-end theorem in which the number is verified inside Lean from the definition of the objects to the final number. How to establish such a count theorem at the scale of terabytes of certificates is the subject of this paper.
There is a long history of claims of counts that turned out to be wrong, which emphasizes the importance of machine-checkable proofs. For instance, Sade corrected Norton’s 1939 count of the reduced Latin squares of order 7 in 1948 [41, 44, 45, 36], Berman and Köhler confirmed Church’s 1965 value of Dedekind’s number , the number of monotone Boolean functions of seven variables, against Lunnon’s of 1971 [13, 33, 1], and McKay corrected the 1996 count of the closed knight’s tours of the chessboard a year later [32, 35]. An independent program that checks a certificate excludes such errors only if it is itself correct. In our evaluation (Section 6), cpog-check, the unverified checker of the certificate format CPOG (certified partitioned-operation graphs), reported a wrong count on 7 of 91 certificates.
Model counting, determining the number of models of a propositional formula, is a fundamental #P-complete problem [60]. Exact counters [21] output only the integer of the count, so an error in their search cannot be detected from the output. In certified model counting, the counter or a separate generator also outputs a certificate, which can be checked by an independent checker. CPOG [6, 7] consists of a certificate format for the circuits that counters such as d4 [30] generate, a generator for it, and a checker whose correctness is proved in Lean [39]. Such a correctness theorem for the checker is about the checker's final state. It certifies that if a run ends in the final state, the output count is the count of the parsed DIMACS file (the standard text format of CNF formulas). However, there is no theorem that connects this count to a Lean term or to the combinatorial objects that are counted, like the Latin squares in our example. A different approach is to enumerate the objects and use proof logging in VeriPB and CakePB [34] to obtain theorems in the proof assistant HOL4 about objects. However, enumeration is not a feasible approach if the number of objects is in the order we are considering in this paper.
We present count-catcher, which takes a CNF formula given as a Lean term and returns its model count as a Lean theorem. The user provides the encoding lemma, and our tool exports the formula and runs the exact counter d4 and the CPOG generator. With an untrusted translator, it translates the CPOG certificate into a node table that contains the circuit and an LRAT refutation, which it may shorten. It then writes one line, count_models, into a new Lean theorem file. This line names the theorem, the encoding lemma to apply, the certificate files and the count. When Lean processes this file, it runs a Lean-verified checker on the certificate. Lean then proves the count theorem, an instance of checkAll_sound, and from it and the encoding lemma we obtain the end-to-end theorem, for example latin8_all.
Count theorems can then be used in larger proofs, for instance, to count only up to symmetry. This is made possible by means of Burnside's lemma [22, Chapter 2], which counts objects up to symmetry as the average number of objects that a symmetry fixes. Using this, we can show, for instance, that the number of triangle-free graphs on ten vertices up to isomorphism is a weighted sum of 42 counts of labeled graphs, one for each cycle type (the multiset of cycle lengths) of a permutation of the ten vertices. Here, the count for a cycle type is the number of triangle-free graphs that a permutation of this type fixes. Each of the 42 numbers is a separate model count of a formula. Each count is shown as a theorem with count-catcher. The remainder of the proof uses Burnside's lemma from
Mathlib [51], Lean’s mathematical library, and a decision procedure that checks that the list of cycle types is complete and that the weighted sum gives the claimed number (Section 5.2). We count the Latin squares of order 8 in the same way, as a weighted sum over the cycle types of the second row, which in a reduced square (first row and first column are the identity) is a permutation of the symbols. Counting up to symmetry also allows us to obtain uniqueness results. Up to isomorphism, exactly one graph on 13 vertices has neither a triangle nor five mutually nonadjacent vertices (a (3, 5)-Ramsey graph) [26, 43]. From a count of one isomorphism class, composed of certified counts, we prove in Lean that every such graph is isomorphic to the circulant graph with jumps 1 and 5.
The difficulty is to bring the equality into the logic at the scale of the certificates. Here, is the number of models of over the universe. To use the count as a lemma about the objects, the theorem must be about the formula with its clauses and universe. Unlike unsatisfiability, which is preserved when clauses or variables are added, the count can change with one clause more or one variable more. The certificates of the equality in cases of interest are large. We use one certificate for each cycle type of the second row of the Latin square. These are four for order 7 and seven for order 8. There we split the squares of each cycle type further by three cells of the third row into 737 certificates. For the Latin squares of order 7, the certificates take under a gigabyte in total. For order 8, they take 7.9 TB, with up to 32.7 GB each (Appendix A.1). Certificates of this size are too large for a single proof term, and the kernel cannot process them.
The equality is shown by combining the encoding lemma, one refutation and two computations proved correct in Lean, forming the chain
Here, X denotes the set of objects, for example the Latin squares of order 8, F the formula that encodes them, and P the circuit the certificate is about, with root r, its output node. The circuit P is a POG (partitioned-operation graph), a directed acyclic graph whose leaves are literals and whose inner nodes are products (AND) and sums (OR) (Section 3). Here, denotes the number of assignments of the universe that make the root true, the set of variables below it, and the number of assignments of that make the root true. The first equality is supported by the encoding lemma provided by the user. The second is the forward implication, that every model of F makes r true, together with the reverse implication, that every assignment that makes r true is a model of F. The third is the validity of the POG: the arguments of every product have pairwise disjoint variable sets and the two arguments of every sum are not true together. Under these two conditions we compute its count bottom-up. The fourth is arithmetic. Following CPOG, we call the three checks the forward, the reverse and the validity check.
Checking the reverse implication by evaluating the POG is based on the way it is proposed in SCPOG [8], which extends CPOG to projected counting (models that agree on a given set of variables count once). The forward check requires the verification of one refutation, which proves the forward implication. We shorten it with the translator (Section 4.3) and stream it into Lean by means of lrat-catcher [48]. The validity check and the reverse check are both proved correct in Lean. We compose all in one theorem over the same term, POG and universe. All checks are run by native evaluation, i.e., Lean compiles the checker, executes it, and adds an axiom that the compiled checker returned true. Our trusted base therefore contains, besides the Lean kernel, also the compiler and the runtime. CPOG's verified checker uses the same trusted base.
Our contributions are as follows.
-
Count theorem: we translate a CPOG certificate into a count theorem over a Lean term and its universe. In this theorem, Lean builds everything that is mentioned; the certificate only supplies data that is checked. We test our checker against enumeration on more than twelve million generated and mutated certificates (Section 4.5).
-
Bit-parallel reverse check: we decide the reverse implication with a check, proved correct in Lean, that evaluates 63 clauses at once in the bits of a machine word. It is 4.6 times faster in the median than our Lean implementation of SCPOG's top-down evaluation (Section 4.4). The translator shortens the refutation in three untrusted steps before the forward check (Section 4.3).
-
Counts as lemmas: based on user-provided encoding lemmas, our tool establishes the count, and lemma and count together give an end-to-end theorem. We demonstrate this with compositions by symmetry, such as the Latin squares of order 8, and with single counts, such as Dedekind's number . Four of the single counts are values of sequences of the On-Line Encyclopedia of Integer Sequences (OEIS) [59] that, to our knowledge, have not been listed before (Sections 5 and 6).
-
Evaluation: we compare our tool with CPOG's checkers on the 2022 Model Counting Competition [17] and turn 96 of 180 formulas into theorems, with certificates of up to 33.9 GB. The three checks take about a quarter of the time of CPOG's verified checker (Section 6). We found that cpog-check reports wrong counts, which a fix of one line of its source removes (Appendix A.4), and that CPOG's verified checker depends on two unproved lemmas, a dependency we removed (Section 4.5).
Code and experiments. count-catcher with its Lean proofs, the theorem files, the generators, our two patches of cpog-gen and the scripts behind every table and figure are at https://github.com/leansolving/count-catcher; the Zenodo record 10.5281/zenodo.23304375 archives this tree at the release together with the prebuilt tools for x86-64, the logs and result files of the cluster runs, and the list of the competition formulas with their SHA-256 hashes.
cake_lpr [49] is verified down to machine code and returns a verdict about a parsed file; Subercaseaux et al. [47] record this verdict as an axiom about a Lean term for the empty hexagon number. Lean's bv_decide [5] proves bit-vector goals by checking the SAT solver's LRAT refutation, and lean-smt [37] reconstructs SMT proofs as native Lean proofs. lrat-catcher [48] streams an LRAT refutation through Lean's checker; this way, even refutations of many gigabytes become Lean
Table 1: Checkers for certified model counting and related checkers.
| Checker | A run ends in (about) | Verified statement | Trusted beyond the logic |
|---|---|---|---|
| count-catcher | a Lean theorem (a CNF term; the objects) | for the term ; with an encoding lemma, the number of objects | Lean's compiler and runtime |
| cpog-lean-check [7] | an output count (a parsed file) | the checker's final state implies that the POG is equivalent to the parsed formula and has the computed count | Lean's compiler and runtime; two unproved lemmas (Section 4.5) |
| cpog-check [7] | an output count (a parsed file) | none | the C program |
| SCPOG's checker [8] | an output count (a parsed file) | the formula and the circuit agree on the variables that are not projected away, verified down to machine code | the hardware model of CakeML |
| VeriPB with CakePB [34] | a HOL4 theorem (the objects) | the number of solutions, obtained by enumerating them | the hardware model of CakeML |
theorems. Gallicchio et al. [20] obtain Lean theorems for Keller's conjecture up to dimension five using proof by reflection, that is, by running a checker inside Lean whose correctness is proved, and Kirchweger et al. [28] use Lean's LRAT checker for verified graph search with SAT Modulo Symmetries. All of this work is based on checking refutations.
Sequencelib [38] is a Lean library for more than 25,000 OEIS sequences, containing the first values proved by computation. With count-catcher, we prove single large values of such sequences. Danço et al. [15] count finite algebraic structures up to isomorphism as the models of a formula with complete symmetry breaking. With Burnside's lemma, we count up to symmetry without symmetry breaking, as a sum of counts each of which is a theorem.
3 Background
Formulas and counts. We fix a universe of propositional variables. A CNF formula over the universe is a set of clauses, which Lean and DIMACS files give as a list. The model count of a formula is the number of assignments of the variables that satisfy every clause of [60, 21]. A variable in no clause doubles the count, so the universe is part of the statement; for a benchmark it is the number of variables declared in the DIMACS header. In Lean, the formula has the type CNF Nat of the standard library. Its variables are numbered from 0. The universe consists of the variables . An assignment gives a truth value to every nonnegative integer, not only to the variables of the universe.
Partitioned-operation graphs. The trace of an exhaustive DPLL search with component caching is a circuit in decision-DNNF [23, 16]. The exact counter d4 [30] can write this circuit to a file. Other counters, such as ganak [46], output only the count; SharpSAT-TD [29] has been extended to write the circuit [27]. The compiler Panini [31] writes circuits in the related language CCDD, and tree decision diagrams [10] are a recent canonical language between OBDDs and structured d-DNNF. Bryant et al. [7] represent such circuits as partitioned-operation graphs (POGs). Each inner node is labeled with a fresh variable, its node variable. Our checker reads the POG from the node table (Section 4.1). The ith node is the variable , so the node variables are fresh by construction. The arguments of an inner node are its out-neighbors. The support of a node is the set of input variables below it in the circuit, i.e., for a literal it is its variable and for an inner node it is the union of the supports of its arguments. A POG is valid if the arguments of every product have pairwise disjoint supports and the two arguments of every sum are not true together.

r 6
3 p 4 -1 2 0
6 p 5 1 3 0
9 s 6 4 5 4 7 0
12 a 4 1 0 1 3 0
13 a 5 -1 0 2 6 0
14 a 1 6 0 10 12 0
15 a 6 0 14 11 13 0
d 14 10 12 0
d 13 2 6 0
d 12 1 3 0
d 1 15 5 7 9 0
d 2 15 4 8 9 0
root and declarations
(validity check)
additions
(forward check)
deletions,
not generated
Figure 1: A formula , a POG for it with the counts of its nodes, and its CPOG certificate. The clauses of have the identifiers 1 and 2; the declaration 3 p 4 -1 2 0 introduces the product node 4 of and with the defining clauses 3 to 5, s declares a sum (the two numbers before its 0 are the exclusion hint), r 6 names the root, and an addition a gives the identifier, the clause and, after the first 0, its hints.
For a node , let be the number of assignments of that make true. In a valid POG, a literal has , a product with the set of arguments has , and the sum of and has . The root of the circuit is true under assignments of the universe, which is in the chain (1).
CPOG certificates. A CPOG certificate [6, 7] is a proof that a POG with root r is equivalent to the formula F. Its lines form three groups indicated in Figure 1: (i) the declarations of the nodes and the root, (ii) the additions, and (iii) the deletions. The declarations mention the nodes one by one, each with its Tseitin defining clauses, which are the clauses that make the node variable equivalent to the product or the sum of its arguments. A hint is a list of earlier clauses. If we assume the negation of a new clause and apply unit propagation to the clauses of the hint, then the new clause follows if a conflict is reached. This is exactly the reverse unit propagation (RUP) criterion of LRAT [14]. The declaration of a sum has an exclusion hint: defining clauses from which the checker derives by unit propagation that the two arguments exclude each other. The additions are a proof of the forward implication (F with the defining clauses implies the root). Each added clause has a hint from which it follows by RUP. The last addition is the unit clause of the root. The deletions are a proof of the reverse implication (the circuit implies every clause of F).
Importing refutations into Lean. An LRAT refutation of a formula is a sequence of additions with hints that ends with the empty clause. Irat-catcher [48] turns such a refutation into a Lean theorem (a CNF formula given as a Lean term is unsatisfiable). It runs the verified LRAT checker of Lean's standard library [5] on the refutation and obtains the theorem by means of the checker's soundness lemma, based on native evaluation (Sections 1 and 4.5). Refutations that are too large to be embedded in the Lean file are streamed, i.e., read in blocks during the evaluation.
4 From Certificate to Theorem
The chain (1) from the number of objects to N consists of four equalities. The first is the encoding lemma, which the user provides (Section 5). In this section, we prove the other three: the equivalence of formula and POG (forward and reverse check), the count of the POG (validity check) and the arithmetic that gives N.

Figure 2: From a term to a theorem. Shaded components are untrusted; thick frames are Lean terms and theorems, the double frame the checker, proved sound in Lean and run as native code; the dashed arrow is the path of a formula given as a DIMACS file.
Table 2: The contract of the check. consists of the clauses of , the defining clauses of and the unit clause ; keep mask: Section 4.3, implication masks: Section 4.4.
| Check | Establishes | Built in Lean | Supplied, untrusted | Checked by |
|---|---|---|---|---|
| validity | P is a valid POG with count c(r) | P and r, parsed from the node table | node table: declarations, exclusion hints | one pass over the node table |
| forward | F implies the root (Φ is unsatisfiable) | Φ, from F and P | additions with hints, keep mask | Lean's LRAT checker, run by lrat-catcher |
| reverse | the root implies F | implication masks, from P and F | none | bit-parallel evaluation |
4.1 The Theorem and the Contract
In the count theorem, the formula is the Lean term of type CNF Nat. An encoder is a Lean function that maps a parameter, such as the order of the Latin squares, to a formula . Usually the formula is an encoder applied to a parameter, for example, the encoder for domino tilings applied to a board. The certificate occurs only in the hypothesis of checkAll_sound (for an embedded certificate, as the strings pogStr and lratStr), and not in the count theorem. For a wrong count , the checker rejects and there is no theorem. No file and no parser occur in the count theorem, with one exception. For a formula that exists only as a DIMACS file, is a parser written in Lean applied to the text of the file. The proof does not depend on the correctness of the parser. However, we have to trust the parser when we interpret the theorem as a statement about the benchmark instance in the file.
We show the origin of the certificate in Figure 2. count-catcher exports the term to DIMACS in its clause order, so that clause identifiers agree. d4 compiles the formula into a decision-DNNF, and cpog-gen generates the certificate; we patched cpog-gen to omit the deletions that prove the reverse implication. The translator of count-catcher is an untrusted program that splits the certificate into a node table (containing the declarations) and an LRAT refutation. The translator may shorten the refutation (Section 4.3). The checker starts from the term , not from a file. Consequently, a failure in any of these programs can cause the check to fail, but it cannot lead to a false theorem.
Table 2 states the contract: for each check, what Lean builds itself and what the certificate supplies. All three checks refer to the same POG with root , which is parsed once from the node table. We combine them into the chain (1) with the composition theorem card_models_eq_countRoot. The checker verifies that every variable of satisfies and that the node table states the same number of variables. It also compares with . A small certificate can be embedded in the Lean file and checked by a single native evaluation. For a streamed refutation (Section 3), we prove the forward implication as a separate theorem (Listing 2 in the appendix).
4.2 The Validity Check
With the validity check, we establish that the POG of the node table is valid and represents the computed count (lemma checkPog_sound). In one pass the checker verifies that (i) every node refers only to the V input variables and to earlier nodes, (ii) the arguments of a product have pairwise disjoint supports, and (iii) the two arguments of a sum exclude each other, and it computes the support and the count of every node.
As in CPOG [7], an exclusion hint may reference defining clauses only, and the parser rejects a reference not pointing to a defining clause.
The checker accepts the fragment of CPOG that cpog-gen produces: (i) a sum has two arguments, (ii) a product any number of arguments, (iii) no argument is a negated node, and (iv) the root is a literal of an input variable or an unnegated node. The reverse check tests (iii) and (iv) (Appendix A.5). The constant false is not in the fragment, and cpog-gen does not produce certificates for unsatisfiable formulas. Therefore, we prove a count of zero from an LRAT refutation of F. We do not preprocess. Consequently, variables that appear in no clause stay in the universe, and duplicate clauses, tautologies and repeated literals stay in the formula.
4.3 The Forward Check
Let be the set of all clauses of , the defining clauses of and the unit clause . The forward implication is true if and only if is unsatisfiable (lemma fwd_of_unsat). The additions of the certificate, followed by the empty clause, form an LRAT refutation of .
Lean generates itself from F and the parsed node table. From the refutation file, Lean only reads the additions and their hints. Consequently, the checker accepts a refutation only if it refutes , whatever formula, POG or defining clauses the translator used.
Using the same reasoning, the translator can shorten the refutation. It proceeds in three steps. cpog-gen adds a clause for every unit that it propagates. However, our translator keeps only those additions on which the empty clause depends. We call this trimming. For a streamed refutation, it saves the kept additions in the binary LRAT format. It also saves a keep mask with one bit set for each clause of that a kept addition cites. The checker loads only the marked clauses. A refutation of a subset of is also a refutation of . Lean selects this subset from , which it generated itself. Consequently, the keep mask can only exclude clauses but cannot add clauses. Finally, an addition that is cited only once is inlined, i.e., its hints are copied into the step that cites it, which the translator does only where they propagate there under the checker's rule.
4.4 The Reverse Check
SCPOG omits the deletions (Sections 2 and 3), and its checker evaluates the POG once per clause [8]. We check a batch of 63 clauses at once. For every node, we propagate the set of clauses of the batch that the node implies as the bits of a number below , its implication mask, which Lean’s runtime keeps in one machine word.
A node implies the clause if every assignment of the input variables that makes the node true satisfies . For the fragment that the checker accepts (Section 4.2), we can decide whether a node implies from its arguments in a bottom-up process. A literal of an input variable implies if it occurs in . A product implies if at least one of its arguments does, and a sum if both of its arguments do. If the root implies every clause of , then it implies , which is the reverse implication. The checker skips tautological clauses and it stores an implication mask for every node. It checks the whole batch in one pass over the nodes with one word operation per edge (Algorithm 1 in the appendix). In Figure 1, the products 4 and 5 imply both clauses of , node 4 through and and node 5 through and , so the sum 6 implies both and the check accepts. Node 4 would imply a clause but node 5 would not, so the sum would not either, and the check would reject.
We prove in lemma checkRevKillFast_sound that acceptance implies the reverse implication. The proof is based on the invariant that bit j of the mask of a literal or node is set only if it implies the clause of the batch. We show this by induction over the node table. This is the only implication required for soundness. In the fragment that the checker accepts, the converse is also true: bit j is set whenever the node implies . Consequently, if the root implies F, the reverse check accepts.
4.5 Design Rationale and Trusted Base
Running CPOG’s verified checker [7] inside Lean by reflection would not give the count theorem directly, for two reasons. First, its correctness theorem is about the checker’s final state and the parsed file, not about the Lean term (Section 1). Second, it counts every node over all declared variables [7, 40]. So we would still need to prove that its result is the model count of the formula F over the universe. Therefore, we created a new validity check and reverse check, with a new composition theorem (Section 4.1).
The theorem of count-catcher depends on the Lean kernel, the three standard axioms, and one axiom per native evaluation: one for an embedded certificate, two for a streamed one. Each native evaluation adds an axiom stating that the evaluated Boolean term is true, for example, checkAll V F pogStr lratStr N = true. For a streamed refutation, the term contains a constant of type Nat → Option (Array IntAction). It has no definition in the logic. Only its native implementation runs during the evaluation. For a given i, it returns the ith block of additions of the refutation file. The soundness lemma is true for every function of this type. So, in particular, the file is not trusted. count_models proves the forward implication of a streamed refutation as a separate theorem about the same formula F and the same POG constant, and checkAllAC_sound (Listing 2) takes it as a hypothesis. Our trusted base contains the Lean compiler and runtime (with GMP for large numbers), including the unproved substitutions of library functions by faster ones, and the agreement of the precompiled checker with the definitions that the kernel checks, which Lean does not test at load time (Appendix A.7). This is the same trusted base as used by bv_decide [5]. For a streamed refutation, each theorem has its own constant, so its axiom fixes only the blocks that arrived, and we trust that the native code returns every block exactly once. Mathlib does not admit native evaluation, so our theorems cannot enter Mathlib as they stand, although they use its definitions.
Our proofs establish statements about the Lean definitions of models and model counts. A mistake in these definitions would not show up in the proofs. Therefore, we also test the checker. For every condition of the three checks, we constructed certificates that violate exactly this one. The checker rejected them all. We also ran a differential test on small formulas that compares the checker's verdict with the count obtained by enumeration. Of more than twelve million generated and mutated certificates, the checker accepted only those with a correct count.
We carried out a comparison between our trusted base and that of cpog-lean-check. We observed that its archived build depends on two unproved lemmas of a pinned library. We gave the two lemmas of the checker that use them direct proofs, which removes this dependency and leaves the checker's executable unchanged. We sent these proofs to the authors of cpog-lean-check.
5 Counts as Lemmas
5.1 Encoding Lemmas
With family, we refer to an encoder (Section 4.1) together with the type X of objects, which is defined without a reference to the encoding, and an encoding lemma. The encoding lemma is a Lean lemma that gives a bijection between the models of F over the universe and X. With the lemma card_of_check (card_of_checkAC for a streamed refutation), shared by all families, we obtain Nat.card X = N from .
Our encoders use no auxiliary variables.
Listing 1: The Latin squares of order 7: the first of the four count_models lines and the reduced count (Section 5.2; proof term abbreviated, full file in the artifact); fwd.pog is the node table, fwd.lrat the refutation and fwd.keep the keep mask; the last comment summarizes #print axioms, two native evaluations per streamed fiber.
count_models latin7_fibre0 via (Latin.fibre_card_of_check (n := 7) (r := ![1, 0, 3, 2, 5, 6, 4])) "c0/fwd.pog" "c0/fwd.lrat" (keep := "c0/fwd.keep") (count := 55296) theorem latin7_reduced : Nat.card {L : Fin 7 → Fin 7 → Fin 7 // IsReducedLatin L} = 16942080 := Latin.card_eq_of_classes (by norm_num) 16942080 [(![1, 0, 3, 2, 5, 6, 4], 55296), ...] (List.forall_mem_cons.2 (latin7_fibre0, ...)) ... (by decide +kernel) (by decide +kernel) -- propext, Classical.choice, Quot.sound, and 8 native evaluations
Listing 1 shows the theorem file of the Latin squares of order 7, the order-7 counterpart of latin8_all in Section 1. We contribute the encoder and the encoding lemma. The encoder uses one variable per cell and symbol, exactly-one clauses per cell and, for every symbol, per row and per column, and unit clauses to fix the first row and first column. As guaranteed by the encoding lemma, the models are in bijection with the reduced Latin squares of order 7. We split the reduced squares by their second row into fibers (Section 5.2). For the first fiber, count-catcher is called as
count-catcher latin7_fibre0
--via 'Latin.fibre_card_of_check (n := 7) (r := ![1, 0, 3, 2, 5, 6, 4])'
This call, one per fiber, exports the formula with #export_cnf, runs the pipeline of Figure 2, and writes the count_models line that opens the listing. A Python script of count-catcher then appends the theorem latin7_reduced, which puts the fiber counts together (Section 5.2). No line of the listing is written by hand. If a check fails, count_models reports which check failed and where: the node and the condition for the validity check, the LRAT step for the forward check, and for the reverse check a clause of F that the root does not imply, with an assignment that satisfies the root and falsifies the clause. The encoders do not occur in the theorem statements. The only definitions there not covered by Mathlib are IsLatin (Section 1) and its reduced variant.
For a new family, one is required to write the encoder and the encoding lemma. For instance, these are 499 lines of Lean for the antichains of the OEIS sequence A358391 (Section 6) and 983 for the Latin squares with the lemmas of their fiber split. For the independent sets and perfect matchings of a graph (where the domino tilings of a board are the perfect matchings of its grid graph), the encoder and encoding lemma are generic and work for every graph. For a new instance, we only need to supply the graph.
5.2 Composition by Symmetry
There are 12,172 triangle-free graphs on ten vertices up to isomorphism [55]. Counting up to isomorphism by Burnside's lemma over the cycle types is a standard technique [42] (see [22, Chapter 2]). In our Lean theorem that counts the triangle-free graphs on ten vertices up to isomorphism, every summand is itself a theorem, namely one of the 42 certified counts of Section 1.
Mathlib has no action of vertex permutations on SimpleGraph. We define such an action by relabeling the n vertices, restricted to graphs with an invariant property such as being triangle-free. We prove in Lean that the orbits of this action are exactly the isomorphism classes. Consequently, the number of isomorphism classes equals the number of orbits, which Burnside's lemma computes. Two permutations with the same cycle type fix the same number of graphs. Therefore, we can
Table 3: Theorems about mathematical objects: “Summands” is the number of certified counts in the proof, “Count” the number of objects (for the graphs, of isomorphism classes); for the Latin squares, “Lean” is summed over the certificates and the assembled theorem. : not listed in the OEIS at time of writing.
| Theorem | Summands | Count | Lean (s) |
|---|---|---|---|
| Composition of certified counts | |||
| Triangle-free graphs on 10 vertices, A006785 | 42 | 12,172 | 74.8 |
| Latin squares of order 7 | 4 | 64.0 | |
| Latin squares of order 8 | 737 | 325,252 | |
| One count as an end-to-end theorem | |||
| Dedekind's number | 1 | 88.8 | |
| A358391(6), Kreweras | 1 | 170.5 | |
| A396728(7), Sperner | 1 | 424.6 | |
| A303210(9), total domination | 1 | 145.0 | |
| A303210(10), total domination | 1 | 14.8 | |
| A count as a hypothesis | |||
| The (3, 5)-Ramsey graph on 13 vertices is unique | 113 | 1 | 78.9 |
regroup Mathlib's Burnside sum into one summand per cycle type. Each summand is the number of permutations with the cycle type, which is the class size, times the number of graphs that one of them fixes. However, the list of cycle types in the proof is an untrusted input, like a certificate. Using Lean's decide, we verify that (i) the entries are cycle types of elements and pairwise distinct, (ii) the class sizes add up to , and (iii) the weighted sum is the claimed number of orbits times .
We get the second factor of each summand as a model count, since the permutation of the vertices induces a permutation of the edge variables. The graphs that fixes are the models of the encoding extended by the two binary clauses for , for every variable that moves. We prove this once for any group acting on the variables and on the objects such that the bijection of the encoding lemma commutes with both actions. A separate proof that preserves is not needed. Consequently, each fixed-point count is a separate theorem, where the encoding lemma is instantiated by the cycle type.
For the Latin squares of Listing 1, we group the count of the reduced squares by cycle type in the same way. The number of all squares is times the number of reduced ones. We establish this equality in Lean. The fiber of a second row consists of the reduced squares with that row. This is encoded by the encoder plus one unit clause per cell of the row. Applying the same permutation to the column indices and to the symbols keeps the first row the identity and turns a second row into , which has the same cycle type. If is again a second row, a permutation of the other rows makes the first column the identity again, so the fiber of and the fiber of have the same size. Consequently, the fiber count depends only on the cycle type. For order 8, unit clauses on three cells of the third row split each fiber further, and we prove in Lean that the parts add up to the fiber.
6 Evaluation
For Table 3, we chose well-known problems that need counting rather than enumeration. Dedekind's number was out of reach for d4 in our probes, and for Latin squares of order 7, the generation of one certificate for all reduced squares exceeded 64 GB, so we split by fibers.
Composition of certified counts. The first group of Table 3 consists of the compositions of Section 5.2; the largest is latin8_all of Section 1, assembled from 737 certified counts in 90 hours of Lean time, and we checked the count against the literature [61].
One count as an end-to-end theorem. We state Dedekind's number with Mathlib's Monotone and no definition of our own. The four OEIS values of Section 1 are A358391(6) [57], the antichains of the lattice of noncrossing partitions of a six-element set; A396728(7) [58], the Sperner families on seven elements that contain no set with its complement; and A303210(9) and A303210(10) [56], the total dominating sets of the torus grid. For even n the torus is bipartite and every clause lies within one side, so the formula splits into two independent halves, which makes A303210(10) cheaper than A303210(9). As a check outside our pipeline, which uses d4, we ran the counters ganak [46] and SharpSAT-TD [29] on the same formulas, and both give the same four integers.
A count as a hypothesis. The Ramsey graph of Section 1 is unique, a classical fact [26, 43]. Using certified counts, we show that there is exactly one isomorphism class. The labeled count, the summand of the identity, is itself split by the neighborhood of one vertex into 13 certified counts, hence 113 summands for the 101 cycle types of 13 elements. The count of one is the hypothesis of the uniqueness theorem: with a separate check, we show that Mathlib's circulant graph with jumps 1 and 5 belongs to this class, so every such graph is isomorphic to it.
Setup. For all tables and figures of this section, we ran the pipeline of Figure 2 with the defaults of Section 4 (no deletions, shortened refutation), except where a row or Table 13 states otherwise. The jobs had access to two cores on shared machines of a Slurm cluster; the appendix lists the sources, tools, limits and repetitions of every table and figure (Appendix A.8). We compare with CPOG's checkers, running both in the same job. Since absolute times vary by tens of percent between runs on shared machines, we compare ratios and, when summarizing, medians. Lean refers to the whole Lean process, including the import of Mathlib and the processing of the theorem file. Check is the time of the three checks as count_models reports it. Memory is the largest amount of main memory that the Lean process occupied, of which at most 3.2 GB are Mathlib's compiled files, which Lean loads into memory. We used the public instances of the unweighted and the weighted track of the 2022 Model Counting Competition [17, 18], 100 formulas each. We ignore the weights and count models. Without its weights, each of 20 formulas of the weighted track equals a formula of the unweighted track, so 180 formulas remain. Bryant et al. [7] evaluate CPOG on the same 180 formulas, which allows a direct comparison with their results. We refer to this set of formulas as the competition set. For the 11 instances of four validation families (domino tilings, queens, independent sets of grids and of graphs), we prove the counts in Lean. All these counts agree with the OEIS or with two other counters (Appendix A.2).
Results on the competition set. In the appendix (Table 8), we follow the 180 formulas through the four stages of the pipeline, and 96 become theorems. Of the formulas that do not become theorems, all but one fail in d4 or the generator. Our checker rejects no certificate it receives, but times out on one certificate of 126.9 GB. The generator cpog-gen ran with our two patches (Appendix A.8) and the same time limit of 4,000 s as d4. It derived the refutation from the structure of the POG. With cpog-gen and the unverified checker cpog-check, Bryant et al. [7] verify 111 of the 123 formulas of the set that d4 solves within 4,000 s. Their generator switches to one SAT call per subgraph below a tree-size threshold, and they allow 10,000 s for generation, check and count together. In a rerun of the 26 formulas on which our generator had failed, with a generation limit of 10,000 s, 8 more become theorems, 104 in total (Appendix A.3). Switching to SAT calls as in their generator adds none, and the remaining formulas exceed 10,000 s or 64 GB. On the proved formulas the median Lean process takes 15.7 s, about half of the 30.3 s of generation (d4: 3.5 s); the largest certificate checked has 33.9 GB, the largest count 1,681 decimal digits. These formulas exist only as DIMACS files, so their theorems are about the parsed term of Section 4.1, with a trusted base comparable to that of cpog-lean-check (Section 4.5), and serve only as a scaling test.

certificate size (MB)
| Measured | count-catcher | Verified | Unverified | Ratio | Lower | n |
|---|---|---|---|---|---|---|
| Checks after translation (s) | 4.5 | 22.6 | 4.1 | 0.23 | 91 | 91 |
| Translation and Lean run (s) | 22.3 | 22.6 | 4.1 | 1.2 | 38 | 91 |
| Pipeline after d4 (s) | 54.5 | 88.2 | 65.5 | 0.92 | 55 | 91 |
| Peak memory (GB) | 3.4 | 0.99 | 0.095 | 3.6 | 14 | 91 |
| Checks, unshortened refutation | - | - | - | 0.39 | 91 | 91 |
| Correct count reported | 91 | 91 | 84 | - | - | 91 |
Figure 3: The cost of the theorem against CPOG's checkers on the same d4 outputs. Top: the time of count-catcher over the time of the verified checker per instance, against the size of the full certificate; the line is ratio one. Bottom: medians over the jointly completed runs; "Ratio" is the median per-instance ratio of count-catcher over the verified checker, "Lower" the number of instances on which count-catcher is lower.
Table 4: Medians of the per-instance ratios of count-catcher over cpog-lean-check by the size of the full certificate; is the number of jointly completed runs.
| Certificate size | n | Lean | Check | Memory |
|---|---|---|---|---|
| below 10 MB | 18 | 86 | 0.22 | 37 |
| 10 to 100 MB | 15 | 3.9 | 0.28 | 12 |
| 100 MB to 1 GB | 43 | 0.93 | 0.20 | 2.5 |
| above 1 GB | 15 | 0.34 | 0.22 | 0.53 |
Time and memory against CPOG's checkers. We compare with the two checkers of CPOG [7], the verified cpog-lean-check and the unverified cpog-check in C, on the same d4 outputs. The comparison uses 82 formulas of the competition set, those proved with generation under 600 s, and 9 of the 11 validation instances (without the two largest). The limit, under which the generator's second run for CPOG's checkers fits our time budget, excludes 14 proved formulas. The checkers read the full certificate with its deletions, written by the unpatched generator; count-catcher reads the node table and the refutation that the translator writes from the certificate without deletions. We also measure the total time after d4 has finished, including certificate generation on both pipelines. In the median, the theorem pipeline takes about the same time as the checked-count pipeline (Figure 3).
The runtime is dominated by Lean's start-up. Without it, Check takes about a quarter of cpog-lean-check's time in the median of every size range (Table 4) and is faster on every instance. The forward check takes of Check in the median (89 runs; the validity and reverse checks are timed together). Part of this speed-up is due to the shortened refutation (Section 4.3). In a second run on the same d4 outputs without trimming, keep mask or inlining, Check is still faster than cpog-lean-check on every instance (Figure 3, bottom). We attribute most of the rest to the bit-parallel reverse check, which decides the reverse implication by evaluation instead of checking the deletions (Section 4.4). For the whole Lean process, the start-up dominates below 100 MB of certificate. Above 1 GB, count-catcher
Table 5: Ablation: the median and the range of the factor by which the metric changes without the design choice (above 1: worse); “clauses of loaded” is the percentage of the clauses of that the checker loads with the keep mask. The generation-time factor includes our second patch, applied only to the generator without deletions. The top-down evaluation is our unverified Lean implementation of the strategy of SCPOG’s checker, the sweep per clause our earlier verified reverse check, one bottom-up pass over the POG per clause.
| Design choice | Metric | Instances | Median | Range |
|---|---|---|---|---|
| Deletions left out | certificate bytes | 91 | 2.0 | 1.1–17 |
| generation time | 75 | 1.5 | 0.97–42 | |
| Bit-parallel reverse check | vs. top-down evaluation | 17 | 4.6 | 1.0–17 |
| vs. sweep per clause | 15 | 90 | 41–220 | |
| Trimmed binary refutation | forward check time | 7 | 1.4 | 0.71–1.9 |
| Keep mask | Lean time | 7 | 1.2 | 1.1–1.9 |
| Lean memory | 7 | 1.7 | 1.0–2.0 | |
| clauses of Φ loaded | 7 | 33% | 18–35% | |
| Inlining | forward check time | 7 | 1.7 | 1.1–2.9 |
| translator time | 7 | 0.73 | 0.70–0.88 | |
| All three shortening steps | forward check time | 7 | 3.2 | 1.6–4.2 |
takes about a third of cpog-lean-check's time (Table 4).
Most of the memory is taken by Mathlib. Because of the streaming, the checker's memory does not grow with the refutation size. cpog-lean-check, however, keeps the certificate in memory. Above 1 GB of certificate, the Lean process uses about half of cpog-lean-check's memory, and below that size, it uses more (Table 4). Both checkers accepted every certificate. cpog-lean-check reported the correct count on every one, and cpog-check a wrong count on 7 of them (Figure 3, last row). The reason is a fault in the normalization of rational numbers (Appendix A.4).
Ablation. In Table 5, we measure the effect of each design choice (the instances and how we chose them are in Appendix A.8). Large effects come from leaving the deletions out of the certificate, which halves it in the median, and from the bit-parallel reverse check. lrat-catcher can also check a refutation in the kernel alone, without native evaluation. For the domino board (99 additions), the kernel takes 24 s against 16 ms natively, and on the board it exceeds 64 GB. For larger instances, we thus use native evaluation.
7 Conclusion
We presented count-catcher, a tool that turns a CPOG certificate of an exact model counter into a Lean theorem about the formula as a term. Combined with an encoding lemma, this gives a theorem about a count of objects. The trusted base consists of Lean's kernel with the compiler and runtime that execute the checks. count-catcher accepts any certificate in the fragment of the CPOG format (Section 4.2). So any model counter that produces this format can serve as its front end; currently, this is d4 with cpog-gen. The generator limits which counts we can prove (Table 8 in the appendix) and takes longer for the refutation than d4 for generating the count.
It would be interesting to extend a counter to write the refutation during its search. This would avoid the need for a separate generator. To scale the approach to even larger instances, one could split a count by cubes that the model counter chooses, with the sum proved as for the fibers in Section 5.2. To extend our approach to weighted counts, as used for the equivalence checking of quantum circuits [24], requires changing the validity check and the count theorem. For projected counts, whose circuits SCPOG certifies, one would also need to change the reverse check.
Acknowledgments
The authors used AI assistance for the implementation, for drafting and reviewing the text, and for creating the figures and tables; the authors take full responsibility for the content. Stefan Szeider acknowledges the support of the Austrian Science Fund (FWF), grants 10.55776/COE12 and 10.55776/P36688.
References
[1] Berman, J., Köhler, P.: Cardinalities of finite distributive lattices. Mitt. Math. Sem. Giessen 121, 103–124 (1976), https://oeis.org/A006356/a006356.pdf
[2] Beyersdorff, O., Fichte, J.K., Hecher, M., Hoffmann, T., Kasche, L.: The relative strength of #SAT proof systems. J. Autom. Reason. 70(2), 12 (2026). https://doi.org/10.1007/s10817-026-09757-w
[3] Beyersdorff, O., Hoffmann, T., Kasche, K.: Proof systems that tightly characterise model counting algorithms. Electronic Colloquium on Computational Complexity, Report TR25-127 (2025), https://eccc.weizmann.ac.il/report/2025/127/
[4] Biere, A., Faller, T., Fazekas, K., Fleury, M., Froleyks, N., Pollitt, F.: CaDiCaL 2.0. In: Gurfinkel, A., Ganesh, V. (eds.) Computer Aided Verification - 36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Proceedings, Part I. Lecture Notes in Computer Science, vol. 14681, pp. 133–152. Springer (2024). https://doi.org/10.1007/978-3-031-65627-9_7
[5] Böving, H., Bhat, S., Cicolini, L., Keizer, A.C., Frénot, L., Mohamed, A., Stefanesco, L., Khan, H., Clune, J., Barrett, C.W., Grosser, T.: Interactive bitvector reasoning using verified bit-blasting. Proc. ACM Program. Lang. 9(OOPSLA2), 3259–3285 (2025). https://doi.org/10.1145/3763167
[6] Bryant, R.E., Nawrocki, W., Avigad, J., Heule, M.J.H.: Certified knowledge compilation with application to verified model counting. In: Mahajan, M., Slivovsky, F. (eds.) 26th International Conference on Theory and Applications of Satisfiability Testing, SAT 2023, Alghero, Italy, July 4-8, 2023. LIPIcs, vol. 271, pp. 6:1–6:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2023). https://doi.org/10.4230/LIPICS.SAT.2023.6
[7] Bryant, R.E., Nawrocki, W., Avigad, J., Heule, M.J.H.: Certified knowledge compilation with application to formally verified model counting. J. Artif. Intell. Res. 82, 2057–2099 (2025). https://doi.org/10.1613/JAIR.1.15958
[8] Bryant, R.E., Tan, Y.K., Heule, M.J.H.: Certifying projected knowledge compilation. In: Berg, J., Nordström, J. (eds.) 28th International Conference on Theory and Applications of Satisfiability Testing, SAT 2025, Glasgow, Scotland, August 12-15, 2025. LIPIcs, vol. 341, pp. 8:1–8:22. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2025). https://doi.org/10.4230/LIPICS.SAT.2025.8
[9] Capelli, F.: Knowledge compilation languages as proof systems. In: Janota, M., Lynce, I. (eds.) Theory and Applications of Satisfiability Testing - SAT 2019 - 22nd International Conference, SAT 2019, Lisbon, Portugal, July 9-12, 2019, Proceedings. Lecture Notes in Computer Science, vol. 11628, pp. 90–99. Springer (2019). https://doi.org/10.1007/978-3-030-24258-9_6
[10] Capelli, F., Choi, Y., Mengel, S., Muñoz, M., den Broeck, G.V.: A canonical generalization of OBDD. In: Ignatiev, A., Szeider, S. (eds.) 29th International Conference on Theory and Applications of Satisfiability Testing, SAT 2026. LIPIcs, vol. 377, pp. 10:1–10:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2026). https://doi.org/10.4230/LIPICS.SAT.2026.10
[11] Capelli, F., Lagniez, J., Marquis, P.: Certifying top-down decision-DNNF compilers. In: Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021. pp. 6244–6253. AAAI Press (2021). https://doi.org/10.1609/AAAI.V35I7.16776
[12] Chede, S., Chew, L., Shukla, A.: Circuits, proofs and propositional model counting. In: Barman, S., Lasota, S. (eds.) 44th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2024, Gandhinagar, Gujarat, India, December 16-18, 2024. LIPIcs, vol. 323, pp. 18:1–18:23. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2024). https://doi.org/10.4230/LIPICS.FSTTCS.2024.18
[13] Church, R.: Enumeration by rank of the elements of the free distributive lattice with seven generators. Notices Amer. Math. Soc. 12(6), 724 (1965), https://www.ams.org/journals/notices/196510/196510FullIssue.pdf, abstract 65T-447
[14] Cruz-Filipe, L., Heule, M.J.H., Hunt, Jr., W.A., Kaufmann, M., Schneider-Kamp, P.: Efficient certified RAT verification. In: de Moura, L. (ed.) Automated Deduction - CADE 26 - 26th International Conference on Automated Deduction, Gothenburg, Sweden, August 6-11, 2017, Proceedings. Lecture Notes in Computer Science, vol. 10395, pp. 220–236. Springer (2017). https://doi.org/10.1007/978-3-319-63046-5_14
[15] Danco, M., Janota, M., Codish, M., Araújo, J.J.: Complete symmetry breaking for finite models. In: Walsh, T., Shah, J., Kolter, Z. (eds.) Thirty-Ninth AAAI Conference on Artificial Intelligence, Thirty-Seventh Conference on Innovative Applications of Artificial Intelligence, Fifteenth Symposium on Educational Advances in Artificial Intelligence, AAAI 2025, Philadelphia, PA, USA, February 25 - March 4, 2025. pp. 11194–11202. AAAI Press (2025). https://doi.org/10.1609/AAAI.V39I11.33217
[16] Darwiche, A., Marquis, P.: A knowledge compilation map. J. Artif. Intell. Res. 17, 229–264 (2002). https://doi.org/10.1613/JAIR.989
[17] Fichte, J.K., Hecher, M.: Model Counting Competition 2022: Competition instances. Zenodo dataset (2023). https://doi.org/10.5281/zenodo.10012860
[18] Fichte, J.K., Hecher, M.: The model counting competitions 2021–2023. Artif. Intell. 360, 104605 (2026). https://doi.org/10.1016/J.ARTINT.2026.104605
[19] Fichte, J.K., Hecher, M., Roland, V.: Proofs for propositional model counting. In: Meel, K.S., Strichman, O. (eds.) 25th International Conference on Theory and Applications of Satisfiability Testing, SAT 2022, Haifa, Israel, August 2-5, 2022. LIPIcs, vol. 236, pp. 30:1–30:24. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2022). https://doi.org/10.4230/LIPICS.SAT.2022.30
[20] Gallicchio, J., Codel, C.R., Avigad, J., Heule, M.J.H.: An end-to-end verification of Keller's conjecture. In: Komendantskaya, E., Nipkow, T. (eds.) 17th International Conference on Interactive Theorem Proving, ITP 2026, Lisbon, Portugal, July 26-29, 2026. LIPIcs, vol. 382, pp. 26:1–26:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2026). https://doi.org/10.4230/LIPICS.ITP.2026.26
[21] Gomes, C.P., Sabharwal, A., Selman, B.: Model counting. In: Biere, A., Heule, M., van Maaren, H., Walsh, T. (eds.) Handbook of Satisfiability - Second Edition, Frontiers in Artificial Intelligence and Applications, vol. 336, pp. 993–1014. IOS Press (2021). https://doi.org/10.3233/FAIA201009
[22] Harary, F., Palmer, E.M.: Graphical Enumeration. Academic Press, New York and London (1973)
[23] Huang, J., Darwiche, A.: The language of search. J. Artif. Intell. Res. 29, 191–219 (2007). https://doi.org/10.1613/JAIR.2097
[24] Huang, W., Chareton, C., Chen, Y., Chung, K., Hsieh, M., Laarman, A., Mei, J.: Equivalence checking of quantum circuits via path-sum and weighted model counting. In: Junges, S., Katz, G. (eds.) Tools and Algorithms for the Construction and Analysis of Systems - 32nd International Conference, TACAS 2026, Held as Part of the International Joint Conferences on Theory and Practice of Software, ETAPS 2026, Turin, Italy, April 11-16, 2026, Proceedings, Part II. Lecture Notes in Computer Science, vol. 16506, pp. 419–439. Springer (2026). https://doi.org/10.1007/978-3-032-22749-2_21
[25] Johnson, D.S., Trick, M.A. (eds.): Cliques, Coloring, and Satisfiability, Proceedings of a DIMACS Workshop, New Brunswick, New Jersey, USA, October 11-13, 1993, DIMACS Series in Discrete Mathematics and Theoretical Computer Science, vol. 26. DIMACS/AMS (1996). https://doi.org/10.1090/DIMACS/026
[26] Kéry, G.: Ramsey egy gráfelméleti tételéről. Matematikai Lapok 15, 204–224 (1964), in Hungarian
[27] Kiesel, R., Eiter, T.: Knowledge compilation and more with SharpSAT-TD. In: Marquis, P., Son, T.C., Kern-Isberner, G. (eds.) Proceedings of the 20th International Conference on Principles of Knowledge Representation and Reasoning, KR 2023, Rhodes, Greece, September 2-8, 2023. pp. 406–416 (2023). https://doi.org/10.24963/KR.2023/40
[28] Kirchweger, M., Manrique, P., Szeider, S.: Formally verified graph generation with SAT modulo symmetries and Lean. In: Biere, A., Lutz, C., Negri, S. (eds.) Automated Reasoning - 13th International Joint Conference, IJCAR 2026, Lisbon, Portugal, July 26-29, 2026, Proceedings, Part I. Lecture Notes in Computer Science, vol. 16688, pp. 117–135. Springer (2026). https://doi.org/10.1007/978-3-032-32589-1_8
[29] Korhonen, T., Järvisalo, M.: Integrating tree decompositions into decision heuristics of propositional model counters (short paper). In: Michel, L.D. (ed.) 27th International Conference on Principles and Practice of Constraint Programming, CP 2021, Montpellier, France (Virtual Conference), October 25-29, 2021. LIPIcs, vol. 210, pp. 8:1–8:11. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021). https://doi.org/10.4230/LIPICS.CP.2021.8
[30] Lagniez, J., Marquis, P.: An improved decision-DNNF compiler. In: Sierra, C. (ed.) Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017. pp. 667–673. ijcai.org (2017). https://doi.org/10.24963/IJCAI.2017/93
[31] Lai, Y., Meel, K.S., Yap, R.H.C.: Panini: An efficient and flexible knowledge compiler. In: Piskac, R., Rakamarić, Z. (eds.) Computer Aided Verification - 37th International Conference, CAV 2025, Zagreb, Croatia, July 23-25, 2025, Proceedings, Part III. Lecture Notes in Computer Science, vol. 15933, pp. 92–105. Springer (2025). https://doi.org/10.1007/978-3-031-98682-6_6
[32] Löbbing, M., Wegener, I.: The number of knight's tours equals 33,439,123,484,294 — counting with binary decision diagrams. Electron. J. Comb. 3(1), R5 (1996). https://doi.org/10.37236/1229
[33] Lunnon, W.F.: The IU function: The size of a free distributive lattice. In: Welsh, D.J.A. (ed.) Combinatorial Mathematics and its Applications, pp. 173–181. Academic Press, London (1971)
[34] McCreesh, C., Nordström, J., Oertel, A., Tan, Y.K.: Proof logging for projected enumeration (and counting?) problems in VeriPB. In: Beldiceanu, N. (ed.) 32nd International Conference on Principles and Practice of Constraint Programming, CP 2026, Lisbon, Portugal, July 20-23,
- LIPIcs, vol. 379, pp. 43:1–43:21. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2026). https://doi.org/10.4230/LIPICS.CP.2026.43
[35] McKay, B.D.: Knight’s tours of an chessboard. Tech. Rep. TR-CS-97-03, Department of Computer Science, Australian National University (1997), https://oeis.org/A001230/a001230.pdf
[36] McKay, B.D., Wanless, I.M.: On the number of Latin squares. Ann. Comb. 9(3), 335–344 (2005). https://doi.org/10.1007/s00026-005-0261-7
[37] Mohamed, A., Mascarenhas, T., Khan, H., Barbosa, H., Reynolds, A., Qian, Y., Tinelli, C., Barrett, C.W.: lean-smt: An SMT tactic for discharging proof goals in Lean. In: Piskac, R., Rakamaric, Z. (eds.) Computer Aided Verification - 37th International Conference, CAV 2025, Zagreb, Croatia, July 23-25, 2025, Proceedings, Part III. Lecture Notes in Computer Science, vol. 15933, pp. 197–212. Springer (2025). https://doi.org/10.1007/978-3-031-98682-6_11
[38] Moreira, W., Stubbs, J.: Sequencelib: A computational platform for formalizing the OEIS in Lean. CoRR abs/2601.11757 (2026). https://doi.org/10.48550/ARXIV.2601.11757
[39] de Moura, L., Ullrich, S.: The Lean 4 theorem prover and programming language. In: Platzer, A., Sutcliffe, G. (eds.) Automated Deduction - CADE 28 - 28th International Conference on Automated Deduction, Virtual Event, July 12-15, 2021, Proceedings. Lecture Notes in Computer Science, vol. 12699, pp. 625–635. Springer (2021). https://doi.org/10.1007/978-3-030-79876-5_37
[40] Nawrocki, W.: Three certificates in computer-assisted mathematics: empty hexagons, model counting, and categorical semantics. Ph.D. thesis, Carnegie Mellon University, Department of Philosophy, Pittsburgh, PA, USA (2026), https://voidma.in/assets/papers/2026nawrocki_three_certificates_computer_assisted_mathematics_empty_hexagons_model_counting_categorical_semantics.pdf
[41] Norton, H.W.: The squares. Annals of Eugenics 9(3), 269–307 (1939). https://doi.org/10.1111/j.1469-1809.1939.tb02214.x
[42] Pólya, G.: Kombinatorische Anzahlbestimmungen für Gruppen, Graphen und chemische Verbindungen. Acta Math. 68, 145–254 (1937). https://doi.org/10.1007/BF02546665
[43] Radziszowski, S.P.: Small Ramsey numbers. Electron. J. Comb. Dynamic Survey DS1 (2026). https://doi.org/10.37236/21, revision 18 of April 24, 2026
[44] Sade, A.: Énumération des carrés latins. Application au 7ème ordre. Conjectures pour les ordres supérieurs. Privately published, Marseille, 8 pp. (1948)
[45] Sade, A.: An omission in Norton’s list of squares. Ann. Math. Statist. 22(2), 306–307 (1951). https://doi.org/10.1214/aoms/1177729654
[46] Sharma, S., Roy, S., Soos, M., Meel, K.S.: GANAK: A scalable probabilistic exact model counter. In: Kraus, S. (ed.) Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019. pp. 1169–1176. ijcai.org (2019). https://doi.org/10.24963/IJCAI.2019/163
[47] Subercaseaux, B., Nawrocki, W., Gallicchio, J., Codel, C.R., Carneiro, M., Heule, M.J.H.: Formal verification of the empty hexagon number. In: Bertot, Y., Kutsia, T., Norrish, M. (eds.) 15th International Conference on Interactive Theorem Proving, ITP 2024, Tbilisi, Georgia, September 9-14, 2024. LIPIcs, vol. 309, pp. 35:1–35:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2024). https://doi.org/10.4230/LIPICS.ITP.2024.35
[48] Szeider, S.: Streaming LRAT certificates into Lean theorems. CoRR abs/2607.00815 (2026). https://doi.org/10.48550/ARXIV.2607.00815
[49] Tan, Y.K., Heule, M.J.H., Myreen, M.O.: cake_lpr: Verified propagation redundancy checking in CakeML. In: Groote, J.F., Larsen, K.G. (eds.) Tools and Algorithms for the Construction and Analysis of Systems - 27th International Conference, TACAS 2021, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021, Luxembourg City, Luxembourg, March 27 - April 1, 2021, Proceedings, Part II. Lecture Notes in Computer Science, vol. 12652, pp. 223–241. Springer (2021). https://doi.org/10.1007/978-3-030-72013-1_12
[50] Tan, Y.K., Yang, J., Soos, M., Myreen, M.O., Meel, K.S.: Formally certified approximate model counting. In: Gurfinkel, A., Ganesh, V. (eds.) Computer Aided Verification - 36th International Conference, CAV 2024, Montreal, QC, Canada, July 24-27, 2024, Proceedings, Part I. Lecture Notes in Computer Science, vol. 14681, pp. 153–177. Springer (2024). https://doi.org/10.1007/978-3-031-65627-9_8
[51] The mathlib Community: The Lean mathematical library. In: Blanchette, J., Hritcu, C. (eds.) Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2020, New Orleans, LA, USA, January 20-21, 2020. pp. 367–381. ACM (2020). https://doi.org/10.1145/3372885.3373824
[52] The OEIS Foundation Inc.: Sequence A000170: Number of ways of placing n nonattacking queens on an board. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A000170
[53] The OEIS Foundation Inc.: Sequence A004003: Number of domino tilings (or dimer coverings) of a square. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A004003
[54] The OEIS Foundation Inc.: Sequence A006506: Number of binary matrices with no 2 adjacent 1's; also number of independent vertex sets in an grid. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A006506
[55] The OEIS Foundation Inc.: Sequence A006785: Number of triangle-free graphs on n vertices. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A006785
[56] The OEIS Foundation Inc.: Sequence A303210: Number of total dominating sets in the torus grid graph. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A303210
[57] The OEIS Foundation Inc.: Sequence A358391: The number of antichains in the Kreweras lattice of non-crossing set partitions of an n-element set. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A358391
[58] The OEIS Foundation Inc.: Sequence A396728: Number of antichains of subsets of an n-element set (Sperner families) that do not contain both a set and its complement. The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org/A396728
[59] The OEIS Foundation Inc.: The On-Line Encyclopedia of Integer Sequences (2026), https://oeis.org
[60] Valiant, L.G.: The complexity of enumeration and reliability problems. SIAM J. Comput. 8(3), 410–421 (1979). https://doi.org/10.1137/0208032
[61] Wells, M.B.: The number of Latin squares of order eight. J. Comb. Theory 3(1), 98–99 (1967). https://doi.org/10.1016/S0021-9800(67)80021-8
[62] Wetzler, N., Heule, M., Hunt, Jr., W.A.: DRAT-trim: Efficient checking and trimming using expressive clausal proofs. In: Sinz, C., Egly, U. (eds.) Theory and Applications of Satisfiability Testing - SAT 2014 - 17th International Conference, Held as Part of the Vienna Summer of Logic, VSL 2014, Vienna, Austria, July 14-17, 2014. Proceedings. Lecture Notes in Computer Science, vol. 8561, pp. 422–429. Springer (2014). https://doi.org/10.1007/978-3-319-09284-3_31
A Additional Tables and Full Statements
A.1 Resources of the Theorems about Mathematical Objects
In Table 6 we give the resources of the theorems of Table 3. For the Latin squares we ran one Lean process per certificate and one for the assembled theorem, and we report the largest peak memory of these processes. The largest certificate of order 8 has 32.7 GB.
Table 6: Resources of the theorems of Table 3, in the same groups. “Summands” is the number of certified counts, as in Table 3. “Size” is the total size of the certificates in GB as written by the patched cpog-gen without deletions; for a count of zero it is the size of the LRAT refutation. “d4” is the time of d4 and “Gen.” the time of cpog-gen (for a count of zero, of the SAT solver that refutes the formula), in seconds and summed over the certificates. “Lean” is the Lean time in seconds as in Table 3. “Mem.” is the peak memory of the Lean process in GB, the largest one if there are several. “Axioms” is the number of native-evaluation axioms that #print axioms lists for the theorem: one per embedded and two per streamed certificate.
| Theorem | Summands | Size | d4 | Gen. | Lean | Mem. | Axioms |
|---|---|---|---|---|---|---|---|
| Composition of certified counts | |||||||
| Triangle-free graphs | 42 | 2.3 | 25.7 | 80.8 | 74.8 | 9.2 | 44 |
| Latin squares, order 7 | 4 | 0.70 | 3.8 | 26.6 | 64.0 | 3.9 | 8 |
| Latin squares, order 8 | 737 | 7,929 | 36,376 | 486,490 | 325,252 | 21.6 | 1,474 |
| One count as an end-to-end theorem | |||||||
| Dedekind's M(7) | 1 | 1.7 | 26.2 | 116.9 | 88.8 | 9.3 | 2 |
| A358391(6) | 1 | 2.9 | 62.7 | 206.7 | 170.5 | 13.4 | 2 |
| A396728(7) | 1 | 7.2 | 63.7 | 271.8 | 424.6 | 18.2 | 2 |
| A303210(9) | 1 | 4.3 | 47.6 | 167.2 | 145.0 | 11.8 | 2 |
| A303210(10) | 1 | 0.24 | 3.3 | 9.0 | 14.8 | 3.9 | 2 |
| A count as a hypothesis(3, 5)-Ramsey graph | |||||||
| 113 | 3.4 | 30.3 | 660.5 | 78.9 | 5.4 | 115 | |
A.2 Validation Families
In Table 7 we list the instances of the validation families of Section 6 with their counts and the resources of the pipeline, and we prove each count as a theorem about the objects with a streamed refutation. The counts agree with the sequences A004003 (domino tilings), A000170 (queens) and A006506 (independent sets of grids) of the OEIS [53, 52, 54]; for the graphs, the counters ganak [46] and SharpSAT-TD [29] give the same counts. The graphs games120 and homer are graph coloring benchmarks of the DIMACS challenge [25], and we generated the cubic graphs at random with a fixed seed.
A.3 The Competition Set
Bryant et al. [7] report that d4 completes 123 of the 180 formulas within 4,000 s. They report further that their toolchain fully verifies 111 of the 123, using the unverified checker cpog-check and a limit
Table 7: The validation families by instance: the number of objects, the size of the certificate in MB as written by the patched cpog-gen without deletions, the generation (“Gen.”) and the Lean time in seconds, and the peak memory (“Mem.”) of the Lean process in GB.
| Instance | Count | Size | Gen. | Lean | Mem. |
|---|---|---|---|---|---|
| Domino tilings | |||||
| 12 × 12 board | 500.1 | 225.4 | 20.1 | 3.6 | |
| Queens | |||||
| n = 12 | 14,200 | 406.3 | 73.9 | 12.9 | 3.5 |
| n = 13 | 73,712 | 2,846 | 461.2 | 56.0 | 4.5 |
| n = 14 | 365,596 | 18,194 | 2,741 | 302.5 | 9.3 |
| Independent sets of grids | |||||
| 14 × 14 grid | 327.9 | 36.4 | 23.1 | 5.0 | |
| 16 × 16 grid | 3,549 | 421.8 | 136.7 | 20.8 | |
| Independent sets of graphs | |||||
| hypercube , 64 vertices | 68.1 | 3.7 | 11.9 | 3.5 | |
| random cubic, 100 vertices | 117.8 | 11.2 | 12.8 | 4.0 | |
| random cubic, 120 vertices | 1,076 | 101.6 | 39.7 | 8.3 | |
| games120, 120 vertices | 860.6 | 88.3 | 43.1 | 7.5 | |
| homer, 561 vertices | 32.7 | 6.2 | 12.4 | 3.4 | |
of 10,000 s for generation, check and count together. They run their other experiments on the 90 formulas on which d4 takes under 1,000 s and whose POG has at most defining clauses. In Table 8 we count the formulas by stage and outcome, and in Table 9 we name those that did not become theorems (track1 is the unweighted track, track2 the weighted one).
Table 8: The formulas of the competition set by pipeline stage: the formulas that reached each stage and their outcomes, with the time limit of the stage and 64 GB of memory throughout. Only the checker can reject, and “Passed” on its row means proved.
| Stage | Reached | Rejected | Timeout | Out of memory | Crash | Passed |
|---|---|---|---|---|---|---|
| d4 (4,000 s) | 180 | - | 57 | 0 | 0 | 123 |
| Generation (4,000 s) | 123 | - | 22 | 4 | 0 | 97 |
| Translation (4,000 s) | 97 | - | 0 | 0 | 0 | 97 |
| Lean, theorem stage (3,600 s) | 97 | 0 | 1 | 0 | 0 | 96 |
cpog-gen failed on 26 formulas. Of the 25 for which it wrote the POG before it failed, 20 have a POG with more than defining clauses. On the four that exceeded the memory limit, d4 took more than 2,800 s. In a rerun on 2026-10-11 with a generation limit of 10,000 s, 10 of the 26 formulas generate a certificate, and 8 become theorems within the Lean limit of 3,600 s (all 10 with 10,000 s). We also ran each formula with one SAT call per subgraph below tree size , as Bryant et al. describe their generator. This mode succeeded only where the structural mode did. The four formulas that exceeded 64 GB fail also with 128 GB.
A.4 The Smallest Miscount of cpog-check
Of the 91 certificates of the comparison with CPOG's checkers, cpog-check reported a wrong count on 7 (Figure 3). The one with the smallest count is the instance “random cubic, 100 vertices” of Table 7. On it, cpog-check reported 8,281,581,627,129,036,755, while we prove 8,281,581,627,129,350,099, the count that d4 and cpog-lean-check also give. cpog-check computes every count with rational numbers whose denominators are products of powers of 2 and 5. The fault is in the normalization of
Table 9: The formulas of the competition set that did not become theorems, by the stage and the outcome of Table 8; is the number of formulas.
| Stage | Outcome | n | Formulas |
|---|---|---|---|
| d4 | timeout | 57 | track1_001, track1_003, track1_061, track1_067, track1_085, track1_105, track1_111, track1_115, track1_131, track1_137, track1_139, track1_159, track1_161, track1_163, track1_165, track1_169, track1_173, track1_175, track1_177, track1_179, track1_181, track1_183, track1_185, track1_187, track1_189, track1_191, track1_193, track1_195, track1_197, track1_199, track2_003, track2_065, track2_069, track2_071, track2_075, track2_083, track2_099, track2_105, track2_113, track2_135, track2_141, track2_145, track2_151, track2_153, track2_157, track2_163, track2_171, track2_173, track2_175, track2_177, track2_181, track2_185, track2_187, track2_189, track2_191, track2_193, track2_195 |
| Generation | timeout | 22 | track1_053, track1_071, track1_075, track1_089, track1_099, track1_107, track1_119, track1_123, track1_125, track1_127, track1_129, track1_143, track1_147, track1_155, track2_001, track2_055, track2_059, track2_119, track2_129, track2_161, track2_179, track2_199 |
| Generation | out of memory | 4 | track1_151, track2_123, track2_143, track2_169 |
| Lean | timeout | 1 | track1_083 |
these numbers (the source file q25.c). The normalization divides a number by the largest power of 2 or 5 that divides its lowest digit in base , which need not divide the number, and discards the remainder. We changed one line so that the power is at most the ninth. With this change, cpog-check reported the correct count on every certificate we retested, among them the 7. We reported the fault to the developers of CPOG with the one-line fix (issue 3 of github.com/rebryant/cpog).
A.5 Constructed Certificates and the Differential Test
For the tests of Section 4.5 we count in Table 10 the certificates that the checker rejected, by the first condition that fails. The condition of the fragment of Section 4.2 that neither an argument nor the root is a negated node is tested by the reverse check and not by the validity check, since the implication masks of the reverse check are defined for such POGs only. For the differential test, d4 and the patched cpog-gen generated certificates from small formulas, and we mutated each in one place. We checked them with the refutation in text format (embedded and streamed) and with the defaults of Section 4 (trimming, keep mask, inlining and the binary format), in a run of 2026-10-07 on the code of the artifact (Table 13). Every certificate that the checker accepted has the count we obtain by enumeration.
A.6 The Bit-Parallel Reverse Check
Algorithm 1 is the reverse check of Section 4.4 for one batch of clauses, as the checker executes it.
A.7 Soundness Theorems
In Listing 2 we state the soundness theorems of Section 4 as they appear in the sources, and #print axioms lists only propositional extensionality, choice and quotient soundness for each of them. The checker and the LRAT checker are precompiled libraries, loaded as plugins; we build the definitions the kernel checks and their C code from the same source in one build, and Lean does not check at load time that the two agree.
Table 10: Certificates rejected by the checker, counted at the first condition that fails. The rows are in the order in which the checker tests the conditions, with the reverse check before the forward check. The rows “universe” are the two conditions on the universe that the checker tests before the three checks (Section 4.1). “Constructed” are the certificates we built by hand, one or more per condition that violate it, and valid certificates of edge cases (an empty formula, no variables, tautologies only). “Generated” are the certificates of the differential test on small formulas, unmutated or with one mutation each; we do not count the mutants that the translator rejected. In the last two rows we count the accepted certificates and all certificates.
| Check | Condition | Constructed | Generated |
|---|---|---|---|
| universe | every variable of lies in the universe | 1 | 0 |
| the node table is over the variables of the theorem | 1 | 0 | |
| validity | every argument is an earlier variable | 2 | 2 |
| the arguments of a product have disjoint supports | 3 | 739,166 | |
| every exclusion hint cites a defining clause of an earlier node | 1 | 31,246 | |
| the exclusion of a sum follows by unit propagation from its hints | 3 | 1,475,770 | |
| the root is declared | 1 | 0 | |
| reverse | neither an argument nor the root is a negated node | 4 | 542,892 |
| the root implies every clause of that is not a tautology | 4 | 2,493,640 | |
| forward | the refutation is well-formed LRAT | 1 | 296,388 |
| every addition follows from its hints by unit propagation, and the last is the empty clause | 3 | 5,010,365 | |
| accepted, each with the count that enumeration gives | 22 | 1,553,855 | |
| total | 46 | 12,143,324 | |
Algorithm 1 The reverse check for one batch of clauses . Implication masks are nonnegative integers read as bit sets. For an argument , is if is a literal of an input variable and if is a node.
Require: nodes in the order of their declaration, root , array with all entries 0 1: for all and literals of do 2: for do 3: if is a product with the set of arguments then bitwise or of for 4: if is a sum of and then ▷ invariant: if bit of is set, then implies , for every literal and every node seen so far 5: bit of is set for every with not tautological 6: for all and literals of do 7: return
Listing 2: The soundness theorems of Section 4 as stated in the sources (proofs omitted): the validity check, the forward implication from a refutation, the reverse check, the composition over one POG, the soundness of the whole check for an embedded and for a streamed refutation, the lemma of the keep mask, the soundness of lrat-catcher's streamed checker, which quantifies over every feed (the function that delivers the refutation in blocks), and the generic family lemma for a streamed refutation, which the fiber lemma behind Listing 1 instantiates. WF is validity, CnfWF the condition that every variable of lies in the universe, countRoot the number , and fwdCnf and fwdCnfOf are , from the parsed POG and from the certificate text.
theorem checkPog_sound {c : PogCert} {N : Nat} (h : checkPog c = some N) : c.pog.WF ∧ c.root.1 < c.pog.numVars ∧ N = c.pog.countRoot c.root
theorem fwd_of_unsat {F : CNF Nat} {P : Pog} {r : Literal Nat} (h : (fwdCnf F P r).Unsat) : Fwd F P r
theorem checkRevKillFast_sound {P : Pog} (hP : P.WF) {F : CNF Nat} {r : Literal Nat} (hr : r.1 < P.numVars) (h : checkRevKillFast P.V P F r = true) : RevEval F P r
theorem card_models_eq_countRoot {V : N} {F : CNF N} {P : Pog} (hF : CnfWF V F) (hP : P.WF) (hV : P.V = V) {r : Literal N} (hr : r.1 < P.numVars) (fwd : Fwd F P r) (rev : RevEval F P r) : Fintype.card {a : Fin V → Bool // F.eval (ext a) = true} = P.countRoot r
theorem checkAll_sound {V : Nat} {F : CNF Nat} {pogStr lratStr : String} {N : Nat} (h : checkAll V F pogStr lratStr N = true) : Fintype.card {a : Fin V → Bool // F.eval (ext a) = true} = N
theorem checkAllAC_sound {V : Nat} {F : CNF Nat} {pogStr : String} {N : Nat} (h : checkAllAC V F pogStr N = true) (hB : (fwdCnfOf F pogStr).Unsat) : Fintype.card {a : Fin V → Bool // F.eval (ext a) = true} = N
theorem fwdCnfOf_unsat_of_sel {F : CNF Nat} {pogStr keepStr : String} (h : (fwdCnfOfSel F pogStr keepStr).Unsat) : (fwdCnfOf F pogStr).Unsat
theorem LRATCatcher.checkStreamCnf_sound (cnf : CNF Nat) (feed : Nat → Option (Array IntAction)) (fuel : Nat) (h : checkStreamCnf cnf feed fuel = true) : cnf.Unsat
theorem Family.card_of_checkAC {X : Type*} {V : N} {F : CNF N} (e : {a : Fin V → Bool // F.eval (ext a) = true} ∼ X) {pogStr : String} {N : N} (h : checkAllAC V F pogStr N = true) (hB : (fwdCnfOf F pogStr).Unsat) : Nat.card X = N
A.8 Provenance of the Measurements
One script writes every number of the paper from the result files of the runs in Table 13. The artifact contains these files. In the run of 2026-10-02 we used the tools of Table 11. For the rows measured in other runs we name the differences in Table 13. cpog-gen derives the refutation node by node, by unit propagation where that suffices and otherwise by a call of CaDiCaL.
Table 11: The tools of the run of 2026-10-02. From CPOG we used cpog-gen with our two patches, the unpatched cpog-gen for the full certificates, and cpog-check and cpog-lean-check.
| Tool | Version | Source |
|---|---|---|
| Lean | 4.30.0 | |
| Mathlib | commit c5ea003 | |
| lrat-catcher | 0.2.0 | |
| d4 | commit 333370c | github.com/crillab/d4 |
| CPOG | release 1.2.0, commit a97ed85 | github.com/rebryant/cpog |
| CaDiCaL [4] | 3.0.1 | |
| drat-trim [62] | commit 2e3b2dc | github.com/marijnheule/drat-trim |
We call the patched cpog-gen as cpog-gen-fwd -F -T 500 -G. With -F, from our first patch, it omits the deletions, and with -G and -T 500, from our second patch, it frees proof clauses that no later step reads and shortens with drat-trim every solver proof that has at least 500 clauses.
Memory limits are enforced by the job scheduler of the cluster, and peak memory is the largest amount of main memory the process occupied, as reported by the operating system; both are in GB of bytes. Both checkers of a comparison run one after the other on the same machine.
In the comparison we omit the 14 proved competition formulas with the longest generation times. In a run before 2026-10-02, three of them had exceeded the 64 GB memory limit of the cpog-lean-check run; one of these three has the largest certificate of the set. On the largest certificate of the comparison, track2_011 with 6.7 GB, cpog-lean-check takes 519.9 s and 24.2 GB, and the Lean process takes 184.7 s and 6.8 GB.
In Table 5 we exclude 2 sweeps that exceeded 1,800 s. For the generation time we use the instances on which both variants of cpog-gen take at least a second. We measured trimming and the binary format together. For the bit-parallel reverse check of Table 5 we used the eleven instances of Table 7 and the six competition formulas track1_063, track1_149, track1_171, track2_081, track2_089 and track2_095, on which an earlier version of our reverse check had been slow. For trimming with the binary format, the keep mask and inlining we took 13- and 14-queens, the grid, A396728(7), and track2_011, track2_087 and track2_095, whose certificates we had stored from runs before 2026-10-02. We also compared streaming the refutation with embedding it in the theorem file, on the eleven instances whose refutation in text format has at most 132 MB (embedded with +embed above the default limit of 64 MB), namely the and boards, 10- and 11-queens, the and grids, , random cubic 100, homer, track1_011 and track2_007. Table 12 has the result in the format of Table 5.
Table 12: Embedding the refutation in the theorem file against streaming it, in the format of Table 5: the median and the range over the instances of the ratio of the check time with the refutation embedded to the check time with it streamed, once for the same refutation in text format and once with the keep mask, inlining and the binary format, which are available only for a streamed refutation.
| Design choice | Metric | Instances | Median | Range |
|---|---|---|---|---|
| Streamed refutation | check time, same proof | 11 | 0.90 | 0.82–0.93 |
| check time, with mask | 11 | 1.9 | 1.4–2.1 |
Table 13: Provenance of the measured numbers: where each result is reported, the data behind it, the date of the run and the sources where they differ from the run of 2026-10-02, the machine class (cpu01: AMD EPYC 9554P; b4: Intel Xeon E5-2640 v4; b5: AMD EPYC 7402; gpu01: AMD EPYC 9274F) and the limits. We took every measurement once, except for the comparison of streaming with embedding and for the bit-parallel reverse check below 60 s, which we measured three times.
| Reported in | Data | Run | Machine | Limits |
|---|---|---|---|---|
| Table 3, Table 6 | the runs of the theorems (the five single counts without inlining); order 8: 737 runs, one per certificate, and one for the assembled theorem | 2026-10-02; order 8 to 2026-10-04, same pipeline | cpu01; order 8 b5 | 64 GB, 4 h; order 8 20 or 48 GB per certificate |
| Table 8, Table 9 | 180 runs of the whole pipeline | 2026-10-02 | b5 | d4 and generation 4,000 s, Lean 3,600 s, 64 GB |
| Figure 3, Table 4, Appendix A.4, Table 5 deletions | 91 runs with both variants of cpog-gen and both CPOG checkers in one job | 2026-10-02 | b4 (89), b5 (2) | each checker 3,600 s; 32, 48 or 64 GB |
| Figure 3, unshortened refutation | 91 runs as above, plus a Lean run on the unshortened refutation | 2026-10-05 | b4 | as above |
| Table 5 bit-parallel reverse check | 17 instances, the reverse check alone | 2026-10-01; the top-down evaluation of that day | cpu01 | 1,800 s per check |
| Table 5 trimmed, keep mask, inlining | 7 instances, four translator settings | 2026-10-02; certificates of runs before 2026-10-02 | cpu01 | 32 or 64 GB, 2 h |
| Table 12 | 11 instances, embedded and streamed | 2026-10-04 | cpu01 | 48 GB, 1,800 s |
| Section 6, rerun of the generation failures | 26 formulas, two generator modes | 2026-10-11 | b5, cpu01 | generation 10,000 s; 64 or 128 GB |
| Section 6, kernel alone | domino boards 4 × 4 to 6 × 6 | 2026-10-04 | cpu01 | 64 GB, 3,600 s |
| Table 7 | 11 runs of the whole pipeline | 2026-10-02 | cpu01 | none |
| Table 10 | constructed certificates; differential test of 12.1 million certificates | 2026-10-07, commit d097449; constructed certificates of 2026-10-11 with the shipped tools | gpu01; b4 machine for the constructed certificates | 20 s per run of each tool |