B9 — The APF–Laws of Form canonical enforcement bridge
ProvedAPFLawsOfForm.canonical_enforceability_bridgeFor a supplied APF physical interface and an exact registered-decoder realization of its ledger, the form ledger recovers the original primitive serving relation. Every finite form has a derivably equivalent representative of depth at most two using no new variables. The representative has the same readout on APF physical states, preserves whether it is an APF binary distinction, and preserves attainable joint prices, feasibility, every achievable budget, and infimal cost inside every finite companion request family. The statement does not identify logical depth with implementation cost or discharge physical completeness, calibration, or realization assumptions.
import Definitions.Def_APFLawsOfForm_Bridge set_option autoImplicit false open LawsOfForm APFPaper1.Foundation
namespace APFLawsOfForm
theorem canonical_enforceability_bridge {X Q D P : Type} [DecidableEq D]
(I : PhysicalInterface X Q D P) (g : Nat → D)
(M : DecoderSystem (PhysicalState I.profile) P) (hM : RealizesLedger I M) (e : Expr) :
(∀ S : Finset Nat, ∀ p, I.ledger.serves p (S.image g) ↔
(formLedger I.ledger M (interfaceReadouts I g)).serves p (atomicFamily S)) ∧
(∃ f : Expr, Algebra e f ∧ depth f ≤ 2 ∧ freeVars f ⊆ freeVars e ∧
denote (interfaceReadouts I g) e = denote (interfaceReadouts I g) f ∧
(Nonconstant (denote (interfaceReadouts I g) e) ↔ Nonconstant (denote (interfaceReadouts I g) f)) ∧
∀ F : Finset Expr,
costs (formLedger I.ledger M (interfaceReadouts I g)) (insert e F) =
costs (formLedger I.ledger M (interfaceReadouts I g)) (insert f F) ∧
(Feasible (formLedger I.ledger M (interfaceReadouts I g)) (insert e F) ↔
Feasible (formLedger I.ledger M (interfaceReadouts I g)) (insert f F)) ∧
(∀ b, WithinBudget (formLedger I.ledger M (interfaceReadouts I g)) (insert e F) b ↔
WithinBudget (formLedger I.ledger M (interfaceReadouts I g)) (insert f F) b) ∧
cost (formLedger I.ledger M (interfaceReadouts I g)) (insert e F) =
cost (formLedger I.ledger M (interfaceReadouts I g)) (insert f F)) := by sorry
end APFLawsOfForm
Read-back
What the Lean code literally says, in plain math · Codex (GPT-6)
For arbitrary types , with decidable equality on , let be an interface consisting of a function ; the state space , where means exactly ; an injective assignment to each of a binary distinction, meaning a function together with the assertion that there exist with ; and a ledger consisting of a price function , a predicate for and finite subsets , and a predicate . The interface and ledger are required to satisfy all of the following: for every ; if and , then ; if and , then ; some serves the empty set and has price zero; for every , some serves ; and for every , the real infimum of is strictly positive. Let be any function, without an injectivity assumption, and let consist, for every , of a type of records, a function , and a specified set of functions . Assume that for every and every finite , holds if and only if, for every , there exists a decoder such that for every ; the decoder may depend on and . Expressions are finite syntax trees generated by a blank symbol , variable symbols for , a unary constructor , and a binary constructor . For an expression , define its Boolean function recursively by , , , and . Define the depth by , , and ; define , , , and . Let be the least relation on expressions that is reflexive, symmetric and transitive, is preserved by , by replacing either argument of , and by every simultaneous substitution of arbitrary expressions for the variables (leaving fixed and commuting with both constructors), and contains, for all expressions , the relations , , , , and . For a finite set of expressions, write to mean that for each there exists a decoder satisfying for every ; these decoders may be chosen separately for different expressions. This is the serving predicate of the induced expression ledger, whose price is and whose carrying predicate for is the existence of such a decoder for . Write for its set of attainable prices, say that is feasible when , say that is within a real budget when , and set , using the total real infimum operation, which assigns zero to the empty set. Then, for every expression , both of the following hold: for every finite and every , if and only if ; and there exists an expression such that , , , as functions on all of , and if and only if , with the additional property that for every finite set of expressions, simultaneously , is feasible if and only if is feasible, for every real the set is within budget if and only if is within budget , and . The same chosen works for all and all ; its uniqueness is not asserted. Natural-number indices include zero, all finite sets may be empty, images and unions discard duplicates, and the insertions still mean ordinary set unions when or already belongs to . If , its decoder condition is vacuous, and the assumed equivalence for the original ledger forces every to serve the empty set; is likewise vacuous. The existence of makes nonempty, the binary distinction for forces at least two distinct states in and hence at least two elements of , and the zero-price empty-serving protocol makes nonempty; choices of the types and data that cannot satisfy these requirements do not give instances of the hypotheses. There is no requirement that the primitive readouts realize every Boolean assignment, that the registered decoder sets be closed under Boolean operations, or that be nonconstant, so the theorem includes blank expressions, expressions with no variables, and expressions whose Boolean functions are constant. The bound on depth counts nested unary constructors only and places no separate bound on the number of binary constructors or variable occurrences. Feasibility of the inserted expression sets is not assumed; if either has no serving protocol, both are infeasible, their attainable-price sets are empty, their assigned costs are zero, and neither is within any budget. All budgets, including zero and negative values, are quantified over, with negative budgets impossible to meet because prices are nonnegative; when attainable-price sets are nonempty, their nonnegative prices make their infima bounded below, but attainment of an infimum is not asserted.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.