Documentation

CslibFrontier.Computability.LogSpaceDerandomization.CorrectionRowRecipe

Shared correction sampling laws and child-function recipes #

Primitive channel and gate laws for the incoming-gated correction atom of [OpenAI2026LogSpace, Section 5.3, (5.12)–(5.14)], revision 7ef5c0cc. The input matrix, row-mass bound and deterministic column multiplier are parameters. Pilot and actual correction clients supply their own inputs and multipliers; no mean or error certificate is a field. CorrectionRowRecipe computes ranks on the full substituted child table, and averages the preparatory child on the inherited source and narrower usage slice. The second channel of Section 7.2 has no broad/narrow importance ratio.

The existing atom law budgets one quarter of the draws to each gate failure, giving the 1/2 lower bound sufficient for exact clipped normalization. This does not assert the source Lemma 5.3 stronger 3/4 margin, its canonical smooth cutoffs or their root regularity.

structure Matrix.CorrectionSamplingLaws {V : Type u_1} {Γ : Type u_2} {Ζ : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ζ] (Q : ℝ → ℝ) (G : Matrix V V ℝ) (g : V → ℝ) (Xs : Γ → V → Prop) (Z Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (f M : ℝ) :

Primitive hypotheses shared by pilot and actual atoms, with an explicit true input and multiplier. Row mass is checked by the client, not assumed as an aggregate mean.

  • I : ℝ → ℝ → ℝ

    Auxiliary incoming score.

  • τ : ℝ → ℝ

    Incoming gate.

  • h : ℝ → ℝ

    Preparatory support cutoff.

  • ρ : ℝ → ℝ

    Row gate.

  • K : ℕ

    Row rank used by the row gate.

  • Kc : ℕ

    Incoming rank used by the incoming gate.

  • η : ℝ

    Safe threshold for the row gate.

  • τ₀ : ℝ

    Safe threshold for the incoming gate.

  • e : ℝ

    Auxiliary-score support threshold.

  • c : ℝ

    Terminal pair-count constant.

  • p : ℝ

    Source pair-count constant.

  • R : ℝ

    Incoming-count bound on the support of the pilot multiplier.

  • π : ℝ

    Actual uniform midpoint density, not a nominal rate.

  • π_pos : 0 < self.π

    Positive actual usage density.

  • density (z : V) : ↑{t : Ζ | Zt t z}.dens = self.π

    Uniform usage density on every terminal vertex.

  • Q_support (v : ℝ) : Q v ≠ 0 → self.h v = 1

    Preparation equals the gate product on the support of the exact cutoff.

  • ρ_nonneg (r : ℝ) : 0 ≤ self.ρ r

    Nonnegative row gate on arbitrary ranks.

  • ρ_le_one (r : ℝ) : self.ρ r ≤ 1

    Row gate is at most one.

  • η_pos : 0 < self.η

    Positive safe row threshold.

  • ρ_one (r : ℝ) : r ≤ self.η → self.ρ r = 1

    The row gate is full through its safe threshold.

  • τ_nonneg (r : ℝ) : 0 ≤ self.τ r

    Nonnegative incoming gate on arbitrary ranks.

  • τ_le_one (r : ℝ) : self.τ r ≤ 1

    Incoming gate is at most one.

  • τ₀_nonneg : 0 ≤ self.τ₀

    The safe incoming threshold is nonnegative.

  • τ_one (r : ℝ) : r ≤ self.τ₀ → self.τ r = 1

    The incoming gate is full through its safe threshold.

  • I_zero (v r : ℝ) : v ≤ self.e → self.I v r = 0

    Auxiliary scores vanish below the input threshold, independently of the row rank.

  • c_nonneg : 0 ≤ self.c

    Nonnegative terminal pair constant.

  • row_rank : 4 * (1 + self.c * M / self.η) ≤ ↑self.K

    Row rank makes failure cost at most one quarter on the true input.

  • terminal_pair (z w : V) : w ≠ z → ↑{t : Ζ | Zt t z ∧ Z t w}.card ≤ self.c * f * ↑{t : Ζ | Zt t z}.card

    Cross-rate terminal pair count, conditional on the usage hit.

  • p_nonneg : 0 ≤ self.p

    Nonnegative source pair constant.

  • source_pair (x w : V) : w ≠ x → ↑{s : Γ | Xs s x ∧ Xs s w}.card ≤ self.p * ↑{s : Γ | Xs s x}.card

    Source pair count conditional on the inherited source hit.

  • incoming_count (z : V) : g z ≠ 0 → self.p * ↑{w : V | self.e < G w z / f}.card ≤ self.R

    True input support bound only where the deterministic multiplier is nonzero.

  • incoming_rank : 4 * (1 + self.R) ≤ ↑self.Kc

    Incoming rank makes failure cost at most one quarter.

theorem Matrix.CorrectionSamplingLaws.usage_nonempty {V : Type u_1} {Γ : Type u_2} {Ζ : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ζ] {Q : ℝ → ℝ} {G : Matrix V V ℝ} {g : V → ℝ} {Xs : Γ → V → Prop} {Z Zt : Ζ → V → Prop} [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] {f M : ℝ} (A : CorrectionSamplingLaws Q G g Xs Z Zt f M) (y : V) :
{t : Ζ | Zt t y}.Nonempty

Positive usage density makes every terminal conditioning slice nonempty.

theorem Matrix.CorrectionSamplingLaws.expect_atom {V : Type u_1} {Γ : Type u_2} {Ζ : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ζ] {Q : ℝ → ℝ} {G : Matrix V V ℝ} {g : V → ℝ} {Xs : Γ → V → Prop} {Z Zt : Ζ → V → Prop} [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] {f M : ℝ} (A : CorrectionSamplingLaws Q G g Xs Z Zt f M) (hf : 0 < f) (hG : ∀ (x y : V), 0 ≤ G x y) (hGM : ∀ (x : V), ∑ y : V, G x y ≤ M) {x : V} (hx : {s : Γ | Xs s x}.Nonempty) (y : V) :
(({s : Γ | Xs s x} ×ˢ {t : Ζ | Zt t y}).expect fun (σ : Γ × Ζ) => correctionAtom A.I A.τ A.K A.Kc f G Xs Z Zt Q A.h A.ρ g σ x y) = Q (G x y / f) * g y

The true conditional mean follows from primitive gate and pair-count laws.

theorem Matrix.CorrectionSamplingLaws.expect_atom_unconditioned {V : Type u_1} {Γ : Type u_2} {Ζ : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ζ] {Q : ℝ → ℝ} {G : Matrix V V ℝ} {g : V → ℝ} {Xs : Γ → V → Prop} {Z Zt : Ζ → V → Prop} [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] {f M : ℝ} (A : CorrectionSamplingLaws Q G g Xs Z Zt f M) (hf : 0 < f) (hG : ∀ (x y : V), 0 ≤ G x y) (hGM : ∀ (x : V), ∑ y : V, G x y ≤ M) {x : V} (hx : {s : Γ | Xs s x}.Nonempty) (y : V) :
(({s : Γ | Xs s x} ×ˢ Finset.univ).expect fun (σ : Γ × Ζ) => f / A.π * correctionAtom A.I A.τ A.K A.Kc f G Xs Z Zt Q A.h A.ρ g σ x y) = f * Q (G x y / f) * g y

Integrating usage membership cancels its actual density, rather than a nominal rate.

def Matrix.CorrectionRowRecipe.input {V : Type u_4} [Fintype V] (direct left right : Matrix V V ℝ) :

Direct plus product input. The right row is evaluated at the midpoint, releasing the parent source; no old source or selected endpoint is a child parameter.

noncomputable def Matrix.CorrectionRowRecipe.normalizer {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype Γ] [Fintype Ζ] (Xs : Γ → V → Prop) (Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (prep : Γ × Ζ → Matrix V V ℝ) (x y : V) :

Conditional normalizer of an arbitrary preparatory child; all channel suffixes are inherited.

noncomputable def Matrix.CorrectionRowRecipe.secondChannel {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype Γ] [Fintype Ζ] (Xs : Γ → V → Prop) (Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (ζ : ℝ) (prep : Γ × Ζ → Matrix V V ℝ) (σ : Γ × Ζ) (x y : V) :

The narrower second signal, with external scale and zero extension, has no importance ratio.

noncomputable def Matrix.CorrectionRowRecipe.preparation {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] (I : ℝ → ℝ → ℝ) (τ h ρ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] (input : Matrix V V ℝ) (σ : Γ × Ζ) :

Incoming-gate preparation on the completed raw child, before any port filtering.

noncomputable def Matrix.CorrectionRowRecipe.normalized {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] [Fintype Γ] [Fintype Ζ] (I : ℝ → ℝ → ℝ) (τ ρ Q γ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (input : Matrix V V ℝ) (prep : Γ × Ζ → Matrix V V ℝ) (maximum : V → ℝ) (σ : Γ × Ζ) (x y : V) :

Normalization on arbitrary child functions. The scalar cutoff is supplied already bounded; the incoming scores and ranks still inspect every original raw entry.

theorem Matrix.CorrectionRowRecipe.normalized_mem_Icc {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] [Fintype Γ] [Fintype Ζ] (I : ℝ → ℝ → ℝ) (τ ρ Q γ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] {B : ℝ} (hB : 0 ≤ B) (hQ0all : ∀ (d : ℝ), 0 ≤ Q d) (hQ1all : ∀ (d : ℝ), Q d ≤ B) (hρ0 : ∀ (r : ℝ), 0 ≤ ρ r) (hρ1 : ∀ (r : ℝ), ρ r ≤ 1) (hτ0 : ∀ (r : ℝ), 0 ≤ τ r) (hτ1 : ∀ (r : ℝ), τ r ≤ 1) (hγ0 : ∀ (r : ℝ), 0 ≤ γ r) (hγ1 : ∀ (r : ℝ), γ r ≤ 1) (input : Matrix V V ℝ) (prep : Γ × Ζ → Matrix V V ℝ) (maximum : V → ℝ) (σ : Γ × Ζ) (x y : V) :
normalized I τ ρ Q γ K Kc f Xs Z Zt input prep maximum σ x y ∈ Set.Icc 0 (2 * B)

Uniform range for arbitrary raw, preparation and vector children. The clipped denominator stays positive even for negative preparatory estimates; no mean or error premise is used.

theorem Matrix.CorrectionRowRecipe.preparation_mem_Icc {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] (I : ℝ → ℝ → ℝ) (τ h ρ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] (hh : ∀ (d : ℝ), h d ∈ Set.Icc 0 1) (hρ : ∀ (r : ℝ), ρ r ∈ Set.Icc 0 1) (hτ : ∀ (r : ℝ), τ r ∈ Set.Icc 0 1) (input : Matrix V V ℝ) (σ : Γ × Ζ) (x y : V) :
preparation I τ h ρ K Kc f Xs Z input σ x y ∈ Set.Icc 0 1

Preparatory estimates also stay in the gate range when the support cutoff does.

theorem Matrix.CorrectionRowRecipe.card_filter_normalized_row_ne_zero_lt {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] [Fintype Γ] [Fintype Ζ] (I : ℝ → ℝ → ℝ) (τ ρ Q γ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (input : Matrix V V ℝ) (prep : Γ × Ζ → Matrix V V ℝ) (maximum : V → ℝ) (σ : Γ × Ζ) (x : V) (hK : 0 < K) {e g : ℝ} (he : 0 ≤ e) (hQ : ∀ d ≤ e, Q d = 0) (hg : g ≤ e) (hρ : ∀ (r : ℝ), g ≤ r → ρ r = 0) :
{y ∈ {w : V | Z σ.2 w} | normalized I τ ρ Q γ K Kc f Xs Z Zt input prep maximum σ x y ≠ 0}.card < K

Arbitrary preparatory/vector children cannot enlarge the row support of the first gate.

theorem Matrix.CorrectionRowRecipe.card_filter_normalized_col_ne_zero_lt {V : Type u_4} {Γ : Type u_5} {Ζ : Type u_6} [Fintype V] [Fintype Γ] [Fintype Ζ] (I : ℝ → ℝ → ℝ) (τ ρ Q γ : ℝ → ℝ) (K Kc : ℕ) (f : ℝ) (Xs : Γ → V → Prop) (Z Zt : Ζ → V → Prop) [(s : Γ) → (v : V) → Decidable (Xs s v)] [(t : Ζ) → (v : V) → Decidable (Z t v)] [(t : Ζ) → (v : V) → Decidable (Zt t v)] (input : Matrix V V ℝ) (prep : Γ × Ζ → Matrix V V ℝ) (maximum : V → ℝ) (σ : Γ × Ζ) (y : V) (hKc : 0 < Kc) (hIQ : ∀ (v r : ℝ), Q v ≠ 0 → ρ r ≠ 0 → I v r = 1) {g : ℝ} (hg : g ≤ 1) (hτ : ∀ (r : ℝ), g ≤ r → τ r = 0) :
{x ∈ {w : V | Xs σ.1 w} | normalized I τ ρ Q γ K Kc f Xs Z Zt input prep maximum σ x y ≠ 0}.card < Kc

The incoming rank on the completed raw table bounds column support after any substitutions.