The supplied four-state turn world
DefinitionAPFPaper5_Worlds_TurnWorldDefines two coordinate distinctions, two record fragments, a quarter-turn fragment, record-union bills, capacity two, quotient tasks, an actual alignment and EightHold; includes execution, budget and profile support lemmas. All states, fragments, costs, capacities, protocol membership, actual alignments and singleton admissible sets for A2/BW are supplied data. Satisfaction of declared forms on them certifies no original physical instance. B02 r2 is handled as the current finite-combination clause; r3 is not installed. The turn keeps no new record by construction. The support lemmas inside this definition module are in review scope; the original alignment has its explicit active field.
Supplied data and hypotheses
- All states, fragments, costs, capacities, protocol membership, actual alignments and singleton admissible sets for A2/BW are supplied data. Satisfaction of declared forms on them certifies no original physical instance. B02 r2 is handled as the current finite-combination clause; r3 is not installed. The turn keeps no new record by construction. The support lemmas inside this definition module are in review scope; the original alignment has its explicit active field.
Limits
This is conditional reference mathematics. The supplied model and its hypotheses are not adopted Foundation inputs, and this node does not establish K1, K3 or K4 closure.
/-
APF Foundation Ledger — definition node DRAFT (session EthanBrooke-01WrrBvu, 2026-11-14; not gated, not reviewed)
name: APFPaper5_Worlds_TurnWorld
title: Supplied data for the turn world: four raw states for two distinctions, two record fragments and one turn fragment, the whole-word class, a bill that counts the records kept
inputs_revision: 2026-11-14.1
mathlib_rev: 0df444a360eaa60ab8c11dca51a86af692955474
source: supplied data, built on Def_APFPaper1_ContinuationWords (the whole-word budgeted class, author ruling
2026-11-12). It follows the description of the other Claude seat's readings world
(MEMO_pullbacks_pass14_2026-11-14, session EthanBrooke-01WrrBvv; its Lean source was not on hand) and adds
one fragment that moves the state. The author, 2026-11-14 15:48 HST: "Yes" (build one world for every
adopted reading with a hold that moves). FOUNDATION_INPUTS is not consumed; no claim is made that a
physical context is like this.
standing: supplied data only. Every definition here is a choice of this seat.
contents: one context. Raw states are the four combinations of sides of two distinctions, dA and dR.
Fragments: ra and rr each keep one record and run only where their distinction is held true, leaving the
state; t (the turn) runs everywhere, keeps no record, and takes the state (a, r) to (not r, a). A word keeps
the records of its fragments; its bill is the number of records it keeps; capacity 2. Every word is a
protocol. dA needs the record of ra; dR needs the record of rr. The occupant sits where both are held true
and carries both, as tasks on the physical domain; the joint class is the extensional one. EightHold names
the eight declared forms on this data, B02 in its revised form. A2 and BW are bound with one admissible
configuration, as in this seat's other worlds. Support lemmas (execution of one fragment, the budget, the
profiles) are included because the alignment needs them; they are not nodes.
-/
import Definitions.Def_APFPaper1_ContinuationWords
import Definitions.Def_APFPaper1_FamilyCost
import Definitions.Def_APF_B01_DeclaredInput
import Definitions.Def_APF_B02_DeclaredInput_r2_proposed
import Definitions.Def_APF_B03_DeclaredInput_r2
import Definitions.Def_APF_B04_DeclaredInput
import Definitions.Def_APF_B05_DeclaredInput_r2
import Definitions.Def_APF_B06_DeclaredInput
import Definitions.Def_APF_B07a_DeclaredInput
import Definitions.Def_APF_B07b_DeclaredInput
import Definitions.Def_APFB06_ExtensionalJoint
import Definitions.Def_APFB06_PhysicalDomain
import Mathlib.Data.Fintype.Prod
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Finset.Card
set_option autoImplicit false
open APFPaper1.Continuation
namespace APFPaper5.Worlds.TurnWorld
/-- The fragments: two that keep a record, and the turn. -/
inductive Fr : Type
| ra : Fr
| rr : Fr
| t : Fr
deriving DecidableEq
abbrev St : Type := Bool × Bool
abbrev Rec : Type := Bool
abbrev Frag : Unit → Unit → Type := fun _ _ => Fr
abbrev Raw : Unit → Type := fun _ => St
abbrev Res : Unit → Type := fun _ => Finset Rec
def dA : St → Bool := fun x => x.1
def dR : St → Bool := fun x => x.2
/-- The turn: dA comes to read what dR read, turned over; dR comes to read what dA read. -/
def quarter : St → St := fun x => (!x.2, x.1)
/-- Where a fragment runs. -/
def runs : Fr → St → Prop
| Fr.ra, x => x.1 = true
| Fr.rr, x => x.2 = true
| Fr.t, _ => True
/-- What a fragment does to the state. -/
def act : Fr → St → St
| Fr.ra, x => x
| Fr.rr, x => x
| Fr.t, x => quarter x
def step : (g h : Unit) → Frag g h → Raw g → Raw h → Prop := fun _ _ f x y => runs f x ∧ y = act f x
/-- The record a fragment keeps. -/
def fragRec : Fr → Finset Rec
| Fr.ra => {true}
| Fr.rr => {false}
| Fr.t => ∅
/-- The records a word keeps: those of its fragments. -/
def keptW : {g h : Unit} → Word Frag g h → Finset Rec
| _, _, Word.nil _ => ∅
| _, _, Word.cons f w => fragRec f ∪ keptW w
def kept : (g : Unit) → WordFrom Frag g → Finset Rec := fun _ w => keptW w.2
def cost : Rec → NNReal := fun _ => 1
def resource : (g : Unit) → WordFrom Frag g → Res g := fun g w => kept g w
def calibration : (g : Unit) → Res g → NNReal := fun _ s => (s.card : NNReal)
def C : Unit → NNReal := fun _ => 2
abbrev K : (g : Unit) → Raw g → WordFrom Frag g → Prop := Cont step resource calibration C
/-- The distinction domain: dA and dR. -/
def Delta : (g : Unit) → (St → Bool) → Prop := fun _ d => d = dA ∨ d = dR
abbrev Dist : Type := {d : St → Bool // Delta () d}
def dAd : Dist := ⟨dA, Or.inl rfl⟩
def dRd : Dist := ⟨dR, Or.inr rfl⟩
/-- Every word is a protocol. -/
def protocols : (g : Unit) → Set (WordFrom Frag g) := fun _ => Set.univ
abbrev Proto : Unit → Type := fun g => {p : WordFrom Frag g // p ∈ protocols g}
def maint : (g : Unit) → Proto g → Set Rec := fun g p => (↑(kept g p.val) : Set Rec)
/-- The record a distinction needs: that of ra for dA, that of rr for dR. -/
def need : Dist → Finset Rec := fun d => {d.val (true, false)}
def suff : (g : Unit) → Proto g → Set Rec → Dist → Prop := fun _ _ sigma d =>
(↑(need d) : Set Rec) ⊆ sigma
def uses : (g : Unit) → Proto g → Dist → Set Rec → Prop := fun _ _ _ _ => True
def wholeRes : (g : Unit) → Proto g → Res g := fun g p => resource g p.val
/-- The words used as witnesses. -/
def wA : WordFrom Frag () := ⟨(), Word.single (g := ()) (h := ()) Fr.ra⟩
def wR : WordFrom Frag () := ⟨(), Word.single (g := ()) (h := ()) Fr.rr⟩
def wTurn : WordFrom Frag () := ⟨(), Word.single (g := ()) (h := ()) Fr.t⟩
def wBoth : WordFrom Frag () :=
⟨(), Word.cons (g := ()) (h := ()) (k := ()) Fr.ra (Word.single (g := ()) (h := ()) Fr.rr)⟩
/-- A word that keeps exactly a given set of records. -/
def wordOfSet (T : Finset Rec) : WordFrom Frag () :=
if true ∈ T then (if false ∈ T then wBoth else wA) else (if false ∈ T then wR else nullWord ())
/-- The occupant's raw state: both distinctions held true. -/
def occ : St := (true, true)
/-! ### Support lemmas (not nodes): execution of one fragment, the budget, and the profiles. They are here
because the alignment below needs that the distinctions respect the profiles. -/
theorem executes_single (f : Fr) (x y : St) :
Executes step (Word.single (g := ()) (h := ()) f) x y ↔ runs f x ∧ y = act f x := by
constructor
· rintro ⟨y', ⟨hr, hy'⟩, hnil⟩
have e : y' = y := hnil
exact ⟨hr, e ▸ hy'⟩
· rintro ⟨hr, hy⟩
exact ⟨act f x, ⟨hr, rfl⟩, hy.symm⟩
theorem budget (g : Unit) (w : WordFrom Frag g) : calibration g (resource g w) ≤ C g := by
show ((kept g w).card : NNReal) ≤ 2
have h : (kept g w).card ≤ 2 := by
have h1 := Finset.card_le_univ (kept g w)
rwa [Fintype.card_bool] at h1
exact_mod_cast h
theorem cont_wA (x : St) : K () x wA ↔ x.1 = true := by
constructor
· rintro ⟨⟨y, hy⟩, _⟩
exact ((executes_single Fr.ra x y).mp hy).1
· intro h
exact ⟨⟨x, (executes_single Fr.ra x x).mpr ⟨h, rfl⟩⟩, budget _ _⟩
theorem cont_wR (x : St) : K () x wR ↔ x.2 = true := by
constructor
· rintro ⟨⟨y, hy⟩, _⟩
exact ((executes_single Fr.rr x y).mp hy).1
· intro h
exact ⟨⟨x, (executes_single Fr.rr x x).mpr ⟨h, rfl⟩⟩, budget _ _⟩
theorem profile_inj (x y : St) (h : K () x = K () y) : x = y := by
have hA : (x.1 = true) ↔ (y.1 = true) := by
rw [← cont_wA x, ← cont_wA y, h]
have hR : (x.2 = true) ↔ (y.2 = true) := by
rw [← cont_wR x, ← cont_wR y, h]
exact Prod.ext (Bool.eq_iff_iff.mpr hA) (Bool.eq_iff_iff.mpr hR)
theorem hresp (g : Unit) (d : {d : St → Bool // Delta g d}) (x y : St) (h : K g x = K g y) :
d.val x = d.val y := by
rw [profile_inj x y h]
/-! ### The occupant's alignment and the joint class, on the physical domain -/
/-- The task domain: the physical domain of dA and dR (the other Claude seat's Def_APFB06_PhysicalDomain). -/
def D : (g : Unit) → Set (APFB01.PhysicalState (K g) → Bool) := fun g =>
APFB06.physicalDomain (K g) (Delta g) (hresp g)
/-- The family the occupant carries, as raw distinctions and as tasks. -/
def carriedDist : Finset Dist := {dAd, dRd}
def carriedTasks : Finset (APFB06.Task (K ()) (D ())) :=
carriedDist.map (APFB06.taskEquiv (K ()) (Delta ()) (hresp ())).symm.toEmbedding
theorem carried_active :
∀ t ∈ carriedTasks, t.val (APFB01.physicalClass (K ()) occ) = true := by
intro t ht
obtain ⟨d, hd, rfl⟩ := Finset.mem_map.mp ht
show d.val occ = true
rcases Finset.mem_insert.mp hd with h | h
· rw [h]
rfl
· rw [Finset.mem_singleton.mp h]
rfl
def align : APFB06.OriginalAlignment (K ()) (D ()) where
carrier := APFB01.physicalClass (K ()) occ
carried := carriedTasks
active := carried_active
/-- Record data on tasks: a task is served as the raw distinction it reads. -/
def suffT : (g : Unit) → Proto g → Set Rec → APFB06.Task (K g) (D g) → Prop := fun g p sigma t =>
suff g p sigma (APFB06.distinctionOfTask (K g) (Delta g) (hresp g) t)
def usesT : (g : Unit) → Proto g → APFB06.Task (K g) (D g) → Set Rec → Prop := fun _ _ _ _ => True
/-- The joint class: the extensional one (the other Claude seat's Def_APFB06_ExtensionalJoint). -/
def J : (g : Unit) → Finset (APFB06.Task (K g) (D g)) → Set (Proto g) := fun g =>
APFB06.extensionalJoint (maint g) (suffT g) (usesT g)
def actualJoint : Set (Sigma fun g => APFB06.OriginalAlignment (K g) (D g)) := {⟨(), align⟩}
/-- The eight declared forms on the supplied data, with B02 as revised (its second sentence included). -/
def EightHold : Prop :=
APF_B01_DeclaredInput (K ())
(fun (f : APFB01.PhysicalState (K ()) → Prop) (x : St) => f (APFB01.physicalClass (K ()) x))
(fun (f : APFB01.PhysicalState (K ()) → Prop) (x : St) => f (APFB01.physicalClass (K ()) x))
(fun (f : APFB01.PhysicalState (K ()) → Prop) (x : St) => f (APFB01.physicalClass (K ()) x))
(fun (f : APFB01.PhysicalState (K ()) → Prop) (x : St) => f (APFB01.physicalClass (K ()) x)) ∧
APFB02.B02SourceMeaning_r2 (Context := Unit) (X := fun _ => St) (Q := fun g => WordFrom Frag g)
(P := Proto) (Record := fun _ => Rec) K Delta maint suff uses ∧
APFB03.B03TaskCost (Context := Unit) (D := fun _ => Dist) (P := Proto) (R := Res)
(Record := fun _ => Rec) wholeRes calibration maint suff uses ∧
APFB04.B04FiniteCapacity (Context := Unit) (fun _ => (2 : ℝ)) ∧
APFB05.MarginalFloor (Context := Unit) (D := fun _ => Dist) (P := Proto) (R := Res)
(Record := fun _ => Rec) wholeRes calibration maint suff uses
(fun _ _ => True) (fun _ => 2) (fun _ => 1) ∧
APFB06.AmendedB06_20260914 K D protocols J wholeRes calibration C actualJoint ∧
APFB07a.A2Selection (Interface := Unit)
(Configuration := fun _ => APFB01.PhysicalState (K ()))
(fun _ s => s = APFB01.physicalClass (K ()) occ) (fun _ _ => (1 : ℝ))
(fun _ => APFB01.physicalClass (K ()) occ) ∧
APFB07b.BWUniqueMinimum (Interface := Unit)
(Configuration := fun _ => APFB01.PhysicalState (K ()))
(fun _ s => s = APFB01.physicalClass (K ()) occ) (fun _ _ => (1 : ℝ))
end APFPaper5.Worlds.TurnWorld