Skip to content

Commit 30c4d38

Browse files
committed
feat: ofLp and toLp of a sum (#31353)
Introduce an `AddEquiv` version of `WithLp.equiv` and use it to prove that `(∑ i ∈ s, f i).ofLp = ∑ i ∈ s, (f i).ofLp` and `toLp p (∑ i ∈ s, f i) = ∑ i ∈ s, toLp p (f i)`.
1 parent 53cb457 commit 30c4d38

File tree

6 files changed

+74
-16
lines changed

6 files changed

+74
-16
lines changed

Mathlib/Analysis/InnerProductSpace/LinearPMap.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,8 @@ theorem mem_adjoint_iff (g : Submodule 𝕜 (E × F)) (x : F × E) :
270270
x ∈ g.adjoint ↔
271271
∀ a b, (a, b) ∈ g → inner 𝕜 b x.fst - inner 𝕜 a x.snd = 0 := by
272272
simp only [Submodule.adjoint, mem_map, mem_orthogonal, LinearEquiv.trans_apply,
273-
LinearEquiv.skewSwap_symm_apply, WithLp.linearEquiv_symm_apply, Prod.exists,
274-
WithLp.prod_inner_apply, WithLp.ofLp_fst, WithLp.ofLp_snd, forall_exists_index, and_imp,
275-
WithLp.linearEquiv_apply]
273+
LinearEquiv.skewSwap_symm_apply, coe_symm_linearEquiv, Prod.exists, prod_inner_apply, ofLp_fst,
274+
ofLp_snd, forall_exists_index, and_imp, coe_linearEquiv]
276275
constructor
277276
· rintro ⟨y, h1, h2⟩ a b hab
278277
rw [← h2, WithLp.ofLp_fst, WithLp.ofLp_snd]

Mathlib/Analysis/InnerProductSpace/PiL2.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ instance instFunLike : FunLike (OrthonormalBasis ι 𝕜 E) ι E where
373373
have : k = k • (1 : 𝕜) := by rw [smul_eq_mul, mul_one]
374374
rw [this, Pi.single_smul]
375375
replace h := congr_fun h i
376-
simp only [LinearEquiv.comp_coe, map_smul, LinearEquiv.coe_coe,
377-
LinearEquiv.trans_apply, WithLp.linearEquiv_symm_apply, EuclideanSpace.toLp_single,
376+
simp only [LinearEquiv.comp_coe, map_smul, LinearEquiv.coe_coe, LinearEquiv.trans_apply,
377+
coe_symm_linearEquiv, EuclideanSpace.toLp_single,
378378
LinearIsometryEquiv.coe_symm_toLinearEquiv] at h ⊢
379379
rw [h]
380380

Mathlib/Analysis/InnerProductSpace/ProdL2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def prod (v : OrthonormalBasis ι₁ 𝕜 E) (w : OrthonormalBasis ι₂ 𝕜 F)
6363
· simp
6464
· unfold Pairwise
6565
simp only [ne_eq, Basis.map_apply, Basis.prod_apply, LinearMap.coe_inl,
66-
OrthonormalBasis.coe_toBasis, LinearMap.coe_inr, WithLp.linearEquiv_symm_apply,
66+
OrthonormalBasis.coe_toBasis, LinearMap.coe_inr, WithLp.coe_symm_linearEquiv,
6767
WithLp.prod_inner_apply, Sum.forall, Sum.elim_inl, Function.comp_apply, inner_zero_right,
6868
add_zero, Sum.elim_inr, zero_add, Sum.inl.injEq, reduceCtorEq, not_false_eq_true,
6969
inner_zero_left, imp_self, implies_true, and_true, Sum.inr.injEq, true_and]

Mathlib/Analysis/Normed/Lp/PiLp.lean

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ protected def _root_.LinearIsometryEquiv.piLpCongrRight (e : ∀ i, α i ≃ₗ
812812
≪≫ₗ (LinearEquiv.piCongrRight fun i => (e i).toLinearEquiv)
813813
≪≫ₗ (WithLp.linearEquiv _ _ _).symm
814814
norm_map' := (WithLp.linearEquiv p 𝕜 _).symm.surjective.forall.2 fun x => by
815-
simp only [LinearEquiv.trans_apply, WithLp.linearEquiv_symm_apply, WithLp.linearEquiv_apply]
815+
simp only [coe_symm_linearEquiv, LinearEquiv.trans_apply, coe_linearEquiv]
816816
obtain rfl | hp := p.dichotomy
817817
· simp_rw [PiLp.norm_toLp, Pi.norm_def, LinearEquiv.piCongrRight_apply,
818818
LinearIsometryEquiv.coe_toLinearEquiv, LinearIsometryEquiv.nnnorm_map]
@@ -1012,23 +1012,33 @@ lemma norm_toLp_one {β} [SeminormedAddCommGroup β] (hp : p ≠ ∞) [One β] :
10121012
‖toLp p (1 : ι → β)‖ = (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖(1 : β)‖ :=
10131013
(norm_toLp_const hp (1 : β)).trans rfl
10141014

1015-
variable (𝕜 p)
1015+
end Fintype
1016+
1017+
section
1018+
1019+
variable [Semiring 𝕜] [∀ i, SeminormedAddCommGroup (β i)] [∀ i, Module 𝕜 (β i)]
10161020

10171021
/-- `WithLp.linearEquiv` as a continuous linear equivalence. -/
1018-
@[simps! -fullyApplied apply symm_apply]
1022+
@[simps! apply symm_apply]
10191023
def continuousLinearEquiv : PiLp p β ≃L[𝕜] ∀ i, β i where
10201024
toLinearEquiv := WithLp.linearEquiv _ _ _
10211025
continuous_toFun := continuous_ofLp _ _
10221026
continuous_invFun := continuous_toLp p _
10231027

1028+
lemma coe_continuousLinearEquiv :
1029+
⇑(PiLp.continuousLinearEquiv p 𝕜 β) = ofLp := rfl
1030+
1031+
lemma coe_symm_continuousLinearEquiv :
1032+
⇑(PiLp.continuousLinearEquiv p 𝕜 β).symm = toLp p := rfl
1033+
10241034
variable {𝕜} in
10251035
/-- The projection on the `i`-th coordinate of `PiLp p β`, as a continuous linear map. -/
10261036
@[simps!]
10271037
def proj (i : ι) : PiLp p β →L[𝕜] β i where
10281038
__ := projₗ p β i
10291039
cont := PiLp.continuous_apply ..
10301040

1031-
end Fintype
1041+
end
10321042

10331043
section Basis
10341044

@@ -1042,7 +1052,7 @@ def basisFun : Basis ι 𝕜 (PiLp p fun _ : ι => 𝕜) :=
10421052
@[simp]
10431053
theorem basisFun_apply [DecidableEq ι] (i) :
10441054
basisFun p 𝕜 ι i = toLp p (Pi.single i 1) := by
1045-
simp_rw [basisFun, Basis.coe_ofEquivFun, WithLp.linearEquiv_symm_apply]
1055+
simp_rw [basisFun, Basis.coe_ofEquivFun, WithLp.coe_symm_linearEquiv]
10461056

10471057
@[simp]
10481058
theorem basisFun_repr (x : PiLp p fun _ : ι => 𝕜) (i : ι) : (basisFun p 𝕜 ι).repr x i = x i :=

Mathlib/Analysis/Normed/Lp/WithLp.lean

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,63 @@ end equiv
219219

220220
variable (K V)
221221

222+
/-- `WithLp.equiv` as a group isomorphism. -/
223+
@[simps apply symm_apply]
224+
protected def addEquiv [AddCommGroup V] : WithLp p V ≃+ V where
225+
toFun := ofLp
226+
invFun := toLp p
227+
map_add' := ofLp_add p
228+
229+
lemma coe_addEquiv [AddCommGroup V] : ⇑(WithLp.addEquiv p V) = ofLp := rfl
230+
231+
lemma coe_symm_addEquiv [AddCommGroup V] : ⇑(WithLp.addEquiv p V).symm = toLp p := rfl
232+
233+
@[simp]
234+
lemma ofLp_sum [AddCommGroup V] {ι : Type*} (s : Finset ι) (f : ι → WithLp p V) :
235+
(∑ i ∈ s, f i).ofLp = ∑ i ∈ s, (f i).ofLp :=
236+
map_sum (WithLp.addEquiv _ _) _ _
237+
238+
@[simp]
239+
lemma toLp_sum [AddCommGroup V] {ι : Type*} (s : Finset ι) (f : ι → V) :
240+
toLp p (∑ i ∈ s, f i) = ∑ i ∈ s, toLp p (f i) :=
241+
map_sum (WithLp.addEquiv _ _).symm _ _
242+
243+
@[simp]
244+
lemma ofLp_listSum [AddCommGroup V] (l : List (WithLp p V)) :
245+
l.sum.ofLp = (l.map ofLp).sum :=
246+
map_list_sum (WithLp.addEquiv _ _) _
247+
248+
@[simp]
249+
lemma toLp_listSum [AddCommGroup V] (l : List V) :
250+
toLp p l.sum = (l.map (toLp p)).sum :=
251+
map_list_sum (WithLp.addEquiv _ _).symm _
252+
253+
@[simp]
254+
lemma ofLp_multisetSum [AddCommGroup V] (s : Multiset (WithLp p V)) :
255+
s.sum.ofLp = (s.map ofLp).sum :=
256+
map_multiset_sum (WithLp.addEquiv _ _) _
257+
258+
@[simp]
259+
lemma toLp_multisetSum [AddCommGroup V] (s : Multiset V) :
260+
toLp p s.sum = (s.map (toLp p)).sum :=
261+
map_multiset_sum (WithLp.addEquiv _ _).symm _
262+
222263
/-- `WithLp.equiv` as a linear equivalence. -/
223-
@[simps -fullyApplied apply symm_apply]
264+
@[simps apply symm_apply]
224265
protected def linearEquiv [Semiring K] [AddCommGroup V] [Module K V] : WithLp p V ≃ₗ[K] V where
225-
toFun := WithLp.ofLp
226-
invFun := WithLp.toLp p
227-
map_add' _ _ := rfl
266+
__ := WithLp.addEquiv p V
228267
map_smul' _ _ := rfl
229268

269+
lemma coe_linearEquiv [Semiring K] [AddCommGroup V] [Module K V] :
270+
⇑(WithLp.linearEquiv p K V) = ofLp := rfl
271+
272+
lemma coe_symm_linearEquiv [Semiring K] [AddCommGroup V] [Module K V] :
273+
⇑(WithLp.linearEquiv p K V).symm = toLp p := rfl
274+
275+
@[simp]
276+
lemma toAddEquiv_linearEquiv [Semiring K] [AddCommGroup V] [Module K V] :
277+
(WithLp.linearEquiv p K V).toAddEquiv = WithLp.addEquiv p V := rfl
278+
230279
instance instModuleFinite
231280
[Semiring K] [AddCommGroup V] [Module K V] [Module.Finite K V] :
232281
Module.Finite K (WithLp p V) :=

Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ theorem EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp :
148148
suffices volume = map (MeasurableEquiv.toLp 2 (ι → ℝ)) volume by
149149
convert ((MeasurableEquiv.toLp 2 (ι → ℝ)).measurable.measurePreserving _).symm
150150
rw [← addHaarMeasure_eq_volume_pi, ← Basis.parallelepiped_basisFun, ← Basis.addHaar_def,
151-
MeasurableEquiv.coe_toLp, ← PiLp.continuousLinearEquiv_symm_apply 2 ℝ, Basis.map_addHaar]
151+
MeasurableEquiv.coe_toLp, ← PiLp.coe_symm_continuousLinearEquiv 2 ℝ, Basis.map_addHaar]
152152
exact (EuclideanSpace.basisFun _ _).addHaar_eq_volume.symm
153153

154154
@[deprecated (since := "2025-07-26")] alias EuclideanSpace.volume_preserving_measurableEquiv :=

0 commit comments

Comments
 (0)