Continuation identity, physical-interface commitments, and complete-protocol cost
DefinitionAPFPaper1_FoundationThe 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.
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
Read-back
What the Lean code literally says, in plain math · Codex (GPT-6)
Blind mathematical read-back
continuationSetoid. For arbitrary types and and an arbitrary function assigning a subset of to each element of , this declaration defines the equivalence relation on given by if and only if as sets, equivalently if and only if every belongs to exactly when it belongs to . 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 . If is empty, all elements of are equivalent; if is empty, the relation is empty.
PhysicalState. For arbitrary types and any function , this is the quotient type , where means as subsets of . Its elements are equivalence classes of elements of under exactly this relation; there are no additional elements representing subsets of outside the image of . If is empty, the quotient is empty. If is nonempty and is constant, the quotient has exactly one element; this includes the case where is empty and is nonempty.
physicalClass. For arbitrary types , an arbitrary function , and a specified element , this function returns the equivalence class in the quotient of by . Thus two inputs have the same returned class exactly when their assigned subsets are equal. The declaration requires the input ; there is no such input when is empty, although the function with empty domain is defined.
BinaryDistinction. For any type , an instance consists of a function together with the assertion that there exist with . Both Boolean values therefore occur, and the witnesses must be distinct. No such instance exists when is empty or has at most one element. No further property of the two fibers or their elements is imposed.
Ledger. For arbitrary types and , an instance consists of a real-valued function , a relation between and finite subsets , and a relation between and , with all of the following assertions: for every ; for every and finite , if and , then ; for every , if and , then ; and there exists with and . The final assertion forces to be nonempty, even if 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 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 , a ledger , and a finite subset , this defines the set . Here a ledger supplies , serving , and carrying , 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 , without multiplicity. It can be empty when no protocol serves , is contained in , and for contains . No minimum or positive price is required.
Feasible. For arbitrary types , a ledger , and a finite subset , this is the proposition . The ledger provides a nonnegative real price , serving downward closed under finite-set inclusion, carrying whenever belongs to a set served by , 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 , a ledger , and a finite subset , this defines the real number , where . 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 is served by some protocol, is nonempty and bounded below by zero, so is its ordinary real greatest lower bound, which need not be attained. If no protocol serves , the total real infimum operation used here gives . In particular, cost is a real number even for an infeasible set, and the empty set has cost zero.
PhysicalInterface. For arbitrary types , with decidable equality on , an instance consists of a function ; for every , a function with two quotient elements on which its values differ, where means ; an assertion that the assignment of these binary distinctions to elements of is injective; and a ledger with real prices , serving for finite , and carrying . The ledger must satisfy , , and existence of with and . In addition, for every some protocol serves , and , 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 . 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 is empty, the readout, injectivity, singleton feasibility, and positivity conditions are vacuous; must still be nonempty because of the ledger. If is nonempty, its nontrivial readouts force the quotient to have at least two elements, so an empty or a constant cannot satisfy the structure's conditions.
WithinBudget. For arbitrary types , a ledger , a finite subset , and any real , this is the proposition . 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 does not assert this existence. No nonnegativity assumption is placed on , but the proposition is false for . For the empty set it holds exactly when , and for an infeasible set it fails for every .
A1Capacity. For arbitrary types , a ledger , and any real , this is the conjunction and . The ledger supplies real prices , a serving relation on protocols and finite subsets of 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 , 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 to be nonempty, and the same condition applies even if is empty.
SupportNovel. For arbitrary types , a ledger , a finite subset , and , this is the proposition that there exists a real such that every satisfying both and satisfies . Here is the ledger's nonnegative real price, is its serving relation downward closed under finite-set inclusion, is its carrying relation with , and a zero-price protocol serves the empty set; is the infimum of , with empty infimum zero. The same positive applies to all protocols, and the cutoff includes equality. No feasibility condition and no explicit condition is part of this definition. If no protocol serves , the universal condition is vacuous and the proposition holds. If is feasible, its finite nonnegative infimum ensures that some serving protocol lies within every positive margin, and consequently the proposition cannot hold for . Protocols serving at larger prices are unrestricted with respect to carrying .
MarginalFloor. For arbitrary types , with an assumption that equality of elements of is decidable, a ledger , and any real , this is the conjunction of and the following assertion for every finite subset and every : if there exists a protocol serving , and if there exists a real such that every protocol serving with price at most does not carry , then . The ledger has nonnegative real prices , a serving relation 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; , with empty infimum zero. The same must work for all , including . Feasibility of forces feasibility of ; hence the difference in an active implication concerns two ordinary infima of nonempty price sets. Repeated insertion when 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 remains; this occurs in particular when is empty. No minimum-attaining protocol is required.
ComplexityMD. For any type , functions and , and any real , this is the conjunction and , where the natural number is converted to a real number in the product. Natural numbers include zero, but the asserted bound excludes zero for every existing . Both lower bounds are inclusive. No assumption on either function precedes this predicate; when it holds, each is at least and thus positive. If is empty, the universal assertion is vacuous and the predicate reduces to . There is no upper bound or required equality for either function.
A2Selection. For any type , any subset , any real-valued function , and a specified element , this is the conjunction and . 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 is empty the predicate is false; if is empty there is no possible specified argument . The comparison includes .
SpectrumNondegenerate. For any type and any function , this is the proposition . 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.