Transport at grade: conjugating a graded realizer between re-encodings ([Decoupling] §4.5) #
Conjecture 4.4's load-bearing step asks a capacity-respecting simulation to transport a realizer
without overflowing the budget. ReflectiveSubsystems/GradeTransport.lean priced the conjugation
on a single injective encoding (an Assembly); this module runs the same transport one level up, on
the
many-realizers assemblies (Asm) over which the graded exponential [A ⇒ B]_g is built, and
reads the price off as a grade.
What is transported #
reencodeAsm A c re-encodes an assembly: an element keeps its identity, but a realizer index m of
it is carried to val c m, the value the code c computes on m. This is the direct-image
realizability relation (∃ m, A.realizes m a ∧ n = val c m); unlike the Assembly-level
reencode, it asks for no injectivity of the new naming, because a
many-realizers assembly already tolerates many names per element.
transportIdx c_emb c_proj r transports a realizer index: decode r to a code, conjugate it with
the coded retraction pair (c_emb, c_proj) (transportRealizer), re-encode the result. Its
tracking law (tracks_transportIdx) and its grade law (grade_transportIdx_le) are the two halves;
gradedTransport packages them, carrying an element of [A ⇒ B]_g to an element of
[reencodeAsm A c_embA ⇒ reencodeAsm B c_emb]_{4·max g b + 9}.
The pullback direction (pullbackAsm, tracks_pullback, gradedPullback) is the mirror: a new
index realizes an element when reading it back lands on an old realizer, and the same conjugation
transports the tracker with the reading in the source slot. It reuses the identical index arithmetic
(grade_transportIdx_le), so the grade law is unchanged — only the retraction's side flips, from
input to output.
The retraction, and its asymmetry #
tracks_transportIdx inherits the asymmetry of the Assembly-level
realizes_transport (cross-referenced for orientation, not consumed here — the two
live over different assembly notions). The input side needs a genuine retraction (hretr: c_proj
undoes c_embA on the realizer indices actually in use), because the conjugate must recover the old
index before the realizer can run on it; the output side needs only a coded map c_emb, applied to
the result with nothing to undo. The realizer r itself needs neither a fragment hypothesis nor
totality — its behaviour enters only as the membership k ∈ ap r m. The retraction is conditioned
over the indices in use, as every realizer hypothesis in this development is, never over all of ℕ.
The price #
grade_transportIdx_le is the §4.5 transport clause at grade: the index length of the conjugate is
at most 4 · max g b + 9, where g bounds the realizer's grade and b the re-encoders'. It is the
one-hop max-affine law of bitlen_transport_le read through the Code ≃ ℕ numbering
(grade_encode, bitlen_ofNat). The semantic conjunct needs no separate statement: it is exactly
gradedExp's tracking clause, holding on the transported element by tracks_transportIdx.
Deliberately absent #
One partial combinatory algebra (Kleene's first, on Nat.Partrec.Code), one hop. Nothing here
iterates the transport or claims a functor: the leading factor of the max-affine law compounds once
per hop (the ×4 is 2², for the two nested comp nodes), so an iterated transport grows the
index budget geometrically — the one-hop law is a theorem while the full functor of Conjecture 4.4
stays open. The packaging map gradedTransport is a function on carriers; it is not itself
claimed trackable — conjugation-as-code, the functor's action on realizers, is the boundary this
module stops at. No tightness is claimed for the constant 4 · max g b + 9, and no host-side
assembly map is built (the assembly induced by a hosting square is a separate construction).
Re-encoding a many-realizers assembly, and transporting an index #
Re-encoding an Asm along a code. The carrier is unchanged; a realizer index m of an
element is carried to val c m. The relation is the direct image of A's under val c, so it
needs no injectivity — a many-realizers assembly already names each element by many codes.
Equations
Instances For
Transporting a realizer index. Decode the index r to a code, conjugate it with the coded
retraction pair (c_emb, c_proj) (transportRealizer), and re-encode the conjugate. This is
the action transportIdx a capacity-respecting simulation has on realizer indices.
Equations
- ReflectiveSubsystems.transportIdx c_emb c_proj r = Encodable.encode (ReflectiveSubsystems.transportRealizer c_emb c_proj (Denumerable.ofNat Nat.Partrec.Code r))
Instances For
The tracking law transports #
The tracking condition transports along a re-encoding. If r tracks f : A ⟶ B and
(c_embA, c_proj) is a retraction pair on the indices A actually uses (hretr), then the
transported index transportIdx c_emb c_proj r tracks the same function f between the
re-encodings reencodeAsm A c_embA and reencodeAsm B c_emb.
The realizer r enters only through the membership k ∈ ap r m, so it needs neither an
rfind-free fragment nor totality; the two re-encoding codes c_proj/c_emb are run, so they are
RfindFree. The
input side undoes c_embA with c_proj; the output side only applies c_emb.
The grade law, and the packaged transport #
The transported index stays within the max-affine budget ([Decoupling] §4.5). If the two
re-encoders have index length at most b and the realizer has grade at most g, the transported
index has grade at most 4 · max g b + 9. This is bitlen_transport_le read through
the Code ≃ ℕ numbering (grade_encode, bitlen_ofNat): the counting-bound realizer length and
the exponential's grade are one quantity.
The transport clause of Conjecture 4.4, at grade. A capacity-respecting re-encoding takes a
morphism affordable at grade g — an element of the graded exponential [A ⇒ B]_g — to a morphism
of the re-encoded assemblies affordable at grade 4 · max g b + 9, where b bounds the two
re-encoders' index lengths. The underlying function is unchanged (gradedTransport_fn); the new
realizer is the conjugated index, whose grade the max-affine one-hop law bounds
(grade_transportIdx_le) and whose tracking tracks_transportIdx supplies. The budget of a
capacity-respecting transport does not overflow — it grows by one max-affine hop.
Instances For
The transport leaves the underlying function untouched. gradedTransport re-encodes
realizers, not elements; the morphism it produces computes the same map on carriers as its input.
The pullback direction: re-encoding by reading, and its inverted asymmetry #
Pulling an Asm back along a reading. The carrier is unchanged; a new index n realizes an
element exactly when reading it back with c_read lands on an old realizer — A.realizes (val c_read n) a. Where reencodeAsm pushes realizers forward through a code, this pulls them
back: the reading c_read is applied to the candidate index. The section c_sect (with the
retraction hsect) supplies a witness index, so the object stays inhabited by realizers.
Equations
- ReflectiveSubsystems.pullbackAsm A c_read c_sect hsect = { carrier := A.carrier, realizes := fun (n : ℕ) (a : A.carrier) => A.realizes (TimeCost.val c_read n) a, realized := ⋯ }
Instances For
Tracking transports along a pullback — the mirror of tracks_transportIdx. The transported
index is the same conjugation, but with the reading in the source slot: transportIdx c_sect c_read runs c_read first, then the realizer, then c_sect.
The asymmetry inverts. In the pushforward the retraction sat on the input — the conjugate had to
recover the old index before running. Here the input is free: the pullback hands the guest index to
c_read directly, and the realizer runs on val c_read n. The genuine retraction is on the
output (hsB, over B's realizers in use): the result is re-encoded by c_sect and c_read
must read it back. hsA does no tracking work at all — it only builds the domain object. This is a
sibling proof, not an instance of tracks_transportIdx.
The pullback clause of Conjecture 4.4, at grade. The host-side counterpart of
gradedTransport: a morphism affordable at grade g between guest assemblies is carried to a
morphism affordable at grade 4 · max g b + 9 between their pullbacks along a reading pair of index
length at most b. The grade law is grade_transportIdx_le at (c_sect, c_read) — the same
max-affine index arithmetic; only the conjugation's argument order differs.
Instances For
The pullback leaves the underlying function untouched, exactly as the pushforward does.