Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

B9 — The APF–Laws of Form canonical enforcement bridge

Proved
APFLawsOfForm.canonical_enforceability_bridge

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

apfboolean-readoutsenforcement-costslaws-of-form

For 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.

Preamble
import Definitions.Def_APFLawsOfForm_Bridge

set_option autoImplicit false
open LawsOfForm APFPaper1.Foundation
Formal statement
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
Source
APF project with Codex, APF–Laws of Form: Distinctions, Continuations, and Enforcement Costs, project technical note version 1, 7 September 2026, SOURCE.md. Newly stated project synthesis, not a theorem attributed to the source book or APF supplement. Source SHA-256 245df96046094e878a79e7b95eb1dc2e2e534c5b4ef07111803d9b1cf0992f03. Statement B9: Let I, g, and M be as in B6 and assume RealizesLedger I M. The form ledger recovers original service for every finite primitive family and every protocol. For every form e there exists a form f with Algebra e f, syntactic depth at most two, and no variables outside those of e. The interpreted readouts on the actual APF quotient are equal, and they are nonconstant under exactly the same condition. One such f works for every finite companion request family F: replacing e by f preserves the attainable price set, feasibility, every achievable real budget, and the real cost infimum. There is no decoder closure assumption in this capstone; closure is needed for the separate constructive service guarantee B8.
Read-back

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

For arbitrary types X,Q,D,PX,Q,D,PX,Q,D,P, with decidable equality on DDD, let III be an interface consisting of a function π:X→P(Q)\pi:X\to\mathcal P(Q)π:X→P(Q); the state space Ω=X/∼\Omega=X/{\sim}Ω=X/∼, where x∼yx\sim yx∼y means exactly π(x)=π(y)\pi(x)=\pi(y)π(x)=π(y); an injective assignment to each d∈Dd\in Dd∈D of a binary distinction, meaning a function rd:Ω→{false,true}r_d:\Omega\to\{\mathrm{false},\mathrm{true}\}rd​:Ω→{false,true} together with the assertion that there exist u,v∈Ωu,v\in\Omegau,v∈Ω with rd(u)≠rd(v)r_d(u)\ne r_d(v)rd​(u)=rd​(v); and a ledger consisting of a price function c:P→Rc:P\to\mathbb Rc:P→R, a predicate serves⁡(p,T)\operatorname{serves}(p,T)serves(p,T) for p∈Pp\in Pp∈P and finite subsets T⊆DT\subseteq DT⊆D, and a predicate carries⁡(p,d)\operatorname{carries}(p,d)carries(p,d). The interface and ledger are required to satisfy all of the following: c(p)≥0c(p)\ge0c(p)≥0 for every ppp; if T⊆UT\subseteq UT⊆U and serves⁡(p,U)\operatorname{serves}(p,U)serves(p,U), then serves⁡(p,T)\operatorname{serves}(p,T)serves(p,T); if serves⁡(p,T)\operatorname{serves}(p,T)serves(p,T) and d∈Td\in Td∈T, then carries⁡(p,d)\operatorname{carries}(p,d)carries(p,d); some ppp serves the empty set and has price zero; for every ddd, some ppp serves {d}\{d\}{d}; and for every ddd, the real infimum of {c(p):serves⁡(p,{d})}\{c(p):\operatorname{serves}(p,\{d\})\}{c(p):serves(p,{d})} is strictly positive. Let g:N→Dg:\mathbb N\to Dg:N→D be any function, without an injectivity assumption, and let MMM consist, for every p∈Pp\in Pp∈P, of a type RpR_pRp​ of records, a function ρp:Ω→Rp\rho_p:\Omega\to R_pρp​:Ω→Rp​, and a specified set Dp\mathcal D_pDp​ of functions Rp→{false,true}R_p\to\{\mathrm{false},\mathrm{true}\}Rp​→{false,true}. Assume that for every p∈Pp\in Pp∈P and every finite T⊆DT\subseteq DT⊆D, serves⁡(p,T)\operatorname{serves}(p,T)serves(p,T) holds if and only if, for every d∈Td\in Td∈T, there exists a decoder δ∈Dp\delta\in\mathcal D_pδ∈Dp​ such that δ(ρp(u))=rd(u)\delta(\rho_p(u))=r_d(u)δ(ρp​(u))=rd​(u) for every u∈Ωu\in\Omegau∈Ω; the decoder may depend on ppp and ddd. Expressions are finite syntax trees generated by a blank symbol 000, variable symbols vnv_nvn​ for n∈Nn\in\mathbb Nn∈N, a unary constructor C(a)C(a)C(a), and a binary constructor a⊕ba\oplus ba⊕b. For an expression aaa, define its Boolean function Ea:Ω→{false,true}E_a:\Omega\to\{\mathrm{false},\mathrm{true}\}Ea​:Ω→{false,true} recursively by E0(u)=falseE_0(u)=\mathrm{false}E0​(u)=false, Evn(u)=rg(n)(u)E_{v_n}(u)=r_{g(n)}(u)Evn​​(u)=rg(n)​(u), EC(a)(u)=¬Ea(u)E_{C(a)}(u)=\neg E_a(u)EC(a)​(u)=¬Ea​(u), and Ea⊕b(u)=Ea(u)∨Eb(u)E_{a\oplus b}(u)=E_a(u)\lor E_b(u)Ea⊕b​(u)=Ea​(u)∨Eb​(u). Define the depth by depth⁡(0)=depth⁡(vn)=0\operatorname{depth}(0)=\operatorname{depth}(v_n)=0depth(0)=depth(vn​)=0, depth⁡(C(a))=depth⁡(a)+1\operatorname{depth}(C(a))=\operatorname{depth}(a)+1depth(C(a))=depth(a)+1, and depth⁡(a⊕b)=max⁡(depth⁡(a),depth⁡(b))\operatorname{depth}(a\oplus b)=\max(\operatorname{depth}(a),\operatorname{depth}(b))depth(a⊕b)=max(depth(a),depth(b)); define V(0)=∅V(0)=\varnothingV(0)=∅, V(vn)={n}V(v_n)=\{n\}V(vn​)={n}, V(C(a))=V(a)V(C(a))=V(a)V(C(a))=V(a), and V(a⊕b)=V(a)∪V(b)V(a\oplus b)=V(a)\cup V(b)V(a⊕b)=V(a)∪V(b). Let ≈\mathrel{\approx}≈ be the least relation on expressions that is reflexive, symmetric and transitive, is preserved by CCC, by replacing either argument of ⊕\oplus⊕, and by every simultaneous substitution of arbitrary expressions for the variables (leaving 000 fixed and commuting with both constructors), and contains, for all expressions a,b,ta,b,ta,b,t, the relations (a⊕b)⊕t≈a⊕(b⊕t)(a\oplus b)\oplus t\approx a\oplus(b\oplus t)(a⊕b)⊕t≈a⊕(b⊕t), a⊕b≈b⊕aa\oplus b\approx b\oplus aa⊕b≈b⊕a, 0⊕a≈a0\oplus a\approx a0⊕a≈a, C(C(a)⊕a)≈0C(C(a)\oplus a)\approx0C(C(a)⊕a)≈0, and C(C(a⊕t)⊕C(b⊕t))≈C(C(a)⊕C(b))⊕tC(C(a\oplus t)\oplus C(b\oplus t))\approx C(C(a)\oplus C(b))\oplus tC(C(a⊕t)⊕C(b⊕t))≈C(C(a)⊕C(b))⊕t. For a finite set HHH of expressions, write J(p,H)J(p,H)J(p,H) to mean that for each a∈Ha\in Ha∈H there exists a decoder δ∈Dp\delta\in\mathcal D_pδ∈Dp​ satisfying δ(ρp(u))=Ea(u)\delta(\rho_p(u))=E_a(u)δ(ρp​(u))=Ea​(u) for every u∈Ωu\in\Omegau∈Ω; these decoders may be chosen separately for different expressions. This is the serving predicate of the induced expression ledger, whose price is c(p)c(p)c(p) and whose carrying predicate for aaa is the existence of such a decoder for EaE_aEa​. Write C(H)={c(p):p∈P, J(p,H)}\mathcal C(H)=\{c(p):p\in P,\ J(p,H)\}C(H)={c(p):p∈P, J(p,H)} for its set of attainable prices, say that HHH is feasible when ∃p∈P, J(p,H)\exists p\in P,\ J(p,H)∃p∈P, J(p,H), say that HHH is within a real budget bbb when ∃p∈P, J(p,H)∧c(p)≤b\exists p\in P,\ J(p,H)\land c(p)\le b∃p∈P, J(p,H)∧c(p)≤b, and set k(H)=inf⁡C(H)k(H)=\inf\mathcal C(H)k(H)=infC(H), using the total real infimum operation, which assigns zero to the empty set. Then, for every expression eee, both of the following hold: for every finite S⊆NS\subseteq\mathbb NS⊆N and every p∈Pp\in Pp∈P, serves⁡(p,{g(n):n∈S})\operatorname{serves}(p,\{g(n):n\in S\})serves(p,{g(n):n∈S}) if and only if J(p,{vn:n∈S})J(p,\{v_n:n\in S\})J(p,{vn​:n∈S}); and there exists an expression fff such that e≈fe\approx fe≈f, depth⁡(f)≤2\operatorname{depth}(f)\le2depth(f)≤2, V(f)⊆V(e)V(f)\subseteq V(e)V(f)⊆V(e), Ee=EfE_e=E_fEe​=Ef​ as functions on all of Ω\OmegaΩ, and (∃u,v∈Ω, Ee(u)≠Ee(v))(\exists u,v\in\Omega,\ E_e(u)\ne E_e(v))(∃u,v∈Ω, Ee​(u)=Ee​(v)) if and only if (∃u,v∈Ω, Ef(u)≠Ef(v))(\exists u,v\in\Omega,\ E_f(u)\ne E_f(v))(∃u,v∈Ω, Ef​(u)=Ef​(v)), with the additional property that for every finite set FFF of expressions, simultaneously C(F∪{e})=C(F∪{f})\mathcal C(F\cup\{e\})=\mathcal C(F\cup\{f\})C(F∪{e})=C(F∪{f}), F∪{e}F\cup\{e\}F∪{e} is feasible if and only if F∪{f}F\cup\{f\}F∪{f} is feasible, for every real bbb the set F∪{e}F\cup\{e\}F∪{e} is within budget bbb if and only if F∪{f}F\cup\{f\}F∪{f} is within budget bbb, and k(F∪{e})=k(F∪{f})k(F\cup\{e\})=k(F\cup\{f\})k(F∪{e})=k(F∪{f}). The same chosen fff works for all FFF and all bbb; 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 eee or fff already belongs to FFF. If S=∅S=\varnothingS=∅, its decoder condition is vacuous, and the assumed equivalence for the original ledger forces every ppp to serve the empty set; J(p,∅)J(p,\varnothing)J(p,∅) is likewise vacuous. The existence of ggg makes DDD nonempty, the binary distinction for g(0)g(0)g(0) forces at least two distinct states in Ω\OmegaΩ and hence at least two elements of XXX, and the zero-price empty-serving protocol makes PPP 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 eee 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.

Human review
  • Endorsed by Shuze Chen · Nov 18, 2026

    Confirmed by the moderator at approval.

  • Endorsed by FiniteUniverse · Nov 18, 2026

    Confirmed by the mission captain (proposal self-audit).

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