Encyclopedia Cost Cost Derivative Lin J Eq Derivative Times X

ARTICLE 3 claims 3 theorems

Cost Derivative Lin J Eq Derivative Times X

A small calculus identity in the Recognition Science library: the first-order change in recognition cost equals the derivative times the multiplier, and nothing more.

The linearized cost

In ordinary calculus, the first-order change of a function f near a point x is approximated by its derivative: f(x + h) ≈ f(x) + f'(x)·h. The Recognition Science declaration linJ_eq_derivative_times_x states the analogous linearization for the framework's cost function J, the discrete record of recognition events whose cost is forced by five plain conditions. The identity says that the linearized per-bond delta, written linJ(x, L), equals the derivative of J at x, multiplied by x and by the log-strain L: linJ(x, L) = J'(x)·x·L. Here x is the base multiplier and L is the logarithmic strain, a measure of proportional change.

The cost function itself is J(x) = (x + x⁻¹)/2 − 1, defined for x > 0. Its derivative is J'(x) = (1 − x⁻²)/2, a standard calculus result proved in the library as deriv_Jcost_eq. The identity linJ(x, L) = ((x − x⁻¹)/2)·L then follows from the algebraic fact that (x − x⁻¹)/2 = ((1 − x⁻²)/2)·x. The declaration linJ_eq_derivative_times_x packages this algebra together with the derivative formula, for all positive x and all real L, as a machine-checked theorem in the framework's library of formal theorems.

What the identity does not claim is a new physical law. It is a purely mathematical statement about the first-order behavior of J along exponential paths, where the multiplier changes from x to x·e^L. It does not assert that the linear term is the whole change: the remainder, defined as remJ(x, L) = J(x·e^L) − J(x) − linJ(x, L), is a separate object, and the library proves only a quadratic bound on it, not that it vanishes. The identity also says nothing about the origin of J itself; the five conditions that force J to have this exact form are the subject of a different theorem, the functional equation result, not of this derivative identity.

In the framework's own development, the identity earns its place by connecting the linearized bond delta to the derivative, so that harm bounds can be derived from the remainder estimate. The library states this connection as harm_linearization_correct, which simply restates the same identity. For a reader outside the framework, the takeaway is narrower: given the cost function J, its first-order approximation along a proportional change is exactly the derivative times the multiplier. That is a fact of calculus, not a claim about the world.

THEOREM linJ_eq_derivative_times_x · IndisputableMonolith/Cost/Derivative.lean
linJ_eq_derivative_times_x · IndisputableMonolith/Cost/Derivative.lean:77
/-- The key identity connecting linJ to the derivative:
    linJ(x, L) = J'(x) · x · L

    Algebraic identity: (x - x⁻¹)/2 = ((1 - x⁻²)/2) · x -/
theorem linJ_eq_derivative_times_x (x L : ℝ) (hx : 0 < x) :
    linJ x L = deriv Jcost x * x * L := by
  have hxne : x ≠ 0 := ne_of_gt hx
  rw [deriv_Jcost_eq x hx]
  unfold linJ
  -- Key algebraic step: (1 - x⁻²) * x = x - x⁻¹
  have h_key : (1 - x⁻¹ ^ 2) * x = x - x⁻¹ := by
    have h1 : x⁻¹ ^ 2 * x = x⁻¹ := by
      rw [pow_two]
      calc x⁻¹ * x⁻¹ * x = x⁻¹ * (x⁻¹ * x) := by ring
        _ = x⁻¹ * 1 := by rw [inv_mul_cancel₀ hxne]
        _ = x⁻¹ := by ring
    calc (1 - x⁻¹ ^ 2) * x
        = x - x⁻¹ ^ 2 * x := by ring
      _ = x - x⁻¹ := by rw [h1]
  calc ((x - x⁻¹) / 2) * L
      = (x - x⁻¹) / 2 * L := by ring
    _ = ((1 - x⁻¹ ^ 2) * x) / 2 * L := by rw [h_key]
    _ = (1 - x⁻¹ ^ 2) / 2 * x * L := by ring
THEOREM deriv_Jcost_eq · IndisputableMonolith/Cost/Derivative.lean
/-- The derivative of J at x equals (1 - x⁻²)/2.

    Proof: J(x) = (x + x⁻¹)/2 - 1
    J'(x) = d/dx[(x + x⁻¹)/2 - 1] = (1 + (-x⁻²))/2 = (1 - x⁻²)/2

    **Technical note**: This is standard calculus, using:
    - d/dx[x] = 1
    - d/dx[x⁻¹] = -x⁻² -/
lemma deriv_Jcost_eq (x : ℝ) (hx : 0 < x) :
    deriv Jcost x = (1 - x⁻¹ ^ 2) / 2 := by
  have hxne : x ≠ 0 := ne_of_gt hx
  -- J(x) = (x + x⁻¹)/2 - 1
  -- J'(x) = (1 + d/dx[x⁻¹])/2 = (1 - x⁻²)/2
  -- Use HasDerivAt to compute the derivative
  have h_inv : HasDerivAt (·⁻¹) (-(x ^ 2)⁻¹) x := hasDerivAt_inv hxne
  have h_id : HasDerivAt id 1 x := hasDerivAt_id x
  have h_add : HasDerivAt (fun y => y + y⁻¹) (1 + -(x ^ 2)⁻¹) x :=
    h_id.add h_inv
  have h_div : HasDerivAt (fun y => (y + y⁻¹) / 2) ((1 + -(x ^ 2)⁻¹) / 2) x :=
    h_add.div_const 2
  have h_sub : HasDerivAt (fun y => (y + y⁻¹) / 2 - 1) ((1 + -(x ^ 2)⁻¹) / 2) x :=
    h_div.sub_const 1
  -- h_sub gives: HasDerivAt Jcost ((1 - x⁻²) / 2) x
  have h_eq : (1 + -(x ^ 2)⁻¹) / 2 = (1 - x⁻¹ ^ 2) / 2 := by
    have h1 : (x ^ 2)⁻¹ = x⁻¹ ^ 2 := by
      rw [pow_two, pow_two, mul_inv_rev]
    rw [h1]
    ring
  rw [h_eq] at h_sub
  exact h_sub.deriv
THEOREM harm_linearization_correct · IndisputableMonolith/Cost/Derivative.lean
harm_linearization_correct · IndisputableMonolith/Cost/Derivative.lean:131
/-- **Main Theorem**: The harm linear term is the correct directional derivative.

    This justifies using linBondDelta in the harm decomposition. -/
theorem harm_linearization_correct (x L : ℝ) (hx : 0 < x) :
    -- The linearization linJ captures the first-order behavior of J along exp paths
    linJ x L = deriv Jcost x * x * L :=
  linJ_eq_derivative_times_x x L hx

What this page does not claim

The identity does not assert that the linear term is the whole change; the remainder remJ is a separate object with only a quadratic bound. The identity does not derive the cost function J itself; that is the subject of the functional equation theorem, not this derivative identity. The identity does not make any empirical prediction about measured physical quantities.

Verify this page

Every tagged claim above names its theorem. To check one yourself rather than trust this page, elaborate the source module with Lean 4 and audit its axiom basis:

$ lake env lean IndisputableMonolith/Cost/Derivative.lean
expected axiom basis: [propext, Classical.choice, Quot.sound] (the Lean kernel's standard three; no RS-specific axioms)

A page whose claims cannot be reproduced this way does not ship. In production, every anchor links to the exact declaration in the public source release, and this block carries the build receipt for the page itself.

Derived articles

This page is generated by a question-recursion engine: the questions its answers raise become the next pages. The current agenda, with open targets marked red:

MACHINE LAYER · GROUNDED CLAIM TABLE · CLICK TO EXPAND