Documentation

LeanPool.DistanceGeometry.Defs

Distance geometry: core definitions #

This file sets up the basic objects of Euclidean distance geometry: the squared-distance matrix of a point configuration, the predicate that a given matrix is such a matrix, embeddability in a fixed dimension, and the basepoint-centered Gram matrix that underlies Schoenberg's characterization.

A configuration of points indexed by ι in k-dimensional Euclidean space is a map x : ι → EuclideanSpace ℝ (Fin k). The squared-distance matrix sqDistMatrix x records dist (x i) (x j) ^ 2. Schoenberg's theorem characterizes which symmetric hollow matrices arise this way through their basepoint-centered Gram matrix.

Main definitions #

Implementation notes #

centeredGram uses the fixed base index 0 : Fin n (hence [NeZero n]) as its origin. For a symmetric hollow matrix, changing the base index gives a congruent Gram matrix with the same rank and positive-semidefiniteness. The Schoenberg conditions are therefore basepoint-independent. The point index is Fin n because the base-0 choice uses the order on Fin n; the squared-distance machinery itself only needs Fintype and DecidableEq.

References #

noncomputable def DistanceGeometry.sqDistMatrix {n k : } (x : Fin nEuclideanSpace (Fin k)) :
Matrix (Fin n) (Fin n)

The squared-distance matrix of a configuration x: its (i, j) entry is the squared Euclidean distance between x i and x j.

Equations
Instances For
    @[simp]
    theorem DistanceGeometry.sqDistMatrix_apply {n k : } (x : Fin nEuclideanSpace (Fin k)) (i j : Fin n) :
    sqDistMatrix x i j = dist (x i) (x j) ^ 2
    def DistanceGeometry.IsSqDistMatrix {n k : } (D : Matrix (Fin n) (Fin n) ) (x : Fin nEuclideanSpace (Fin k)) :

    D is the squared-distance matrix of the configuration x when every entry D i j equals the squared Euclidean distance between points x i and x j.

    Equations
    Instances For
      theorem DistanceGeometry.IsSqDistMatrix.symm {n k : } {D : Matrix (Fin n) (Fin n) } {x : Fin nEuclideanSpace (Fin k)} (hD : IsSqDistMatrix D x) (i j : Fin n) :
      D i j = D j i

      A squared-distance matrix is symmetric: D i j = D j i.

      theorem DistanceGeometry.IsSqDistMatrix.hollow {n k : } {D : Matrix (Fin n) (Fin n) } {x : Fin nEuclideanSpace (Fin k)} (hD : IsSqDistMatrix D x) (i : Fin n) :
      D i i = 0

      A squared-distance matrix is hollow: its diagonal vanishes.

      def DistanceGeometry.EmbedsIn {n : } (D : Matrix (Fin n) (Fin n) ) (k : ) :

      D is embeddable in dimension k when it is the squared-distance matrix of some configuration of points in EuclideanSpace ℝ (Fin k).

      Equations
      Instances For

        IsPreDistMatrix is this project's name for the symmetric-and-hollow structural predicate. It does not include entrywise nonnegativity. Every squared-distance matrix satisfies this predicate, which supplies the structural hypothesis for the sufficiency direction of Schoenberg's theorem.

        Equations
        Instances For
          theorem DistanceGeometry.IsPreDistMatrix.symm {n : } {D : Matrix (Fin n) (Fin n) } (hD : IsPreDistMatrix D) (i j : Fin n) :
          D i j = D j i

          A matrix satisfying IsPreDistMatrix is symmetric.

          theorem DistanceGeometry.IsPreDistMatrix.hollow {n : } {D : Matrix (Fin n) (Fin n) } (hD : IsPreDistMatrix D) (i : Fin n) :
          D i i = 0

          A matrix satisfying IsPreDistMatrix is hollow.

          Every squared-distance matrix satisfies IsPreDistMatrix.

          noncomputable def DistanceGeometry.centeredGram {n : } [NeZero n] (D : Matrix (Fin n) (Fin n) ) :
          Matrix (Fin n) (Fin n)

          The basepoint-centered Gram matrix of a squared-distance matrix D, anchored at index 0 (requires n ≥ 1, i.e. [NeZero n], for the index 0 : Fin n to exist). When D holds the squared distances of a configuration x, this matrix equals ⟪x i - x 0, x j - x 0⟫ (proved in Schoenberg.lean), hence it is the Gram matrix of the recentred vectors x i - x 0.

          Equations
          Instances For
            @[simp]
            theorem DistanceGeometry.centeredGram_apply {n : } [NeZero n] (D : Matrix (Fin n) (Fin n) ) (i j : Fin n) :
            centeredGram D i j = (D 0 i + D 0 j - D i j) / 2
            theorem DistanceGeometry.centeredGram_symm {n : } [NeZero n] {D : Matrix (Fin n) (Fin n) } (hsymm : ∀ (i j : Fin n), D i j = D j i) (i j : Fin n) :

            The basepoint-centered Gram matrix of a symmetric matrix is symmetric.