Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

B8 — Compile forms with registered Boolean operations

Proved
APFLawsOfForm.registered_decoder_compilation

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

apfboolean-readoutsenforcement-costslaws-of-form

If a complete APF protocol serves all primitive labels occurring in a form, its registered decoders realize the original serving relation, and its already provided decoder catalogue contains false and is closed under Boolean complement and binary disjunction, that same protocol serves the form at its existing bill. The result supplies an actual budget witness and bounds the infimum by that bill. Closure is an explicit resource/interface hypothesis, not a conclusion that all physical postprocessing is free.

Preamble
import Definitions.Def_APFLawsOfForm_Bridge

set_option autoImplicit false
open LawsOfForm APFPaper1.Foundation
Formal statement
namespace APFLawsOfForm
theorem registered_decoder_compilation {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) (p : P) (hp : I.ledger.serves p (primitiveSupport g e)) (hc : BooleanClosed M p) :
    (formLedger I.ledger M (interfaceReadouts I g)).serves p {e} ∧
    WithinBudget (formLedger I.ledger M (interfaceReadouts I g)) {e} (I.ledger.price p) ∧
    cost (formLedger I.ledger M (interfaceReadouts I g)) {e} ≤ I.ledger.price p := 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 B8: Let I, g, and M be as in B6 and assume RealizesLedger I M. For any form e and protocol p, suppose p serves the original primitiveSupport g e and BooleanClosed M p holds. Then that same p serves the singleton form request {e} in the induced ledger. It witnesses service within its original price, and the form's cost infimum is at most that price. The Boolean closure assumption concerns the already registered decoders and does not assert free availability of unregistered operations.
Read-back

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

For every four types X,Q,D,PX,Q,D,PX,Q,D,P, with decidable equality on DDD, let III consist of a map π:X→P(Q)\pi:X\to\mathcal P(Q)π:X→P(Q), the quotient Ω=X/∼\Omega=X/{\sim}Ω=X/∼ where x∼yx\sim yx∼y means π(x)=π(y)\pi(x)=\pi(y)π(x)=π(y), an injective assignment d↦δdd\mapsto\delta_dd↦δd​ of binary distinctions to elements of DDD, and a ledger LLL on DDD and PPP: each distinction has a readout rd:Ω→{false,true}r_d:\Omega\to\{\mathrm{false},\mathrm{true}\}rd​:Ω→{false,true} with rd(u)≠rd(v)r_d(u)\ne r_d(v)rd​(u)=rd​(v) for some u,v∈Ωu,v\in\Omegau,v∈Ω; the ledger has a real price a(q)≥0a(q)\ge0a(q)≥0 for every q∈Pq\in Pq∈P, a relation serves⁡(q,S)\operatorname{serves}(q,S)serves(q,S) for finite S⊆DS\subseteq DS⊆D that is closed under passing to subsets, and a relation carries⁡(q,d)\operatorname{carries}(q,d)carries(q,d) such that serving SSS implies carrying every d∈Sd\in Sd∈S; and some protocol serves the empty set at price zero. The interface also requires, for each d∈Dd\in Dd∈D, that some protocol serves {d}\{d\}{d} and that inf⁡{a(q):q∈P,serves⁡(q,{d})}>0\inf\{a(q):q\in P,\operatorname{serves}(q,\{d\})\}>0inf{a(q):q∈P,serves(q,{d})}>0, where every cost in this statement is the real infimum of the set of serving protocols' prices. Let g:N→Dg:\mathbb N\to Dg:N→D be any function, and let MMM assign to every protocol q∈Pq\in Pq∈P a type RqR_qRq​ of records, a record map tq:Ω→Rqt_q:\Omega\to R_qtq​:Ω→Rq​, and a set Aq⊆(Rq→{false,true})A_q\subseteq(R_q\to\{\mathrm{false},\mathrm{true}\})Aq​⊆(Rq​→{false,true}) of registered decoders. Assume that for every q∈Pq\in Pq∈P and every finite S⊆DS\subseteq DS⊆D, serves⁡(q,S)\operatorname{serves}(q,S)serves(q,S) holds if and only if, for each d∈Sd\in Sd∈S, there exists a decoder h∈Aqh\in A_qh∈Aq​ satisfying h(tq(u))=rd(u)h(t_q(u))=r_d(u)h(tq​(u))=rd​(u) for every u∈Ωu\in\Omegau∈Ω; these decoders may depend on ddd. Let eee be any finite formal expression built from a blank, variables indexed by natural numbers including zero, a unary crossing operation, and a binary beside operation, and let p∈Pp\in Pp∈P. Write V(e)V(e)V(e) for the finite set of variable indices occurring in eee, defined by V(blank)=∅V(\mathrm{blank})=\varnothingV(blank)=∅, V(var(n))={n}V(\mathrm{var}(n))=\{n\}V(var(n))={n}, V(cross(b))=V(b)V(\mathrm{cross}(b))=V(b)V(cross(b))=V(b), and V(beside(b,c))=V(b)∪V(c)V(\mathrm{beside}(b,c))=V(b)\cup V(c)V(beside(b,c))=V(b)∪V(c). Assume that ppp serves the finite image g[V(e)]g[V(e)]g[V(e)], and that ApA_pAp​ contains the constant-false decoder, contains the pointwise Boolean negation of each of its members, and contains the pointwise Boolean disjunction of every pair of its members, with these closure conditions holding as functions on all of RpR_pRp​. For any expression bbb, define fb:Ω→{false,true}f_b:\Omega\to\{\mathrm{false},\mathrm{true}\}fb​:Ω→{false,true} by interpreting the blank as false, variable nnn as rg(n)r_{g(n)}rg(n)​, crossing as Boolean negation, and beside as Boolean disjunction. Define a ledger L′L'L′ on expressions and the same protocols by keeping price a(q)a(q)a(q), declaring that qqq serves a finite expression set FFF exactly when, for every b∈Fb\in Fb∈F, there is some h∈Aqh\in A_qh∈Aq​ with h(tq(u))=fb(u)h(t_q(u))=f_b(u)h(tq​(u))=fb​(u) for all u∈Ωu\in\Omegau∈Ω, and declaring that qqq carries bbb exactly when such a decoder exists for bbb. Then all three conclusions hold together: ppp serves {e}\{e\}{e} in L′L'L′; there exists a protocol q∈Pq\in Pq∈P that serves {e}\{e\}{e} in L′L'L′ and satisfies a(q)≤a(p)a(q)\le a(p)a(q)≤a(p); and inf⁡{a(q):q∈P, q serves {e} in L′}≤a(p)\inf\{a(q):q\in P,\ q\text{ serves }\{e\}\text{ in }L'\}\le a(p)inf{a(q):q∈P, q serves {e} in L′}≤a(p). The quantified expression may have no variables or may evaluate to a constant; repeated indices and repeated values of ggg are discarded in the support set, ggg need not be injective, and no joint realizability of arbitrary assignments to primitive readouts is assumed. If V(e)V(e)V(e) is empty, the stated serving hypothesis concerns the empty set, and the global equivalence assumption makes every protocol serve that set. The decoder equality is required on every quotient state, whereas decoder closure is required even on records outside the image of the record map. The decoder and budget witnesses need not be unique, and the infimum need not be attained; for the concluding cost, the first conclusion makes its defining set nonempty and nonnegative prices make it bounded below. Although the types are universally quantified without separate nonemptiness assumptions, ggg forces DDD to be inhabited, the ledger forces PPP to be inhabited, and the nonconstant readout of g(0)g(0)g(0) forces at least two distinct quotient states, so empty XXX or QQQ, empty DDD or PPP, or a constant profile cannot satisfy the full hypotheses.

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