Documentation

CslibFrontier.Computability.Complexity.FineGrained.PPZ.LazyOrder

PPZ rounds in a lazily sampled order #

A round of PPZ or PPSZ (Cslib.Complexity.PPZ.roundWith) processes the variables in a uniformly random order, sampled eagerly as a permutation. An implementation samples the order lazily, as in the Fisher–Yates shuffle: it keeps the unprocessed variables in an array, and at each step it swaps a uniformly chosen one to the front and processes it.

Cslib.Complexity.PPZ.roundOn O g τ processes the variables g 0, …, g (m - 1) in a uniformly random order, starting from the partial assignment τ. Choosing the first of them uniformly and recursing on the others is the same random process (Cslib.Complexity.PPZ.roundOn_succ): after p is processed, the array g with g 0 and g p swapped lists the remaining variables from position 1 on. This is the decomposition Equiv.Perm.decomposeFin of a uniform permutation into its value at 0 and a uniform permutation of the rest. A round is the case of all variables from the empty assignment (Cslib.Complexity.PPZ.roundWith_eq_roundOn).

Main definitions #

Main results #

noncomputable def Cslib.Complexity.PPZ.runList {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) :
List (Fin n) → (Fin n → Option Bool) → PMF (Fin n → Option Bool)

Process the variables of l in order with the oracle O, starting from τ.

noncomputable def Cslib.Complexity.PPZ.roundOn {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) {m : ℕ} (g : Fin m → Fin n) (τ : Fin n → Option Bool) :
PMF (Fin n → Option Bool)

Process the variables g 0, …, g (m - 1) in a uniformly random order with the oracle O, starting from τ.

theorem Cslib.Complexity.PPZ.runList_nil {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) (τ : Fin n → Option Bool) :
theorem Cslib.Complexity.PPZ.runList_cons {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) (x : Fin n) (l : List (Fin n)) (τ : Fin n → Option Bool) :
runList O (x :: l) τ = (stepWith O τ x).bind fun (b : Bool) => runList O l (Function.update τ x (some b))
theorem Cslib.Complexity.PPZ.runList_append_singleton {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) (l : List (Fin n)) (x : Fin n) (τ : Fin n → Option Bool) :
runList O (l ++ [x]) τ = (runList O l τ).bind fun (τ' : Fin n → Option Bool) => PMF.map (fun (b : Bool) => Function.update τ' x (some b)) (stepWith O τ' x)

Processing one more variable at the end of a list.

theorem Cslib.Complexity.PPZ.runWith_eq_runList {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) (π : Equiv.Perm (Fin n)) {i : ℕ} (hi : i ≤ n) :
runWith O π i = runList O (List.ofFn fun (j : Fin i) => π (Fin.castLE hi j)) fun (x : Fin n) => none

A run in a fixed order processes the list of the first i values of the order.

theorem Cslib.Complexity.PPZ.roundOn_zero {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) (g : Fin 0 → Fin n) (τ : Fin n → Option Bool) :
roundOn O g τ = PMF.pure τ

No variables: nothing changes.

theorem Cslib.Complexity.PPZ.roundOn_succ {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) {m : ℕ} (g : Fin (m + 1) → Fin n) (τ : Fin n → Option Bool) :
roundOn O g τ = (Probability.PMF.uniformOfFintype (Fin (m + 1))).bind fun (p : Fin (m + 1)) => (stepWith O τ (g p)).bind fun (b : Bool) => roundOn O (fun (i : Fin m) => g ((Equiv.swap 0 p) i.succ)) (Function.update τ (g p) (some b))

The lazy form of a uniformly random order. Processing g 0, …, g m in a uniformly random order is the same as choosing p uniformly, processing g p, and then processing the others in a uniformly random order. The others are listed by g after swapping positions 0 and p, from position 1 on.

theorem Cslib.Complexity.PPZ.roundWith_eq_roundOn {n : ℕ} (O : (Fin n → Option Bool) → Fin n → Option Bool) :
roundWith O = roundOn O id fun (x : Fin n) => none

A round is roundOn on all variables from the empty assignment.