Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

S7 — Essential distinctions determine exact two-bit form cost

Proved
APFLoFStrengthening.semantic_service_and_exact_cost

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

apflaws-of-formrecordssemantic-costsymmetry

In the two-bit model, a Boolean output is implementable from a record exactly when the record contains its essential coordinates. A coordinate is essential if changing only it can change the output. Every form has exact cost equal to the price of its semantic essential support. In particular variable 0 disjoined with its complement costs zero, despite containing a syntactic variable. The exhaustive support lemma is finite kernel-checked Boolean reasoning, not a native oracle.

Preamble
import Definitions.Def_APFLoFStrengthening_Model
import Definitions.Def_APFLoFStrengthening_Symmetry
import Mathlib.Tactic


set_option autoImplicit false
set_option linter.unusedSectionVars false
set_option maxRecDepth 100000
set_option maxHeartbeats 4000000
open LawsOfForm APFPaper1.Foundation APFLawsOfForm
Formal statement
namespace APFLoFStrengthening
theorem semantic_service_and_exact_cost (g : Nat → Bool) :
    (∀ (f : Raw Bool → Bool) (p : Finset Bool),
      Implements (system Bool) p (TwoBit.liftOutput f) ↔ TwoBit.essentialSupport f ⊆ p) ∧
    (∀ e : Expr,
      cost (formLedger (ledger Bool) (system Bool) (interfaceReadouts (interface Bool) g)) {e} =
        price Bool (TwoBit.essentialSupport (TwoBit.rawEval g e))) ∧
    cost (formLedger (ledger Bool) (system Bool) (interfaceReadouts (interface Bool) g))
      {Expr.beside (.var 0) (.cross (.var 0))} = 0 := by sorry
end APFLoFStrengthening
Source
APF project with Codex, Independent Records, Semantic Cost, and Symmetry, project technical note version 1, 7 September 2026, SOURCE.md. Source SHA-256 bd8025b7ccbd3e7203b124ad8f02536ed3846f0f979877634fe54322787e0026. In the two-bit model, a registered decoder implements any Boolean output f from protocol p if and only if every essential coordinate of f belongs to p. The raw support criterion is checked by Lean kernel reduction over the finite Boolean problem, without a native oracle. Quotient descent then gives the corresponding criterion for form outputs. For every form e and label map g, the cost of requesting e is exactly the price of its semantic essential support. The support itself is a serving protocol, and every serving protocol contains it. The form `var 0 beside cross(var 0)` consequently costs zero: its output is constant true, so its essential support is empty despite the occurrence of a syntactic variable.
Read-back

What the Lean code literally says, in plain math · Fresh isolated Codex reader; exact model ID not recorded

semantic_service_and_exact_cost — independent code readback

For every total g : Nat → Bool, with the standard Boolean and expression equality/finite-domain instances and no further hypothesis on g, the theorem asserts three conjuncts.

First, for every Boolean output function f : (Bool → Bool) → Bool and every p : Finset Bool, system Bool implements the quotient lift of f from p if and only if essentialSupport f ⊆ p. The support contains coordinate d exactly when some raw assignments x,y agree at every coordinate other than d but yield different f-values. Implementation means that there exists a registered decoder of the p-record which returns f correctly at every state. The decoder may depend on f and p, and support witnesses may depend on d; none of these existential choices must be uniform across all f. This first conjunct does not otherwise depend on g.

Second, for every expression e, the cost of serving {e} in the form ledger is exactly the price of the essential support of the raw function obtained by evaluating e with variable n assigned x (g n). The ledger records subsets of the two Boolean coordinates and registers every Boolean decoder. Its price for a set of size k is k + choose(k, 2), cast to the reals. Hence the asserted exact singleton-expression costs are 0, 1, or 3 according to whether that semantic support has size 0, 1, or 2. g may identify any variable indices; syntactic appearances alone do not determine this price.

Third, the particular expression “variable 0 beside the crossing of variable 0,” whose Boolean denotation is x OR NOT x, has cost 0 for every g. This claim requires neither distinct coordinates nor nonconstant output.

An empty record implements exactly the constant f covered by the first equivalence; the full two-coordinate record implements every such f. Variable-free expressions and other semantically constant expressions have empty essential support and receive zero exact cost. The raw input space has four assignments and does not have an empty-domain case. The theorem concerns arbitrary mathematical functions on this finite space, not a runtime or physical-resource guarantee. Its scope is individual output functions and singleton-expression requests; no finite-family cost formula is stated here. The placeholder is not proof evidence.

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