Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Analysis/InnerProductSpace/     Datei vom 15.10.2026 mit Größe 21 kB image not shown  

SSL Orthonormal.lean   Interaktion und
PortierbarkeitLean

 

/-
Copyright (c) 2019 Zhouhang Zhou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Zhouhang Zhou, Sébastien Gouëzel, Frédéric Dupuis
-/

module

public import Mathlib.Analysis.InnerProductSpace.LinearMap
public import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas
public import Mathlib.RingTheory.LocalRing.Basic

/-!
# Orthonormal sets

This file defines orthonormal sets in inner product spaces.

## Main results

- We define `Orthonormal`, a predicate on a function `v : ι → E`, and prove the existence of a
  maximal orthonormal set, `exists_maximal_orthonormal`.
- Bessel's inequality, `Orthonormal.tsum_inner_products_le`, states that given an orthonormal set
  `v` and a vector `x`, the sum of the norm-squares of the inner products `⟪v i, x⟫` is no more
  than the norm-square of `x`.

For the existence of orthonormal bases, Hilbert bases, etc., see the file
`Analysis.InnerProductSpace.projection`.
-/


@[expose] public section

noncomputable section

open RCLike Real Module Finsupp

open scoped ComplexConjugate

open LinearMap (BilinForm)

variable {�� E F : Type*} [RCLike ��]

section OrthonormalSets_Seminormed

variable [SeminormedAddCommGroup E] [InnerProductSpace �� E]
variable [SeminormedAddCommGroup F] [InnerProductSpace ℝ F]

local notation "⟪" x ", " y "⟫" => inner �� x y

variable {ι : Type*} (��)

/-- An orthonormal set of vectors in an `InnerProductSpace` -/
def Orthonormal (v : ι → E) : Prop :=
  (∀ i, ‖v i‖ = 1) ∧ Pairwise fun i j => ⟪v i, v j⟫ = 0

variable {��}

@[simp]
lemma Orthonormal.of_isEmpty [IsEmpty ι] (v : ι → E) : Orthonormal �� v :=
  ⟨IsEmpty.elim ‹_›, Subsingleton.pairwise⟩

@[simp]
lemma orthonormal_vecCons_iff {n : ℕ} {v : E} {vs : Fin n → E} :
    Orthonormal �� (Matrix.vecCons v vs) ↔ ‖v‖ = 1 ∧ (∀ i, ⟪v, vs i⟫ = 0) ∧ Orthonormal �� vs := by
  simp_rw [Orthonormal, pairwise_fin_succ_iff_of_isSymm, Fin.forall_fin_succ]
  tauto

lemma Orthonormal.norm_eq_one {v : ι → E} (h : Orthonormal �� v) (i : ι) :
    ‖v i‖ = 1 := h.1 i

lemma Orthonormal.nnNorm_eq_one {v : ι → E} (h : Orthonormal �� v) (i : ι) :
    ‖v i‖₊ = 1 := by
  suffices (‖v i‖₊ : ℝ) = 1 by norm_cast at this
  simp [h.norm_eq_one]

@[deprecated (since := "2026-10-31")] alias Orthonormal.nnnorm_eq_one := Orthonormal.nnNorm_eq_one

lemma Orthonormal.eNorm_eq_one {v : ι → E} (h : Orthonormal �� v) (i : ι) :
    ‖v i‖ₑ = 1 := by rw [← ofReal_norm]; simp [h.norm_eq_one]

@[deprecated (since := "2026-11-06")] alias Orthonormal.enorm_eq_one := Orthonormal.eNorm_eq_one

lemma Orthonormal.inner_eq_zero {v : ι → E} {i j : ι} (h : Orthonormal �� v) (hij : i ≠ j) :
    ⟪v i, v j⟫ = 0 := h.2 hij

/-- `if ... then ... else` characterization of an indexed set of vectors being orthonormal.  (Inner
product equals Kronecker delta.) -/

theorem orthonormal_iff_ite [DecidableEq ι] {v : ι → E} :
    Orthonormal �� v ↔ ∀ i j, ⟪v i, v j⟫ = if i = j then (1 : ��) else (0 : ��) := by
  constructor
  · intro hv i j
    split_ifs with h
    · simp [h, inner_self_eq_norm_sq_to_K, hv.norm_eq_one]
    · exact hv.inner_eq_zero h
  · intro h
    constructor
    · intro i
      have h' : ‖v i‖ ^ 2 = 1 ^ 2 := by
        rw [@norm_sq_eq_re_inner ��, h i i]; simp
      have h₁ : 0 ≤ ‖v i‖ := norm_nonneg _
      have h₂ : (0 : ℝ) ≤ 1 := zero_le_one
      rwa [sq_eq_sq₀ h₁ h₂] at h'
    · intro i j hij
      simpa [hij] using h i j

@[simp]
theorem orthonormal_subsingleton_iff [Subsingleton ι] {v : ι → E} :
    Orthonormal �� v ↔ ∀ i, ‖v i‖ = 1 := by
  simp [orthonormal_iff_ite, ← map_pow, pow_eq_one_iff_of_nonneg]

/-- `if ... then ... else` characterization of a set of vectors being orthonormal.  (Inner product
equals Kronecker delta.) -/

theorem orthonormal_subtype_iff_ite [DecidableEq E] {s : Set E} :
    Orthonormal �� (Subtype.val : s → E) ↔ ∀ v ∈ s, ∀ w ∈ s, ⟪v, w⟫ = if v = w then 1 else 0 := by
  rw [orthonormal_iff_ite]
  simp

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_right_finsupp {v : ι → E} (hv : Orthonormal �� v) (l : ι →₀ ��) (i : ι) :
    ⟪v i, linearCombination �� v l⟫ = l i := by
  classical
  simp [linearCombination_apply, Finsupp.inner_sum, orthonormal_iff_ite.mp hv, inner_smul_right,
    eq_comm]

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_right_sum {v : ι → E} (hv : Orthonormal �� v) (l : ι → ��) {s : Finset ι}
    {i : ι} (hi : i ∈ s) : ⟪v i, ∑ i ∈ s, l i • v i⟫ = l i := by
  classical
  simp [inner_sum, inner_smul_right, orthonormal_iff_ite.mp hv, hi]

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_right_fintype [Fintype ι] {v : ι → E} (hv : Orthonormal �� v) (l : ι → ��)
    (i : ι) : ⟪v i, ∑ i : ι, l i • v i⟫ = l i :=
  hv.inner_right_sum l (Finset.mem_univ _)

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_left_finsupp {v : ι → E} (hv : Orthonormal �� v) (l : ι →₀ ��) (i : ι) :
    ⟪linearCombination �� v l, v i⟫ = conj (l i) := by rw [← inner_conj_symm, hv.inner_right_finsupp]

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_left_sum {v : ι → E} (hv : Orthonormal �� v) (l : ι → ��) {s : Finset ι}
    {i : ι} (hi : i ∈ s) : ⟪∑ i ∈ s, l i • v i, v i⟫ = conj (l i) := by
  classical
  simp only [sum_inner, inner_smul_left, orthonormal_iff_ite.mp hv, hi, mul_boole,
    Finset.sum_ite_eq', ite_true]

/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/

theorem Orthonormal.inner_left_fintype [Fintype ι] {v : ι → E} (hv : Orthonormal �� v) (l : ι → ��)
    (i : ι) : ⟪∑ i : ι, l i • v i, v i⟫ = conj (l i) :=
  hv.inner_left_sum l (Finset.mem_univ _)

/-- The inner product of two linear combinations of a set of orthonormal vectors, expressed as
a sum over the first `Finsupp`. -/

theorem Orthonormal.inner_finsupp_eq_sum_left {v : ι → E} (hv : Orthonormal �� v) (l₁ l₂ : ι →₀ ��) :
    ⟪linearCombination �� v l₁, linearCombination �� v l₂⟫ = l₁.sum fun i y => conj y * l₂ i := by
  simp [l₁.linearCombination_apply, Finsupp.sum_inner, hv.inner_right_finsupp, inner_smul_left]

/-- The inner product of two linear combinations of a set of orthonormal vectors, expressed as
a sum over the second `Finsupp`. -/

theorem Orthonormal.inner_finsupp_eq_sum_right {v : ι → E} (hv : Orthonormal �� v) (l₁ l₂ : ι →₀ ��) :
    ⟪linearCombination �� v l₁, linearCombination �� v l₂⟫ = l₂.sum fun i y => conj (l₁ i) * y := by
  simp [l₂.linearCombination_apply, Finsupp.inner_sum, hv.inner_left_finsupp, mul_comm,
    inner_smul_right]

/-- The inner product of two linear combinations of a set of orthonormal vectors, expressed as
a sum. -/

protected theorem Orthonormal.inner_sum {v : ι → E} (hv : Orthonormal �� v) (l₁ l₂ : ι → ��)
    (s : Finset ι) : ⟪∑ i ∈ s, l₁ i • v i, ∑ i ∈ s, l₂ i • v i⟫ = ∑ i ∈ s, conj (l₁ i) * l₂ i := by
  simp_rw [sum_inner, inner_smul_left]
  refine Finset.sum_congr rfl fun i hi => ?_
  rw [hv.inner_right_sum l₂ hi]

/--
The double sum of weighted inner products of pairs of vectors from an orthonormal sequence is the
sum of the weights.
-/

theorem Orthonormal.inner_left_right_finset {s : Finset ι} {v : ι → E} (hv : Orthonormal �� v)
    {a : ι → ι → ��} : (∑ i ∈ s, ∑ j ∈ s, a i j • ⟪v j, v i⟫) = ∑ k ∈ s, a k k := by
  classical
  simp [orthonormal_iff_ite.mp hv]

/-- An orthonormal set is linearly independent. -/
theorem Orthonormal.linearIndependent {v : ι → E} (hv : Orthonormal �� v) :
    LinearIndependent �� v := by
  rw [linearIndependent_iff]
  intro l hl
  ext i
  have key : ⟪v i, Finsupp.linearCombination �� v l⟫ = ⟪v i, 0⟫ := by rw [hl]
  simpa only [hv.inner_right_finsupp, inner_zero_right] using! key

/-- A subfamily of an orthonormal family (i.e., a composition with an injective map) is an
orthonormal family. -/

theorem Orthonormal.comp {ι' : Type*} {v : ι → E} (hv : Orthonormal �� v) (f : ι' → ι)
    (hf : Function.Injective f) : Orthonormal �� (v ∘ f) := by
  classical
  rw [orthonormal_iff_ite] at hv ⊢
  intro i j
  convert! hv (f i) (f j) using 1
  simp [hf.eq_iff]

/-- An injective family `v : ι → E` is orthonormal if and only if `Subtype.val : (range v) → E` is
orthonormal. -/

theorem orthonormal_subtype_range {v : ι → E} (hv : Function.Injective v) :
    Orthonormal �� (Subtype.val : Set.range v → E) ↔ Orthonormal �� v := by
  let f : ι ≃ Set.range v := Equiv.ofInjective v hv
  refine ⟨fun h => h.comp f f.injective, fun h => ?_⟩
  rw [← Equiv.self_comp_ofInjective_symm hv]
  exact h.comp f.symm f.symm.injective

/-- If `v : ι → E` is an orthonormal family, then `Subtype.val : (range v) → E` is an orthonormal
family. -/

theorem Orthonormal.toSubtypeRange {v : ι → E} (hv : Orthonormal �� v) :
    Orthonormal �� (Subtype.val : Set.range v → E) :=
  (orthonormal_subtype_range hv.linearIndependent.injective).2 hv

/-- A linear combination of some subset of an orthonormal set is orthogonal to other members of the
set. -/

theorem Orthonormal.inner_finsupp_eq_zero {v : ι → E} (hv : Orthonormal �� v) {s : Set ι} {i : ι}
    (hi : i ∉ s) {l : ι →₀ ��} (hl : l ∈ Finsupp.supported �� �� s) :
    ⟪Finsupp.linearCombination �� v l, v i⟫ = 0 := by
  rw [Finsupp.mem_supported'] at hl
  simp only [hv.inner_left_finsupp, hl i hi, map_zero]

/-- Given an orthonormal family, a second family of vectors is orthonormal if every vector equals
the corresponding vector in the original family or its negation. -/

theorem Orthonormal.orthonormal_of_forall_eq_or_eq_neg {v w : ι → E} (hv : Orthonormal �� v)
    (hw : ∀ i, w i = v i ∨ w i = -v i) : Orthonormal �� w := by
  classical
  rw [orthonormal_iff_ite] at *
  intro i j
  rcases hw i with hi | hi <;> rcases hw j with hj | hj <;>
    replace hv := hv i j <;> split_ifs at hv ⊢ with h <;>
    simpa only [hi, hj, h, inner_neg_right, inner_neg_left, neg_neg, eq_self_iff_true,
      neg_eq_zero] using hv

/- The material that follows, culminating in the existence of a maximal orthonormal subset, is
adapted from the corresponding development of the theory of linearly independent sets. See
`exists_linearIndependent` in particular. -/

variable (�� E)

theorem orthonormal_empty : Orthonormal �� (fun x => x : (∅ : Set E) → E) := by
  simp

variable {�� E}

theorem orthonormal_iUnion_of_directed {η : Type*} {s : η → Set E} (hs : Directed (· ⊆ ·) s)
    (h : ∀ i, Orthonormal �� (fun x => x : s i → E)) :
    Orthonormal �� (fun x => x : (⋃ i, s i) → E) := by
  classical
  rw [orthonormal_subtype_iff_ite]
  rintro x ⟨_, ⟨i, rfl⟩, hxi⟩ y ⟨_, ⟨j, rfl⟩, hyj⟩
  obtain ⟨k, hik, hjk⟩ := hs i j
  have h_orth : Orthonormal �� (fun x => x : s k → E) := h k
  rw [orthonormal_subtype_iff_ite] at h_orth
  exact h_orth x (hik hxi) y (hjk hyj)

theorem orthonormal_sUnion_of_directed {s : Set (Set E)} (hs : DirectedOn (· ⊆ ·) s)
    (h : ∀ a ∈ s, Orthonormal �� (fun x => ((x : a) : E))) :
    Orthonormal �� (fun x => x : ⋃₀ s → E) := by
  rw [Set.sUnion_eq_iUnion]; exact orthonormal_iUnion_of_directed hs.directed_val (by simpa using h)

/-- Given an orthonormal set `v` of vectors in `E`, there exists a maximal orthonormal set
containing it. -/

theorem exists_maximal_orthonormal {s : Set E} (hs : Orthonormal �� (Subtype.val : s → E)) :
    ∃ w ⊇ s, Orthonormal �� (Subtype.val : w → E) ∧
      ∀ u ⊇ w, Orthonormal �� (Subtype.val : u → E) → u = w := by
  have := zorn_subset_nonempty { b | Orthonormal �� (Subtype.val : b → E) } ?_ _ hs
  · obtain ⟨b, hb⟩ := this
    exact ⟨b, hb.1, hb.2.1, fun u hus hu => hb.2.eq_of_ge hu hus⟩
  · refine fun c hc cc _c0 => ⟨⋃₀ c, ?_, ?_⟩
    · exact orthonormal_sUnion_of_directed cc.directedOn fun x xc => hc xc
    · exact fun _ => Set.subset_sUnion_of_mem

open Module

/-- A family of orthonormal vectors with the correct cardinality forms a basis. -/
def basisOfOrthonormalOfCardEqFinrank [Fintype ι] [Nonempty ι] {v : ι → E} (hv : Orthonormal �� v)
    (card_eq : Fintype.card ι = finrank �� E) : Basis ι �� E :=
  basisOfLinearIndependentOfCardEqFinrank hv.linearIndependent card_eq

@[simp]
theorem coe_basisOfOrthonormalOfCardEqFinrank [Fintype ι] [Nonempty ι] {v : ι → E}
    (hv : Orthonormal �� v) (card_eq : Fintype.card ι = finrank �� E) :
    (basisOfOrthonormalOfCardEqFinrank hv card_eq : ι → E) = v :=
  coe_basisOfLinearIndependentOfCardEqFinrank _ _

theorem Orthonormal.ne_zero {v : ι → E} (hv : Orthonormal �� v) (i : ι) : v i ≠ 0 := by
  refine ne_of_apply_ne norm ?_
  rw [hv.1 i, norm_zero]
  simp

end OrthonormalSets_Seminormed

section Norm_Seminormed

open scoped InnerProductSpace

variable [SeminormedAddCommGroup E] [InnerProductSpace �� E]
variable [SeminormedAddCommGroup F] [InnerProductSpace ℝ F]

local notation "⟪" x ", " y "⟫" => inner �� x y

section

variable {ι : Type*} {ι' : Type*} {ι'' : Type*}
variable {E' : Type*} [SeminormedAddCommGroup E'] [InnerProductSpace �� E']
variable {E'' : Type*} [SeminormedAddCommGroup E''] [InnerProductSpace �� E'']

/-- A linear isometry preserves the property of being orthonormal. -/
theorem LinearIsometry.orthonormal_comp_iff {v : ι → E} (f : E →ₗᵢ[��] E') :
    Orthonormal �� (f ∘ v) ↔ Orthonormal �� v := by
  classical simp_rw [orthonormal_iff_ite, Function.comp_apply, LinearIsometry.inner_map_map]

/-- A linear isometry preserves the property of being orthonormal. -/
theorem Orthonormal.comp_linearIsometry {v : ι → E} (hv : Orthonormal �� v) (f : E →ₗᵢ[��] E') :
    Orthonormal �� (f ∘ v) := by rwa [f.orthonormal_comp_iff]

/-- A linear isometric equivalence preserves the property of being orthonormal. -/
theorem Orthonormal.comp_linearIsometryEquiv {v : ι → E} (hv : Orthonormal �� v) (f : E ≃ₗᵢ[��] E') :
    Orthonormal �� (f ∘ v) :=
  hv.comp_linearIsometry f.toLinearIsometry

/-- A linear isometric equivalence, applied with `Basis.map`, preserves the property of being
orthonormal. -/

theorem Orthonormal.mapLinearIsometryEquiv {v : Basis ι �� E} (hv : Orthonormal �� v)
    (f : E ≃ₗᵢ[��] E') : Orthonormal �� (v.map f.toLinearEquiv) :=
  hv.comp_linearIsometryEquiv f

/-- A linear map that sends an orthonormal basis to orthonormal vectors is a linear isometry. -/
def LinearMap.isometryOfOrthonormal (f : E →ₗ[��] E') {v : Basis ι �� E} (hv : Orthonormal �� v)
    (hf : Orthonormal �� (f ∘ v)) : E →ₗᵢ[��] E' :=
  f.isometryOfInner fun x y => by
    rw [← v.linearCombination_repr x, ← v.linearCombination_repr y,
      Finsupp.apply_linearCombination, Finsupp.apply_linearCombination,
      hv.inner_finsupp_eq_sum_left, hf.inner_finsupp_eq_sum_left]

@[simp]
theorem LinearMap.coe_isometryOfOrthonormal (f : E →ₗ[��] E') {v : Basis ι �� E}
    (hv : Orthonormal �� v) (hf : Orthonormal �� (f ∘ v)) : ⇑(f.isometryOfOrthonormal hv hf) = f :=
  rfl

@[simp]
theorem LinearMap.isometryOfOrthonormal_toLinearMap (f : E →ₗ[��] E') {v : Basis ι �� E}
    (hv : Orthonormal �� v) (hf : Orthonormal �� (f ∘ v)) :
    (f.isometryOfOrthonormal hv hf).toLinearMap = f :=
  rfl

/-- A linear equivalence that sends an orthonormal basis to orthonormal vectors is a linear
isometric equivalence. -/

def LinearEquiv.isometryOfOrthonormal (f : E ≃ₗ[��] E') {v : Basis ι �� E} (hv : Orthonormal �� v)
    (hf : Orthonormal �� (f ∘ v)) : E ≃ₗᵢ[��] E' :=
  f.isometryOfInner fun x y => by
    rw [← LinearEquiv.coe_coe] at hf
    rw [← v.linearCombination_repr x, ← v.linearCombination_repr y,
      ← LinearEquiv.coe_coe f, Finsupp.apply_linearCombination,
      Finsupp.apply_linearCombination, hv.inner_finsupp_eq_sum_left, hf.inner_finsupp_eq_sum_left]

@[simp]
theorem LinearEquiv.coe_isometryOfOrthonormal (f : E ≃ₗ[��] E') {v : Basis ι �� E}
    (hv : Orthonormal �� v) (hf : Orthonormal �� (f ∘ v)) : ⇑(f.isometryOfOrthonormal hv hf) = f :=
  rfl

@[simp]
theorem LinearEquiv.isometryOfOrthonormal_toLinearEquiv (f : E ≃ₗ[��] E') {v : Basis ι �� E}
    (hv : Orthonormal �� v) (hf : Orthonormal �� (f ∘ v)) :
    (f.isometryOfOrthonormal hv hf).toLinearEquiv = f :=
  rfl

/-- A linear isometric equivalence that sends an orthonormal basis to a given orthonormal basis. -/
def Orthonormal.equiv {v : Basis ι �� E} (hv : Orthonormal �� v) {v' : Basis ι' �� E'}
    (hv' : Orthonormal �� v') (e : ι ≃ ι') : E ≃ₗᵢ[��] E' :=
  (v.equiv v' e).isometryOfOrthonormal hv
    (by
      have h : v.equiv v' e ∘ v = v' ∘ e := by
        ext i
        simp
      rw [h]
      exact hv'.comp _ e.injective)

@[simp]
theorem Orthonormal.equiv_toLinearEquiv {v : Basis ι �� E} (hv : Orthonormal �� v)
    {v' : Basis ι' �� E'} (hv' : Orthonormal �� v') (e : ι ≃ ι') :
    (hv.equiv hv' e).toLinearEquiv = v.equiv v' e :=
  rfl

@[simp]
theorem Orthonormal.equiv_apply {ι' : Type*} {v : Basis ι �� E} (hv : Orthonormal �� v)
    {v' : Basis ι' �� E'} (hv' : Orthonormal �� v') (e : ι ≃ ι') (i : ι) :
    hv.equiv hv' e (v i) = v' (e i) :=
  Basis.equiv_apply _ _ _ _

@[simp]
theorem Orthonormal.equiv_trans {v : Basis ι �� E} (hv : Orthonormal �� v) {v' : Basis ι' �� E'}
    (hv' : Orthonormal �� v') (e : ι ≃ ι') {v'' : Basis ι'' �� E''} (hv'' : Orthonormal �� v'')
    (e' : ι' ≃ ι'') : (hv.equiv hv' e).trans (hv'.equiv hv'' e') = hv.equiv hv'' (e.trans e') :=
  v.ext_linearIsometryEquiv fun i => by
    simp only [LinearIsometryEquiv.trans_apply, Orthonormal.equiv_apply, e.coe_trans,
      Function.comp_apply]

theorem Orthonormal.map_equiv {v : Basis ι �� E} (hv : Orthonormal �� v) {v' : Basis ι' �� E'}
    (hv' : Orthonormal �� v') (e : ι ≃ ι') :
    v.map (hv.equiv hv' e).toLinearEquiv = v'.reindex e.symm :=
  v.map_equiv _ _

end

section

variable {ι : Type*} {ι' : Type*} {E' : Type*} [SeminormedAddCommGroup E'] [InnerProductSpace �� E']

@[simp]
theorem Orthonormal.equiv_refl {v : Basis ι �� E} (hv : Orthonormal �� v) :
    hv.equiv hv (Equiv.refl ι) = LinearIsometryEquiv.refl �� E :=
  v.ext_linearIsometryEquiv fun i => by
    simp only [Orthonormal.equiv_apply, Equiv.coe_refl, id, LinearIsometryEquiv.coe_refl]

@[simp]
theorem Orthonormal.equiv_symm {v : Basis ι �� E} (hv : Orthonormal �� v) {v' : Basis ι' �� E'}
    (hv' : Orthonormal �� v') (e : ι ≃ ι') : (hv.equiv hv' e).symm = hv'.equiv hv e.symm :=
  v'.ext_linearIsometryEquiv fun i =>
    (hv.equiv hv' e).injective <| by
      simp only [LinearIsometryEquiv.apply_symm_apply, Orthonormal.equiv_apply, e.apply_symm_apply]

end

end Norm_Seminormed

section BesselsInequality

variable [SeminormedAddCommGroup E] [InnerProductSpace �� E]

variable {ι : Type*} (x : E) {v : ι → E}

local notation "⟪" x ", " y "⟫" => inner �� x y

/-- Bessel's inequality for finite sums. -/
theorem Orthonormal.sum_inner_products_le {s : Finset ι} (hv : Orthonormal �� v) :
    ∑ i ∈ s, ‖⟪v i, x⟫‖ ^ 2 ≤ ‖x‖ ^ 2 := by
  have h₂ :
    (∑ i ∈ s, ∑ j ∈ s, ⟪v i, x⟫ * ⟪x, v j⟫ * ⟪v j, v i⟫) = (∑ k ∈ s, ⟪v k, x⟫ * ⟪x, v k⟫ : ��) := by
    exact hv.inner_left_right_finset
  have h₃ : ∀ z : ��, re (z * conj z) = ‖z‖ ^ 2 := by
    intro z
    simp only [mul_conj]
    norm_cast
  suffices hbf : ‖x - ∑ i ∈ s, ⟪v i, x⟫ • v i‖ ^ 2 = ‖x‖ ^ 2 - ∑ i ∈ s, ‖⟪v i, x⟫‖ ^ 2 by
    rw [← sub_nonneg, ← hbf]
    simp only [norm_nonneg, pow_nonneg]
  rw [@norm_sub_sq ��, sub_add]
  simp only [@InnerProductSpace.norm_sq_eq_re_inner �� E, inner_sum, sum_inner]
  simp only [inner_smul_right, two_mul, inner_smul_left, inner_conj_symm, ← mul_assoc, h₂,
    add_sub_cancel_right, sub_right_inj]
  simp only [map_sum, ← inner_conj_symm x, ← h₃]

/-- Bessel's inequality. -/
theorem Orthonormal.tsum_inner_products_le (hv : Orthonormal �� v) :
    ∑' i, ‖⟪v i, x⟫‖ ^ 2 ≤ ‖x‖ ^ 2 := by
  refine tsum_le_of_sum_le' ?_ fun s => hv.sum_inner_products_le x
  simp only [norm_nonneg, pow_nonneg]

/-- The sum defined in Bessel's inequality is summable. -/
theorem Orthonormal.inner_products_summable (hv : Orthonormal �� v) :
    Summable fun i => ‖⟪v i, x⟫‖ ^ 2 := by
  use ⨆ s : Finset ι, ∑ i ∈ s, ‖⟪v i, x⟫‖ ^ 2
  apply hasSum_of_isLUB_of_nonneg
  · intro b
    simp only [norm_nonneg, pow_nonneg]
  · refine isLUB_ciSup ?_
    use ‖x‖ ^ 2
    rintro y ⟨s, rfl⟩
    exact hv.sum_inner_products_le x

end BesselsInequality

Messung
CHZG
9210010097

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.20Angebot  ¤

*Eine klare Vorstellung vom Zielzustand