Documentation

ReflectiveSubsystems.GradedSimulation

Grading a decoupled simulation: the hosting-induced assembly map ([Decoupling] §4.5) #

ReflectiveSubsystems/DecoupledSimulation.lean builds the structural category of decoupled simulations — a hosting square plus code-locality — and leaves the resource grade to a sibling. This module is that sibling: it adds the coded reading data a simulation needs in order to move graded morphisms, and derives the map a capacity-respecting simulation induces on graded exponentials, per frame.

The coded reading #

CodedReading encH encG ℓ b equips a reading ℓ : H → G with a coded retraction pair (c_read, c_sect) of index length at most a uniform budget b: c_read reads a host index to the guest index it names (bridge), and c_sect sections it back (retr). bridge is what makes the pair a coded reading of ℓ; its consumers are the future cross-frame statements — the per-frame boundary is named here. (Remark, not a target: for a surjective reading on finite carriers a set-level section exists and finiteness realizes both codes, the Realizability.realizes_of_finite mechanism.)

The graded simulation and its induced map #

GradedSimulates is the structural Simulates together with one CodedReading per frame, all sharing a single budget b (uniform across frames). It carries data — the codes — so it is a structure, not a proposition. For a frame t and a pair of GuestCoded assemblies (assemblies whose realizers are encG-images, so the reading's retraction discharges the pullback's hypothesis), inducedMap transports a graded morphism [A ⇒ B]_g to [A' ⇒ B']_{4·max g b + 9}, where A', B' are the guest assemblies pulled back along the frame's reading (gradedPullback). The map does not touch the underlying function (inducedMap_fn).

The price is (g, b), not (g, b, τ) #

The dilation τ prices time — it multiplies along a tower of hosting squares ([Persistence] §10.2) — and does not enter the per-application realizer grade, exactly as the transport law of ReflectiveSubsystems/GradeTransport.lean finds. So the induced map's grade is 4 · max g b + 9: the guest grade g and the reading budget b, with no τ.

Non-vacuity #

GradedSimulates.id enriches Simulates.id — the identity reading coded by Code.id (val Code.id = id), at budget bitlen Code.id. The example below inhabits inducedMap at that hosting, so the construction is not vacuous.

Boundaries #

Per-frame only: the induced map is stated at a single frame t. Cross-frame persistence of the pulled-back structure — that the frames cohere along the tower — is [Persistence] §10.2 territory, named here, not claimed. No functoriality: composing simulations compounds the ×4 factor, so no composite grade law is asserted. Neither pullbackAsm nor inducedMap is claimed trackable — the map is a function on carriers, not a morphism of any category. No tightness is claimed for the constant 4 · max g b + 9.

The identity code's value map #

Code.id = pair left right is in the rfind'-free fragment.

The value map of Code.id is the identity: reading an index by Code.id returns it unchanged. Obtained from Code.eval_id through value-agreement (eval_eq_val) on the rfind'-free fragment.

The coded reading #

structure ReflectiveSubsystems.CodedReading {H : Type u_1} {G : Type u_2} (encH : H → ℕ) (encG : G → ℕ) (ℓ : H → G) (b : ℕ) :

A coded reading of ℓ at budget b. A retraction pair of codes (c_read, c_sect), both in the rfind'-free fragment and both of index length at most b: c_read reads a host index encH x to the guest index encG (ℓ x) it names (bridge), and c_sect sections a guest index back so that c_read recovers it (retr). This is the per-frame datum a capacity-respecting simulation supplies beyond its structural square.

Instances For

    A GuestCoded assembly names its elements only by encG-images: every realizer in use is encG x for some guest state x. This is exactly the condition under which a reading's guest-side retraction (CodedReading.retr, stated over encG-images) discharges the pullback's hypothesis.

    Equations
    Instances For
      theorem ReflectiveSubsystems.guest_retr {G : Type u_1} {encG : G → ℕ} {A : RealizabilityCCC.Asm} (hA : GuestCoded encG A) {c_read c_sect : Nat.Partrec.Code} (retr : ∀ (xG : G), TimeCost.val c_read (TimeCost.val c_sect (encG xG)) = encG xG) (a : A.carrier) (m : ℕ) :
      A.realizes m a → TimeCost.val c_read (TimeCost.val c_sect m) = m

      On a GuestCoded assembly, the reading's guest-side retraction holds at every realizer in use: each is an encG-image, where retr applies. This is what feeds pullbackAsm's hypothesis.

      The graded simulation and its induced assembly map #

      structure ReflectiveSubsystems.GradedSimulates {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) (τ : ℕ) (encH : C' × W' → ℕ) (encG : C × W → ℕ) (b : ℕ) :

      A graded decoupled simulation. The structural Simulates (ReflectiveSubsystems/DecoupledSimulation.lean) together with one coded reading per frame, all at a single uniform budget b. It carries the reading codes as data, so it is a structure rather than a proposition.

      • sim : Simulates U' U ℓ τ

        the underlying structural simulation.

      • readings (t : ℕ) : CodedReading encH encG (ℓ t) b

        a coded reading of every frame's reading map, at the uniform budget b.

      Instances For
        noncomputable def ReflectiveSubsystems.GradedSimulates.inducedMap {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} {τ : ℕ} {encH : C' × W' → ℕ} {encG : C × W → ℕ} {b : ℕ} (S : GradedSimulates U' U ℓ τ encH encG b) (t : ℕ) {A B : RealizabilityCCC.Asm} {g : ℕ} (hA : GuestCoded encG A) (hB : GuestCoded encG B) (f : (gradedExp g A B).carrier) :
        (gradedExp (4 * max g b + 9) (pullbackAsm A (S.readings t).c_read (S.readings t).c_sect ⋯) (pullbackAsm B (S.readings t).c_read (S.readings t).c_sect ⋯)).carrier

        The assembly map a graded simulation induces, per frame ([Decoupling] §4.5). At frame t, a graded morphism [A ⇒ B]_g between GuestCoded guest assemblies is carried to a morphism [A' ⇒ B']_{4·max g b + 9}, where A', B' are A, B pulled back along the frame's coded reading. It is gradedPullback along readings t; the guest-coded hypotheses on A, B discharge the pullback's retraction obligations (guest_retr). The realizer overflow of a capacity-respecting simulation's transport is bounded by the same one-hop max-affine law — the price is (g, b), not (g, b, τ).

        Equations
        Instances For
          theorem ReflectiveSubsystems.GradedSimulates.inducedMap_fn {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} {τ : ℕ} {encH : C' × W' → ℕ} {encG : C × W → ℕ} {b : ℕ} (S : GradedSimulates U' U ℓ τ encH encG b) (t : ℕ) {A B : RealizabilityCCC.Asm} {g : ℕ} (hA : GuestCoded encG A) (hB : GuestCoded encG B) (f : (gradedExp g A B).carrier) :
          fn (S.inducedMap t hA hB f) = fn f

          The induced map leaves the underlying function untouched. It re-encodes realizers along the frame's reading, not elements, so it computes the same map on carriers as its input.

          Non-vacuity: the identity hosting, graded #

          The identity reading, coded by Code.id (val Code.id = id), at any encoding. This is the reading that enriches Simulates.id.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def ReflectiveSubsystems.GradedSimulates.id {C : Type u_1} {W : Type u_2} (U : C × W → C × W) (encG : C × W → ℕ) :
            GradedSimulates U U (fun (x : ℕ) => _root_.id) 1 encG encG (bitlen Nat.Partrec.Code.id)

            The identity hosting is graded. Every decoupled map simulates itself by the identity reading (Simulates.id); coding that reading by Code.id at budget bitlen Code.id enriches it to a GradedSimulates.

            Equations
            Instances For
              theorem ReflectiveSubsystems.inducedMap_id_fn {C : Type u_1} {W : Type u_2} (U : C × W → C × W) (encG : C × W → ℕ) {A B : RealizabilityCCC.Asm} {g : ℕ} (hA : GuestCoded encG A) (hB : GuestCoded encG B) (f : (gradedExp g A B).carrier) :
              fn ((GradedSimulates.id U encG).inducedMap 0 hA hB f) = fn f

              Non-vacuity probe. At the identity hosting the induced map is inhabited and preserves the underlying function: a guest-coded pair and any graded morphism yield an element of the pulled-back graded exponential computing the same map. Stating this forces inducedMap to elaborate at the identity, so the construction is not vacuous.