Finite costs, centered distances, and exponential overlaps
DefinitionAPFTheoremZero_CostGeometryFor a real n by n array, negative type means its quadratic sum is nonpositive on every real coefficient vector whose coefficients sum to zero. Diagonal centering subtracts half the sum of the two diagonal entries. The exponential kernel applies exp(-t J_ij) entry by entry. The based Gram array is (D_ib+D_jb-D_ij)/2. These definitions impose no symmetry, positivity, physical interpretation, or nonempty-size assumption; the based Gram construction additionally takes an index b.
import Mathlib.LinearAlgebra.Matrix.PosDef
import Mathlib.Analysis.SpecialFunctions.Exp
import Mathlib.Analysis.InnerProductSpace.PiL2
import Mathlib.Logic.Relation
set_option autoImplicit false
open BigOperators
namespace APFTheoremZero
def NegativeType {n : ℕ} (D : Matrix (Fin n) (Fin n) ℝ) : Prop :=
∀ a : Fin n → ℝ, (∑ i, a i) = 0 →
(∑ i, ∑ j, a i * a j * D i j) ≤ 0
noncomputable def centerCost {n : ℕ} (J : Matrix (Fin n) (Fin n) ℝ) : Matrix (Fin n) (Fin n) ℝ :=
fun i j => J i j - (J i i + J j j) / 2
noncomputable def expKernel {n : ℕ} (J : Matrix (Fin n) (Fin n) ℝ) (t : ℝ) :
Matrix (Fin n) (Fin n) ℝ :=
fun i j => Real.exp (-t * J i j)
noncomputable def basedGram {n : ℕ} (D : Matrix (Fin n) (Fin n) ℝ) (b : Fin n) :
Matrix (Fin n) (Fin n) ℝ :=
fun i j => (D i b + D j b - D i j) / 2
end APFTheoremZero
Read-back
What the Lean code literally says, in plain math · Independent source-informed reader /root/theorem_zero_readback; exact model unavailable
For every natural number , including , and every real matrix with indices , the predicate called means that, for every real coefficient vector whose coordinate sum is zero, . This definition imposes no separate symmetry, diagonal, entrywise-sign or non-degeneracy condition on . The zero coefficient vector is included; when , all sums are empty sums equal to zero and this predicate is satisfied by the empty matrix.
For every natural number , including , and every real matrix , the function called returns the real matrix with entry at every pair of indices . No symmetry, positivity or other condition on is assumed. When , the returned matrix has no entries. The denominator is the nonzero real number . This declaration is marked noncomputable in the formal code; that marker does not assert that the mathematical function is uncomputable.
For every natural number , including , every real matrix , and every real number , the function called returns the real matrix with entry at each pair of indices . There are no sign or symmetry assumptions on and no restriction on : zero and negative are included, and gives entry everywhere. When , the returned matrix has no entries. This declaration is marked noncomputable in the formal code; that marker does not assert that the mathematical function is uncomputable.
For every natural number , every real matrix , and a supplied index , the function called returns the real matrix with entry at each pair of indices . No symmetry, zero-diagonal, positivity or other condition on is required by this definition. The supplied index cannot exist when , so there is no application with an empty index set and a supplied base index. The denominator is the nonzero real number . This declaration is marked noncomputable in the formal code; that marker does not assert that the mathematical function is uncomputable.