Documentation

CslibFrontier.Probability.SaksZhou

The Saks–Zhou iteration #

Saks and Zhou [SZ99] compute a high power M ^ (n₁ ^ n₂) of a substochastic matrix by iterating an approximate n₁-th power n₂ times. Each round reuses the same random seed y but uses a fresh random shift zᵢ. In the presentation of [ChattopadhyayLiao2020, Appendix A.1], let pow A y be an "offline randomized" approximation of A ^ n₁ with seed y ∈ Ω, and let M̂₀ = M and M̂ᵢ = Snap_d(pow M̂ᵢ₋₁ y, zᵢ) (snapIter). Lemma A.4 there states that M̂_{n₂} is close to M ^ (n₁ ^ n₂) with high probability over (y, z₁, …, z_{n₂}). This file proves this probability statement in exact density form, with explicit constants and for an arbitrary finite seed space Ω. Here pow is an arbitrary function, so the space clause of Lemma A.4 (M̂_{n₂} is computable in space O(r + n₂ (s + d))) is not formalized; it belongs to the space-bounded realization in #474.

Suppose that for A = M and for every dyadic substochastic A at precision d, at most an ε fraction of the seeds y give |pow A y - A ^ n₁| > ε in some entry (entryFarSet). Then:

With n = n₁ ^ n₂, this is the bound ‖M̂_{n₂} - M ^ n‖_∞ ≤ n w 2 ^ (1 - d) of [ChattopadhyayLiao2020, Lemma A.4], with failure probability n₂ (ε + w ^ 2 (2 ^ d ε + 2 ^ (-d))) in place of O(w ^ 2 n₂ (2 ^ d ε + 2 ^ (-d))). Three points differ from that statement. Only the probability statement is formalized, not the space clause. The hypothesis on pow is needed only for M and for dyadic substochastic matrices, which are the only matrices the reference iteration visits; this is the setting of [Hoza2021, proof of Theorem A.3], where the matrices have a-bit entries. The geometric sum ∑_{k < n₂} n₁ ^ k is the exact solution of the error recursion; it is at most n₁ ^ n₂ only for n₁ ≥ 2. For n₁ = 1 the iteration can lose 2 ^ (-d) in every round, so the form n w 2 ^ (1 - d) needs n₁ ≥ 2. The tests give a 1 × 1 example.

The bad-seed and far sets are named (entryFarSet, rowFarSet) so that their decidability instances are fixed once. Restating them with set-builder notation at a concrete ι = Fin w would elaborate ∃ i with Nat.decidableExistsFin instead of Fintype.decidableExistsFintype, and the two sets would then match only up to congr!.

Proof #

The reference iterates are dyadic substochastic, so the hypothesis applies to them. Fix a round i and the earlier shifts. If the actual and reference iterates agree before round i, they disagree after it only if pow Mᵢ₋₁ y is ε-far from Mᵢ₋₁ ^ n₁, which has density at most ε in y, or if the two are ε-close but snap differently under the fresh shift zᵢ, which has density at most w ^ 2 (2 ^ d ε + 2 ^ (-d)) in zᵢ by Lemma A.3 (dens_snapMatrix_ne_le). A hybrid argument over the rounds sums these bounds. For the deterministic error, snapping a nonnegative matrix changes each row by at most w 2 ^ (1 - d) in absolute sum, which is the per-step bound of [ChattopadhyayLiao2020, proof of Lemma A.4], and the n₁-th power is n₁-Lipschitz on the unit ball of the matrix ∞-norm (Matrix.sum_abs_pow_sub_pow_le). So the error Eᵢ satisfies Eᵢ ≤ w 2 ^ (1 - d) + n₁ Eᵢ₋₁. This recursion and its exact solution are derived here; [CL20] states only the per-step bound and then cites Lemma 5.4 of [SZ99] for the conclusion.

Main definitions #

Main results #

References #

noncomputable def Cslib.Probability.SaksZhou.entryFarSet {Ω : Type u_2} {κ : Type u_3} {ν : Type u_4} [Fintype Ω] [Fintype κ] [Fintype ν] (ε : ℝ) (X : Ω → Matrix κ ν ℝ) (B : Matrix κ ν ℝ) :

The points y at which X y is ε-far from B in some entry. For X = pow A and B = A ^ n₁ these are the bad seeds of the hypothesis of Lemma A.4.

@[simp]
theorem Cslib.Probability.SaksZhou.mem_entryFarSet {Ω : Type u_2} {κ : Type u_3} {ν : Type u_4} [Fintype Ω] [Fintype κ] [Fintype ν] {ε : ℝ} {X : Ω → Matrix κ ν ℝ} {B : Matrix κ ν ℝ} {y : Ω} :
y ∈ entryFarSet ε X B ↔ ∃ (i : κ) (j : ν), ε < |X y i j - B i j|
noncomputable def Cslib.Probability.SaksZhou.rowFarSet {Ω : Type u_2} {κ : Type u_3} {ν : Type u_4} [Fintype Ω] [Fintype κ] [Fintype ν] (c : ℝ) (X : Ω → Matrix κ ν ℝ) (B : Matrix κ ν ℝ) :

The points p at which some row of X p - B has absolute sum greater than c.

@[simp]
theorem Cslib.Probability.SaksZhou.mem_rowFarSet {Ω : Type u_2} {κ : Type u_3} {ν : Type u_4} [Fintype Ω] [Fintype κ] [Fintype ν] {c : ℝ} {X : Ω → Matrix κ ν ℝ} {B : Matrix κ ν ℝ} {p : Ω} :
p ∈ rowFarSet c X B ↔ ∃ (i : κ), c < ∑ j : ν, |X p i j - B i j|
noncomputable def Cslib.Probability.SaksZhou.snapIter {ι : Type u_1} (d : ℕ) (pow : Matrix ι ι ℝ → Matrix ι ι ℝ) (M : Matrix ι ι ℝ) (n : ℕ) :
(Fin n → Fin (2 ^ d)) → Matrix ι ι ℝ

The Saks–Zhou iteration: snapIter d pow M n z is M̂ₙ, where M̂₀ = M and M̂ᵢ₊₁ = Snap_d(pow M̂ᵢ, zᵢ) for the shifts z = (z₀, …, z_{n-1}). With pow = (· ^ n₁) it is the reference iteration of [ChattopadhyayLiao2020, proof of Lemma A.4].

@[simp]
theorem Cslib.Probability.SaksZhou.snapIter_zero {ι : Type u_1} (d : ℕ) (pow : Matrix ι ι ℝ → Matrix ι ι ℝ) (M : Matrix ι ι ℝ) (z : Fin 0 → Fin (2 ^ d)) :
snapIter d pow M 0 z = M
theorem Cslib.Probability.SaksZhou.snapIter_succ {ι : Type u_1} (d : ℕ) (pow : Matrix ι ι ℝ → Matrix ι ι ℝ) (M : Matrix ι ι ℝ) (n : ℕ) (z : Fin (n + 1) → Fin (2 ^ d)) :
snapIter d pow M (n + 1) z = snapMatrix d (pow (snapIter d pow M n (Fin.init z))) (z (Fin.last n))
@[simp]
theorem Cslib.Probability.SaksZhou.snapIter_snoc {ι : Type u_1} (d : ℕ) (pow : Matrix ι ι ℝ → Matrix ι ι ℝ) (M : Matrix ι ι ℝ) (n : ℕ) (z : Fin n → Fin (2 ^ d)) (t : Fin (2 ^ d)) :
snapIter d pow M (n + 1) (Fin.snoc z t) = snapMatrix d (pow (snapIter d pow M n z)) t
theorem Cslib.Probability.SaksZhou.isDyadicSubstochastic_snapIter {ι : Type u_1} [Fintype ι] [DecidableEq ι] (d n₁ : ℕ) {M : Matrix ι ι ℝ} (h0 : ∀ (i j : ι), 0 ≤ M i j) (h1 : ∀ (i : ι), ∑ j : ι, M i j ≤ 1) (n : ℕ) (z : Fin (n + 1) → Fin (2 ^ d)) :
IsDyadicSubstochastic d (snapIter d (fun (x : Matrix ι ι ℝ) => x ^ n₁) M (n + 1) z)

The reference iterates Mᵢ = Snap_d(Mᵢ₋₁ ^ n₁, zᵢ), i ≥ 1, of a substochastic matrix are dyadic substochastic.

theorem Cslib.Probability.SaksZhou.sum_abs_snapIter_sub_pow_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] (d n₁ : ℕ) {M : Matrix ι ι ℝ} (h0 : ∀ (i j : ι), 0 ≤ M i j) (h1 : ∀ (i : ι), ∑ j : ι, M i j ≤ 1) (n : ℕ) (z : Fin n → Fin (2 ^ d)) (i : ι) :
∑ j : ι, |snapIter d (fun (x : Matrix ι ι ℝ) => x ^ n₁) M n z i j - (M ^ n₁ ^ n) i j| ≤ (∑ k ∈ Finset.range n, ↑n₁ ^ k) * (↑(Fintype.card ι) * (2 / 2 ^ d))

The deterministic error of the reference iteration: every row of Mₙ - M ^ (n₁ ^ n) has absolute sum at most (∑_{k < n} n₁ ^ k) w 2 ^ (1 - d), where w = |ι|. This solves the recursion Eᵢ ≤ w 2 ^ (1 - d) + n₁ Eᵢ₋₁, derived here from the per-step snapping bound of [ChattopadhyayLiao2020, proof of Lemma A.4] and the power perturbation bound Matrix.sum_abs_pow_sub_pow_le; [CL20] cites Lemma 5.4 of [SZ99] for this step.

theorem Cslib.Probability.SaksZhou.dens_snapIter_ne_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {Ω : Type u_2} [Fintype Ω] (d n₁ n₂ : ℕ) (pow : Matrix ι ι ℝ → Ω → Matrix ι ι ℝ) {M : Matrix ι ι ℝ} {ε : ℝ} (h0 : ∀ (i j : ι), 0 ≤ M i j) (h1 : ∀ (i : ι), ∑ j : ι, M i j ≤ 1) (hε : 0 ≤ ε) (hpow : ∀ (A : Matrix ι ι ℝ), A = M ∨ IsDyadicSubstochastic d A → ↑(entryFarSet ε (pow A) (A ^ n₁)).dens ≤ ε) :
↑{p : Ω × (Fin n₂ → Fin (2 ^ d)) | snapIter d (fun (A : Matrix ι ι ℝ) => pow A p.1) M n₂ p.2 ≠ snapIter d (fun (x : Matrix ι ι ℝ) => x ^ n₁) M n₂ p.2}.dens ≤ ↑n₂ * (ε + ↑(Fintype.card ι) ^ 2 * (2 ^ d * ε + (2 ^ d)⁻¹))

Coupling with the reference iteration [ChattopadhyayLiao2020, proof of Lemma A.4]. Let M be substochastic, and suppose that for A = M and for every dyadic substochastic A at precision d, the seeds y ∈ Ω with |pow A y - A ^ n₁| > ε in some entry have density at most ε. Then the iteration M̂_{n₂} = snapIter d (pow · y) M n₂ z, with one shared seed y and independent uniform shifts z, differs from the reference iteration snapIter d (· ^ n₁) M n₂ z on a set of density at most n₂ (ε + w ^ 2 (2 ^ d ε + 2 ^ (-d))), where w = |ι|.

theorem Cslib.Probability.SaksZhou.dens_snapIter_far_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {Ω : Type u_2} [Fintype Ω] (d n₁ n₂ : ℕ) (pow : Matrix ι ι ℝ → Ω → Matrix ι ι ℝ) {M : Matrix ι ι ℝ} {ε : ℝ} (h0 : ∀ (i j : ι), 0 ≤ M i j) (h1 : ∀ (i : ι), ∑ j : ι, M i j ≤ 1) (hε : 0 ≤ ε) (hpow : ∀ (A : Matrix ι ι ℝ), A = M ∨ IsDyadicSubstochastic d A → ↑(entryFarSet ε (pow A) (A ^ n₁)).dens ≤ ε) :
↑(rowFarSet ((∑ k ∈ Finset.range n₂, ↑n₁ ^ k) * (↑(Fintype.card ι) * (2 / 2 ^ d))) (fun (p : Ω × (Fin n₂ → Fin (2 ^ d))) => snapIter d (fun (A : Matrix ι ι ℝ) => pow A p.1) M n₂ p.2) (M ^ n₁ ^ n₂)).dens ≤ ↑n₂ * (ε + ↑(Fintype.card ι) ^ 2 * (2 ^ d * ε + (2 ^ d)⁻¹))

The Saks–Zhou iteration [ChattopadhyayLiao2020, Lemma A.4], with the exact error sum. Under the hypotheses of dens_snapIter_ne_le, the pairs (y, z) for which some row of M̂_{n₂} - M ^ (n₁ ^ n₂) has absolute sum greater than (∑_{k < n₂} n₁ ^ k) w 2 ^ (1 - d) have density at most n₂ (ε + w ^ 2 (2 ^ d ε + 2 ^ (-d))). Only the probability statement of Lemma A.4 is formalized: pow is an arbitrary function, and the space clause is left to the space-bounded realization (#474).

theorem Cslib.Probability.SaksZhou.dens_snapIter_far_le_of_two_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {Ω : Type u_2} [Fintype Ω] (d : ℕ) {n₁ : ℕ} (n₂ : ℕ) (hn₁ : 2 ≤ n₁) (pow : Matrix ι ι ℝ → Ω → Matrix ι ι ℝ) {M : Matrix ι ι ℝ} {ε : ℝ} (h0 : ∀ (i j : ι), 0 ≤ M i j) (h1 : ∀ (i : ι), ∑ j : ι, M i j ≤ 1) (hε : 0 ≤ ε) (hpow : ∀ (A : Matrix ι ι ℝ), A = M ∨ IsDyadicSubstochastic d A → ↑(entryFarSet ε (pow A) (A ^ n₁)).dens ≤ ε) :
↑(rowFarSet (↑n₁ ^ n₂ * (↑(Fintype.card ι) * (2 / 2 ^ d))) (fun (p : Ω × (Fin n₂ → Fin (2 ^ d))) => snapIter d (fun (A : Matrix ι ι ℝ) => pow A p.1) M n₂ p.2) (M ^ n₁ ^ n₂)).dens ≤ ↑n₂ * (ε + ↑(Fintype.card ι) ^ 2 * (2 ^ d * ε + (2 ^ d)⁻¹))

The Saks–Zhou iteration [ChattopadhyayLiao2020, Lemma A.4]: for n₁ ≥ 2 and n = n₁ ^ n₂, except on a set of density at most n₂ (ε + w ^ 2 (2 ^ d ε + 2 ^ (-d))), every row of M̂_{n₂} - M ^ n has absolute sum at most n w 2 ^ (1 - d). As in dens_snapIter_far_le, only the probability statement is formalized, not the space clause. The restriction n₁ ≥ 2 is needed: for n₁ = 1 the error can reach n₂ 2 ^ (-d), and the tests give an example.