Defect
Defect supplies a binary natural-number indicator for source strings in the CPM LNAL bridge. It returns zero precisely when the string satisfies the Structured predicate and one otherwise. Cost-algebra authors cite it to seed the defect distance d(x,y) = J(x/y). The definition is a direct conditional that delegates the check to the sibling Structured predicate.
claimFor a source string $src$, define the defect as $0$ if $src$ is structured (its parsed program passes static checks) and $1$ otherwise.
background
The CPM module implements a minimal surrogate for structured sets: programs appear as strings that must survive static checks. The sibling Structured definition parses the input via parseProgram and then runs staticChecks, returning true only when the resulting representation is valid. Defect then maps this Boolean outcome to a Nat cost of zero or one. The module setting is therefore a lightweight bridge between LNAL compiler output and the J-cost algebra.
proof idea
The definition is a direct conditional expression that evaluates Structured src and returns 0 or 1 accordingly. No lemmas or tactics are invoked; it is a primitive one-line definition.
why it matters in Recognition Science
Defect feeds the binary deviation indicator into defectDist and its derived properties (non-negativity, symmetry, self-distance zero) inside CostAlgebra. Those properties in turn support the defect pseudometric used for J-cost calculations that appear in the phi-ladder mass formulas and the T5–T8 forcing chain. It therefore closes the LNAL-to-algebra link required for the Recognition framework’s cost accounting.
scope and limits
- Does not compute continuous or graded costs beyond the binary outcome.
- Does not handle parse failures outside the Structured predicate.
- Does not reference the phi-ladder, J-function, or physical constants.
- Does not prove any algebraic properties of the returned value.
formal statement (Lean)
17def Defect (src : String) : Nat := if Structured src then 0 else 1
proof body
Definition body.
18
19end CPM
20end IndisputableMonolith
used by (40)
-
defectDist -
defectDist_nonneg -
defectDist_self -
defectDist_symm -
J_nonneg -
shiftedHValueOf -
Hypothesis -
poly_circuit_poly_capacity -
cosmological_constant_resolution -
Model -
defect_must_be_small -
cost_stability_calibrated -
defect_symmetric -
discrete_minimum_stable -
unity_unique_minimizer -
defect -
defect_at_one -
DefectCollapse -
defect_one -
Exists -
logic_from_cost -
rung_separation -
before -
variational_dynamics_certificate -
variational_dynamics_deterministic -
variational_step_unique -
ExternalPhaseField -
C_proj_value -
coherence_defect_simplify -
total_potential_in_frame