Alignment protocols and calibrated connecting prices
DefinitionAPFReachKernel_RealignmentModelapfconditional-referencereachkernel
An alignment consists of a carrier and a held family. A realignment model supplies connecting protocols, calibrated nonnegative prices, identity, admissible composition and subadditivity. The interface defines connecting-price families, a separate lower-bound floor predicate (positivity must be supplied where required) and change of alignment. These are model inputs and predicates before any infimum construction; they do not identify an original physical whole account.
Definition code
import Definitions.Def_APFReachKernel_ContinuationModel
import Definitions.Def_APFReachKernel_Foundation
namespace ReachKernel
end ReachKernel
namespace ReachKernel.RealignmentModel
end ReachKernel.RealignmentModel
/-
ReachKernel/RealignmentModel.lean
Conditional alignment-level connecting protocols and calibrated prices.
Identity, admissible composition and subadditivity are structure fields;
the per-realignment floor is a separate hypothesis. These pre-infimum
results do not construct the original physical account or an infimum port.
The five Native files in this archive are separately inventoried prototypes;
no additional Native theorem file is present or claimed built.
-/
set_option autoImplicit false
namespace ReachKernel
/-- Mirror of `APFUpstreamOccupant.OriginalAlignment` (carrier, carried,
active), with `carried` as a predicate instead of a Finset so the kernel
stays Mathlib-free. `D` is the physical distinction domain on the quotient. -/
structure Alignment {X Q : Type} (Cont : X → Set Q)
(D : Set (PhysicalState Cont → Bool)) where
carrier : PhysicalState Cont
carried : Set {d : PhysicalState Cont → Bool // d ∈ D}
active : ∀ d, d ∈ carried → d.val carrier = true
/--
`RealignmentModel Cont D calib C`
* `Connects π a₁ a₂` — "π takes the substrate from (a₁,𝒟_{a₁}) to
(a₂,𝒟_{a₂})". Relation.
* `cost π` — cost(π), as a calibrated load (`calib (load π)`).
* `identity_protocol`— (P1) do-nothing connects a to a at cost 0.
* `concat_connects` — (P2) verbatim, conditional on "the concatenation
remains admissible" (`Admissible`), which the source
leaves conditional and so do we.
* `cost_subadditive` — (P3).
(P4) is `PerRealignmentFloor`, a separate predicate, never a field.
NOT present: any law that Connects is total, functional, or that any
a₂ ≠ a₁ is ever connected.
-/
structure RealignmentModel {X Q R K : Type} [Add K] [LE K]
(Cont : X → Set Q) (D : Set (PhysicalState Cont → Bool))
(calib : R → K) (C : K) where
Connects : Q → Alignment Cont D → Alignment Cont D → Prop
load : Q → R
concat : Q → Q → Q
/-- "the concatenation remains admissible" — the source's own proviso. -/
Admissible : Q → Prop
zero : K
zero_le : ∀ k : K, zero ≤ k
identity_protocol :
∀ a, ∃ e, Connects e a a ∧ calib (load e) = zero
concat_connects :
∀ π₁ π₂ a₁ a₂ a₃, Connects π₁ a₁ a₂ → Connects π₂ a₂ a₃ →
Admissible (concat π₂ π₁) → Connects (concat π₂ π₁) a₁ a₃
cost_subadditive :
∀ π₁ π₂, calib (load (concat π₂ π₁)) ≤ calib (load π₁) + calib (load π₂)
namespace RealignmentModel
variable {X Q R K : Type} [Add K] [LE K]
variable {Cont : X → Set Q} {D : Set (PhysicalState Cont → Bool)}
variable {calib : R → K} {C : K}
def cost (M : RealignmentModel Cont D calib C) (π : Q) : K := calib (M.load π)
/-- The price set whose infimum is κ^trans(a₁ → a₂). -/
def realignmentPrices (M : RealignmentModel Cont D calib C)
(a₁ a₂ : Alignment Cont D) : Set K :=
fun k => ∃ π, M.Connects π a₁ a₂ ∧ M.cost π = k
/-- (P4), as the source states it: a hypothesis, named, never asserted. -/
def PerRealignmentFloor (M : RealignmentModel Cont D calib C) (ε : K) : Prop :=
M.zero ≤ ε ∧ ε ≠ M.zero ∧
∀ π a₁ a₂, M.Connects π a₁ a₂ → a₁ ≠ a₂ → ε ≤ M.cost π
/-- T-R3 at the alignment level (statement): from `a` some protocol connects
to a DIFFERENT admissible alignment. This is "a held family can actually
change". It is not a consequence of (P1)–(P3): see StaticControl. -/
def AlignmentCanChange (M : RealignmentModel Cont D calib C) (a : Alignment Cont D) : Prop :=
∃ π a', M.Connects π a a' ∧ a' ≠ a
end RealignmentModel
end ReachKernel
Source
APF ReachKernel; original archive f05a126714fe8d24a4377f87a7e460777555e19227087abb6c18dbe2ffae959e, ReachKernel/RealignmentModel.lean; corrected compatible source manifest 2c8ccc43b416ba6e4f1b9eb02d4780b828e8dab689651eb567f7d159065cdfd2. Private conditional/reference model.