Documentation

CslibFrontier.Probability.PairwiseIndependentHash.FrameChannel

Frame-conditioned retention channels and their retention slices #

A frame is an ordered linearly independent family F : Fin r → (Fin H → ZMod P). A frame-conditioned channel is a pair A = (a₀, F) of a constant column a₀ : Fin H → ZMod P and a frame F. It evaluates an identifier y : ZMod P as the polynomial

A.eval y = a₀ + ∑ j, y ^ (j + 1) • F j,

and retains y when A.eval y lies in the retention box retentionBox P H L. Drawing a uniformly random frame-conditioned channel is drawing a uniformly random H × (r + 1) matrix conditioned on its last r columns being linearly independent.

For a fixed identifier y, the map A ↦ (F, A.eval y) is a bijection, since a₀ is recovered from the value and the frame (evalEquiv). Hence the frame and the evaluation are independent, the evaluation is uniform, and y is retained with probability exactly (L / P) ^ H for every y and every r ≤ H (dens_eval_mem_retentionBox), as without frame conditioning. On the retention slice of y, the channels retaining y, the same bijection gives coordinates (F, w) with w in the box {0, …, L - 1} ^ H, which we identify with ZMod L ^ H (sliceEquiv). Conditional averaging on the slice is done in these coordinates (CslibFrontier.Probability.PairwiseIndependentHash.ConditionalAveraging).

This follows the rank channels of Section 3 of the OpenAI preprint [OAI26e] (channel matrices conditioned on their non-constant columns forming a frame), the exact marginal in the proof of its Lemma 3.1, and the coordinates (F, w) of the proof of its Lemma 6.2.

Main definitions #

Main results #

References #

@[reducible, inline]
abbrev Cslib.Probability.Frame (P H r : ℕ) :

A frame: an ordered linearly independent family of r vectors in ZMod P ^ H.

Instances For
    @[instance_reducible]

    Linear independence of a finite family over ZMod P is decided by testing all coefficient vectors.

    theorem Cslib.Probability.Frame.nonempty {P H r : ℕ} (hr : r ≤ H) :
    Nonempty (Frame P H r)

    For r ≤ H the first r standard basis vectors form a frame.

    An integer matrix of determinant one, reduced modulo P, maps frames to frames, column by column.

    @[simp]
    theorem Cslib.Probability.Frame.mapSL_apply {P H r : ℕ} (g : Matrix.SpecialLinearGroup (Fin H) ℤ) (F : Frame P H r) (j : Fin r) :
    ↑((mapSL g) F) j = (↑((Matrix.SpecialLinearGroup.map (Int.castRingHom (ZMod P))) g)).mulVec (↑F j)
    @[reducible, inline]

    A frame-conditioned channel: a constant column and a frame.

    def Cslib.Probability.FrameChannel.eval {P H r : ℕ} (A : FrameChannel P H r) (y : ZMod P) :
    Fin H → ZMod P

    The value a₀ + ∑ j, y ^ (j + 1) • F j of the channel A = (a₀, F) at the identifier y.

    def Cslib.Probability.FrameChannel.evalEquiv {P H r : ℕ} (y : ZMod P) :
    FrameChannel P H r ≃ (Fin H → ZMod P) × Frame P H r

    Coordinates of a channel at y: its value at y and its frame. The constant column is recovered as the value minus the frame part.

    @[simp]
    theorem Cslib.Probability.FrameChannel.evalEquiv_apply {P H r : ℕ} (y : ZMod P) (A : FrameChannel P H r) :
    (evalEquiv y) A = (A.eval y, A.2)
    theorem Cslib.Probability.dens_eval_mem_retentionBox {P H r L : ℕ} [NeZero P] (hr : r ≤ H) (hL : L ≤ P) (y : ZMod P) :
    {A : FrameChannel P H r | A.eval y ∈ retentionBox P H L}.dens = (↑L / ↑P) ^ H

    Frame-conditioned retention rate: for r ≤ H and L ≤ P, a uniformly random frame-conditioned channel retains every identifier y with probability exactly (L / P) ^ H.

    @[reducible, inline]
    abbrev Cslib.Probability.RetentionSlice (P H r L : ℕ) [NeZero P] (y : ZMod P) :

    The retention slice of y: the frame-conditioned channels retaining y.

    def Cslib.Probability.retentionBoxEquiv {P H L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) :
    ↥(retentionBox P H L) ≃ (Fin H → ZMod L)

    The retention box {0, …, L - 1} ^ H in ZMod P ^ H is ZMod L ^ H for L ≤ P, by reading representatives.

    @[simp]
    theorem Cslib.Probability.retentionBoxEquiv_apply {P H L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (w : ↥(retentionBox P H L)) (i : Fin H) :
    (retentionBoxEquiv hL) w i = ↑(↑w i).val
    @[simp]
    theorem Cslib.Probability.retentionBoxEquiv_symm_apply {P H L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (u : Fin H → ZMod L) (i : Fin H) :
    ↑((retentionBoxEquiv hL).symm u) i = ↑(u i).val
    def Cslib.Probability.sliceEquiv {P H r L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (y : ZMod P) :
    RetentionSlice P H r L y ≃ Frame P H r × (Fin H → ZMod L)

    Coordinates on a retention slice: a channel retaining y is its frame together with its value at y, which ranges over the whole box ZMod L ^ H.

    @[simp]
    theorem Cslib.Probability.sliceEquiv_apply {P H r L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (y : ZMod P) (A : RetentionSlice P H r L y) :
    (sliceEquiv hL y) A = ((↑A).2, fun (i : Fin H) => ↑((↑A).eval y i).val)
    @[simp]
    theorem Cslib.Probability.sliceEquiv_symm_apply_snd {P H r L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (y : ZMod P) (p : Frame P H r × (Fin H → ZMod L)) :
    (↑((sliceEquiv hL y).symm p)).2 = p.1

    The frame of a channel is its frame coordinate on the slice.

    @[simp]
    theorem Cslib.Probability.eval_sliceEquiv_symm {P H r L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (y : ZMod P) (p : Frame P H r × (Fin H → ZMod L)) (i : Fin H) :
    (↑((sliceEquiv hL y).symm p)).eval y i = ↑(p.2 i).val

    The value at y of the channel with coordinates (F, w) is w, read in ZMod P.

    theorem Cslib.Probability.card_retentionSlice {P H r L : ℕ} [NeZero P] [NeZero L] (hL : L ≤ P) (y : ZMod P) :

    A retention slice has #frames · L ^ H channels.