Documentation

CslibFrontier.Computability.LogSpaceDerandomization.CopyStage

One stage of the correction-and-copy hierarchy #

One stage of the hierarchy of the OpenAI preprint (2026-09-23), Section 4, ideas 3 and 4 in issue #474 [OAI26e], takes a transition matrix C with entries at most f, corrects it to D = C - E + E C with a finite cutoff correction E (Matrix.cutoffCorrectionIter), and splits the remaining large entries of D among copies of their targets (Matrix.copyStage). This file proves the deterministic bounds of such a stage. The result C⁺ has entries at most f / q, and its support lies in a set at most twice as large as the support of C (Matrix.copyStage_rates). These are exactly the per-stage hypotheses of the stage bound Matrix.sub_rewardTransport_mulVec_le_pow; Matrix.sub_rewardTransport_mulVec_le_of_rates iterates them.

Stages can be chained. If C is strictly upper triangular, so is the residual D (Matrix.cutoffCorrection_residual_isStrictUpperTriangular), and the copy step is strictly upper triangular for the lexicographic order on the copies Lex (V × Fin (m + 1)), which is linearly ordered (Matrix.copyStage_isStrictUpperTriangular). Its rows sum to at most one (Matrix.copyStage_mulVec_one_le with Matrix.correction_mulVec_one_le) and its entries are nonnegative under the cutoff assumptions 0 ≤ χ ≤ 1 (Matrix.copyStage_nonneg with Matrix.cutoffCorrection_residual_nonneg), so it satisfies the input hypotheses of the next stage.

The choice of which columns are corrected and which vertices get active copies comes from the preprint's detectors, which are probabilistic. Here it is an interface: copy weights r with r 0 = 1, and a finite set O of overloaded vertices, such that

The last condition follows from incidence counting (Matrix.card_mul_le_of_incidences): if every overloaded column has many large entries in one of a few matrices with the stated row-sum bounds, as the detectors guarantee for the pilot inputs, then there are few overloaded columns. The pilot inputs have bounded row sums, not necessarily at most one [OpenAI2026LogSpace, Lemma 4.2].

The corrected matrix also satisfies the remaining bounds of Lemma 4.4 of the preprint. Its entries are at most (k + 1) f (Matrix.cutoffCorrection_residual_le_mul). It dominates its unsigned constituents, θ / (2 (k + 1)) (C + E + E C) ≤ D (Matrix.cutoffCorrection_residual_dominates), which lets the three terms of D be estimated separately. Its support stays within that of C (Matrix.cutoffCorrection_residual_mem).

Main definitions #

Main results #

References #

Residual bounds for cutoff corrections #

theorem Matrix.cutoffCorrectionIter_sum_le {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hC0 : ∀ (x y : V), 0 ≤ C x y) (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) (hC1 : C.mulVec 1 ≤ 1) (k : ℕ) (x : V) :
∑ y : V, cutoffCorrectionIter φ C k x y ≤ ↑k

Row sums of the iterates: the k-th iterate of a cutoff correction of a substochastic C has row sums at most k [OpenAI2026LogSpace, Lemma 4.2].

theorem Matrix.cutoffCorrectionIter_le_mul {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hC0 : ∀ (x y : V), 0 ≤ C x y) (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) (hCf : ∀ (x y : V), C x y ≤ f) (hf : 0 ≤ f) (hC1 : C.mulVec 1 ≤ 1) (k : ℕ) (x y : V) :
cutoffCorrectionIter φ C k x y ≤ ↑k * f

Entries of the iterates: the k-th iterate has entries at most k f [OpenAI2026LogSpace, Lemma 4.2].

theorem Matrix.cutoffCorrection_residual_le_mul {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hC0 : ∀ (x y : V), 0 ≤ C x y) (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) (hCf : ∀ (x y : V), C x y ≤ f) (hf : 0 ≤ f) (hC1 : C.mulVec 1 ≤ 1) (k : ℕ) (x y : V) :
(C - cutoffCorrectionIter φ C k + cutoffCorrectionIter φ C k * C) x y ≤ (↑k + 1) * f

The residual entry bound: C - E_k + E_k C has entries at most (k + 1) f [OpenAI2026LogSpace, Lemma 4.4].

theorem Matrix.cutoffCorrection_residual_dominates {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hC0 : ∀ (x y : V), 0 ≤ C x y) (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) (hCf : ∀ (x y : V), C x y ≤ f) (hf : 0 ≤ f) (hC1 : C.mulVec 1 ≤ 1) (hφm : ∀ (y : V), Monotone (φ y)) (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) (k : ℕ) (x y : V) :
θ / (2 * (↑k + 1)) * (C + cutoffCorrectionIter φ C (k + 1) + cutoffCorrectionIter φ C (k + 1) * C) x y ≤ (C - cutoffCorrectionIter φ C (k + 1) + cutoffCorrectionIter φ C (k + 1) * C) x y

Domination of the unsigned terms: for θ ≤ 1, the residual of the (k + 1)-th iterate dominates a fixed multiple of the sum of its unsigned constituents, θ / (2 (k + 1)) (C + E + E C) ≤ C - E + E C [OpenAI2026LogSpace, Lemma 4.4].

theorem Matrix.cutoffCorrectionIter_mem {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) {A : Finset V} (hA : ∀ (x y : V), C x y ≠ 0 → x ∈ A ∧ y ∈ A) (k : ℕ) (x y : V) (h : cutoffCorrectionIter φ C k x y ≠ 0) :
x ∈ A ∧ y ∈ A

The iterates are supported within any set A covering the support of C.

theorem Matrix.cutoffCorrection_residual_mem {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) {A : Finset V} (hA : ∀ (x y : V), C x y ≠ 0 → x ∈ A ∧ y ∈ A) (k : ℕ) (x y : V) (h : (C - cutoffCorrectionIter φ C k + cutoffCorrectionIter φ C k * C) x y ≠ 0) :
x ∈ A ∧ y ∈ A

The residual stays within the support of C [OpenAI2026LogSpace, Lemma 4.4].

theorem Matrix.cutoffCorrectionIter_isStrictUpperTriangular {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) [Preorder V] (hC : C.IsStrictUpperTriangular) (k : ℕ) :

The iterates of the cutoff correction of a strictly upper triangular matrix are strictly upper triangular.

theorem Matrix.cutoffCorrection_residual_isStrictUpperTriangular {V : Type u_1} [Fintype V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ : ℝ} (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hθf : 0 ≤ θ * f) [Preorder V] (hC : C.IsStrictUpperTriangular) (k : ℕ) :

The residual of a strictly upper triangular matrix is strictly upper triangular.

Copy fractions #

noncomputable def Matrix.copyFraction (χ : ℝ → ℝ) (m : ℕ) (t : ℝ) (j : Fin (m + 1)) :

Copy fractions for m + 1 copies, driven by a cutoff χ with values in [0, 1]: the primary copy 0 receives 1 - m / (m + 1) χ t, every other copy χ t / (m + 1). Small entries (χ t = 0) stay with the primary copy; large ones (χ t = 1) are split evenly [OpenAI2026LogSpace, (4.21)].

theorem Matrix.sum_copyFraction (χ : ℝ → ℝ) (m : ℕ) (t : ℝ) :
∑ j : Fin (m + 1), copyFraction χ m t j = 1
theorem Matrix.copyFraction_nonneg {χ : ℝ → ℝ} {m : ℕ} {t : ℝ} (h0 : 0 ≤ χ t) (h1 : χ t ≤ 1) (j : Fin (m + 1)) :
0 ≤ copyFraction χ m t j
theorem Matrix.copyFraction_le_one {χ : ℝ → ℝ} {m : ℕ} {t : ℝ} (h0 : 0 ≤ χ t) (h1 : χ t ≤ 1) (j : Fin (m + 1)) :
copyFraction χ m t j ≤ 1
theorem Matrix.copyFraction_of_eq_zero {χ : ℝ → ℝ} {m : ℕ} {t : ℝ} (h : χ t = 0) (j : Fin (m + 1)) :
copyFraction χ m t j = if j = 0 then 1 else 0
theorem Matrix.copyFraction_of_eq_one {χ : ℝ → ℝ} {m : ℕ} {t : ℝ} (h : χ t = 1) (j : Fin (m + 1)) :
copyFraction χ m t j = 1 / (↑m + 1)

The copy step #

noncomputable def Matrix.copyStage {V : Type u_1} (χ : ℝ → ℝ) (m : ℕ) (r : Fin (m + 1) → V → ℝ) (D : Matrix V V ℝ) :
Matrix (V × Fin (m + 1)) (V × Fin (m + 1)) ℝ

The copy step of the hierarchy: Matrix.copySplit with the proportions Matrix.copyFraction χ m (D x y) [OpenAI2026LogSpace, (4.23)].

def Matrix.copyCover {V : Type u_1} {m : ℕ} [DecidableEq V] (A O : Finset V) :
Finset (V × Fin (m + 1))

The copies that can be active: the primary copies of a cover A of the parents, and the extra copies j ≠ 0 of the overloaded vertices O.

theorem Matrix.copyStage_isStrictUpperTriangular {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} [LT V] (hD : D.IsStrictUpperTriangular) :

The copy step stays strictly upper triangular for the lexicographic order on the copies: (x, i) comes before (y, j) when x < y, or x = y and i < j. Indexed by Lex (V × Fin (m + 1)), which is linearly ordered when V is, the copy step can be the input of the next stage (Matrix.copySplit_isStrictUpperTriangular).

theorem Matrix.card_copyCover_le {V : Type u_1} {m : ℕ} [DecidableEq V] (A O : Finset V) :
(copyCover A O).card ≤ A.card + m * O.card
theorem Matrix.copyStage_mul_copyWeight {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {τ₀ : ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} [Fintype V] [DecidableEq V] (hr0 : ∀ (x : V), r 0 x = 1) (hχ₀ : ∀ t ≤ τ₀, χ t = 0) (hbig : ∀ (x y : V), τ₀ < D x y → ∀ (j : Fin (m + 1)), r j y = 1) :

The copy step intertwines with its projection when the primary weight is one and every large entry τ₀ < D x y has all copies of its target active [OpenAI2026LogSpace, (4.26)].

theorem Matrix.copyStage_nonneg {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} (hr : ∀ (j : Fin (m + 1)) (x : V), 0 ≤ r j x) (hD : ∀ (x y : V), 0 ≤ D x y) (hχ0 : ∀ (t : ℝ), 0 ≤ χ t) (hχ1 : ∀ (t : ℝ), χ t ≤ 1) (a b : V × Fin (m + 1)) :
0 ≤ copyStage χ m r D a b
theorem Matrix.copyStage_mulVec_one_le {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} [Fintype V] (hr0 : ∀ (j : Fin (m + 1)) (x : V), 0 ≤ r j x) (hr1 : ∀ (j : Fin (m + 1)) (x : V), r j x ≤ 1) (hD0 : ∀ (x y : V), 0 ≤ D x y) (hD1 : D.mulVec 1 ≤ 1) :
(copyStage χ m r D).mulVec 1 ≤ 1

The copy step preserves the row-sum upper bound: its rows sum to at most one when D is nonnegative with rows summing to at most one and the weights lie in [0, 1]. Substochasticity also needs nonnegative entries, which Matrix.copyStage_nonneg gives under the additional cutoff assumptions 0 ≤ χ ≤ 1.

theorem Matrix.copyStage_le {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {τ₁ : ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} (hr0 : ∀ (j : Fin (m + 1)) (x : V), 0 ≤ r j x) (hr1 : ∀ (j : Fin (m + 1)) (x : V), r j x ≤ 1) (hD0 : ∀ (x y : V), 0 ≤ D x y) {K b : ℝ} (hDK : ∀ (x y : V), D x y ≤ K) (hχ0 : ∀ (t : ℝ), 0 ≤ χ t) (hχ1 : ∀ (t : ℝ), χ t ≤ 1) (hχ₁ : ∀ (t : ℝ), τ₁ ≤ t → χ t = 1) (hτ₁ : τ₁ ≤ b) (hK : K / (↑m + 1) ≤ b) (a c : V × Fin (m + 1)) :
copyStage χ m r D a c ≤ b

The density bound: if the entries of D are at most K, the cutoff is one from τ₁ on, τ₁ ≤ b and K / (m + 1) ≤ b, the copy step has entries at most b [OpenAI2026LogSpace, Proposition 4.5].

theorem Matrix.copyStage_mem_copyCover {V : Type u_1} {m : ℕ} {χ : ℝ → ℝ} {τ₀ : ℝ} {r : Fin (m + 1) → V → ℝ} {D : Matrix V V ℝ} [DecidableEq V] {A O : Finset V} (hA : ∀ (x y : V), D x y ≠ 0 → x ∈ A ∧ y ∈ A) (hrO : ∀ (j : Fin (m + 1)) (x : V), j ≠ 0 → r j x ≠ 0 → x ∈ O) (hχ₀ : ∀ t ≤ τ₀, χ t = 0) (hcolO : ∀ (x y : V), τ₀ < D x y → y ∈ O) (a b : V × Fin (m + 1)) (h : copyStage χ m r D a b ≠ 0) :

Active copies: if A covers the support of D, extra copies of x are active only for overloaded x, and large entries have overloaded targets, then the copy step is supported in Matrix.copyCover A O [OpenAI2026LogSpace, Proposition 4.5].

Incidence counting #

theorem Matrix.card_mul_le_of_incidences {V : Type u_1} [Fintype V] {k : ℕ} (G : Fin k → Matrix V V ℝ) (hG0 : ∀ (i : Fin k) (x y : V), 0 ≤ G i x y) (s : Fin k → ℝ) (hGs : ∀ (i : Fin k) (x : V), ∑ y : V, G i x y ≤ s i) (A : Finset V) (hGA : ∀ (i : Fin k) (x y : V), G i x y ≠ 0 → x ∈ A) {δ : ℝ} (hδ : 0 < δ) (O : Finset V) {N : ℕ} (hO : ∀ y ∈ O, ∃ (i : Fin k), N ≤ {x : V | δ < G i x y}.card) :
↑O.card * ↑N * δ ≤ ↑A.card * ∑ i : Fin k, s i

Incidence counting. Let G i be nonnegative matrices whose rows sum to at most s i and vanish outside A. If each vertex of O is the target of at least N entries larger than δ in one of the G i, then |O| N δ ≤ |A| ∑ s i. With the pilot inputs of the preprint as G i, this bounds the number of overloaded columns [OpenAI2026LogSpace, Proposition 4.5].

One stage #

theorem Matrix.copyStage_rates {V : Type u_1} [Fintype V] [DecidableEq V] [LinearOrder V] {φ : V → ℝ → ℝ} {C : Matrix V V ℝ} {f θ L : ℝ} {m : ℕ} {χ : ℝ → ℝ} {τ₀ τ₁ : ℝ} {r : Fin (m + 1) → V → ℝ} (hC : C.IsStrictUpperTriangular) (hC0 : ∀ (x y : V), 0 ≤ C x y) (hCf : ∀ (x y : V), C x y ≤ f) (hC1 : C.mulVec 1 ≤ 1) (hφ0 : ∀ (y : V) (t : ℝ), 0 ≤ φ y t) (hφθ : ∀ (y : V) (t : ℝ), φ y t ≤ max (t - θ * f) 0) (hφm : ∀ (y : V), Monotone (φ y)) (hφL : ∀ (y : V) (s t : ℝ), s ≤ t → φ y t - φ y s ≤ L * (t - s)) (hf : 0 < f) (hθ : 0 < θ) (hL : 0 ≤ L) (k : ℕ) {A O : Finset V} (hA : ∀ (x y : V), C x y ≠ 0 → x ∈ A ∧ y ∈ A) (hr0 : ∀ (x : V), r 0 x = 1) (hr01 : ∀ (j : Fin (m + 1)) (x : V), 0 ≤ r j x ∧ r j x ≤ 1) (hrO : ∀ (j : Fin (m + 1)) (x : V), j ≠ 0 → r j x ≠ 0 → x ∈ O) {θ₂ : ℝ} (hcol : ∀ (y : V), (∀ (t : ℝ), t - θ₂ * f ≤ φ y t) ∨ (∀ (j : Fin (m + 1)), r j y = 1) ∧ y ∈ O) (hτ₀ : θ₂ * f + f * Real.exp (1 / θ) * (L / θ) ^ k / ↑k.factorial ≤ τ₀) (hχ0 : ∀ (t : ℝ), 0 ≤ χ t) (hχ1 : ∀ (t : ℝ), χ t ≤ 1) (hχ₀ : ∀ t ≤ τ₀, χ t = 0) (hχ₁ : ∀ (t : ℝ), τ₁ ≤ t → χ t = 1) {q : ℝ} (hτ₁ : τ₁ ≤ f / q) (hK : (↑k + 1) * f / (↑m + 1) ≤ f / q) (hO : m * O.card ≤ A.card) :
have D := C - cutoffCorrectionIter φ C k + cutoffCorrectionIter φ C k * C; (∀ (a b : V × Fin (m + 1)), copyStage χ m r D a b ≤ f / q) ∧ copyStage χ m r D * copyWeight r = copyWeight r * D ∧ (∀ (a b : V × Fin (m + 1)), copyStage χ m r D a b ≠ 0 → a ∈ copyCover A O ∧ b ∈ copyCover A O) ∧ (copyCover A O).card ≤ 2 * A.card

One stage of the hierarchy. Correct C by the k-th cutoff iterate and split the residual D by Matrix.copyStage. Suppose every column is either fully corrected (its cutoff leaves at most θ₂ f) or overloaded with all copies active, the truncation error keeps fully corrected entries at most τ₀, the cutoff χ is 0 up to τ₀ and 1 from τ₁ ≤ f / q, there are enough copies ((k + 1) f / (m + 1) ≤ f / q), and m |O| ≤ |A| for a cover A of the support of C. Then the copy step has entries at most f / q, intertwines with its projection, and is supported in a set of at most 2 |A| copies [OpenAI2026LogSpace, Proposition 4.5].

Iterating the stages #

theorem Matrix.sub_rewardTransport_mulVec_le_of_rates {V : ℕ → Type u_1} [(l : ℕ) → Fintype (V l)] [(l : ℕ) → DecidableEq (V l)] {C E : (l : ℕ) → Matrix (V l) (V l) ℝ} {P : (l : ℕ) → Matrix (V (l + 1)) (V l) ℝ} (hP : ∀ (l : ℕ) (i : V (l + 1)) (j : V l), 0 ≤ P l i j) (hP1 : ∀ (l : ℕ), (P l).mulVec 1 ≤ 1) (hC : ∀ (l : ℕ) (i j : V l), 0 ≤ C l i j) (hstep : ∀ (l : ℕ), C (l + 1) * P l = P l * (C l - E l + E l * C l)) {p e : V 0 → ℝ} (hp : (1 - C 0).mulVec p = e) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) {z : (l : ℕ) → V l} (hz : ∀ (l : ℕ) (w : V l), P l (z (l + 1)) w = if w = z l then 1 else 0) {c n : ℕ} (hε0 : ∀ (x y : V 0), C 0 x y ≤ 1) (hεs : ∀ (l : ℕ), (∀ (x y : V l), C l x y ≤ (2 ^ (c + 1))⁻¹ ^ l) → ∀ (x y : V (l + 1)), C (l + 1) x y ≤ (2 ^ (c + 1))⁻¹ ^ (l + 1)) (A : (l : ℕ) → Finset (V l)) (hA : ∀ (l : ℕ) (x y : V l), C l x y ≠ 0 → y ∈ A l) (hA0 : (A 0).card ≤ n) (hAs : ∀ (l : ℕ), (A (l + 1)).card ≤ 2 * (A l).card) (l : ℕ) :
0 ≤ p (z 0) - (rewardTransport P E l).mulVec e (z l) ∧ p (z 0) - (rewardTransport P E l).mulVec e (z l) ≤ ↑n * (2 ^ c)⁻¹ ^ l

The stage bound from per-stage rates. If the entries of C 0 are at most one, each stage divides the entry bound by q = 2 ^ (c + 1), and each stage at most doubles a cover of the support, then along primary copies 0 ≤ p (z 0) - W l (z l) ≤ n * (2 ^ c)⁻¹ ^ l, where n bounds the initial cover. Matrix.copyStage_rates provides the per-stage rates [OpenAI2026LogSpace, Proposition 4.7].