Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPSZ.Placement

PPSZ: random placements and the depth recursion #

The analysis of PPSZ Paturi, Pudlák, Saks, Zane bounds the probability that a variable x is forced by the probability of a cut event on the set A of variables processed before x. This file contains the probabilistic part of that argument; it does not mention formulas.

The paper places the variables at independent uniform times in [0, 1]. We work with a uniformly random order instead. If x is fixed and the order π is uniform, the set A of the other m variables placed before x equals a given set S with probability 1 / ((m + 1) * C(m, |S|)) = ∫₀¹ r ^ |S| * (1 - r) ^ (m - |S|) dr (card_filter_placedBefore_mul_choose, card_filter_placedBefore_div_factorial). Hence for every event E on sets of variables, the probability of E(A) is the average over r ∈ [0, 1] of the probability of E when each of the other variables is included independently with probability r (card_filter_placedBefore_div_factorial_eq_integral). The integrand bernoulliProb U r E is a finite sum, so no measure on [0, 1]ⁿ is needed. This reduction is ours (original).

For a fixed r, the Harris inequality (bernoulliProb_mul_le, from Mathlib's fkg) bounds the probability of an intersection of increasing events below by the product of their probabilities. This gives the fixed-r form of Lemma 7 of the paper with all qᵢ = r (prod_le_bernoulliProb_forall_or), and by induction on the depth the bound Q k d r of the PPSZ recursion (Q_le_bernoulliProb) Paturi, Pudlák, Saks, Zane, Lemma 7 (p. 350) and p. 351.

Main definitions #

Main results #

References #

The depth recursion #

noncomputable def Cslib.Complexity.PPSZ.Q (k : ℕ) :
ℕ → ℝ → ℝ

The PPSZ depth recursion Paturi, Pudlák, Saks, Zane, p. 351: Q k 0 r = 0 and Q k (d + 1) r = (r + (1 - r) * Q k d r) ^ (k - 1). For a critical clause tree of degree at most k - 1 and depth d, it bounds the probability of a cut when each variable is placed before the root with probability r. The uppercase name follows the paper's Q_k^{(d)}.

noncomputable def Cslib.Complexity.PPSZ.qbar (k d : ℕ) :

The average ∫₀¹ Q k d r dr of the depth recursion, the bound on the probability that a variable is forced Paturi, Pudlák, Saks, Zane, p. 351.

@[simp]
theorem Cslib.Complexity.PPSZ.Q_zero (k : ℕ) (r : ℝ) :
Q k 0 r = 0

At depth zero the bound is 0.

theorem Cslib.Complexity.PPSZ.Q_succ (k d : ℕ) (r : ℝ) :
Q k (d + 1) r = (r + (1 - r) * Q k d r) ^ (k - 1)

The recursion step.

@[simp]
theorem Cslib.Complexity.PPSZ.Q_one (k : ℕ) (r : ℝ) :
Q k 1 r = r ^ (k - 1)

At depth one the bound is r ^ (k - 1).

theorem Cslib.Complexity.PPSZ.add_one_sub_mul_mem_Icc {r q : ℝ} (hr : r ∈ Set.Icc 0 1) (hq : q ∈ Set.Icc 0 1) :
r + (1 - r) * q ∈ Set.Icc 0 1

The base r + (1 - r) * q of the recursion lies in [0, 1].

theorem Cslib.Complexity.PPSZ.Q_mem_Icc {k d : ℕ} {r : ℝ} (hr : r ∈ Set.Icc 0 1) :
Q k d r ∈ Set.Icc 0 1

Q takes values in [0, 1] on [0, 1].

theorem Cslib.Complexity.PPSZ.Q_nonneg {k d : ℕ} {r : ℝ} (hr : r ∈ Set.Icc 0 1) :
0 ≤ Q k d r

Q is nonnegative on [0, 1].

theorem Cslib.Complexity.PPSZ.Q_le_one {k d : ℕ} {r : ℝ} (hr : r ∈ Set.Icc 0 1) :
Q k d r ≤ 1

Q is at most 1 on [0, 1].

theorem Cslib.Complexity.PPSZ.Q_le_Q_succ {k d : ℕ} {r : ℝ} (hr : r ∈ Set.Icc 0 1) :
Q k d r ≤ Q k (d + 1) r

Q is monotone in the depth.

theorem Cslib.Complexity.PPSZ.monotone_Q {k : ℕ} {r : ℝ} (hr : r ∈ Set.Icc 0 1) :
Monotone fun (d : ℕ) => Q k d r

For fixed r ∈ [0, 1], Q is monotone in the depth.

theorem Cslib.Complexity.PPSZ.Q_le_Q_of_le {k d : ℕ} {r s : ℝ} (hr : 0 ≤ r) (hrs : r ≤ s) (hs : s ≤ 1) :
Q k d r ≤ Q k d s

Q is monotone in r on [0, 1].

Q k d is a polynomial in r, hence continuous.

qbar is nonnegative.

qbar is at most 1.

qbar is monotone in the depth.

theorem Cslib.Complexity.PPSZ.antitone_Q_width {r : ℝ} (hr : r ∈ Set.Icc 0 1) (d : ℕ) :
Antitone fun (k : ℕ) => Q k d r

Q is antitone in the clause width k on [0, 1]: wider clauses give smaller bounds. The idea is the remark of Hertli, p. 8 that S_k increases with k; the proof, by induction on the depth, is original.

qbar is antitone in the clause width k; in particular qbar k d ≤ qbar 3 d for k ≥ 3. This is the finite-depth form of the remark of Hertli, p. 8 that S_k increases with k.

theorem Cslib.Complexity.PPSZ.qbar_one {k : ℕ} (hk : 1 ≤ k) :
qbar k 1 = 1 / ↑k

At depth one the bound is 1 / k, the bound of PPZ.

theorem Cslib.Complexity.PPSZ.integral_sum_mul_pow (c : ℕ → ℝ) (m : ℕ) :
∫ (r : ℝ) in 0..1, ∑ i ∈ Finset.range m, c i * r ^ i = ∑ i ∈ Finset.range m, c i / (↑i + 1)

The integral of a polynomial over [0, 1]: ∫₀¹ ∑ i < m, c i * r ^ i dr = ∑ i < m, c i / (i + 1).

The bound at depth two for k = 3: Q 3 2 r = (r + (1 - r) * r ^ 2) ^ 2, so qbar 3 2 = 31 / 70.

The Beta integral #

theorem Cslib.Complexity.PPSZ.integral_pow_mul_one_sub_pow (i j : ℕ) :
∫ (r : ℝ) in 0..1, r ^ i * (1 - r) ^ j = ↑i.factorial * ↑j.factorial / ↑(i + j + 1).factorial

The Beta integral ∫₀¹ r ^ i * (1 - r) ^ j dr = i! * j! / (i + j + 1)!, by induction on j. This is the value B(i + 1, j + 1) of the Beta function at natural numbers. Mathlib has the general form, ProbabilityTheory.beta α β = Γ(α) Γ(β) / Γ(α + β) with ProbabilityTheory.beta_eq_betaIntegralReal relating it to Complex.betaIntegral, but that integral uses complex powers, so for natural exponents the elementary induction is shorter.

Independent inclusion #

noncomputable def Cslib.Complexity.PPSZ.bernoulliProb {α : Type u_1} (U : Finset α) (r : ℝ) (E : Finset α → Prop) :

Independent inclusion. The probability that a random subset of U, containing each element independently with probability r, satisfies E: the sum of the weights r ^ |S| * (1 - r) ^ (|U| - |S|) over the subsets S ⊆ U that satisfy E.

This is the measure of BitString.bernoulliAverage carried by subsets of U instead of masks U → Bool: bernoulliProb_eq_bernoulliAverage identifies the two through the bijection between subsets of U and their indicator masks. We keep the Finset carrier because the events of PPSZ are monotone families of variable sets and Mathlib's FKG inequality fkg, which gives the Harris inequality bernoulliProb_mul_le, is stated on the lattice Finset α.

theorem Cslib.Complexity.PPSZ.bernoulliProb_eq_sum {α : Type u_1} (U : Finset α) (r : ℝ) (E : Finset α → Prop) [DecidablePred E] :
bernoulliProb U r E = ∑ S ∈ U.powerset with E S, r ^ S.card * (1 - r) ^ (U.card - S.card)

bernoulliProb as a sum, for any decidability instance of the event.

theorem Cslib.Complexity.PPSZ.bernoulliProb_congr {α : Type u_1} {U : Finset α} {r : ℝ} {E F : Finset α → Prop} (h : ∀ S ⊆ U, E S ↔ F S) :

Events that agree on the subsets of U have the same probability.

theorem Cslib.Complexity.PPSZ.bernoulliProb_nonneg {α : Type u_1} {U : Finset α} {r : ℝ} {E : Finset α → Prop} (hr : r ∈ Set.Icc 0 1) :

Probabilities are nonnegative for r ∈ [0, 1].

theorem Cslib.Complexity.PPSZ.bernoulliProb_true {α : Type u_1} (U : Finset α) (r : ℝ) :
(bernoulliProb U r fun (x : Finset α) => True) = 1

The weights sum to one.

@[simp]
theorem Cslib.Complexity.PPSZ.bernoulliProb_false {α : Type u_1} (U : Finset α) (r : ℝ) :
(bernoulliProb U r fun (x : Finset α) => False) = 0

The impossible event has probability 0.

theorem Cslib.Complexity.PPSZ.bernoulliProb_le_one {α : Type u_1} {U : Finset α} {r : ℝ} {E : Finset α → Prop} (hr : r ∈ Set.Icc 0 1) :

Probabilities are at most 1 for r ∈ [0, 1].

theorem Cslib.Complexity.PPSZ.bernoulliProb_eq_bernoulliAverage {α : Type u_1} [DecidableEq α] (U : Finset α) (r : ℝ) (E : Finset α → Prop) [DecidablePred E] :
bernoulliProb U r E = BitString.bernoulliAverage r fun (s : ↥U → Bool) => if E (Finset.map (Function.Embedding.subtype fun (x : α) => x ∈ U) {i : ↥U | s i = true}) then 1 else 0

Masks and subsets. bernoulliProb U r E is the expectation, under BitString.bernoulliAverage at rate r, of the indicator of E evaluated at the subset {a ∈ U | s a} of U selected by a mask s : U → Bool.

theorem Cslib.Complexity.PPSZ.continuous_bernoulliProb {α : Type u_1} (U : Finset α) (E : Finset α → Prop) :
Continuous fun (r : ℝ) => bernoulliProb U r E

The probability of an event is a polynomial in r, hence continuous.

theorem Cslib.Complexity.PPSZ.bernoulliProb_insert {α : Type u_1} {U : Finset α} {r : ℝ} [DecidableEq α] {v : α} (hv : v ∉ U) (E : Finset α → Prop) :
bernoulliProb (insert v U) r E = (1 - r) * bernoulliProb U r E + r * bernoulliProb U r fun (S : Finset α) => E (insert v S)

Conditioning on one element. For v ∉ U, a random subset of insert v U omits v with probability 1 - r and contains it with probability r.

theorem Cslib.Complexity.PPSZ.bernoulliProb_mem_or {α : Type u_1} {U : Finset α} {r : ℝ} {E : Finset α → Prop} [DecidableEq α] {v : α} (hv : v ∈ U) (hind : ∀ (S : Finset α), E (insert v S) ↔ E S) :
(bernoulliProb U r fun (S : Finset α) => v ∈ S ∨ E S) = r + (1 - r) * bernoulliProb U r E

An element and an independent event. If v ∈ U and E does not depend on v, then a random subset contains v or satisfies E with probability r + (1 - r) * Pr[E].

theorem Cslib.Complexity.PPSZ.bernoulliProb_mem {α : Type u_1} {U : Finset α} {r : ℝ} {v : α} (hv : v ∈ U) :
(bernoulliProb U r fun (S : Finset α) => v ∈ S) = r

A given element is in the random set with probability r.

theorem Cslib.Complexity.PPSZ.bernoulliProb_union_of_forall_insert {α : Type u_1} {U : Finset α} {r : ℝ} {E : Finset α → Prop} [DecidableEq α] {D : Finset α} (hUD : Disjoint U D) (hE : ∀ v ∈ D, ∀ (S : Finset α), E (insert v S) ↔ E S) :
bernoulliProb (U ∪ D) r E = bernoulliProb U r E

Ignored elements do not matter (original). If D is disjoint from U and E does not depend on the elements of D, then a random subset of U ∪ D satisfies E with the same probability as a random subset of U.

theorem Cslib.Complexity.PPSZ.integral_bernoulliProb {α : Type u_1} (U : Finset α) (E : Finset α → Prop) [DecidablePred E] :
∫ (r : ℝ) in 0..1, bernoulliProb U r E = ∑ S ∈ U.powerset with E S, ↑S.card.factorial * ↑(U.card - S.card).factorial / ↑(U.card + 1).factorial

Averaging independent inclusion over r (original): ∫₀¹ Pr[E] dr gives each subset S ⊆ U the weight |S|! * (|U| - |S|)! / (|U| + 1)!, by the Beta integral.

theorem Cslib.Complexity.PPSZ.card_add_one_mul_integral_bernoulliProb {α : Type u_1} [DecidableEq α] (U : Finset α) (E : Finset α → Prop) [DecidablePred E] :
(↑U.card + 1) * ∫ (r : ℝ) in 0..1, bernoulliProb U r E = (if E ∅ then 1 else 0) + ∑ y ∈ U, ∫ (r : ℝ) in 0..1, bernoulliProb (U.erase y) r fun (S : Finset α) => E (insert y S)

The first element of a random order, for independent inclusion (original). For every event E on subsets of U, (|U| + 1) * ∫₀¹ Pr_U[E] dr = [E ∅] + ∑ y ∈ U, ∫₀¹ Pr_{U ∖ {y}}[E (insert y ·)] dr. By card_filter_placedBefore_div_factorial_eq_integral, the integrals are probabilities over a uniformly random order of U and one more element x, of the event on the set placed before x. The identity conditions on the first element of the order: it is x with probability 1 / (|U| + 1), and the set placed before x is then empty; it is y ∈ U with the same probability, and the rest of the order is then uniform.

theorem Cslib.Complexity.PPSZ.bernoulliProb_mul_le {α : Type u_1} {U : Finset α} {r : ℝ} {E F : Finset α → Prop} [Finite α] (hr : r ∈ Set.Icc 0 1) (hE : Monotone E) (hF : Monotone F) :
bernoulliProb U r E * bernoulliProb U r F ≤ bernoulliProb U r fun (S : Finset α) => E S ∧ F S

The Harris inequality. Increasing events are positively correlated under independent inclusion; a consequence of the FKG inequality (Mathlib's fkg).

theorem Cslib.Complexity.PPSZ.prod_le_bernoulliProb_forall {α : Type u_1} {U : Finset α} {r : ℝ} [Finite α] (hr : r ∈ Set.Icc 0 1) {ι : Type u_2} (s : Finset ι) {E : ι → Finset α → Prop} (hE : ∀ i ∈ s, Monotone (E i)) :
∏ i ∈ s, bernoulliProb U r (E i) ≤ bernoulliProb U r fun (S : Finset α) => ∀ i ∈ s, E i S

The Harris inequality for a finite family of increasing events.

theorem Cslib.Complexity.PPSZ.prod_le_bernoulliProb_forall_or {α : Type u_1} {U : Finset α} {r : ℝ} [Finite α] [DecidableEq α] (hr : r ∈ Set.Icc 0 1) {ι : Type u_2} (s : Finset ι) {v : ι → α} {E : ι → Finset α → Prop} (hv : ∀ i ∈ s, v i ∈ U) (hE : ∀ i ∈ s, Monotone (E i)) (hind : ∀ i ∈ s, ∀ (S : Finset α), E i (insert (v i) S) ↔ E i S) :
∏ i ∈ s, (r + (1 - r) * bernoulliProb U r (E i)) ≤ bernoulliProb U r fun (S : Finset α) => ∀ i ∈ s, v i ∈ S ∨ E i S

The PPSZ product bound, the fixed-r form of Paturi, Pudlák, Saks, Zane, Lemma 7 with all qᵢ = r. Let vᵢ ∈ U and let Eᵢ be increasing events that do not depend on vᵢ. Then the event that every vᵢ is in the random set or Eᵢ holds has probability at least ∏ᵢ (r + (1 - r) * Pr[Eᵢ]). In the paper, vᵢ are the children of the root of a critical clause tree and Eᵢ are the cut events of the subtrees below them.

theorem Cslib.Complexity.PPSZ.pow_le_bernoulliProb_forall_or {α : Type u_1} {U : Finset α} {r : ℝ} [Finite α] [DecidableEq α] (hr : r ∈ Set.Icc 0 1) {ι : Type u_2} {s : Finset ι} {v : ι → α} {E : ι → Finset α → Prop} (hv : ∀ i ∈ s, v i ∈ U) (hE : ∀ i ∈ s, Monotone (E i)) (hind : ∀ i ∈ s, ∀ (S : Finset α), E i (insert (v i) S) ↔ E i S) {m : ℕ} (hs : s.card ≤ m) {q : ℝ} (hq : q ∈ Set.Icc 0 1) (hqE : ∀ i ∈ s, q ≤ bernoulliProb U r (E i)) :
(r + (1 - r) * q) ^ m ≤ bernoulliProb U r fun (S : Finset α) => ∀ i ∈ s, v i ∈ S ∨ E i S

The PPSZ product bound, uniform form. If there are at most m events Eᵢ as in prod_le_bernoulliProb_forall_or, each of probability at least q ∈ [0, 1], the probability is at least (r + (1 - r) * q) ^ m.

theorem Cslib.Complexity.PPSZ.Q_succ_le_bernoulliProb_forall_or {α : Type u_1} {U : Finset α} {r : ℝ} [Finite α] [DecidableEq α] (hr : r ∈ Set.Icc 0 1) {ι : Type u_2} {s : Finset ι} {v : ι → α} {E : ι → Finset α → Prop} (hv : ∀ i ∈ s, v i ∈ U) (hE : ∀ i ∈ s, Monotone (E i)) (hind : ∀ i ∈ s, ∀ (S : Finset α), E i (insert (v i) S) ↔ E i S) {k d : ℕ} (hs : s.card ≤ k - 1) (hqE : ∀ i ∈ s, Q k d r ≤ bernoulliProb U r (E i)) :
Q k (d + 1) r ≤ bernoulliProb U r fun (S : Finset α) => ∀ i ∈ s, v i ∈ S ∨ E i S

One step of the depth recursion. If at most k - 1 increasing events Eᵢ, each not depending on vᵢ ∈ U, have probability at least Q k d r, then the event that every vᵢ is in the random set or Eᵢ holds has probability at least Q k (d + 1) r.

theorem Cslib.Complexity.PPSZ.Q_le_bernoulliProb {α : Type u_1} {U : Finset α} {r : ℝ} [Finite α] [DecidableEq α] (hr : r ∈ Set.Icc 0 1) {k : ℕ} {β : Type u_2} (E : ℕ → β → Finset α → Prop) (good : ℕ → β → Prop) (ch : β → Finset α) (nxt : β → α → β) (hmono : ∀ (d : ℕ) (b : β), good d b → Monotone (E d b)) (hch : ∀ (d : ℕ) (b : β), good (d + 1) b → ch b ⊆ U ∧ (ch b).card ≤ k - 1) (hgood : ∀ (d : ℕ) (b : β), good (d + 1) b → ∀ y ∈ ch b, good d (nxt b y)) (hind : ∀ (d : ℕ) (b : β), good (d + 1) b → ∀ y ∈ ch b, ∀ (S : Finset α), E d (nxt b y) (insert y S) ↔ E d (nxt b y) S) (hrec : ∀ (d : ℕ) (b : β), good (d + 1) b → ∀ S ⊆ U, E (d + 1) b S ↔ ∀ y ∈ ch b, y ∈ S ∨ E d (nxt b y) S) (d : ℕ) (b : β) :
good d b → Q k d r ≤ bernoulliProb U r (E d b)

The depth recursion bounds recursive events Paturi, Pudlák, Saks, Zane, p. 351. Let E d b be increasing events indexed by a height d and a node b, among the nodes satisfying good d b. Suppose a good node b of height d + 1 has a set ch b ⊆ U of at most k - 1 child labels, the child nxt b y of label y is good of height d, its event does not depend on y, and E (d + 1) b holds exactly when every child label is in the set or its child's event holds. Then every good node of height d has Q k d r ≤ Pr[E d b]. For a critical clause tree, E d b is the event that the paths of length d below b are cut.

Random placements #

The variables placed before x by the order π, in which π j is placed at step j. This is PPZ.prefixSet π (π.symm x) (placedBefore_eq_prefixSet, in CslibFrontier.Computability.Complexity.FineGrained.PPSZ.Unique); it is defined separately because this file does not depend on formulas or on PPZ.

theorem Cslib.Complexity.PPSZ.mem_placedBefore {n : ℕ} {π : Equiv.Perm (Fin n)} {x y : Fin n} :
y ∈ placedBefore π x ↔ (Equiv.symm π) y < (Equiv.symm π) x

y is placed before x when its position is smaller.

x is not placed before itself.

theorem Cslib.Complexity.PPSZ.card_placedBefore {n : ℕ} (π : Equiv.Perm (Fin n)) (x : Fin n) :
(placedBefore π x).card = ↑((Equiv.symm π) x)

x is preceded by as many variables as its position.

theorem Cslib.Complexity.PPSZ.card_filter_placedBefore_eq {n : ℕ} {x : Fin n} {S : Finset (Fin n)} (hx : x ∉ S) :
{π : Equiv.Perm (Fin n) | placedBefore π x = S}.card = S.card.factorial * (n - 1 - S.card).factorial

The orders placing S before x (original): |S|! * (n - 1 - |S|)! of the n! orders place exactly the variables of S before x.

theorem Cslib.Complexity.PPSZ.card_filter_placedBefore_mul_choose {n : ℕ} {x : Fin n} {S : Finset (Fin n)} (hx : x ∉ S) :
{π : Equiv.Perm (Fin n) | placedBefore π x = S}.card * (n * (n - 1).choose S.card) = n.factorial

The set placed before x is uniform given its size (original): it is a given set S in a 1 / (n * C(n - 1, |S|)) fraction of the orders.

theorem Cslib.Complexity.PPSZ.card_filter_placedBefore_div_factorial {n : ℕ} {x : Fin n} {S : Finset (Fin n)} (hx : x ∉ S) :
↑{π : Equiv.Perm (Fin n) | placedBefore π x = S}.card / ↑n.factorial = ∫ (r : ℝ) in 0..1, r ^ S.card * (1 - r) ^ (n - 1 - S.card)

The placement integral for one set (original): the probability that exactly the variables of S are placed before x is ∫₀¹ r ^ |S| * (1 - r) ^ (n - 1 - |S|) dr.

Random orders as random placements (original). For every event E on sets of variables, the probability over a uniformly random order that the set placed before x satisfies E is the average over r ∈ [0, 1] of the probability of E when each other variable is included independently with probability r.

theorem Cslib.Complexity.PPSZ.qbar_le_card_filter_placedBefore_div_factorial {n k d : ℕ} {x : Fin n} {E : Finset (Fin n) → Prop} [DecidablePred E] (h : ∀ r ∈ Set.Icc 0 1, Q k d r ≤ bernoulliProb (Finset.univ.erase x) r E) :
qbar k d ≤ ↑{π : Equiv.Perm (Fin n) | E (placedBefore π x)}.card / ↑n.factorial

The depth bound for a random order. If for every r ∈ [0, 1] the event E has probability at least Q k d r under independent inclusion of the variables other than x, then over a uniformly random order the set placed before x satisfies E with probability at least qbar k d.