Documentation

Complexitylib.Classes.PCP.Internal.CNFMaxVar

The largest variable index, by slot #

CNF.maxVar folds over clauses and then over literals. An algorithm instead loops over a flat slot index and takes the largest value it sees. The two are the same number, and this module says why: each bounds the family of variable indices and each is attained by it.

Main results #

theorem Complexity.var_le_maxVar (φ : SAT.CNF) {j : } (hj : j < List.length φ) {p : } (hp : p < List.length φ[j]) :

Every literal's index is at most the formula's largest.

theorem Complexity.exists_lit_eq_maxVar (c : SAT.Clause) :
0 < List.length c∃ (p : ) (hp : p < List.length c), c[p].var = c.maxVar

Some literal of a nonempty clause attains its largest index.

theorem Complexity.exists_clause_eq_maxVar (φ : SAT.CNF) :
0 < List.length φ∃ (j : ) (hj : j < List.length φ), φ[j].maxVar = φ.maxVar

Some clause of a nonempty formula attains its largest index.

theorem Complexity.exists_slot_eq_maxVar (φ : SAT.CNF) (h3 : φ.Is3CNF) (h : 0 < List.length φ) :
∃ (j : ) (hj : j < List.length φ) (p : ) (hp : p < List.length φ[j]), φ[j][p].var = φ.maxVar

Some literal attains the formula's largest index.

The loop computes maxVar #

noncomputable def Complexity.slotVar (w : List Bool) :

The variable index at a flat slot, read off the encoding.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Complexity.slotVar_eq (φ : SAT.CNF) {i j p : } (hj : j < List.length φ) (hp : p < List.length φ[j]) (hdj : i / 3 = j) (hdp : i % 3 = p) :

    The loop computes maxVar.