Documentation

CslibFrontier.Computability.LogSpaceDerandomization.HierarchySignedMean

Genuine signed canonical request means #

The actual correction child is zero off its usage event. Its source-conditioned canonical mean transports to the inherited terminal event with the exact density factor. Normalized index j selects genuine iterate j.val; final dispatch at fixed structural HP.k completes iterate HP.k. Statistical precision does not change this request structure.

The literal one-bin rawSample mean is C_bin + E C_bin - E. The finite residual assembly sums actual positive bins using the existing routed-bin partition and subtracts the special negative request once. Coverage, distinct roles, exact importance/midpoint densities, source reset, all suffixes and the narrower-source finite horizon remain explicit. This is one genuine deterministic stage, not recursive correctness of estimated children or a routed copy-stage/error theorem.

The assembly is original work by Christian Reitwiessner using Samuel Schlesinger's hierarchy construction and the genuine source sampler. Child-error propagation, numerical envelopes, recursive reserves, workspace bounds and RL=L remain open.

Main definitions #

Main results #

theorem Matrix.HierarchyParams.H4RankEnvironment.sourceChild_zero_off_usage {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) {n : ℕ} (r : HierarchyTask.Request n (Fin J) (ZMod P)) (hr : Admissible r) (C : Matrix V V ℝ) (i : ℕ) (σ : Environment P J) (x y : V) (hy : ¬splitUsage D ident r (σ r.terminal.role) y) :
sourceChild HP D ident r hr C i σ x y = 0

A genuine correction child vanishes outside its actual usage slice.

theorem Matrix.HierarchyParams.H4RankEnvironment.sourceChild_mean_on_terminal_event {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) {n : ℕ} (r : HierarchyTask.Request n (Fin J) (ZMod P)) (hr : Admissible r) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) {k s u : ℕ} (hsH : s ≤ H.maxExponent) (hks : k ≤ s) (hs : r.source.rate = rate s) (ht : r.terminal.rate = rate k) (hu : r.usage.rate = rate u) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ r.terminal.rate) {i : ℕ} (hi : i < HP.k) (q : Cslib.Probability.FrameChannel P 4 1 → Prop) [DecidablePred q] (x y : V) (hsub : ∀ (A : Cslib.Probability.FrameChannel P 4 1), splitUsage D ident r A y → q A) :
({σ : Environment P J | r.source.retains (channels D) σ (ident x) ∧ q (σ r.terminal.role)}.expect fun (σ : Environment P J) => r.terminal.rate * (↑{σ : Environment P J | q (σ r.terminal.role)}.dens / ↑{σ : Environment P J | r.usage.retains (channels D) σ (ident y)}.dens) * sourceChild HP D ident r hr C i σ x y) = HP.correctionIter (canonicalChannel ident r.terminal.rate) (canonicalChannel ident r.terminal.rate) r.terminal.rate C (i + 1) x y

Genuine canonical correction mean under a containing inherited terminal event. The statistical expectation uses one full environment with every spectator integrated. No target-mean hypothesis is supplied.

theorem Matrix.HierarchyParams.H4RankEnvironment.coordinate_min_grid {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (role : Fin J) (suffix : List (ZMod P)) (a b : ℕ) (A : Cslib.Probability.FrameChannel P 4 1) (v : ZMod P) :
coordinate D { role := role, rate := min (rate a) (rate b), suffix := suffix } A v → coordinate D (gridChannel role a suffix) A v

Grid usage at the minimum of two rates is contained in the inherited endpoint event. Both predicates use exactly the same frame and suffix.

noncomputable def Matrix.HierarchyParams.H4RankEnvironment.canonicalRequestChild {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) {n : ℕ} (C : Matrix V V ℝ) (cutoff h ρ : ℝ → ℝ) (K : ℕ) (r : HierarchyTask.Request n (Fin J) (ZMod P)) (σ : Environment P J) :

Genuine actual request children for a selected raw bin. A normalized correction at index j uses sourceChild at j.val, never a statistical precision or a fixed zero iterate. Unused constructors return zero; dense requests keep their full source-reset tuple.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonicalRequestChild_final {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) {n : ℕ} (r : HierarchyTask.Request n (Fin J) (ZMod P)) (hr : Admissible r) (hq : 0 < n) (C : Matrix V V ℝ) (cutoff h ρ : ℝ → ℝ) (K l : ℕ) (htask : r.task = HierarchyTask.correctionAtomTask l false (Fin.last n)) (σ : Environment P J) :
canonicalRequestChild HP D ident C cutoff h ρ K r σ = sourceChild HP D ident r hr C (n - 1) σ

Exact final dispatch in the actual child family.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonicalRequestChild_final_mean {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) {n : ℕ} (r : HierarchyTask.Request n (Fin J) (ZMod P)) (hr : Admissible r) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) {k s u : ℕ} (hsH : s ≤ H.maxExponent) (hks : k ≤ s) (hs : r.source.rate = rate s) (ht : r.terminal.rate = rate k) (hu : r.usage.rate = rate u) (hn : n = HP.k) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ r.terminal.rate) (cutoff h ρ : ℝ → ℝ) (K l : ℕ) (htask : r.task = HierarchyTask.correctionAtomTask l false (Fin.last n)) (q : Cslib.Probability.FrameChannel P 4 1 → Prop) [DecidablePred q] (x y : V) (hsub : ∀ (A : Cslib.Probability.FrameChannel P 4 1), splitUsage D ident r A y → q A) :
({σ : Environment P J | r.source.retains (channels D) σ (ident x) ∧ q (σ r.terminal.role)}.expect fun (σ : Environment P J) => r.terminal.rate * (↑{σ : Environment P J | q (σ r.terminal.role)}.dens / ↑{σ : Environment P J | r.usage.retains (channels D) σ (ident y)}.dens) * canonicalRequestChild HP D ident C cutoff h ρ K r σ x y) = HP.correctionIter (canonicalChannel ident r.terminal.rate) (canonicalChannel ident r.terminal.rate) r.terminal.rate C HP.k x y

The real final correction request has the final canonical correction mean, including its inherited terminal conditioning, rather than just a freely chosen iterate.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonical_rawSample_mean {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (hsH : ks ≤ H.maxExponent) (hms : km ≤ ks) (hbH : kb ≤ H.maxExponent) (ss sm st : List (ZMod P)) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ rate km) (cutoff h ρ : ℝ → ℝ) (K : ℕ) (hkh : ∀ (v : ℝ), cutoff v ≠ 0 → h v = 1) (hρ0 : ∀ (v : ℝ), 0 ≤ ρ v) (hρ1 : ∀ (v : ℝ), ρ v ≤ 1) {η : ℝ} (hη : 0 < η) (hρη : ∀ v ≤ η, ρ v = 1) (hK : 2 * (1 + 32 / η) ≤ ↑K) (x y : V) :
have source := gridChannel R.source ks ss; have mid := gridChannel R.midpoint km sm; have terminal := gridChannel R.terminal kt st; have B := fun (x y : V) => rate kb * cutoff (C x y / rate kb); have E := HP.correctionIter (canonicalChannel ident (rate km)) (canonicalChannel ident (rate km)) (rate km) C HP.k; ({σ : Environment P J | CorrectionRowTask.Channel.retains source (channels D) σ (ident x) ∧ CorrectionRowTask.Channel.retains terminal (channels D) σ (ident y)}.expect fun (σ : Environment P J) => HierarchyTask.rawSample (fun (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (v : V) => channels D role b suffix σ (ident v)) l bin HierarchyTask.RawTask.residual source mid terminal (rate kb) (fun (r : HierarchyTask.Request HP.k (Fin J) (ZMod P)) => canonicalRequestChild HP D ident C cutoff h ρ K r σ) x y) = B x y + ∑ z : V, E x z * B z y - E x y

Literal one-bin rawSample with the real canonical request family. The negative correction occurs once in this call; summing unchanged calls would subtract it repeatedly. Every term uses one full environment, shared midpoint and inherited source/terminal event.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonical_rawNegativeSample_mean {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (hsH : ks ≤ H.maxExponent) (hms : km ≤ ks) (ss sm st : List (ZMod P)) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ rate km) (cutoff h ρ : ℝ → ℝ) (K : ℕ) (x y : V) :
({σ : Environment P J | CorrectionRowTask.Channel.retains (gridChannel R.source ks ss) (channels D) σ (ident x) ∧ CorrectionRowTask.Channel.retains (gridChannel R.terminal kt st) (channels D) σ (ident y)}.expect fun (σ : Environment P J) => HierarchyTask.rawNegativeSample (fun (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (v : V) => channels D role b suffix σ (ident v)) l bin HierarchyTask.RawTask.residual (gridChannel R.source ks ss) (gridChannel R.midpoint km sm) (gridChannel R.terminal kt st) (rate kb) (fun (r : HierarchyTask.Request HP.k (Fin J) (ZMod P)) => canonicalRequestChild HP D ident C cutoff h ρ K r σ) x y) = HP.correctionIter (canonicalChannel ident (rate km)) (canonicalChannel ident (rate km)) (rate km) C HP.k x y

The actual special-negative request has the final canonical mean. Its rank is km, usage is min(parent terminal, km), and no midpoint density is introduced.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonical_rawPositiveSample_mean {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (hsH : ks ≤ H.maxExponent) (hms : km ≤ ks) (hbH : kb ≤ H.maxExponent) (ss sm st : List (ZMod P)) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ rate km) (cutoff h ρ : ℝ → ℝ) (K : ℕ) (hkh : ∀ (v : ℝ), cutoff v ≠ 0 → h v = 1) (hρ0 : ∀ (v : ℝ), 0 ≤ ρ v) (hρ1 : ∀ (v : ℝ), ρ v ≤ 1) {η : ℝ} (hη : 0 < η) (hρη : ∀ v ≤ η, ρ v = 1) (hK : 2 * (1 + 32 / η) ≤ ↑K) (x y : V) :
have B := fun (x y : V) => rate kb * cutoff (C x y / rate kb); have E := HP.correctionIter (canonicalChannel ident (rate km)) (canonicalChannel ident (rate km)) (rate km) C HP.k; ({σ : Environment P J | CorrectionRowTask.Channel.retains (gridChannel R.source ks ss) (channels D) σ (ident x) ∧ CorrectionRowTask.Channel.retains (gridChannel R.terminal kt st) (channels D) σ (ident y)}.expect fun (σ : Environment P J) => HierarchyTask.rawPositiveSample (fun (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (v : V) => channels D role b suffix σ (ident v)) l bin HierarchyTask.RawTask.residual (gridChannel R.source ks ss) (gridChannel R.midpoint km sm) (gridChannel R.terminal kt st) (rate kb) (fun (r : HierarchyTask.Request HP.k (Fin J) (ZMod P)) => canonicalRequestChild HP D ident C cutoff h ρ K r σ) x y) = B x y + ∑ z : V, E x z * B z y

Positive bin contribution before the separately routed special negative correction.

theorem Matrix.HierarchyParams.H4RankEnvironment.canonical_residual_bins_mean {P J : ℕ} [Fact (Nat.Prime P)] {V : Type} [Fintype V] (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (hD : D ≠ 0) (hid : Function.Injective ident) (H : Horizon P) (R : RoleProfile J) (l ks km kt n : ℕ) (ksH : ks ≤ H.maxExponent) (hms : km ≤ ks) (ss sm st : List (ZMod P)) (kb : ℕ → ℕ) (hbH : ∀ i ∈ Finset.range (n + 1), kb i ≤ H.maxExponent) (C : Matrix V V ℝ) (hC : ∀ (x y : V), 0 ≤ C x y) (hC1 : C.mulVec 1 ≤ 1) (hCf : ∀ (x y : V), C x y ≤ rate km) (χ : ℝ → ℝ) (hχ : ∀ (v : ℝ), 1 ≤ v → χ v = 1) (h : ℕ → ℝ → ℝ) (ρ : ℝ → ℝ) (K : ℕ) (hkh : ∀ i ∈ Finset.range (n + 1), ∀ (v : ℝ), routedBinCutoff χ (fun (i : ℕ) => rate (kb i)) i (fun (x : ℝ) => 1) v ≠ 0 → h i v = 1) (hρ0 : ∀ (v : ℝ), 0 ≤ ρ v) (hρ1 : ∀ (v : ℝ), ρ v ≤ 1) {η : ℝ} (hη : 0 < η) (hρη : ∀ v ≤ η, ρ v = 1) (hK : 2 * (1 + 32 / η) ≤ ↑K) (x y : V) (hcover : ∀ (z : V), C z y = 0 ∨ rate (kb n) ≤ C z y) :
have cutoff := fun (i : ℕ) => routedBinCutoff χ (fun (i : ℕ) => rate (kb i)) i fun (x : ℝ) => 1; have source := gridChannel R.source ks ss; have mid := gridChannel R.midpoint km sm; have terminal := gridChannel R.terminal kt st; ({σ : Environment P J | CorrectionRowTask.Channel.retains source (channels D) σ (ident x) ∧ CorrectionRowTask.Channel.retains terminal (channels D) σ (ident y)}.expect fun (σ : Environment P J) => ∑ i ∈ Finset.range (n + 1), HierarchyTask.rawPositiveSample (fun (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (v : V) => channels D role b suffix σ (ident v)) l i HierarchyTask.RawTask.residual source mid terminal (rate (kb i)) (fun (r : HierarchyTask.Request HP.k (Fin J) (ZMod P)) => canonicalRequestChild HP D ident C (cutoff i) (h i) ρ K r σ) x y - HierarchyTask.rawNegativeSample (fun (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (v : V) => channels D role b suffix σ (ident v)) l 0 HierarchyTask.RawTask.residual source mid terminal (rate (kb 0)) (fun (r : HierarchyTask.Request HP.k (Fin J) (ZMod P)) => canonicalRequestChild HP D ident C (cutoff 0) (h 0) ρ K r σ) x y) = HP.residual (canonicalChannel ident (rate km)) (canonicalChannel ident (rate km)) (rate km) C x y

Actual finite bin decomposition of the canonical signed residual. Positive bin samples are summed; the special endpoint correction is subtracted ONCE. The cover and finite horizon are explicit, so this does not assert recursive statistical correctness.