The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V16. Normed spaces and functional analysis

Mathlib.Analysis.InnerProductSpace.GramMatrix

16 declarations. Mathlib docs ยท Source

Gram Matrices

This file defines Gram matrices and proves their positive semidefiniteness. Results require RCLike ๐•œ.

Main definition

  • Matrix.gram : the Matrix n n ๐•œ with โŸชv i, v jโŸซ at i j : n, where v : n โ†’ E for an Inner ๐•œ E.

Main results

  • Matrix.posSemidef_gram: Gram matrices are positive semidefinite.
  • Matrix.posDef_gram_iff_linearIndependent: Linear independence of v is equivalent to positive definiteness of gram ๐•œ v.

def Matrix.gram E3 #

{E : Type u_1} โ†’ {n : Type u_2} โ†’ (๐•œ : Type u_5) โ†’ [Inner ๐•œ E] โ†’ (n โ†’ E) โ†’ Matrix n n ๐•œ

The entries of a Gram matrix are inner products of vectors in an inner product space.

theorem Matrix.gram_apply E0 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : Inner ๐•œ E] (v : n โ†’ E) (i j : n),
  Matrix.gram ๐•œ v i j = inner ๐•œ (v i) (v j)

theorem Matrix.gram_zero E0 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E], Matrix.gram ๐•œ 0 = 0

theorem Matrix.gram_single E0 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] [inst_3 : DecidableEq n] (i : n) (x : E),
  Matrix.gram ๐•œ (Pi.single i x) = Matrix.single i i (inner ๐•œ x x)

theorem Matrix.submatrix_gram E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] (v : n โ†’ E) {m : Type u_5} (f : m โ†’ n),
  (Matrix.gram ๐•œ v).submatrix f f = Matrix.gram ๐•œ (v โˆ˜ f)

theorem Matrix.isHermitian_gram E1 #

โˆ€ {E : Type u_1} {n : Type u_2} (๐•œ : Type u_4) [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] (v : n โ†’ E), (Matrix.gram ๐•œ v).IsHermitian

A Gram matrix is Hermitian.

theorem Matrix.star_dotProduct_gram_mulVec E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] [inst_3 : Fintype n] (v : n โ†’ E) (x y : n โ†’ ๐•œ),
  star x โฌแตฅ (Matrix.gram ๐•œ v).mulVec y = inner ๐•œ (โˆ‘ i, x i โ€ข v i) (โˆ‘ i, y i โ€ข v i)

theorem Matrix.posSemidef_gram E3 #

โˆ€ {E : Type u_1} {n : Type u_2} (๐•œ : Type u_4) [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] (v : n โ†’ E), (Matrix.gram ๐•œ v).PosSemidef

A Gram matrix is positive semidefinite.

theorem Matrix.linearIndependent_of_posDef_gram E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] {v : n โ†’ E}, (Matrix.gram ๐•œ v).PosDef โ†’ LinearIndependent ๐•œ v

In a normed space, positive definiteness of gram ๐•œ v implies linear independence of v.

theorem Matrix.linearIndependent_of_det_gram_ne_zero E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : SeminormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] [inst_3 : Fintype n] [inst_4 : DecidableEq n] {v : n โ†’ E},
  (Matrix.gram ๐•œ v).det โ‰  0 โ†’ LinearIndependent ๐•œ v

theorem Matrix.posDef_gram_of_linearIndependent E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] {v : n โ†’ E}, LinearIndependent ๐•œ v โ†’ (Matrix.gram ๐•œ v).PosDef

In a normed space, linear independence of v implies positive definiteness of gram ๐•œ v.

theorem Matrix.posDef_gram_iff_linearIndependent E3 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] {v : n โ†’ E}, (Matrix.gram ๐•œ v).PosDef โ†” LinearIndependent ๐•œ v

In a normed space, linear independence of v is equivalent to positive definiteness of gram ๐•œ v.

theorem Matrix.det_gram_ne_zero_iff_linearIndependent E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] [inst_3 : Fintype n] [inst_4 : DecidableEq n] {v : n โ†’ E},
  (Matrix.gram ๐•œ v).det โ‰  0 โ†” LinearIndependent ๐•œ v

theorem Matrix.gram_eq_conjTranspose_mul E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] {ฮน : Type u_5} [inst_3 : Fintype ฮน] (b : OrthonormalBasis ฮน ๐•œ E) (v : n โ†’ E),
  Matrix.gram ๐•œ v =
    (Matrix.of fun i j โ†ฆ (b.repr (v j)).ofLp i).conjTranspose * Matrix.of fun i j โ†ฆ (b.repr (v j)).ofLp i

theorem Matrix.gram_eq_one_iff_orthonormal E0 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] [inst_3 : DecidableEq n] {v : n โ†’ E}, Matrix.gram ๐•œ v = 1 โ†” Orthonormal ๐•œ v

theorem Matrix.posSemidef_opNorm_smul_gram_sub_gram E1 #

โˆ€ {E : Type u_1} {n : Type u_2} {๐•œ : Type u_4} [inst : RCLike ๐•œ] [inst_1 : NormedAddCommGroup E]
  [inst_2 : InnerProductSpace ๐•œ E] {F : Type u_5} [inst_3 : NormedAddCommGroup F] [inst_4 : InnerProductSpace ๐•œ F]
  (v : n โ†’ E) (f : E โ†’L[๐•œ] F), (โ€–fโ€– ^ 2 โ€ข Matrix.gram ๐•œ v - Matrix.gram ๐•œ (โ‡‘f โˆ˜ v)).PosSemidef

Inequality โ€–f xโ€– โ‰ค โ€–fโ€– * โ€–xโ€– lifted to Gram matrices.