Relational continuations with identity and budgeted composition
DefinitionAPFReachKernel_ContinuationModelapfconditional-referencereachkernel
A supplied model specifies raw configurations, responses, admission profiles, reached outcomes, a capacity, calibrated loads and response concatenation. Its laws require quotient-respecting reach, an identity response, admissible composition within budget and prefix closure. The interface also defines reachable quotient outcomes. Admission of a particular response does not itself guarantee an outcome; later regulation results explicitly retain the needed selected-outcome premise.
Definition code
import Definitions.Def_APFReachKernel_Foundation
namespace ReachKernel
end ReachKernel
namespace ReachKernel.ContinuationModel
end ReachKernel.ContinuationModel
/-
ReachKernel/ContinuationModel.lean
A supplied relational continuation model: quotient-respecting reach,
identity, budget-conditional composition and prefix closure. The formulation
is motivated by Paper1 supplement v9.26 C1-C3 and its reach discussion.
Cont remains opaque: admission of a particular policy response does not
supply an outcome. Identity gives an outcome for some response only.
The calibrated load is model data; an identification with the original
physical whole account requires a separate source correspondence.
-/
set_option autoImplicit false
namespace ReachKernel
/--
`ContinuationModel Cont calib C`
* `X` raw possibility substrate (P1 def "Raw possibility substrate")
* `Q` finite admissible continuations; `Cont x` those available from `x`
* `R` resource loads, `calib : R → K` the calibration, `C : K` the capacity.
Fields, each with its source line:
* `Reaches x c y` — "the profile reached by c" (C2). Relation.
* `load c` — the continuation's own capacity load. (C2)'s "combined
capacity load" is `load (concat c' c)`, NOT `load c + load c'`:
the source's κ_int story is precisely that joint loads need
not be sums, so additivity is not assumed here (Audit 6, F-38).
* `concat c' c` — "the concatenation c′ ∗ c" (C2). Total as a function,
partial in meaning: its value off the C2 domain is
never constrained by any law here.
* `reaches_descends` — words act on possibilities `[x]`, so reach from `x`
is reach from every raw representative of `[x]`
(3183). This is B01 applied to the new relation.
* `identity` — (C1) "do nothing, preserve the profile".
* `concat_mem` — (C2) verbatim.
* `concat_reaches`— partial-process-category lemma (3174–3180): if
K : x ⇝ y and L : y ⇝ z and the combined cost is
within budget, then L∘K : x ⇝ z.
* `prefix_mem` — (C3) for the initial segment `c` of `c′ ∗ c`.
NOT present, by design: totality of Reaches, uniqueness of the reached
profile, any law on `load (concat c' c)`, any transition floor, any operation
set, any reader/decoder/score/probability/clock/metric.
-/
structure ContinuationModel {X Q R K : Type} [LE K]
(Cont : X → Set Q) (calib : R → K) (C : K) where
Reaches : X → Q → PhysicalState Cont → Prop
load : Q → R
concat : Q → Q → Q
reaches_descends :
∀ x x' c y, physicalClass Cont x = physicalClass Cont x' →
Reaches x c y → Reaches x' c y
identity :
∀ x, ∃ e, e ∈ Cont x ∧ Reaches x e (physicalClass Cont x)
concat_mem :
∀ x c c' y, c ∈ Cont x → Reaches x c y → availableAt Cont c' y →
calib (load (concat c' c)) ≤ C → concat c' c ∈ Cont x
concat_reaches :
∀ x c c' y z, c ∈ Cont x → Reaches x c y → availableAt Cont c' y →
calib (load (concat c' c)) ≤ C →
(∀ x', physicalClass Cont x' = y → Reaches x' c' z) →
Reaches x (concat c' c) z
prefix_mem :
∀ x c c', concat c' c ∈ Cont x → c ∈ Cont x
namespace ContinuationModel
variable {X Q R K : Type} [LE K]
variable {Cont : X → Set Q} {calib : R → K} {C : K}
/-- Dictionary row 15 / 13: the possible outputs of preparing `x` and
running the admitted continuation `c`. A set, not a value. -/
def Out (M : ContinuationModel Cont calib C) (x : X) (c : Q) :
Set (PhysicalState Cont) :=
fun y => M.Reaches x c y
/-- Reach descended to the quotient on the input side (B01). Well defined
because of `reaches_descends`. -/
def ReachesClass (M : ContinuationModel Cont calib C) :
PhysicalState Cont → Q → PhysicalState Cont → Prop :=
fun s c y => Quotient.lift (fun x : X => M.Reaches x c y)
(fun x x' (h : Cont x = Cont x') => propext
⟨M.reaches_descends x x' c y (Quotient.sound h),
M.reaches_descends x' x c y (Quotient.sound h.symm)⟩) s
/-- The first physical question (T-R3, statement): from `x` some admitted
continuation reaches a profile other than `[x]`. Whether this follows from
(C1)–(C3) is decided by the two control models: it does NOT (StaticControl)
and it CAN (CAControl). -/
def ProfileCanChange (M : ContinuationModel Cont calib C) (x : X) : Prop :=
∃ c y, c ∈ Cont x ∧ M.Reaches x c y ∧ y ≠ physicalClass Cont x
end ContinuationModel
end ReachKernel
Source
APF ReachKernel; original archive f05a126714fe8d24a4377f87a7e460777555e19227087abb6c18dbe2ffae959e, ReachKernel/ContinuationModel.lean; corrected compatible source manifest 2c8ccc43b416ba6e4f1b9eb02d4780b828e8dab689651eb567f7d159065cdfd2. Private conditional/reference model.