Documentation

CslibFrontier.Computability.LogSpaceDerandomization.RowCompression

Compression of two-coordinate rows #

The local update of [OpenAI2026LogSpace, Section 8.2, (8.5)--(8.6), Lemma 8.1] replaces a real row by a common default and a bounded number of exceptions. This is the deterministic compression step of the logspace estimator; no probability or machine-space bound is asserted.

For an old default (z, 0), a floor ρ, and an input row w, put m y = max |w y 0| |w y 1| and u = max z (max ρ (rank_n m)). The new default is z' = max u (min (max z (rank_K (w · 0))) (3 * u)). Every displacement from (z', 0) is clipped to radius 7 * max (m y - 2 * u) 0.

Finset.kthLargest pads with zeros. For a nonnegative old default z, taking max z of this rank accounts for the paper's dummy copies of (z, 0). In the size rank this maximum is already absorbed by u. The finite set s consists of real endpoint IDs; dummy positions never enter the support count. Input coordinates may be negative. Positive n and K suffice for stability; the later condition K ≤ n is not needed for this local result.

Main definitions #

Main results #

References #

noncomputable def Cslib.RowCompression.entrySize (w : Fin 2 → ℝ) :

The sup norm of a two-coordinate entry.

The common default entry (z, 0).

noncomputable def Cslib.RowCompression.radius (u : ℝ) (w : Fin 2 → ℝ) :

The clipping radius for an entry at threshold u.

noncomputable def Cslib.RowCompression.updateEntry (u z : ℝ) (w : Fin 2 → ℝ) (ν : Fin 2) :

Clip each displacement from (z, 0) to the entry's radius.

noncomputable def Cslib.RowCompression.threshold {ι : Type u_1} (s : Finset ι) (n : ℕ) (ρ z : ℝ) (w : ι → Fin 2 → ℝ) :

The size threshold, with dummy copies of the old default included in its rank.

noncomputable def Cslib.RowCompression.newDefault {ι : Type u_1} (s : Finset ι) (n K : ℕ) (ρ z : ℝ) (w : ι → Fin 2 → ℝ) :

The new nonnegative default; max z accounts for dummy copies in the first-coordinate rank. For nonnegative z this is exactly (8.5) of [OAI26e].

noncomputable def Cslib.RowCompression.update {ι : Type u_1} (s : Finset ι) (n K : ℕ) (ρ z : ℝ) (w : ι → Fin 2 → ℝ) (y : ι) :
Fin 2 → ℝ

The compression update of [OpenAI2026LogSpace, (8.6)].

noncomputable def Cslib.RowCompression.candidates {ι : Type u_1} (s : Finset ι) (n : ℕ) (ρ z : ℝ) (w : ι → Fin 2 → ℝ) :

A coarse candidate list: every non-default output has input size greater than u.

theorem Cslib.RowCompression.threshold_nonneg {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
0 ≤ threshold s n ρ z w
theorem Cslib.RowCompression.le_threshold {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
z ≤ threshold s n ρ z w
theorem Cslib.RowCompression.floor_le_threshold {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
ρ ≤ threshold s n ρ z w
theorem Cslib.RowCompression.threshold_le_newDefault {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
threshold s n ρ z w ≤ newDefault s n K ρ z w
theorem Cslib.RowCompression.newDefault_le_three_mul {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
newDefault s n K ρ z w ≤ 3 * threshold s n ρ z w
theorem Cslib.RowCompression.le_newDefault {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
z ≤ newDefault s n K ρ z w
theorem Cslib.RowCompression.newDefault_nonneg {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} :
0 ≤ newDefault s n K ρ z w
theorem Cslib.RowCompression.threshold_congr_on {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w₁ w₂ : ι → Fin 2 → ℝ} (hw : ∀ x ∈ s, ∀ (μ : Fin 2), w₁ x μ = w₂ x μ) :
threshold s n ρ z w₁ = threshold s n ρ z w₂

threshold depends only on the row entries on s.

theorem Cslib.RowCompression.newDefault_congr_on {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w₁ w₂ : ι → Fin 2 → ℝ} (hw : ∀ x ∈ s, ∀ (μ : Fin 2), w₁ x μ = w₂ x μ) :
newDefault s n K ρ z w₁ = newDefault s n K ρ z w₂

newDefault depends only on the row entries on s.

theorem Cslib.RowCompression.updateEntry_eq_self_of_three_mul_le {u b : ℝ} {v : Fin 2 → ℝ} (hu : 0 ≤ u) (hb : 0 ≤ b) (hb' : b ≤ 3 * u) (hv : 3 * u ≤ entrySize v) :
updateEntry u b v = v
theorem Cslib.RowCompression.updateEntry_mem_Icc (u b : ℝ) (v : Fin 2 → ℝ) (ν : Fin 2) :
updateEntry u b v ν ∈ Set.Icc (min (v ν) (defaultEntry b ν)) (max (v ν) (defaultEntry b ν))
theorem Cslib.RowCompression.abs_updateEntry_sub_le (u b : ℝ) (v : Fin 2 → ℝ) (ν : Fin 2) :
|updateEntry u b v ν - v ν| ≤ |v ν - defaultEntry b ν|

Clipping toward the default changes a coordinate by no more than its distance to it.

theorem Cslib.RowCompression.update_eq_default_of_size_le {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {y : ι} (hy : entrySize (w y) ≤ 2 * threshold s n ρ z w) :
update s n K ρ z w y = defaultEntry (newDefault s n K ρ z w)

Entries of size at most twice the threshold become the new default.

theorem Cslib.RowCompression.update_eq_self_of_three_mul_le {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {y : ι} (hy : 3 * threshold s n ρ z w ≤ entrySize (w y)) :
update s n K ρ z w y = w y

Entries of size at least three times the threshold are preserved, including signed entries.

theorem Cslib.RowCompression.update_mem_Icc {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} (y : ι) (ν : Fin 2) :
update s n K ρ z w y ν ∈ Set.Icc (min (w y ν) (defaultEntry (newDefault s n K ρ z w) ν)) (max (w y ν) (defaultEntry (newDefault s n K ρ z w) ν))

Compression moves each coordinate toward the new default without overshooting.

theorem Cslib.RowCompression.abs_update_sub_le_six_mul {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} (y : ι) (ν : Fin 2) :
|update s n K ρ z w y ν - w y ν| ≤ 6 * threshold s n ρ z w

The local change bound used before the first overflow in [OpenAI2026LogSpace, Section 8.3]. When the threshold equals the prescribed floor ρ, each coordinate changes by at most 6 * ρ. This does not yet sum changes over a schedule or prove the later weighted preloss estimate.

theorem Cslib.RowCompression.card_candidates_lt {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} (hn : 0 < n) :
(candidates s n ρ z w).card < n

The coarse candidate list is strictly smaller than the capacity, hence also at most n.

theorem Cslib.RowCompression.update_eq_default_of_not_mem_candidates {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {y : ι} (hy : y ∈ s) (hnot : y ∉ candidates s n ρ z w) :
update s n K ρ z w y = defaultEntry (newDefault s n K ρ z w)

Outside the candidate list every real endpoint has the new default value.

theorem Cslib.RowCompression.card_exceptions_lt {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} (hn : 0 < n) :
{y ∈ s | update s n K ρ z w y ≠ defaultEntry (newDefault s n K ρ z w)}.card < n

The exact exception set is smaller than n, regardless of coincidences with the default.

theorem Cslib.RowCompression.candidates_subset {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} (hz : 0 ≤ z) (t : Finset ι) (hw : ∀ y ∈ s, y ∉ t → w y = defaultEntry z) :
candidates s n ρ z w ⊆ t

Candidates can be selected entirely from any set containing the non-default input IDs. Use the union of the previous exception list and the newly touched IDs for that set.

Stability independent of the row width #

theorem Cslib.RowCompression.abs_entrySize_sub_entrySize_le {v v' : Fin 2 → ℝ} {δ : ℝ} (h : ∀ (ν : Fin 2), |v ν - v' ν| ≤ δ) :
theorem Cslib.RowCompression.abs_defaultEntry_sub_defaultEntry_le {b b' δ : ℝ} (hδ : 0 ≤ δ) (hb : |b - b'| ≤ δ) (ν : Fin 2) :
theorem Cslib.RowCompression.abs_threshold_sub_threshold_le {ι : Type u_1} {s : Finset ι} {n : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {z' δ : ℝ} {w' : ι → Fin 2 → ℝ} (hn : 0 < n) (hδ : 0 ≤ δ) (hz : |z - z'| ≤ δ) (hw : ∀ y ∈ s, ∀ (ν : Fin 2), |w y ν - w' y ν| ≤ δ) :
|threshold s n ρ z w - threshold s n ρ z' w'| ≤ δ

The threshold varies by at most the sup perturbation of the row and old default.

theorem Cslib.RowCompression.abs_newDefault_sub_newDefault_le {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {z' δ : ℝ} {w' : ι → Fin 2 → ℝ} (hn : 0 < n) (hK : 0 < K) (hδ : 0 ≤ δ) (hz : |z - z'| ≤ δ) (hw : ∀ y ∈ s, ∀ (ν : Fin 2), |w y ν - w' y ν| ≤ δ) :
|newDefault s n K ρ z w - newDefault s n K ρ z' w'| ≤ 3 * δ

The default has Lipschitz constant three, uniformly in the capacities and row width.

theorem Cslib.RowCompression.abs_radius_sub_radius_le {δ u u' : ℝ} {v v' : Fin 2 → ℝ} (hδ : 0 ≤ δ) (hu : |u - u'| ≤ δ) (hv : ∀ (ν : Fin 2), |v ν - v' ν| ≤ δ) :
|radius u v - radius u' v'| ≤ 21 * δ

The radius is 21-Lipschitz jointly in the entry and the threshold.

theorem Cslib.RowCompression.abs_update_sub_update_le {ι : Type u_1} {s : Finset ι} {n K : ℕ} {ρ z : ℝ} {w : ι → Fin 2 → ℝ} {z' δ : ℝ} {w' : ι → Fin 2 → ℝ} (hn : 0 < n) (hK : 0 < K) (hδ : 0 ≤ δ) (hz : |z - z'| ≤ δ) (hw : ∀ y ∈ s, ∀ (ν : Fin 2), |w y ν - w' y ν| ≤ δ) {y : ι} (hy : y ∈ s) (ν : Fin 2) :
|update s n K ρ z w y ν - update s n K ρ z' w' y ν| ≤ 28 * δ

The update is 28-Lipschitz in the row and old default, with the floor and capacities fixed. The estimate is on real endpoints y ∈ s; it is independent of their number and magnitudes.