Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPSZ.Frozen

PPSZ for satisfiable formulas: frozen variables and the guess probability #

A run of PPSZ on a satisfiable formula φ passes through partial assignments τ. When τ is the restriction of a satisfying assignment σ to a set T of variables, an unassigned variable x is guessed if, at its turn, the values of σ on T and on the variables placed before x do not w-imply x = σ x. Its guess probability guessProb φ w T σ x is the fraction of the n! orders in which this happens; for T = ∅ it is the probability that x is not forced (guessProb_empty). A variable is frozen under τ (Frozen) if all satisfying extensions of τ (IsSatExtension) agree on it Hertli, Definition 5 (p. 4).

Hertli analyses a modified PPSZ that sets every w-implied variable as soon as it is implied; here the algorithm is unmodified, as in Scheder, Steinberger, and the quantities below are the analogues of Hertli's for the unmodified algorithm.

This file proves the three properties of the guess probability that the adaptation of the analysis of Hertli uses.

The restriction of a formula by a partial assignment is Cslib.Logic.PL.CNF.restrictBy. Under an assignment that extends the partial assignment, it has the value of the formula (Cslib.Logic.PL.CNF.eval_restrictBy), and it has no wider clauses (Cslib.Logic.PL.CNF.length_le_of_mem_restrictBy); these facts are in CslibFrontier.Logics.Propositional.Resolution.Restrict.

Main definitions #

Main results #

References #

Lifting w-implication #

theorem Cslib.Complexity.PPSZ.WImplied.of_restrictBy {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {ρ τ τ' : Fin n → Option Bool} {x : Fin n} {b : Bool} (h : WImplied (φ.restrictBy ρ) w τ x b) (hρ : ∀ (y : Fin n) (c : Bool), ρ y = some c → τ' y = some c) (hτ : ∀ (y : Fin n) (c : Bool), τ y = some c → τ' y = some c) :
WImplied φ w τ' x b

w-implication lifts from a restricted formula (original): if a value is w-implied in φ.restrictBy ρ under τ, it is w-implied in φ under every τ' that extends both ρ and τ. Each clause of the restricted formula is replaced by a clause of φ it comes from.

Frozen variables #

def Cslib.Complexity.PPSZ.Frozen {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (τ : Fin n → Option Bool) (x : Fin n) :

x is frozen under the partial assignment τ Hertli, Definition 5 (p. 4): it is unassigned, and all satisfying extensions of τ give it the same value. Hertli defines frozen variables of the restricted formula; its satisfying assignments are the satisfying extensions of τ (Cslib.Logic.PL.CNF.eval_restrictBy).

theorem Cslib.Complexity.PPSZ.isSatExtension_restrict {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {σ : Fin n → Bool} (hσ : Logic.PL.CNF.eval σ φ = true) (T : Finset (Fin n)) :

A satisfying assignment is a satisfying extension of each of its restrictions.

theorem Cslib.Complexity.PPSZ.Frozen.update {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {τ : Fin n → Option Bool} {x y : Fin n} (h : Frozen φ τ x) (hxy : x ≠ y) (hy : τ y = none) (b : Bool) :
Frozen φ (Function.update τ y (some b)) x

A frozen variable stays frozen when another unassigned variable is assigned.

theorem Cslib.Complexity.PPSZ.exists_ne_of_not_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {τ : Fin n → Option Bool} {x : Fin n} (hx : τ x = none) (h : ¬Frozen φ τ x) :
∃ (σ : Fin n → Bool) (σ' : Fin n → Bool), IsSatExtension φ τ σ ∧ IsSatExtension φ τ σ' ∧ σ x ≠ σ' x

An unassigned variable that is not frozen takes both values among the satisfying extensions.

theorem Cslib.Complexity.PPSZ.satLit_iff_of_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {τ : Fin n → Option Bool} {σ : Fin n → Bool} (hσ : IsSatExtension φ τ σ) {y : Fin n} (hfr : Frozen φ τ y) {b : Bool} :
SatLit φ τ y b ↔ b = σ y

Satisfying literals on a frozen variable: if y is frozen under τ, which has the satisfying extension σ, the only satisfying literal on y is y = σ y.

The guess probability #

noncomputable def Cslib.Complexity.PPSZ.guessProb {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n) :

The guess probability of x after fixing the variables of T to their values in σ: the fraction of the n! orders π in which the values of σ on T and on the variables placed before x do not w-imply x = σ x, with the order taken on all variables; the variables of T placed before x change nothing. This is the analogue for the unmodified algorithm of p_guessed of Hertli, Definition 4 (p. 4), for the formula with the variables of T fixed. For frozen x it is E_π[J_x(π, σ)] of Scheder, Steinberger, p. 9:4 for that formula.

theorem Cslib.Complexity.PPSZ.guessProb_nonneg {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} :
0 ≤ guessProb φ w T σ x

The guess probability is nonnegative.

theorem Cslib.Complexity.PPSZ.guessProb_le_one {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} :
guessProb φ w T σ x ≤ 1

The guess probability is at most 1.

theorem Cslib.Complexity.PPSZ.guessProb_le_of_subset {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T T' : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (hTT' : T ⊆ T') :
guessProb φ w T' σ x ≤ guessProb φ w T σ x

Monotonicity of the guess probability Hertli, Lemma 10 (p. 5): fixing more variables of σ does not increase the guess probability, since w-implication is monotone (WImplied.mono). Hertli removes the new variable from the order; here the order is on all variables, so the statement is a comparison of events for each order.

theorem Cslib.Complexity.PPSZ.guessProb_eq_zero_of_wImplied {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (h : WImplied φ w (PPZ.restrict σ T) x (σ x)) :
guessProb φ w T σ x = 0

If x = σ x is w-implied under σ restricted to T, then x is never guessed.

theorem Cslib.Complexity.PPSZ.guessProb_of_mem {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (hx : x ∈ T) :
guessProb φ w T σ x = 0

An assigned variable is never guessed.

theorem Cslib.Complexity.PPSZ.guessProb_empty {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {σ : Fin n → Bool} {x : Fin n} (hσ : Logic.PL.CNF.eval σ φ = true) :
guessProb φ w ∅ σ x = 1 - ↑{π : Equiv.Perm (Fin n) | Forced φ w σ π x}.card / ↑n.factorial

With no fixed variables, x is guessed exactly when it is not forced: the guess probability is 1 minus the forcing probability of round_apply_ge.

theorem Cslib.Complexity.PPSZ.guessProb_eq_integral {n : ℕ} (φ : Logic.PL.CNF (Fin n)) (w : ℕ) (T : Finset (Fin n)) (σ : Fin n → Bool) (x : Fin n) :
guessProb φ w T σ x = ∫ (r : ℝ) in 0..1, bernoulliProb (Tᶜ.erase x) r fun (S : Finset (Fin n)) => ¬WImplied φ w (PPZ.restrict σ (T ∪ S)) x (σ x)

The guess probability as an integral (original). The event that x is guessed depends only on the unassigned variables placed before x, so the guess probability is the average over r ∈ [0, 1] of the probability of the event when each unassigned variable other than x is fixed independently with probability r.

theorem Cslib.Complexity.PPSZ.card_compl_mul_guessProb {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (hx : x ∉ T) :
↑Tᶜ.card * guessProb φ w T σ x = (if WImplied φ w (PPZ.restrict σ T) x (σ x) then 0 else 1) + ∑ y ∈ Tᶜ.erase x, guessProb φ w (insert y T) σ x

The first-step identity, the analogue for the unmodified algorithm of Hertli, Lemma 11 (p. 6), in the form m * u = f + ∑ y, u_y (original, by card_add_one_mul_integral_bernoulliProb). Let x ∉ T, let m = |Tᶜ| be the number of unassigned variables, u the guess probability of x, and f = 0 if x = σ x is w-implied under σ restricted to T and f = 1 otherwise. Then m * u is f plus the sum, over the unassigned y ≠ x, of the guess probability u_y after also fixing y. Hertli assumes that x is not w-implied, so that f = 1.

theorem Cslib.Complexity.PPSZ.sum_guessProb_sub {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (hx : x ∉ T) :
∑ y ∈ Tᶜ.erase x, (guessProb φ w T σ x - guessProb φ w (insert y T) σ x) = (if WImplied φ w (PPZ.restrict σ T) x (σ x) then 0 else 1) - guessProb φ w T σ x

The first-step identity, as a sum of decreases, the analogue for the unmodified algorithm of Hertli, Lemma 11 (p. 6): with u, u_y and f as in card_compl_mul_guessProb, ∑ y ≠ x unassigned, (u - u_y) = f - u.

The guess bound for frozen variables #

theorem Cslib.Complexity.PPSZ.exists_isCriticalTreeAt_restrictBy {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} (hσ : Logic.PL.CNF.eval σ φ = true) (hfr : Frozen φ (PPZ.restrict σ T) x) (h : ℕ) :
∃ (C : List (Fin n) → Logic.PL.Clause (Fin n)), IsCriticalTreeAt (φ.restrictBy (PPZ.restrict σ T)) σ x h C

Critical clause trees for frozen variables (original). If σ satisfies φ and x is frozen under σ restricted to T, then the restricted formula has a critical clause tree of every height rooted at x for σ: flipping any set of variables that contains x falsifies a clause of the restricted formula.

theorem Cslib.Complexity.PPSZ.guessProb_le_of_frozen {n : ℕ} {φ : Logic.PL.CNF (Fin n)} {w : ℕ} {T : Finset (Fin n)} {σ : Fin n → Bool} {x : Fin n} {k h : ℕ} (hσ : Logic.PL.CNF.eval σ φ = true) (hfr : Frozen φ (PPZ.restrict σ T) x) (hlen : ∀ c ∈ φ, List.length c ≤ k) (hw : ∑ i ∈ Finset.range h, (k - 1) ^ i ≤ w) :
guessProb φ w T σ x ≤ 1 - qbar k h

The guess bound for frozen variables, for the unmodified algorithm the frozen-variable part of the finite-depth form of Scheder, Steinberger, Theorem 4 (p. 9:4), which they attribute to Paturi, Pudlák, Saks and Zane; Hertli's bound for his modified algorithm, Hertli, Theorem 6 (p. 4), follows from it by guessProb_le_of_subset. Let σ satisfy φ, whose clauses have at most k literals, let w ≥ ∑ i < h, (k - 1) ^ i, and let x be frozen under σ restricted to T. Then x is guessed in at most a 1 - qbar k h fraction of the orders, as in the unique case (qbar_le_card_filter_forced_div_factorial). The proof, through a critical clause tree of the restricted formula rooted at x (exists_isCriticalTreeAt_restrictBy) and the lifting of w-implication (WImplied.of_restrictBy), is original.