S7 — Essential distinctions determine exact two-bit form cost
ProvedAPFLoFStrengthening.semantic_service_and_exact_costIn 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.
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
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
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.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.