Documentation

CslibFrontier.Computability.LogSpaceDerandomization.PairwiseIndependentHash.FrameRetention

Retention estimates for frame-conditioned channels #

A frame-conditioned channel A = (a₀, F) (Cslib.Probability.FrameChannel) is a uniformly random polynomial channel y ↦ a₀ + ∑ j, y ^ (j + 1) • M j conditioned on its coefficient columns M forming a frame, i.e. being linearly independent. Its single evaluations have the exact retention probability (L / P) ^ H (dens_eval_mem_retentionBox). Here we prove the pair and lower-tail estimates, following the proof of Lemma 3.1 of the OpenAI preprint [OpenAI2026LogSpace, Lemma 3.1 and its proof, pp. 9–10]:

Together these give the pair bound π₁ π₂ / q_fr for two distinct identifiers (dens_eval_mem_and_eval_mem_le) and the Chebyshev lower tail 4 / (#A π q_fr) (dens_two_mul_card_filter_eval_mem_lt_le). So frame-conditioned channels satisfy the detector interface Cslib.Probability.RetentionChannels with constants c_π = 1, C_π = 2 ^ H, C_pair = 2 ^ H / q_fr and C_var = 4 / q_fr (retentionChannels_frameRetains), and for r < H with the constants 2 ^ (H + 1) and 8, which depend on H only (retentionChannels_frameRetains_of_lt).

Main definitions #

Main results #

References #

noncomputable def Cslib.Probability.frameDensity (P H r : ℕ) [NeZero P] :

The frame density q_fr: the probability that a uniformly random family of r vectors in ZMod P ^ H is a frame [OpenAI2026LogSpace, proof of Lemma 3.1].

The frame density is nonnegative.

theorem Cslib.Probability.card_frame {P H r : ℕ} [Fact (Nat.Prime P)] (hr : r ≤ H) :
Fintype.card (Frame P H r) = ∏ i : Fin r, (P ^ H - P ^ ↑i)

Counting frames: for r ≤ H there are ∏_{i < r} (P ^ H - P ^ i) frames of length r in ZMod P ^ H.

theorem Cslib.Probability.frameDensity_eq_prod {P H r : ℕ} [Fact (Nat.Prime P)] (hr : r ≤ H) :
frameDensity P H r = ∏ i : Fin r, (1 - ↑P ^ ↑i / ↑P ^ H)

The frame density is ∏_{i < r} (1 - P ^ i / P ^ H) for r ≤ H.

theorem Cslib.Probability.one_div_two_le_frameDensity {P H r : ℕ} [Fact (Nat.Prime P)] (hr : r < H) :
1 / 2 ≤ frameDensity P H r

For r < H, at least half of all families of r vectors in ZMod P ^ H are frames.

theorem Cslib.Probability.frameDensity_pos {P H r : ℕ} [Fact (Nat.Prime P)] (hr : r ≤ H) :
0 < frameDensity P H r

For r ≤ H the frame density is positive.

def Cslib.Probability.polyChannelEval {P H r : ℕ} (s : (Fin r → Fin H → ZMod P) × (Fin H → ZMod P)) (y : ZMod P) :
Fin H → ZMod P

The value ∑ j, y ^ (j + 1) • M j + a₀ at y of the polynomial channel with unrestricted coefficient columns M and constant column a₀, for the seed s = (M, a₀).

A frame-conditioned channel evaluates as the unrestricted polynomial channel with the same columns.

Unrestricted polynomial channels are pairwise independent: with at least one non-constant column, the values of a uniformly random polynomial channel at two distinct identifiers are independent and uniform [OpenAI2026LogSpace, proof of Lemma 3.1]. The difference of the values at x₁ ≠ x₂ takes every value already through the first column, since x₁ - x₂ is invertible.

theorem Cslib.Probability.dens_frameChannel_le {P H r : ℕ} [NeZero P] (E : (Fin r → Fin H → ZMod P) × (Fin H → ZMod P) → Prop) [DecidablePred E] :
↑{A : FrameChannel P H r | E (↑A.2, A.1)}.dens ≤ ↑{s : (Fin r → Fin H → ZMod P) × (Fin H → ZMod P) | E s}.dens / frameDensity P H r

Transfer to frame conditioning: an event about the seed (M, a₀) of a polynomial channel has, under frame conditioning, at most its unrestricted probability divided by the frame density q_fr [OpenAI2026LogSpace, proof of Lemma 3.1].

theorem Cslib.Probability.dens_eval_mem_and_eval_mem_le {P H r : ℕ} [NeZero P] [Fact (Nat.Prime P)] {L₁ L₂ : ℕ} (hr : 0 < r) (hL₁ : L₁ ≤ P) (hL₂ : L₂ ≤ P) {w y : ZMod P} (hwy : w ≠ y) :
↑{A : FrameChannel P H r | A.eval w ∈ retentionBox P H L₁ ∧ A.eval y ∈ retentionBox P H L₂}.dens ≤ (↑L₁ / ↑P) ^ H * (↑L₂ / ↑P) ^ H / frameDensity P H r

Pair bound under frame conditioning: for distinct identifiers w ≠ y and sides L₁, L₂ ≤ P, a frame-conditioned channel with r ≥ 1 retains w in the box of side L₁ and y in the box of side L₂ with probability at most (L₁ / P) ^ H (L₂ / P) ^ H / q_fr [OpenAI2026LogSpace, proof of Lemma 3.1, item 2].

theorem Cslib.Probability.dens_two_mul_card_filter_eval_mem_lt_le {P H r : ℕ} [NeZero P] [Fact (Nat.Prime P)] {L : ℕ} (hr : 0 < r) (hL : L ≤ P) (A : Finset (ZMod P)) (hpos : 0 < ↑A.card * (↑L / ↑P) ^ H) :
↑{s : FrameChannel P H r | 2 * ↑{y ∈ A | s.eval y ∈ retentionBox P H L}.card < ↑A.card * (↑L / ↑P) ^ H}.dens ≤ 4 / (↑A.card * (↑L / ↑P) ^ H) / frameDensity P H r

Lower tail under frame conditioning: for r ≥ 1, L ≤ P and π = (L / P) ^ H, a frame-conditioned channel retains fewer than #A π / 2 identifiers of A with probability at most 4 / (#A π) / q_fr [OpenAI2026LogSpace, proof of Lemma 3.1, item 3].

@[reducible, inline]
abbrev Cslib.Probability.frameRetains (P H : ℕ) {r : ℕ} [NeZero P] (L : ℕ) (s : FrameChannel P H r) (y : ZMod P) :

The identifier y is retained by the frame-conditioned channel s when its value s.eval y lies in the retention box of side L.

theorem Cslib.Probability.retentionChannels_frameRetains {P H r : ℕ} {V : Type u_1} [Fact (Nat.Prime P)] {ident : V → ZMod P} (hident : Function.Injective ident) (hr0 : 0 < r) (hr : r ≤ H) {a : ℝ} (hPa : 1 ≤ ↑P * a) (ha : a ≤ 1) :
RetentionChannels (fun (s : FrameChannel P H r) (v : V) => frameRetains P H ⌈↑P * a⌉₊ s (ident v)) (fun (s : FrameChannel P H r) (v : V) => frameRetains P H ⌈↑P * a⌉₊ s (ident v)) (a ^ H) ((↑⌈↑P * a⌉₊ / ↑P) ^ H) 1 (2 ^ H) (2 ^ H / frameDensity P H r) (4 / frameDensity P H r)

Frame-conditioned channels satisfy the detector interface. Let ident : V → ZMod P be injective, 1 ≤ r ≤ H, 1 ≤ P a, a ≤ 1 and L = ⌈P a⌉. Retaining v when a uniformly random frame-conditioned channel retains ident v, for each of two channels, gives retention channels at rate f = a ^ H with retention probability π = (L / P) ^ H and constants c_π = 1, C_π = 2 ^ H, C_pair = 2 ^ H / q_fr and C_var = 4 / q_fr, where q_fr is the frame density [OpenAI2026LogSpace, Lemma 3.1, items 1–3].

theorem Cslib.Probability.retentionChannels_frameRetains_of_lt {P H r : ℕ} {V : Type u_1} [Fact (Nat.Prime P)] {ident : V → ZMod P} (hident : Function.Injective ident) (hr0 : 0 < r) (hr : r < H) {a : ℝ} (hPa : 1 ≤ ↑P * a) (ha : a ≤ 1) :
RetentionChannels (fun (s : FrameChannel P H r) (v : V) => frameRetains P H ⌈↑P * a⌉₊ s (ident v)) (fun (s : FrameChannel P H r) (v : V) => frameRetains P H ⌈↑P * a⌉₊ s (ident v)) (a ^ H) ((↑⌈↑P * a⌉₊ / ↑P) ^ H) 1 (2 ^ H) (2 ^ (H + 1)) 8

Frame-conditioned channels with constants depending only on H. For 1 ≤ r < H, the frame density is at least 1 / 2, so the channels of retentionChannels_frameRetains satisfy the detector interface with c_π = 1, C_π = 2 ^ H, C_pair = 2 ^ (H + 1) and C_var = 8 [OpenAI2026LogSpace, Lemma 3.1, items 1–3].