Documentation

CslibFrontier.Computability.LogSpaceDerandomization.HierarchyTaskMeans

Actual correction tasks and reward sample means #

CorrectionSampling records gates and pair-count bounds for sampling a particular actual correction input. It contains no mean identity or estimator error certificate. The correction input's nonnegativity and row mass come from HierarchyParams.correctionInput_bounds. CorrectionSampling.withUsage replaces the usage slice using its actual marginal and cross-rate pair count while preserving the true channels and gates. The sample uses two independent seed coordinates; its midpoint mask is part of the actual correction atom. Uniform midpoint density cancels its sampling probability.

The resulting reward sample has the exact mean of the deterministic correction-and-copy reward update, including a nonprimary copy's weight. This is the correction/reward part of [OpenAI2026LogSpace, Lemma 7.1, (7.5), printed pp. 34–35], revision 7ef5c0cc. It is an exact finite identity, independent of the choice of fourth or eighth moments. Estimates may later share coordinates, but that does not replace this product-seed true-mean argument.

The local pilot preparation/normalization family is in CslibFrontier/Computability/LogSpaceDerandomization/PilotRowTasks.lean. Routed direct bins, the common global task order, complete scheduled mean bound, raw differences, conditional noise, compression and strong recursion remain separate work.

structure Matrix.HierarchyParams.CorrectionSampling {q cπ Cπ Cpair Cvar : ℝ} (P : HierarchyParams q cπ Cπ Cpair Cvar) {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] (X : ι → V → Prop) (Y : κ → V → Prop) [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ) (C : Matrix V V ℝ) (i : ℕ) extends Matrix.CorrectionSamplingLaws P.Q (P.correctionInput X Y f C i) (fun (z : V) => P.γ (P.pilot X Y f C z)) Xs Z Zt f (↑i + 1) :

Primitive sampling/gate conditions for an actual correction task. The row bound used in normalization is i + 1, derived from the concrete iteration rather than supplied here.

noncomputable def Matrix.HierarchyParams.CorrectionSampling.withUsage {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
P.CorrectionSampling X Y Xs Z U f C i

Change only the usage channel of an actual correction sampler. Its measured density and cross-rate pair bound suffice; true hierarchy channels and all gates stay fixed.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_I {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).I = A.I

Usage replacement preserves the I parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_τ {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).τ = A.τ

Usage replacement preserves the τ parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_h {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).h = A.h

Usage replacement preserves the h parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_ρ {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).ρ = A.ρ

Usage replacement preserves the ρ parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_K {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).K = A.K

Usage replacement preserves the K parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_Kc {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).Kc = A.Kc

Usage replacement preserves the Kc parameter.

theorem Matrix.HierarchyParams.CorrectionSampling.withUsage_π {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (U : Ζ → V → Prop) [(t : Ζ) → (v : V) → Decidable (U t v)] (π : ℝ) (hπ : 0 < π) (hd : ∀ (z : V), ↑{t : Ζ | U t z}.dens = π) (hp : ∀ (z w : V), w ≠ z → ↑{t : Ζ | U t z ∧ Z t w}.card ≤ A.c * f * ↑{t : Ζ | U t z}.card) :
(A.withUsage U π hπ hd hp).π = π

Usage replacement uses the supplied measured density.

def Matrix.HierarchyParams.CorrectionSampling.withSource {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (S : Γ → V → Prop) [(s : Γ) → (v : V) → Decidable (S s v)] (hp : ∀ (x w : V), w ≠ x → ↑{s : Γ | S s x ∧ S s w}.card ≤ A.p * ↑{s : Γ | S s x}.card) :
P.CorrectionSampling X Y S Z Zt f C i

Replace the conditioning source while keeping the true channels, ranks and incoming budget. Only its conditional pair count must fit the existing source constant. The exposed record update lets concrete recipe clients reduce its unchanged gate projections.

noncomputable def Matrix.HierarchyParams.CorrectionSampling.atom {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (σ : Γ × Ζ) (x z : V) :

The normalized stochastic correction, built from this actual hierarchy input and its final pilot multiplier. The usage mask is the midpoint channel.

noncomputable def Matrix.HierarchyParams.CorrectionSampling.rewardSample {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (r : ℝ) (W : V → ℝ) (σ : Γ × Ζ) (x : V) :

The two terms in the reward formula, before a conditional average. The direct child retains the old source; the correction child is evaluated at its sampled midpoint.

theorem Matrix.HierarchyParams.CorrectionSampling.usage_nonempty {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (z : V) :
{t : Ζ | Zt t z}.Nonempty

Positive actual density supplies every midpoint conditioning slice.

theorem Matrix.HierarchyParams.CorrectionSampling.expect_atom {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (hf : 0 < f) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) {x : V} (hx : {s : Γ | Xs s x}.Nonempty) (z : V) :
(({s : Γ | Xs s x} ×ˢ Finset.univ).expect fun (σ : Γ × Ζ) => f / A.π * A.atom σ x z) = P.correctionIter X Y f C (i + 1) x z

Normalization is proved from the gates on the actual correction input.

theorem Matrix.HierarchyParams.CorrectionSampling.expect_rewardSample {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) (hf : 0 < f) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) {x : V} (hx : {s : Γ | Xs s x}.Nonempty) (r : ℝ) (W : V → ℝ) :
(({s : Γ | Xs s x} ×ˢ Finset.univ).expect fun (σ : Γ × Ζ) => A.rewardSample r W σ x) = r * (W x + (P.correctionIter X Y f C (i + 1)).mulVec W x)

The reward sample's true conditional mean is the actual correction update. No conditional mean is assumed as a field of CorrectionSampling.

theorem Matrix.HierarchyParams.CorrectionSampling.expect_projected_rewardSample {q cπ Cπ Cpair Cvar : ℝ} {P : HierarchyParams q cπ Cπ Cpair Cvar} {V : Type u_1} {ι : Type u_2} {κ : Type u_3} {Γ : Type u_4} {Ζ : Type u_5} [Fintype V] [Fintype ι] [Fintype κ] [Fintype Γ] [Fintype Ζ] {X : ι → V → Prop} {Y : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Y t 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 : ℝ} {C : Matrix V V ℝ} {i : ℕ} (A : P.CorrectionSampling X Y Xs Z Zt f C i) [DecidableEq V] (hf : 0 < f) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hi : i + 1 = P.k) (a : Lex (V × Fin (P.m + 1))) (hx : {s : Γ | Xs s (ofLex a).1}.Nonempty) (W : V → ℝ) :
(({s : Γ | Xs s (ofLex a).1} ×ˢ Finset.univ).expect fun (σ : Γ × Ζ) => A.rewardSample (P.weight X Y f C (ofLex a).2 (ofLex a).1) W σ (ofLex a).1) = (P.proj X Y f C).mulVec (W + (P.correction X Y f C).mulVec W) a

On a fixed copy-symbol part this is exactly the deterministic correction-and-copy reward update, including nonprimary weights.

theorem Matrix.expect_hierarchyRewardSample {q cπ Cπ Cpair Cvar : ℝ} (P : HierarchyParams q cπ Cπ Cpair Cvar) {V : ℕ → Type u_1} [(l : ℕ) → Fintype (V l)] [(l : ℕ) → LinearOrder (V l)] (e : (l : ℕ) → V (l + 1) ≃ Lex (V l × Fin (P.m + 1))) {ι : ℕ → Type u_2} {κ : ℕ → Type u_3} [(l : ℕ) → Fintype (ι l)] [(l : ℕ) → Fintype (κ l)] (X : (l : ℕ) → ι l → V l → Prop) (Y : (l : ℕ) → κ l → V l → Prop) [(l : ℕ) → (s : ι l) → (v : V l) → Decidable (X l s v)] [(l : ℕ) → (t : κ l) → (v : V l) → Decidable (Y l t v)] (S : Matrix (V 0) (V 0) ℝ) {Γ : Type u_4} {Ζ : Type u_5} [Fintype Γ] [Fintype Ζ] (l i : ℕ) (Xs : Γ → V l → Prop) (Z Zt : Ζ → V l → Prop) [(s : Γ) → (v : V l) → Decidable (Xs s v)] [(t : Ζ) → (v : V l) → Decidable (Z t v)] [(t : Ζ) → (v : V l) → Decidable (Zt t v)] (A : P.CorrectionSampling (X l) (Y l) Xs Z Zt (q⁻¹ ^ l) (hierarchy P e X Y S l) i) (hi : i + 1 = P.k) (he : ∀ (j : ℕ) (a b : V (j + 1)), (e j) a < (e j) b → a < b) (hq : 0 < q) (hCπ : 0 < Cπ) (hS : S.IsStrictUpperTriangular) (hS0 : ∀ (x y : V 0), 0 ≤ S x y) (hS1 : S.mulVec 1 ≤ 1) {π : ℕ → ℝ} (hch : ∀ j < l, Cslib.Probability.RetentionChannels (X j) (Y j) (q⁻¹ ^ j) (π j) cπ Cπ Cpair Cvar) (e₀ : V 0 → ℝ) (a : V (l + 1)) (hx : {s : Γ | Xs s (ofLex ((e l) a)).1}.Nonempty) :
(({s : Γ | Xs s (ofLex ((e l) a)).1} ×ˢ Finset.univ).expect fun (σ : Γ × Ζ) => A.rewardSample (P.weight (X l) (Y l) (q⁻¹ ^ l) (hierarchy P e X Y S l) (ofLex ((e l) a)).2 (ofLex ((e l) a)).1) ((rewardTransport (hierarchyProj P e X Y S) (hierarchyCorrection P e X Y S) l).mulVec e₀) σ (ofLex ((e l) a)).1) = (rewardTransport (hierarchyProj P e X Y S) (hierarchyCorrection P e X Y S) (l + 1)).mulVec e₀ a

The product-seed sample realizes the reward of the next actual hierarchy stage. The old reward is deterministic here; replacing it and the correction by estimates requires the separate induction comparisons. No unbiasedness of such estimates is asserted.