Encyclopedia Cost Cost Ndim Core Dot Log Hadamard Mul

ARTICLE 3 claims 3 theorems

Cost Ndim Core Dot Log Hadamard Mul

A machine-checked theorem shows that in the framework's N-dimensional cost, the logarithm of a componentwise product splits into a sum, the same rule that makes slide rules work.

The log-aggregate product rule

The declaration dot_log_hadamardMul is a formal theorem in the Recognition Science library, a machine-checked collection of mathematical proofs. It states a simple algebraic identity: for any positive vectors x and y, the weighted sum of the logarithms of their componentwise product equals the weighted sum of the logarithms of x plus the weighted sum of the logarithms of y. In symbols, if α is a vector of weights, then Σ αᵢ log(xᵢ yᵢ) = Σ αᵢ log(xᵢ) + Σ αᵢ log(yᵢ). This is just the familiar rule that the logarithm of a product is the sum of logarithms, applied componentwise and then averaged with weights.

The theorem is the multiplicative analogue of the additive rule for ordinary sums. It holds for any natural number n of components, so it is not limited to two or three dimensions. The positivity condition, that every component of x and y is greater than zero, is exactly what makes logarithms defined. The proof is a direct consequence of the definitions: the componentwise logarithm, the weighted dot product, and the componentwise multiplication are all defined in the library, and the identity follows by expanding each definition. No additional assumptions about the weights α are needed; they can be any real numbers.

In the Recognition Science framework, this identity is a building block for the N-dimensional cost function. The cost measures the price of a recognition event, a discrete record of a comparison, and the framework shows that any cost satisfying five plain conditions must take a specific form. The N-dimensional version lifts that scalar cost to vectors by first aggregating components through a weighted log sum, then applying the scalar cost. The product rule ensures that this aggregation respects componentwise multiplication, turning a product of vectors into a sum of their log-aggregates. That property is what later lets the framework prove reciprocity, that inverting every component leaves the cost unchanged, and it underpins the zero-cost characterization, which says the cost is zero exactly when the weighted log sum is zero.

The theorem does not claim that the cost itself is multiplicative, nor that it is additive. It does not say anything about the scalar cost J, only about the log-aggregate that feeds into it. It does not assert that the product rule holds for vectors with zero or negative components, since logarithms are not defined there. And it does not, by itself, establish any physical law or empirical prediction; it is a piece of pure algebra within the framework's formal system.

THEOREM dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean
dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean:73
/-- Log-aggregate of a componentwise product. -/
theorem dot_log_hadamardMul {n : ℕ} (α x y : Vec n)
    (hx : ∀ i, 0 < x i) (hy : ∀ i, 0 < y i) :
    dot α (logVec (hadamardMul x y)) = dot α (logVec x) + dot α (logVec y) := by
  unfold dot logVec hadamardMul
  calc
    ∑ i : Fin n, α i * Real.log (x i * y i)
        = ∑ i : Fin n, α i * (Real.log (x i) + Real.log (y i)) := by
            refine Finset.sum_congr rfl ?_
            intro i hi
            rw [Real.log_mul (show x i ≠ 0 from (hx i).ne') (show y i ≠ 0 from (hy i).ne')]
    _ = ∑ i : Fin n, (α i * Real.log (x i) + α i * Real.log (y i)) := by
          refine Finset.sum_congr rfl ?_
          intro i hi
          ring
    _ = (∑ i : Fin n, α i * Real.log (x i)) + (∑ i : Fin n, α i * Real.log (y i)) := by
          simpa using Finset.sum_add_distrib
THEOREM dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean
dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean:73
/-- Log-aggregate of a componentwise product. -/
theorem dot_log_hadamardMul {n : ℕ} (α x y : Vec n)
    (hx : ∀ i, 0 < x i) (hy : ∀ i, 0 < y i) :
    dot α (logVec (hadamardMul x y)) = dot α (logVec x) + dot α (logVec y) := by
  unfold dot logVec hadamardMul
  calc
    ∑ i : Fin n, α i * Real.log (x i * y i)
        = ∑ i : Fin n, α i * (Real.log (x i) + Real.log (y i)) := by
            refine Finset.sum_congr rfl ?_
            intro i hi
            rw [Real.log_mul (show x i ≠ 0 from (hx i).ne') (show y i ≠ 0 from (hy i).ne')]
    _ = ∑ i : Fin n, (α i * Real.log (x i) + α i * Real.log (y i)) := by
          refine Finset.sum_congr rfl ?_
          intro i hi
          ring
    _ = (∑ i : Fin n, α i * Real.log (x i)) + (∑ i : Fin n, α i * Real.log (y i)) := by
          simpa using Finset.sum_add_distrib
THEOREM dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean
dot_log_hadamardMul · IndisputableMonolith/Cost/Ndim/Core.lean:73
/-- Log-aggregate of a componentwise product. -/
theorem dot_log_hadamardMul {n : ℕ} (α x y : Vec n)
    (hx : ∀ i, 0 < x i) (hy : ∀ i, 0 < y i) :
    dot α (logVec (hadamardMul x y)) = dot α (logVec x) + dot α (logVec y) := by
  unfold dot logVec hadamardMul
  calc
    ∑ i : Fin n, α i * Real.log (x i * y i)
        = ∑ i : Fin n, α i * (Real.log (x i) + Real.log (y i)) := by
            refine Finset.sum_congr rfl ?_
            intro i hi
            rw [Real.log_mul (show x i ≠ 0 from (hx i).ne') (show y i ≠ 0 from (hy i).ne')]
    _ = ∑ i : Fin n, (α i * Real.log (x i) + α i * Real.log (y i)) := by
          refine Finset.sum_congr rfl ?_
          intro i hi
          ring
    _ = (∑ i : Fin n, α i * Real.log (x i)) + (∑ i : Fin n, α i * Real.log (y i)) := by
          simpa using Finset.sum_add_distrib

What this page does not claim

The theorem does not claim that the cost function itself is multiplicative or additive. It does not claim the identity holds for vectors with zero or negative components. It does not claim any empirical or physical consequence on its own.

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/Ndim/Core.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