Skip to content

Commit 58fa94d

Browse files
committed
refactor(lpSpace): reorder type arguments (#21779)
When talking about a `π•œ`-module `E`, the (unwritten) convention is to order the arguments as `π•œ E` not `E π•œ`. One proof using `@` breaks, but this proof didn't need `@` in the first place.
1 parent 398adb2 commit 58fa94d

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

β€ŽMathlib/Analysis/Normed/Lp/lpSpace.leanβ€Ž

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ noncomputable section
5858

5959
open scoped NNReal ENNReal Function
6060

61-
variable {Ξ± : Type*} {E : Ξ± β†’ Type*} {p q : ℝβ‰₯0∞} [βˆ€ i, NormedAddCommGroup (E i)]
61+
variable {π•œ π•œ' : Type*} {Ξ± : Type*} {E : Ξ± β†’ Type*} {p q : ℝβ‰₯0∞} [βˆ€ i, NormedAddCommGroup (E i)]
6262

6363
/-!
6464
### `Memβ„“p` predicate
@@ -234,7 +234,7 @@ theorem finset_sum {ΞΉ} (s : Finset ΞΉ) {f : ΞΉ β†’ βˆ€ i, E i} (hf : βˆ€ i ∈
234234

235235
section BoundedSMul
236236

237-
variable {π•œ : Type*} [NormedRing π•œ] [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)]
237+
variable [NormedRing π•œ] [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)]
238238

239239
theorem const_smul {f : βˆ€ i, E i} (hf : Memβ„“p f p) (c : π•œ) : Memβ„“p (c β€’ f) p := by
240240
rcases p.trichotomy with (rfl | rfl | hp)
@@ -259,7 +259,7 @@ theorem const_smul {f : βˆ€ i, E i} (hf : Memβ„“p f p) (c : π•œ) : Memβ„“p (c
259259
apply nnnorm_smul_le
260260

261261
theorem const_mul {f : Ξ± β†’ π•œ} (hf : Memβ„“p f p) (c : π•œ) : Memβ„“p (fun x => c * f x) p :=
262-
@Memβ„“p.const_smul Ξ± (fun _ => π•œ) _ _ π•œ _ _ (fun i => by infer_instance) _ hf c
262+
hf.const_smul c
263263

264264
end BoundedSMul
265265

@@ -539,7 +539,6 @@ end ComparePointwise
539539

540540
section BoundedSMul
541541

542-
variable {π•œ : Type*} {π•œ' : Type*}
543542
variable [NormedRing π•œ] [NormedRing π•œ']
544543
variable [βˆ€ i, Module π•œ (E i)] [βˆ€ i, Module π•œ' (E i)]
545544

@@ -560,20 +559,20 @@ variable [βˆ€ i, BoundedSMul π•œ (E i)] [βˆ€ i, BoundedSMul π•œ' (E i)]
560559
theorem mem_lp_const_smul (c : π•œ) (f : lp E p) : c β€’ (f : PreLp E) ∈ lp E p :=
561560
(lp.memβ„“p f).const_smul c
562561

563-
variable (E p π•œ)
562+
variable (π•œ E p)
564563

565564
/-- The `π•œ`-submodule of elements of `βˆ€ i : Ξ±, E i` whose `lp` norm is finite. This is `lp E p`,
566565
with extra structure. -/
567566
def _root_.lpSubmodule : Submodule π•œ (PreLp E) :=
568567
{ lp E p with smul_mem' := fun c f hf => by simpa using mem_lp_const_smul c ⟨f, hf⟩ }
569568

570-
variable {E p π•œ}
569+
variable {π•œ E p}
571570

572-
theorem coe_lpSubmodule : (lpSubmodule E p π•œ).toAddSubgroup = lp E p :=
571+
theorem coe_lpSubmodule : (lpSubmodule π•œ E p).toAddSubgroup = lp E p :=
573572
rfl
574573

575574
instance : Module π•œ (lp E p) :=
576-
{ (lpSubmodule E p π•œ).module with }
575+
{ (lpSubmodule π•œ E p).module with }
577576

578577
@[simp]
579578
theorem coeFn_smul (c : π•œ) (f : lp E p) : ⇑(c β€’ f) = c β€’ ⇑f :=
@@ -628,7 +627,6 @@ end BoundedSMul
628627

629628
section DivisionRing
630629

631-
variable {π•œ : Type*}
632630
variable [NormedDivisionRing π•œ] [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)]
633631

634632
theorem norm_const_smul (hp : p β‰  0) {c : π•œ} (f : lp E p) : β€–c β€’ fβ€– = β€–cβ€– * β€–fβ€– := by
@@ -642,7 +640,7 @@ end DivisionRing
642640

643641
section NormedSpace
644642

645-
variable {π•œ : Type*} [NormedField π•œ] [βˆ€ i, NormedSpace π•œ (E i)]
643+
variable [NormedField π•œ] [βˆ€ i, NormedSpace π•œ (E i)]
646644

647645
instance instNormedSpace [Fact (1 ≀ p)] : NormedSpace π•œ (lp E p) where
648646
norm_smul_le c f := norm_smul_le c f
@@ -692,7 +690,7 @@ instance [hp : Fact (1 ≀ p)] : NormedStarGroup (lp E p) where
692690
Β· simp only [lp.norm_eq_ciSup, lp.star_apply, norm_star]
693691
Β· simp only [lp.norm_eq_tsum_rpow h, lp.star_apply, norm_star]
694692

695-
variable {π•œ : Type*} [Star π•œ] [NormedRing π•œ]
693+
variable [Star π•œ] [NormedRing π•œ]
696694
variable [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)] [βˆ€ i, StarModule π•œ (E i)]
697695

698696
instance : StarModule π•œ (lp E p) where
@@ -840,7 +838,7 @@ end NormedCommRing
840838

841839
section Algebra
842840

843-
variable {I : Type*} {π•œ : Type*} {B : I β†’ Type*}
841+
variable {I : Type*} {B : I β†’ Type*}
844842
variable [NormedField π•œ] [βˆ€ i, NormedRing (B i)] [βˆ€ i, NormedAlgebra π•œ (B i)]
845843

846844
/-- A variant of `Pi.algebra` that lean can't find otherwise. -/
@@ -874,7 +872,7 @@ end Algebra
874872

875873
section Single
876874

877-
variable {π•œ : Type*} [NormedRing π•œ] [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)]
875+
variable [NormedRing π•œ] [βˆ€ i, Module π•œ (E i)] [βˆ€ i, BoundedSMul π•œ (E i)]
878876
variable [DecidableEq Ξ±]
879877

880878
/-- The element of `lp E p` which is `a : E i` at the index `i`, and zero elsewhere. -/

β€ŽMathlib/MeasureTheory/Function/LpSpace.leanβ€Ž

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ noncomputable section
7070
open TopologicalSpace MeasureTheory Filter
7171
open scoped NNReal ENNReal Topology MeasureTheory Uniformity symmDiff
7272

73-
variable {Ξ± E F G : Type*} {m m0 : MeasurableSpace Ξ±} {p : ℝβ‰₯0∞} {q : ℝ} {ΞΌ Ξ½ : Measure Ξ±}
73+
variable {Ξ± π•œ π•œ' E F G : Type*} {m m0 : MeasurableSpace Ξ±} {p : ℝβ‰₯0∞} {q : ℝ} {ΞΌ Ξ½ : Measure Ξ±}
7474
[NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
7575

7676
namespace MeasureTheory
@@ -411,28 +411,27 @@ example [Fact (1 ≀ p)] : SeminormedAddGroup.toNNNorm = (Lp.instNNNorm : NNNorm
411411

412412
section BoundedSMul
413413

414-
variable {π•œ π•œ' : Type*}
415414
variable [NormedRing π•œ] [NormedRing π•œ'] [Module π•œ E] [Module π•œ' E]
416415
variable [BoundedSMul π•œ E] [BoundedSMul π•œ' E]
417416

418417
theorem const_smul_mem_Lp (c : π•œ) (f : Lp E p ΞΌ) : c β€’ (f : Ξ± β†’β‚˜[ΞΌ] E) ∈ Lp E p ΞΌ := by
419418
rw [mem_Lp_iff_eLpNorm_lt_top, eLpNorm_congr_ae (AEEqFun.coeFn_smul _ _)]
420419
exact eLpNorm_const_smul_le.trans_lt <| ENNReal.mul_lt_top ENNReal.coe_lt_top f.prop
421420

422-
variable (E p ΞΌ π•œ)
421+
variable (π•œ E p ΞΌ)
423422

424423
/-- The `π•œ`-submodule of elements of `Ξ± β†’β‚˜[ΞΌ] E` whose `Lp` norm is finite. This is `Lp E p ΞΌ`,
425424
with extra structure. -/
426425
def LpSubmodule : Submodule π•œ (Ξ± β†’β‚˜[ΞΌ] E) :=
427426
{ Lp E p μ with smul_mem' := fun c f hf => by simpa using const_smul_mem_Lp c ⟨f, hf⟩ }
428427

429-
variable {E p ΞΌ π•œ}
428+
variable {π•œ E p ΞΌ}
430429

431-
theorem coe_LpSubmodule : (LpSubmodule E p ΞΌ π•œ).toAddSubgroup = Lp E p ΞΌ :=
430+
theorem coe_LpSubmodule : (LpSubmodule π•œ E p ΞΌ).toAddSubgroup = Lp E p ΞΌ :=
432431
rfl
433432

434433
instance instModule : Module π•œ (Lp E p ΞΌ) :=
435-
{ (LpSubmodule E p ΞΌ π•œ).module with }
434+
{ (LpSubmodule π•œ E p ΞΌ).module with }
436435

437436
theorem coeFn_smul (c : π•œ) (f : Lp E p ΞΌ) : ⇑(c β€’ f) =ᡐ[ΞΌ] c β€’ ⇑f :=
438437
AEEqFun.coeFn_smul _ _
@@ -1548,7 +1547,7 @@ variable (π•œ : Type*) [Fact (1 ≀ p)]
15481547
as an element of `Lp`. -/
15491548
def toLp [NormedField π•œ] [NormedSpace π•œ E] : (Ξ± →ᡇ E) β†’L[π•œ] Lp E p ΞΌ :=
15501549
LinearMap.mkContinuous
1551-
(LinearMap.codRestrict (Lp.LpSubmodule E p ΞΌ π•œ)
1550+
(LinearMap.codRestrict (Lp.LpSubmodule π•œ E p ΞΌ)
15521551
((ContinuousMap.toAEEqFunLinearMap ΞΌ).comp (toContinuousMapLinearMap Ξ± E π•œ)) mem_Lp)
15531552
_ Lp_norm_le
15541553

0 commit comments

Comments
Β (0)