AFTD Auto-Formalizing Theoretical Domains

is_thr_res_derivation

def

A Threshold Resolution (Thr-Res) derivation from a CNF formula F : Finset (Finset (CnfLit (Fin n))) is a list π : List (ThrCond n) where each line π[i] satisfies at least one of six rules: (1) Source: for all l, π[i].coeffs l = 0 and π[i].threshold = 0; (2) Clause introduction: there exist j < i and C ∈ F such that for all l, π[i].coeffs l = π[j].coeffs l + (if l ∈ C then 1 else 0) and π[i].threshold = π[j].threshold + 1; (3) Resolution: there exist j < i, k < i, and variable v : Fin n such that for all l, π[j].coeffs l = π[i].coeffs l + (if l = CnfLit.pos v then 1 else 0), and π[k].coeffs l = π[i].coeffs l + (if l = CnfLit.neg v then 1 else 0), and π[j].threshold = π[i].threshold and π[k].threshold = π[i].threshold; (4) Weakening: there exist j < i and literal l₀ such that for all l, π[i].coeffs l = π[j].coeffs l + (if l = l₀ then 1 else 0) and π[i].threshold = π[j].threshold; (5) Introduce: there exist j < i and literal l₀ such that for all l, π[i].coeffs l = π[j].coeffs l + (if l = l₀ ∨ l = cnf_lit_compl l₀ then 1 else 0) and π[i].threshold = π[j].threshold + 1; or (6) Simplify: there exist j < i and literal l₀ such that for all l, π[j].coeffs l = π[i].coeffs l + (if l = l₀ ∨ l = cnf_lit_compl l₀ then 1 else 0) and π[j].threshold = π[i].threshold + 1.

Statement

def is_thr_res_derivation (n : ℕ) (F : Finset (Finset (CnfLit (Fin n)))) (π : List (ThrCond n)) : Prop
Defined in
arXiv:2611.24548 Definition 2.12
Verified
19 Nov 2026
Axioms
none listed
Built on 4
  • ThrCondA threshold condition over n Boolean variables is an inequality f ≥ s, where f is a nonnegative integer linear combination of literals…
  • CnfLitA CNF literal over a variable type V is either a positive variable or a negated variable.
  • cnf_lit_complThe complement of a literal, negating its polarity.
  • cnf_lit_decidable_eqDecidable equality on CNF literals, derived from decidable equality on the underlying variables.
Used by 1
  • is_thr_res_refutationA Threshold Resolution refutation of a CNF formula F : Finset (Finset (CnfLit (Fin n))) is a Thr-Res derivation π : List (ThrCond n) from…

Read back from the Lean

is_thr_res_derivation n F π asserts that the list π of threshold conditions (each consisting of a coefficient function coeffs : CnfLit (Fin n) → ℕ and an integer threshold : ℤ) is a valid threshold resolution derivation from the CNF formula F (a finset of clauses, where each clause is a finset of literals over Fin n). Specifically, for every index i : Fin π.length, the condition π[i] must satisfy at least one of the following six rules: 1. **Axiom**: For all literals l, π[i].coeffs l = 0, and π[i].threshold = 0. 2. **Clause introduction**: There exist an index j < i and a clause C ∈ F such that: - for all literals l, π[i].coeffs l = π[j].coeffs l + (1 if l ∈ C else 0), and - π[i].threshold = π[j].threshold + 1. 3. **Resolution / Cut rule**: There exist indices j < i and k < i, and a variable v : Fin n, such that: - for all literals l, π[j].coeffs l = π[i].coeffs l + (1 if l = CnfLit.pos v else 0), - for all literals l, π[k].coeffs l = π[i].coeffs l + (1 if l = CnfLit.neg v else 0), and - π[j].threshold = π[i].threshold and π[k].threshold = π[i].threshold. 4. **Weakening**: There exist an index j < i and a literal l₀ such that: - for all literals l, π[i].coeffs l = π[j].coeffs l + (1 if l = l₀ else 0), and - π[i].threshold = π[j].threshold. 5. **Complement addition**: There exist an index j < i and a literal l₀ such that: - for all literals l, π[i].coeffs l = π[j].coeffs l + (1 if l = l₀ or l = cnf_lit_compl l₀ else 0), and - π[i].threshold = π[j].threshold + 1. 6. **Complement elimination (with increased threshold)**: There exist an index j < i and a literal l₀ such that: - for all literals l, π[j].coeffs l = π[i].coeffs l + (1 if l = l₀ or l = cnf_lit_compl l₀ else 0), and - π[i].threshold = π[j].threshold + 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

/-- A Threshold Resolution (Thr-Res) derivation from a CNF formula F. -/
def is_thr_res_derivation (n : ℕ) (F : Finset (Finset (CnfLit (Fin n)))) (π : List (ThrCond n)) : Prop :=
  ∀ i : Fin π.length,
    ( (∀ l, π[i].coeffs l = 0) ∧ π[i].threshold = 0 ) ∨
    ( ∃ (j : Fin π.length) (C : Finset (CnfLit (Fin n))),
        j < i ∧ C ∈ F ∧
        (∀ l, π[i].coeffs l = π[j].coeffs l + if l ∈ C then 1 else 0) ∧
        π[i].threshold = π[j].threshold + 1 ) ∨
    ( ∃ (j k : Fin π.length) (v : Fin n),
        j < i ∧ k < i ∧
        (∀ l, π[j].coeffs l = π[i].coeffs l + if l = CnfLit.pos v then 1 else 0) ∧
        (∀ l, π[k].coeffs l = π[i].coeffs l + if l = CnfLit.neg v then 1 else 0) ∧
        π[j].threshold = π[i].threshold ∧ π[k].threshold = π[i].threshold ) ∨
    ( ∃ (j : Fin π.length) (l₀ : CnfLit (Fin n)),
        j < i ∧
        (∀ l, π[i].coeffs l = π[j].coeffs l + if l = l₀ then 1 else 0) ∧
        π[i].threshold = π[j].threshold ) ∨
    ( ∃ (j : Fin π.length) (l₀ : CnfLit (Fin n)),
        j < i ∧
        (∀ l, π[i].coeffs l = π[j].coeffs l + (if l = l₀ ∨ l = cnf_lit_compl l₀ then 1 else 0)) ∧
        π[i].threshold = π[j].threshold + 1 ) ∨
    ( ∃ (j : Fin π.length) (l₀ : CnfLit (Fin n)),
        j < i ∧
        (∀ l, π[j].coeffs l = π[i].coeffs l + (if l = l₀ ∨ l = cnf_lit_compl l₀ then 1 else 0)) ∧
        π[j].threshold = π[i].threshold + 1 )
See it in the graphDiscuss this resultChallenge it