Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPSZ.General

PPSZ for satisfiable formulas #

This file proves that PPSZ with w-implication (Cslib.Complexity.PPSZ.round), unmodified, finds a satisfying assignment of every satisfiable k-CNF formula, k ≥ 3, with the probability that the analysis of Paturi, Pudlák, Saks, Zane gives for uniquely satisfiable formulas: at least 2^{-(1 - qbar k h) n} for w ≥ ∑ i < h, (k - 1) ^ i (round_success_of_satisfiable), and at least 2^{-(1 - μ_k / (k - 1) + ε) n} in the ε-form (round_success_limit). The theorem behind it is Hertli's theorem in the form of Scheder, Steinberger, Theorem 6 (p. 9:5): if every frozen variable of every restriction of φ is guessed with probability at most p, and p ≥ p* = 1 - 1 / (2 ln 2), then one round succeeds with probability at least 2^{-p n} (round_success_ge_of_guess_le).

The proof #

The proof is Hertli's cost-function induction Hertli, §3, adapted to the unmodified algorithm (original adaptation). Hertli analyses a modified PPSZ that sets every w-implied literal before choosing the next variable, and remarks that his approach does not work for the original algorithm; here guesses of frozen variables are charged in each step instead.

Main definitions #

Main results #

References #

The cost #

noncomputable def Cslib.Complexity.PPSZ.guessBit {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (τ : Fin n → Option Bool) (y : Fin n) :

1 if no value is w-implied on y under τ, so that PPSZ guesses y at this step, and 0 otherwise.

noncomputable def Cslib.Complexity.PPSZ.cost {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (p : ℝ) (τ : Fin n → Option Bool) (x : Fin n) :

Hertli's cost of the variable x under the partial assignment τ, after Hertli, Definition 14 (p. 7): 0 if x is assigned, p if x is unassigned and not frozen, and, if x is frozen, its guess probability guessProb for the unmodified algorithm with the assigned variables fixed, averaged over the output distribution assignProb of AssignSL. Hertli uses the guess probability of his modified algorithm and takes p = S_k, the guess bound of frozen variables; here p is a parameter.

noncomputable def Cslib.Complexity.PPSZ.totalCost {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (p : ℝ) (τ : Fin n → Option Bool) :

Hertli's cost of a partial assignment Hertli, Definition 14 (p. 7): the sum of the costs of the variables.

theorem Cslib.Complexity.PPSZ.cost_of_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} {τ : Fin n → Option Bool} {x : Fin n} (h : Frozen φ τ x) :
cost φ w p τ x = ∑ α : Fin n → Bool, assignProb φ τ α * guessProb φ w (BitString.PartialAssignment.free τ)ᶜ α x

The cost of a frozen variable.

theorem Cslib.Complexity.PPSZ.cost_of_not_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} {τ : Fin n → Option Bool} {x : Fin n} (h : ¬Frozen φ τ x) (hx : τ x = none) :
cost φ w p τ x = p

The cost of an unassigned variable that is not frozen is p.

theorem Cslib.Complexity.PPSZ.cost_of_ne_none {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} {τ : Fin n → Option Bool} {x : Fin n} (hx : τ x ≠ none) :
cost φ w p τ x = 0

An assigned variable costs nothing.

theorem Cslib.Complexity.PPSZ.cost_le {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} (hp : 0 ≤ p) (herr : ∀ (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n), Logic.PL.CNF.eval σ φ = true → Frozen φ (PPZ.restrict σ T) x → guessProb φ w T σ x ≤ p) {τ : Fin n → Option Bool} (hτ : ∃ (σ : Fin n → Bool), IsSatExtension φ τ σ) (x : Fin n) :
cost φ w p τ x ≤ p

The cost of a variable is at most p if every frozen variable is guessed with probability at most p: the cost of a frozen variable is an average of its guess probabilities.

The cost decrease #

theorem Cslib.Complexity.PPSZ.sum_cost_update_add_le_of_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} {τ : Fin n → Option Bool} {σ : Fin n → Bool} (hσ : IsSatExtension φ τ σ) {x : Fin n} (hfr : Frozen φ τ x) :
∑ l ∈ satLits φ τ, cost φ w p (Function.update τ l.1 (some l.2)) x + ↑(guessBit φ w τ x) ≤ ↑(satLits φ τ).card * cost φ w p τ x

The decrease for a frozen variable, the generalization of Hertli, Lemma 19 (p. 9) in multiplied form (original). Let x be frozen under τ, let s be the number of satisfying literals and f = guessBit φ w τ x. Summed over the satisfying literals l, the costs of x under τ[l] are at most s · c(τ, x) - f. Hertli assumes f = 1 and divides by the output probabilities of AssignSL; here, for each output α, with P = R(τ)(α), w_y = R(τ[y ↦ α y])(α), u the guess probability and u_y the one with y also fixed, the inequality ∑_{y ≠ x} w_y u_y + P f ≤ s P u follows from Observation 13 (s P = ∑_y w_y), Lemma 11 (∑_{y ≠ x} (u - u_y) = f - u), Lemma 10 (u_y ≤ u) and Lemma 16 (P ≤ w_y, also for y = x).

theorem Cslib.Complexity.PPSZ.sum_guessBit_add_totalCost_le {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} (hp : 0 ≤ p) (herr : ∀ (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n), Logic.PL.CNF.eval σ φ = true → Frozen φ (PPZ.restrict σ T) x → guessProb φ w T σ x ≤ p) {τ : Fin n → Option Bool} (hτ : ∃ (σ : Fin n → Bool), IsSatExtension φ τ σ) :
∑ l ∈ satLits φ τ, (↑(guessBit φ w τ l.1) + totalCost φ w p (Function.update τ l.1 (some l.2))) ≤ ↑(satLits φ τ).card * totalCost φ w p τ + (2 - 2 * p) * (↑(satLits φ τ).card - ↑(BitString.PartialAssignment.free τ).card)

The cost decrease, the generalization of Hertli, Theorem 17 (p. 7) to the unmodified algorithm (original). If τ has a satisfying extension and every frozen variable is guessed with probability at most p ≥ 0, then summed over the s satisfying literals l, e_l + c(τ[l]) is at most s · c(τ) + (2 - 2p)(s - m), where e_l = guessBit φ w τ l.1 and m is the number of unassigned variables. A liquid variable contributes 2 + (s - 2) p (Hertli, Lemma 18 (p. 9)), a frozen one at most s · c(τ, x) (sum_cost_update_add_le_of_frozen), and s - m is the number of liquid variables.

The success recursion #

noncomputable def Cslib.Complexity.PPSZ.guessCount {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (α : Fin n → Bool) (π : Equiv.Perm (Fin n)) (i : ℕ) :

The number of steps from position i on at which the run in the order π that agrees with α guesses: no value is w-implied on the variable at that position. These are the unforced steps (unforcedCount, that is Cslib.Complexity.PPZ.unforcedCountWith with the oracle implied φ w) from position i on (guessCount_add_unforcedCount).

theorem Cslib.Complexity.PPSZ.guessCount_add_unforcedCount {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} (α : Fin n → Bool) (π : Equiv.Perm (Fin n)) (i : ℕ) :
guessCount φ w α π i + unforcedCount φ w α π i = unforcedCount φ w α π n

The guesses from position i on and the unforced steps before position i are all the unforced steps.

noncomputable def Cslib.Complexity.PPSZ.succSum {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (π₀ : Equiv.Perm (Fin n)) (i : ℕ) (τ : Fin n → Option Bool) :

The success sum at the partial assignment τ after the first i positions of the order π₀: the sum, over the satisfying extensions α of τ and over the orders π that agree with π₀ on the first i positions, of 2^{-u}, where u = guessCount φ w α π i counts the guesses from position i on. At i = 0 it is n! times the probability that one round outputs a satisfying assignment (succSum_zero).

theorem Cslib.Complexity.PPSZ.succSum_nonneg {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} (π₀ : Equiv.Perm (Fin n)) (i : ℕ) (τ : Fin n → Option Bool) :
0 ≤ succSum φ w π₀ i τ

The success sum is nonnegative.

theorem Cslib.Complexity.PPSZ.succSum_eq {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {π₀ : Equiv.Perm (Fin n)} {i : ℕ} (hi : i < n) {τ : Fin n → Option Bool} (hτ : BitString.PartialAssignment.free τ = (PPZ.prefixSet π₀ i)ᶜ) :
succSum φ w π₀ i τ = ∑ y ∈ BitString.PartialAssignment.free τ, (1 / 2) ^ guessBit φ w τ y * ∑ b : Bool, succSum φ w (Equiv.swap (π₀ ⟨i, hi⟩) y * π₀) (i + 1) (Function.update τ y (some b))

The success recursion (original), the exact form of Hertli, Observation 9 for the unmodified algorithm and Scheder, Steinberger, Observation 1 unrolled one step. If τ assigns exactly the first i < n variables of π₀, the success sum splits by the unassigned variable y at position i and its value b: the step on y costs the factor 2^{-guessBit φ w τ y}.

theorem Cslib.Complexity.PPSZ.succSum_zero {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} (π₀ : Equiv.Perm (Fin n)) :
(succSum φ w π₀ 0 fun (x : Fin n) => none) = ↑n.factorial * ∑ σ : Fin n → Bool with Logic.PL.CNF.eval σ φ = true, ((round φ w) fun (x : Fin n) => some (σ x)).toReal

The success sum at the start is n! times the probability that one round of PPSZ outputs a satisfying assignment.

The induction #

theorem Cslib.Complexity.PPSZ.factorial_mul_le_succSum {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} (hp : 1 - 1 / (2 * Real.log 2) ≤ p) (herr : ∀ (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n), Logic.PL.CNF.eval σ φ = true → Frozen φ (PPZ.restrict σ T) x → guessProb φ w T σ x ≤ p) (m i : ℕ) (π₀ : Equiv.Perm (Fin n)) (τ : Fin n → Option Bool) :
i + m = n → BitString.PartialAssignment.free τ = (PPZ.prefixSet π₀ i)ᶜ → (∃ (σ : Fin n → Bool), IsSatExtension φ τ σ) → ↑m.factorial * 2 ^ (-totalCost φ w p τ) ≤ succSum φ w π₀ i τ

Hertli's Theorem 15 for the unmodified algorithm Hertli, Theorem 15 (p. 7) (original adaptation): if every frozen variable of every restriction of φ is guessed with probability at most p ≥ 1 - 1 / (2 ln 2), then for every partial assignment τ with a satisfying extension that assigns exactly the first i variables of π₀, with m = n - i variables left, succSum φ w π₀ i τ ≥ m! · 2^{-c(τ)}. The unmodified algorithm's success probability on the restricted formula is succSum / m!; Hertli's Theorem 15 bounds the success probability of his modified algorithm. The proof is by induction on m, through the success recursion (succSum_eq), the arithmetic–geometric mean inequality over the satisfying literals (card_mul_two_rpow_neg_le_sum), the cost decrease (sum_guessBit_add_totalCost_le) and the leftover inequality (two_sub_two_mul_mul_le_mul_logb).

The threshold #

2 - 2 ln 2 ≤ 1 / (2 ln 2), equivalently (2 ln 2 - 1)² ≥ 0.

The threshold (original): for k ≥ 3 and every depth h, p = 1 - qbar k h is at least p* = 1 - 1 / (2 ln 2) of Scheder, Steinberger, Theorem 6 (p. 9:5), since qbar k h ≤ qbar 3 h ≤ 2 - 2 ln 2 ≤ 1 / (2 ln 2). The condition k ≥ 3 is the one used here; it is sufficient, not necessary.

PPSZ for satisfiable formulas #

theorem Cslib.Complexity.PPSZ.round_success_ge_of_guess_le {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {p : ℝ} (hp : 1 - 1 / (2 * Real.log 2) ≤ p) (hsat : φ.Satisfiable) (herr : ∀ (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n), Logic.PL.CNF.eval σ φ = true → Frozen φ (PPZ.restrict σ T) x → guessProb φ w T σ x ≤ p) :
2 ^ (-(p * ↑n)) ≤ ∑ σ : Fin n → Bool with Logic.PL.CNF.eval σ φ = true, ((round φ w) fun (x : Fin n) => some (σ x)).toReal

Hertli's theorem, as stated in Scheder, Steinberger, Theorem 6 (p. 9:5) (attributed there to Hertli), for PPSZ with w-implication, proved along the route of Hertli, Theorem 15 (p. 7): if every frozen variable of every restriction of φ to a satisfying assignment is guessed with probability at most p, and p ≥ p* = 1 - 1 / (2 ln 2) = (2 - log₂ e) / 2, then for satisfiable φ one round of PPSZ outputs a satisfying assignment with probability at least 2^{-p n}.

The hypothesis herr is the condition E_π[J_x] ≤ p of Scheder, Steinberger, Definition 2 (p. 9:4), restricted to frozen x, for all the restrictions φ|σ_T of φ (restrict σ T with σ satisfying φ); every satisfiable restriction of φ is of this form. For frozen x, E_π[J_x] is guessProb; Definition 2 also bounds E_π[J_x] for liquid x, which herr drops. So for a class closed under restrictions Scheder, Steinberger, Definition 8 (p. 9:6), the setting of their Lemma 15 and of Hertli, this theorem is at least as strong as their Theorem 6; it is not a statement about a class that is not closed under restrictions. The algorithm is the unmodified PPSZ, as in Scheder, Steinberger; Hertli analyses a modified algorithm, and the adaptation of his proof is original.

theorem Cslib.Complexity.PPSZ.round_success_of_satisfiable {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w k h : ℕ} (hk : 3 ≤ k) (hsat : φ.Satisfiable) (hlen : ∀ c ∈ φ, List.length c ≤ k) (hw : ∑ i ∈ Finset.range h, (k - 1) ^ i ≤ w) :
2 ^ (-((1 - qbar k h) * ↑n)) ≤ ∑ σ : Fin n → Bool with Logic.PL.CNF.eval σ φ = true, ((round φ w) fun (x : Fin n) => some (σ x)).toReal

PPSZ for satisfiable k-CNF formulas at a fixed depth, the finite-depth form of Hertli, p. 5 and Theorem 15 and Scheder, Steinberger, Theorem 6 (original): for k ≥ 3, w ≥ ∑ i < h, (k - 1) ^ i and every satisfiable CNF formula on n variables whose clauses have at most k literals, one round of PPSZ with w-implication outputs a satisfying assignment with probability at least 2^{-(1 - qbar k h) n}, the bound of the uniquely satisfiable case (round_success_of_unique).

theorem Cslib.Complexity.PPSZ.round_success_of_satisfiable_three {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} (hw : 3 ≤ w) (hsat : φ.Satisfiable) (hlen : ∀ c ∈ φ, List.length c ≤ 3) :
2 ^ (-(39 / 70 * ↑n)) ≤ ∑ σ : Fin n → Bool with Logic.PL.CNF.eval σ φ = true, ((round φ w) fun (x : Fin n) => some (σ x)).toReal

PPSZ for satisfiable 3-CNF formulas at depth two (original): for w ≥ 3, one round of PPSZ with w-implication outputs a satisfying assignment of a satisfiable 3-CNF formula with probability at least 2^{-(39/70) n}, as in the unique case (round_success_of_unique_three).

theorem Cslib.Complexity.PPSZ.round_success_limit {k : ℕ} (hk : 3 ≤ k) (ε : ℝ) :
ε > 0 → ∃ (w : ℕ), ∀ (n : ℕ) (φ : Logic.PL.CNF (Fin n)), φ.Satisfiable → (∀ c ∈ φ, List.length c ≤ k) → 2 ^ (-((1 - mu k / (↑k - 1) + ε) * ↑n)) ≤ ∑ σ : Fin n → Bool with Logic.PL.CNF.eval σ φ = true, ((round φ w) fun (x : Fin n) => some (σ x)).toReal

PPSZ for satisfiable k-SAT Hertli, p. 5, Scheder, Steinberger, Theorem 6 with Theorem 4, for PPSZ with w-implication. Let k ≥ 3. For every ε > 0 there is a bound w such that, for every n, one round of PPSZ with w-implication outputs a satisfying assignment of any satisfiable CNF formula on n variables whose clauses have at most k literals with probability at least 2^{-(1 - μ_k / (k - 1) + ε) n}.

This is the ε-form of the bound 2^{-(1 - μ_k / (k - 1)) n - o(n)} of the sources, as in round_success_unique_limit; the uniform o(n) form with w growing with n is not formalized here. The condition k ≥ 3 is the one under which the threshold p* is cleared here.