Documentation

CslibFrontier.Computability.LogSpaceDerandomization.HierarchyRankEnvironment

Full rank environments for finite hierarchy prefixes #

One supplied prime serves every stage of this H=4, r=1 client on the q=16 rate grid. The environment contains all independent rank roles and no salt coordinates. Conditioning splits the same environment; spectator coordinates remain full slices. The exact-route torus has modulus one. Finite exponent and identifier horizons are explicit hypotheses.

rawIncomingNormalized_noise applies the component-walk fourth-moment theorem to the actual signed raw residual with incoming-gated normalized correction children. Its right-hand side retains the raw input fourth moment. It does not prove incoming I / h / τ margins, true-mean or reward approximation, statistical induction, a native implementation, or a class equality. This is an original concrete application of the existing frame and row-moment APIs.

Main definitions #

Main results #

@[reducible, inline]

The full product of independent four-dimensional rank frames.

@[reducible, inline]

An actual hierarchy channel on the fixed rank roles and field-valued suffixes.

Operational source-grid rate: exponent k means 16 ^ -k.

Natural side; ceiling division gives the exact finite-grid side.

Instances For

    Ceiling division agrees with the semantic real ceiling on the exponent grid.

    The supplied prime is admissible only through the declared finite horizon.

    • maxExponent : ℕ

      Largest admitted rate exponent.

    • maxIdentifier : ℕ

      Largest admitted natural identifier.

    • side_admissible : 2 ^ self.maxExponent ≤ P

      The smallest queried side has an admissible real lower bound.

    • identifier_admissible : self.maxIdentifier < P

      Natural identifiers fit before field reduction.

    Every grid side is positive for a positive supplied modulus.

    Grid sides never exceed the supplied modulus.

    def Matrix.HierarchyParams.H4RankEnvironment.retains {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (role : Fin J) (k : ℕ) (suffix : List (ZMod P)) (σ : Environment P J) (x : ZMod P) :

    Retention with exact natural exponents, existing padded identifiers, fixed roles.

    noncomputable def Matrix.HierarchyParams.H4RankEnvironment.gridChannel {P J : ℕ} (role : Fin J) (k : ℕ) (suffix : List (ZMod P)) :

    Actual Request channels use real rates; the natural side is specified separately by a grid certificate, rather than computed using a runtime fourth root.

    def Matrix.HierarchyParams.H4RankEnvironment.pairSide {P J : ℕ} (s t : Fin J) (Ls Lt : ℕ) (j : Fin J) :

    Every unconditioned role is a full side-P slice at the public identifier zero.

    Instances For
      def Matrix.HierarchyParams.H4RankEnvironment.pairId {P J : ℕ} [Fact (Nat.Prime P)] (s t : Fin J) (a b : ZMod P) (j : Fin J) :

      Condition source and terminal at their identifiers; spectators use public identifier zero.

      def Matrix.HierarchyParams.H4RankEnvironment.X {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s : Fin J) (Ls : ℕ) (a : V → ZMod P) (σ : Environment P J) (x : V) :

      Source retention in the full rank environment.

      Instances For
        def Matrix.HierarchyParams.H4RankEnvironment.Y {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (t : Fin J) (Lt : ℕ) (b : V → ZMod P) (σ : Environment P J) (z : V) :

        Terminal retention in the same full rank environment.

        Instances For
          @[instance_reducible]
          noncomputable instance Matrix.HierarchyParams.H4RankEnvironment.instDecidableX {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s : Fin J) (L : ℕ) (a : V → ZMod P) (σ : Environment P J) (x : V) :
          Decidable (X s L a σ x)
          @[instance_reducible]
          noncomputable instance Matrix.HierarchyParams.H4RankEnvironment.instDecidableY {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s : Fin J) (L : ℕ) (a : V → ZMod P) (σ : Environment P J) (x : V) :
          Decidable (Y s L a σ x)

          Every frame is retained by the full side-P box.

          noncomputable def Matrix.HierarchyParams.H4RankEnvironment.pairEquiv {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s t : Fin J) (hst : s ≠ t) (Ls Lt : ℕ) (a b : V → ZMod P) (x z : V) :
          Cslib.RetainedPairSlice (X s Ls a) (Y t Lt b) x z ≃ ((j : Fin J) → Cslib.Probability.RetentionSlice P 4 1 (pairSide s t Ls Lt j) (pairId s t (a x) (b z) j)) × (Fin 4 → ZMod 1)

          Exact full-coordinate equivalence. No role is omitted or averaged externally.

          theorem Matrix.HierarchyParams.H4RankEnvironment.pairSide_le {P J : ℕ} (s t : Fin J) (Ls Lt : ℕ) (hs : Ls ≤ P) (ht : Lt ≤ P) (j : Fin J) :
          pairSide s t Ls Lt j ≤ P

          Every coordinate side is bounded by the shared prime.

          instance Matrix.HierarchyParams.H4RankEnvironment.pairSide_neZero {P J : ℕ} [Fact (Nat.Prime P)] (s t : Fin J) (Ls Lt : ℕ) [NeZero Ls] [NeZero Lt] (j : Fin J) :
          NeZero (pairSide s t Ls Lt j)
          noncomputable def Matrix.HierarchyParams.H4RankEnvironment.graph {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s t : Fin J) (hst : s ≠ t) (Ls Lt : ℕ) [NeZero Ls] [NeZero Lt] (hs : Ls ≤ P) (ht : Lt ≤ P) (a b : V → ZMod P) (x z : V) :
          Cslib.RotationMap (Cslib.RetainedPairSlice (X s Ls a) (Y t Lt b) x z) (((_ : Fin J) × ({ p : Fin 4 × Fin 4 // p.1 ≠ p.2 } ⊕ Fin 4) ⊕ { p : Fin 4 × Fin 4 // p.1 ≠ p.2 } ⊕ Fin 4) × Bool ⊕ ((_ : Fin J) × ({ p : Fin 4 × Fin 4 // p.1 ≠ p.2 } ⊕ Fin 4) ⊕ { p : Fin 4 × Fin 4 // p.1 ≠ p.2 } ⊕ Fin 4) × Bool)

          Actual graph on retained environments: one independent rank coordinate moves; the exact-route M=1 coordinate is the unique point.

          theorem Matrix.HierarchyParams.H4RankEnvironment.noise {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] (s t : Fin J) (hst : s ≠ t) (Ls Lt : ℕ) [NeZero Ls] [NeZero Lt] (hs : Ls ≤ P) (ht : Lt ≤ P) (a b : V → ZMod P) {N u : ℝ} (hNu : 0 ≤ N * u) (steps : ℕ) (F : Environment P J → V → V → ℝ) :
          (Cslib.rowNormPow 4 N u (X s Ls a) (Y t Lt b) fun (σ : Environment P J) (x z : V) => Cslib.conditionalWalk (X s Ls a) (Y t Lt b) (graph s t hst Ls Lt hs ht a b) (fun (x x_1 : V) => steps) F σ x z - Cslib.rowSliceMean (X s Ls a) (Y t Lt b) F x z) ≤ 32 * (1 - 1 / (155648 * (↑J + 1) * 4 ^ 4)) ^ (2 * steps) * Cslib.rowNormPow 4 N u (X s Ls a) (Y t Lt b) F

          The full retained-pair / operator obligations are discharged for this concrete rank environment, uniformly in the one supplied prime and both natural sides.

          Semantic extension to the actual real-rate Request interface. Executable clients supply the natural exponent; this extension is used only in the mathematical model.

          The semantic fourth-root side agrees with natural ceiling division on the rate grid.

          noncomputable def Matrix.HierarchyParams.H4RankEnvironment.channels {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (x : ZMod P) :

          Interpret actual real-rate hierarchy channels on the full rank environment.

          Instances For
            @[instance_reducible]
            noncomputable instance Matrix.HierarchyParams.H4RankEnvironment.instDecidableChannels {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (role : Fin J) (b : ℝ) (suffix : List (ZMod P)) (σ : Environment P J) (x : ZMod P) :
            Decidable (channels D role b suffix σ x)
            theorem Matrix.HierarchyParams.H4RankEnvironment.grid_retains {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (role : Fin J) (k : ℕ) (suffix : List (ZMod P)) (σ : Environment P J) (x : ZMod P) :
            CorrectionRowTask.Channel.retains (gridChannel role k suffix) (channels D) σ x ↔ retains D role k suffix σ x

            An actual grid channel has the natural exponent retention predicate.

            Every finite grid rate is positive.

            Increasing the exponent narrows the grid rate.

            Usage minima correspond to maxima of natural exponents.

            The declared exponent horizon supplies the frame side lower bound.

            theorem Matrix.HierarchyParams.H4RankEnvironment.side_div_pow_four_le {P : ℕ} [Fact (Nat.Prime P)] (H : Horizon P) {k : ℕ} (hk : k ≤ H.maxExponent) :
            (↑(side P k) / ↑P) ^ 4 ≤ 16 * rate k

            On the declared exponent horizon, the frame mass (side P k / P) ^ 4 is at most 16 times the grid rate.

            theorem Matrix.HierarchyParams.H4RankEnvironment.retention {P : ℕ} [Fact (Nat.Prime P)] {D : ZMod P} (hD : D ≠ 0) (suffix : List (ZMod P)) (H : Horizon P) {k : ℕ} (hk : k ≤ H.maxExponent) :
            Cslib.Probability.RetentionChannels (fun (A : Cslib.Probability.FrameChannel P 4 1) (x : ZMod P) => Cslib.Probability.frameRetains P 4 (side P k) A (CopyPadding.identifier D suffix x)) (fun (A : Cslib.Probability.FrameChannel P 4 1) (x : ZMod P) => Cslib.Probability.frameRetains P 4 (side P k) A (CopyPadding.identifier D suffix x)) (rate k) ((↑(side P k) / ↑P) ^ 4) 1 16 32 8

            Frame detector constants are exactly (1, 16, 32, 8), independently of P and stage.

            theorem Matrix.HierarchyParams.H4RankEnvironment.density {P J : ℕ} [Fact (Nat.Prime P)] (role : Fin J) (L : ℕ) (hL : L ≤ P) (a : ZMod P) :
            ↑{σ : Environment P J | Cslib.Probability.frameRetains P 4 L (σ role) a}.dens = (↑L / ↑P) ^ 4

            Exact full-environment marginal density, valid also for unconditioned roles.

            theorem Matrix.HierarchyParams.H4RankEnvironment.mixed_pair_density {P J : ℕ} [Fact (Nat.Prime P)] (role : Fin J) (H : Horizon P) {k : ℕ} (hk : k ≤ H.maxExponent) (Lt : ℕ) (hLt : Lt ≤ P) {w y : ZMod P} (hwy : w ≠ y) :
            ↑{σ : Environment P J | Cslib.Probability.frameRetains P 4 (side P k) (σ role) w ∧ Cslib.Probability.frameRetains P 4 Lt (σ role) y}.dens ≤ 32 * rate k * ↑{σ : Environment P J | Cslib.Probability.frameRetains P 4 Lt (σ role) y}.dens

            Concrete mixed rank / usage pair law from frame conditioning, not unrestricted seed independence. Usage may have any other positive side; only rank's admissible source-grid exponent contributes 32 * rate(k).

            theorem Matrix.HierarchyParams.H4RankEnvironment.mixed_pair_count {P J : ℕ} [Fact (Nat.Prime P)] (role : Fin J) (H : Horizon P) {k : ℕ} (hk : k ≤ H.maxExponent) (Lt : ℕ) (hLt : Lt ≤ P) {D : ZMod P} (hD : D ≠ 0) (suffix : List (ZMod P)) {w y : ZMod P} (hwy : w ≠ y) :
            ↑{σ : Environment P J | Cslib.Probability.frameRetains P 4 Lt (σ role) (CopyPadding.identifier D suffix y) ∧ Cslib.Probability.frameRetains P 4 (side P k) (σ role) (CopyPadding.identifier D suffix w)}.card ≤ 32 * rate k * ↑{σ : Environment P J | Cslib.Probability.frameRetains P 4 Lt (σ role) (CopyPadding.identifier D suffix y)}.card

            The mixed rank/usage density bound as a count bound, with injective copy padding.

            Independent role coordinates remain independent for all mixed rates and suffixes.

            theorem Matrix.HierarchyParams.H4RankEnvironment.copy_retains {P J : ℕ} [Fact (Nat.Prime P)] (D : ℕ) (ch : Channel P J) (σ : Environment P J) (n m l : ℕ) (hD : D = m + 1) (x : Fin (n * (m + 1) ^ l)) (j : Fin (m + 1)) :

            Copy traversal agrees with the actual radix-copy identifier, including inherited padding.

            A fixed independent role product, reused unchanged at every stage.

            • source : Fin J

              Rank coordinate conditioning the source vertex.

            • midpoint : Fin J

              Independent rank coordinate used at product midpoints.

            • terminal : Fin J

              Rank coordinate conditioning the terminal vertex.

            • source_midpoint : self.source ≠ self.midpoint
            • source_terminal : self.source ≠ self.terminal
            • midpoint_terminal : self.midpoint ≠ self.terminal

            Three distinct roles for source, midpoint and terminal.

            Precisely the role / suffix frame condition needed by a normalized row request.

            Instances For

              Actual residual requests preserve distinct roles, including source release to midpoint in the right child and the separate negative endpoint correction.

              theorem Matrix.HierarchyParams.H4RankEnvironment.copy_admissible {P J k : ℕ} (R : RoleProfile J) (l bin ks kt kf kb : ℕ) (ss st : List (ZMod P)) (i j : ZMod P) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (hr : r ∈ HierarchyTask.routedCopyRequests l bin (gridChannel R.source ks ss) (gridChannel R.terminal kt st) (rate kf) (rate kb) i j) :

              Copy source / terminal symbols prepend to the inherited suffix, on the actual weight and residual-normalized constructors.

              noncomputable def Matrix.HierarchyParams.H4RankEnvironment.coordinate {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (ch : Channel P J) (A : Cslib.Probability.FrameChannel P 4 1) (v : ZMod P) :

              Local channel predicate for the existing source / terminal product normalization.

              Instances For
                @[instance_reducible]
                noncomputable instance Matrix.HierarchyParams.H4RankEnvironment.instDecidableCoordinate {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (ch : Channel P J) (A : Cslib.Probability.FrameChannel P 4 1) (v : ZMod P) :
                @[instance_reducible]
                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.normalizedRequest {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (cutoff gate : ℝ → ℝ) (K : ℕ) (raw prep : Environment P J → Matrix V V ℝ) (σ : Environment P J) (x y : V) :

                Actual DenseRowRecipe.normalized, with the terminal coordinate split off. All spectator roles remain in Γ, including future-stage roles. The preparatory child is a whole function on the same global rank environment.

                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.rawNormalized {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (cutoff gate : ℝ → ℝ) (K : ℕ) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) (σ : Environment P J) :

                One real signed raw residual sample, whose four children use the actual normalized recipe, its original raw ranks and clipped preparatory denominator.

                theorem Matrix.HierarchyParams.H4RankEnvironment.rawNormalized_noise {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (cutoff gate : ℝ → ℝ) (K : ℕ) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) {N u : ℝ} (hNu : 0 ≤ N * u) (steps : ℕ) :
                have a := fun (v : V) => CopyPadding.identifier D ss (ident v); have b := fun (v : V) => CopyPadding.identifier D st (ident v); have F := rawNormalized D ident R l bin ks km kt kb ss sm st cutoff gate K raw prep; have G := graph R.source R.terminal ⋯ (side P ks) (side P kt) ⋯ ⋯ a b; (Cslib.rowNormPow 4 N u (X R.source (side P ks) a) (Y R.terminal (side P kt) b) fun (σ : Environment P J) (x z : V) => Cslib.conditionalWalk (X R.source (side P ks) a) (Y R.terminal (side P kt) b) G (fun (x x_1 : V) => steps) F σ x z - Cslib.rowSliceMean (X R.source (side P ks) a) (Y R.terminal (side P kt) b) F x z) ≤ 32 * (1 - 1 / (155648 * (↑J + 1) * 4 ^ 4)) ^ (2 * steps) * Cslib.rowNormPow 4 N u (X R.source (side P ks) a) (Y R.terminal (side P kt) b) F

                Full integrated contraction for the actual normalized-child raw sample. There is one prime, one fixed role product, and torus M=1. No desired noise or conditional-moment hypothesis is supplied by the client.

                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.denseLaws {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (hD : D ≠ 0) (role : Fin J) (suffix : List (ZMod P)) (H : Horizon P) (k : ℕ) (hk : k ≤ H.maxExponent) (Lt La : ℕ) (hLt0 : 0 < Lt) (hLtP : Lt ≤ P) (hLa : Lt ≤ La) (cutoff h gate : ℝ → ℝ) (K : ℕ) (M η : ℝ) (hsupport : ∀ (d : ℝ), cutoff d ≠ 0 → h d = 1) (hg0 : ∀ (r : ℝ), 0 ≤ gate r) (hg1 : ∀ (r : ℝ), gate r ≤ 1) (hη : 0 < η) (hone : ∀ r ≤ η, gate r = 1) (hK : 2 * (1 + 32 * M / η) ≤ ↑K) :
                DenseSamplingLaws (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 (side P k) (σ role) (CopyPadding.identifier D suffix v)) (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 La (σ role) (CopyPadding.identifier D suffix v)) (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 Lt (σ role) (CopyPadding.identifier D suffix v)) cutoff (rate k) M

                The frame counterpart of DenseSamplingLaws.ofAffine, on the actual entire role product and with the correct cross-rate constant 32.

                Explicit rational polynomial cutoff and row gate for an actual dense client. These are fully exposed arithmetic formulas, not opaque functions from a witness.

                Explicit polynomial row gate, full through rank one and closed from rank two.

                The polynomial row gate is nonnegative.

                The polynomial row gate is at most one.

                The polynomial row gate is one below its safe threshold.

                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.explicitDense {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (hD : D ≠ 0) (role : Fin J) (suffix : List (ZMod P)) (H : Horizon P) (k : ℕ) (hk : k ≤ H.maxExponent) (Lt La : ℕ) (hLt0 : 0 < Lt) (hLtP : Lt ≤ P) (hLa : Lt ≤ La) :
                DenseSamplingLaws (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 (side P k) (σ role) (CopyPadding.identifier D suffix v)) (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 La (σ role) (CopyPadding.identifier D suffix v)) (fun (σ : Environment P J) (v : ZMod P) => Cslib.Probability.frameRetains P 4 Lt (σ role) (CopyPadding.identifier D suffix v)) cutoff (rate k) 1

                An explicit, nonvacuous dense client: rank 66, safe threshold 1, raw row mass at most 1. This proves its true normalization through concrete frame laws. It is not the hierarchy incoming / access-margin theorem.

                theorem Matrix.HierarchyParams.H4RankEnvironment.explicitDense_mean {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (hD : D ≠ 0) (role : Fin J) (suffix : List (ZMod P)) (H : Horizon P) (k : ℕ) (hk : k ≤ H.maxExponent) (Lt La : ℕ) (hLt0 : 0 < Lt) (hLtP : Lt ≤ P) (hLa : Lt ≤ La) (G : Matrix (ZMod P) (ZMod P) ℝ) (hG : ∀ (x y : ZMod P), 0 ≤ G x y) (hG1 : ∀ (x : ZMod P), ∑ y : ZMod P, G x y ≤ 1) (x y : ZMod P) :
                have A := explicitDense D hD role suffix H k hk Lt La hLt0 hLtP hLa; ({σ : Environment P J | Cslib.Probability.frameRetains P 4 La (σ role) (CopyPadding.identifier D suffix y)}.expect fun (σ : Environment P J) => A.direct G σ x y) = rate k * cutoff (G x y / rate k)

                Primitive frame laws give a true atom's conditional mean; no mean certificate is a field of the environment model. Arbitrary prime, mixed usage and inherited suffixes are retained in the statement.

                theorem Matrix.HierarchyParams.H4RankEnvironment.rawNormalized_rank_dependency {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} {Input : Type u_2} (ranks : Input → Environment P J) (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) {a b : Input} (hab : ∀ (j : Fin J), ranks a j = ranks b j) :
                rawNormalized D ident R l bin ks km kt kb ss sm st cutoff gate 66 raw prep (ranks a) = rawNormalized D ident R l bin ks km kt kb ss sm st cutoff gate 66 raw prep (ranks b)

                Equal rank environments give identical actual raw / normalized samples, regardless of any external deterministic record. No random salt coordinate is present in either sample or conditional averaging space. This concerns this client; the eventual recursive estimator must prove the analogous factorization.

                theorem Matrix.HierarchyParams.H4RankEnvironment.normalizer_full {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (hr : Admissible r) (prep : Environment P J → Matrix V V ℝ) (x y : V) :
                have split := Equiv.piSplitAt r.terminal.role fun (x : Fin J) => Cslib.Probability.FrameChannel P 4 1; CorrectionRowRecipe.normalizer (fun (rest : { j : Fin J // j ≠ r.terminal.role } → Cslib.Probability.FrameChannel P 4 1) (x : V) => coordinate D r.source (rest ⟨r.source.role, ⋯⟩) (ident x)) (fun (A : Cslib.Probability.FrameChannel P 4 1) (v : V) => coordinate D r.usage A (ident v)) (fun (p : ({ j : Fin J // j ≠ r.terminal.role } → Cslib.Probability.FrameChannel P 4 1) × Cslib.Probability.FrameChannel P 4 1) => prep (split.symm (p.2, p.1))) x y = Cslib.rowSliceMean (fun (σ : Environment P J) (v : V) => r.source.retains (channels D) σ (ident v)) (fun (σ : Environment P J) (v : V) => r.usage.retains (channels D) σ (ident v)) prep x y

                The normalization split is exactly the single full-environment conditional mean, not a product of two independent copies of the full environment.

                theorem Matrix.HierarchyParams.H4RankEnvironment.explicitDense_nonzero {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (hD : D ≠ 0) (role : Fin J) (suffix : List (ZMod P)) (H : Horizon P) (x : ZMod P) :
                have A := explicitDense D hD role suffix H 0 ⋯ P P ⋯ ⋯ ⋯; ({σ : Environment P J | Cslib.Probability.frameRetains P 4 P (σ role) (CopyPadding.identifier D suffix x)}.expect fun (σ : Environment P J) => A.direct 1 σ x x) = 1

                Identity-matrix rows witness a nonzero actual normalized dense sample, for every supplied prime and horizon, rather than an empty conditioning model.

                theorem Matrix.HierarchyParams.H4RankEnvironment.bounded_identifier_injective {P : ℕ} [Fact (Nat.Prime P)] (H : Horizon P) {N : ℕ} (hN : N ≤ H.maxIdentifier + 1) {D : ZMod P} (hD : D ≠ 0) (suffix : List (ZMod P)) :
                Function.Injective fun (x : Fin N) => CopyPadding.identifier D suffix ↑↑x

                For N ≤ H.maxIdentifier + 1, D ≠ 0 and one fixed suffix, padding in ZMod P is injective on the naturals below N: these unpadded naturals are below P, so their casts are distinct, and CopyPadding.identifier_injective applies. That a padded natural stays below P is the separate padNat_lt_prime, under its own bound on the padded range.

                theorem Matrix.HierarchyParams.H4RankEnvironment.pairEquiv_coordinate {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s t : Fin J) (hst : s ≠ t) (Ls Lt : ℕ) (a b : V → ZMod P) (x z : V) (σ : Cslib.RetainedPairSlice (X s Ls a) (Y t Lt b) x z) (j : Fin J) :
                ↑(((pairEquiv s t hst Ls Lt a b x z) σ).1 j) = ↑σ j

                All full-environment coordinates are recovered pointwise, including the unconditioned roles represented as public-id full slices.

                Natural radix padding before any field reduction.

                theorem Matrix.HierarchyParams.H4RankEnvironment.padNat_cast {P : ℕ} [Fact (Nat.Prime P)] (D x : ℕ) (suffix : List ℕ) :
                ↑(padNat D suffix x) = CopyPadding.identifier (↑D) (List.map (fun (j : ZMod P) => j) do let a ← suffix pure ↑a) ↑x

                Natural copy padding commutes with reduction to the supplied field.

                theorem Matrix.HierarchyParams.H4RankEnvironment.padNat_bound {D n x : ℕ} (hx : x < n) (suffix : List ℕ) (hd : ∀ j ∈ suffix, j < D) :
                padNat D suffix x < n * D ^ suffix.length

                A bounded suffix preserves the natural radix domain bound.

                theorem Matrix.HierarchyParams.H4RankEnvironment.padNat_lt_prime {P : ℕ} (H : Horizon P) {D n x : ℕ} (hx : x < n) (suffix : List ℕ) (hd : ∀ j ∈ suffix, j < D) (hb : n * D ^ suffix.length ≤ H.maxIdentifier + 1) :
                padNat D suffix x < P

                Finite-horizon no-wrap condition charges both stage growth and copy suffix length before the prime is supplied. It says nothing about unbounded stages.

                The fourth-power dyadic grid is the hierarchy source grid with q=16.

                theorem Matrix.HierarchyParams.H4RankEnvironment.retention_environment_ident {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_2} (s t : Fin J) (is it : V → ZMod P) (his : Function.Injective is) (hit : Function.Injective it) (H : Horizon P) {k : ℕ} (hk : k ≤ H.maxExponent) :
                Cslib.Probability.RetentionChannels (fun (σ : Environment P J) (v : V) => Cslib.Probability.frameRetains P 4 (side P k) (σ s) (is v)) (fun (σ : Environment P J) (v : V) => Cslib.Probability.frameRetains P 4 (side P k) (σ t) (it v)) (rate k) ((↑(side P k) / ↑P) ^ 4) 1 16 32 8

                The hierarchy detector interface lifted to fixed independent role coordinates. Both padded identifier maps may differ, but must be injective on this stage.

                theorem Matrix.HierarchyParams.H4RankEnvironment.hierarchy_prefix_bound {P J : ℕ} [Fact (Nat.Prime P)] (HP : HierarchyParams 16 1 16 32 8) {V : ℕ → Type u_2} [(i : ℕ) → Fintype (V i)] [(i : ℕ) → LinearOrder (V i)] (e : (i : ℕ) → V (i + 1) ≃ Lex (V i × Fin (HP.m + 1))) (he : ∀ (i : ℕ) (a b : V (i + 1)), (e i) a < (e i) b → a < b) (R : RoleProfile J) (ids idt : (i : ℕ) → V i → ZMod P) (H : Horizon P) (l : ℕ) (hl : l ≤ H.maxExponent + 1) (his : ∀ i < l, Function.Injective (ids i)) (hit : ∀ i < l, Function.Injective (idt i)) (S : Matrix (V 0) (V 0) ℝ) (hS : S.IsStrictUpperTriangular) (hS0 : ∀ (x y : V 0), 0 ≤ S x y) (hS1 : S.mulVec 1 ≤ 1) :
                let X := fun (i : ℕ) (σ : Environment P J) (v : V i) => Cslib.Probability.frameRetains P 4 (side P i) (σ R.source) (ids i v); let Y := fun (i : ℕ) (σ : Environment P J) (v : V i) => Cslib.Probability.frameRetains P 4 (side P i) (σ R.terminal) (idt i v); (hierarchy HP e X Y S l).IsStrictUpperTriangular ∧ (∀ (x y : V l), 0 ≤ hierarchy HP e X Y S l x y) ∧ (hierarchy HP e X Y S l).mulVec 1 ≤ 1 ∧ ∀ (x y : V l), hierarchy HP e X Y S l x y ≤ rate l

                Concrete finite-horizon hierarchy entry bound with the frame constants. It applies the general hierarchy theorem, never the unrestricted-affine corollary. No admissibility is claimed beyond the stages strictly before l.

                theorem Matrix.HierarchyParams.H4RankEnvironment.channel_density {P J : ℕ} [Fact (Nat.Prime P)] (D : ZMod P) (ch : Channel P J) (k : ℕ) (hk : ch.rate = rate k) (v : ZMod P) :
                ↑{σ : Environment P J | CorrectionRowTask.Channel.retains ch (channels D) σ v}.dens = (↑(side P k) / ↑P) ^ 4

                Exact density of any actual channel whose real rate has a natural grid certificate; no density oracle remains in importance weights.

                theorem Matrix.HierarchyParams.H4RankEnvironment.usageRatio_grid {P J : ℕ} [Fact (Nat.Prime P)] {k : ℕ} (D : ZMod P) (endpoint : Channel P J) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (ke ku : ℕ) (he : endpoint.rate = rate ke) (hu : r.usage.rate = rate ku) (y : ZMod P) :
                HierarchyTask.usageRatio (channels D) endpoint r y = (↑(side P ke) / ↑P) ^ 4 / (↑(side P ku) / ↑P) ^ 4

                Actual importance ratios are ratios of the two exact frame densities.

                theorem Matrix.HierarchyParams.H4RankEnvironment.padding_law {P J : ℕ} [Fact (Nat.Prime P)] {D : ZMod P} (hD : D ≠ 0) (suffix : List (ZMod P)) (E : (Fin J → ZMod P → Fin 4 → ZMod P) → Prop) [DecidablePred E] :
                {σ : Environment P J | E fun (c : Fin J) (x : ZMod P) => (σ c).eval (CopyPadding.identifier D suffix x)}.dens = {σ : Environment P J | E fun (c : Fin J) => (σ c).eval}.dens

                Joint padding invariance includes every independent role, at the same P.

                theorem Matrix.HierarchyParams.H4RankEnvironment.hierarchy_radix_prefix {P J : ℕ} [Fact (Nat.Prime P)] (HP : HierarchyParams 16 1 16 32 8) (R : RoleProfile J) (H : Horizon P) (n l : ℕ) (hl : l ≤ H.maxExponent + 1) (ss st : ℕ → List (ZMod P)) (hD : ↑HP.m + 1 ≠ 0) (hcard : ∀ i < l, n * (HP.m + 1) ^ i ≤ H.maxIdentifier + 1) (S : Matrix (Fin (n * (HP.m + 1) ^ 0)) (Fin (n * (HP.m + 1) ^ 0)) ℝ) (hS : S.IsStrictUpperTriangular) (hS0 : ∀ (x y : Fin (n * (HP.m + 1) ^ 0)), 0 ≤ S x y) (hS1 : S.mulVec 1 ≤ 1) :
                let V := fun (i : ℕ) => Fin (n * (HP.m + 1) ^ i); have ids := fun (i : ℕ) (v : V i) => CopyPadding.identifier (↑HP.m + 1) (ss i) ↑↑v; have idt := fun (i : ℕ) (v : V i) => CopyPadding.identifier (↑HP.m + 1) (st i) ↑↑v; let X := fun (i : ℕ) (σ : Environment P J) (v : V i) => Cslib.Probability.frameRetains P 4 (side P i) (σ R.source) (ids i v); let Y := fun (i : ℕ) (σ : Environment P J) (v : V i) => Cslib.Probability.frameRetains P 4 (side P i) (σ R.terminal) (idt i v); have C := hierarchy HP (radixCopyEquiv n HP.m) X Y S l; C.IsStrictUpperTriangular ∧ (∀ (x y : V l), 0 ≤ C x y) ∧ C.mulVec 1 ≤ 1 ∧ ∀ (x y : V l), C x y ≤ rate l

                A fully concrete radix hierarchy prefix under one global supplied prime. Stage cardinalities and queried exponent horizon are explicit finite premises.

                theorem Matrix.HierarchyParams.H4RankEnvironment.free_role {P J : ℕ} [Fact (Nat.Prime P)] (s t j : Fin J) (hjs : j ≠ s) (hjt : j ≠ t) (Ls Lt : ℕ) (a b : ZMod P) :
                pairSide s t Ls Lt j = P ∧ pairId s t a b j = 0

                The public-id full slice for a spectator role is an equality, not a nonempty witness hiding a frozen coordinate.

                theorem Matrix.HierarchyParams.H4RankEnvironment.graph_walk {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} (s t : Fin J) (hst : s ≠ t) (Ls Lt : ℕ) [NeZero Ls] [NeZero Lt] (hs : Ls ≤ P) (ht : Lt ≤ P) (a b : V → ZMod P) (x z : V) (f : Cslib.RetainedPairSlice (X s Ls a) (Y t Lt b) x z → ℝ) (σ : Cslib.RetainedPairSlice (X s Ls a) (Y t Lt b) x z) :
                (graph s t hst Ls Lt hs ht a b x z).walk f σ = (Cslib.RotationMap.ofPerms (Cslib.Probability.componentMove 4 1 (fun (x : Fin J) => P) (pairSide s t Ls Lt))).lazy.walk (fun (c : ((j : Fin J) → Cslib.Probability.Frame P 4 1 × (Fin 4 → ZMod (pairSide s t Ls Lt j))) × (Fin 4 → ZMod 1)) => f ((pairEquiv s t hst Ls Lt a b x z).symm ((Cslib.Probability.componentEquiv 1 ⋯ (pairId s t (a x) (b z))).symm c))) ((Cslib.Probability.componentEquiv 1 ⋯ (pairId s t (a x) (b z))) ((pairEquiv s t hst Ls Lt a b x z) σ))

                Explicit one-step operator identity for the graph actually used by noise: transport an ordinary lazy component move, then recover every rank role.

                theorem Matrix.HierarchyParams.H4RankEnvironment.normalizedRequest_formula {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (hr : Admissible r) (cutoff gate : ℝ → ℝ) (K : ℕ) (raw prep : Environment P J → Matrix V V ℝ) (σ : Environment P J) (x y : V) :
                normalizedRequest D ident r cutoff gate K raw prep σ x y = if r.usage.retains (channels D) σ (ident y) then cutoff (raw σ x y / r.terminal.rate) * rowGate gate K r.terminal.rate (raw σ) {v : V | r.terminal.retains (channels D) σ (ident v)} x / max (1 / 2) (min 1 (Cslib.rowSliceMean (fun (τ : Environment P J) (v : V) => r.source.retains (channels D) τ (ident v)) (fun (τ : Environment P J) (v : V) => r.usage.retains (channels D) τ (ident v)) prep x y)) else 0

                Normalized-main formula on this client's actual single environment. Raw ranks are evaluated before clipping; the denominator is the actual preparatory conditional mean clipped to [1 / 2, 1].

                The source grid has exactly the requested adjacent-bin ratio.

                theorem Matrix.HierarchyParams.H4RankEnvironment.raw_grid_bounded {P J k : ℕ} (R : RoleProfile J) (l bin K ks km kt kb : ℕ) (hs : ks ≤ K) (hm : km ≤ K) (ht : kt ≤ K) (hb : kb ≤ K) (ss sm st : List (ZMod P)) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (hr : r ∈ (HierarchyTask.rawRequests l bin HierarchyTask.RawTask.residual (gridChannel R.source ks ss) (gridChannel R.midpoint km sm) (gridChannel R.terminal kt st) (rate kb)).calls) :
                ∃ (es : ℕ) (et : ℕ) (eu : ℕ), es ≤ K ∧ et ≤ K ∧ eu ≤ K ∧ r.source.rate = rate es ∧ r.terminal.rate = rate et ∧ r.usage.rate = rate eu

                Every actual residual request stays on the natural-exponent grid (the usage min is a max of exponents, and no other role is allocated), and raw call construction preserves a supplied finite exponent horizon. This is local call closure, not closure of every estimator guard / enumeration query.

                A finite horizon is satisfiable for every supplied prime. Larger horizons retain their explicit side and identifier premises rather than a global claim.

                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.correctionRequest {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (D : ZMod P) (ident : V → ZMod P) (r : HierarchyTask.Request k (Fin J) (ZMod P)) (I : ℝ → ℝ → ℝ) (τ ρ Q γ : ℝ → ℝ) (K Kc : ℕ) (raw prep : Environment P J → Matrix V V ℝ) (maximum : Environment P J → V → ℝ) (σ : Environment P J) (x y : V) :

                Actual incoming-gated main correction normalization on the entire rank environment, with raw row / incoming ranks and the inherited source / usage mean. This evaluates the recipe; it does not assert its later incoming-margin laws.

                noncomputable def Matrix.HierarchyParams.H4RankEnvironment.rawIncomingNormalized {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (I : ℝ → ℝ → ℝ) (τ : ℝ → ℝ) (Kc : ℕ) (binCutoff : ℝ → ℝ) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) (maximum : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → V → ℝ) (σ : Environment P J) :

                Actual residual calls use dense base bins, incoming-gated main correction children, and a literal zero at correction iteration zero. No callback supplies the environment model, slice representation, walk identity or noise bound.

                theorem Matrix.HierarchyParams.H4RankEnvironment.rawIncomingNormalized_noise {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (I : ℝ → ℝ → ℝ) (τ : ℝ → ℝ) (Kc : ℕ) (binCutoff : ℝ → ℝ) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) (maximum : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → V → ℝ) {N u : ℝ} (hNu : 0 ≤ N * u) (steps : ℕ) :
                have a := fun (v : V) => CopyPadding.identifier D ss (ident v); have b := fun (v : V) => CopyPadding.identifier D st (ident v); have F := rawIncomingNormalized HP D ident R l bin ks km kt kb ss sm st I τ Kc binCutoff raw prep maximum; have G := graph R.source R.terminal ⋯ (side P ks) (side P kt) ⋯ ⋯ a b; (Cslib.rowNormPow 4 N u (X R.source (side P ks) a) (Y R.terminal (side P kt) b) fun (σ : Environment P J) (x z : V) => Cslib.conditionalWalk (X R.source (side P ks) a) (Y R.terminal (side P kt) b) G (fun (x x_1 : V) => steps) F σ x z - Cslib.rowSliceMean (X R.source (side P ks) a) (Y R.terminal (side P kt) b) F x z) ≤ 32 * (1 - 1 / (155648 * (↑J + 1) * 4 ^ 4)) ^ (2 * steps) * Cslib.rowNormPow 4 N u (X R.source (side P ks) a) (Y R.terminal (side P kt) b) F

                Integrated contraction for actual raw residual requests with incoming-gated normalized main children, including source-released product-right and negative correction. Every earlier raw / preparatory / pilot child may depend on all rank roles. The bound retains the raw input fourth moment, not an assumed output certificate.

                theorem Matrix.HierarchyParams.H4RankEnvironment.rawIncomingNormalized_rank_dependency {P J : ℕ} [Fact (Nat.Prime P)] {V : Type u_1} [Fintype V] {k : ℕ} {Input : Type u_2} (ranks : Input → Environment P J) (HP : FourthRootHierarchyParams 16 1 16 32 8) (D : ZMod P) (ident : V → ZMod P) (R : RoleProfile J) (l bin ks km kt kb : ℕ) (ss sm st : List (ZMod P)) (I : ℝ → ℝ → ℝ) (τ : ℝ → ℝ) (Kc : ℕ) (binCutoff : ℝ → ℝ) (raw prep : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → Matrix V V ℝ) (maximum : HierarchyTask.Request k (Fin J) (ZMod P) → Environment P J → V → ℝ) {a b : Input} (hab : ∀ (j : Fin J), ranks a j = ranks b j) :
                rawIncomingNormalized HP D ident R l bin ks km kt kb ss sm st I τ Kc binCutoff raw prep maximum (ranks a) = rawIncomingNormalized HP D ident R l bin ks km kt kb ss sm st I τ Kc binCutoff raw prep maximum (ranks b)

                Exact-route dependence for the incoming-gated client itself.