18.11: a phase plan is an offered pair and price, or an idle length.
The distinct-pair and positive-length conditions are stated in PlanValid.
Equations
- MindFormal.MarketReplay.Plan A Price = (MindFormal.Bilateral.Offer A Price ⊕ NNReal)
Instances For
18.11: the stored first act includes its phase-relative time and label. Absent acts stay absent; only the two parties' slots are retained in a phase.
Instances For
18.11: the phase's ordinary coordinates, before imposing the invariant that its deadline is still pending and the two first acts are not both present.
Equations
- MindFormal.MarketReplay.Phase A N Price = (MindFormal.MarketReplay.Plan A Price × NNReal × MindFormal.MarketReplay.Firsts A N)
Instances For
18.11: the memory coordinates are exactly the stream memory, ledger and outstanding/idle phase. There is no retained replay record or source path.
Equations
- MindFormal.MarketReplay.Memory M A N Price = (M × MindFormal.Bilateral.Ledger A × MindFormal.MarketReplay.Phase A N Price)
Instances For
18.11: the primitive phase length is the common offer deadline or the selected idle duration. An idle plan is not an offered encounter.
Equations
- MindFormal.MarketReplay.length deadline (Sum.inl val) = deadline
- MindFormal.MarketReplay.length deadline (Sum.inr idle) = idle
Instances For
18.11: primitive plans have distinct parties, or an idle interval between the declared minimum and deadline, as required by the completion menu. This is data validation, not a restart or a market composition premise.
Equations
- MindFormal.MarketReplay.PlanValid deadline minimum (Sum.inl val) = (val.1 ≠ val.2.1)
- MindFormal.MarketReplay.PlanValid deadline minimum (Sum.inr idle) = (minimum ≤ idle ∧ idle ≤ deadline)
Instances For
18.11: ordinary phase memories have a pending deadline, phase-relative first acts at or before their age, and no already-completed pair.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decode the first occupied record slot as a timed label, leaving an absent slot absent. Valid chronological records have nonnegative times.
Equations
Instances For
At a valid join the first slot is the past's first slot, if present, otherwise the future's first slot translated by the cut.
A previously collected first act stays fixed. Otherwise the first new act is translated from elapsed time into the phase's own age coordinate.
Equations
- MindFormal.MarketReplay.collect age old h = old.or (Option.map (fun (q : NNReal × C) => (age + q.1, q.2)) (MindFormal.MarketReplay.firstSlot h))
Instances For
18.11: record the parties' first acts and advance phase age, without settling. Callers use the record closed at the elapsed time in this read.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Collecting across a valid cut preserves the original first act and its phase-relative time, including an act exactly at the cut.
Observation of phase coordinates composes across the same cut-valid records as the stream. No restart is assumed.
A party already collected needs no elapsed time. A missing first act uses its next record slot, capped at the remaining deadline; absence times out.
Equations
Instances For
A party already completing by the cut has the same capped end on the joined record. Later acts cannot replace its first act.
A party's capped end after joining, clipped below at the cut, is the cut plus its residual end from the observed phase.
A party unfinished at the cut is still unfinished at the cut on the joined record: future acts are strictly after zero.
18.11: the phase ends when both first acts have arrived or its deadline expires. Idle ends at its remaining duration and has no parties.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A valid plan has positive length, from the two primitive positive durations; this is not a positive pause between successive acts.
The primitive step-end rule starts a valid phase whenever it returns a valid plan. No earlier first act is carried into the new offer.
Every party's completion is capped by the remaining deadline.
A phase ending by the cut ends at the identical time on the joined record. This includes timeout and an act exactly at the cut.
If the cut precedes the phase end, the joined end is the cut plus the end read from the observed phase and the future's own record.
With no new acts, an unfinished valid phase ends at its remaining deadline. In particular its end is strictly positive.
Observing no elapsed time and no acts preserves every valid phase coordinate, including a stored first act and absent bystander slots.
A decoded first act in a closed record is no later than its cut, including arbitrary nonchronological input codes.
A retained first act stays within the advanced phase age.
If a previously missing first act has been collected by the cut, that party's capped end on the original record is at or before the cut.
Before a phase's end, observing the closed prefix preserves the phase invariant. The proof works for every input code, not only native records.
A stored first act is exposed to the existing bilateral ledger as one timed occupied slot; absent acts produce the existing empty record.
Equations
- MindFormal.MarketReplay.firstHistory none = MindFormal.emptyHistory C
- MindFormal.MarketReplay.firstHistory (some q) = ⟨fun (k : ℕ) => if k = 0 then (↑q.1, Sum.inl q.2) else MindFormal.emptyActionSlot C, ⋯⟩
Instances For
18.11: settlement is the existing physical ledger operation on the collected first acts. Idle phases leave the ledger for the stream's own packets.
Equations
- One or more equations did not get rendered due to their size.
Instances For
18.11: one chronological replay with a finite recursion budget. At each phase end the stream is advanced on the closed record, settlement is computed, and the primitive jump selects the next fresh phase. The zero-budget branch is a total fallback. The lemmas below prove sufficient fuel, phase validity and composition for the constructed market advance.
Equations
- One or more equations did not get rendered due to their size.
- MindFormal.MarketReplay.replayFuel stream deadline price accept jump 0 x✝³ x✝² x✝¹ x✝ = x✝³
Instances For
Every finite replay level preserves the phase invariant, including the total zero-fuel branch. The jump only supplies the next primitive plan.
An unfinished party completing before the remaining deadline has an occupied first slot in the closed record at completion.
Ending a valid phase before its timeout consumes at least one act. It cannot be an idle phase, or a pair whose two acts were both stored already.
The replay's decreasing natural potential counts remaining acts, full minimum intervals, and a possibly already-aged first phase.
Equations
Instances For
At every completed valid phase the potential strictly decreases on the rebased record and the fresh phase returned by the rule.
18.11: the finite replay budget counts all input acts and positive-length timeout/idle intervals. potential_le_budget and replayFuel_stable below prove its adequacy from primitive data.
Equations
- MindFormal.MarketReplay.budget deadline minimum t history = 2 * (∑ a : A, MindFormal.RetainedClock.nextIndex (history a) + ⌈↑t / min ↑deadline ↑minimum⌉₊) + 3
Instances For
18.11: the chronological market advance from primitive data. Its proved laws below construct the homogeneous world in MarketWorld.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The computed budget dominates the phase-dependent potential.
Every fuel at least the potential computes exactly the same replay. This proves adequacy without assuming termination or composition.
The replay's equation before the next phase end has no fuel.
The computed post-settlement memory: advance the stream on the closed record, settle the physical ledger, then apply its primitive rule.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The replay's equation at or after a phase end has no fuel.
The replay's output belongs to the required valid-phase memory type for every record and every source path.
18.11: the constructed replay composes at every cut-valid cut, including a cut inside an offer or idle phase. All sources are arbitrary; the proof uses the stream's existing law and the proved finite budget.
The replay has the class's zero-time law on valid phases and sources starting at zero. No chronological restriction is needed on the empty record.
The stream's existing prefix law also removes a truncation later than the current read. This is an algebraic consequence of that law.
Every fuel level reads only the source prefix up to elapsed time. The recursive shift uses exactly the remaining truncation.
The computed budget reads no source, so the full replay has the class's source-prefix law on every record.
18.11: the exact composition obligation for the computed replay.
All antecedents are primitive positive lengths, valid next plans, ordinary
phase memories and the class's cut-valid input records. It is proved by
compositionObligation, never supplied as a construction hypothesis.
Equations
- One or more equations did not get rendered due to their size.
Instances For
18.11: L24b's exact composition obligation, with only L24c's permitted idle upper bound, follows from the constructed replay's proved equations.