Model vocabulary — A supplied four-place continuation model
DefinitionAPFB06_circle_world_VocabularyData, predicates and immediate constructor helpers for this reviewed model. Its substantive results are published as separate proved theorem nodes.
Finite supplied model with two recorded Boolean readings and a hidden four-place coordinate. Read fragments keep their records, making fragments have place-dependent gates, and the free quarter turn changes only the hidden place. Costs count kept records, capacity is two, floor is one. EightHold proves historical declared forms on these data, not current physical inputs. Singleton A2/BW choices do not establish protocol binding or continuity; the model supplies no physical carrier or chance weights.
Supplied data and hypotheses
- Every formal parameter and hypothesis remains exposed. Historical model encodings and named conditions are not adopted as current physical inputs.
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 — theorem node DRAFT (Claude seat, session EthanBrooke-01WrrBvv, 2026-11-18; not
gated, not reviewed, not released, not built on the build machine, in no bundle)
name: APFB06_circle_world
title: One supplied world with a held circle of four places that no record sees: a quarter turn that keeps no record, and two makings, each of which makes its own distinction read true, keeps its record and moves the held place; the world meets the eight declared forms and B02 with its second sentence
inputs_revision: 2026-11-20.2 (the eight declared forms as encoded, with B02 also in the builder seat's
proposed form Def_APF_B02_DeclaredInput_r2_proposed)
restated: 2026-11-21 09:49 HST, for bundle v57, at the author's word of 09:43 HST, "yes", to this seat's question
"Shall I build v57 as set out, yes or no?"
(RULING_build_v57_with_the_headers_restated_to_2026-11-20.2_and_stage_the_run_2026-11-21; set out in
TEE_UP_the_build_run_before_the_upload_bundle_v57_with_headers_restated_to_the_revision_in_force_2026-11-21).
HEADER ONLY. Every line after this comment is the file as in bundle v56 (sha256
5c0492283633dac1ac32f96eb5b2b93f474808a10e3776f4439404025483e047), kept in Old/ as
Thm_APFB06_circle_world_pre-restating_v57_2026-11-21.lean. No declaration is changed. THE RESTATED BYTES
ARE NOT RELEASED.
Changed in this header: the revision named on the inputs_revision line, which was 2026-11-17.4, and this
entry. Nothing else.
WHAT HAPPENED: since revision 2026-11-17.4, which this header named until now, three revisions of
FOUNDATION_INPUTS were installed. Revision 2026-11-18.2, installed 2026-11-18 at 18:22 HST (sha256
290a59cad5591706d9b929fc98dde9f1b1215b4e40dc3d8eff790e8c59090cf0;
INSTALL_RECEIPT_FOUNDATION_INPUTS_2026-11-18.2_2026-11-18): the reading of B02's first sentence
(reading_20261114_list_complete) is scoped to what is recorded. It now reads: "The distinctions of a
context are complete for what is recorded: potential states that every distinction of the context reads
alike are recorded alike. They may differ in what they hold unrecorded. Then what can follow them tells
them apart, and no side does." It is a reading and not a commitment; B02's two sentences are unchanged.
Revision 2026-11-18.3, installed 2026-11-18 at 19:50 HST (sha256
95815d3a9ef01dd631bd52729a66a79531ff4590ed44d451be5882af20cc35b2;
INSTALL_RECEIPT_FOUNDATION_INPUTS_2026-11-18.3_and_GATE_POLICY_2026-11-18.inputs.2_2026-11-18): one block
was added that records where 13 cited files now resolve. No wording of a commitment changed. Revision
2026-11-20.2, installed 2026-11-20 at 12:36 HST (sha256
05c831bf6e786f168d9a9f0bb366b496388bd049960e9df3ca0acad8680d6252;
INSTALL_RECEIPT_FOUNDATION_INPUTS_2026-11-20.2_2026-11-20): B06 is reduced. After its first four sentences,
which are unchanged, it now reads: "To draw a distinction is to keep its record: each distinction has one
record, the same in every protocol, and a protocol draws the distinction exactly when it keeps that record.
Every record a protocol keeps is the record of some tested distinction or family of tested distinctions,
and is used for it. Every process pays epsilon for each record it keeps, and nothing else, where epsilon is
positive and fixed by the context. In every context some protocol draws no distinction. The occupant draws
exactly its family, and every part of that family is drawn alone by some protocol. A process that keeps no
record costs nothing. A process that keeps no record changes nothing that is recorded." Against revision
2026-11-18.3, six sentences are replaced by four and three are kept word for word. The six that are no
longer sentences of the inputs: "Each record carries a cost. What a set of records is sufficient for does
not depend on the protocol that keeps it. The occupant holds its distinctions with exactly the records they
need, and its bill is the cost of those records. The same is true of every part of it: any family of its
distinctions is held with exactly the records that family needs, at exactly their cost, and there is no
cheaper way to hold that family. Epsilon is the unit of the occupant: each record it keeps costs epsilon,
the floor of its context. Holding nothing costs nothing." B03 and B05 are retired as inputs and are kept in
the inputs file as derived statements. B07a and B07b each gain a note, note_20261120_protocol_binding;
their wording, scope and forms are unchanged. B01, B02 and B04 are unchanged. The commitments are six: B01,
B02, B04, B06, B07a, B07b. The gate policy on the build machine is policy_revision 2026-11-20.inputs.1
(sha256 5e9f3ec3cfa6c9a0a0b28549d13370c31ef78de38272ac6391efeac472f9a4aa) and requires this revision
(INSTALL_RECEIPT_GATE_POLICY_2026-11-20.inputs.1_2026-11-20).
HOW TO READ THE REST OF THIS HEADER: it named revision 2026-11-17.4 and is left as written, any earlier
entries "restated" below included. Where it names revision 2026-11-17.4 or an earlier one as the revision
in force, that is no longer so: the revision in force is 2026-11-20.2. Where it counts eight commitments,
eight inputs or eight declared forms: there are now six commitments. The declared forms of B03 and B05 are
unchanged and are now forms of derived statements. Where it calls B03 or B05 an input, or takes the
declared form of either as a hypothesis: the installed file says of B03, and in the same words of B05, "A
dependency on B03 is a dependency on its declared form, which is unchanged. From revision 2026-11-20.2 that
form is a derived statement and not an input. The derivation is a draft and is not certified: until it is
admitted through the gate, a node that consumes B03 is conditional on it. Resolve it before foundation
certification. Do not treat an old use of B03 as a use of B06." Where it speaks of B06 by a count of its
sentences or by their numbers, of the occupant statement, of the amended B06, or of a sentence of B06 as an
input: that is B06 as it stood at the revision the header then named, and B06 now reads as quoted above. A
statement here that takes one of the six replaced sentences as a premise stays true as a conditional;
whether it follows from the reduced B06 is NOT SAID by this entry (for what used them see
MEMO_pullbacks_passes119_and_120_what_used_the_dropped_sentences_and_one_world_for_all_eleven_2026-11-18 in
Notes). Where it says of a sentence that is in B06 as quoted above that it is proposed, a ruling carried as
a named hypothesis, NOT RULED, not installed or not an input: that is no longer so, for that sentence as
worded above and for no typing of it. Where it takes the reading of B02's first sentence as first recorded
(the distinctions of a context are complete: potential states that every distinction reads alike have the
same continuation profile; the physical objects of a context correspond one to one with the combinations of
sides of its distinctions) as a reading of the inputs: from revision 2026-11-18.2 the inputs do not assert
it. A statement that takes it as a premise stays true as a conditional. A supplied world in which it holds
is not excluded: the scoped reading adds no constraint. THE NEW SENTENCES OF B06 HAVE NO CERTIFIED LEAN
FORM: the forms the inputs file names for the reduced B06 are drafts of the two seats, marked
PROPOSED_NOT_CERTIFIED, and the Lean that derives the declared forms of B03 and B05 is a draft and is not
gated. NOTHING in this entry says that a theorem of this file follows from the inputs at revision
2026-11-20.2, or that a supplied world of this file is a world of them: each theorem stands as before, on
its named hypotheses or on its supplied world, and a supplied world that breaks a sentence of the inputs at
revision 2026-11-20.2 is not a world of the inputs at that revision, whatever this header says of an
earlier one. The gate policy says of the move to this revision: "immutable; dependency compatibility must
be established separately; no stale-basis waiver". This entry establishes no such compatibility. Proposed
revision 2026-11-20.3 (one further note on each of B07a and B07b) is NOT installed.
mathlib_rev: 0df444a360eaa60ab8c11dca51a86af692955474
source: the author, 2026-11-18 13:42 HST: "Yes", to "Shall I build that world next, yes or no?", the world
being one with "a held circle of four places, with a quarter turn that keeps no record; two makings,
each of which records its own distinction and moves the circle; so that making one changes whether the
other can run" (RULING_build_the_world_with_a_held_circle_and_two_makings_next_2026-11-18). The parts
are this seat's construction. The author has said yes to building it and no more.
This file is Thm_APFB06_held_datum_world (pass 123) restated. What is changed in the world: (1) the
held datum is two bits, a place on a circle of four; (2) the turn gives the place a quarter turn;
(3) there is a making for each of the two distinctions, in place of the one making of dR; (4) a making
runs at every place but one, and leaves the held place at a place of its own. The reading fragments,
the records, the bill, the capacity and the protocols are as they were. Proofs are restated for the
new fragments and states; the statements of the declared forms are the held-datum world's, with the
occupant placed where both distinctions are held true and the held place is zm.
Consulted before typing (2026-11-18, 13:44 to 13:46 HST, and 13:53 HST for the lines quoted), with what
passes 122 and 123 consulted:
- Paper 5 Supplement v7.33 (sandbox copy): 1697-1699, the half turn of the Held circle "exchanges the
represented ordered poles ... and reverses the continuation coordinate", and the quarter-turn J_A;
1716-1723, "The exact half-turn and quarter-turn matrix identities are certified by"
check_T_held_circle_quarter_turn, and "nontriviality without connectedness does not supply a
quarter-turn"; 1443-1447 and 1958-1961 as read for the tee-up of 13:31 HST.
- Codebank: apf/_held_holonomy_naturality.py, held_circle_quarter_turn_impl (J^2 = -I, J orthogonal,
"J has order four", "-I is the nonidentity order-two half-turn"). The check was read, not run.
- Existing Lean: Thm_APFB06_held_datum_world (the template); Thm_APFB06_moving_world (its turn takes
(a, r) to (r, not a), on two recorded sides); Thm_APFB06_two_context_world (tmap, two_turns,
four_turns: a turn between two contexts); Def_APFPaper5_K2_HoldWord.
consumes_inputs: none as hypotheses. Declared forms and readings are PROVED of supplied data, which
certifies nothing about the physical inputs.
the world (APFB06.CircleWorld): one context. Two distinctions in the domain, dA and dR. Two records, ra
and rr. A raw state is the side of dA, the side of dR, and a held place. There are four places, zp,
xp, zm, xm, and the turn takes them round in that order.
- A reading fragment for ra and one for rr: each runs where its distinction is held true, leaves the
state and keeps its record.
- The making of dA runs at every place but zm. It makes dA read true, leaves dR, keeps the record ra,
and leaves the held place at zp.
- The making of dR runs at every place but xm. It makes dR read true, leaves dA, keeps the record rr,
and leaves the held place at xp.
- The turn runs everywhere, gives the held place a quarter turn, leaves dA and dR, and keeps no record.
A word keeps the records its fragments keep; its bill is the number of records kept; capacity 2; floor
1. Every word is a protocol.
statement: what the held-datum world's file proves, of this world (eight_hold, meets_B02_r2,
alignments_hold_relation, sum_holds, keep_holds, after_holds, capacity_holds, empty_keeps_nothing,
available, cost_eq_card, cost_subadditive, prefix_restriction_holds, identity_holds,
subword_heredity_holds, word_acts), and:
- of the places: places, turnP_zp to turnP_xm, openA_iff, openR_iff, no_place_closes_both, and
openR_turn (the making of dR can run at a place exactly where the making of dA can run a quarter
turn back);
- of each making: makeA_acts, makeA_admitted_iff, kept_makeA, bill_makeA, and the same for dR;
madeR_place_is_madeA_place_turned; madeA_not_injective;
- of the turn: turn_acts, turn_admitted, kept_turn, bill_turn, turned_turned (two turns turn both bits
of the place over), turned_four, turned_ne, turned_turned_ne (the turn is of order four and no
less), and of three turns turn3_acts, turn3_admitted, kept_turn3, turned3_turned, turned_turned3;
- place_of_three, profile_inj: different raw states have different continuation profiles. The held
place is seen by the profile, through which makings can follow.
NOT RULED, and choices of this file:
- The held place is not in the world's distinction domain and has no record.
- What a making does to the held place, and where it can run. Nothing in the inputs says that a making
moves what is held, or where it leaves it. These rules are supplied. They were chosen for the
stated aim: each making is closed at one place, and the rule for dR is the rule for dA a quarter
turn on.
what this file does NOT say:
- That the world meets the sentences of B06 as proposed for revision 2026-11-18.1, that the turn is a
hold, or that the makings do not commute. Those are the next file's.
- That the turn is the quarter-turn of Paper 5. It is a quarter turn of a circle of four places. Paper
5's is a map of a carrier with square minus one. Two turns here turn both bits over, which has the
same shape; nothing here is a carrier.
- Chances. A making can run or it cannot. No number between appears.
- What a making that cannot run leaves. It does not run. No record is kept of the side that reads
false.
- That a making can be undone. No fragment of this world turns a side of dA or dR from true to false.
- That the held place is anything but definite. Every raw state has one place, and everything that can
follow is fixed by the sides and the place. This is a world with a hidden place.
- That this world is the physical one.
- A2's protocol binding and the continuity clause are not checked here. No lane. No claim that the
transfer is forced, that the carrier gap is closed or narrowed, or that Born is derived.
axioms: within propext, Classical.choice, Quot.sound. No sorry.
-/
import Definitions.Def_APFPaper5_Worlds_TwoObjects
import Definitions.Def_APFB06_ExtensionalJoint
import Definitions.Def_APFB06_AlignmentHoldsRelation
import Definitions.Def_APF_B02_DeclaredInput_r2_proposed
import Definitions.Def_APFB02_HoldOnDistinctions
import Definitions.Def_APF_B04_DeclaredInput
import Definitions.Def_APF_B07a_DeclaredInput
import Definitions.Def_APF_B07b_DeclaredInput
import Theorems.Thm_APFPaper1_Source_needed_subset_kept
import Theorems.Thm_APFPaper1_Source_card_needed_le_bill
import Theorems.Thm_APFPaper1_Source_card_needed_le_familyCost
import Theorems.Thm_APFPaper1_Source_familyCost_eq_card_of_available
import Theorems.Thm_APFPaper1_Source_join_of_available
import Theorems.Thm_APFPaper1_Continuation_prefixMonotone_of_sum_and_keep
import Theorems.Thm_APFPaper1_Continuation_cont_prefix_of_sum_and_keep
import Theorems.Thm_APFPaper1_Continuation_cont_iff_contHereditary_of_sum_and_keep
import Theorems.Thm_APFPaper1_Continuation_subwordHeredity_of_subword_bill
import Theorems.Thm_APFPaper1_Continuation_subwordHeredity_of_sum_and_keeps
import Theorems.Thm_APFPaper1_Continuation_bill_nullWord_of_sum
import Theorems.Thm_APFPaper1_Continuation_cont_identity_of_sum
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
set_option autoImplicit false
open APFPaper1.Continuation
namespace APFB06.CircleWorld
/-- The records. -/
inductive Rc
| ra | rr
deriving DecidableEq
instance : Fintype Rc := ⟨{Rc.ra, Rc.rr}, fun r => by cases r <;> decide⟩
/-- The kinds of fragment: a reading fragment for each record, a making fragment for each record, and
the turn. -/
inductive Fr
| rd (c : Rc)
| mk (c : Rc)
| tn
deriving DecidableEq
/-- The fragments. -/
abbrev Frag : Unit → Unit → Type := fun _ _ => Fr
/-- The places of the held circle. A place is two bits. No distinction of the world reads a place, and a
place has no record. -/
abbrev Pl : Type := Bool × Bool
/-- The four places, in the order the turn takes them: zp, xp, zm, xm, and round again. -/
def zp : Pl := (true, true)
def xp : Pl := (true, false)
def zm : Pl := (false, false)
def xm : Pl := (false, true)
/-- The quarter turn of the circle of places. -/
def turnP : Pl → Pl := fun p => (p.2, !p.1)
/-- Where the making of dA can run: every place but zm. -/
def openA : Pl → Bool := fun p => p.1 || p.2
/-- Where the making of dR can run: every place but xm. -/
def openR : Pl → Bool := fun p => p.1 || !p.2
/-- Raw states: the side of dA, then the side of dR, then the held place. -/
abbrev St : Type := Bool × Bool × Pl
abbrev Raw : Unit → Type := fun _ => St
abbrev Res : Unit → Type := fun _ => Finset Rc
/-- The making of dA: dA comes to read true, whatever it read; dR is left as it was; THE HELD PLACE COMES
TO zp. -/
def madeA : St → St := fun x => (true, x.2.1, zp)
/-- The making of dR: dR comes to read true, whatever it read; dA is left as it was; THE HELD PLACE COMES
TO xp. -/
def madeR : St → St := fun x => (x.1, true, xp)
/-- The turn's action: the held place takes a quarter turn; dA and dR are left as they were. -/
def turned : St → St := fun x => (x.1, x.2.1, turnP x.2.2)
/-- Where a fragment can run: a reading fragment runs where its distinction is held true; THE MAKING OF
dA RUNS AT EVERY PLACE BUT zm; THE MAKING OF dR RUNS AT EVERY PLACE BUT xm; the turn runs everywhere. -/
def runs : Fr → St → Prop
| .rd .ra, x => x.1 = true
| .rd .rr, x => x.2.1 = true
| .mk .ra, x => openA x.2.2 = true
| .mk .rr, x => openR x.2.2 = true
| .tn, _ => True
/-- What a fragment does to the state: a reading fragment leaves it; a making sets its distinction to
true and moves the held place; the turn turns the held place. -/
def act : Fr → St → St
| .rd _, x => x
| .mk .ra, x => madeA x
| .mk .rr, x => madeR x
| .tn, x => turned 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 fragments of a word, in execution order. -/
def labels : {g h : Unit} → Word Frag g h → List Fr
| _, _, Word.nil _ => []
| _, _, Word.cons f w => f :: labels w
/-- The record a fragment keeps, if any: a reading fragment keeps its record; a making keeps the record
of the distinction it makes; THE TURN KEEPS NONE. -/
def recF : Fr → Option Rc
| .rd c => some c
| .mk c => some c
| .tn => none
/-- What a word keeps: the records its fragments keep. -/
def kept (g : Unit) (w : WordFrom Frag g) : Finset Rc :=
Finset.univ.filter (fun r => ∃ f ∈ labels w.2, recF f = some r)
theorem card_kept_le (g : Unit) (w : WordFrom Frag g) : (kept g w).card ≤ 2 :=
le_trans (Finset.card_le_card (Finset.filter_subset _ _)) (by decide)
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
/-- Each record costs 1. -/
def recCost : Rc → NNReal := fun _ => 1
abbrev K : (g : Unit) → Raw g → WordFrom Frag g → Prop := Cont step resource calibration C
/-- Every word is within budget: there are only two records. -/
theorem in_budget (g : Unit) (w : WordFrom Frag g) : calibration g (resource g w) ≤ C g := by
show (((kept g w).card : ℕ) : NNReal) ≤ 2
have h := card_kept_le g w
exact_mod_cast h
/-! ### Words from lists of fragments -/
def wordOf : (g : Unit) → List Fr → Word Frag g g
| g, [] => Word.nil g
| g, f :: l => Word.cons (g := g) (h := g) (k := g) f (wordOf g l)
/-- The word with the listed fragments, in that order. -/
def wd (g : Unit) (l : List Fr) : WordFrom Frag g := ⟨g, wordOf g l⟩
theorem wA_in_iff (x : St) : K () x (wd () [Fr.rd Rc.ra]) ↔ x.1 = true := by
constructor
· rintro ⟨⟨_, _, ⟨hr, _⟩, _⟩, _⟩
exact hr
· intro h
exact ⟨⟨x, x, ⟨h, rfl⟩, rfl⟩, in_budget _ _⟩
theorem wR_in_iff (x : St) : K () x (wd () [Fr.rd Rc.rr]) ↔ x.2.1 = true := by
constructor
· rintro ⟨⟨_, _, ⟨hr, _⟩, _⟩, _⟩
exact hr
· intro h
exact ⟨⟨x, x, ⟨h, rfl⟩, rfl⟩, in_budget _ _⟩
/-- The making of dA is a continuation exactly where the held place is not zm. -/
theorem wMA_in_iff (x : St) : K () x (wd () [Fr.mk Rc.ra]) ↔ openA x.2.2 = true := by
constructor
· rintro ⟨⟨_, _, ⟨hr, _⟩, _⟩, _⟩
exact hr
· intro h
exact ⟨⟨madeA x, madeA x, ⟨h, rfl⟩, rfl⟩, in_budget _ _⟩
/-- The making of dR is a continuation exactly where the held place is not xm. -/
theorem wMR_in_iff (x : St) : K () x (wd () [Fr.mk Rc.rr]) ↔ openR x.2.2 = true := by
constructor
· rintro ⟨⟨_, _, ⟨hr, _⟩, _⟩, _⟩
exact hr
· intro h
exact ⟨⟨madeR x, madeR x, ⟨h, rfl⟩, rfl⟩, in_budget _ _⟩
/-- The turn followed by the making of dA is a continuation exactly where the making of dA can run a
quarter turn on. -/
theorem wTMA_in_iff (x : St) :
K () x (wd () [Fr.tn, Fr.mk Rc.ra]) ↔ openA (turnP x.2.2) = true := by
constructor
· rintro ⟨⟨_, _, ⟨_, rfl⟩, _, ⟨hr, _⟩, _⟩, _⟩
exact hr
· intro h
exact ⟨⟨madeA (turned x), turned x, ⟨trivial, rfl⟩, madeA (turned x), ⟨h, rfl⟩, rfl⟩,
in_budget _ _⟩
/-- A place is fixed by where three words can run: the making of dA, the making of dR, and the making of
dA after one turn. -/
theorem place_of_three (p q : Pl) (h1 : openA p = openA q) (h2 : openR p = openR q)
(h3 : openA (turnP p) = openA (turnP q)) : p = q := by
obtain ⟨a, b⟩ := p
obtain ⟨c, d⟩ := q
cases a <;> cases b <;> cases c <;> cases d <;>
first
| rfl
| exact absurd h1 (by decide)
| exact absurd h2 (by decide)
| exact absurd h3 (by decide)
/-- Different raw states have different continuation profiles. The held place is seen by the profile. -/
theorem profile_inj (x y : St) (h : K () x = K () y) : x = y := by
have h1 : x.1 = true ↔ y.1 = true := by
rw [← wA_in_iff x, ← wA_in_iff y, h]
have h2 : x.2.1 = true ↔ y.2.1 = true := by
rw [← wR_in_iff x, ← wR_in_iff y, h]
have h3 : openA x.2.2 = true ↔ openA y.2.2 = true := by
rw [← wMA_in_iff x, ← wMA_in_iff y, h]
have h4 : openR x.2.2 = true ↔ openR y.2.2 = true := by
rw [← wMR_in_iff x, ← wMR_in_iff y, h]
have h5 : openA (turnP x.2.2) = true ↔ openA (turnP y.2.2) = true := by
rw [← wTMA_in_iff x, ← wTMA_in_iff y, h]
exact Prod.ext (Bool.eq_iff_iff.mpr h1)
(Prod.ext (Bool.eq_iff_iff.mpr h2)
(place_of_three _ _ (Bool.eq_iff_iff.mpr h3) (Bool.eq_iff_iff.mpr h4)
(Bool.eq_iff_iff.mpr h5)))
/-! ### The distinctions and what they need -/
def dA : St → Bool := fun x => x.1
def dR : St → Bool := fun x => x.2.1
/-- The distinction domain: dA and dR. -/
abbrev Delta : (g : Unit) → (St → Bool) → Prop := fun _ d => d = dA ∨ d = dR
noncomputable instance instDecEqDomain (g : Unit) : DecidableEq {d : St → Bool // Delta g d} :=
Classical.decEq _
abbrev Dist : Type := {d : St → Bool // Delta () d}
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
cases g
rw [profile_inj x y h]
def dAd : Dist := ⟨dA, Or.inl rfl⟩
def dRd : Dist := ⟨dR, Or.inr rfl⟩
/-- The record a distinction needs: ra for dA, rr for dR. Read off a state where dA is held true and dR
false. -/
def recOf (d : Dist) : Rc := cond (d.val (true, false, false, false)) Rc.ra Rc.rr
/-- The records a distinction needs. -/
def fam (d : Dist) : Finset Rc := {recOf d}
/-! ### Protocols: every word -/
def protocols : (g : Unit) → Set (WordFrom Frag g) := fun _ => Set.univ
abbrev Pr (g : Unit) : Type := {p : WordFrom Frag g // p ∈ protocols g}
def pOf (l : List Rc) : Pr () := ⟨wd () (l.map Fr.rd), Set.mem_univ _⟩
/-- The protocol keeping both records. -/
def pAR : Pr () := pOf [Rc.ra, Rc.rr]
def keptP (p : Pr ()) : Finset Rc := kept () p.val
def maint (g : Unit) (p : {p : WordFrom Frag g // p ∈ protocols g}) : Set Rc := ↑(kept g p.val)
def suff (g : Unit) (_ : {p : WordFrom Frag g // p ∈ protocols g}) (s : Set Rc)
(d : {d : St → Bool // Delta g d}) : Prop := recOf d ∈ s
def uses (g : Unit) (_ : {p : WordFrom Frag g // p ∈ protocols g})
(_ : {d : St → Bool // Delta g d}) (_ : Set Rc) : Prop := True
def wholeRes (g : Unit) (p : {p : WordFrom Frag g // p ∈ protocols g}) : Res g := resource g p.val
/-! ### The record model, and sentence 4: an exact protocol for every family -/
/-- The family cost of the ledger on this world. -/
noncomputable abbrev fcost (S : Finset Dist) : ℝ :=
APFPaper1.Source.familyCost (wholeRes ()) (calibration ()) (maint ()) (suff ()) (uses ()) S
/-! ### B06 on the physical domain, at the extensional joint class -/
noncomputable def heldD : Finset Dist := {dAd, dRd}
/-- The occupant's alignment: it sits where both are held true and the held place is zm, and carries dA
and dR. -/
noncomputable def alignR : APFB06.OriginalAlignment (K ())
(APFB06.physicalDomain (K ()) (Delta ()) (hresp ())) where
carrier := APFB01.physicalClass (K ()) (true, true, false, false)
carried := heldD.map (APFB06.taskEquiv (K ()) (Delta ()) (hresp ())).symm.toEmbedding
active := by
intro t ht
obtain ⟨d, hd, rfl⟩ := Finset.mem_map.mp ht
rcases Finset.mem_insert.mp hd with rfl | hd'
· rfl
· rw [Finset.mem_singleton.mp hd']
rfl
def actualJointR : Set (Sigma fun g =>
APFB06.OriginalAlignment (K g) (APFB06.physicalDomain (K g) (Delta g) (hresp g))) :=
{⟨(), alignR⟩}
/-- The eight declared forms on the supplied data. -/
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 (Context := Unit) (X := fun _ => St) (Q := fun g => WordFrom Frag g)
(P := fun g => {p : WordFrom Frag g // p ∈ protocols g}) (Record := fun _ => Rc)
K Delta maint suff uses ∧
APFB03.B03TaskCost (Context := Unit) (D := fun g => {d : St → Bool // Delta g d})
(P := fun g => {p : WordFrom Frag g // p ∈ protocols g}) (R := fun _ => Finset Rc)
(Record := fun _ => Rc) wholeRes calibration maint suff uses ∧
APFB04.B04FiniteCapacity (Context := Unit) (fun g => ((C g : NNReal) : ℝ)) ∧
APFB05.MarginalFloor (Context := Unit) (D := fun g => {d : St → Bool // Delta g d})
(P := fun g => {p : WordFrom Frag g // p ∈ protocols g}) (R := fun _ => Finset Rc)
(Record := fun _ => Rc) wholeRes calibration maint suff uses (fun _ _ => True)
(fun g => ((C g : NNReal) : ℝ)) (fun _ => (1 : ℝ)) ∧
APFB06.AmendedB06_20260914 K
(fun g => APFB06.physicalDomain (K g) (Delta g) (hresp g)) protocols
(fun g => APFB06.extensionalJoint (maint g)
(fun p s t => suff g p s (APFB06.taskEquiv (K g) (Delta g) (hresp g) t))
(fun p t s => uses g p (APFB06.taskEquiv (K g) (Delta g) (hresp g) t) s))
wholeRes calibration C actualJointR ∧
APFB07a.A2Selection (Interface := Unit)
(Configuration := fun _ => APFB01.PhysicalState (K ()))
(fun _ s => s = APFB01.physicalClass (K ()) (true, true, false, false)) (fun _ _ => (1 : ℝ))
(fun _ => APFB01.physicalClass (K ()) (true, true, false, false)) ∧
APFB07b.BWUniqueMinimum (Interface := Unit)
(Configuration := fun _ => APFB01.PhysicalState (K ()))
(fun _ s => s = APFB01.physicalClass (K ()) (true, true, false, false)) (fun _ _ => (1 : ℝ))
/-! ### B02 with its second sentence -/
/-! ### The held-relation reading -/
/-! ### The record sentences, of every word -/
/-! ### What the sentences give here -/
/-! ### The places -/
/-! ### The two makings: each makes its own distinction read true, keeps its record, and moves the held place -/
/-- The making of dA, as a word. -/
def makeA : WordFrom Frag () := wd () [Fr.mk Rc.ra]
/-- The making of dR, as a word. -/
def makeR : WordFrom Frag () := wd () [Fr.mk Rc.rr]
/-! ### The turn: the held place moves round the circle, and no record is kept -/
/-- The turn word: the one fragment that gives the held place a quarter turn. -/
def turn : WordFrom Frag () := wd () [Fr.tn]
/-- Three turns, as a word: the reverse of the turn. -/
def turn3 : WordFrom Frag () := wd () [Fr.tn, Fr.tn, Fr.tn]
/-- What three turns do. -/
def turned3 : St → St := fun x => turned (turned (turned x))
/-! ### What a word does to a state -/
/-- What a list of fragments does to the state, in order. -/
def runAll : List Fr → St → St
| [], x => x
| f :: l, x => runAll l (act f x)
/-- How a distinction reads a state. -/
abbrev reads : Dist → St → Bool := fun d x => d.val x
end APFB06.CircleWorld