Documentation

CslibFrontier.Probability.SaksZhou.Walk

Walks realizing substochastic matrices #

A substochastic matrix A over states ι whose entries are multiples of 1 / |X|, for a finite alphabet X, is the transition matrix of a deterministic walk driven by uniformly random letters of X. The walk lives on Option ι, where none is an absorbing sink collecting the missing mass of each row. From state some i, the letters are split into disjoint parts, A i j |X| letters moving to some j for each j, and the remaining letters move to none. The supplied order of the columns and numbering of the alphabet assign consecutive intervals of letters to the columns (walkStep_eq_some_iff).

Reading m uniform letters then moves some i to some j with probability (A ^ m) i j (dens_foldl_walkStep_eq). This is how a matrix produced by rounding, such as the dyadic substochastic matrices of the Saks–Zhou rounding operator, is turned back into a read-once branching program over random letters.

Main definitions #

Main results #

def Cslib.Probability.SaksZhou.walkStepOfCounts {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (counts : Matrix ι ι ℕ) :
Option ι → X → Option ι

Allocate exactly counts i j letters of row i to each column j, consecutively in the supplied order. Unallocated letters, oversized rows and the sink all move to the sink.

@[simp]
theorem Cslib.Probability.SaksZhou.walkStepOfCounts_none {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (counts : Matrix ι ι ℕ) (x : X) :
walkStepOfCounts order letter counts none x = none
noncomputable def Cslib.Probability.SaksZhou.walkStep {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (A : Matrix ι ι ℝ) :
Option ι → X → Option ι

The walk of A on letters of X assigns ⌊A i j |X|⌋₊ letters of row i to each column j using walkStepOfCounts.

theorem Cslib.Probability.SaksZhou.walkStep_eq_walkStepOfCounts {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (A : Matrix ι ι ℝ) (counts : Matrix ι ι ℕ) (h : ∀ (i j : ι), ⌊A i j * ↑(Fintype.card X)⌋₊ = counts i j) :
walkStep order letter A = walkStepOfCounts order letter counts

Replace the real matrix in an ordered walk by its integer multiplicities.

theorem Cslib.Probability.SaksZhou.walkStepOfCounts_eq_some_iff {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (counts : Matrix ι ι ℕ) (i : ι) (j : Fin n) (x : X) (hfit : ∑ t : ι, counts i t ≤ Fintype.card X) :
walkStepOfCounts order letter counts (some i) x = some (order j) ↔ have start := ∑ t : Fin ↑j, counts i (order (Fin.castLE ⋯ t)); start ≤ ↑(letter x) ∧ ↑(letter x) < start + counts i (order j)

In a row whose weights fit, a letter moves to column order j exactly when its index lies between the sum of the preceding column weights and that sum plus the current weight. This lets an evaluator find the destination by scanning the columns in order.

theorem Cslib.Probability.SaksZhou.walkStep_eq_some_iff {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (A : Matrix ι ι ℝ) (i : ι) (j : Fin n) (x : X) (hfit : ∑ t : ι, ⌊A i t * ↑(Fintype.card X)⌋₊ ≤ Fintype.card X) :
walkStep order letter A (some i) x = some (order j) ↔ have start := ∑ t : Fin ↑j, ⌊A i (order (Fin.castLE ⋯ t)) * ↑(Fintype.card X)⌋₊; start ≤ ↑(letter x) ∧ ↑(letter x) < start + ⌊A i (order j) * ↑(Fintype.card X)⌋₊

The destination interval for the integer weights induced by a real matrix.

@[simp]
theorem Cslib.Probability.SaksZhou.walkStep_none {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) (A : Matrix ι ι ℝ) (x : X) :
walkStep order letter A none x = none
theorem Cslib.Probability.SaksZhou.dens_walkStep_eq {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) [Nonempty X] {A : Matrix ι ι ℝ} (h0 : ∀ (i j : ι), 0 ≤ A i j) (h1 : ∀ (i : ι), ∑ j : ι, A i j ≤ 1) (hA : ∀ (i j : ι), ∃ (c : ℕ), A i j * ↑(Fintype.card X) = ↑c) (i j : ι) :
↑{x : X | walkStep order letter A (some i) x = some j}.dens = A i j

One uniform letter moves some i to some j with probability A i j.

theorem Cslib.Probability.SaksZhou.dens_foldl_walkStep_eq {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype X] {n b : ℕ} (order : Fin n ≃ ι) (letter : X ≃ Fin b) [Nonempty X] {A : Matrix ι ι ℝ} (h0 : ∀ (i j : ι), 0 ≤ A i j) (h1 : ∀ (i : ι), ∑ j : ι, A i j ≤ 1) (hA : ∀ (i j : ι), ∃ (c : ℕ), A i j * ↑(Fintype.card X) = ↑c) (m : ℕ) (i j : ι) :
↑{u : Fin m → X | List.foldl (walkStep order letter A) (some i) (List.ofFn u) = some j}.dens = (A ^ m) i j

The walk realizes the matrix powers: m uniform letters move some i to some j with probability (A ^ m) i j.