mp_nsr_size
The unary size mp_nsr_size of an MP-NSR certificate cert : List (MpNsrEntry n F) for a CNF formula F : List (List (CnfLit (Fin n))) over Fin n, defined as the length of cert plus the sum over all entries e in cert of e.coeff.num.natAbs + e.coeff.den + (∑ i : Fin n, e.monomial (CnfLit.pos i)) + (∑ i : Fin n, e.monomial (CnfLit.neg i)) + 1.
Statement
def mp_nsr_size {n : ℕ} {F : List (List (CnfLit (Fin n)))} (cert : List (MpNsrEntry n F)) : ℕ- Defined in
- arXiv:2611.24548 Sec 2.1 & Def 2.3
- Verified
- 19 Nov 2026
- Axioms
- none listed
- Built on 2
- MpNsrEntryA structure MpNsrEntry (n : ℕ) (F : List (List (CnfLit (Fin n)))) : Type representing an entry in an MP-NSR certificate, with fields coeff…
- CnfLitA CNF literal over a variable type V is either a positive variable or a negated variable.
Read back from the Lean
A definition of mp_nsr_size, which takes an implicit natural number n, an implicit CNF formula F : List (List (CnfLit (Fin n))), and a certificate cert : List (MpNsrEntry n F), and returns a natural number representing the size of cert.
The returned value is the sum of:
1. The length of cert (cert.length), and
2. The sum over every entry e in cert of:
- The absolute value of the numerator of e.coeff (e.coeff.num.natAbs),
- plus the denominator of e.coeff (e.coeff.den),
- plus the sum over all i : Fin n of e.monomial (CnfLit.pos i),
- plus the sum over all i : Fin n of e.monomial (CnfLit.neg i),
- plus 1.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- Unary size of an MP-NSR certificate. -/ def mp_nsr_size {n : ℕ} {F : List (List (CnfLit (Fin n)))} (cert : List (MpNsrEntry n F)) : ℕ := cert.length + (cert.map (fun e => e.coeff.num.natAbs + e.coeff.den + (∑ i : Fin n, e.monomial (CnfLit.pos i)) + (∑ i : Fin n, e.monomial (CnfLit.neg i)) + 1)).sum