@@ -86,6 +86,40 @@ protected theorem PiLp.ext {p : ℝ≥0∞} {ι : Type*} {α : ι → Type*} {x
86
86
namespace PiLp
87
87
88
88
variable (p : ℝ≥0 ∞) (𝕜 : Type *) {ι : Type *} (α : ι → Type *) (β : ι → Type *)
89
+ section
90
+ /- Register simplification lemmas for the applications of `PiLp` elements, as the usual lemmas
91
+ for Pi types will not trigger. -/
92
+ variable {𝕜 p α}
93
+ variable [SeminormedRing 𝕜] [∀ i, SeminormedAddCommGroup (β i)]
94
+ variable [∀ i, Module 𝕜 (β i)] [∀ i, BoundedSMul 𝕜 (β i)] (c : 𝕜)
95
+
96
+ variable (x y : PiLp p β) (i : ι)
97
+
98
+ @[simp]
99
+ theorem zero_apply : (0 : PiLp p β) i = 0 :=
100
+ rfl
101
+ #align pi_Lp.zero_apply PiLp.zero_apply
102
+
103
+ @[simp]
104
+ theorem add_apply : (x + y) i = x i + y i :=
105
+ rfl
106
+ #align pi_Lp.add_apply PiLp.add_apply
107
+
108
+ @[simp]
109
+ theorem sub_apply : (x - y) i = x i - y i :=
110
+ rfl
111
+ #align pi_Lp.sub_apply PiLp.sub_apply
112
+
113
+ @[simp]
114
+ theorem smul_apply : (c • x) i = c • x i :=
115
+ rfl
116
+ #align pi_Lp.smul_apply PiLp.smul_apply
117
+
118
+ @[simp]
119
+ theorem neg_apply : (-x) i = -x i :=
120
+ rfl
121
+ #align pi_Lp.neg_apply PiLp.neg_apply
122
+ end
89
123
90
124
/-! Note that the unapplied versions of these lemmas are deliberately omitted, as they break
91
125
the use of the type synonym. -/
@@ -223,11 +257,11 @@ separate from `PiLp.seminormedAddCommGroup` since the latter requires the type c
223
257
224
258
Registering this separately allows for a future norm-like structure on `PiLp p β` for `p < 1`
225
259
satisfying a relaxed triangle inequality. These are called *quasi-norms* . -/
226
- instance hasNorm : Norm (PiLp p β) where
260
+ instance instNorm : Norm (PiLp p β) where
227
261
norm f :=
228
262
if p = 0 then {i | ‖f i‖ ≠ 0 }.toFinite.toFinset.card
229
263
else if p = ∞ then ⨆ i, ‖f i‖ else (∑ i, ‖f i‖ ^ p.toReal) ^ (1 / p.toReal)
230
- #align pi_Lp.has_norm PiLp.hasNorm
264
+ #align pi_Lp.has_norm PiLp.instNorm
231
265
232
266
variable {p β}
233
267
@@ -299,7 +333,6 @@ def pseudoEmetricAux : PseudoEMetricSpace (PiLp p β) where
299
333
(∑ i, edist (f i) (g i) ^ p.toReal) ^ (1 / p.toReal) +
300
334
(∑ i, edist (g i) (h i) ^ p.toReal) ^ (1 / p.toReal) :=
301
335
ENNReal.Lp_add_le _ _ _ hp
302
-
303
336
#align pi_Lp.pseudo_emetric_aux PiLp.pseudoEmetricAux
304
337
305
338
attribute [local instance] PiLp.pseudoEmetricAux
@@ -528,17 +561,13 @@ instance seminormedAddCommGroup [∀ i, SeminormedAddCommGroup (β i)] :
528
561
{ Pi.addCommGroup with
529
562
dist_eq := fun x y => by
530
563
rcases p.dichotomy with (rfl | h)
531
- · simp only [dist_eq_iSup, norm_eq_ciSup, dist_eq_norm]
532
- -- Porting note: added
533
- congr
564
+ · simp only [dist_eq_iSup, norm_eq_ciSup, dist_eq_norm, sub_apply]
534
565
· have : p ≠ ∞ := by
535
566
intro hp
536
567
rw [hp, ENNReal.top_toReal] at h
537
568
linarith
538
569
simp only [dist_eq_sum (zero_lt_one.trans_le h), norm_eq_sum (zero_lt_one.trans_le h),
539
- dist_eq_norm]
540
- -- Porting note: added
541
- congr }
570
+ dist_eq_norm, sub_apply] }
542
571
#align pi_Lp.seminormed_add_comm_group PiLp.seminormedAddCommGroup
543
572
544
573
/-- normed group instance on the product of finitely many normed groups, using the `L^p` norm. -/
@@ -610,8 +639,7 @@ theorem norm_sq_eq_of_L2 (β : ι → Type*) [∀ i, SeminormedAddCommGroup (β
610
639
611
640
theorem dist_eq_of_L2 {β : ι → Type *} [∀ i, SeminormedAddCommGroup (β i)] (x y : PiLp 2 β) :
612
641
dist x y = (∑ i, dist (x i) (y i) ^ 2 ).sqrt := by
613
- simp_rw [dist_eq_norm, norm_eq_of_L2]
614
- rfl
642
+ simp_rw [dist_eq_norm, norm_eq_of_L2, sub_apply]
615
643
#align pi_Lp.dist_eq_of_L2 PiLp.dist_eq_of_L2
616
644
617
645
theorem nndist_eq_of_L2 {β : ι → Type *} [∀ i, SeminormedAddCommGroup (β i)] (x y : PiLp 2 β) :
@@ -626,7 +654,7 @@ theorem edist_eq_of_L2 {β : ι → Type*} [∀ i, SeminormedAddCommGroup (β i)
626
654
edist x y = (∑ i, edist (x i) (y i) ^ 2 ) ^ (1 / 2 : ℝ) := by simp [PiLp.edist_eq_sum]
627
655
#align pi_Lp.edist_eq_of_L2 PiLp.edist_eq_of_L2
628
656
629
- instance instboundedSMul [SeminormedRing 𝕜] [∀ i, SeminormedAddCommGroup (β i)]
657
+ instance instBoundedSMul [SeminormedRing 𝕜] [∀ i, SeminormedAddCommGroup (β i)]
630
658
[∀ i, Module 𝕜 (β i)] [∀ i, BoundedSMul 𝕜 (β i)] :
631
659
BoundedSMul 𝕜 (PiLp p β) :=
632
660
.of_nnnorm_smul_le fun c f => by
@@ -637,8 +665,6 @@ instance instboundedSMul [SeminormedRing 𝕜] [∀ i, SeminormedAddCommGroup (
637
665
have hpt : p ≠ ⊤ := p.toReal_pos_iff_ne_top.mp hp0
638
666
rw [nnnorm_eq_sum hpt, nnnorm_eq_sum hpt, NNReal.rpow_one_div_le_iff hp0, NNReal.mul_rpow,
639
667
← NNReal.rpow_mul, div_mul_cancel 1 hp0.ne', NNReal.rpow_one, Finset.mul_sum]
640
- -- Porting note: added to replace Pi.smul_apply
641
- have smul_apply : ∀ i : ι, (c • f) i = c • (f i) := fun i => rfl
642
668
simp_rw [← NNReal.mul_rpow, smul_apply]
643
669
exact Finset.sum_le_sum fun i _ => NNReal.rpow_le_rpow (nnnorm_smul_le _ _) hp0.le
644
670
@@ -648,39 +674,10 @@ instance normedSpace [NormedField 𝕜] [∀ i, SeminormedAddCommGroup (β i)]
648
674
norm_smul_le := norm_smul_le
649
675
#align pi_Lp.normed_space PiLp.normedSpace
650
676
651
- /- Register simplification lemmas for the applications of `PiLp` elements, as the usual lemmas
652
- for Pi types will not trigger. -/
653
677
variable {𝕜 p α}
654
678
variable [SeminormedRing 𝕜] [∀ i, SeminormedAddCommGroup (β i)]
655
679
variable [∀ i, Module 𝕜 (β i)] [∀ i, BoundedSMul 𝕜 (β i)] (c : 𝕜)
656
680
657
- variable (x y : PiLp p β) (x' y' : ∀ i, β i) (i : ι)
658
-
659
- @[simp]
660
- theorem zero_apply : (0 : PiLp p β) i = 0 :=
661
- rfl
662
- #align pi_Lp.zero_apply PiLp.zero_apply
663
-
664
- @[simp]
665
- theorem add_apply : (x + y) i = x i + y i :=
666
- rfl
667
- #align pi_Lp.add_apply PiLp.add_apply
668
-
669
- @[simp]
670
- theorem sub_apply : (x - y) i = x i - y i :=
671
- rfl
672
- #align pi_Lp.sub_apply PiLp.sub_apply
673
-
674
- @[simp]
675
- theorem smul_apply : (c • x) i = c • x i :=
676
- rfl
677
- #align pi_Lp.smul_apply PiLp.smul_apply
678
-
679
- @[simp]
680
- theorem neg_apply : (-x) i = -x i :=
681
- rfl
682
- #align pi_Lp.neg_apply PiLp.neg_apply
683
-
684
681
/-- The canonical map `WithLp.equiv` between `PiLp ∞ β` and `Π i, β i` as a linear isometric
685
682
equivalence. -/
686
683
def equivₗᵢ : PiLp ∞ β ≃ₗᵢ[𝕜] ∀ i, β i :=
@@ -703,8 +700,6 @@ def _root_.LinearIsometryEquiv.piLpCongrLeft (e : ι ≃ ι') :
703
700
(PiLp p fun _ : ι => E) ≃ₗᵢ[𝕜] PiLp p fun _ : ι' => E where
704
701
toLinearEquiv := LinearEquiv.piCongrLeft' 𝕜 (fun _ : ι => E) e
705
702
norm_map' x' := by
706
- -- Porting note: this avoids spurious `x` and `y` arguments
707
- clear x y
708
703
rcases p.dichotomy with (rfl | h)
709
704
· simp_rw [norm_eq_ciSup]
710
705
exact e.symm.iSup_congr fun _ => rfl
@@ -754,7 +749,6 @@ variable [DecidableEq ι]
754
749
@[simp]
755
750
theorem nnnorm_equiv_symm_single [hp : Fact (1 ≤ p)] (i : ι) (b : β i) :
756
751
‖(WithLp.equiv p (∀ i, β i)).symm (Pi.single i b)‖₊ = ‖b‖₊ := by
757
- clear x y -- Porting note: added
758
752
haveI : Nonempty ι := ⟨i⟩
759
753
induction p using ENNReal.recTopCoe generalizing hp with
760
754
| top =>
@@ -834,7 +828,6 @@ for `p ≠ ∞`. -/
834
828
theorem nnnorm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
835
829
‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
836
830
(Fintype.card ι : ℝ≥0 ) ^ (1 / p).toReal * ‖b‖₊ := by
837
- clear x y -- Porting note: added to avoid spurious arguments
838
831
rcases em <| p = ∞ with (rfl | hp)
839
832
· simp only [WithLp.equiv_symm_pi_apply, ENNReal.div_top, ENNReal.zero_toReal, NNReal.rpow_zero,
840
833
one_mul, nnnorm_eq_ciSup, Function.const_apply, ciSup_const]
0 commit comments