Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Continuation identity, physical-interface commitments, and complete-protocol cost

Definition
APFPaper1_Foundation

by FiniteUniverse · Sep 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

apffoundationsorder-theory

The foundation interface separates declarations from consequences. A supplied profile maps raw configurations to arbitrary sets of observation labels; equality of the entire profile defines an equivalence relation and its quotient. A binary distinction is a Boolean predicate on a state type taking both values. A ledger has nonnegative real protocol prices, a serving relation closed under subfamily restriction, a separate carrying relation, and an existing zero-price empty protocol. Serving a demand implies carrying it, but the converse and composition rules are not assumed. Feasibility means that a serving protocol exists; joint cost is the infimum of all serving prices. A PhysicalInterface links distinct demand labels injectively to nontrivial binary predicates on the profile quotient, supplies a ledger, and requires every singleton demand to be feasible and have positive infimal cost. These are supplied commitments, not derived facts about nature. It does not guarantee joint feasibility of arbitrary families, robust physical enforcement, complete profiles, or complete physical pricing. The generic cost theorems use a ledger without requiring this stronger interface. A1Capacity bounds all protocol prices by a nonnegative real C; real-valued C builds finiteness into the chosen regime. WithinBudget requires an actual serving protocol at price at most the budget. SupportNovel requires one positive near-optimality window in which every serving protocol lacks sufficient records for the added demand. MarginalFloor requires a positive uniform bound on every feasible novel cost increment. ComplexityMD separately specifies a positive minimum-test-scaled lower bound for a supplied test-count function with counts at least one; the meaning of that function as minimum independent test complexity is a separate modeling obligation. A2Selection and SpectrumNondegenerate are named predicates, not assumed facts. No finiteness of the full configuration or protocol types, attained infimum, cost isotropy, or physical outcome selection is asserted. Real infimum defaults to zero for infeasible targets; all cost theorems explicitly guard that case. SupportNovel can be vacuous for infeasible prefixes, which the theorem hypotheses exclude.

Definition code
import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Data.Finset.Insert
import Mathlib.Algebra.BigOperators.Group.Finset.Basic

namespace APFPaper1.Foundation

def continuationSetoid {X Q : Type*} (profile : X → Set Q) : Setoid X where
  r x y := profile x = profile y
  iseqv := ⟨fun _ => rfl, fun h => h.symm, fun h k => h.trans k⟩

def PhysicalState {X Q : Type*} (profile : X → Set Q) :=
  Quotient (continuationSetoid profile)

def physicalClass {X Q : Type*} (profile : X → Set Q) (x : X) :
    PhysicalState profile := Quotient.mk _ x

structure BinaryDistinction (Ω : Type*) where
  readout : Ω → Bool
  nontrivial : ∃ x y, readout x ≠ readout y

structure Ledger (D P : Type*) where
  price : P → ℝ
  price_nonneg : ∀ p, 0 ≤ price p
  serves : P → Finset D → Prop
  serves_mono : ∀ p S T, S ⊆ T → serves p T → serves p S
  carries : P → D → Prop
  carries_of_serves : ∀ p S d, serves p S → d ∈ S → carries p d
  empty_protocol : ∃ p, serves p ∅ ∧ price p = 0

def costs {D P : Type*} (L : Ledger D P) (S : Finset D) : Set ℝ :=
  {c | ∃ p, L.serves p S ∧ L.price p = c}

def Feasible {D P : Type*} (L : Ledger D P) (S : Finset D) : Prop :=
  ∃ p, L.serves p S

noncomputable def cost {D P : Type*} (L : Ledger D P) (S : Finset D) : ℝ :=
  sInf (costs L S)

structure PhysicalInterface (X Q D P : Type*) [DecidableEq D] where
  profile : X → Set Q
  distinction : D → BinaryDistinction (PhysicalState profile)
  distinction_injective : Function.Injective distinction
  ledger : Ledger D P
  individually_feasible : ∀ d, Feasible ledger {d}
  positive_distinction_cost : ∀ d, 0 < cost ledger {d}

def WithinBudget {D P : Type*} (L : Ledger D P) (S : Finset D) (b : ℝ) : Prop :=
  ∃ p, L.serves p S ∧ L.price p ≤ b

def A1Capacity {D P : Type*} (L : Ledger D P) (C : ℝ) : Prop :=
  0 ≤ C ∧ ∀ p, L.price p ≤ C

def SupportNovel {D P : Type*} (L : Ledger D P) (S : Finset D) (d : D) : Prop :=
  ∃ η : ℝ, 0 < η ∧ ∀ p, L.serves p S → L.price p ≤ cost L S + η → ¬ L.carries p d

def MarginalFloor {D P : Type*} [DecidableEq D] (L : Ledger D P) (ε : ℝ) : Prop :=
  0 < ε ∧ ∀ S d, Feasible L (insert d S) → SupportNovel L S d →
    ε ≤ cost L (insert d S) - cost L S

def ComplexityMD {D : Type*} (distinctionCost : D → ℝ) (tests : D → ℕ)
    (μ : ℝ) : Prop :=
  0 < μ ∧ ∀ d, 1 ≤ tests d ∧ μ * (tests d : ℝ) ≤ distinctionCost d

def A2Selection {A : Type*} (admissible : Set A) (price : A → ℝ) (actual : A) : Prop :=
  actual ∈ admissible ∧ ∀ a ∈ admissible, price actual ≤ price a

def SpectrumNondegenerate {D : Type*} (distinctionCost : D → ℝ) : Prop :=
  ∃ d e, distinctionCost d ≠ distinctionCost e

end APFPaper1.Foundation
Source
Paper 1 Technical Supplement v9.23, primitive spine, sec:admissible-possibility-spaces, rem:ledger-valuation-convention, def:record-support-rank, def:MD, and line 986 graded A2/BW status; https://doi.org/10.5281/zenodo.19714957. APF Astra Session 2026-09-05/06 audit package, INPUT_LEDGER.md F01-F12 and D01-D09; local research prop:budget. PhysicalInterface is an explicit packaging of the supplied commitments; it is not a theorem of physical enforcement.
Read-back

What the Lean code literally says, in plain math · Codex (GPT-6)

Blind mathematical read-back

continuationSetoid. For arbitrary types XXX and QQQ and an arbitrary function F:X→P(Q)F:X\to\mathcal P(Q)F:X→P(Q) assigning a subset of QQQ to each element of XXX, this declaration defines the equivalence relation on XXX given by x∼yx\sim yx∼y if and only if F(x)=F(y)F(x)=F(y)F(x)=F(y) as sets, equivalently if and only if every q∈Qq\in Qq∈Q belongs to F(x)F(x)F(x) exactly when it belongs to F(y)F(y)F(y). Reflexivity, symmetry, and transitivity are supplied by the corresponding properties of equality. Neither type is required to be nonempty, and no restriction is imposed on FFF. If QQQ is empty, all elements of XXX are equivalent; if XXX is empty, the relation is empty.

PhysicalState. For arbitrary types X,QX,QX,Q and any function F:X→P(Q)F:X\to\mathcal P(Q)F:X→P(Q), this is the quotient type X/∼X/{\sim}X/∼, where x∼yx\sim yx∼y means F(x)=F(y)F(x)=F(y)F(x)=F(y) as subsets of QQQ. Its elements are equivalence classes of elements of XXX under exactly this relation; there are no additional elements representing subsets of QQQ outside the image of FFF. If XXX is empty, the quotient is empty. If XXX is nonempty and FFF is constant, the quotient has exactly one element; this includes the case where QQQ is empty and XXX is nonempty.

physicalClass. For arbitrary types X,QX,QX,Q, an arbitrary function F:X→P(Q)F:X\to\mathcal P(Q)F:X→P(Q), and a specified element x∈Xx\in Xx∈X, this function returns the equivalence class [x][x][x] in the quotient of XXX by u∼v  ⟺  F(u)=F(v)u\sim v\iff F(u)=F(v)u∼v⟺F(u)=F(v). Thus two inputs have the same returned class exactly when their assigned subsets are equal. The declaration requires the input xxx; there is no such input when XXX is empty, although the function with empty domain is defined.

BinaryDistinction. For any type Ω\OmegaΩ, an instance consists of a function r:Ω→{false,true}r:\Omega\to\{\mathrm{false},\mathrm{true}\}r:Ω→{false,true} together with the assertion that there exist x,y∈Ωx,y\in\Omegax,y∈Ω with r(x)≠r(y)r(x)\ne r(y)r(x)=r(y). Both Boolean values therefore occur, and the witnesses must be distinct. No such instance exists when Ω\OmegaΩ is empty or has at most one element. No further property of the two fibers or their elements is imposed.

Ledger. For arbitrary types DDD and PPP, an instance consists of a real-valued function c:P→Rc:P\to\mathbb Rc:P→R, a relation R(p,S)R(p,S)R(p,S) between p∈Pp\in Pp∈P and finite subsets S⊆DS\subseteq DS⊆D, and a relation K(p,d)K(p,d)K(p,d) between p∈Pp\in Pp∈P and d∈Dd\in Dd∈D, with all of the following assertions: c(p)≥0c(p)\ge0c(p)≥0 for every ppp; for every ppp and finite S,TS,TS,T, if S⊆TS\subseteq TS⊆T and R(p,T)R(p,T)R(p,T), then R(p,S)R(p,S)R(p,S); for every p,S,dp,S,dp,S,d, if R(p,S)R(p,S)R(p,S) and d∈Sd\in Sd∈S, then K(p,d)K(p,d)K(p,d); and there exists p∈Pp\in Pp∈P with R(p,∅)R(p,\varnothing)R(p,∅) and c(p)=0c(p)=0c(p)=0. The final assertion forces PPP to be nonempty, even if DDD is empty. The converse from carrying elements to serving a set is not required, serving any nonempty set is not required, and carrying elements outside a served set is permitted. A given ppp need not serve even the empty set unless some stated condition forces it to do so. There is no required rule combining protocols or combining served sets.

costs. For arbitrary types D,PD,PD,P, a ledger LLL, and a finite subset S⊆DS\subseteq DS⊆D, this defines the set CL(S)={t∈R∣∃p∈P, R(p,S) and c(p)=t}C_L(S)=\{t\in\mathbb R\mid\exists p\in P,\ R(p,S)\text{ and }c(p)=t\}CL​(S)={t∈R∣∃p∈P, R(p,S) and c(p)=t}. Here a ledger supplies c:P→Rc:P\to\mathbb Rc:P→R, serving R(p,T)R(p,T)R(p,T), and carrying K(p,d)K(p,d)K(p,d), subject to nonnegative prices, downward closure of serving under finite-set inclusion, carrying every element of each served set, and existence of a zero-price protocol serving the empty set. This set contains precisely the prices of protocols serving SSS, without multiplicity. It can be empty when no protocol serves SSS, is contained in [0,∞)[0,\infty)[0,∞), and for S=∅S=\varnothingS=∅ contains 000. No minimum or positive price is required.

Feasible. For arbitrary types D,PD,PD,P, a ledger LLL, and a finite subset S⊆DS\subseteq DS⊆D, this is the proposition ∃p∈P, R(p,S)\exists p\in P,\ R(p,S)∃p∈P, R(p,S). The ledger provides a nonnegative real price c(p)c(p)c(p), serving R(p,T)R(p,T)R(p,T) downward closed under finite-set inclusion, carrying K(p,d)K(p,d)K(p,d) whenever ddd belongs to a set served by ppp, and a protocol serving the empty set at price zero. Feasibility requires only a serving protocol, with no price bound or uniqueness. It always holds for the empty set and need not hold for any nonempty set.

cost. For arbitrary types D,PD,PD,P, a ledger LLL, and a finite subset S⊆DS\subseteq DS⊆D, this defines the real number κL(S)=inf⁡CL(S)\kappa_L(S)=\inf C_L(S)κL​(S)=infCL​(S), where CL(S)={c(p)∣p∈P, R(p,S)}C_L(S)=\{c(p)\mid p\in P,\ R(p,S)\}CL​(S)={c(p)∣p∈P, R(p,S)}. The ledger has real nonnegative prices, serving downward closed under finite-set inclusion, a carrying relation containing every element of each served set, and a zero-price protocol serving the empty set. If SSS is served by some protocol, CL(S)C_L(S)CL​(S) is nonempty and bounded below by zero, so κL(S)\kappa_L(S)κL​(S) is its ordinary real greatest lower bound, which need not be attained. If no protocol serves SSS, the total real infimum operation used here gives inf⁡∅=0\inf\varnothing=0inf∅=0. In particular, cost is a real number even for an infeasible set, and the empty set has cost zero.

PhysicalInterface. For arbitrary types X,Q,D,PX,Q,D,PX,Q,D,P, with decidable equality on DDD, an instance consists of a function F:X→P(Q)F:X\to\mathcal P(Q)F:X→P(Q); for every d∈Dd\in Dd∈D, a function rd:X/∼→{false,true}r_d:X/{\sim}\to\{\mathrm{false},\mathrm{true}\}rd​:X/∼→{false,true} with two quotient elements on which its values differ, where x∼yx\sim yx∼y means F(x)=F(y)F(x)=F(y)F(x)=F(y); an assertion that the assignment of these binary distinctions to elements of DDD is injective; and a ledger with real prices c(p)≥0c(p)\ge0c(p)≥0, serving R(p,S)R(p,S)R(p,S) for finite S⊆DS\subseteq DS⊆D, and carrying K(p,d)K(p,d)K(p,d). The ledger must satisfy S⊆T∧R(p,T)⇒R(p,S)S\subseteq T\land R(p,T)\Rightarrow R(p,S)S⊆T∧R(p,T)⇒R(p,S), R(p,S)∧d∈S⇒K(p,d)R(p,S)\land d\in S\Rightarrow K(p,d)R(p,S)∧d∈S⇒K(p,d), and existence of ppp with R(p,∅)R(p,\varnothing)R(p,∅) and c(p)=0c(p)=0c(p)=0. In addition, for every d∈Dd\in Dd∈D some protocol serves {d}\{d\}{d}, and inf⁡{c(p)∣R(p,{d})}>0\inf\{c(p)\mid R(p,\{d\})\}>0inf{c(p)∣R(p,{d})}>0, using the total real infimum whose empty-set value is zero. The injectivity assertion means that equality of assigned binary distinctions implies equality of their indices; because the additional nontriviality field is a proof, this equivalently says rd=re⇒d=er_d=r_e\Rightarrow d=erd​=re​⇒d=e. Each singleton price set is nonempty and has a strictly positive lower bound, but its infimum need not be attained, and there is no asserted common positive lower bound for all singletons. The readouts need not distinguish every pair of quotient elements, and the carrying and serving relations have no additional required connection to the values of these readouts. Feasibility of sets with two or more elements is not required. If DDD is empty, the readout, injectivity, singleton feasibility, and positivity conditions are vacuous; PPP must still be nonempty because of the ledger. If DDD is nonempty, its nontrivial readouts force the quotient to have at least two elements, so an empty XXX or a constant FFF cannot satisfy the structure's conditions.

WithinBudget. For arbitrary types D,PD,PD,P, a ledger LLL, a finite subset S⊆DS\subseteq DS⊆D, and any real bbb, this is the proposition ∃p∈P, R(p,S)∧c(p)≤b\exists p\in P,\ R(p,S)\land c(p)\le b∃p∈P, R(p,S)∧c(p)≤b. The ledger supplies nonnegative real prices, serving downward closed under finite-set inclusion, carrying every element of each served set, and a zero-price protocol serving the empty set. The bound is inclusive and must be met by an actual serving protocol; a mere infimum of serving prices at most bbb does not assert this existence. No nonnegativity assumption is placed on bbb, but the proposition is false for b<0b<0b<0. For the empty set it holds exactly when b≥0b\ge0b≥0, and for an infeasible set it fails for every bbb.

A1Capacity. For arbitrary types D,PD,PD,P, a ledger LLL, and any real CCC, this is the conjunction C≥0C\ge0C≥0 and ∀p∈P, c(p)≤C\forall p\in P,\ c(p)\le C∀p∈P, c(p)≤C. The ledger supplies real prices c(p)≥0c(p)\ge0c(p)≥0, a serving relation on protocols and finite subsets of DDD that is downward closed under inclusion, a carrying relation containing every element of each served set, and a protocol serving the empty set at price zero. The upper bound applies to every protocol, including protocols that serve no set. It does not assert that some protocol has price exactly CCC, and it does not refer to a sum of prices or restrict the number of protocols. Zero capacity is allowed and forces every price to be zero; negative capacity makes the predicate false. The ledger forces PPP to be nonempty, and the same condition applies even if DDD is empty.

SupportNovel. For arbitrary types D,PD,PD,P, a ledger LLL, a finite subset S⊆DS\subseteq DS⊆D, and d∈Dd\in Dd∈D, this is the proposition that there exists a real η>0\eta>0η>0 such that every p∈Pp\in Pp∈P satisfying both R(p,S)R(p,S)R(p,S) and c(p)≤κL(S)+ηc(p)\le\kappa_L(S)+\etac(p)≤κL​(S)+η satisfies ¬K(p,d)\neg K(p,d)¬K(p,d). Here ccc is the ledger's nonnegative real price, RRR is its serving relation downward closed under finite-set inclusion, KKK is its carrying relation with R(p,T)∧e∈T⇒K(p,e)R(p,T)\land e\in T\Rightarrow K(p,e)R(p,T)∧e∈T⇒K(p,e), and a zero-price protocol serves the empty set; κL(S)\kappa_L(S)κL​(S) is the infimum of {c(p)∣R(p,S)}\{c(p)\mid R(p,S)\}{c(p)∣R(p,S)}, with empty infimum zero. The same positive η\etaη applies to all protocols, and the cutoff includes equality. No feasibility condition and no explicit condition d∉Sd\notin Sd∈/S is part of this definition. If no protocol serves SSS, the universal condition is vacuous and the proposition holds. If SSS is feasible, its finite nonnegative infimum ensures that some serving protocol lies within every positive margin, and consequently the proposition cannot hold for d∈Sd\in Sd∈S. Protocols serving SSS at larger prices are unrestricted with respect to carrying ddd.

MarginalFloor. For arbitrary types D,PD,PD,P, with an assumption that equality of elements of DDD is decidable, a ledger LLL, and any real ε\varepsilonε, this is the conjunction of ε>0\varepsilon>0ε>0 and the following assertion for every finite subset S⊆DS\subseteq DS⊆D and every d∈Dd\in Dd∈D: if there exists a protocol serving S∪{d}S\cup\{d\}S∪{d}, and if there exists a real η>0\eta>0η>0 such that every protocol serving SSS with price at most κL(S)+η\kappa_L(S)+\etaκL​(S)+η does not carry ddd, then ε≤κL(S∪{d})−κL(S)\varepsilon\le\kappa_L(S\cup\{d\})-\kappa_L(S)ε≤κL​(S∪{d})−κL​(S). The ledger has nonnegative real prices c(p)c(p)c(p), a serving relation R(p,T)R(p,T)R(p,T) downward closed under finite-set inclusion, a carrying relation K(p,e)K(p,e)K(p,e) containing every element of each served set, and a zero-price protocol serving the empty set; κL(T)=inf⁡{c(p)∣R(p,T)}\kappa_L(T)=\inf\{c(p)\mid R(p,T)\}κL​(T)=inf{c(p)∣R(p,T)}, with empty infimum zero. The same ε\varepsilonε must work for all S,dS,dS,d, including S=∅S=\varnothingS=∅. Feasibility of S∪{d}S\cup\{d\}S∪{d} forces feasibility of SSS; hence the difference in an active implication concerns two ordinary infima of nonempty price sets. Repeated insertion when d∈Sd\in Sd∈S is included in the quantification, but the positive-margin noncarrying hypothesis then cannot hold. If no pair satisfies both antecedents, the universal implication is vacuous and only ε>0\varepsilon>0ε>0 remains; this occurs in particular when DDD is empty. No minimum-attaining protocol is required.

ComplexityMD. For any type DDD, functions a:D→Ra:D\to\mathbb Ra:D→R and n:D→Nn:D\to\mathbb Nn:D→N, and any real μ\muμ, this is the conjunction μ>0\mu>0μ>0 and ∀d∈D, 1≤n(d)∧μ n(d)≤a(d)\forall d\in D,\ 1\le n(d)\land\mu\,n(d)\le a(d)∀d∈D, 1≤n(d)∧μn(d)≤a(d), where the natural number n(d)n(d)n(d) is converted to a real number in the product. Natural numbers include zero, but the asserted bound excludes zero for every existing ddd. Both lower bounds are inclusive. No assumption on either function precedes this predicate; when it holds, each a(d)a(d)a(d) is at least μ\muμ and thus positive. If DDD is empty, the universal assertion is vacuous and the predicate reduces to μ>0\mu>0μ>0. There is no upper bound or required equality for either function.

A2Selection. For any type AAA, any subset E⊆AE\subseteq AE⊆A, any real-valued function c:A→Rc:A\to\mathbb Rc:A→R, and a specified element a∗∈Aa_*\in Aa∗​∈A, this is the conjunction a∗∈Ea_*\in Ea∗​∈E and ∀a∈E, c(a∗)≤c(a)\forall a\in E,\ c(a_*)\le c(a)∀a∈E, c(a∗​)≤c(a). Thus the specified element belongs to the subset and attains a least value of the given function on that subset. The prices may be negative, equal prices and multiple minimizing elements are permitted, and no existence assertion for such an element is made independently of this predicate. If EEE is empty the predicate is false; if AAA is empty there is no possible specified argument a∗a_*a∗​. The comparison includes a=a∗a=a_*a=a∗​.

SpectrumNondegenerate. For any type DDD and any function a:D→Ra:D\to\mathbb Ra:D→R, this is the proposition ∃d,e∈D, a(d)≠a(e)\exists d,e\in D,\ a(d)\ne a(e)∃d,e∈D, a(d)=a(e). The witnesses necessarily are distinct, so the proposition is false for an empty type or a type with at most one element, and also for any constant function. There is no sign condition, ordering requirement between the two values, quantitative separation, or uniqueness of witnesses.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me