Skip to content

Commit 78a26d5

Browse files
chore: split WithLp.equiv into a new pair WithLp.toLp/WithLp.ofLp (#26459)
`(WithLp.equiv p _).symm v` is very inconvenient as a normal form when working with `WithLp`. This introduces `WithLp.toLp p v` as the simp-normal spelling of this operation, and `v'.ofLp` as the simp-normal spelling of `WithLp.equiv p _ v'`. It then deprecates almost all the lemmas about `WithLp.equiv`, as these are no longer stated in simp-normal form. The motivation for making `toLp` and `ofLp` as plain functions, as opposed to `Equiv`s, is to permit them to be later adapted into a constructor and projection of a one-field structure. Almost nothing in mathlib needs them to be equivs anyway. Zulip thread: [#mathlib4 > defeq abuse in &#96;WithLp&#96; @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/defeq.20abuse.20in.20.60WithLp.60/near/516241777) Co-authored-by: Yael Dillies <yael.dillies@gmail.com> Co-authored-by: Paul Lezeau <paul.lezeau@gmail.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
1 parent 51b3aad commit 78a26d5

File tree

21 files changed

+650
-357
lines changed

21 files changed

+650
-357
lines changed

Mathlib/Analysis/CStarAlgebra/Matrix.lean

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ coincide with the existing topology and uniformity on matrices.
3636
3737
-/
3838

39-
39+
open WithLp
4040
open scoped Matrix
41+
4142
variable {𝕜 m n l E : Type*}
4243

4344
section EntrywiseSupNorm
@@ -113,15 +114,21 @@ lemma coe_toEuclideanCLM_eq_toEuclideanLin (A : Matrix n n 𝕜) :
113114
rfl
114115

115116
@[simp]
117+
lemma toEuclideanCLM_toLp (A : Matrix n n 𝕜) (x : n → 𝕜) :
118+
toEuclideanCLM (n := n) (𝕜 := 𝕜) A (toLp _ x) = toLp _ (A *ᵥ x) := rfl
119+
120+
@[deprecated toEuclideanCLM_toLp (since := "2025-05-07")]
116121
lemma toEuclideanCLM_piLp_equiv_symm (A : Matrix n n 𝕜) (x : n → 𝕜) :
117122
toEuclideanCLM (n := n) (𝕜 := 𝕜) A ((WithLp.equiv _ _).symm x) =
118-
(WithLp.equiv _ _).symm (A *ᵥ x) :=
119-
rfl
123+
(WithLp.equiv _ _).symm (A *ᵥ x) := rfl
120124

121125
@[simp]
126+
lemma ofLp_toEuclideanCLM (A : Matrix n n 𝕜) (x : EuclideanSpace 𝕜 n) :
127+
ofLp (toEuclideanCLM (n := n) (𝕜 := 𝕜) A x) = A *ᵥ ofLp x := rfl
128+
129+
@[deprecated ofLp_toEuclideanCLM (since := "2025-05-07")]
122130
lemma piLp_equiv_toEuclideanCLM (A : Matrix n n 𝕜) (x : EuclideanSpace 𝕜 n) :
123-
WithLp.equiv _ _ (toEuclideanCLM (n := n) (𝕜 := 𝕜) A x) =
124-
A *ᵥ (WithLp.equiv _ _ x) :=
131+
WithLp.equiv _ _ (toEuclideanCLM (n := n) (𝕜 := 𝕜) A x) = A *ᵥ (WithLp.equiv _ _ x) :=
125132
rfl
126133

127134
/-- An auxiliary definition used only to construct the true `NormedAddCommGroup` (and `Metric`)

Mathlib/Analysis/Calculus/FDeriv/WithLp.lean

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import Mathlib.Analysis.Calculus.FDeriv.Prod
77
import Mathlib.Analysis.Calculus.FDeriv.Equiv
88
import Mathlib.Analysis.Normed.Lp.PiLp
99

10-
1110
/-!
1211
# Derivatives on `WithLp`
1312
-/
1413

15-
section PiLp
14+
open ContinuousLinearMap PiLp WithLp
1615

17-
open ContinuousLinearMap
16+
section PiLp
1817

1918
variable {𝕜 ι : Type*} {E : ι → Type*} {H : Type*}
2019
variable [NontriviallyNormedField 𝕜] [NormedAddCommGroup H] [∀ i, NormedAddCommGroup (E i)]
@@ -55,29 +54,48 @@ theorem hasFDerivWithinAt_piLp :
5554

5655
namespace PiLp
5756

58-
theorem hasStrictFDerivAt_equiv (f : PiLp p E) :
59-
HasStrictFDerivAt (WithLp.equiv p (∀ i, E i))
60-
(PiLp.continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
57+
theorem hasStrictFDerivAt_ofLp (f : PiLp p E) :
58+
HasStrictFDerivAt ofLp (continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
6159
.of_isLittleO <| (Asymptotics.isLittleO_zero _ _).congr_left fun _ => (sub_self _).symm
6260

63-
theorem hasStrictFDerivAt_equiv_symm (f : PiLp p E) :
64-
HasStrictFDerivAt (WithLp.equiv p (∀ i, E i)).symm
65-
(PiLp.continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
61+
@[deprecated hasStrictFDerivAt_ofLp (since := "2025-05-07")]
62+
theorem hasStrictFDerivAt_equiv (f : ∀ i, E i) :
63+
HasStrictFDerivAt (WithLp.equiv p _)
64+
(continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
65+
hasStrictFDerivAt_ofLp _ f
66+
67+
theorem hasStrictFDerivAt_toLp (f : ∀ i, E i) :
68+
HasStrictFDerivAt (toLp p) (continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
6669
.of_isLittleO <| (Asymptotics.isLittleO_zero _ _).congr_left fun _ => (sub_self _).symm
6770

71+
@[deprecated hasStrictFDerivAt_toLp (since := "2025-05-07")]
72+
theorem hasStrictFDerivAt_equiv_symm (f : ∀ i, E i) :
73+
HasStrictFDerivAt (WithLp.equiv p _).symm
74+
(continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
75+
hasStrictFDerivAt_toLp _ f
76+
6877
nonrec theorem hasStrictFDerivAt_apply (f : PiLp p E) (i : ι) :
6978
HasStrictFDerivAt (𝕜 := 𝕜) (fun f : PiLp p E => f i) (proj p E i) f :=
70-
(hasStrictFDerivAt_apply i f).comp f (hasStrictFDerivAt_equiv (𝕜 := 𝕜) p f)
79+
(hasStrictFDerivAt_apply i f).comp f (hasStrictFDerivAt_ofLp (𝕜 := 𝕜) p f)
80+
81+
theorem hasFDerivAt_ofLp (f : PiLp p E) :
82+
HasFDerivAt ofLp (continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
83+
(hasStrictFDerivAt_ofLp p f).hasFDerivAt
7184

85+
@[deprecated hasFDerivAt_ofLp (since := "2025-05-07")]
7286
theorem hasFDerivAt_equiv (f : PiLp p E) :
73-
HasFDerivAt (WithLp.equiv p (∀ i, E i))
74-
(PiLp.continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
75-
(hasStrictFDerivAt_equiv p f).hasFDerivAt
76-
77-
theorem hasFDerivAt_equiv_symm (f : PiLp p E) :
78-
HasFDerivAt (WithLp.equiv p (∀ i, E i)).symm
79-
(PiLp.continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
80-
(hasStrictFDerivAt_equiv_symm p f).hasFDerivAt
87+
HasFDerivAt (WithLp.equiv _ _) (continuousLinearEquiv p 𝕜 _).toContinuousLinearMap f :=
88+
hasFDerivAt_ofLp _ f
89+
90+
theorem hasFDerivAt_toLp (f : ∀ i, E i) :
91+
HasFDerivAt (toLp p) (continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
92+
(hasStrictFDerivAt_toLp p f).hasFDerivAt
93+
94+
@[deprecated hasFDerivAt_toLp (since := "2025-05-07")]
95+
theorem hasFDerivAt_equiv_symm (f : ∀ i, E i) :
96+
HasFDerivAt (WithLp.equiv _ _).symm
97+
(continuousLinearEquiv p 𝕜 _).symm.toContinuousLinearMap f :=
98+
hasFDerivAt_toLp _ f
8199

82100
nonrec theorem hasFDerivAt_apply (f : PiLp p E) (i : ι) :
83101
HasFDerivAt (𝕜 := 𝕜) (fun f : PiLp p E => f i) (proj p E i) f :=

Mathlib/Analysis/InnerProductSpace/PiL2.lean

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For consequences in infinite dimension (Hilbert bases, etc.), see the file
5555

5656

5757
open Real Set Filter RCLike Submodule Function Uniformity Topology NNReal ENNReal
58-
ComplexConjugate DirectSum
58+
ComplexConjugate DirectSum WithLp
5959

6060
noncomputable section
6161

@@ -109,27 +109,24 @@ open Lean Meta Elab Term Macro TSyntax PrettyPrinter.Delaborator SubExpr
109109
open Mathlib.Tactic (subscriptTerm)
110110

111111
/-- Notation for vectors in Lp space. `!₂[x, y, ...]` is a shorthand for
112-
`(WithLp.equiv 2 _).symm ![x, y, ...]`, of type `EuclideanSpace _ (Fin _)`.
112+
`WithLp.toLp 2 ![x, y, ...]`, of type `EuclideanSpace _ (Fin _)`.
113113
114114
This also works for other subscripts. -/
115115
syntax (name := PiLp.vecNotation) "!" noWs subscriptTerm noWs "[" term,* "]" : term
116116
macro_rules | `(!$p:subscript[$e:term,*]) => do
117117
-- override the `Fin n.succ` to a literal
118118
let n := e.getElems.size
119-
`((WithLp.equiv $p <| ∀ _ : Fin $(quote n), _).symm ![$e,*])
119+
`(WithLp.toLp $p (V := ∀ _ : Fin $(quote n), _) ![$e,*])
120120

121121
/-- Unexpander for the `!₂[x, y, ...]` notation. -/
122-
@[app_delab DFunLike.coe]
122+
@[app_delab WithLp.toLp]
123123
def EuclideanSpace.delabVecNotation : Delab :=
124-
whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 6 do
125-
-- check that the `(WithLp.equiv _ _).symm` is present
126-
let p : Term ← withAppFn <| withAppArg do
127-
let_expr Equiv.symm _ _ e := ← getExpr | failure
128-
let_expr WithLp.equiv _ _ := e | failure
129-
withNaryArg 2 <| withNaryArg 0 <| delab
124+
whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 3 do
125+
-- check that the `WithLp.toLp _` is present
126+
let p : Term ← withNaryArg 0 <| delab
130127
-- to be conservative, only allow subscripts which are numerals
131128
guard <| p matches `($_:num)
132-
let `(![$elems,*]) := ← withAppArg delab | failure
129+
let `(![$elems,*]) := ← withNaryArg 2 delab | failure
133130
`(!$p[$elems,*])
134131

135132
end Notation
@@ -185,9 +182,12 @@ theorem finrank_euclideanSpace_fin {n : ℕ} :
185182
Module.finrank 𝕜 (EuclideanSpace 𝕜 (Fin n)) = n := by simp
186183

187184
theorem EuclideanSpace.inner_eq_star_dotProduct (x y : EuclideanSpace 𝕜 ι) :
188-
⟪x, y⟫ = WithLp.equiv _ _ y ⬝ᵥ star (WithLp.equiv _ _ x) :=
189-
rfl
185+
⟪x, y⟫ = ofLp y ⬝ᵥ star (ofLp x) := rfl
186+
187+
lemma EuclideanSpace.inner_toLp_toLp (x y : ι → 𝕜) :
188+
⟪toLp 2 x, toLp 2 y⟫ = dotProduct y (star x) := rfl
190189

190+
@[deprecated EuclideanSpace.inner_toLp_toLp (since := "2024-04-27")]
191191
theorem EuclideanSpace.inner_piLp_equiv_symm (x y : ι → 𝕜) :
192192
⟪(WithLp.equiv 2 _).symm x, (WithLp.equiv 2 _).symm y⟫ = y ⬝ᵥ star x :=
193193
rfl
@@ -247,22 +247,27 @@ variable [DecidableEq ι]
247247
/-- The vector given in euclidean space by being `a : 𝕜` at coordinate `i : ι` and `0 : 𝕜` at
248248
all other coordinates. -/
249249
def EuclideanSpace.single (i : ι) (a : 𝕜) : EuclideanSpace 𝕜 ι :=
250-
(WithLp.equiv _ _).symm (Pi.single i a)
250+
toLp _ (Pi.single i a)
251251

252-
@[simp]
252+
@[simp] lemma EuclideanSpace.ofLp_single (i : ι) (a : 𝕜) : ofLp (single i a) = Pi.single i a := rfl
253+
254+
@[deprecated EuclideanSpace.ofLp_single (since := "2024-04-27")]
253255
theorem WithLp.equiv_single (i : ι) (a : 𝕜) :
254256
WithLp.equiv _ _ (EuclideanSpace.single i a) = Pi.single i a :=
255257
rfl
256258

257259
@[simp]
260+
lemma EuclideanSpace.toLp_single (i : ι) (a : 𝕜) : toLp _ (Pi.single i a) = single i a := rfl
261+
262+
@[deprecated EuclideanSpace.toLp_single (since := "2024-04-27")]
258263
theorem WithLp.equiv_symm_single (i : ι) (a : 𝕜) :
259264
(WithLp.equiv _ _).symm (Pi.single i a) = EuclideanSpace.single i a :=
260265
rfl
261266

262267
@[simp]
263268
theorem EuclideanSpace.single_apply (i : ι) (a : 𝕜) (j : ι) :
264269
(EuclideanSpace.single i a) j = ite (j = i) a 0 := by
265-
rw [EuclideanSpace.single, WithLp.equiv_symm_pi_apply, ← Pi.single_apply i a j]
270+
rw [EuclideanSpace.single, PiLp.toLp_apply, ← Pi.single_apply i a j]
266271

267272
@[simp]
268273
theorem EuclideanSpace.single_eq_zero_iff {i : ι} {a : 𝕜} :
@@ -279,27 +284,27 @@ theorem EuclideanSpace.inner_single_right (i : ι) (a : 𝕜) (v : EuclideanSpac
279284
@[simp]
280285
theorem EuclideanSpace.norm_single (i : ι) (a : 𝕜) :
281286
‖EuclideanSpace.single i (a : 𝕜)‖ = ‖a‖ :=
282-
PiLp.norm_equiv_symm_single 2 (fun _ => 𝕜) i a
287+
PiLp.norm_toLp_single 2 (fun _ => 𝕜) i a
283288

284289
@[simp]
285290
theorem EuclideanSpace.nnnorm_single (i : ι) (a : 𝕜) :
286291
‖EuclideanSpace.single i (a : 𝕜)‖₊ = ‖a‖₊ :=
287-
PiLp.nnnorm_equiv_symm_single 2 (fun _ => 𝕜) i a
292+
PiLp.nnnorm_toLp_single 2 (fun _ => 𝕜) i a
288293

289294
@[simp]
290295
theorem EuclideanSpace.dist_single_same (i : ι) (a b : 𝕜) :
291296
dist (EuclideanSpace.single i (a : 𝕜)) (EuclideanSpace.single i (b : 𝕜)) = dist a b :=
292-
PiLp.dist_equiv_symm_single_same 2 (fun _ => 𝕜) i a b
297+
PiLp.dist_toLp_single_same 2 (fun _ => 𝕜) i a b
293298

294299
@[simp]
295300
theorem EuclideanSpace.nndist_single_same (i : ι) (a b : 𝕜) :
296301
nndist (EuclideanSpace.single i (a : 𝕜)) (EuclideanSpace.single i (b : 𝕜)) = nndist a b :=
297-
PiLp.nndist_equiv_symm_single_same 2 (fun _ => 𝕜) i a b
302+
PiLp.nndist_toLp_single_same 2 (fun _ => 𝕜) i a b
298303

299304
@[simp]
300305
theorem EuclideanSpace.edist_single_same (i : ι) (a b : 𝕜) :
301306
edist (EuclideanSpace.single i (a : 𝕜)) (EuclideanSpace.single i (b : 𝕜)) = edist a b :=
302-
PiLp.edist_equiv_symm_single_same 2 (fun _ => 𝕜) i a b
307+
PiLp.edist_toLp_single_same 2 (fun _ => 𝕜) i a b
303308

304309
/-- `EuclideanSpace.single` forms an orthonormal family. -/
305310
theorem EuclideanSpace.orthonormal_single :
@@ -370,7 +375,7 @@ instance instFunLike : FunLike (OrthonormalBasis ι 𝕜 E) ι E where
370375
rw [this, Pi.single_smul]
371376
replace h := congr_fun h i
372377
simp only [LinearEquiv.comp_coe, map_smul, LinearEquiv.coe_coe,
373-
LinearEquiv.trans_apply, WithLp.linearEquiv_symm_apply, WithLp.equiv_symm_single,
378+
LinearEquiv.trans_apply, WithLp.linearEquiv_symm_apply, EuclideanSpace.toLp_single,
374379
LinearIsometryEquiv.coe_symm_toLinearEquiv] at h ⊢
375380
rw [h]
376381

@@ -593,18 +598,18 @@ theorem _root_.Pi.orthonormalBasis_apply {η : Type*} [Fintype η] [DecidableEq
593598
[∀ i, Fintype (ι i)] {𝕜 : Type*} [RCLike 𝕜] {E : η → Type*} [∀ i, NormedAddCommGroup (E i)]
594599
[∀ i, InnerProductSpace 𝕜 (E i)] (B : ∀ i, OrthonormalBasis (ι i) 𝕜 (E i))
595600
(j : (i : η) × (ι i)) :
596-
Pi.orthonormalBasis B j = (WithLp.equiv _ _).symm (Pi.single _ (B j.fst j.snd)) := by
601+
Pi.orthonormalBasis B j = toLp _ (Pi.single _ (B j.fst j.snd)) := by
597602
classical
598603
ext k
599604
obtain ⟨i, j⟩ := j
600605
simp only [Pi.orthonormalBasis, coe_ofRepr, LinearIsometryEquiv.symm_trans,
601606
LinearIsometryEquiv.symm_symm, LinearIsometryEquiv.piLpCongrRight_symm,
602607
LinearIsometryEquiv.trans_apply, LinearIsometryEquiv.piLpCongrRight_apply,
603-
LinearIsometryEquiv.piLpCurry_apply, WithLp.equiv_single, WithLp.equiv_symm_pi_apply,
608+
LinearIsometryEquiv.piLpCurry_apply, EuclideanSpace.ofLp_single, PiLp.toLp_apply,
604609
Sigma.curry_single (γ := fun _ _ => 𝕜)]
605610
obtain rfl | hi := Decidable.eq_or_ne i k
606-
· simp only [Pi.single_eq_same, WithLp.equiv_symm_single, OrthonormalBasis.repr_symm_single]
607-
· simp only [Pi.single_eq_of_ne' hi, WithLp.equiv_symm_zero, map_zero]
611+
· simp only [Pi.single_eq_same, EuclideanSpace.toLp_single, OrthonormalBasis.repr_symm_single]
612+
· simp only [Pi.single_eq_of_ne' hi, toLp_zero, map_zero]
608613

609614
@[simp]
610615
theorem _root_.Pi.orthonormalBasis_repr {η : Type*} [Fintype η] {ι : η → Type*}
@@ -1079,26 +1084,44 @@ def toEuclideanLin : Matrix m n 𝕜 ≃ₗ[𝕜] EuclideanSpace 𝕜 n →ₗ[
10791084
(WithLp.linearEquiv _ 𝕜 (m → 𝕜)).symm
10801085

10811086
@[simp]
1087+
lemma toEuclideanLin_toLp (A : Matrix m n 𝕜) (x : n → 𝕜) :
1088+
Matrix.toEuclideanLin A (toLp _ x) = toLp _ (Matrix.toLin' A x) := rfl
1089+
1090+
@[deprecated toEuclideanLin_toLp (since := "2024-04-27")]
10821091
theorem toEuclideanLin_piLp_equiv_symm (A : Matrix m n 𝕜) (x : n → 𝕜) :
10831092
Matrix.toEuclideanLin A ((WithLp.equiv _ _).symm x) =
10841093
(WithLp.equiv _ _).symm (A *ᵥ x) :=
10851094
rfl
10861095

10871096
@[simp]
1097+
theorem piLp_ofLp_toEuclideanLin (A : Matrix m n 𝕜) (x : EuclideanSpace 𝕜 n) :
1098+
ofLp (Matrix.toEuclideanLin A x) = Matrix.toLin' A (ofLp x) :=
1099+
rfl
1100+
1101+
@[deprecated piLp_ofLp_toEuclideanLin (since := "2024-04-27")]
10881102
theorem piLp_equiv_toEuclideanLin (A : Matrix m n 𝕜) (x : EuclideanSpace 𝕜 n) :
10891103
WithLp.equiv _ _ (Matrix.toEuclideanLin A x) = A *ᵥ (WithLp.equiv _ _ x) :=
10901104
rfl
10911105

10921106
theorem toEuclideanLin_apply (M : Matrix m n 𝕜) (v : EuclideanSpace 𝕜 n) :
1093-
toEuclideanLin M v = (WithLp.equiv 2 (m → 𝕜)).symm (M *ᵥ (WithLp.equiv 2 (n → 𝕜)) v) :=
1094-
rfl
1107+
toEuclideanLin M v = toLp _ (M *ᵥ ofLp v) := rfl
10951108

10961109
@[simp]
1110+
theorem ofLp_toEuclideanLin_apply (M : Matrix m n 𝕜) (v : EuclideanSpace 𝕜 n) :
1111+
ofLp (toEuclideanLin M v) = M *ᵥ ofLp v :=
1112+
rfl
1113+
1114+
@[deprecated ofLp_toEuclideanLin_apply (since := "2024-04-27")]
10971115
theorem piLp_equiv_toEuclideanLin_apply (M : Matrix m n 𝕜) (v : EuclideanSpace 𝕜 n) :
10981116
WithLp.equiv 2 (m → 𝕜) (toEuclideanLin M v) = M *ᵥ WithLp.equiv 2 (n → 𝕜) v :=
10991117
rfl
11001118

11011119
@[simp]
1120+
theorem toEuclideanLin_apply_piLp_toLp (M : Matrix m n 𝕜) (v : n → 𝕜) :
1121+
toEuclideanLin M (toLp _ v) = toLp _ (M *ᵥ v) :=
1122+
rfl
1123+
1124+
@[deprecated toEuclideanLin_apply_piLp_toLp (since := "2024-04-27")]
11021125
theorem toEuclideanLin_apply_piLp_equiv_symm (M : Matrix m n 𝕜) (v : n → 𝕜) :
11031126
toEuclideanLin M ((WithLp.equiv 2 (n→ 𝕜)).symm v) = (WithLp.equiv 2 (m → 𝕜)).symm (M *ᵥ v) :=
11041127
rfl
@@ -1116,8 +1139,7 @@ lemma toEuclideanLin_eq_toLin_orthonormal [Fintype m] :
11161139

11171140
end Matrix
11181141

1119-
local notation "⟪" x ", " y "⟫ₑ" =>
1120-
inner 𝕜 (Equiv.symm (WithLp.equiv 2 _) x) (Equiv.symm (WithLp.equiv 2 _) y)
1142+
local notation "⟪" x ", " y "⟫ₑ" => inner 𝕜 (toLp 2 x) (toLp 2 y)
11211143

11221144
/-- The inner product of a row of `A` and a row of `B` is an entry of `B * Aᴴ`. -/
11231145
theorem inner_matrix_row_row [Fintype n] (A B : Matrix m n 𝕜) (i j : m) :
@@ -1127,7 +1149,7 @@ theorem inner_matrix_row_row [Fintype n] (A B : Matrix m n 𝕜) (i j : m) :
11271149
/-- The inner product of a column of `A` and a column of `B` is an entry of `Aᴴ * B`. -/
11281150
theorem inner_matrix_col_col [Fintype m] (A B : Matrix m n 𝕜) (i j : n) :
11291151
⟪Aᵀ i, Bᵀ j⟫ₑ = (Aᴴ * B) i j := by
1130-
simp_rw [EuclideanSpace.inner_piLp_equiv_symm, Matrix.mul_apply',
1152+
simp_rw [EuclideanSpace.inner_toLp_toLp, Matrix.mul_apply',
11311153
Matrix.conjTranspose_apply, dotProduct_comm, Pi.star_def]
11321154
rfl
11331155

Mathlib/Analysis/InnerProductSpace/ProdL2.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ variable {E F}
4343

4444
@[simp]
4545
theorem prod_inner_apply (x y : WithLp 2 (E × F)) :
46-
⟪x, y⟫_𝕜 =
47-
⟪(WithLp.equiv 2 (E × F) x).fst, (WithLp.equiv 2 (E × F) y).fst⟫_𝕜 +
48-
⟪(WithLp.equiv 2 (E × F) x).snd, (WithLp.equiv 2 (E × F) y).snd⟫_𝕜 := rfl
46+
⟪x, y⟫_𝕜 = ⟪(ofLp x).fst, (ofLp y).fst⟫_𝕜 + ⟪(ofLp x).snd, (ofLp y).snd⟫_𝕜 := rfl
4947

5048
end WithLp
5149

@@ -65,7 +63,7 @@ def prod (v : OrthonormalBasis ι₁ 𝕜 E) (w : OrthonormalBasis ι₂ 𝕜 F)
6563
· unfold Pairwise
6664
simp only [ne_eq, Basis.map_apply, Basis.prod_apply, LinearMap.coe_inl,
6765
OrthonormalBasis.coe_toBasis, LinearMap.coe_inr, WithLp.linearEquiv_symm_apply,
68-
WithLp.prod_inner_apply, Equiv.apply_symm_apply, Sum.forall, Sum.elim_inl,
66+
WithLp.prod_inner_apply, WithLp.ofLp_toLp, Sum.forall, Sum.elim_inl,
6967
Function.comp_apply, inner_zero_right, add_zero, Sum.elim_inr, zero_add, Sum.inl.injEq,
7068
reduceCtorEq, not_false_eq_true, inner_zero_left, imp_self, implies_true, and_true,
7169
Sum.inr.injEq, true_and]

0 commit comments

Comments
 (0)