Documentation

CslibFrontier.Probability.PairwiseIndependentHash.ProductValidatedWords

Validated walk words for the multi-component product sampler #

CslibFrontier.Probability.PairwiseIndependentHash.ValidatedWords expresses t steps of the lazy conditional walk on a single retention slice as an iterate of a validated variant operator over the ambient channel space FrameChannel P H r. Meanwhile, CslibFrontier.Probability.PairwiseIndependentHash.ComponentGap proves the spectral gap for the multi-component lazy product walk (componentMove H M P L, transported along componentEquiv) over J conditioned channels together with a free-bit torus (ZMod M) ^ H.

This module bridges those two layers by formalizing Section 6.1, Lemma 6.3 (lem:env-variants, items 1–4) of [OAI26e] directly on the multi-component product environment ComponentSpace H M P = (∀ j, FrameChannel (P j) H 1) × (Fin H → ZMod M):

Main definitions #

Main results #

References #

Bounded alphabets and ambient multi-component space #

The candidate wrap box {-3, …, 3} ^ H, independent of the primes, side lengths, torus modulus, identifiers, and walk length.

The wrap box affineWrapBox H has cardinality 7 ^ H.

@[reducible, inline]

Generator index of componentMove H M P L: either a channel index j : Fin J paired with an affine generator, or a torus affine generator.

@[reducible, inline]

Edge label of the lazy product walk (ofPerms (componentMove H M P L)).lazy: .inl (m, b) applies generator m in direction b, while .inr (m, b) is a lazy self-loop.

The lazy product walk has 4 * (J + 1) * H ^ 2 edge labels per step.

@[reducible, inline]
abbrev Cslib.Probability.ComponentSpace (H M : ℕ) {J : ℕ} (P : Fin J → ℕ) :

The ambient multi-component environment: J frame channels of rank 1 together with a free-bit torus (ZMod M) ^ H.

@[reducible, inline]
abbrev Cslib.Probability.ComponentSlice (H M : ℕ) {J : ℕ} (P : Fin J → ℕ) [∀ (j : Fin J), NeZero (P j)] (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) :

The product retention slice retaining y j in channel j for all j : Fin J, paired with the free-bit torus (ZMod M) ^ H.

def Cslib.Probability.componentSliceVal {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), NeZero (P j)] {L : Fin J → ℕ} {y : (j : Fin J) → ZMod (P j)} (A : ComponentSlice H M P L y) :

Forgetful embedding from the product retention slice into the ambient ComponentSpace.

One-step ambient variant permutations and wrap validation #

def Cslib.Probability.componentStepPerm {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (e : ComponentLazyStep H J) (z : Fin H → ℤ) :

One-step ambient variant permutation (Lemma 6.3, items 1–2, for t = 1).

  • On .inr _ (a lazy self-loop), it is the identity permutation.
  • On .inl (.inr k, b) (a torus move), it applies torusMove H M k (or its inverse when b = true) to the torus coordinate.
  • On .inl (.inl ⟨j, k⟩, b) (a move on channel j), it applies variantMove (L j) with wrap vector z to channel j and leaves all other components unchanged.

Crucially, this permutation of ComponentSpace H M P does not depend on the identifiers y.

def Cslib.Probability.IsValidComponentStep {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) (e : ComponentLazyStep H J) (z : Fin H → ℤ) (A : ComponentSpace H M P) :

One-step wrap validation test on ComponentSpace H M P. Initial slice membership is carried by ComponentSlice H M P L y (matching ConditionalAveraging and ValidatedWords); channel moves test IsValidWrap on (A.1 j).eval (y j) alone, while torus moves and lazy self-loops require z = 0.

Instances For
    @[instance_reducible]
    instance Cslib.Probability.instDecidableIsValidComponentStep {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) (e : ComponentLazyStep H J) (z : Fin H → ℤ) (A : ComponentSpace H M P) :
    def Cslib.Probability.componentStepWrap {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) (e : ComponentLazyStep H J) (A : ComponentSpace H M P) :
    Fin H → ℤ

    The unique wrap vector passing IsValidComponentStep L y e · A.

    theorem Cslib.Probability.isValidComponentStep_iff {H M J : ℕ} {P L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] {y : (j : Fin J) → ZMod (P j)} {e : ComponentLazyStep H J} {z : Fin H → ℤ} {A : ComponentSpace H M P} :
    theorem Cslib.Probability.componentStepWrap_mem {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), NeZero (P j)] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] {y : (j : Fin J) → ZMod (P j)} (e : ComponentLazyStep H J) (A : ComponentSlice H M P L y) :
    theorem Cslib.Probability.componentStepPerm_wrap_eq {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} (e : ComponentLazyStep H J) (A : ComponentSlice H M P L y) :

    On the product retention slice, the ambient variant with componentStepWrap coincides with the exact neighbor in the reindexed lazy product multigraph.

    theorem Cslib.Probability.sum_ite_isValidComponentStep {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} {R : Type u_1} [AddCommMonoid R] (e : ComponentLazyStep H J) (f : ComponentSpace H M P → R) (A : ComponentSlice H M P L y) :

    One-step sum over candidate wraps: summing f over z ∈ affineWrapBox H filtered by IsValidComponentStep gives f at the conditional slice neighbor.

    noncomputable def Cslib.Probability.componentValidatedStep {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) (g : ComponentSpace H M P → ℝ) (A : ComponentSpace H M P) :

    One-step validated operator on ComponentSpace H M P.

    theorem Cslib.Probability.walk_pow_componentMove_eq_iterate {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} (f : ComponentSpace H M P → ℝ) (t : ℕ) (A : ComponentSlice H M P L y) :
    (((RotationMap.ofPerms (componentMove H M P L)).lazy.reindex (componentEquiv M hL y).symm).walk ^ t) (fun (B : ((j : Fin J) → RetentionSlice (P j) H 1 (L j) (y j)) × (Fin H → ZMod M)) => f (componentSliceVal B)) A = (componentValidatedStep L y)^[t] f (componentSliceVal A)

    Iterated validated operator computes the lazy product walk on ComponentSlice H M P L y.

    Explicit length-t validated walk words (Lemma 6.3, items 1–4) #

    def Cslib.Probability.componentWordPerm {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) {t : ℕ} :
    (Fin t → ComponentLazyStep H J) → (Fin t → Fin H → ℤ) → Equiv.Perm (ComponentSpace H M P)

    Ambient permutation of a length-t word (w, z) (Lemma 6.3, items 1–2): applies step 0, then step 1, …, through step t - 1. Because it is a composition of Equiv.Perms, it is automatically a bijection of ComponentSpace H M P independent of the identifiers y.

    theorem Cslib.Probability.expect_componentWordPerm {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), NeZero (P j)] [NeZero M] (L : Fin J → ℕ) {t : ℕ} (w : Fin t → ComponentLazyStep H J) (z : Fin t → Fin H → ℤ) {R : Type u_1} [AddCommMonoid R] [Module ℚ≥0 R] (g : ComponentSpace H M P → R) :
    (Finset.univ.expect fun (A : ComponentSpace H M P) => g ((componentWordPerm L w z) A)) = Finset.univ.expect fun (A : ComponentSpace H M P) => g A

    Uniform-measure invariance (Lemma 6.3, item 1): every word permutation preserves uniform expectations on ComponentSpace H M P.

    def Cslib.Probability.IsValidComponentWord {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) {t : ℕ} :
    (Fin t → ComponentLazyStep H J) → (Fin t → Fin H → ℤ) → ComponentSpace H M P → Prop

    Sequential wrap validation along a length-t word: each step's wrap vector must pass IsValidComponentStep at the intermediate ambient state reached by the preceding prefix.

    Instances For
      @[instance_reducible]
      instance Cslib.Probability.instDecidableIsValidComponentWord {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) {t : ℕ} (w : Fin t → ComponentLazyStep H J) (z : Fin t → Fin H → ℤ) (A : ComponentSpace H M P) :
      def Cslib.Probability.componentWordWrap {H M J : ℕ} {P : Fin J → ℕ} (L : Fin J → ℕ) (y : (j : Fin J) → ZMod (P j)) {t : ℕ} :
      (Fin t → ComponentLazyStep H J) → ComponentSpace H M P → Fin t → Fin H → ℤ

      The unique valid wrap word of length t for move word w starting at ambient state A.

      theorem Cslib.Probability.isValidComponentWord_iff {H M J : ℕ} {P L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] {y : (j : Fin J) → ZMod (P j)} {t : ℕ} {w : Fin t → ComponentLazyStep H J} {z : Fin t → Fin H → ℤ} {A : ComponentSpace H M P} :
      theorem Cslib.Probability.existsUnique_isValidComponentWord {H M J : ℕ} {P L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (y : (j : Fin J) → ZMod (P j)) {t : ℕ} (w : Fin t → ComponentLazyStep H J) (A : ComponentSpace H M P) :
      ∃! z : Fin t → Fin H → ℤ, IsValidComponentWord L y w z A

      Existence and uniqueness of the valid wrap word (Lemma 6.3, item 3): for every ambient state A and every move word w, exactly one wrap word z passes IsValidComponentWord.

      theorem Cslib.Probability.componentWordWrap_mem {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} {t : ℕ} (w : Fin t → ComponentLazyStep H J) (A : ComponentSlice H M P L y) :

      On ComponentSlice H M P L y, the unique valid wrap word lies in (affineWrapBox H) ^ t (Lemma 6.3, bounded-alphabet preamble and item 3).

      theorem Cslib.Probability.componentWordPerm_wrap_eq {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} {t : ℕ} (w : Fin t → ComponentLazyStep H J) (A : ComponentSlice H M P L y) :

      On ComponentSlice H M P L y, applying componentWordPerm with the unique valid wrap word reaches the endpoint (G.pow t).neighbor A w of the walk along w in the reindexed lazy product multigraph G (Lemma 6.3, item 3).

      theorem Cslib.Probability.sum_ite_isValidComponentWord {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} {R : Type u_1} [AddCommMonoid R] {t : ℕ} (w : Fin t → ComponentLazyStep H J) (f : ComponentSpace H M P → R) (A : ComponentSlice H M P L y) :

      Exactly one length-t wrap word survives on ComponentSlice H M P L y, evaluating to the endpoint (G.pow t).neighbor A w of the walk along w in the reindexed lazy product multigraph G.

      theorem Cslib.Probability.walk_pow_componentMove_eq_expect_word {H M J : ℕ} {P : Fin J → ℕ} [∀ (j : Fin J), Fact (Nat.Prime (P j))] {L : Fin J → ℕ} [∀ (j : Fin J), NeZero (L j)] (hL : ∀ (j : Fin J), L j ≤ P j) {y : (j : Fin J) → ZMod (P j)} (f : ComponentSpace H M P → ℝ) (t : ℕ) (A : ComponentSlice H M P L y) :
      (((RotationMap.ofPerms (componentMove H M P L)).lazy.reindex (componentEquiv M hL y).symm).walk ^ t) (fun (B : ((j : Fin J) → RetentionSlice (P j) H 1 (L j) (y j)) × (Fin H → ZMod M)) => f (componentSliceVal B)) A = Finset.univ.expect fun (w : Fin t → ComponentLazyStep H J) => ∑ z ∈ Fintype.piFinset fun (x : Fin t) => affineWrapBox H, if IsValidComponentWord L y w z (componentSliceVal A) then f ((componentWordPerm L w z) (componentSliceVal A)) else 0

      Length-t validated words compute the lazy multi-component conditional walk (Lemma 6.3, item 4). Averaging over move words w : Fin t → ComponentLazyStep H J and summing over wrap words z ∈ (affineWrapBox H) ^ t—without dividing by #(affineWrapBox H) ^ t—equals t steps of the lazy product walk on ComponentSlice H M P L y.