Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite costs, centered distances, and exponential overlaps

Definition
APFTheoremZero_CostGeometry

by FiniteUniverse · Sep 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

apffinite-geometrypositive-definite-kernels

For 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.

Definition code
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
Source
APF Theorem Zero historical strengthening companion, SOURCE_THEOREM_ZERO.md, September 2026; explicit corrected/extended targets, not verbatim claims of the February PDF. Definition D; early Paper 5 supplement v1.0, proposition inner_product; Schoenberg (1938), pp.525–526.
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 nnn, including 000, and every real n×nn\times nn×n matrix DDD with indices 0,…,n−10,\ldots,n-10,…,n−1, the predicate called NegativeType⁡(D)\operatorname{NegativeType}(D)NegativeType(D) means that, for every real coefficient vector a=(ai)i=0n−1a=(a_i)_{i=0}^{n-1}a=(ai​)i=0n−1​ whose coordinate sum is zero, ∑i=0n−1∑j=0n−1aiajDij≤0\sum_{i=0}^{n-1}\sum_{j=0}^{n-1}a_i a_jD_{ij}\le 0∑i=0n−1​∑j=0n−1​ai​aj​Dij​≤0. This definition imposes no separate symmetry, diagonal, entrywise-sign or non-degeneracy condition on DDD. The zero coefficient vector is included; when n=0n=0n=0, all sums are empty sums equal to zero and this predicate is satisfied by the empty matrix.

For every natural number nnn, including 000, and every real n×nn\times nn×n matrix JJJ, the function called centerCost⁡\operatorname{centerCost}centerCost returns the real n×nn\times nn×n matrix with entry Jij−(Jii+Jjj)/2J_{ij}-(J_{ii}+J_{jj})/2Jij​−(Jii​+Jjj​)/2 at every pair of indices i,j∈{0,…,n−1}i,j\in\{0,\ldots,n-1\}i,j∈{0,…,n−1}. No symmetry, positivity or other condition on JJJ is assumed. When n=0n=0n=0, the returned matrix has no entries. The denominator is the nonzero real number 222. This declaration is marked noncomputable in the formal code; that marker does not assert that the mathematical function is uncomputable.

For every natural number nnn, including 000, every real n×nn\times nn×n matrix JJJ, and every real number ttt, the function called expKernel⁡\operatorname{expKernel}expKernel returns the real n×nn\times nn×n matrix with entry exp⁡(−tJij)\exp(-tJ_{ij})exp(−tJij​) at each pair of indices i,j∈{0,…,n−1}i,j\in\{0,\ldots,n-1\}i,j∈{0,…,n−1}. There are no sign or symmetry assumptions on JJJ and no restriction on ttt: zero and negative ttt are included, and t=0t=0t=0 gives entry 111 everywhere. When n=0n=0n=0, 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 nnn, every real n×nn\times nn×n matrix DDD, and a supplied index b∈{0,…,n−1}b\in\{0,\ldots,n-1\}b∈{0,…,n−1}, the function called basedGram⁡\operatorname{basedGram}basedGram returns the real n×nn\times nn×n matrix with entry (Dib+Djb−Dij)/2(D_{ib}+D_{jb}-D_{ij})/2(Dib​+Djb​−Dij​)/2 at each pair of indices i,j∈{0,…,n−1}i,j\in\{0,\ldots,n-1\}i,j∈{0,…,n−1}. No symmetry, zero-diagonal, positivity or other condition on DDD is required by this definition. The supplied index bbb cannot exist when n=0n=0n=0, so there is no application with an empty index set and a supplied base index. The denominator is the nonzero real number 222. This declaration is marked noncomputable in the formal code; that marker does not assert that the mathematical function is uncomputable.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me