cnf_clause_to_lin
def
The linear inequality embedding of a CNF clause C over n variables, asserting ∑_{l ∈ C} [l] ≥ 1 where [x_i] = x_i and [~x_i] = 1 - x_i.
Statement
def cnf_clause_to_lin (n : ℕ) (C : Finset (CnfLit (Fin n))) : LinIneq n- Defined in
- arXiv:2611.24548 Definition 4.1
- Verified
- 19 Nov 2026
- Axioms
- none listed
- Built on 3
- LinIneqA linear inequality c^T x ≥ d over n Boolean variables, with integer coefficient vector c : Fin n → ℤ and integer constant term d : ℤ.
- cnf_lit_decidable_eqDecidable equality on CNF literals, derived from decidable equality on the underlying variables.
- CnfLitA CNF literal over a variable type V is either a positive variable or a negated variable.
- Used by 3
- treelike_cp_sizeThe unary size of a treelike Cutting Planes derivation tree d, defined recursively as 1 plus the unary size lin_ineq_unary_size L of the…
- TreelikeCpDerivationInductive type family of treelike Cutting Planes (CP) derivations of a linear inequality from a CNF formula F over n variables (given as a…
- treelike_cp_unsat_of_refutationSoundness of treelike Cutting Planes refutations: if a CNF formula F over n variables has a treelike Cutting Planes refutation deriving 0…
Read back from the Lean
The definition cnf_clause_to_lin takes a natural number n and a finite set of literals C : Finset (CnfLit (Fin n)), and returns the LinIneq n with:
- coefficient function mapping each j : Fin n to (if CnfLit.pos j ∈ C then 1 else 0) - (if CnfLit.neg j ∈ C then 1 else 0) (in ℤ), and
- constant term equal to 1 - ∑ j : Fin n, (if CnfLit.neg j ∈ C then 1 else 0) (in ℤ).
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
/-- The embedding of a CNF clause as a linear inequality asserting that the sum of its literals is at least 1. -/ def cnf_clause_to_lin (n : ℕ) (C : Finset (CnfLit (Fin n))) : LinIneq n := ⟨fun j => (if CnfLit.pos j ∈ C then 1 else 0) - (if CnfLit.neg j ∈ C then 1 else 0), 1 - ∑ j : Fin n, (if CnfLit.neg j ∈ C then (1 : ℤ) else 0)⟩