Documentation

ReflectiveSubsystems.DecoupledSimulation

The structural category of decoupled simulations ([Decoupling] §4.5) #

Provenance: [Decoupling] §4.5 — the domain of the functor Conjecture 4.4 asks for: decoupled learners, with capacity-respecting simulations as morphisms. This file defines those morphisms and proves they form a category.

Scope: STRUCTURAL, with the graded enrichment in a sibling module #

A capacity-respecting simulation is a triple: a hosting square, a code-locality condition, and a resource grade on the reading family. The first two are here; the third is the graded enrichment GradedSimulates in ReflectiveSubsystems/GradedSimulation.lean, where CodedReading carries each frame's coded reading pair at a uniform budget b and inducedMap transports a graded morphism along one frame. The price is (g, b), not (g, b, τ): a guest realizer of grade g, read by a pair of index length at most b, is priced by 4 · max g b + 9 in the host. The dilation τ prices time — it multiplies along a tower of hosting squares — and does not enter the per-application realizer grade, exactly as the transport law of ReflectiveSubsystems/GradeTransport.lean finds. What this file establishes is that the underlying structure is a category: morphisms compose, identities exist, and the two conditions are closed under both.

The two conditions, and why only one of them is primitive #

A decoupled subsystem splits its state as C × W — a code region and a work region — and its step map leaves the code region fixed. That read-only property is not an extra axiom here; it is the defining property of decoupling ([Decoupling] §3, Lemma 3.1), recorded as ReadOnly.

A simulation of U by U' is then:

The design question this settles is which conditions are primitive. One might expect to require that the code region be carried across the square, and separately that the induced code translation be time-independent. Neither is a hypothesis: both are theorems.

So code-locality is the one genuine condition, and it is trivially closed under composition (the code translations simply chain).

Non-discreteness #

counter_simulates exhibits a nontrivial morphism: the mod-k·n counter hosts the mod-n counter, read by reduction mod n, at dilation 1. So the category is not discrete, and the definition is not vacuously satisfied only by identities.

Decoupled step maps #

def ReflectiveSubsystems.ReadOnly {C : Type u_1} {W : Type u_2} (U : C × W → C × W) :

The decoupling property ([Decoupling] §3, Lemma 3.1): on a state space split as C × W into a code region and a work region, the step map leaves the code region fixed. This is the defining property of a decoupled subsystem, not an extra assumption imposed here.

Equations
Instances For
    theorem ReflectiveSubsystems.ReadOnly.iterate {C : Type u_1} {W : Type u_2} {U : C × W → C × W} (h : ReadOnly U) (n : ℕ) (s : C × W) :
    (U^[n] s).1 = s.1

    Read-only survives iteration: no number of steps touches the code region.

    The morphisms #

    structure ReflectiveSubsystems.Simulates {C : Type u_1} {W : Type u_2} {C' : Type u_3} {W' : Type u_4} (U' : C' × W' → C' × W') (U : C × W → C × W) (ℓ : ℕ → C' × W' → C × W) (τ : ℕ) :

    A simulation of U by U' at dilation τ — a morphism of the domain category [Decoupling] §4.5 asks for, minus its resource grade (see the module docstring).

    square is the hosting square: τ steps of the host, read one frame later, are one step of the guest. codeLocal says the reading's guest code is determined by the host's code region alone — stated as a relation between host states agreeing on their code, which avoids constructing (or choosing) a translation map.

    • square : Intertwines U'^[τ] U ℓ

      the hosting square at dilation τ

    • codeLocal (t : ℕ) (x' y' : C' × W') : x'.1 = y'.1 → (ℓ t x').1 = (ℓ t y').1

      the reading's guest code depends on the host state only through the host's code region

    Instances For

      The two automaticity facts #

      theorem ReflectiveSubsystems.code_carrying {C : Type u_1} {W : Type u_2} {C' : Type u_3} {W' : Type u_4} {U' : C' × W' → C' × W'} {U : C × W → C × W} {ℓ : ℕ → C' × W' → C × W} {τ : ℕ} (hU : ReadOnly U) (h : Simulates U' U ℓ τ) (t : ℕ) (x' : C' × W') :
      (ℓ (t + 1) (U'^[τ] x')).1 = (ℓ t x').1

      The code region is carried automatically. A block of τ host steps does not change the guest code the reading returns. Nothing is assumed about the reading beyond the square: the guest's own read-only property collapses the square's code component, so "the square carries the code region" is a consequence of decoupling rather than a condition on the morphism.

      theorem ReflectiveSubsystems.code_time_indep {C : Type u_1} {W : Type u_2} {C' : Type u_3} {W' : Type u_4} {U' : C' × W' → C' × W'} {U : C × W → C × W} {ℓ : ℕ → C' × W' → C × W} {τ : ℕ} (hU : ReadOnly U) (hU' : ReadOnly U') (h : Simulates U' U ℓ τ) (t : ℕ) (x' : C' × W') :
      (ℓ (t + 1) x').1 = (ℓ t x').1

      The induced code translation is time-independent automatically. The reading returns the same guest code through every frame. The host's read-only property fixes the host code across a block of τ steps, code-locality transports the previous lemma's equation from (U'^[τ]) x' back to x', and the two together leave no room for a frame dependence.

      No inhabitedness of the work region and no choice enter: the argument is entirely a chain of equations at the single state x'.

      The category structure #

      theorem ReflectiveSubsystems.Simulates.id {C : Type u_1} {W : Type u_2} (U : C × W → C × W) :
      Simulates U U (fun (x : ℕ) => _root_.id) 1

      Identity. Every decoupled step map simulates itself, read by the identity at dilation 1.

      theorem ReflectiveSubsystems.Simulates.comp {C : Type u_1} {W : Type u_2} {C' : Type u_3} {W' : Type u_4} {C'' : Type u_5} {W'' : Type u_6} {U : C × W → C × W} {U' : C' × W' → C' × W'} {U'' : C'' × W'' → C'' × W''} {ℓ₁ : ℕ → C' × W' → C × W} {ℓ₂ : ℕ → C'' × W'' → C' × W'} {τ₁ τ₂ : ℕ} (h₁ : Simulates U' U ℓ₁ τ₁) (h₂ : Simulates U'' U' ℓ₂ τ₂) :
      Simulates U'' U (fun (k : ℕ) => ℓ₁ k ∘ ℓ₂ (τ₁ * k)) (τ₂ * τ₁)

      Composition — the capstone. Simulations compose and dilations multiply: if U' simulates U at dilation τ₁ and U'' simulates U' at dilation τ₂, then U'' simulates U at dilation τ₂ * τ₁, read through the composite family k ↦ ℓ₁ k ∘ ℓ₂ (τ₁ * k) — the outer reading is taken at the inner clock rate, since the guest's clock ticks once per τ₁ ticks of the middle system's.

      The square half is the tower's composition law ([Persistence] §10.2); the code-locality half chains the two localities and needs nothing else, which is what makes the condition a categorical one rather than a constraint that has to be re-established at each level.

      A nontrivial morphism: the counter tower #

      The cyclic counter of modulus m as a decoupled step map: an empty code region and a work register that advances by one.

      Equations
      Instances For

        The counter's code region is read-only — vacuously, its code region being a point.

        def ReflectiveSubsystems.modLens (n : ℕ) [NeZero n] (m a✝ : ℕ) :
        Unit × Fin m → Unit × Fin n

        The reading that reduces the work register mod n, the same at every frame.

        Equations
        Instances For

          The category is not discrete. The mod-k·n counter hosts the mod-n counter, read by reduction mod n, at dilation 1: the square commutes because n ∣ k·n, so reducing the host's wrap-around mod n is the guest's own wrap-around. Code-locality is immediate — the reading's guest code is the point.