Documentation

CslibFrontier.Computability.LogSpaceDerandomization.DenseRowRecipes

Bounded dense row recipes #

Shared arbitrary-child recipes for global hierarchy access and signed residual clients. The routed cutoff is [OpenAI2026LogSpace, Section 5.2, (5.9)], revision 7ef5c0cc. Top clipping includes routing; raw ranks are evaluated before scalar clipping.

Main definitions #

noncomputable def Matrix.routedBinCutoff (χ : ℝ → ℝ) (b : ℕ → ℝ) (i : ℕ) (route : ℝ → ℝ) (d : ℝ) :

The bin in atom units, with destination routing included before the row normalization. For an unrouted bin use the routing function constantly equal to one.

theorem Matrix.mul_routedBinCutoff {χ route : ℝ → ℝ} {b : ℕ → ℝ} {i : ℕ} (hb : b i ≠ 0) (w : ℝ) :
b i * routedBinCutoff χ b i route (w / b i) = w * Cslib.binWeight χ b i w * route w

Converting an atom-unit routed cutoff back to matrix units preserves the raw argument.

theorem Matrix.sum_routedBinCutoff {χ route : ℝ → ℝ} {b : ℕ → ℝ} (n : ℕ) (hb : ∀ (i : ℕ), 0 < b i) (hχ : ∀ (t : ℝ), 1 ≤ t → χ t = 1) {w : ℝ} (hcover : w = 0 ∨ b n ≤ w) :
∑ i ∈ Finset.range (n + 1), b i * routedBinCutoff χ b i route (w / b i) = w * route w

Finite coverage of the true entry suffices; a zero entry needs no positive lower cutoff.

def Matrix.CorrectionRowRecipe.residual {V : Type u_1} [Fintype V] (direct negative left right : Matrix V V ℝ) :

Signed raw residual, before any scalar saturation. The right child releases the source and is evaluated at z. The negative and product-left corrections have separate terminal/usage tuples. Direct and right children may be different estimates of the base.

theorem Matrix.CorrectionRowRecipe.residual_eq {V : Type u_1} [Fintype V] (C E : Matrix V V ℝ) :
residual C E E C = C - E + E * C

Substitution of exact children recovers the existing matrix expression.

noncomputable def Matrix.boundedRoutedBinCutoff (χ : ℝ → ℝ) (b : ℕ → ℝ) (cap : ℝ) (i : ℕ) (route : ℝ → ℝ) (d : ℝ) :

Bounded top bin, with the same clipped first entry used in its routing fraction. Positive fine bins keep their original expression; negative inputs are extended by zero.

theorem Matrix.boundedRoutedBinCutoff_eq {χ : ℝ → ℝ} {b : ℕ → ℝ} {cap d : ℝ} (hd : 0 ≤ d) (hcap : d ≤ cap) (i : ℕ) (route : ℝ → ℝ) :
boundedRoutedBinCutoff χ b cap i route d = routedBinCutoff χ b i route d

The bounded expression preserves every nonnegative true input below the top cap.

theorem Matrix.boundedRoutedBinCutoff_of_neg {χ : ℝ → ℝ} {b : ℕ → ℝ} {cap d : ℝ} (hcap : 0 ≤ cap) (hd : d < 0) (i : ℕ) (route : ℝ → ℝ) :
boundedRoutedBinCutoff χ b cap i route d = 0

Negative estimates produce no bin value, including at the clipped top bin.

theorem Matrix.boundedRoutedBinCutoff_eq_zero {χ : ℝ → ℝ} {b : ℕ → ℝ} {cap d : ℝ} (hcap : 0 ≤ cap) (hχ0 : ∀ t ≤ 1 / 2, χ t = 0) (hb : ∀ (i : ℕ), 0 < b i) (hanti : Antitone b) (hd : d ≤ 1 / 2) (i : ℕ) (route : ℝ → ℝ) :
boundedRoutedBinCutoff χ b cap i route d = 0

Scalar top clipping and zero extension preserve the dense lower support threshold. Consequently raw row-rank gates still bound support for arbitrary estimates.

theorem Matrix.routedBinCutoff_succ_lt {χ : ℝ → ℝ} {b : ℕ → ℝ} (hχ0 : ∀ t ≤ 1 / 2, χ t = 0) (hχ1 : ∀ (t : ℝ), 1 ≤ t → χ t = 1) (hb : ∀ (i : ℕ), 0 < b i) (hanti : Antitone b) {i : ℕ} {route : ℝ → ℝ} {d : ℝ} (h : routedBinCutoff χ b (i + 1) route d ≠ 0) :
d < b i / b (i + 1)

A true fine-bin nonzero value controls the atom-unit entry by the adjacent scale ratio.

theorem Matrix.boundedRoutedBinCutoff_mem_Icc {χ : ℝ → ℝ} {b : ℕ → ℝ} {cap B : ℝ} (hcap : 0 ≤ cap) (hB : 0 ≤ B) (hcapB : cap ≤ B) (hχ : Monotone χ) (hχ0 : ∀ t ≤ 1 / 2, χ t = 0) (hχ1 : ∀ (t : ℝ), 1 ≤ t → χ t = 1) (hχrange : ∀ (t : ℝ), χ t ∈ Set.Icc 0 1) (hb : ∀ (i : ℕ), 0 < b i) (hanti : Antitone b) (hratio : ∀ (i : ℕ), b i / b (i + 1) ≤ B) (route : ℝ → ℝ) (hr : ∀ (w : ℝ), route w ∈ Set.Icc 0 1) (i : ℕ) (d : ℝ) :
boundedRoutedBinCutoff χ b cap i route d ∈ Set.Icc 0 B

Fixed finite range for arbitrary estimated inputs. The top cap and fine scale ratio are separate bounds; no clipping is applied to a fine bin's routing argument.

noncomputable def Matrix.DenseRowRecipe.preparation {V : Type u_1} {Ω : Type u_3} [Fintype V] (h ρ : ℝ → ℝ) (K : ℕ) (b : ℝ) (Y : Ω → V → Prop) [(s : Ω) → (v : V) → Decidable (Y s v)] (raw : Matrix V V ℝ) (s : Ω) :

Dense preparation on the full raw row, before scalar clipping or access filtering.

noncomputable def Matrix.DenseRowRecipe.normalized {V : Type u_1} {Γ : Type u_2} {Ω : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ω] (k ρ : ℝ → ℝ) (K : ℕ) (b : ℝ) (X : Γ → V → Prop) (Y Yt : Ω → V → Prop) [(s : Γ) → (v : V) → Decidable (X s v)] [(s : Ω) → (v : V) → Decidable (Y s v)] [(s : Ω) → (v : V) → Decidable (Yt s v)] (raw : Matrix V V ℝ) (prep : Γ × Ω → Matrix V V ℝ) (σ : Γ × Ω) (x y : V) :

Normalization of arbitrary children. Preparation is averaged on its own source/usage slice, including inherited suffixes, without an importance factor.

theorem Matrix.DenseRowRecipe.normalized_mem_Icc {V : Type u_1} {Γ : Type u_2} {Ω : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ω] (k ρ : ℝ → ℝ) (K : ℕ) (b : ℝ) (X : Γ → V → Prop) (Y Yt : Ω → V → Prop) [(s : Γ) → (v : V) → Decidable (X s v)] [(s : Ω) → (v : V) → Decidable (Y s v)] [(s : Ω) → (v : V) → Decidable (Yt s v)] {B : ℝ} (hB : 0 ≤ B) (hk : ∀ (d : ℝ), k d ∈ Set.Icc 0 B) (hρ : ∀ (r : ℝ), ρ r ∈ Set.Icc 0 1) (raw : Matrix V V ℝ) (prep : Γ × Ω → Matrix V V ℝ) (σ : Γ × Ω) (x y : V) :
normalized k ρ K b X Y Yt raw prep σ x y ∈ Set.Icc 0 (2 * B)

Every arbitrary preparatory estimate gives the same fixed output range.

theorem Matrix.DenseRowRecipe.card_filter_normalized_ne_zero_lt {V : Type u_1} {Γ : Type u_2} {Ω : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ω] (k ρ : ℝ → ℝ) (K : ℕ) (b : ℝ) (X : Γ → V → Prop) (Y Yt : Ω → V → Prop) [(s : Γ) → (v : V) → Decidable (X s v)] [(s : Ω) → (v : V) → Decidable (Y s v)] [(s : Ω) → (v : V) → Decidable (Yt s v)] (hsub : ∀ (s : Ω) (y : V), Yt s y → Y s y) (hK : 0 < K) {e g : ℝ} (he : 0 ≤ e) (hk : ∀ d ≤ e, k d = 0) (hg : g ≤ e) (hρ : ∀ (r : ℝ), g ≤ r → ρ r = 0) (raw : Matrix V V ℝ) (prep : Γ × Ω → Matrix V V ℝ) (σ : Γ × Ω) (x : V) :
{y : V | normalized k ρ K b X Y Yt raw prep σ x y ≠ 0}.card < K

Output support is controlled by ranks on the original raw matrix, independent of the preparatory child. This is a support statement, not an access enumeration algorithm.

theorem Matrix.DenseRowRecipe.normalized_eq_denseAtom {V : Type u_1} {Γ : Type u_2} {Ω : Type u_3} [Fintype V] [Fintype Γ] [Fintype Ω] (k h ρ : ℝ → ℝ) (K : ℕ) (b : ℝ) (X : Γ → V → Prop) (Y Yt : Ω → V → Prop) [(s : Γ) → (v : V) → Decidable (X s v)] [(s : Ω) → (v : V) → Decidable (Y s v)] [(s : Ω) → (v : V) → Decidable (Yt s v)] (raw : Matrix V V ℝ) (σ : Γ × Ω) (x y : V) (hx : {s : Γ | X s x}.Nonempty) :
normalized k ρ K b X Y Yt raw (fun (σ : Γ × Ω) => preparation h ρ K b Y raw σ.2) σ x y = denseAtom Y Yt k h ρ K b raw σ.2 x y

Exact preparation loses its source dependence after the source slice is fixed.

Scalar parameters of a dense bin. Channel predicates remain invocation arguments.

  • χ : ℝ → ℝ

    Bin switch.

  • scales : ℕ → ℝ

    Positive scales are required by the true-mean lemmas, not by evaluation.

  • cap : ℝ

    Cap on the top-bin scalar argument.

  • route : ℝ → ℝ

    Routing fraction evaluated before normalization.

  • h : ℝ → ℝ

    Preparation support function.

  • ρ : ℝ → ℝ

    Raw row-rank gate.

  • K : ℕ

    Padded row rank.