-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathlpSpace.lean
More file actions
1394 lines (1129 loc) · 55.6 KB
/
lpSpace.lean
File metadata and controls
1394 lines (1129 loc) · 55.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/-
Copyright (c) 2021 Heather Macbeth. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Heather Macbeth
-/
module
public import Mathlib.Analysis.MeanInequalities
public import Mathlib.Analysis.MeanInequalitiesPow
public import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
public import Mathlib.Data.Set.Image
public import Mathlib.Topology.Algebra.ContinuousMonoidHom
public import Mathlib.Algebra.Order.Group.Pointwise.Bounds
/-!
# ℓp space
This file describes properties of elements `f` of a pi-type `∀ i, E i` with finite "norm",
defined for `p : ℝ≥0∞` as the size of the support of `f` if `p=0`, `(∑' a, ‖f a‖^p) ^ (1/p)` for
`0 < p < ∞` and `⨆ a, ‖f a‖` for `p=∞`.
The Prop-valued `Memℓp f p` states that a function `f : ∀ i, E i` has finite norm according
to the above definition; that is, `f` has finite support if `p = 0`, `Summable (fun a ↦ ‖f a‖^p)` if
`0 < p < ∞`, and `BddAbove (norm '' (Set.range f))` if `p = ∞`.
The space `lp E p` is the subtype of elements of `∀ i : α, E i` which satisfy `Memℓp f p`. For
`1 ≤ p`, the "norm" is genuinely a norm and `lp` is a complete metric space.
## Main definitions
* `Memℓp f p` : property that the function `f` satisfies, as appropriate, `f` finitely supported
if `p = 0`, `Summable (fun a ↦ ‖f a‖^p)` if `0 < p < ∞`, and `BddAbove (norm '' (Set.range f))` if
`p = ∞`.
* `lp E p` : elements of `∀ i : α, E i` such that `Memℓp f p`. Defined as an `AddSubgroup` of
a type synonym `PreLp` for `∀ i : α, E i`, and equipped with a `NormedAddCommGroup` structure.
Under appropriate conditions, this is also equipped with the instances `lp.normedSpace`,
`lp.completeSpace`. For `p=∞`, there is also `lp.inftyNormedRing`,
`lp.inftyNormedAlgebra`, `lp.inftyStarRing` and `lp.inftyCStarRing`.
## Main results
* `Memℓp.of_exponent_ge`: For `q ≤ p`, a function which is `Memℓp` for `q` is also `Memℓp` for `p`.
* `lp.memℓp_of_tendsto`, `lp.norm_le_of_tendsto`: A pointwise limit of functions in `lp`, all with
`lp` norm `≤ C`, is itself in `lp` and has `lp` norm `≤ C`.
* `lp.tsum_mul_le_mul_norm`: basic form of Hölder's inequality
## Implementation
Since `lp` is defined as an `AddSubgroup`, dot notation does not work. Use `lp.norm_neg f` to
say that `‖-f‖ = ‖f‖`, instead of the non-working `f.norm_neg`.
## TODO
* More versions of Hölder's inequality (for example: the case `p = 1`, `q = ∞`; a version for normed
rings which has `‖∑' i, f i * g i‖` rather than `∑' i, ‖f i‖ * g i‖` on the RHS; a version for
three exponents satisfying `1 / r = 1 / p + 1 / q`)
-/
@[expose] public section
noncomputable section
open scoped NNReal ENNReal Function
variable {𝕜 𝕜' : Type*} {α : Type*} {E : α → Type*} {p q : ℝ≥0∞} [∀ i, NormedAddCommGroup (E i)]
/-!
### `Memℓp` predicate
-/
/-- The property that `f : ∀ i : α, E i`
* is finitely supported, if `p = 0`, or
* admits an upper bound for `Set.range (fun i ↦ ‖f i‖)`, if `p = ∞`, or
* has the series `∑' i, ‖f i‖ ^ p` be summable, if `0 < p < ∞`. -/
def Memℓp (f : ∀ i, E i) (p : ℝ≥0∞) : Prop :=
if p = 0 then Set.Finite { i | f i ≠ 0 }
else if p = ∞ then BddAbove (Set.range fun i => ‖f i‖)
else Summable fun i => ‖f i‖ ^ p.toReal
theorem memℓp_zero_iff {f : ∀ i, E i} : Memℓp f 0 ↔ Set.Finite { i | f i ≠ 0 } := by
dsimp [Memℓp]
rw [if_pos rfl]
theorem memℓp_zero {f : ∀ i, E i} (hf : Set.Finite { i | f i ≠ 0 }) : Memℓp f 0 :=
memℓp_zero_iff.2 hf
theorem memℓp_infty_iff {f : ∀ i, E i} : Memℓp f ∞ ↔ BddAbove (Set.range fun i => ‖f i‖) := by
simp [Memℓp]
theorem memℓp_infty {f : ∀ i, E i} (hf : BddAbove (Set.range fun i => ‖f i‖)) : Memℓp f ∞ :=
memℓp_infty_iff.2 hf
theorem memℓp_gen_iff (hp : 0 < p.toReal) {f : ∀ i, E i} :
Memℓp f p ↔ Summable fun i => ‖f i‖ ^ p.toReal := by
rw [ENNReal.toReal_pos_iff] at hp
dsimp [Memℓp]
rw [if_neg hp.1.ne', if_neg hp.2.ne]
theorem memℓp_gen {f : ∀ i, E i} (hf : Summable fun i => ‖f i‖ ^ p.toReal) : Memℓp f p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf
exact (Set.Finite.of_summable_const (by simp) H).subset (Set.subset_univ _)
· apply memℓp_infty
have H : Summable fun _ : α => (1 : ℝ) := by simpa using hf
simpa using ((Set.Finite.of_summable_const (by simp) H).image fun i => ‖f i‖).bddAbove
exact (memℓp_gen_iff hp).2 hf
theorem memℓp_gen' {C : ℝ} {f : ∀ i, E i} (hf : ∀ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C) :
Memℓp f p := by
apply memℓp_gen
use ⨆ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal
apply hasSum_of_isLUB_of_nonneg
· intro b
positivity
apply isLUB_ciSup
use C
rintro - ⟨s, rfl⟩
exact hf s
theorem memℓp_gen_iff' {f : (i : α) → E i} (hp : 0 < p.toReal) :
Memℓp f p ↔ ∀ (s : Finset α), ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ ∑' i, ‖f i‖ ^ p.toReal := by
refine ⟨fun hf ↦ ?_, memℓp_gen'⟩
obtain ⟨hp₁, hp₂⟩ := ENNReal.toReal_pos_iff.mp hp
simp only [Memℓp, hp₁.ne', ↓reduceIte, hp₂.ne] at hf
simpa [upperBounds] using isLUB_hasSum (by intro; positivity) hf.hasSum |>.1
theorem memℓp_gen_iff'' {f : (i : α) → E i} (hp : 0 < p.toReal) :
Memℓp f p ↔ ∃ C, 0 ≤ C ∧ ∀ (s : Finset α), ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C := by
refine ⟨fun hf ↦ ?_, fun ⟨C, _, hC⟩ ↦ memℓp_gen' hC⟩
exact ⟨_, tsum_nonneg fun i ↦ (by positivity), memℓp_gen_iff' hp |>.mp hf⟩
theorem zero_memℓp : Memℓp (0 : ∀ i, E i) p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
simp
· apply memℓp_infty
simp only [norm_zero, Pi.zero_apply]
exact bddAbove_singleton.mono Set.range_const_subset
· apply memℓp_gen
simp [Real.zero_rpow hp.ne', summable_zero]
theorem zero_mem_ℓp' : Memℓp (fun i : α => (0 : E i)) p :=
zero_memℓp
theorem memℓp_norm_iff {f : (i : α) → E i} :
Memℓp (‖f ·‖) p ↔ Memℓp f p := by
obtain (rfl | rfl | hp) := p.trichotomy
· simp [memℓp_zero_iff]
· simp [memℓp_infty_iff]
· simp [memℓp_gen_iff hp]
alias ⟨Memℓp.of_norm, Memℓp.norm⟩ := memℓp_norm_iff
namespace Memℓp
theorem mono {f : (i : α) → E i} {g : α → ℝ}
(hg : Memℓp g p) (hfg : ∀ i, ‖f i‖ ≤ g i) :
Memℓp f p := by
replace hfg (i) : ‖f i‖ ≤ ‖g i‖ := (hfg i).trans (Real.le_norm_self _)
obtain (rfl | rfl | hp) := p.trichotomy
· simp_rw [memℓp_zero_iff, ← norm_pos_iff] at hg ⊢
refine hg.subset fun i hi ↦ hi.trans_le <| hfg i
· rw [memℓp_infty_iff] at hg ⊢
exact hg.range_mono _ hfg
· rw [memℓp_gen_iff hp] at hg ⊢
apply hg.of_norm_bounded fun i ↦ ?_
rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]
gcongr
exact hfg i
/-- Often it is more convenient to use `Memℓp.mono`, where the bounding function is real-valued.
This version is provable from that one using `Memℓp.toNorm` applied to the argument with type
`Memℓp g p`. -/
theorem mono' {F : α → Type*} [∀ i, NormedAddCommGroup (F i)] {f : (i : α) → E i}
{g : (i : α) → F i} (hg : Memℓp g p) (hfg : ∀ i, ‖f i‖ ≤ ‖g i‖) :
Memℓp f p :=
hg.norm.mono hfg
theorem finite_dsupport {f : ∀ i, E i} (hf : Memℓp f 0) : Set.Finite { i | f i ≠ 0 } :=
memℓp_zero_iff.1 hf
theorem bddAbove {f : ∀ i, E i} (hf : Memℓp f ∞) : BddAbove (Set.range fun i => ‖f i‖) :=
memℓp_infty_iff.1 hf
theorem summable (hp : 0 < p.toReal) {f : ∀ i, E i} (hf : Memℓp f p) :
Summable fun i => ‖f i‖ ^ p.toReal :=
(memℓp_gen_iff hp).1 hf
lemma summable_of_one {E : Type*} [NormedAddCommGroup E] [CompleteSpace E]
{x : α → E} (hx : Memℓp x 1) : Summable x :=
.of_norm <| by simpa using hx.summable
theorem neg {f : ∀ i, E i} (hf : Memℓp f p) : Memℓp (-f) p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
simp [hf.finite_dsupport]
· apply memℓp_infty
simpa using hf.bddAbove
· apply memℓp_gen
simpa using hf.summable hp
@[simp]
theorem neg_iff {f : ∀ i, E i} : Memℓp (-f) p ↔ Memℓp f p :=
⟨fun h => neg_neg f ▸ h.neg, Memℓp.neg⟩
theorem of_exponent_ge {p q : ℝ≥0∞} {f : ∀ i, E i} (hfq : Memℓp f q) (hpq : q ≤ p) : Memℓp f p := by
rcases ENNReal.trichotomy₂ hpq with
(⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ | ⟨rfl, hp⟩ | ⟨rfl, rfl⟩ | ⟨hq, rfl⟩ | ⟨hq, _, hpq'⟩)
· exact hfq
· apply memℓp_infty
obtain ⟨C, hC⟩ := (hfq.finite_dsupport.image fun i => ‖f i‖).bddAbove
use max 0 C
rintro x ⟨i, rfl⟩
by_cases hi : f i = 0
· simp [hi]
· exact (hC ⟨i, hi, rfl⟩).trans (le_max_right _ _)
· apply memℓp_gen
have : ∀ i ∉ hfq.finite_dsupport.toFinset, ‖f i‖ ^ p.toReal = 0 := by
intro i hi
have : f i = 0 := by simpa using hi
simp [this, Real.zero_rpow hp.ne']
exact summable_of_ne_finset_zero this
· exact hfq
· apply memℓp_infty
obtain ⟨A, hA⟩ := (hfq.summable hq).tendsto_cofinite_zero.bddAbove_range_of_cofinite
use A ^ q.toReal⁻¹
rintro x ⟨i, rfl⟩
have : 0 ≤ ‖f i‖ ^ q.toReal := by positivity
simpa [← Real.rpow_mul, mul_inv_cancel₀ hq.ne'] using
Real.rpow_le_rpow this (hA ⟨i, rfl⟩) (inv_nonneg.mpr hq.le)
· apply memℓp_gen
have hf' := hfq.summable hq
refine .of_norm_bounded_eventually hf' (@Set.Finite.subset _ { i | 1 ≤ ‖f i‖ } ?_ _ ?_)
· have H : { x : α | 1 ≤ ‖f x‖ ^ q.toReal }.Finite := by
simpa using hf'.tendsto_cofinite_zero.eventually_lt_const (by simp)
exact H.subset fun i hi => Real.one_le_rpow hi hq.le
· change ∀ i, ¬|‖f i‖ ^ p.toReal| ≤ ‖f i‖ ^ q.toReal → 1 ≤ ‖f i‖
intro i hi
have : 0 ≤ ‖f i‖ ^ p.toReal := by positivity
simp only [abs_of_nonneg, this] at hi
contrapose! hi
exact Real.rpow_le_rpow_of_exponent_ge' (norm_nonneg _) hi.le hq.le hpq'
theorem add {f g : ∀ i, E i} (hf : Memℓp f p) (hg : Memℓp g p) : Memℓp (f + g) p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
refine (hf.finite_dsupport.union hg.finite_dsupport).subset fun i => ?_
simp only [Pi.add_apply, Ne, Set.mem_union, Set.mem_setOf_eq]
contrapose!
rintro ⟨hf', hg'⟩
simp [hf', hg']
· apply memℓp_infty
obtain ⟨A, hA⟩ := hf.bddAbove
obtain ⟨B, hB⟩ := hg.bddAbove
refine ⟨A + B, ?_⟩
rintro a ⟨i, rfl⟩
exact le_trans (norm_add_le _ _) (add_le_add (hA ⟨i, rfl⟩) (hB ⟨i, rfl⟩))
apply memℓp_gen
let C : ℝ := if p.toReal < 1 then 1 else (2 : ℝ) ^ (p.toReal - 1)
refine .of_nonneg_of_le ?_ (fun i => ?_) (((hf.summable hp).add (hg.summable hp)).mul_left C)
· intro; positivity
· refine (Real.rpow_le_rpow (norm_nonneg _) (norm_add_le _ _) hp.le).trans ?_
dsimp only [C]
split_ifs with h
· simpa using NNReal.coe_le_coe.2 (NNReal.rpow_add_le_add_rpow ‖f i‖₊ ‖g i‖₊ hp.le h.le)
· let F : Fin 2 → ℝ≥0 := ![‖f i‖₊, ‖g i‖₊]
simp only [not_lt] at h
simpa [Fin.sum_univ_succ] using
Real.rpow_sum_le_const_mul_sum_rpow_of_nonneg Finset.univ h fun i _ => (F i).coe_nonneg
theorem sub {f g : ∀ i, E i} (hf : Memℓp f p) (hg : Memℓp g p) : Memℓp (f - g) p := by
rw [sub_eq_add_neg]; exact hf.add hg.neg
theorem finset_sum {ι} (s : Finset ι) {f : ι → ∀ i, E i} (hf : ∀ i ∈ s, Memℓp (f i) p) :
Memℓp (fun a => ∑ i ∈ s, f i a) p := by
haveI : DecidableEq ι := Classical.decEq _
revert hf
refine Finset.induction_on s ?_ ?_
· simp only [zero_mem_ℓp', Finset.sum_empty, imp_true_iff]
· intro i s his ih hf
simp only [his, Finset.sum_insert, not_false_iff]
exact (hf i (s.mem_insert_self i)).add (ih fun j hj => hf j (Finset.mem_insert_of_mem hj))
section IsBoundedSMul
variable [NormedRing 𝕜] [∀ i, Module 𝕜 (E i)] [∀ i, IsBoundedSMul 𝕜 (E i)]
theorem const_smul {f : ∀ i, E i} (hf : Memℓp f p) (c : 𝕜) : Memℓp (c • f) p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
refine hf.finite_dsupport.subset fun i => (?_ : ¬c • f i = 0 → ¬f i = 0)
exact not_imp_not.mpr fun hf' => hf'.symm ▸ smul_zero c
· obtain ⟨A, hA⟩ := hf.bddAbove
refine memℓp_infty ⟨‖c‖ * A, ?_⟩
rintro a ⟨i, rfl⟩
dsimp only [Pi.smul_apply]
refine (norm_smul_le _ _).trans ?_
gcongr
exact hA ⟨i, rfl⟩
· apply memℓp_gen
dsimp only [Pi.smul_apply]
have := (hf.summable hp).mul_left (↑(‖c‖₊ ^ p.toReal) : ℝ)
simp_rw [← coe_nnnorm, ← NNReal.coe_rpow, ← NNReal.coe_mul, NNReal.summable_coe,
← NNReal.mul_rpow] at this ⊢
refine NNReal.summable_of_le ?_ this
intro i
gcongr
apply nnnorm_smul_le
theorem const_mul {f : α → 𝕜} (hf : Memℓp f p) (c : 𝕜) : Memℓp (fun x => c * f x) p :=
hf.const_smul c
end IsBoundedSMul
end Memℓp
/-!
### lp space
The space of elements of `∀ i, E i` satisfying the predicate `Memℓp`.
-/
/-- We define `PreLp E` to be a type synonym for `∀ i, E i` which, importantly, does not inherit
the `pi` topology on `∀ i, E i` (otherwise this topology would descend to `lp E p` and conflict
with the normed group topology we will later equip it with.)
We choose to deal with this issue by making a type synonym for `∀ i, E i` rather than for the `lp`
subgroup itself, because this allows all the spaces `lp E p` (for varying `p`) to be subgroups of
the same ambient group, which permits lemma statements like `lp.monotone` (below). -/
@[nolint unusedArguments]
def PreLp (E : α → Type*) [∀ i, NormedAddCommGroup (E i)] : Type _ :=
∀ i, E i
deriving AddCommGroup
instance PreLp.unique [IsEmpty α] : Unique (PreLp E) :=
inferInstanceAs <| Unique (∀ _, _)
/-- **The (little) ℓᵖ space**: The additive subgroup of a type synonym of `Π i, E i`, which consists
of those functions `f` such that `Memℓp f p` (i.e., `f` has finite `p`-norm).
The non-dependent version comes equipped with the notation `ℓ^p(ι, E)` in the `lp` namespace. When
`p` takes the values `0`, `1` or `2`, the notation `ℓ⁰(ι, E)`, `ℓ¹(ι, E)`, `ℓ²(ι, E)` is also
available. -/
def lp (E : α → Type*) [∀ i, NormedAddCommGroup (E i)] (p : ℝ≥0∞) : AddSubgroup (PreLp E) where
carrier := { f | Memℓp f p }
zero_mem' := zero_memℓp
add_mem' := Memℓp.add
neg_mem' := Memℓp.neg
@[inherit_doc] scoped[lp] notation "ℓ^" p "(" ι ", " E ")" => lp (fun _ : ι ↦ E) p
/-- `ℓ⁰(ι, E)` is the space of finitely supported functions `ι → E`. In general, this should not
be used outside of the context of `ℓ^p(ι, E)` spaces, and one should instead prefer `Finsupp`
in other situations. -/
scoped[lp] notation "ℓ⁰(" ι ", " E ")" => lp (fun _ : ι ↦ E) 0
/-- `ℓ¹(ι, E)` is the space of summable functions `ι → E`. To be more precise, it is the space
of functions whose *norms* are summable, but when `E` is complete these coincide. -/
scoped[lp] notation "ℓ¹(" ι ", " E ")" => lp (fun _ : ι ↦ E) 1
/-- `ℓ²(ι, E)` is the space of square-summable functions `ι → E`. When `E := 𝕜`, with `RCLike 𝕜`,
this is a Hilbert space. -/
scoped[lp] notation "ℓ²(" ι ", " E ")" => lp (fun _ : ι ↦ E) 2
namespace lp
-- TODO: this instance is bad because it inserts `Subtype.val` as the casting function,
-- which abuses definitional equality.
instance coeFun : CoeFun (lp E p) fun _ => ∀ i, E i :=
⟨Subtype.val (α := ∀ i, E i)⟩
@[ext]
theorem ext {f g : lp E p} (h : (f : ∀ i, E i) = g) : f = g :=
Subtype.ext h
theorem eq_zero' [IsEmpty α] (f : lp E p) : f = 0 :=
Subsingleton.elim f 0
protected theorem monotone {p q : ℝ≥0∞} (hpq : q ≤ p) : lp E q ≤ lp E p :=
fun _ hf => Memℓp.of_exponent_ge hf hpq
protected theorem memℓp (f : lp E p) : Memℓp f p :=
f.prop
variable (E p)
@[simp]
theorem coeFn_zero : ⇑(0 : lp E p) = 0 :=
rfl
variable {E p}
@[simp]
theorem coeFn_neg (f : lp E p) : ⇑(-f) = -f :=
rfl
@[simp]
theorem coeFn_add (f g : lp E p) : ⇑(f + g) = f + g :=
rfl
variable (p E) in
/-- Coercion to function as an `AddMonoidHom`. -/
def coeFnAddMonoidHom : lp E p →+ (∀ i, E i) where
toFun := (⇑)
__ := AddSubgroup.subtype _
@[simp]
theorem coeFnAddMonoidHom_apply (x : lp E p) : coeFnAddMonoidHom E p x = ⇑x := rfl
theorem coeFn_sum {ι : Type*} (f : ι → lp E p) (s : Finset ι) :
⇑(∑ i ∈ s, f i) = ∑ i ∈ s, ⇑(f i) :=
(lp E p).val_finset_sum f s
@[simp]
theorem coeFn_sub (f g : lp E p) : ⇑(f - g) = f - g :=
rfl
instance : Norm (lp E p) where
norm f :=
if hp : p = 0 then by
subst hp
exact ((lp.memℓp f).finite_dsupport.toFinset.card : ℝ)
else if p = ∞ then ⨆ i, ‖f i‖ else (∑' i, ‖f i‖ ^ p.toReal) ^ (1 / p.toReal)
theorem norm_eq_card_dsupport (f : lp E 0) : ‖f‖ = (lp.memℓp f).finite_dsupport.toFinset.card :=
dif_pos rfl
theorem norm_eq_ciSup (f : lp E ∞) : ‖f‖ = ⨆ i, ‖f i‖ := rfl
theorem isLUB_norm [Nonempty α] (f : lp E ∞) : IsLUB (Set.range fun i => ‖f i‖) ‖f‖ := by
rw [lp.norm_eq_ciSup]
exact isLUB_ciSup (lp.memℓp f)
theorem norm_eq_tsum_rpow (hp : 0 < p.toReal) (f : lp E p) :
‖f‖ = (∑' i, ‖f i‖ ^ p.toReal) ^ (1 / p.toReal) := by
dsimp [norm]
rw [ENNReal.toReal_pos_iff] at hp
rw [dif_neg hp.1.ne', if_neg hp.2.ne]
theorem norm_rpow_eq_tsum (hp : 0 < p.toReal) (f : lp E p) :
‖f‖ ^ p.toReal = ∑' i, ‖f i‖ ^ p.toReal := by
rw [norm_eq_tsum_rpow hp, ← Real.rpow_mul]
· field_simp
simp
positivity
theorem hasSum_norm (hp : 0 < p.toReal) (f : lp E p) :
HasSum (fun i => ‖f i‖ ^ p.toReal) (‖f‖ ^ p.toReal) := by
rw [norm_rpow_eq_tsum hp]
exact ((lp.memℓp f).summable hp).hasSum
/-- The sequence of norms of `x : lp E p` as a term of `ℓ^p(α, ℝ)`. Here `E : α → Type*`
is a dependent type and `ℓ^p(α, ℝ)` is the non-dependent `ℝ`-valued `lp` space. -/
@[simps]
def toNorm {p : ℝ≥0∞} (x : lp E p) : ℓ^p(α, ℝ) :=
⟨fun i ↦ ‖x i‖, lp.memℓp x |>.norm⟩
lemma norm_toNorm {p : ℝ≥0∞} {x : lp E p} :
‖toNorm x‖ = ‖x‖ := by
obtain (rfl | rfl | hp) := p.trichotomy
· simp [norm_eq_card_dsupport]
· simp [norm_eq_ciSup]
· simp [norm_eq_tsum_rpow hp]
theorem norm_nonneg' (f : lp E p) : 0 ≤ ‖f‖ := by
rcases p.trichotomy with (rfl | rfl | hp)
· simp [lp.norm_eq_card_dsupport f]
· rcases isEmpty_or_nonempty α with _i | _i
· rw [lp.norm_eq_ciSup]
simp [Real.iSup_of_isEmpty]
inhabit α
exact (norm_nonneg (f default)).trans ((lp.isLUB_norm f).1 ⟨default, rfl⟩)
· rw [lp.norm_eq_tsum_rpow hp f]
exact Real.rpow_nonneg (tsum_nonneg fun i ↦ by positivity) _
set_option backward.isDefEq.respectTransparency false in
@[simp]
theorem norm_zero : ‖(0 : lp E p)‖ = 0 := by
rcases p.trichotomy with (rfl | rfl | hp)
· simp [lp.norm_eq_card_dsupport]
· simp [lp.norm_eq_ciSup]
· rw [lp.norm_eq_tsum_rpow hp]
have hp' : 1 / p.toReal ≠ 0 := one_div_ne_zero hp.ne'
simpa [Real.zero_rpow hp.ne'] using Real.zero_rpow hp'
theorem norm_eq_zero_iff {f : lp E p} : ‖f‖ = 0 ↔ f = 0 := by
refine ⟨fun h => ?_, by rintro rfl; exact norm_zero⟩
rcases p.trichotomy with (rfl | rfl | hp)
· ext i
have : { i : α | ¬f i = 0 } = ∅ := by simpa [lp.norm_eq_card_dsupport f] using h
have : (¬f i = 0) = False := congr_fun this i
tauto
· rcases isEmpty_or_nonempty α with _i | _i
· simp [eq_iff_true_of_subsingleton]
have H : IsLUB (Set.range fun i => ‖f i‖) 0 := by simpa [h] using lp.isLUB_norm f
ext i
have : ‖f i‖ = 0 := le_antisymm (H.1 ⟨i, rfl⟩) (norm_nonneg _)
simpa using this
· have hf : HasSum (fun i : α => ‖f i‖ ^ p.toReal) 0 := by
have := lp.hasSum_norm hp f
rwa [h, Real.zero_rpow hp.ne'] at this
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i ↦ by positivity
rw [hasSum_zero_iff_of_nonneg this] at hf
ext i
have : f i = 0 ∧ p.toReal ≠ 0 := by
simpa [Real.rpow_eq_zero_iff_of_nonneg (norm_nonneg (f i))] using congr_fun hf i
exact this.1
theorem eq_zero_iff_coeFn_eq_zero {f : lp E p} : f = 0 ↔ ⇑f = 0 := by
rw [lp.ext_iff, coeFn_zero]
@[simp]
theorem norm_neg ⦃f : lp E p⦄ : ‖-f‖ = ‖f‖ := by
rcases p.trichotomy with (rfl | rfl | hp)
· simp only [norm_eq_card_dsupport, coeFn_neg, Pi.neg_apply, ne_eq, neg_eq_zero]
· cases isEmpty_or_nonempty α
· simp only [lp.eq_zero' f, neg_zero, norm_zero]
apply (lp.isLUB_norm (-f)).unique
simpa only [coeFn_neg, Pi.neg_apply, norm_neg] using lp.isLUB_norm f
· suffices ‖-f‖ ^ p.toReal = ‖f‖ ^ p.toReal by
exact Real.rpow_left_injOn hp.ne' (norm_nonneg' _) (norm_nonneg' _) this
apply (lp.hasSum_norm hp (-f)).unique
simpa only [coeFn_neg, Pi.neg_apply, _root_.norm_neg] using lp.hasSum_norm hp f
instance normedAddCommGroup [hp : Fact (1 ≤ p)] : NormedAddCommGroup (lp E p) :=
fast_instance% AddGroupNorm.toNormedAddCommGroup
{ toFun := norm
map_zero' := norm_zero
neg' := norm_neg
add_le' := fun f g => by
rcases p.dichotomy with (rfl | hp')
· cases isEmpty_or_nonempty α
· simp only [lp.eq_zero' f, zero_add, norm_zero, le_refl]
refine (lp.isLUB_norm (f + g)).2 ?_
rintro x ⟨i, rfl⟩
refine le_trans ?_ (add_mem_upperBounds_add
(lp.isLUB_norm f).1 (lp.isLUB_norm g).1 ⟨_, ⟨i, rfl⟩, _, ⟨i, rfl⟩, rfl⟩)
exact norm_add_le (f i) (g i)
· have hp'' : 0 < p.toReal := zero_lt_one.trans_le hp'
have hf₁ : ∀ i, 0 ≤ ‖f i‖ := fun i => norm_nonneg _
have hg₁ : ∀ i, 0 ≤ ‖g i‖ := fun i => norm_nonneg _
have hf₂ := lp.hasSum_norm hp'' f
have hg₂ := lp.hasSum_norm hp'' g
-- apply Minkowski's inequality
obtain ⟨C, hC₁, hC₂, hCfg⟩ :=
Real.Lp_add_le_hasSum_of_nonneg hp' hf₁ hg₁ (norm_nonneg' _) (norm_nonneg' _) hf₂ hg₂
refine le_trans ?_ hC₂
rw [← Real.rpow_le_rpow_iff (norm_nonneg' (f + g)) hC₁ hp'']
refine hasSum_le ?_ (lp.hasSum_norm hp'' (f + g)) hCfg
intro i
gcongr
apply norm_add_le
eq_zero_of_map_eq_zero' := fun _ => norm_eq_zero_iff.1 }
-- TODO: define an `ENNReal` version of `HolderConjugate`, and then express this inequality
-- in a better version which also covers the case `p = 1, q = ∞`.
/-- Hölder inequality -/
protected theorem tsum_mul_le_mul_norm {p q : ℝ≥0∞} (hpq : p.toReal.HolderConjugate q.toReal)
(f : lp E p) (g : lp E q) :
(Summable fun i => ‖f i‖ * ‖g i‖) ∧ ∑' i, ‖f i‖ * ‖g i‖ ≤ ‖f‖ * ‖g‖ := by
have hf₁ : ∀ i, 0 ≤ ‖f i‖ := fun i => norm_nonneg _
have hg₁ : ∀ i, 0 ≤ ‖g i‖ := fun i => norm_nonneg _
have hf₂ := lp.hasSum_norm hpq.pos f
have hg₂ := lp.hasSum_norm hpq.symm.pos g
obtain ⟨C, -, hC', hC⟩ :=
Real.inner_le_Lp_mul_Lq_hasSum_of_nonneg hpq (norm_nonneg' _) (norm_nonneg' _) hf₁ hg₁ hf₂ hg₂
rw [← hC.tsum_eq] at hC'
exact ⟨hC.summable, hC'⟩
protected theorem summable_mul {p q : ℝ≥0∞} (hpq : p.toReal.HolderConjugate q.toReal)
(f : lp E p) (g : lp E q) : Summable fun i => ‖f i‖ * ‖g i‖ :=
(lp.tsum_mul_le_mul_norm hpq f g).1
protected theorem tsum_mul_le_mul_norm' {p q : ℝ≥0∞} (hpq : p.toReal.HolderConjugate q.toReal)
(f : lp E p) (g : lp E q) : ∑' i, ‖f i‖ * ‖g i‖ ≤ ‖f‖ * ‖g‖ :=
(lp.tsum_mul_le_mul_norm hpq f g).2
section ComparePointwise
theorem norm_apply_le_norm (hp : p ≠ 0) (f : lp E p) (i : α) : ‖f i‖ ≤ ‖f‖ := by
rcases eq_or_ne p ∞ with (rfl | hp')
· haveI : Nonempty α := ⟨i⟩
exact (isLUB_norm f).1 ⟨i, rfl⟩
have hp'' : 0 < p.toReal := ENNReal.toReal_pos hp hp'
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i ↦ by positivity
rw [← Real.rpow_le_rpow_iff (norm_nonneg _) (norm_nonneg' _) hp'']
convert le_hasSum (hasSum_norm hp'' f) i fun i _ => this i
lemma lipschitzWith_one_eval (p : ℝ≥0∞) [Fact (1 ≤ p)] (i : α) :
LipschitzWith 1 (fun x : lp E p ↦ x i) :=
.mk_one fun _ _ ↦ by
simp_rw [dist_eq_norm, ← Pi.sub_apply, ← lp.coeFn_sub]
exact norm_apply_le_norm (zero_lt_one.trans_le Fact.out).ne' ..
theorem sum_rpow_le_norm_rpow (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ ‖f‖ ^ p.toReal := by
rw [lp.norm_rpow_eq_tsum hp f]
have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i ↦ by positivity
refine Summable.sum_le_tsum _ (fun i _ => this i) ?_
exact (lp.memℓp f).summable hp
theorem norm_le_of_forall_le' [Nonempty α] {f : lp E ∞} (C : ℝ) (hCf : ∀ i, ‖f i‖ ≤ C) :
‖f‖ ≤ C := by
refine (isLUB_norm f).2 ?_
rintro - ⟨i, rfl⟩
exact hCf i
theorem norm_le_of_forall_le {f : lp E ∞} {C : ℝ} (hC : 0 ≤ C) (hCf : ∀ i, ‖f i‖ ≤ C) :
‖f‖ ≤ C := by
cases isEmpty_or_nonempty α
· simpa [eq_zero' f] using hC
· exact norm_le_of_forall_le' C hCf
theorem norm_le_of_tsum_le (hp : 0 < p.toReal) {C : ℝ} (hC : 0 ≤ C) {f : lp E p}
(hf : ∑' i, ‖f i‖ ^ p.toReal ≤ C ^ p.toReal) : ‖f‖ ≤ C := by
rw [← Real.rpow_le_rpow_iff (norm_nonneg' _) hC hp, norm_rpow_eq_tsum hp]
exact hf
theorem norm_le_of_forall_sum_le (hp : 0 < p.toReal) {C : ℝ} (hC : 0 ≤ C) {f : lp E p}
(hf : ∀ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C ^ p.toReal) : ‖f‖ ≤ C :=
norm_le_of_tsum_le hp hC (((lp.memℓp f).summable hp).tsum_le_of_sum_le hf)
lemma norm_mono {F : α → Type*} [∀ i, NormedAddCommGroup (F i)]
{p : ℝ≥0∞} (hp : p ≠ 0) {x : lp E p} {y : lp F p} (h : ∀ i, ‖x i‖ ≤ ‖y i‖) :
‖x‖ ≤ ‖y‖ := by
obtain (rfl | rfl | hp) := p.trichotomy
· exact hp rfl |>.elim
· exact norm_le_of_forall_le (by positivity) fun i ↦ (h i).trans <| norm_apply_le_norm hp y i
· exact norm_le_of_forall_sum_le hp (norm_nonneg' _) fun s ↦ calc
∑ i ∈ s, ‖x i‖ ^ p.toReal
_ ≤ ∑ i ∈ s, ‖y i‖ ^ p.toReal := by gcongr with i _; exact h i
_ ≤ ‖y‖ ^ p.toReal := sum_rpow_le_norm_rpow hp y s
end ComparePointwise
section IsBoundedSMul
variable [NormedRing 𝕜] [NormedRing 𝕜']
variable [∀ i, Module 𝕜 (E i)] [∀ i, Module 𝕜' (E i)]
instance : Module 𝕜 (PreLp E) :=
inferInstanceAs <| Module 𝕜 (∀ i, E i)
instance [∀ i, SMulCommClass 𝕜' 𝕜 (E i)] : SMulCommClass 𝕜' 𝕜 (PreLp E) :=
inferInstanceAs <| SMulCommClass 𝕜' 𝕜 (∀ i, E i)
instance [SMul 𝕜' 𝕜] [∀ i, IsScalarTower 𝕜' 𝕜 (E i)] : IsScalarTower 𝕜' 𝕜 (PreLp E) :=
inferInstanceAs <| IsScalarTower 𝕜' 𝕜 (∀ i, E i)
instance [∀ i, Module 𝕜ᵐᵒᵖ (E i)] [∀ i, IsCentralScalar 𝕜 (E i)] : IsCentralScalar 𝕜 (PreLp E) :=
inferInstanceAs <| IsCentralScalar 𝕜 (∀ i, E i)
variable [∀ i, IsBoundedSMul 𝕜 (E i)] [∀ i, IsBoundedSMul 𝕜' (E i)]
theorem mem_lp_const_smul (c : 𝕜) (f : lp E p) : c • (f : PreLp E) ∈ lp E p :=
(lp.memℓp f).const_smul c
variable (𝕜 E p)
/-- The `𝕜`-submodule of elements of `∀ i : α, E i` whose `lp` norm is finite. This is `lp E p`,
with extra structure. -/
def _root_.lpSubmodule : Submodule 𝕜 (PreLp E) :=
{ lp E p with smul_mem' := fun c f hf => by simpa using mem_lp_const_smul c ⟨f, hf⟩ }
variable {𝕜 E p}
theorem coe_lpSubmodule : (lpSubmodule 𝕜 E p).toAddSubgroup = lp E p :=
rfl
instance : Module 𝕜 (lp E p) :=
inferInstanceAs <| Module 𝕜 (lpSubmodule 𝕜 E p)
@[simp]
theorem coeFn_smul (c : 𝕜) (f : lp E p) : ⇑(c • f) = c • ⇑f :=
rfl
instance [∀ i, SMulCommClass 𝕜' 𝕜 (E i)] : SMulCommClass 𝕜' 𝕜 (lp E p) :=
⟨fun _ _ _ => Subtype.ext <| smul_comm _ _ _⟩
instance [SMul 𝕜' 𝕜] [∀ i, IsScalarTower 𝕜' 𝕜 (E i)] : IsScalarTower 𝕜' 𝕜 (lp E p) :=
⟨fun _ _ _ => Subtype.ext <| smul_assoc _ _ _⟩
instance [∀ i, Module 𝕜ᵐᵒᵖ (E i)] [∀ i, IsCentralScalar 𝕜 (E i)] : IsCentralScalar 𝕜 (lp E p) :=
⟨fun _ _ => Subtype.ext <| op_smul_eq_smul _ _⟩
theorem norm_const_smul_le (hp : p ≠ 0) (c : 𝕜) (f : lp E p) : ‖c • f‖ ≤ ‖c‖ * ‖f‖ := by
rcases p.trichotomy with (rfl | rfl | hp)
· exact absurd rfl hp
· cases isEmpty_or_nonempty α
· simp [lp.eq_zero' f]
have hfc := (lp.isLUB_norm f).mul_left (norm_nonneg c)
simp_rw [← Set.range_comp, Function.comp_def] at hfc
exact norm_le_of_forall_le (by positivity)
fun i ↦ norm_smul_le c (f i) |>.trans <| hfc.1 ⟨i, rfl⟩
· letI inst : NNNorm (lp E p) := ⟨fun f => ⟨‖f‖, norm_nonneg' _⟩⟩
have coe_nnnorm : ∀ f : lp E p, ↑‖f‖₊ = ‖f‖ := fun _ => rfl
suffices ‖c • f‖₊ ^ p.toReal ≤ (‖c‖₊ * ‖f‖₊) ^ p.toReal by
rwa [NNReal.rpow_le_rpow_iff hp] at this
clear_value inst
rw [NNReal.mul_rpow]
have hLHS := lp.hasSum_norm hp (c • f)
have hRHS := (lp.hasSum_norm hp f).mul_left (‖c‖ ^ p.toReal)
simp_rw [← coe_nnnorm, ← _root_.coe_nnnorm, ← NNReal.coe_rpow, ← NNReal.coe_mul,
NNReal.hasSum_coe] at hRHS hLHS
refine hasSum_mono hLHS hRHS fun i => ?_
dsimp only
rw [← NNReal.mul_rpow, lp.coeFn_smul, Pi.smul_apply]
gcongr
apply nnnorm_smul_le
instance [Fact (1 ≤ p)] : IsBoundedSMul 𝕜 (lp E p) :=
IsBoundedSMul.of_norm_smul_le <| norm_const_smul_le (zero_lt_one.trans_le <| Fact.out).ne'
end IsBoundedSMul
section Sum
variable {E : Type*} [NormedAddCommGroup E]
lemma norm_tsum_le (f : ℓ¹(α, E)) :
‖∑' i, f i‖ ≤ ‖f‖ := calc
‖∑' i, f i‖ ≤ ∑' i, ‖f i‖ := norm_tsum_le_tsum_norm (.of_norm (by simpa using f.2.summable))
_ = ‖f‖ := by simp [norm_eq_tsum_rpow]
variable [NormedRing 𝕜] [Module 𝕜 E] [IsBoundedSMul 𝕜 E] [CompleteSpace E]
variable (α 𝕜 E) in
/-- Summation (i.e., `tsum`) in `ℓ¹(α, E)` as a continuous linear map. -/
@[simps!]
noncomputable def tsumCLM : ℓ¹(α, E) →L[𝕜] E :=
LinearMap.mkContinuous
{ toFun f := ∑' i, f i
map_add' f g := by
rw [← Summable.tsum_add]
exacts [rfl, .of_norm (by simpa using f.2.summable), .of_norm (by simpa using g.2.summable)]
map_smul' c f := by
simp only [coeFn_smul]
exact Summable.tsum_const_smul _ (.of_norm (by simpa using f.2.summable)) }
1 (fun f ↦ by simpa using norm_tsum_le f)
end Sum
section DivisionRing
variable [NormedDivisionRing 𝕜] [∀ i, Module 𝕜 (E i)] [∀ i, IsBoundedSMul 𝕜 (E i)]
theorem norm_const_smul (hp : p ≠ 0) {c : 𝕜} (f : lp E p) : ‖c • f‖ = ‖c‖ * ‖f‖ := by
obtain rfl | hc := eq_or_ne c 0
· simp
refine le_antisymm (norm_const_smul_le hp c f) ?_
have := mul_le_mul_of_nonneg_left (norm_const_smul_le hp c⁻¹ (c • f)) (norm_nonneg c)
rwa [inv_smul_smul₀ hc, norm_inv, mul_inv_cancel_left₀ (norm_ne_zero_iff.mpr hc)] at this
end DivisionRing
section NormedSpace
variable [NormedField 𝕜] [∀ i, NormedSpace 𝕜 (E i)]
instance instNormedSpace [Fact (1 ≤ p)] : NormedSpace 𝕜 (lp E p) where
norm_smul_le c f := norm_smul_le c f
end NormedSpace
section NormedStarGroup
variable [∀ i, StarAddMonoid (E i)] [∀ i, NormedStarGroup (E i)]
theorem _root_.Memℓp.star_mem {f : ∀ i, E i} (hf : Memℓp f p) : Memℓp (star f) p := by
rcases p.trichotomy with (rfl | rfl | hp)
· apply memℓp_zero
simp [hf.finite_dsupport]
· apply memℓp_infty
simpa using hf.bddAbove
· apply memℓp_gen
simpa using hf.summable hp
@[simp]
theorem _root_.Memℓp.star_iff {f : ∀ i, E i} : Memℓp (star f) p ↔ Memℓp f p :=
⟨fun h => star_star f ▸ Memℓp.star_mem h, Memℓp.star_mem⟩
instance : Star (lp E p) where
star f := ⟨(star f : ∀ i, E i), f.property.star_mem⟩
@[simp]
theorem coeFn_star (f : lp E p) : ⇑(star f) = star (⇑f) :=
rfl
@[simp]
protected theorem star_apply (f : lp E p) (i : α) : star f i = star (f i) :=
rfl
instance instInvolutiveStar : InvolutiveStar (lp E p) where
star_involutive x := by simp [star]
instance instStarAddMonoid : StarAddMonoid (lp E p) where
star_add _f _g := ext <| star_add (R := ∀ i, E i) _ _
instance [hp : Fact (1 ≤ p)] : NormedStarGroup (lp E p) where
norm_star_le f := le_of_eq <| by
rcases p.trichotomy with (rfl | rfl | h)
· exfalso
have := ENNReal.toReal_mono ENNReal.zero_ne_top hp.elim
norm_num at this
· simp only [lp.norm_eq_ciSup, lp.star_apply, norm_star]
· simp only [lp.norm_eq_tsum_rpow h, lp.star_apply, norm_star]
variable [Star 𝕜] [NormedRing 𝕜]
variable [∀ i, Module 𝕜 (E i)] [∀ i, IsBoundedSMul 𝕜 (E i)] [∀ i, StarModule 𝕜 (E i)]
instance : StarModule 𝕜 (lp E p) where
star_smul _r _f := ext <| star_smul (R := 𝕜) (A := ∀ i, E i) _ _
end NormedStarGroup
section NonUnitalNormedRing
variable {I : Type*} {B : I → Type*} [∀ i, NonUnitalNormedRing (B i)]
theorem _root_.Memℓp.infty_mul {f g : ∀ i, B i} (hf : Memℓp f ∞) (hg : Memℓp g ∞) :
Memℓp (f * g) ∞ := by
rw [memℓp_infty_iff]
obtain ⟨⟨Cf, hCf⟩, ⟨Cg, hCg⟩⟩ := hf.bddAbove, hg.bddAbove
refine ⟨Cf * Cg, ?_⟩
rintro _ ⟨i, rfl⟩
calc
‖(f * g) i‖ ≤ ‖f i‖ * ‖g i‖ := norm_mul_le (f i) (g i)
_ ≤ Cf * Cg :=
mul_le_mul (hCf ⟨i, rfl⟩) (hCg ⟨i, rfl⟩) (norm_nonneg _)
((norm_nonneg _).trans (hCf ⟨i, rfl⟩))
instance : Mul (lp B ∞) where
mul f g := ⟨HMul.hMul (α := ∀ i, B i) _ _, f.property.infty_mul g.property⟩
@[simp]
theorem infty_coeFn_mul (f g : lp B ∞) : ⇑(f * g) = ⇑f * ⇑g :=
rfl
instance nonUnitalRing : NonUnitalRing (lp B ∞) := fast_instance%
Function.Injective.nonUnitalRing lp.coeFun.coe Subtype.coe_injective (lp.coeFn_zero B ∞)
lp.coeFn_add infty_coeFn_mul lp.coeFn_neg lp.coeFn_sub (fun _ _ => rfl) fun _ _ => rfl
instance nonUnitalNormedRing : NonUnitalNormedRing (lp B ∞) :=
{ lp.nonUnitalRing, lp.normedAddCommGroup with
norm_mul_le f g := lp.norm_le_of_forall_le (by positivity) fun i ↦ calc
‖(f * g) i‖ ≤ ‖f i‖ * ‖g i‖ := norm_mul_le _ _
_ ≤ ‖f‖ * ‖g‖ := mul_le_mul (lp.norm_apply_le_norm ENNReal.top_ne_zero f i)
(lp.norm_apply_le_norm ENNReal.top_ne_zero g i) (norm_nonneg _) (norm_nonneg _) }
instance nonUnitalNormedCommRing {B : I → Type*} [∀ i, NonUnitalNormedCommRing (B i)] :
NonUnitalNormedCommRing (lp B ∞) where
mul_comm _ _ := ext <| mul_comm ..
-- we also want a `NonUnitalNormedCommRing` instance, but this has to wait for https://github.com/leanprover-community/mathlib3/pull/13719
instance infty_isScalarTower {𝕜} [NormedRing 𝕜] [∀ i, Module 𝕜 (B i)] [∀ i, IsBoundedSMul 𝕜 (B i)]
[∀ i, IsScalarTower 𝕜 (B i) (B i)] : IsScalarTower 𝕜 (lp B ∞) (lp B ∞) :=
⟨fun r f g => lp.ext <| smul_assoc (N := ∀ i, B i) (α := ∀ i, B i) r (⇑f) (⇑g)⟩
instance infty_smulCommClass {𝕜} [NormedRing 𝕜] [∀ i, Module 𝕜 (B i)] [∀ i, IsBoundedSMul 𝕜 (B i)]
[∀ i, SMulCommClass 𝕜 (B i) (B i)] : SMulCommClass 𝕜 (lp B ∞) (lp B ∞) :=
⟨fun r f g => lp.ext <| smul_comm (N := ∀ i, B i) (α := ∀ i, B i) r (⇑f) (⇑g)⟩
section StarRing
variable [∀ i, StarRing (B i)] [∀ i, NormedStarGroup (B i)]
instance inftyStarRing : StarRing (lp B ∞) :=
{ lp.instStarAddMonoid with
star_mul := fun _f _g => ext <| star_mul (R := ∀ i, B i) _ _ }
instance inftyCStarRing [∀ i, CStarRing (B i)] : CStarRing (lp B ∞) where
norm_mul_self_le f := by
rw [← sq, ← Real.le_sqrt (norm_nonneg _) (norm_nonneg _)]
refine lp.norm_le_of_forall_le ‖star f * f‖.sqrt_nonneg fun i => ?_
rw [Real.le_sqrt (norm_nonneg _) (norm_nonneg _), sq, ← CStarRing.norm_star_mul_self]
exact lp.norm_apply_le_norm ENNReal.top_ne_zero (star f * f) i
end StarRing
end NonUnitalNormedRing
section NormedRing
variable {I : Type*} {B : I → Type*} [∀ i, NormedRing (B i)]
instance _root_.PreLp.ring : Ring (PreLp B) :=
inferInstanceAs (Ring (∀ i, B i))
variable [∀ i, NormOneClass (B i)]
theorem _root_.one_memℓp_infty : Memℓp (1 : ∀ i, B i) ∞ :=
⟨1, by rintro i ⟨i, rfl⟩; exact norm_one.le⟩
variable (B) in
/-- The `𝕜`-subring of elements of `∀ i : α, B i` whose `lp` norm is finite. This is `lp E ∞`,
with extra structure. -/
def _root_.lpInftySubring : Subring (PreLp B) :=
{ lp B ∞ with
carrier := { f | Memℓp f ∞ }
one_mem' := one_memℓp_infty
mul_mem' := Memℓp.infty_mul }
instance inftyRing : Ring (lp B ∞) :=
inferInstanceAs <| Ring (lpInftySubring B)
theorem _root_.Memℓp.infty_pow {f : ∀ i, B i} (hf : Memℓp f ∞) (n : ℕ) : Memℓp (f ^ n) ∞ :=
(lpInftySubring B).pow_mem hf n
theorem _root_.natCast_memℓp_infty (n : ℕ) : Memℓp (n : ∀ i, B i) ∞ :=
natCast_mem (lpInftySubring B) n
theorem _root_.intCast_memℓp_infty (z : ℤ) : Memℓp (z : ∀ i, B i) ∞ :=
intCast_mem (lpInftySubring B) z
@[simp]
theorem infty_coeFn_one : ⇑(1 : lp B ∞) = 1 :=
rfl
@[simp]
theorem infty_coeFn_pow (f : lp B ∞) (n : ℕ) : ⇑(f ^ n) = (⇑f) ^ n :=
rfl
@[simp]
theorem infty_coeFn_natCast (n : ℕ) : ⇑(n : lp B ∞) = n :=
rfl
@[simp]
theorem infty_coeFn_intCast (z : ℤ) : ⇑(z : lp B ∞) = z :=
rfl
instance [Nonempty I] : NormOneClass (lp B ∞) where
norm_one := by simp_rw [lp.norm_eq_ciSup, infty_coeFn_one, Pi.one_apply, norm_one, ciSup_const]
instance inftyNormedRing : NormedRing (lp B ∞) :=
{ lp.inftyRing, lp.nonUnitalNormedRing with }
end NormedRing
section NormedCommRing
variable {I : Type*} {B : I → Type*} [∀ i, NormedCommRing (B i)] [∀ i, NormOneClass (B i)]
instance inftyNormedCommRing : NormedCommRing (lp B ∞) where
mul_comm := mul_comm
end NormedCommRing
section Algebra
variable {I : Type*} {B : I → Type*}
variable [NormedField 𝕜] [∀ i, NormedRing (B i)] [∀ i, NormedAlgebra 𝕜 (B i)]
instance _root_.PreLp.algebra : Algebra 𝕜 (PreLp B) :=
inferInstanceAs <| Algebra 𝕜 (∀ i, B i)
variable [∀ i, NormOneClass (B i)]
theorem _root_.algebraMap_memℓp_infty (k : 𝕜) : Memℓp (algebraMap 𝕜 (∀ i, B i) k) ∞ := by
rw [Algebra.algebraMap_eq_smul_one]
exact (one_memℓp_infty.const_smul k : Memℓp (k • (1 : ∀ i, B i)) ∞)
variable (𝕜 B)
/-- The `𝕜`-subalgebra of elements of `∀ i : α, B i` whose `lp` norm is finite. This is `lp E ∞`,
with extra structure. -/
def _root_.lpInftySubalgebra : Subalgebra 𝕜 (PreLp B) :=
{ lpInftySubring B with
carrier := { f | Memℓp f ∞ }
algebraMap_mem' := algebraMap_memℓp_infty }
variable {𝕜 B}
instance : Algebra 𝕜 (lp B ∞) := inferInstanceAs <| Algebra 𝕜 (lpInftySubalgebra 𝕜 B)
instance inftyNormedAlgebra : NormedAlgebra 𝕜 (lp B ∞) where
norm_smul_le := norm_smul_le
end Algebra
section Single
variable [NormedRing 𝕜] [∀ i, Module 𝕜 (E i)] [∀ i, IsBoundedSMul 𝕜 (E i)]
variable [DecidableEq α]
/-- The element of `lp E p` which is `a : E i` at the index `i`, and zero elsewhere. -/
protected def single (p) (i : α) (a : E i) : lp E p :=
⟨Pi.single i a, by
refine (memℓp_zero ?_).of_exponent_ge (zero_le p)
refine (Set.finite_singleton i).subset ?_
intro j
simp only [Set.mem_singleton_iff, Ne,
Set.mem_setOf_eq]
rw [not_imp_comm]
intro h
exact Pi.single_eq_of_ne h _⟩
@[norm_cast]
protected theorem coeFn_single (p) (i : α) (a : E i) :
⇑(lp.single p i a) = Pi.single i a := rfl