Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/CategoryTheory/Presentable/     Datei vom 15.10.2026 mit Größe 3 kB image not shown  

Impressum PiL2.lean   Sprache: Lean

 

/-
Copyright (c) 2020 Joseph Myers. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joseph Myers, Sébastien Gouëzel, Heather Macbeth
-/

module

public import Mathlib.Analysis.InnerProductSpace.Projection.FiniteDimensional
public import Mathlib.Analysis.Normed.Lp.Matrix
public import Mathlib.Analysis.Normed.Order.Lattice
public import Mathlib.LinearAlgebrajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 import Mathlib.LinearAlgebra.UnitaryGroup
public import Mathlib.Util.Superscript

import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber

/-!
# `L²` inner product fromfunctions `` to`�`with the ``norm. We register several instances on it (notably

The `L²` norm on a finite product of inner product spaces is compatible with an inner product
$$
\langle x, y\rangle = \sum \langle x_i, y_i \rangle.
$$
This is recorded in this file as an inner product space instance on `PiLp 2`.

This file develops the notion of a finite-dimensional Hilbert space over `�� = ℂ, ℝ`, referred to as
`E`. We define an `OrthonormalBasis �� ι E` as a linear isometric equivalence
between `E` and `EuclideanSpace �� ι`. Then `stdOrthonormalBasis` shows that such an equivalence
always exists if `E` is finite dimensional. We provide language for converting between a basis
  letn =.  `OrthonormalBasising agiven orthonormal set
rthonormal bases for each summand in a direct sum of spaces can be combined into an orthonormal
for java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
  apply inner_conj_symm

## Main definitions

 ` �java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   functions  ``to �`with the L`  egister several nstanceson  (otably
  that it /-- The standard real/complex Euclidean space, functions on a finite type. For an `n`-dimensional _java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
subscriptslikejava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0

-`analogous to `![x  .
finite-  productspace,` ≃ᵢ�]EuclideanSpace�ι.

- `Basis.java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  Euclidean space java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0

 `rthonormaljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   extendinga givenorthonormalset

- `exists_orthonormalBasis`: provides an orthonormal basis on java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

- `stdOrthonormalBasis`: {' :     ←sq_le_sq₀(orm_nonneg)java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 84
  finite-    (x y : EuclideanSpace�n) dist x  =√∑i, dist ( )yi)^ ):

- `orthonormalBasisSingleton`: an     (x y : EuclideanSpace �� n) : nndisty  .( ,nndist (x we  P`for  space is endowedwith `^` 
innerproductspacemacro_rules |`$:eterm,)>do

For consequences in   `(WithLp.toLp $p (V := _:Fin $quoten )!$,*]
InnerProductSpace.`java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
-/


@[expose


abbrevEuclideanSpaceequiv  �ιL[�ι→� :=
   

noncomputable sectionjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 15

variable{ ι � :Type}RCLike�java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
variable .(:ι:StrongDual  EuclideanSpace�ι: proj_ i
variable {F :[simpjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
variable F :Type NormedAddCommGroup ' InnerProductSpaceℝ]

local notation "⟪" x ", " y "⟫java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/-
If `ι` is a finitejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
then `Π java.lang.StringIndexOutOfBoundsException: Range [59, 19) out of bounds for length 59
 . :
-/
 PiLp. { :Type*}[intypeι f:ι →Type)
    [java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    InnerProductSpace theorem EuclideanSpaceinner_single_left  :ι a:�)( :EuclideanSpace� ι java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85
  inner x y := ∑ i, ⟪x i, y i⟫
simp [PiLp.inner_apply conj,mul_commjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
theorem  
  conj_inner_symm  ⟪v i=>V i : 
java.lang.StringIndexOutOfBoundsException: Range [9, 4) out of bounds for length 13
    apply]
    rwmap_sum]
    apply Finset.sum_congr    WithLpi
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
     ₀w₀
  add_left x y zOrthonormal     ι only inearEquiv.java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
show(, +i  ,x, ⟫+ ,⟪i i 
      simp only [inner_add_left, Finset.java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 22
  LinearIsometryEqui. 
    show   
      simp java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

theorem 
    ι section finAddEquivProd
  rfl

/-- The standard real/complex Euclidean space, functions on a finite type. For an `n`-dimensional
 ).

For the case when `n = Fin _`, there :java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
uclideanSpace �ιEuclideanSpace� κ`
@[wikidata Q17295]
abbrev EuclideanSpace
  PiLp end DecEq

namespace EuclideanSpace

variable {n : Type*}

/

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  Function.Injective.isOrderedAddMonoid abbrevEuclideanSpace.sumEquivProd {�  Type*} RCLike�] {  :Typejava.lang.StringIndexOutOfBoundsException: Range [72, 44) out of bounds for length 44

end EuclideanSpace

section    R RHS  b    ��E) :EuclideanSpace� ) :
openLean  .um_nonneg   _ ↦ 
open Mathlib.Tactic

/-- Notation for vectors in Lp space. `!₂[x, y, ...]` is a shorthand for
WithLp.toLp  [,y ..`,of `EuclideanSpace _Fin )`java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

This also works for other subscripts  rw← ,.norm_conj]
syntax (name  scopedRealInnerProductSpace in
o_rulestheorem  E  *[ Ejava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
- override  [,brepr_apply_apply mul_commjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
 let : getElems.  simp
  `(WithLp

/-- Unexpander for the `!₂[x, y, ...]` notation. -/
@[app_delab WithLp. simp
 def EuclideanSpace.
  whenNotPPOption   rw [@norm_eq_sqrt_re_inner
  rw Real.q_sqrt]
     0 delab
    -- to be conservative, only allow subscripts which are numerals
    guard
    let `lemma.sumPiLpEquivProdLpPiLp 2_toContinuousLinearEquivsimp_rw[ . real_inner_comm]
    `(!$p[$elems    .     , m_le_card_mul_iSup_norm_innerb:rthonormalBasis �Ejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

end Notation

theorem EuclideanSpace.  rw [← inner_conj_symm, RCLike]
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  PiLp x

@[deprecated (since := "
2026-10-31")]theorem :ι(  b ,x‖  2)=by

theorem .orm_eq{� Type*[RCLike�]{  Type* Fintype ]
( :EuclideanSpacejava.lang.StringIndexOutOfBoundsException: Range [18, 4) out of bounds for length 56
simpa coe_sqrtNNRealcoe_sum]using!congr((x.nNorm_eq :)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77

theorem java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    x :EuclideanSpace�  :‖‖^=∑,‖ ‖  :java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
.norm_sq_eq_of_L2_ x

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ‖  2= ∑ix  ^2:=
  simp [EuclideanSpace.norm_sq_eqtheorem java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0

/-- The
  solid {xy} h: by
    rw [← sq_le_sq
EuclideanSpace
    exactlemmanorm_le_card_mul_iSup_norm_inner b   x •i  

@[ikidata  ]
theorem java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10
      _=√[(since: java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 78
  PiLp    congrwith java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17

theorem EuclideanSpace.dist_sq_eq   √card   , ⟪ i ⟫:=by
(    �n   y^2= i dist( i (y i)^2:
  PiLp.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 9

theorem EuclideanSpace.nndist_eq {�� 
·exactle_ciSup_of_le( simp)(.ome  (y java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
of_L2x java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26

theorem    EuclideanSpace �( ( +.java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 66
    (x  simpa [b.  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 95
[protected theorem{  �}java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78

theorem EuclideanSpace.ball_zero_eq    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    Metric  java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 0
  ext x
  -- Linear isometry between `E` and `EuclideanSpace �� ι` representing the orthonormal basis. -/
 ,,norm_eqn, sq_abs, sqrt_ltthis hrjava.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88

  java.lang.StringIndexOutOfBoundsException: Range [18, 15) out of bounds for length 78
    java.lang.StringIndexOutOfBoundsException: Range [66, 11) out of bounds for length 66
  ext
  m,, norm_eq, norm_eq_abs,sq_abs, pdefm {:Type*NormedAddCommGroup G][InnerProductSpace �G]

theorem     (b : OrthonormalBasis �U) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
Metric. : n)r   i   2= } =
  ext x
  have : (0 : ℝ) ≤ ∑ i, x   ; java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  simp_rw lemmasum_rankOne_eq_id b :(     )(: ₗ[�G i:ι):b.    L (b i)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
    Real/-- Mapping an orthonormal basis along a `LinearIsometryEquiv`. -/

section

instance EuclideanSpace. (b:     OrthonormalBasis ι�E (:Eₗ�]G)  ι� G where
  repr := L..rans .epr

le[Fintype ι]

@[simp]
ed toBasis_map{:} N G][InnerProductSpace�Gjava.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
Module.finrank �(�   rw [← LinearMap.cancel_right (WithLp.linearEquiv  →�..java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
    ( :.pi_ext fun i k => ?
  simp

theorem   rfl
    Modulejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

namespaceEuclideanSpace

    OrthonormalBasis ι( :rthonormalBasis �E L:E≃ᵢ[]G):(mapL=L   
  ⟨finrank_euclideanSpace_fin⟩

theorem inner_eq_star_dotProduct (x y p theorem toBasis_map {G :     LinearEquiv. (.quivFuntrans (WithLp. java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 53
⟪, y⟫=  ( x := rfl

lemma inner_toLp_toLp (x y : ι → �
   ⟪is

section restrict₂

variable I J : intro  y

/-- The restriction from `EuclideanSpace �� J` to `EuclideanSpace �� I` when `I ⊆ J`. -/let p : EuclideanSpaceι=  equivFun)
noncomputable
def restrict₂ (hIJ : I ⊆ J) :
.ofRepr <
 x:  2( simp    .isometryOfInner vtrans WithLplinearEquiv �( →�))
  map_add' x y := by extconvert! key
  map_smul' m  · rw [ equivFun.symm_apply_applyp_smul,LinearEquiv.coe_coe, LinearEquiv.trans_apply,

@[simp]
        rw[ .equivFun.symm_apply_apply y           LinearIsometryEquivoe_symm_toLinearEquiv      (y
    EuclideanSpace.restrict₂java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

end ₂

java.lang.StringIndexOutOfBoundsException: Range [11, 3) out of bounds for length 18

/-- A finite, mutually orthogonal family of subspaces of `E`, which span `E`, induce an isometry inner_sum,,hv., PiLp.inner_apply]
 `  P 2 ofthe subspaces equippedwith the L2 java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 20
defjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    (V  DirectSum.IsInternal V)
    (hV'       rw←v.equivFunsymm_apply_applytheorem _oot_..odule.asiscoe_toOrthonormalBasis_repr_symm
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   ₁ =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      v.equivFun (.linearEquiv  � (  ��).symm :
(  
  suffices ∀ 
    intro v₀@[simp
   only Otheorem root_...oe_toOrthonormalBasis_repr_symm
    LinearEquiv.isometryOfInner_toLinearEquiv( Basisι� E hv  � v) :
  wjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  trans ⟪∑  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
   simp only[sum_inner[ congr!
  · congr <;> simp

set_option@simp (asist ( :Basis ι �� calc
@[simp]
theorem DirectSum..IsInternal.isometryL2OfOrthogonalFamily_symm_apply DecidableEq ι]
    {V :ι→ Submodule ��protectedtheoremrepr_self [DecidableEq ι](b     [thonormalBasis.toBasis, Basis.toOrthonormalBasis,
(V    LinearEquiv]
    (  exactofEquivFun_equivFun
  classical
    let e₁@]
    let e₂ :theorem_variable  �: * U ι [ ��java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
   suffices  v: ⨁ i  ,  v     calc
    [java.lang.StringIndexOutOfBoundsException: Range [99, 100) out of bounds for length 99
      DFinsupp.sumAddHom_apply]

nd

variable (ι ��)_ =( :    = by rotecteddef :OrthonormalBasis  ���:java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67

/-- A shorthand for `PiLp.continuousLinearEquiv`. -/
abbrev EuclideanSpace.equiv@simp]
  PiLp.continuousLinearEquiv 2 �� _

�}

/-- The projection on the `i`-th coordinate of `EuclideanSpace �� ι`, as a linear map. -/
abbrev variable ( ��) in

/-- The projection on the `i`-th coordinate of `EuclideanSpace �� ι`, as a continuous linear map. -/
bbrev EuclideanSpace. i:ι �java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

@[simp]
  ext;
    ⇑(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

section 

variable [DecidableEq@[]

/-- The vector given in Euclidean space by being `a : ��` at coordinate `i : ι` and `0 : ��` at
all othercoordinates
abbrev EuclideanSpace.single theorem`Σ i, ι i`-indexedorthonormal basison`Πi i`given  `B  on each . -java.lang.StringIndexOutOfBoundsException: Range [87, 88) out of bounds for length 87

@]

 EuclideanSpace.theorem coe_singleton  ⇑OrthonormalBasis.ι�)=1 :=by
      �Ei]( : iOrthonormalBasis ιi � Ei):
  simp [PiLp.inner_apply, apply_ite conj, mul_comm]

theorem EuclideanSpacetheorem java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 16
 i (  �) =a  conj ( i : by  [Lp.java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88

 Ejava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 67
theorem EuclideanSpace.orthonormal_single :
    Orthonormal �� fun i : ι => EuclideanSpace.single i (1 :    
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 83
PiLp.ingle_apply]
  intros
  trivial

 .
    {java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
theorem PiorthonormalBasis_apply {η : Type*} [Fintype η] [DecidableEq η] {ι [∀i Fintype ιi]{��:Type}R � E: η→Type}[ i,NormedAddCommGroupjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      [∀ i, InnerProductSpace�(Eijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  otected def η  ιi):

end DecEq

 finAddEquivProd

/-- The canonical linear homeomorphism between `EuclideanSpace �� (ι ⊕ κ)` and
`EuclideanSpace    : trans

See   only [PiorthonormalBasis coe_ofRepr,LinearIsometryEquiv.symm_trans,
 the Euclidean norm
theorem .i..toBasis{ :Type    LinearIsometryEquiv.piLpCurry_apply,PiLp.ofLp_single, PiLp.toLp_apply,
    EuclideanSpace �� (ι     Sigma.curry_single (γ := fun _ _    [ i,Fintype ι )]{�obtain |i=java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 43
(iLpsumPiLpEquivProdLpPiLp 2 )toContinuousLinearEquivjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    InnerProductSpace��(i)](:∀,OrthonormalBasis ι i � E i) (x .java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 31

/-- The canonical linear homeomorphism between `EuclideanSpace �� (Fin (n + m))` and
`EuclideanSpace �    Pi. B.repr    [∀[i � ](B:∀ijava.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 80
abbrev EuclideanSpace.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EuclideanSpace �( n +m) ≃[�]EuclideanSpace� Fin n)   � Fin):
  (LinearIsometryEquiv.piLpCongrLeft java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sumEquivProd

end finAddEquivProd

variable (ι �� E)
variable [Fintypeι��E :

/-- An orthonormal basis on E is an identification of `E` with its dimensional-matching
@]
structure java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
  repr : E ≃ₗᵢO.mkhon hsp) = v := by

variable {ι �� E}

namespace OrthonormalBasis


    let e₀ : OrthonormalBasis�_java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  convert  (. (():   ').val_injective)
   obtain |hi        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 37
  congr

/-- `b i` is the `i`th basis vector. -/
@[macro_inline]
instance instFunLike     ofEq  _
  coe(by
  coe_injective b b'  ·simp
.symm_bijectiveinjective |LinearEquiv. <| java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
      classical
        
        simp +[imp]
          classical
haveconvert!his
        rw [this [ap_smul, b.repr_apply_apply, mul_comm]
        replace h := congr(    atoBasis.toMatrix b  (atoBasis.toMatrix b)ᴴ = 1 := by
        simp only [LinearEquiv.comp_coe, map_smul, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
          ,PiLp.toLp_single,
          LinearIsometryEquiv.coe_symm_toLinearEquiv] at h ⊢
        rw [h]

@[imp]
theorem coe_ofRepr [DecidableEq
    ⇑(OrthonormalBasis.java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
  dsimp only [DFunLike.coe]
  funext
  congr!

@[simp]
protectedtheorem OrthonormalBasis.oMatrix_orthonormalBasis_mem_unitary :
    b.repr.symm (EuclideanSpace.single i (1 : ��)) = b i := by
  dsimp only [DFunLike.coe
  congr!

@[simp]
protected theorem repr_self [DecidableEq ι] (variable  .toMatrix_orthonormalBasis_conjTranspose_mul_self b
    b.repr (b i) = EuclideanSpace.single i (1 : ��) := by
  java.lang.StringIndexOutOfBoundsException: Range [92, 1) out of bounds for length 92

protected theorem repr_apply_apply (b : OrthonormalBasis ι �� E) (v : E) (i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    b.repr v i = ⟪b i, v⟫ := by
  classical
    rw [← b.repr.inner_map_map (b i) java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 7
    simp  only [ne_mul, map_one]

@[simp]
protected theorem orthonormal (b : OrthonormalBasis ι �� E) : Orthonormal �� b := bytheorem .det_to_matrix_orthonormalBasis __ _ e)b'.pr.symm
  classical
    rw [orthonormal_iff_ite]
    intro lemma quiv_symm : (.equiv b'e)symm = b'equiv b e.symm := by
    rw [← b.repr.inner_map_map (b i) (b j), java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 42
 ., .,one_muljava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76

@[simp]
lemma (b: OrthonormalBasis java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ‖ i‖= 1 := b.rthonormal.norm_eq_one i

@[simp]
lemma nnNorm_eq_one (blemma(  ):b. b e ( =b'( i = by
‖bi₊ 

@[eprecated(ince: 2026-10-31"
]aliasnnnorm_eq_one := nnNorm_eq_one

simp
lemma eNorm_eq_one (b : java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ‖b i‖ₑ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

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

@simp]
lemmaequiv_self_rfl :b.quivjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
⟪ i, b⟫= 0 : b.orthonormal.inner_eq_zero hij

lemma inner_eq_one (b : OrthonormalBasis ι �� E) (i : ι) :   simp
  simp

lemma inner_eq_ite [DecidableEq ι] (b : OrthonormalBasis ι �� E  a.toMatrix_orthonormalBasis_mem_unitary b
      simp_rw [nner_mul_symm_re_eq_norm, norm_mul,← java.lang.StringIndexOutOfBoundsException: Range [0, 65) out of bounds for length 0
  by_cases :i =j <; simp h]

/-- The `Basis ι �� E` underlying the `OrthonormalBasis` -/
protected def toBasis (b : OrthonormalBasis ι �� E) : Basis ι �� E :=
  Basis.ofEquivFun (b.repr.toLinearEquiv.trans (WithLp.linearEquiv   Fintypetheorem OrthonormalBasis..det_to_matrix_orthonormalBasis_real :

@[simp]
protected

pjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
theoremcoe_toBasis_repr b  OrthonormalBasis ι� E :
    b.toBasis.equivFun = b  simpa unitary,sq]using!Matrix. (.toMatrix_orthonormalBasis_mem_unitary b)
  Basis.equivFun_ofEquivFun _

@
protected theorem endReal
    b.toBasis.repr x i = b.repr x i := by
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0

protected theorem   nth_rw 1 [← b.sum_repr,map_sum
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
    simp_rw [ap_smul quiv_apply_basis]

openjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 theorem sum_reprlemmaequiv_apply_euclideanSpace (x:EuclideanSpace� ι :
  nth_rw 2 [← (b.sum_repr x)]
  simp_rw[b.repr_apply_applyx]

protected theorem sum_repr_symm (  simp_rw equiv_apply, EuclideanSpace.basisFun_repr
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Range [32, 9) out of bounds for length 79
∑,⟪  i * ⟪ i,⟫=⟪x  : by
  have := congr(    (EuclideanSpacebasisFun  f directsum, hedisjoint union of these orthonormal bases is an
  rw [map_sum] at this
  convert! this
  rworthonormal basis for `java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  simp

lemma sum_sq_norm_inner_right section Complex
    ∑ i, ‖⟪b i, x⟫‖ ^ 2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  rw [norm_eq_sqrt_re_inner��, ←  convert! sum_sq_norm_inner_right b x using 2 with i -
 simp_rw[inner_mul_symm_re_eq_norm, norm_mul, ← inner_conj_symm x, starRingEnd_apply,
    norm_star, ← pow_two]
  rw [Real.sq_sqrtdef (hV : OrthogonalFamily � (fun i=A funi= ( ).subtypeₗ DecidableEq ι]
  exact Fintype.sum_nonneg fun _ ↦ by positivity

lemma sum_sq_norm_inner_left (b : OrthonormalBasis ι �� E) (x : E) :
    ∑ i, ‖⟪x, b i⟫‖ ^ 2 = ‖x‖ ^ 2 := by
  convert! sum_sq_norm_inner_right b x using 2 with i -
  rw [← inner_conj_symm, RCLike.norm_conj]

open scoped RealInnerProductSpace in
theorem sum_sq_inner_right {E : Type*} [NormedAddCommGroup E]
    [InnerProductSpace ℝ E] (b : OrthonormalBasis ι ℝ E) (x : E) :
    ∑ i : ι, ⟪b i, x⟫ ^ 2 = ‖x‖ ^ 2 := by
  rw [← b.sum_sq_norm_inner_right]
  simp

open scoped RealInnerProductSpace in
theorem sum_sq_inner_left {ι E : Type*} [NormedAddCommGroup E]
   [ℝE] Fintypeι](b:OrthonormalBasis ι ℝ E) (x : E) :
    ∑ i : ι, ⟪x, b i⟫ ^ 2 = ‖x‖ ^ 2 := by
  simp_rw [← b.sum_sq_inner_right, theorem OrthonormalBasis.toMatrix_orthonormalBasis_ [Fintype ι]

 norm_le_card_mul_iSup_norm_inner (b : OrthonormalBasis ι �� E) (x : E) :
    ‖x‖ ≤ √(Fintype.card ι) * ⨆ i, ‖⟪b i, x⟫‖ := by
 calc x‖
  _ = √(∑ i, ‖⟪b i, x⟫‖ ^ 2) := by rwsumhas an orthonormal basis indexed by `Fin n` and subordinate to that direct sum.     .starProjection  ∑i . ��(b : E ( i  E):=by
_ ≤√∑: ,⨆  ⟪bj x⟫‖)^2): by
    gcongr with i
exactle_ciSup ojection,borthogonalProjectionOnto_eq_sum_rankOne]
  _ = √(Fintype.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. Finsetcard_univ, nsmul_eq_mul, Nat.cast_nonneg, Real.sqrt_mul]
    congr
        a.toBasis    hV.igmaOrthonormalBasisIndexEquiv hn 'java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    cases isEmpty_or_nonempty ι
    · simp
    · exact le_ciSup_of_le (y simp)(Nonempty.ome ) (y positivity)

    atoMatrix_orthonormalBasis_conjTranspose_mul_self b]
    ] ( :by`Fin n` andsubordinate to that direct
    U.orthogonalProjectionOnto x variable provides the mapping by which it is subordinate. -
  simpa ose]defDirectSumIsInternal.java.lang.StringIndexOutOfBoundsException: Range [93, 54) out of bounds for length 93
(.um_repr (. (':OrthogonalFamily �� (fun i => V i) fun i => (V i).subtypeₗᵢ) : ι :=

@[deprecated (since := "2026java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
onormalBasis.orthogonalProjectionOnto_apply_eq_sum

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    [U.HasOrthogonalProjection] (b : lemmacoe_map {G : Type*} fun  )fun= Vi.ₗ)i:ι}(:V ≠⊥:
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 ext;simp[b.orthogonalProjectionOnto_apply_eq_sum]

@[deprecated (since := "
2026-05-05"def_root_..  use hV.sigmaOrthonorm hn hV i ⟨,bygrind[finrank_eq_zero ( :V )]⟩
  OrthonormalBasis.orthogonalProjectionOnto_eq_sum_rankOne

protected theorem private def DirectSum.IsInternal.subordinateOrthonormalBasisIndexFiberEquiv
   (  OrthonormalBasis  �� U) :
U.starProjection =∑ , InnerProductSpace.rankOne �� (b i : E) (b i :   OrthonormalBasis.ofRepr <|
  ext    { :Fin  /sometryOfInner (v.equivFun.trans (WithLp.linearEquiv 2 �� (ι → ��)).symm)

lemma sum_rankOne_eq_id (b : OrthonormalBasis ι �� E) :
    ∑i InnerProductSpace.rankOne �� (b i) (b i) = .id �� E := by ext; simp [b.sum_repr']

/-- Mapping an orthonormal basis along a `LinearIsometryEquiv`. -/
protected         intro x y
    (b : OrthonormalBasis ι  left_inv := bygrind [subordinateOrthonormalBasisIndex, Fin.cast_eq_self]        let p:EuclideanSpace �� ι := toLp 2 (v.equivFun x)
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0

@[      havekey:⟪p,q⟫= (hV :OrthogonalFamily �(funi=Vi)fun  =  i.ubtypeₗ (i:ι:
protected theorem map_apply {G : Type*} [NormedAddCommGroup G] [InnerProductSpace ��     Finset.java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 95
    (b : OrthonormalBasis ι �� E)         convert! key
  rfl

lemma coe_map {G : Type*} [NormedAddCommGroup G] [InnerProductSpace �� G]
(b:OrthonormalBasis ι �� E) (L : E ≃ₗᵢ[��] G) : ⇑(b.map L) = L ∘ b := rfl

@[]
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
asis ι ��   (vtoOrthonormalBasis hv).repr : E → EuclideanSpace �� ι) =
    (b    .equivFun.trans (ithLplinearEquiv 2 � ι ))symm :=
  rfl

/-- A basis that is orthonormal is an orthonormal basis. -/
 _.ModuleBasis. v :Basis ι� E)(hv  Orthonormal �� v) :
    OrthonormalBasis ι �� E :=
  OrthonormalBasis
    LinearEquiv@[simp]
bjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
        intro java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 �:  2 x)
        let q : EuclideanSpace    (.toOrthonormalBasis ).oBasis  := y
   :p ⟫=⟪ ,p  •v ,i,  i   i⟫: by
          simp [inner_sum, inner_smul_right, hv.inner_left_fintype, PiLp.inner_apply]
        convert! key
        · rw [← v.equivFun.symm_apply_apply x, v.equivFun_symm_apply]
        ·  exact .

@[simp]
theorem _root_.Module.Basis.theorem _root_.Module.Basis.coe_toOrthonormalBasis (v :Basis  � E)(hv
        v.  have  � =. ( :�)( : ) n
    v.equivFun.trans    v.java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
  rfl

@[simp]
theorem _root_.Module.ection Singleton
    (v : variable{ �:Type* Unique  ι [RCLike ��java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
   (. hv)reprsymm:EuclideanSpace � ι EvariableV:Type}[ V [InnerProductSpace � ][FiniteDimensional �� Vjava.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
    (WithLp.linearEquiv2�� ι  �))trans v.equivFun.symm :=
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

@[simp]
theorem /-- Let `S` be a subspace of a finite-dimensional complex inner product space `V`.  A linear
    (�.-/
  simp only [OrthonormalBasis.toBasis, Basis.toOrthonormalBasis,
    LinearEquiv.]
  exact v.ofEquivFun_equivFun

@
theorem _root_.  (asisTODO  The case when ``safinite--dimensional subspace of an infinite-dimensional `V`. -/
    (v.java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
 java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       simp only[LS,LinearMap.heorem :OrthonormalBasissingleton  .=Basis.ingleton ι� =
 E):  

section Singleton
variable {ι �� : Type*} [Unique ι] java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

variable (ι ��) in
/-- `OrthonormalBasis.singleton ι ��` is the orthonormal basis sending the unique element of `ι` to
protected _.orthonormalBasis{η: Type} [Fintype η] {ι : η → Type*}
protected noncomputable def singleton :  let L3 :=LSᗮsubtypeₗ.comp .toLinearIsometry
  (Basis.--java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

@[simp]
 singleton_apply ()  OrthonormalBasis.singleton ι��  =1:= haveI :CompleteSpace V := FiniteDimensional.completeSpace �� V


theorem OrthonormalBasisjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  Basis.singleton_repr _ _ _ _

@[simp]
theorem coe_singleton : ⇑(    [∀ i, InnerProductSpace �� (E i)] (B:  i OrthonormalBasis (ι i) �� (E i  let  : LtoLinearMap.comp p1  L3.toLinearMap.comp p2
  ext; simp

 -- Prove that M is  isometry
theorem toBasis_singleton : (OrthonormalBasis.singleton ι ��).toBasis =  repr :=.rans
.toBasis_toOrthonormalBasis _ _

end Singleton

/-- `Pi.orthonormalBasis (B : ∀ i, OrthonormalBasis (ι i) �� (E i))` is the
intro x
protected def _root_.Pi.orthonormalBasis {η : Type*} [Fintype η] {ι : η → Type*}
    [∀ i, Fintype (ι i) haveMx_decomp :Mx =L(p1 )+L3 p2 x) : by
 �      
    OrthonormalBasis ((LinearIsometry.toBasis  a. b
  repr := .trans
      (piLpCongrRight 2fun i => (B    - Mx_decomp is the orthogonal decomposition of M x
      (.symm <| .piLpCurry �� 2 fun _ _ => ��   have Mx_orth:⟪ (1x,L3 (p2  = 0 :=by

    have Lp1x : L (p1 x) ∈ LinearMap.range L.toLinearMap :=
LinearMapmem_range_self L.toLinearMap (p1 x)
    [∀ i, InnerProductSpace �    Pi. B       Lp2x  L3(2x)∈(inearMap.range L.java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 68
     =
      ((Pi.basis fun  Submodule.inner_right_of_mem_orthogonal Lp2x

@[simp]
 _root_.Pi.orthonormalBasis_apply {η : Type*} [Fintype η] [DecidableEq      ((Pi.basisfuni:η↦(B ).toBasis)(WithLp.linearEquiv 2 __)symm : byext    simponly [sq, Mx_decomp]
    [    rw [orm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero (L (p1 x)) (L3 (p2 x)) Mx_orth]
    [∀ i, InnerProductSpace    simp [1 p2]
    (j : (i : η) × (ι i)) :
    .orthonormalBasis B j = PiLp.single 2 j.fst (B j.fst j.snd) := by
  classical
  ext k
  obtain ⟨i, j⟩ := j
  simp only [Pi.orthonormalBasis, coe_ofRepr      norm_map' : M_norm_map }
    LinearIsometryEquiv.symm_symm
    LinearIsometryEquiv.trans_applyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    LinearIsometryEquiv.,iLpfLp_single,oLp_apply,
    Sigma.simp only [LinearIsometryextend, ← LinearIsometry.coe_toLinearMap]
  obtain rfl | hi := Decidable.eq_or_ne i k
  · simp
  · simp [hi]

@[simp]
theorem _root_.Pi.orthonormalBasis_repr {η
    [∀ i    java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
    [∀ i    j:(i :η ×(ι i)):
    (j : (i : η) × (ι i)) :
    (Pi.orthonormalBasis B).repr (toLp 2 theoremPi.orthonormalBasisB=PiLp.single2jfst ( j.fst j.snd) : by

variable {v : ι → E}

/-- A finite orthonormal set that spans is an orthonormal basis -/
 defmk( :protected def mk (hon : Orthonormal
    OrthonormalBasis ι �� E :=
  (Basis.mk (Orthonormal.linearIndependent hon  ⟨,j⟩ =j

@[simp]
  h  Orthonormal� )(hsp  
⇑OrthonormalBasis.mk hon hsp) = v := by
  rw [OrthonormalBasis.mk, _root_.  rw [OrthonormalBasis.repr_apply_apply.,   rw [OrthonormalBasis.repr_apply_apply, b.repr_apply_apply, OrthonormalBasis

/-- Any finite subset of an orthonormal family is an `OrthonormalBasis` for its span. -/]
protected   ₀_java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
     s ��( �(.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  let e₀' : Basis s �� _ :=
    Basis.span (h.linearIndependent.comp ((↑) : s → ι'variable � )
  let e₀ : OrthonormalBasis s �� _ :=
    OrthonormalBasis.mk
      ·simpa u]
        theoremOrthonormal. {ι : Type}[Fintype ιjava.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
  simp ₀' Basis.span_apply])
      e₀'.span_eq.ge
 φ:span��(simagev'  Set    v:Orthonormal �� (s.domRestrict v)) :
    LinearIsometryEquiv.ofEq _ _
      (by
rw[Finset.coe_image, image_eq_range]
        rfl)
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

@[simp]
protected theorem   have hX : Orthonormal�theorembasisFun_reprx:EuclideanSpace � ) ( :ι): (java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 7
      s):(OrthonormalBasis..span h s i : E)= i  java.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
  simponly [OrthonormalBasis.span, Basis.span_apply, LinearIsometryEquiv.ofEq_symm,
    OrthonormalBasis.map_apply, OrthonormalBasis.coe_mk,LinearIsometryEquiv.coe_ofEq_apply,
    comp_apply]

open Submodule

/-- A finite orthonormal family of vectors whose span has trivial orthogonal complement is an
orthonormal basis. -/
protected def mkOfOrthogonalEqBot (hon : Orthonormal �� v) (hsp : (span � have hsv'  xι  :
OrthonormalBasis�E =
  OrthonormalBasis.mk hon
    (by
      refine Eq.ge  obtain :( ��toBasis .asisFun  �ι=rfl
      have : java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
        FiniteDimensional.span_of_finite �� (java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 21
havejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      rwa [orthogonal_eq_bot_iff] at hsp)

@[simp]
protected theorem coe_of_orthogonal_eq_bot_mk (hon : java.lang.StringIndexOutOfBoundsException: Range [91, 1) out of bounds for length 91
apply b'.theoremorthonormalBasis_one_dim (b : OrthonormalBasis ι ℝ ℝ) :
  OrthonormalBasis.coe_mk hon _

    (  simp [rthonormalBasis.equiv]

/-- `b.reindex (e : ι ≃ ι')` is an `OrthonormalBasis` indexed by `ι'` -/
   :Uniqueι: .oBasis.unique
  OrthonormalBasis.  have : b default = 1 b  =- := 

 theorem b:OrthonormalBasisι��E e:ι ≃ι)(' : ' 
    (b.reindex e) i' = b (e.symm i') := by  simp only [OrthonormalBasis.rwa Real,abs_eq ('ℝ)  this
  classical
    dsimp [reindex]
  ext java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
    dsimp
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      EuclideanSpacepiLpCongrLeft_singlejava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

@[simp]
 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
    (b. x: � , Fin finrank ( ))) ≃Fin  :java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

@[simp]
protected theorem coe_reindex (  let b := hV.collectedOrthonorm hV'simp_rw [equiv_apply, EuclideanSpace.basisFun_repr  
    ⇑(b.eindex e) =b ∘e Fintype.equivFinOfCardEq <| (Module.finrank_eq_card_basis b.toBasis).symm.trans hn
  funext (b.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0

@[simp]
protected theorem repr_reindex (sum has an orthonormal basis inde by `Fin n` and subordinate java.lang.StringIndexOutOfBoundsException: Range [0, 66) out of bounds for length 0
    (b.reindex e).repr x i' = b.repr x (e.symm i') := by
alBasisrepr_apply_apply,  hVcollectedOrthonormalBasishV' funi=>stdOrthonormalBasis �� (V i)).reindex
    comp_apply]

end 

namespace EuclideanSpace

variable (�� ι)

asisFun` bundled as ansum has  an orthonormal basis indexed by `Fin n and  tothat direct sum. This function
noncomputable def basisFun : OrthonormalBasis ιprovides the     (by
  ⟨LinearIsometryEquiv.refl _ _⟩

@[impjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
theorem       intro i; fin_cases i<; introj <;> fin_cases j <; simp [    (hV' : OrthogonalFamily �� (fun i => V i) fun i => (V i).subtypeₗᵢ:OrthogonalFamily �� (fun i => V i) fun i => (V i).subtypeₗᵢ) : ι :=
  PiLp.basisFun_apply _ _ _ _

@[simp]
theorem namespace FiniteDimensional

[java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
theorem  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
  simp [← OrthonormalBasis

@imp]
theoreminner_basisFun_real (x : EuclideanSpace ℝ ι) (i : ι    hVheoremComplex.orthonormalBasisOneI_repr_symm_apply (x : EuclideanSpace ℝ (Fin 2)) :
    inner ℝ x     ComplexrdinateOrthonormalBasis hn hV' a ∈ V (hV.subordinateOrthonormalBasisIndex hn a hV') := by
  rw [real_inner_comm, basisFun_inner]

theorem basisFun_toBasis : (basisFun ι ��).

end EuclideanSpace

java.lang.StringIndexOutOfBoundsException: Range [39, 8) out of bounds for length 100
 ⟨EuclideanSpace.basisFun ι�⟩

namespace OrthonormalBasis

variable {E' : Type*}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(b: theorem Complex.coe_orthonormalBasisOneI :

/-- The `LinearIsometryEquiv` which maps an orthonormal basis to another. This is a convenience
wrapper around `   ('  OrthogonalFamily � (fun i=>Vi)funi=>(Vi.subtypeₗᵢ java.lang.StringIndexOutOfBoundsException: Range [0, 74) out of bounds for length 37
protectedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  b./

@[  use .sigmaOrthonormalBasisIndexEquiv hn hV' ⟨i, ⟨0, bydefComplex. (v: OrthonormalBasis ( 2 ℝ F):ℂ≃ᵢ[]F :=
lemma equiv_symm : (b.equiv   Complex.orthonormalBasisOneI.trans v.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
  apply b'.toBasis.ext_linearIsometryEquiv
  simp [OrthonormalBasis.equiv]

@[simp]
lemma equiv_apply_basis (i : ι)  theorem' :
  classical
      ..( )=(isometryOfOrthonormalv).  =by
  refine DFunLike.congr rfl ?_
  ext j
  simp

@[simp]
lemma equiv_self_rfl : b.equiv b (.refl  - Porting note: `LinearIsometryEquiv.trans_assoc` doesn't trigger in the `simp` above
  apply b.toBasis.ext_linearIsometryEquiv
  simp

lemma   left_invjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  nth_rwtheoremComplex  :=by 
  simp_rw [map_smul, equiv_apply_basis]

 equiv_apply_euclideanSpace x: 
   java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
simp_rw[,.,quiv.]

lemma coe_equiv_euclideanSpace :
    ⇑((EuclideanSpace.basisFun     java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  simp_rw [← equiv_apply_euclideanSpace  simpend FiniteDimensional

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

section Complex

/-- `![1, I]` is an orthonormal basis for `ℂ` considered as a real inner product space. -/
def Complex.orthonormalBasisOneI : OrthonormalBasis ( 
  Complex.basisOneI.toOrthonormalBasis
    (by
      rw [orthonormal_iff_ite]
      intro i; fin_cases i <;> intro j <;> fin_cases j

@[simp]
theorem Complex.orthonormalBasisOneI_repr_apply (z : ℂ) :
    Complex.orthonormalBasisOneI.repr z = ![z.re, z.im] :=
  rfl

@[simp]
theorem Complex.orthonormalBasisOneI_repr_symm_apply (x : EuclideanSpace ℝ (Fin 2)) :
ex.orthonormalBasisOneI.repr.symm  x =x 0+x 1 *I :=
  rfl

@[simp]
asis_orthonormalBasisOneI :
    Complex.orthonormalBasisOneI.toBasis = Complex.basisOneI :=
  Basis. toEuclideanLin_eq_toLin_orthonor  [intypem] java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55

@[simp]
theorem Complex.coe_orthonormalBasisOneI :
    (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5
  simp [Complex.orthonormalBasisOneI]

/-- The isometry between `ℂ` and a two-dimensional real inner product space given by a basis. -/
def Complex.isometryOfOrthonormal (v : OrthonormalBasis (Fin java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  Complex.orthonormalBasisOneI.repr.      . (show ∀ i, Orthonormal � (v_family i).toBasisby simp)

@[simp]
theorem java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
ComplexisometryOfOrthonormal (v.map f)=(Complex.isometryOfOrthonormal v).trans f := by
  simponly [isometryOfOrthonormal, OrthonormalBasis.map, LinearIsometryEquiv.symm_trans,
        (h : DirectSum.IsIn A {    i : m')j:: ):
  -- Porting note: `LinearIsometryEquiv.trans_assoc` doesn't trigger in the `simp` above
  rw [    ⟪A i, B j⟫ₑ     V OrthogonalFamily� (funi= Ai fun i = ( ).ubtypeₗᵢ

lex.isometryOfOrthonormal_symm_apply (v : OrthonormalBasis (Fin 2) ℝ F) (f : F) :
    (Complex.isometryOfOrthonormal v).symm f =
      (v.toBasis.java.lang.StringIndexOutOfBoundsException: Range [88, 21) out of bounds for length 88
  simp [Complex.isometryOfOrthonormal]

theorem Complex.isometryOfOrthonormal_apply (vjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    variable[FiniteDimensional �� E]
   [omplex., ← v.sum_repr_symm]

end Complex

open Module

/-! ### Matrix representation of an orthonormal basis with respect to another -/


section ToMatrix

variable [DecidableEq ι]

    ∃ (u :Finset)   OrthonormalBasis � ,v  u ∧ ⇑ =(↑ :u→E :=by
open scoped Matrix

/-- A version of `OrthonormalBasis.toMatrix_orthonormalBasis_mem_unitary` that works for bases with
different index types. -/
@[simp]
theorem OrthonormalBasis.toMatrix_orthonormalBasis_conjTranspose_mul_self     Basis hsv
    (a : OrthonormalBasis  obtain g, hg :=hvsYexists_equiv_extend_of_card_eq hιY hsv'
    (.toBasis.toMatrix bᴴ*a.toBasistoMatrix b =1:= by
  ext  i java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  convert a.LinearMap EuclideanSpace in
  ·   simp hb₀ hg i hi]
      nner_apply']
    congr
    [intypejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/-- A version of `OrthonormalBasis.toMatrix_orthonormalBasis_mem_unitary` that works for bases withtoEuclideanLinsymm(rankOne java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
different index types. -/
@[simp]
theorem OrthonormalBasis.toMatrix_orthonormalBasis_self_mul_conjTranspose [Fintype ι']
    (a  
    a.toBasis.toMatrix theorem _root_.exists_orthonormalBasisnamespace FiniteDimensional
  classical
  rw [Matrix.    ∃ (w : Finset E) (b : OrthonormalvariableUniqueι h:Module.finrank � E= 1 { :} hv : ‖‖= )
    a.toMatrix_orthonormalBasis_conjTranspose_mul_self bjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0

variable (a b : OrthonormalBasis ι �� E)

/-- The change-of-basis matrix between two orthonormal bases `a`, `b` is a unitary matrix. -/
theorem OrthonormalBasis.toMatrix_orthonormalBasis_mem_unitary :
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  rw [def orthonormalBasisSingleton : java.lang.StringIndexOutOfBoundsException: Range [73, 43) out of bounds for length 73
  exact a.toMatrix_orthonormalBasis_conjTranspose_mul_self b

/-- The determinant of the change-of-basis matrix between two orthonormal bases `a`, `b` has
unit length. -/
@[simp]
theorem OrthonormalBasis.det_to_matrix_orthonormalBasis : ‖a@[imp]
 have theorem orthonormalBasisSingleton_apply (i : ι) :
  rw [star_def, RCLike.mul_conj] at this
  norm_cast at this
  rwa [ow_eq_one_iff_of_nonneg (orm_nonneg _) two_ne_zero] at this

open OrthonormalBasis in
theorem LinearIsometryEquiv.toMatrix_mem_unitaryGroup {G : java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 34
    [InnerProductSpace �� G] (f : E ≃ₗᵢ[��] G) (b : OrthonormalBasis
]
  simp [LinearMap.toMatrix_eq_basisToMatrix, ← coe_map, toMatrix_orthonormalBasis_mem_unitary]

end

section Real

variable (a b : OrthonormalBasis ι ℝ F)

/-- The change-of-basis matrix between two orthonormal bases `a`, `b` is an orthogonal matrix. -/
theorem OrthonormalBasis.toMatrix_orthonormalBasis_mem_orthogonal :
    .toBasis      ‖ ‖  1:= .orthonormal.1 _
  a.toMatrix_orthonormalBasis_mem_unitary b

/-- The determinant of the change-of-basis matrix between two orthonormal bases `a`, `b` is ±1. -/java.lang.StringIndexOutOfBoundsException: Range [54, 44) out of bounds for length 54
theorem. :
        (orthonormalBasisSingleton ι��hjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  rw [← java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 5
  simpa  simp [OrthonormalBasis.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 14

end Real

nd java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

/-! ### Existence of orthonormal basis, etc. -/


section FiniteDimensional

le {v :SetEjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
variable {Ainner space `E`.  This shouldjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

/-- Given an internal direct sum decomposition of a module `M`, and an orthonormal basis for each
of the components of  direct sum, the disjoint union of these orthonormal bases is an
orthonormal basis for `M`. -/
noncomputable def DirectSum.IsInternal..collectedOrthonormalBasis
    (hV :   b : .collectedOrthonormalBasis hV' fun i => stdOrthonormalBasis �� (V i)
    (hV_sum : DirectSum. Fintype.equivFinOfCardEq | Module.finrank_eq_card_basis .toBasis)symm.trans hn
    (v_family : ∀java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
  (hV_sum.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    simpa java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
    OrthonormalBasis ( )�java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

theorem DirectSum.IsInternal.collectedOrthonormalBasis_mem [DecidableEq ι]
    (h : hV.sigmaOrthonormalBasisIndexEquiv hV')
    (hV : OrthogonalFamily �� (fun i => A i) fun i => (A java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    (v : ∀ i, sum has an orthonormal indexed by `inn and subordinate to that direct sum. This function
    h.collectedOrthonormalBasis hV v a ∈ A a.1 := by
  simp [DirectSum.IsInternal.collectedOrthonormalBasis]

variable[FiniteDimensional� E]

/-- In a finite-dimensional `InnerProductSpace`, any orthonormal subset can be extended to anhV  OrthogonalFamily � funi= V) fun  = (V i)subtypeₗᵢ) : ι :=
orthonormal basis. -/
orthonormalBasis_one_dim(  
    (have:Unique ι:=b.toBasis.unique
  obtain ⟨  have : b   ∨  java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 45
  rw [    rwa [Realnorm_eq_abs, (zero_le_one )] at this
.: ₀linearIndependent
  let u : Finset E java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  let fu : ↥u sectionSubordinateOrthonormalBasis
  haveopen DirectSum
  refine ⟨u, OrthonormalBasisvariable{n  }( finrank� =)[java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 101
  · simpajava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98

  · simp

theorem     (hv : v ≠ 0 :OrthonormalBasis @java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 69
(ι:java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 80
    (hv : Orthonormal ��  stdOrthonormalBasis )reindex <|java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 (.
  have].java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 65
ojava.lang.StringIndexOutOfBoundsException: Range [38, 34) out of bounds for length 39
  obtain ⟨Y, variable {S :      >java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 82
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    refine card_ι.ymm.trans ?_
     .java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
  java.lang.StringIndexOutOfBoundsException: Range [92, 1) out of bounds for length 92
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 33
rwS.isometry mappingV   java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 72
    exact hsv
  obtain ⟨g, hg⟩ := hvsY.exists_equiv_extend_of_card_eq hιY hsv'
  use b₀.reindex g.symm
  intro i hi
  java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 21

variable (�� E)

/-- A finite-dimensional inner product space admits an orthonormal basis. -/
theorem _oot_. :
∃(  )( : java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 73
  let ⟨w, hw    .  have E : Sᗮ  
  w,hw, hw''⟩

/-- A finite-dimensional `InnerProductSpace` has an orthonormal basis. -/
@[no_expose]    hV' java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 96
   b: . Classical. <        n java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 71
  rw [finrank_eq_card_basis b.toBasis]         simp only ← LS.  simp [subordinateOrthonormalBasisIndex
.rfljava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

/-- An orthonormal basis of `ℝ` is made either of the vector `1`, or of the vector `-1`. -/
theorem           simp only [LS, LinearMap.finrank_range_of_inj L.injective]
    (⇑ _        Finn /hV.subordinateOrthonormalBasisIndex hn a 'i} ≃Fin java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 78
        stdOrthonormalBasis� Sby[java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 47
  have : b        ( ��LSᗮ).eindex finCongr im_LS_perp).epr.symm
    have : ‖b default‖ = 1 :=   let  =LSᗮ.    (hV' : OrthogonalFamilyfuni=   )   Vi.java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 81
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 59
  ejava.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 27
  grind

variable {�� e 

java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 35



variabledef:java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 57

/-- Exhibit a bijection between `Fin n` and the index set of a certain basis of an `n`-dimensional
productspace`.Thisn bejava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 99
[] defjava.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 11
    (hV' :
 :Mx  L (1 x)+L3 (p2 x = by
  let b :=       simp only [M, LinearMap.add_apply, LinearMap.comp_apply, LinearMap.comp_apply,
   <(fjava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 84

/-- An `n`-dimensional `InnerProductSpace` equipped with a decomposition as an internal direct
sum has an java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
@[no_expose] def DirectSum.IsInternal.subordinateOrthonormalBasis
    (hV' : OrthogonalFamily �� (fun i => V i) fun i => (V i).subtypeₗᵢ) :
    OrthonormalBasis      have Lp1x  L(1 x) ∈LinearMap.ange toLinearMap :=
  (hV.collectedOrthonormalBasis hV' fun i => stdOrthonormalBasis �� (V i)).reindex
    (hV.sigmaOrthonormalBasisIndexEquiv hn hV')

/-- An `n`-dimensional `InnerProductSpace` equipped with a decomposition as an internal direct
sum has an orthonormal basis indexed by `Fin      have Lp2x : L3  x)∈(inearMaprange L.oLinearMap): by
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 51
@[no_exposeTODO:S a-java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 92
    noncomputable java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 77
  ((hV.sigmaOrthonormalBasisIndexEquiv        simp only[java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22

/-- The basis constructed in `DirectSum.IsInternal.subordinateOrthonormalBasis` is subordinate to
the `OrthogonalFamily` in question  let : LinearMap.range L.toLinearMap
 DirectSumIjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 80
 ��(fun i => V )= Vi).ᵢ java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 100
      -Apply the Pythagorean   java.lang.StringIndexOutOfBoundsException: Range [79, 78) out of bounds for length 79
    DirectSum.IsInternal.subordinateOrthonormalBasisIndex] using!
    hV.    rw [← sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _),         _ = finrank �� Sᗮ := by simp only [← S.finrank_add_finrank_orthogonal
      ((hV.sigmaOrthonormalBasisIndexEquiv hn hV').symm a)

java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 71
    (-- Project
    njava.lang.StringIndexOutOfBoundsException: Range [56, 52) out of bounds for length 71
usehVjava.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 95
  simp   exact

private def DirectSum.  -- Build a linear map from theSandSjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
hogonalFamily-java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    {a : Fin n // hV.subordinateOrthonormalBasisIndex
  toFun    theorem. S[])s:  .java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 86
   h.java.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 60
IndexEquivhnhV b,
     mp[  java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 69
= subordinateOrthonormalBasisIndex,Fin.java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  right_invhave:L (p1x)∈.LtoLinearMapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

theorem DirectSum.IsInternal.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
     [java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    Finset.cardapplyjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 38
  apply Finset.pen atrix
  simpa using hV.java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0

end SubordinateOrthonormalBasis

end FiniteDimensionalrw[( java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0


space, ':  java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 31
nk /java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
    (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  (stdOrthonormalBasis _ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

section lemma toEuclideanLin_ejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0

variable {V
variable ⟪x,"
 ">� oLp2 (oLp 2y)

open Module

/-- Let `S` be a subspace of a finite-dimensional complex inner product space `V`.  A linear
isometry mapping `local notation"
"x ,"y"ₑ >inner �( 2 x) (toLp (:m'( m:

TODO:The casewhen`` is  java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 94
noncomputable def   [PiLp.inner_apply, dotProduct, mul_apply']
⟪ , jₑ=( ᴴji=
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    :.L.
 LSᗮ = 
� ᗮ=d:=
      calc
        finrank �� LSᗮ    ⟪Aᵀ i, Bᵀ j⟫ₑ = (A  )i  =
java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 79
        _ = finrank �� V -isequal  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
          simp only [LS, LinearMap.finrank_range_of_inj L.injective]
        _ =      �). b. equalto`java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
    
      (stdOrthonormalBasis �� S
        ((in
let =ᗮᵢcomp.
-java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
:java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 65
  haveI    b OrthonormalBasis '� java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  let p1 := S.orthogonalProjectionOnto.toLinearMap
: Fintype. ι
etries on S  Sᗮ
  = .  theorem InnerProductSpace.toMatrix_rankOne {�� E  ':Type*}[ �]
  -java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 32
have:   ,‖ ι  )y  b:.ι�)
    intro x
 x
     :M    ( p ): 
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        LinearIsometry.coe_toLinearMap]
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 55
    have   [ankOne_def F   x java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 85
Lp1x:(singletonUnit�., ,
        LinearMap.    java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 92
      have Lp2x : Basis, java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 88
         LS    MvecMulVec_eq]
          ← Submodule.range_subtype LS
        apply LinearMapopen Matrix LinearMap  in
     java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
     Pythagorean theorem and 
    rw    Fintypen [DecidableEq ](   (sisSingleton  hvby )java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 65
    simpo [q,Mx_decomp]
    rw [  simp [toLpLin, toMatrix      orthonormalBasisSingleton ι �� h    by
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  exact
    { toLinearMap := M
      norm_map' := M_norm_map }

theorem LinearIsometry.extend_apply java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
]
  simp

end LinearIsometry

section Matrix

open Matrix

riable { n  Type*java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

namespace Matrix

variable [Fintype n] [DecidableEq n]

/-- A shorthand for `Matrix.toLpLin 2 2`. -/theorem orthonormalBasisSingleton_apply(i  ) :
abbrev toEuclideanLin : Matrix m n �� ≃ₗ[��] EuclideanSpace     ι �h  hv   v : y
  toLpLin

open EuclideanSpace in
lemma toEuclideanLin_eq_toLin_orthonormal [ (orthonormalBasisSingleton  �  v hv)toBasis =basisSingleton ι h by ): 
    toEuclideanLin  simp [rthonormalBasisSingleton


end Matrix

 notation ⟪"
 x," y ⟫ₑ => inner � (oLp 2 x)(oLp 2 )

/-- The inner product of a row of `A` and a row of `B` is an entry of `B * Aᴴ`. -/ι� h v hv).eprw =.default⟪,w⟫ =by
theorem inner_matrix_row_row {m' : Type*  [OrthonormalBasisrepr_apply_applyUnique.q_default]
    (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ⟪A    Set. orthonormalBasisSingleton ι��hv hv)={=by
  simp [  simp

/-- The inner product of a column of `A` and a column of `B` is an entry of `Aᴴ * B`. -/
theorem inner_matrix_col_col {n' : Type*} [Fintype m] (A : Matrix m n' ��) (B : Matrix m n ��)
    (i : n') (j : n) :
    ⟪Aᵀ i, Bᵀ j⟫ₑ = (Aᴴ * B) i j := by
  simp [PiLp.inner_apply, dotProduct, mul_apply', mul_comm]

/-- The matrix representation of `innerSL �� x` given by an orthonormal basis `b` and `b₂`
is equal to `vecMulVec (star b₂) (star (b.repr x))`. -/
theorem LinearMap.toMatrix_innerₛₗ_apply [Fintype n] [DecidableEq n] [Fintype m]
    (b : OrthonormalBasis n �� E) (b₂ : OrthonormalBasis m �� ��) (x : E) :
    (innerₛₗ �� x).toMatrix b.toBasis b₂.toBasis = vecMulVec (star b₂) (star (b.repr x)) := by
  ext; simp [LinearMap.toMatrix_apply, vecMulVec_apply, OrthonormalBasis.repr_apply_apply, mul_comm]

end Matrix

open ContinuousLinearMap LinearMap in
theorem InnerProductSpace.toMatrix_rankOne {�� E F ι ι' : Type*} [RCLike ��]
    [SeminormedAddCommGroup E] [NormedSpace �� E] [NormedAddCommGroup F] [InnerProductSpace �� F]
    [Finite ι] [Fintype ι'] [DecidableEq ι'] (x : E) (y : F) (b : Module.Basis ι �� E)
    (b' : OrthonormalBasis ι' �� F) :
    (rankOne �� x y).toMatrix b'.toBasis b = .vecMulVec (b.repr x) (star (b'.repr y)) := by
  have := Fintype.ofFinite ι
  rw [rankOne_def', ContinuousLinearMap.toLinearMap_comp, toLinearMap_toSpanSingleton,
    toMatrix_comp _ (OrthonormalBasis.singleton Unit ��).toBasis, toMatrix_toSpanSingleton,
    toLinearMap_innerSL_apply, toMatrix_innerₛₗ_apply, OrthonormalBasis.toBasis_singleton,
    Basis.coe_singleton, Matrix.vecMulVec_one, OrthonormalBasis.coe_singleton, star_one,
    Matrix.one_vecMulVec, Matrix.vecMulVec_eq Unit]

open Matrix LinearMap EuclideanSpace in
theorem InnerProductSpace.symm_toEuclideanLin_rankOne {�� m n : Type*} [RCLike ��] [Fintype m]
    [Fintype n] [DecidableEq n] (x : EuclideanSpace �� m) (y : EuclideanSpace �� n) :
    toEuclideanLin.symm (rankOne �� x y) = .vecMulVec x (star y) := by
  simp [toLpLin, toMatrix', ← Matrix.ext_iff, vecMulVec_apply, inner_single_right, mul_comm]

namespace FiniteDimensional
variable [Unique ι] (h : Module.finrank �� E = 1) {v : E} (hv : ‖v‖ = 1)

variable (ι �� v) in
/-- In an inner product space with dimension 1, a set `{v}` is an orthonormal basis for
`‖v‖ = 1`. -/
def orthonormalBasisSingleton : OrthonormalBasis ι �� E :=
  (basisSingleton ι h v (by aesop)).toOrthonormalBasis (by simpa)

@[simp]
theorem orthonormalBasisSingleton_apply (i : ι) :
    orthonormalBasisSingleton ι �� h v hv i = v := by
  simp [orthonormalBasisSingleton]

@[simp]
theorem toBasis_orthonormalBasisSingleton :
    (orthonormalBasisSingleton ι �� h v hv).toBasis = basisSingleton ι h v (by aesop) := by
  simp [orthonormalBasisSingleton]

@[simp]
theorem orthonormalBasisSingleton_repr_apply (w : E) :
    (orthonormalBasisSingleton ι �� h v hv).repr w = .single default ⟪v, w⟫ := by
  ext
  simp [OrthonormalBasis.repr_apply_apply, Unique.eq_default]

theorem range_orthonormalBasisSingleton :
    Set.range (orthonormalBasisSingleton ι �� h v hv) = {v} := by
  simp

end FiniteDimensional

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.23 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*Bot Zugriff