/
basic.lean
1704 lines (1293 loc) · 77.1 KB
/
basic.lean
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) 2018 Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Patrick Massot, Johannes Hölzl, Yaël Dillies
-/
import algebra.module.ulift
import analysis.normed.group.seminorm
import order.liminf_limsup
import topology.algebra.uniform_group
import topology.metric_space.algebra
import topology.metric_space.isometry
import topology.sequences
/-!
# Normed (semi)groups
In this file we define 10 classes:
* `has_norm`, `has_nnnorm`: auxiliary classes endowing a type `α` with a function `norm : α → ℝ`
(notation: `∥x∥`) and `nnnorm : α → ℝ≥0` (notation: `∥x∥₊`), respectively;
* `seminormed_..._group`: A seminormed (additive) (commutative) group is an (additive) (commutative)
group with a norm and a compatible pseudometric space structure:
`∀ x y, dist x y = ∥x / y∥` or `∀ x y, dist x y = ∥x - y∥`, depending on the group operation.
* `normed_..._group`: A normed (additive) (commutative) group is an (additive) (commutative) group
with a norm and a compatible metric space structure.
We also prove basic properties of (semi)normed groups and provide some instances.
## Notes
The current convention `dist x y = ∥x - y∥` means that the distance is invariant under right
addition, but actions in mathlib are usually from the left. This means we might want to change it to
`dist x y = ∥-x + y∥`.
The normed group hierarchy would lend itself well to a mixin design (that is, having
`seminormed_group` and `seminormed_add_group` not extend `group` and `add_group`), but we choose not
to for performance concerns.
## Tags
normed group
-/
variables {𝓕 𝕜 α ι κ E F G : Type*}
open filter function metric
open_locale big_operators ennreal filter nnreal uniformity pointwise topological_space
/-- Auxiliary class, endowing a type `E` with a function `norm : E → ℝ` with notation `∥x∥`. This
class is designed to be extended in more interesting classes specifying the properties of the norm.
-/
@[notation_class] class has_norm (E : Type*) := (norm : E → ℝ)
/-- Auxiliary class, endowing a type `α` with a function `nnnorm : α → ℝ≥0` with notation `∥x∥₊`. -/
@[notation_class] class has_nnnorm (E : Type*) := (nnnorm : E → ℝ≥0)
export has_norm (norm)
export has_nnnorm (nnnorm)
notation `∥` e `∥` := norm e
notation `∥` e `∥₊` := nnnorm e
/-- A seminormed group is an additive group endowed with a norm for which `dist x y = ∥x - y∥`
defines a pseudometric space structure. -/
class seminormed_add_group (E : Type*) extends has_norm E, add_group E, pseudo_metric_space E :=
(dist := λ x y, ∥x - y∥)
(dist_eq : ∀ x y, dist x y = ∥x - y∥ . obviously)
/-- A seminormed group is a group endowed with a norm for which `dist x y = ∥x / y∥` defines a
pseudometric space structure. -/
@[to_additive]
class seminormed_group (E : Type*) extends has_norm E, group E, pseudo_metric_space E :=
(dist := λ x y, ∥x / y∥)
(dist_eq : ∀ x y, dist x y = ∥x / y∥ . obviously)
/-- A normed group is an additive group endowed with a norm for which `dist x y = ∥x - y∥` defines a
metric space structure. -/
class normed_add_group (E : Type*) extends has_norm E, add_group E, metric_space E :=
(dist := λ x y, ∥x - y∥)
(dist_eq : ∀ x y, dist x y = ∥x - y∥ . obviously)
/-- A normed group is a group endowed with a norm for which `dist x y = ∥x / y∥` defines a metric
space structure. -/
@[to_additive]
class normed_group (E : Type*) extends has_norm E, group E, metric_space E :=
(dist := λ x y, ∥x / y∥)
(dist_eq : ∀ x y, dist x y = ∥x / y∥ . obviously)
/-- A seminormed group is an additive group endowed with a norm for which `dist x y = ∥x - y∥`
defines a pseudometric space structure. -/
class seminormed_add_comm_group (E : Type*)
extends has_norm E, add_comm_group E, pseudo_metric_space E :=
(dist := λ x y, ∥x - y∥)
(dist_eq : ∀ x y, dist x y = ∥x - y∥ . obviously)
/-- A seminormed group is a group endowed with a norm for which `dist x y = ∥x / y∥`
defines a pseudometric space structure. -/
@[to_additive]
class seminormed_comm_group (E : Type*)
extends has_norm E, comm_group E, pseudo_metric_space E :=
(dist := λ x y, ∥x / y∥)
(dist_eq : ∀ x y, dist x y = ∥x / y∥ . obviously)
/-- A normed group is an additive group endowed with a norm for which `dist x y = ∥x - y∥` defines a
metric space structure. -/
class normed_add_comm_group (E : Type*) extends has_norm E, add_comm_group E, metric_space E :=
(dist := λ x y, ∥x - y∥)
(dist_eq : ∀ x y, dist x y = ∥x - y∥ . obviously)
/-- A normed group is a group endowed with a norm for which `dist x y = ∥x / y∥` defines a metric
space structure. -/
@[to_additive]
class normed_comm_group (E : Type*) extends has_norm E, comm_group E, metric_space E :=
(dist := λ x y, ∥x / y∥)
(dist_eq : ∀ x y, dist x y = ∥x / y∥ . obviously)
@[priority 100, to_additive] -- See note [lower instance priority]
instance normed_group.to_seminormed_group [normed_group E] : seminormed_group E :=
{ ..‹normed_group E› }
@[priority 100, to_additive] -- See note [lower instance priority]
instance normed_comm_group.to_seminormed_comm_group [normed_comm_group E] :
seminormed_comm_group E :=
{ ..‹normed_comm_group E› }
@[priority 100, to_additive] -- See note [lower instance priority]
instance seminormed_comm_group.to_seminormed_group [seminormed_comm_group E] : seminormed_group E :=
{ ..‹seminormed_comm_group E› }
@[priority 100, to_additive] -- See note [lower instance priority]
instance normed_comm_group.to_normed_group [normed_comm_group E] : normed_group E :=
{ ..‹normed_comm_group E› }
/-- Construct a `normed_group` from a `seminormed_group` satisfying `∀ x, ∥x∥ = 0 → x = 1`. This
avoids having to go back to the `(pseudo_)metric_space` level when declaring a `normed_group`
instance as a special case of a more general `seminormed_group` instance. -/
@[to_additive "Construct a `normed_add_group` from a `seminormed_add_group` satisfying
`∀ x, ∥x∥ = 0 → x = 0`. This avoids having to go back to the `(pseudo_)metric_space` level when
declaring a `normed_add_group` instance as a special case of a more general `seminormed_add_group`
instance.", reducible] -- See note [reducible non-instances]
def normed_group.of_separation [seminormed_group E] (h : ∀ x : E, ∥x∥ = 0 → x = 1) :
normed_group E :=
{ to_metric_space :=
{ eq_of_dist_eq_zero := λ x y hxy, div_eq_one.1 $ h _ $ by rwa ←‹seminormed_group E›.dist_eq },
..‹seminormed_group E› }
/-- Construct a `normed_comm_group` from a `seminormed_comm_group` satisfying
`∀ x, ∥x∥ = 0 → x = 1`. This avoids having to go back to the `(pseudo_)metric_space` level when
declaring a `normed_comm_group` instance as a special case of a more general `seminormed_comm_group`
instance. -/
@[to_additive "Construct a `normed_add_comm_group` from a `seminormed_add_comm_group` satisfying
`∀ x, ∥x∥ = 0 → x = 0`. This avoids having to go back to the `(pseudo_)metric_space` level when
declaring a `normed_add_comm_group` instance as a special case of a more general
`seminormed_add_comm_group` instance.", reducible] -- See note [reducible non-instances]
def normed_comm_group.of_separation [seminormed_comm_group E] (h : ∀ x : E, ∥x∥ = 0 → x = 1) :
normed_comm_group E :=
{ ..‹seminormed_comm_group E›, ..normed_group.of_separation h }
/-- Construct a seminormed group from a multiplication-invariant distance. -/
@[to_additive "Construct a seminormed group from a translation-invariant distance."]
def seminormed_group.of_mul_dist [has_norm E] [group E] [pseudo_metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist x y ≤ dist (x * z) (y * z)) :
seminormed_group E :=
{ dist_eq := λ x y, begin
rw h₁, apply le_antisymm,
{ simpa only [div_eq_mul_inv, ← mul_right_inv y] using h₂ _ _ _ },
{ simpa only [div_mul_cancel', one_mul] using h₂ (x/y) 1 y }
end }
/-- Construct a seminormed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a seminormed group from a translation-invariant pseudodistance."]
def seminormed_group.of_mul_dist' [has_norm E] [group E] [pseudo_metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist (x * z) (y * z) ≤ dist x y) :
seminormed_group E :=
{ dist_eq := λ x y, begin
rw h₁, apply le_antisymm,
{ simpa only [div_mul_cancel', one_mul] using h₂ (x/y) 1 y },
{ simpa only [div_eq_mul_inv, ← mul_right_inv y] using h₂ _ _ _ }
end }
/-- Construct a seminormed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a seminormed group from a translation-invariant pseudodistance."]
def seminormed_comm_group.of_mul_dist [has_norm E] [comm_group E] [pseudo_metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist x y ≤ dist (x * z) (y * z)) :
seminormed_comm_group E :=
{ ..seminormed_group.of_mul_dist h₁ h₂ }
/-- Construct a seminormed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a seminormed group from a translation-invariant pseudodistance."]
def seminormed_comm_group.of_mul_dist' [has_norm E] [comm_group E] [pseudo_metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist (x * z) (y * z) ≤ dist x y) :
seminormed_comm_group E :=
{ ..seminormed_group.of_mul_dist' h₁ h₂ }
/-- Construct a normed group from a multiplication-invariant distance. -/
@[to_additive "Construct a normed group from a translation-invariant distance."]
def normed_group.of_mul_dist [has_norm E] [group E] [metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist x y ≤ dist (x * z) (y * z)) :
normed_group E :=
{ ..seminormed_group.of_mul_dist h₁ h₂ }
/-- Construct a normed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a normed group from a translation-invariant pseudodistance."]
def normed_group.of_mul_dist' [has_norm E] [group E] [metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist (x * z) (y * z) ≤ dist x y) :
normed_group E :=
{ ..seminormed_group.of_mul_dist' h₁ h₂ }
/-- Construct a normed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a normed group from a translation-invariant pseudodistance."]
def normed_comm_group.of_mul_dist [has_norm E] [comm_group E] [metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist x y ≤ dist (x * z) (y * z)) :
normed_comm_group E :=
{ ..normed_group.of_mul_dist h₁ h₂ }
/-- Construct a normed group from a multiplication-invariant pseudodistance. -/
@[to_additive "Construct a normed group from a translation-invariant pseudodistance."]
def normed_comm_group.of_mul_dist' [has_norm E] [comm_group E] [metric_space E]
(h₁ : ∀ x : E, ∥x∥ = dist x 1) (h₂ : ∀ x y z : E, dist (x * z) (y * z) ≤ dist x y) :
normed_comm_group E :=
{ ..normed_group.of_mul_dist' h₁ h₂ }
set_option old_structure_cmd true
/-- Construct a seminormed group from a seminorm, i.e., registering the pseudodistance and the
pseudometric space structure from the seminorm properties. Note that in most cases this instance
creates bad definitional equalities (e.g., it does not take into account a possibly existing
`uniform_space` instance on `E`). -/
@[to_additive "Construct a seminormed group from a seminorm, i.e., registering the pseudodistance*
and the pseudometric space structure from the seminorm properties. Note that in most cases this
instance creates bad definitional equalities (e.g., it does not take into account a possibly
existing `uniform_space` instance on `E`)."]
def group_seminorm.to_seminormed_group [group E] (f : group_seminorm E) : seminormed_group E :=
{ dist := λ x y, f (x / y),
norm := f,
dist_eq := λ x y, rfl,
dist_self := λ x, by simp only [div_self', map_one_eq_zero],
dist_triangle := le_map_div_add_map_div f,
dist_comm := map_div_rev f }
/-- Construct a seminormed group from a seminorm, i.e., registering the pseudodistance and the
pseudometric space structure from the seminorm properties. Note that in most cases this instance
creates bad definitional equalities (e.g., it does not take into account a possibly existing
`uniform_space` instance on `E`). -/
@[to_additive "Construct a seminormed group from a seminorm, i.e., registering the pseudodistance*
and the pseudometric space structure from the seminorm properties. Note that in most cases this
instance creates bad definitional equalities (e.g., it does not take into account a possibly
existing `uniform_space` instance on `E`)."]
def group_seminorm.to_seminormed_comm_group [comm_group E] (f : group_seminorm E) :
seminormed_comm_group E :=
{ ..f.to_seminormed_group }
/-- Construct a normed group from a norm, i.e., registering the distance and the metric space
structure from the norm properties. Note that in most cases this instance creates bad definitional
equalities (e.g., it does not take into account a possibly existing `uniform_space` instance on
`E`). -/
@[to_additive "Construct a normed group from a norm, i.e., registering the distance and the metric
space structure from the norm properties. Note that in most cases this instance creates bad
definitional equalities (e.g., it does not take into account a possibly existing `uniform_space`
instance on `E`)."]
def group_norm.to_normed_group [group E] (f : group_norm E) : normed_group E :=
{ eq_of_dist_eq_zero := λ x y h, div_eq_one.1 $ eq_one_of_map_eq_zero f h,
..f.to_group_seminorm.to_seminormed_group }
/-- Construct a normed group from a norm, i.e., registering the distance and the metric space
structure from the norm properties. Note that in most cases this instance creates bad definitional
equalities (e.g., it does not take into account a possibly existing `uniform_space` instance on
`E`). -/
@[to_additive "Construct a normed group from a norm, i.e., registering the distance and the metric
space structure from the norm properties. Note that in most cases this instance creates bad
definitional equalities (e.g., it does not take into account a possibly existing `uniform_space`
instance on `E`)."]
def group_norm.to_normed_comm_group [comm_group E] (f : group_norm E) : normed_comm_group E :=
{ ..f.to_normed_group }
instance : normed_add_comm_group punit :=
{ norm := function.const _ 0,
dist_eq := λ _ _, rfl, }
@[simp] lemma punit.norm_eq_zero (r : punit) : ∥r∥ = 0 := rfl
section seminormed_group
variables [seminormed_group E] [seminormed_group F] [seminormed_group G] {s : set E}
{a a₁ a₂ b b₁ b₂ : E} {r r₁ r₂ : ℝ}
@[to_additive]
lemma dist_eq_norm_div (a b : E) : dist a b = ∥a / b∥ := seminormed_group.dist_eq _ _
@[to_additive]
lemma dist_eq_norm_div' (a b : E) : dist a b = ∥b / a∥ := by rw [dist_comm, dist_eq_norm_div]
alias dist_eq_norm_sub ← dist_eq_norm
alias dist_eq_norm_sub' ← dist_eq_norm'
@[simp, to_additive] lemma dist_one_right (a : E) : dist a 1 = ∥a∥ :=
by rw [dist_eq_norm_div, div_one]
@[simp, to_additive] lemma dist_one_left : dist (1 : E) = norm :=
funext $ λ a, by rw [dist_comm, dist_one_right]
@[to_additive]
lemma isometry.norm_map_of_map_one {f : E → F} (hi : isometry f) (h₁ : f 1 = 1) (x : E) :
∥f x∥ = ∥x∥ :=
by rw [←dist_one_right, ←h₁, hi.dist_eq, dist_one_right]
@[to_additive tendsto_norm_cocompact_at_top]
lemma tendsto_norm_cocompact_at_top' [proper_space E] : tendsto norm (cocompact E) at_top :=
by simpa only [dist_one_right] using tendsto_dist_right_cocompact_at_top (1 : E)
@[to_additive] lemma norm_div_rev (a b : E) : ∥a / b∥ = ∥b / a∥ :=
by simpa only [dist_eq_norm_div] using dist_comm a b
@[simp, to_additive norm_neg]
lemma norm_inv' (a : E) : ∥a⁻¹∥ = ∥a∥ := by simpa using norm_div_rev 1 a
@[simp, to_additive] lemma dist_mul_right (a₁ a₂ b : E) : dist (a₁ * b) (a₂ * b) = dist a₁ a₂ :=
by simp [dist_eq_norm_div]
@[to_additive] lemma dist_div_right (a₁ a₂ b : E) : dist (a₁ / b) (a₂ / b) = dist a₁ a₂ :=
by simpa only [div_eq_mul_inv] using dist_mul_right _ _ _
@[simp, to_additive] lemma dist_div_eq_dist_mul_left (a b c : E) :
dist (a / b) c = dist a (c * b) :=
by rw [←dist_mul_right _ _ b, div_mul_cancel']
@[simp, to_additive] lemma dist_div_eq_dist_mul_right (a b c : E) :
dist a (b / c) = dist (a * c) b :=
by rw [←dist_mul_right _ _ c, div_mul_cancel']
/-- In a (semi)normed group, inversion `x ↦ x⁻¹` tends to infinity at infinity. TODO: use
`bornology.cobounded` instead of `filter.comap has_norm.norm filter.at_top`. -/
@[to_additive "In a (semi)normed group, negation `x ↦ -x` tends to infinity at infinity. TODO: use
`bornology.cobounded` instead of `filter.comap has_norm.norm filter.at_top`."]
lemma filter.tendsto_inv_cobounded :
tendsto (has_inv.inv : E → E) (comap norm at_top) (comap norm at_top) :=
by simpa only [norm_inv', tendsto_comap_iff, (∘)] using tendsto_comap
/-- **Triangle inequality** for the norm. -/
@[to_additive norm_add_le "**Triangle inequality** for the norm."]
lemma norm_mul_le' (a b : E) : ∥a * b∥ ≤ ∥a∥ + ∥b∥ :=
by simpa [dist_eq_norm_div] using dist_triangle a 1 b⁻¹
@[to_additive] lemma norm_mul_le_of_le (h₁ : ∥a₁∥ ≤ r₁) (h₂ : ∥a₂∥ ≤ r₂) : ∥a₁ * a₂∥ ≤ r₁ + r₂ :=
(norm_mul_le' a₁ a₂).trans $ add_le_add h₁ h₂
@[to_additive norm_add₃_le] lemma norm_mul₃_le (a b c : E) : ∥a * b * c∥ ≤ ∥a∥ + ∥b∥ + ∥c∥ :=
norm_mul_le_of_le (norm_mul_le' _ _) le_rfl
@[simp, to_additive norm_nonneg] lemma norm_nonneg' (a : E) : 0 ≤ ∥a∥ :=
by { rw [←dist_one_right], exact dist_nonneg }
section
open tactic tactic.positivity
/-- Extension for the `positivity` tactic: norms are nonnegative. -/
@[positivity]
meta def _root_.tactic.positivity_norm : expr → tactic strictness
| `(∥%%a∥) := nonnegative <$> mk_app ``norm_nonneg [a] <|> nonnegative <$> mk_app ``norm_nonneg' [a]
| _ := failed
end
@[simp, to_additive norm_zero] lemma norm_one' : ∥(1 : E)∥ = 0 := by rw [←dist_one_right, dist_self]
@[to_additive] lemma ne_one_of_norm_ne_zero : ∥a∥ ≠ 0 → a ≠ 1 :=
mt $ by { rintro rfl, exact norm_one' }
@[nontriviality, to_additive norm_of_subsingleton]
lemma norm_of_subsingleton' [subsingleton E] (a : E) : ∥a∥ = 0 :=
by rw [subsingleton.elim a 1, norm_one']
attribute [nontriviality] norm_of_subsingleton
@[to_additive] lemma norm_div_le (a b : E) : ∥a / b∥ ≤ ∥a∥ + ∥b∥ :=
by simpa [dist_eq_norm_div] using dist_triangle a 1 b
@[to_additive] lemma norm_div_le_of_le {r₁ r₂ : ℝ} (H₁ : ∥a₁∥ ≤ r₁) (H₂ : ∥a₂∥ ≤ r₂) :
∥a₁ / a₂∥ ≤ r₁ + r₂ :=
(norm_div_le a₁ a₂).trans $ add_le_add H₁ H₂
@[to_additive] lemma dist_le_norm_mul_norm (a b : E) : dist a b ≤ ∥a∥ + ∥b∥ :=
by { rw dist_eq_norm_div, apply norm_div_le }
@[to_additive abs_norm_sub_norm_le] lemma abs_norm_sub_norm_le' (a b : E) : |∥a∥ - ∥b∥| ≤ ∥a / b∥ :=
by simpa [dist_eq_norm_div] using abs_dist_sub_le a b 1
@[to_additive norm_sub_norm_le] lemma norm_sub_norm_le' (a b : E) : ∥a∥ - ∥b∥ ≤ ∥a / b∥ :=
(le_abs_self _).trans (abs_norm_sub_norm_le' a b)
@[to_additive dist_norm_norm_le] lemma dist_norm_norm_le' (a b : E) : dist ∥a∥ ∥b∥ ≤ ∥a / b∥ :=
abs_norm_sub_norm_le' a b
@[to_additive] lemma norm_le_norm_add_norm_div' (u v : E) : ∥u∥ ≤ ∥v∥ + ∥u / v∥ :=
by { rw add_comm, refine (norm_mul_le' _ _).trans_eq' _, rw div_mul_cancel' }
@[to_additive] lemma norm_le_norm_add_norm_div (u v : E) : ∥v∥ ≤ ∥u∥ + ∥u / v∥ :=
by { rw norm_div_rev, exact norm_le_norm_add_norm_div' v u }
alias norm_le_norm_add_norm_sub' ← norm_le_insert'
alias norm_le_norm_add_norm_sub ← norm_le_insert
@[to_additive] lemma norm_le_mul_norm_add (u v : E) : ∥u∥ ≤ ∥u * v∥ + ∥v∥ :=
calc ∥u∥ = ∥u * v / v∥ : by rw mul_div_cancel''
... ≤ ∥u * v∥ + ∥v∥ : norm_div_le _ _
@[to_additive ball_eq] lemma ball_eq' (y : E) (ε : ℝ) : ball y ε = {x | ∥x / y∥ < ε} :=
set.ext $ λ a, by simp [dist_eq_norm_div]
@[to_additive] lemma ball_one_eq (r : ℝ) : ball (1 : E) r = {x | ∥x∥ < r} :=
set.ext $ assume a, by simp
@[to_additive mem_ball_iff_norm] lemma mem_ball_iff_norm'' : b ∈ ball a r ↔ ∥b / a∥ < r :=
by rw [mem_ball, dist_eq_norm_div]
@[to_additive mem_ball_iff_norm'] lemma mem_ball_iff_norm''' : b ∈ ball a r ↔ ∥a / b∥ < r :=
by rw [mem_ball', dist_eq_norm_div]
@[simp, to_additive] lemma mem_ball_one_iff : a ∈ ball (1 : E) r ↔ ∥a∥ < r :=
by rw [mem_ball, dist_one_right]
@[to_additive mem_closed_ball_iff_norm]
lemma mem_closed_ball_iff_norm'' : b ∈ closed_ball a r ↔ ∥b / a∥ ≤ r :=
by rw [mem_closed_ball, dist_eq_norm_div]
@[simp, to_additive] lemma mem_closed_ball_one_iff : a ∈ closed_ball (1 : E) r ↔ ∥a∥ ≤ r :=
by rw [mem_closed_ball, dist_one_right]
@[to_additive mem_closed_ball_iff_norm']
lemma mem_closed_ball_iff_norm''' : b ∈ closed_ball a r ↔ ∥a / b∥ ≤ r :=
by rw [mem_closed_ball', dist_eq_norm_div]
@[to_additive norm_le_of_mem_closed_ball]
lemma norm_le_of_mem_closed_ball' (h : b ∈ closed_ball a r) : ∥b∥ ≤ ∥a∥ + r :=
(norm_le_norm_add_norm_div' _ _).trans $ add_le_add_left (by rwa ←dist_eq_norm_div) _
@[to_additive norm_le_norm_add_const_of_dist_le]
lemma norm_le_norm_add_const_of_dist_le' : dist a b ≤ r → ∥a∥ ≤ ∥b∥ + r :=
norm_le_of_mem_closed_ball'
@[to_additive norm_lt_of_mem_ball]
lemma norm_lt_of_mem_ball' (h : b ∈ ball a r) : ∥b∥ < ∥a∥ + r :=
(norm_le_norm_add_norm_div' _ _).trans_lt $ add_lt_add_left (by rwa ←dist_eq_norm_div) _
@[to_additive]
lemma norm_div_sub_norm_div_le_norm_div (u v w : E) : ∥u / w∥ - ∥v / w∥ ≤ ∥u / v∥ :=
by simpa only [div_div_div_cancel_right'] using norm_sub_norm_le' (u / w) (v / w)
@[to_additive bounded_iff_forall_norm_le]
lemma bounded_iff_forall_norm_le' : bounded s ↔ ∃ C, ∀ x ∈ s, ∥x∥ ≤ C :=
by simpa only [set.subset_def, mem_closed_ball_one_iff] using bounded_iff_subset_ball (1 : E)
@[simp, to_additive mem_sphere_iff_norm]
lemma mem_sphere_iff_norm' : b ∈ sphere a r ↔ ∥b / a∥ = r := by simp [dist_eq_norm_div]
@[simp, to_additive] lemma mem_sphere_one_iff_norm : a ∈ sphere (1 : E) r ↔ ∥a∥ = r :=
by simp [dist_eq_norm_div]
@[simp, to_additive norm_eq_of_mem_sphere]
lemma norm_eq_of_mem_sphere' (x : sphere (1:E) r) : ∥(x : E)∥ = r := mem_sphere_one_iff_norm.mp x.2
@[to_additive] lemma ne_one_of_mem_sphere (hr : r ≠ 0) (x : sphere (1 : E) r) : (x : E) ≠ 1 :=
ne_one_of_norm_ne_zero $ by rwa norm_eq_of_mem_sphere' x
@[to_additive ne_zero_of_mem_unit_sphere]
lemma ne_one_of_mem_unit_sphere (x : sphere (1 : E) 1) : (x:E) ≠ 1 :=
ne_one_of_mem_sphere one_ne_zero _
variables (E)
/-- The norm of a seminormed group as a group seminorm. -/
@[to_additive "The norm of a seminormed group as an additive group seminorm."]
def norm_group_seminorm : group_seminorm E := ⟨norm, norm_one', norm_mul_le', norm_inv'⟩
@[simp, to_additive] lemma coe_norm_group_seminorm : ⇑(norm_group_seminorm E) = norm := rfl
variables {E}
namespace isometric
-- TODO This material is superseded by similar constructions such as
-- `affine_isometry_equiv.const_vadd`; deduplicate
/-- Multiplication `y ↦ y * x` as an `isometry`. -/
@[to_additive "Addition `y ↦ y + x` as an `isometry`"]
protected def mul_right (x : E) : E ≃ᵢ E :=
{ isometry_to_fun := isometry.of_dist_eq $ λ y z, dist_mul_right _ _ _,
.. equiv.mul_right x }
@[simp, to_additive]
lemma mul_right_to_equiv (x : E) : (isometric.mul_right x).to_equiv = equiv.mul_right x := rfl
@[simp, to_additive]
lemma coe_mul_right (x : E) : (isometric.mul_right x : E → E) = λ y, y * x := rfl
@[to_additive] lemma mul_right_apply (x y : E) : (isometric.mul_right x : E → E) y = y * x := rfl
@[simp, to_additive]
lemma mul_right_symm (x : E) : (isometric.mul_right x).symm = isometric.mul_right x⁻¹ :=
ext $ λ y, rfl
end isometric
@[to_additive] lemma normed_comm_group.tendsto_nhds_one {f : α → E} {l : filter α} :
tendsto f l (𝓝 1) ↔ ∀ ε > 0, ∀ᶠ x in l, ∥ f x ∥ < ε :=
metric.tendsto_nhds.trans $ by simp only [dist_one_right]
@[to_additive] lemma normed_comm_group.tendsto_nhds_nhds {f : E → F} {x : E} {y : F} :
tendsto f (𝓝 x) (𝓝 y) ↔ ∀ ε > 0, ∃ δ > 0, ∀ x', ∥x' / x∥ < δ → ∥f x' / y∥ < ε :=
by simp_rw [metric.tendsto_nhds_nhds, dist_eq_norm_div]
@[to_additive] lemma normed_comm_group.cauchy_seq_iff [nonempty α] [semilattice_sup α] {u : α → E} :
cauchy_seq u ↔ ∀ ε > 0, ∃ N, ∀ m, N ≤ m → ∀ n, N ≤ n → ∥u m / u n∥ < ε :=
by simp [metric.cauchy_seq_iff, dist_eq_norm_div]
@[to_additive] lemma normed_comm_group.nhds_basis_norm_lt (x : E) :
(𝓝 x).has_basis (λ ε : ℝ, 0 < ε) (λ ε, {y | ∥y / x∥ < ε}) :=
by { simp_rw ← ball_eq', exact metric.nhds_basis_ball }
@[to_additive] lemma normed_comm_group.nhds_one_basis_norm_lt :
(𝓝 (1 : E)).has_basis (λ ε : ℝ, 0 < ε) (λ ε, {y | ∥y∥ < ε}) :=
by { convert normed_comm_group.nhds_basis_norm_lt (1 : E), simp }
@[to_additive] lemma normed_comm_group.uniformity_basis_dist :
(𝓤 E).has_basis (λ ε : ℝ, 0 < ε) (λ ε, {p : E × E | ∥p.fst / p.snd∥ < ε}) :=
by { convert metric.uniformity_basis_dist, simp [dist_eq_norm_div] }
open finset
/-- A homomorphism `f` of seminormed groups is Lipschitz, if there exists a constant `C` such that
for all `x`, one has `∥f x∥ ≤ C * ∥x∥`. The analogous condition for a linear map of
(semi)normed spaces is in `normed_space.operator_norm`. -/
@[to_additive "A homomorphism `f` of seminormed groups is Lipschitz, if there exists a constant `C`
such that for all `x`, one has `∥f x∥ ≤ C * ∥x∥`. The analogous condition for a linear map of
(semi)normed spaces is in `normed_space.operator_norm`."]
lemma monoid_hom_class.lipschitz_of_bound [monoid_hom_class 𝓕 E F] (f : 𝓕) (C : ℝ)
(h : ∀ x, ∥f x∥ ≤ C * ∥x∥) : lipschitz_with (real.to_nnreal C) f :=
lipschitz_with.of_dist_le' $ λ x y, by simpa only [dist_eq_norm_div, map_div] using h (x / y)
@[to_additive] lemma lipschitz_on_with_iff_norm_div_le {f : E → F} {C : ℝ≥0} :
lipschitz_on_with C f s ↔ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → ∥f x / f y∥ ≤ C * ∥x / y∥ :=
by simp only [lipschitz_on_with_iff_dist_le_mul, dist_eq_norm_div]
alias lipschitz_on_with_iff_norm_div_le ↔ lipschitz_on_with.norm_div_le _
attribute [to_additive] lipschitz_on_with.norm_div_le
@[to_additive] lemma lipschitz_on_with.norm_div_le_of_le {f : E → F} {C : ℝ≥0}
(h : lipschitz_on_with C f s) (ha : a ∈ s) (hb : b ∈ s) (hr : ∥a / b∥ ≤ r) :
∥f a / f b∥ ≤ C * r :=
(h.norm_div_le ha hb).trans $ mul_le_mul_of_nonneg_left hr C.2
@[to_additive] lemma lipschitz_with_iff_norm_div_le {f : E → F} {C : ℝ≥0} :
lipschitz_with C f ↔ ∀ x y, ∥f x / f y∥ ≤ C * ∥x / y∥ :=
by simp only [lipschitz_with_iff_dist_le_mul, dist_eq_norm_div]
alias lipschitz_with_iff_norm_div_le ↔ lipschitz_with.norm_div_le _
attribute [to_additive] lipschitz_with.norm_div_le
@[to_additive] lemma lipschitz_with.norm_div_le_of_le {f : E → F} {C : ℝ≥0} (h : lipschitz_with C f)
(hr : ∥a / b∥ ≤ r) : ∥f a / f b∥ ≤ C * r :=
(h.norm_div_le _ _).trans $ mul_le_mul_of_nonneg_left hr C.2
/-- A homomorphism `f` of seminormed groups is continuous, if there exists a constant `C` such that
for all `x`, one has `∥f x∥ ≤ C * ∥x∥`. -/
@[to_additive "A homomorphism `f` of seminormed groups is continuous, if there exists a constant `C`
such that for all `x`, one has `∥f x∥ ≤ C * ∥x∥`"]
lemma monoid_hom_class.continuous_of_bound [monoid_hom_class 𝓕 E F] (f : 𝓕) (C : ℝ)
(h : ∀ x, ∥f x∥ ≤ C * ∥x∥) : continuous f :=
(monoid_hom_class.lipschitz_of_bound f C h).continuous
@[to_additive] lemma monoid_hom_class.uniform_continuous_of_bound [monoid_hom_class 𝓕 E F]
(f : 𝓕) (C : ℝ) (h : ∀x, ∥f x∥ ≤ C * ∥x∥) : uniform_continuous f :=
(monoid_hom_class.lipschitz_of_bound f C h).uniform_continuous
@[to_additive is_compact.exists_bound_of_continuous_on]
lemma is_compact.exists_bound_of_continuous_on' [topological_space α] {s : set α}
(hs : is_compact s) {f : α → E} (hf : continuous_on f s) :
∃ C, ∀ x ∈ s, ∥f x∥ ≤ C :=
(bounded_iff_forall_norm_le'.1 (hs.image_of_continuous_on hf).bounded).imp $ λ C hC x hx,
hC _ $ set.mem_image_of_mem _ hx
@[to_additive] lemma monoid_hom_class.isometry_iff_norm [monoid_hom_class 𝓕 E F] (f : 𝓕) :
isometry f ↔ ∀ x, ∥f x∥ = ∥x∥ :=
begin
simp only [isometry_iff_dist_eq, dist_eq_norm_div, ←map_div],
refine ⟨λ h x, _, λ h x y, h _⟩,
simpa using h x 1,
end
alias monoid_hom_class.isometry_iff_norm ↔ _ monoid_hom_class.isometry_of_norm
attribute [to_additive] monoid_hom_class.isometry_of_norm
section nnnorm
@[priority 100, to_additive] -- See note [lower instance priority]
instance seminormed_group.to_has_nnnorm : has_nnnorm E := ⟨λ a, ⟨∥a∥, norm_nonneg' a⟩⟩
@[simp, norm_cast, to_additive coe_nnnorm] lemma coe_nnnorm' (a : E) : (∥a∥₊ : ℝ) = ∥a∥ := rfl
@[simp, to_additive coe_comp_nnnorm]
lemma coe_comp_nnnorm' : (coe : ℝ≥0 → ℝ) ∘ (nnnorm : E → ℝ≥0) = norm := rfl
@[to_additive norm_to_nnreal]
lemma norm_to_nnreal' : ∥a∥.to_nnreal = ∥a∥₊ := @real.to_nnreal_coe ∥a∥₊
@[to_additive]
lemma nndist_eq_nnnorm_div (a b : E) : nndist a b = ∥a / b∥₊ := nnreal.eq $ dist_eq_norm_div _ _
alias nndist_eq_nnnorm_sub ← nndist_eq_nnnorm
@[simp, to_additive nnnorm_zero] lemma nnnorm_one' : ∥(1 : E)∥₊ = 0 := nnreal.eq norm_one'
@[to_additive] lemma ne_one_of_nnnorm_ne_zero {a : E} : ∥a∥₊ ≠ 0 → a ≠ 1 :=
mt $ by { rintro rfl, exact nnnorm_one' }
@[to_additive nnnorm_add_le]
lemma nnnorm_mul_le' (a b : E) : ∥a * b∥₊ ≤ ∥a∥₊ + ∥b∥₊ := nnreal.coe_le_coe.1 $ norm_mul_le' a b
@[simp, to_additive nnnorm_neg] lemma nnnorm_inv' (a : E) : ∥a⁻¹∥₊ = ∥a∥₊ := nnreal.eq $ norm_inv' a
@[to_additive] lemma nnnorm_div_le (a b : E) : ∥a / b∥₊ ≤ ∥a∥₊ + ∥b∥₊ :=
nnreal.coe_le_coe.1 $ norm_div_le _ _
@[to_additive nndist_nnnorm_nnnorm_le]
lemma nndist_nnnorm_nnnorm_le' (a b : E) : nndist ∥a∥₊ ∥b∥₊ ≤ ∥a / b∥₊ :=
nnreal.coe_le_coe.1 $ dist_norm_norm_le' a b
@[to_additive] lemma nnnorm_le_nnnorm_add_nnnorm_div (a b : E) : ∥b∥₊ ≤ ∥a∥₊ + ∥a / b∥₊ :=
norm_le_norm_add_norm_div _ _
@[to_additive] lemma nnnorm_le_nnnorm_add_nnnorm_div' (a b : E) : ∥a∥₊ ≤ ∥b∥₊ + ∥a / b∥₊ :=
norm_le_norm_add_norm_div' _ _
alias nnnorm_le_nnnorm_add_nnnorm_sub' ← nnnorm_le_insert'
alias nnnorm_le_nnnorm_add_nnnorm_sub ← nnnorm_le_insert
@[to_additive]
lemma nnnorm_le_mul_nnnorm_add (a b : E) : ∥a∥₊ ≤ ∥a * b∥₊ + ∥b∥₊ := norm_le_mul_norm_add _ _
@[to_additive of_real_norm_eq_coe_nnnorm]
lemma of_real_norm_eq_coe_nnnorm' (a : E) : ennreal.of_real ∥a∥ = ∥a∥₊ :=
ennreal.of_real_eq_coe_nnreal _
@[to_additive] lemma edist_eq_coe_nnnorm_div (a b : E) : edist a b = ∥a / b∥₊ :=
by rw [edist_dist, dist_eq_norm_div, of_real_norm_eq_coe_nnnorm']
@[to_additive edist_eq_coe_nnnorm] lemma edist_eq_coe_nnnorm' (x : E) : edist x 1 = (∥x∥₊ : ℝ≥0∞) :=
by rw [edist_eq_coe_nnnorm_div, div_one]
@[to_additive]
lemma mem_emetric_ball_one_iff {r : ℝ≥0∞} : a ∈ emetric.ball (1 : E) r ↔ ↑∥a∥₊ < r :=
by rw [emetric.mem_ball, edist_eq_coe_nnnorm']
@[simp, to_additive] lemma edist_mul_right (a₁ a₂ b : E) : edist (a₁ * b) (a₂ * b) = edist a₁ a₂ :=
by simp [edist_dist]
@[simp, to_additive] lemma edist_div_right (a₁ a₂ b : E) : edist (a₁ / b) (a₂ / b) = edist a₁ a₂ :=
by simpa only [div_eq_mul_inv] using edist_mul_right _ _ _
@[to_additive] lemma monoid_hom_class.lipschitz_of_bound_nnnorm [monoid_hom_class 𝓕 E F] (f : 𝓕)
(C : ℝ≥0) (h : ∀ x, ∥f x∥₊ ≤ C * ∥x∥₊) : lipschitz_with C f :=
@real.to_nnreal_coe C ▸ monoid_hom_class.lipschitz_of_bound f C h
@[to_additive] lemma monoid_hom_class.antilipschitz_of_bound [monoid_hom_class 𝓕 E F] (f : 𝓕)
{K : ℝ≥0} (h : ∀ x, ∥x∥ ≤ K * ∥f x∥) :
antilipschitz_with K f :=
antilipschitz_with.of_le_mul_dist $ λ x y, by simpa only [dist_eq_norm_div, map_div] using h (x / y)
@[to_additive] lemma monoid_hom_class.bound_of_antilipschitz [monoid_hom_class 𝓕 E F] (f : 𝓕)
{K : ℝ≥0} (h : antilipschitz_with K f) (x) : ∥x∥ ≤ K * ∥f x∥ :=
by simpa only [dist_one_right, map_one] using h.le_mul_dist x 1
end nnnorm
@[to_additive] lemma tendsto_iff_norm_tendsto_one {f : α → E} {a : filter α} {b : E} :
tendsto f a (𝓝 b) ↔ tendsto (λ e, ∥f e / b∥) a (𝓝 0) :=
by { convert tendsto_iff_dist_tendsto_zero, simp [dist_eq_norm_div] }
@[to_additive] lemma tendsto_one_iff_norm_tendsto_one {f : α → E} {a : filter α} :
tendsto f a (𝓝 1) ↔ tendsto (λ e, ∥f e∥) a (𝓝 0) :=
by { rw tendsto_iff_norm_tendsto_one, simp only [div_one] }
@[to_additive] lemma comap_norm_nhds_one : comap norm (𝓝 0) = 𝓝 (1 : E) :=
by simpa only [dist_one_right] using nhds_comap_dist (1 : E)
/-- Special case of the sandwich theorem: if the norm of `f` is eventually bounded by a real
function `a` which tends to `0`, then `f` tends to `1`. In this pair of lemmas (`squeeze_one_norm'`
and `squeeze_one_norm`), following a convention of similar lemmas in `topology.metric_space.basic`
and `topology.algebra.order`, the `'` version is phrased using "eventually" and the non-`'` version
is phrased absolutely. -/
@[to_additive "Special case of the sandwich theorem: if the norm of `f` is eventually bounded by a
real function `a` which tends to `0`, then `f` tends to `1`. In this pair of lemmas
(`squeeze_zero_norm'` and `squeeze_zero_norm`), following a convention of similar lemmas in
`topology.metric_space.basic` and `topology.algebra.order`, the `'` version is phrased using
\"eventually\" and the non-`'` version is phrased absolutely."]
lemma squeeze_one_norm' {f : α → E} {a : α → ℝ} {t₀ : filter α} (h : ∀ᶠ n in t₀, ∥f n∥ ≤ a n)
(h' : tendsto a t₀ (𝓝 0)) : tendsto f t₀ (𝓝 1) :=
tendsto_one_iff_norm_tendsto_one.2 $ squeeze_zero' (eventually_of_forall $ λ n, norm_nonneg' _) h h'
/-- Special case of the sandwich theorem: if the norm of `f` is bounded by a real function `a` which
tends to `0`, then `f` tends to `1`. -/
@[to_additive "Special case of the sandwich theorem: if the norm of `f` is bounded by a real
function `a` which tends to `0`, then `f` tends to `0`."]
lemma squeeze_one_norm {f : α → E} {a : α → ℝ} {t₀ : filter α} (h : ∀ n, ∥f n∥ ≤ a n) :
tendsto a t₀ (𝓝 0) → tendsto f t₀ (𝓝 1) :=
squeeze_one_norm' $ eventually_of_forall h
@[to_additive] lemma tendsto_norm_div_self (x : E) : tendsto (λ a, ∥a / x∥) (𝓝 x) (𝓝 0) :=
by simpa [dist_eq_norm_div] using
tendsto_id.dist (tendsto_const_nhds : tendsto (λ a, (x:E)) (𝓝 x) _)
@[to_additive tendsto_norm]lemma tendsto_norm' {x : E} : tendsto (λ a, ∥a∥) (𝓝 x) (𝓝 ∥x∥) :=
by simpa using tendsto_id.dist (tendsto_const_nhds : tendsto (λ a, (1:E)) _ _)
@[to_additive] lemma tendsto_norm_one : tendsto (λ a : E, ∥a∥) (𝓝 1) (𝓝 0) :=
by simpa using tendsto_norm_div_self (1:E)
@[continuity, to_additive continuous_norm] lemma continuous_norm' : continuous (λ a : E, ∥a∥) :=
by simpa using continuous_id.dist (continuous_const : continuous (λ a, (1:E)))
@[continuity, to_additive continuous_nnnorm]
lemma continuous_nnnorm' : continuous (λ a : E, ∥a∥₊) := continuous_norm'.subtype_mk _
@[to_additive lipschitz_with_one_norm] lemma lipschitz_with_one_norm' :
lipschitz_with 1 (norm : E → ℝ) :=
by simpa only [dist_one_left] using lipschitz_with.dist_right (1 : E)
@[to_additive lipschitz_with_one_nnnorm] lemma lipschitz_with_one_nnnorm' :
lipschitz_with 1 (has_nnnorm.nnnorm : E → ℝ≥0) :=
lipschitz_with_one_norm'
@[to_additive uniform_continuous_norm]
lemma uniform_continuous_norm' : uniform_continuous (norm : E → ℝ) :=
lipschitz_with_one_norm'.uniform_continuous
@[to_additive uniform_continuous_nnnorm]
lemma uniform_continuous_nnnorm' : uniform_continuous (λ (a : E), ∥a∥₊) :=
uniform_continuous_norm'.subtype_mk _
/-- A helper lemma used to prove that the (scalar or usual) product of a function that tends to one
and a bounded function tends to one. This lemma is formulated for any binary operation
`op : E → F → G` with an estimate `∥op x y∥ ≤ A * ∥x∥ * ∥y∥` for some constant A instead of
multiplication so that it can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`. -/
@[to_additive "A helper lemma used to prove that the (scalar or usual) product of a function that
tends to zero and a bounded function tends to zero. This lemma is formulated for any binary
operation `op : E → F → G` with an estimate `∥op x y∥ ≤ A * ∥x∥ * ∥y∥` for some constant A instead
of multiplication so that it can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`."]
lemma filter.tendsto.op_one_is_bounded_under_le' {f : α → E} {g : α → F} {l : filter α}
(hf : tendsto f l (𝓝 1)) (hg : is_bounded_under (≤) l (norm ∘ g)) (op : E → F → G)
(h_op : ∃ A, ∀ x y, ∥op x y∥ ≤ A * ∥x∥ * ∥y∥) :
tendsto (λ x, op (f x) (g x)) l (𝓝 1) :=
begin
cases h_op with A h_op,
rcases hg with ⟨C, hC⟩, rw eventually_map at hC,
rw normed_comm_group.tendsto_nhds_one at hf ⊢,
intros ε ε₀,
rcases exists_pos_mul_lt ε₀ (A * C) with ⟨δ, δ₀, hδ⟩,
filter_upwards [hf δ δ₀, hC] with i hf hg,
refine (h_op _ _).trans_lt _,
cases le_total A 0 with hA hA,
{ exact (mul_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonpos_of_nonneg hA $ norm_nonneg' _) $
norm_nonneg' _).trans_lt ε₀ },
calc A * ∥f i∥ * ∥g i∥ ≤ A * δ * C :
mul_le_mul (mul_le_mul_of_nonneg_left hf.le hA) hg (norm_nonneg' _) (mul_nonneg hA δ₀.le)
... = A * C * δ : mul_right_comm _ _ _
... < ε : hδ,
end
/-- A helper lemma used to prove that the (scalar or usual) product of a function that tends to one
and a bounded function tends to one. This lemma is formulated for any binary operation
`op : E → F → G` with an estimate `∥op x y∥ ≤ ∥x∥ * ∥y∥` instead of multiplication so that it
can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`. -/
@[to_additive "A helper lemma used to prove that the (scalar or usual) product of a function that
tends to zero and a bounded function tends to zero. This lemma is formulated for any binary
operation `op : E → F → G` with an estimate `∥op x y∥ ≤ ∥x∥ * ∥y∥` instead of multiplication so that
it can be applied to `(*)`, `flip (*)`, `(•)`, and `flip (•)`."]
lemma filter.tendsto.op_one_is_bounded_under_le {f : α → E} {g : α → F} {l : filter α}
(hf : tendsto f l (𝓝 1)) (hg : is_bounded_under (≤) l (norm ∘ g)) (op : E → F → G)
(h_op : ∀ x y, ∥op x y∥ ≤ ∥x∥ * ∥y∥) :
tendsto (λ x, op (f x) (g x)) l (𝓝 1) :=
hf.op_one_is_bounded_under_le' hg op ⟨1, λ x y, (one_mul (∥x∥)).symm ▸ h_op x y⟩
section
variables {l : filter α} {f : α → E}
@[to_additive filter.tendsto.norm] lemma filter.tendsto.norm' (h : tendsto f l (𝓝 a)) :
tendsto (λ x, ∥f x∥) l (𝓝 ∥a∥) :=
tendsto_norm'.comp h
@[to_additive filter.tendsto.nnnorm] lemma filter.tendsto.nnnorm' (h : tendsto f l (𝓝 a)) :
tendsto (λ x, ∥f x∥₊) l (𝓝 (∥a∥₊)) :=
tendsto.comp continuous_nnnorm'.continuous_at h
end
section
variables [topological_space α] {f : α → E}
@[to_additive continuous.norm] lemma continuous.norm' : continuous f → continuous (λ x, ∥f x∥) :=
continuous_norm'.comp
@[to_additive continuous.nnnorm]
lemma continuous.nnnorm' : continuous f → continuous (λ x, ∥f x∥₊) := continuous_nnnorm'.comp
@[to_additive continuous_at.norm]
lemma continuous_at.norm' {a : α} (h : continuous_at f a) : continuous_at (λ x, ∥f x∥) a := h.norm'
@[to_additive continuous_at.nnnorm]
lemma continuous_at.nnnorm' {a : α} (h : continuous_at f a) : continuous_at (λ x, ∥f x∥₊) a :=
h.nnnorm'
@[to_additive continuous_within_at.norm]
lemma continuous_within_at.norm' {s : set α} {a : α} (h : continuous_within_at f s a) :
continuous_within_at (λ x, ∥f x∥) s a :=
h.norm'
@[to_additive continuous_within_at.nnnorm]
lemma continuous_within_at.nnnorm' {s : set α} {a : α} (h : continuous_within_at f s a) :
continuous_within_at (λ x, ∥f x∥₊) s a :=
h.nnnorm'
@[to_additive continuous_on.norm]
lemma continuous_on.norm' {s : set α} (h : continuous_on f s) : continuous_on (λ x, ∥f x∥) s :=
λ x hx, (h x hx).norm'
@[to_additive continuous_on.nnnorm]
lemma continuous_on.nnnorm' {s : set α} (h : continuous_on f s) : continuous_on (λ x, ∥f x∥₊) s :=
λ x hx, (h x hx).nnnorm'
end
/-- If `∥y∥ → ∞`, then we can assume `y ≠ x` for any fixed `x`. -/
@[to_additive eventually_ne_of_tendsto_norm_at_top "If `∥y∥→∞`, then we can assume `y≠x` for any
fixed `x`"]
lemma eventually_ne_of_tendsto_norm_at_top' {l : filter α} {f : α → E}
(h : tendsto (λ y, ∥f y∥) l at_top) (x : E) :
∀ᶠ y in l, f y ≠ x :=
(h.eventually_ne_at_top _).mono $ λ x, ne_of_apply_ne norm
@[to_additive] lemma seminormed_comm_group.mem_closure_iff :
a ∈ closure s ↔ ∀ ε, 0 < ε → ∃ b ∈ s, ∥a / b∥ < ε :=
by simp [metric.mem_closure_iff, dist_eq_norm_div]
@[to_additive norm_le_zero_iff'] lemma norm_le_zero_iff''' [t0_space E] {a : E} : ∥a∥ ≤ 0 ↔ a = 1 :=
begin
letI : normed_group E :=
{ to_metric_space := metric.of_t0_pseudo_metric_space E, ..‹seminormed_group E› },
rw [←dist_one_right, dist_le_zero],
end
@[to_additive norm_eq_zero'] lemma norm_eq_zero''' [t0_space E] {a : E} : ∥a∥ = 0 ↔ a = 1 :=
(norm_nonneg' a).le_iff_eq.symm.trans norm_le_zero_iff'''
@[to_additive norm_pos_iff'] lemma norm_pos_iff''' [t0_space E] {a : E} : 0 < ∥a∥ ↔ a ≠ 1 :=
by rw [← not_le, norm_le_zero_iff''']
@[to_additive]
lemma seminormed_group.tendsto_uniformly_on_one {f : ι → κ → G} {s : set κ} {l : filter ι} :
tendsto_uniformly_on f 1 l s ↔ ∀ ε > 0, ∀ᶠ i in l, ∀ x ∈ s, ∥f i x∥ < ε :=
by simp_rw [tendsto_uniformly_on_iff, pi.one_apply, dist_one_left]
@[to_additive]
lemma seminormed_group.uniform_cauchy_seq_on_filter_iff_tendsto_uniformly_on_filter_one
{f : ι → κ → G} {l : filter ι} {l' : filter κ} : uniform_cauchy_seq_on_filter f l l' ↔
tendsto_uniformly_on_filter (λ n : ι × ι, λ z, f n.fst z / f n.snd z) 1 (l ×ᶠ l) l' :=
begin
refine ⟨λ hf u hu, _, λ hf u hu, _⟩,
{ obtain ⟨ε, hε, H⟩ := uniformity_basis_dist.mem_uniformity_iff.mp hu,
refine (hf {p : G × G | dist p.fst p.snd < ε} $ dist_mem_uniformity hε).mono (λ x hx,
H 1 (f x.fst.fst x.snd / f x.fst.snd x.snd) _),
simpa [dist_eq_norm_div, norm_div_rev] using hx },
{ obtain ⟨ε, hε, H⟩ := uniformity_basis_dist.mem_uniformity_iff.mp hu,
refine (hf {p : G × G | dist p.fst p.snd < ε} $ dist_mem_uniformity hε).mono (λ x hx,
H (f x.fst.fst x.snd) (f x.fst.snd x.snd) _),
simpa [dist_eq_norm_div, norm_div_rev] using hx }
end
@[to_additive]
lemma seminormed_group.uniform_cauchy_seq_on_iff_tendsto_uniformly_on_one
{f : ι → κ → G} {s : set κ} {l : filter ι} :
uniform_cauchy_seq_on f l s ↔
tendsto_uniformly_on (λ n : ι × ι, λ z, f n.fst z / f n.snd z) 1 (l ×ᶠ l) s :=
by rw [tendsto_uniformly_on_iff_tendsto_uniformly_on_filter,
uniform_cauchy_seq_on_iff_uniform_cauchy_seq_on_filter,
seminormed_group.uniform_cauchy_seq_on_filter_iff_tendsto_uniformly_on_filter_one]
end seminormed_group
section induced
variables (E F)
/-- A group homomorphism from a `group` to a `seminormed_group` induces a `seminormed_group`
structure on the domain. -/
@[reducible, -- See note [reducible non-instances]
to_additive "A group homomorphism from an `add_group` to a `seminormed_add_group` induces a
`seminormed_add_group` structure on the domain."]
def seminormed_group.induced [group E] [seminormed_group F] [monoid_hom_class 𝓕 E F] (f : 𝓕) :
seminormed_group E :=
{ norm := λ x, ∥f x∥,
dist_eq := λ x y, by simpa only [map_div, ←dist_eq_norm_div],
..pseudo_metric_space.induced f _ }
/-- A group homomorphism from a `comm_group` to a `seminormed_group` induces a
`seminormed_comm_group` structure on the domain. -/
@[reducible, -- See note [reducible non-instances]
to_additive "A group homomorphism from an `add_comm_group` to a `seminormed_add_group` induces a
`seminormed_add_comm_group` structure on the domain."]
def seminormed_comm_group.induced [comm_group E] [seminormed_group F] [monoid_hom_class 𝓕 E F]
(f : 𝓕) : seminormed_comm_group E :=
{ ..seminormed_group.induced E F f }
/-- An injective group homomorphism from a `group` to a `normed_group` induces a `normed_group`
structure on the domain. -/
@[reducible, -- See note [reducible non-instances].
to_additive "An injective group homomorphism from an `add_group` to a `normed_add_group` induces a
`normed_add_group` structure on the domain."]
def normed_group.induced [group E] [normed_group F] [monoid_hom_class 𝓕 E F] (f : 𝓕)
(h : injective f) : normed_group E :=
{ ..seminormed_group.induced E F f, ..metric_space.induced f h _ }
/-- An injective group homomorphism from an `comm_group` to a `normed_group` induces a
`normed_comm_group` structure on the domain. -/
@[reducible, -- See note [reducible non-instances].
to_additive "An injective group homomorphism from an `comm_group` to a `normed_comm_group` induces a
`normed_comm_group` structure on the domain."]
def normed_comm_group.induced [comm_group E] [normed_group F] [monoid_hom_class 𝓕 E F] (f : 𝓕)
(h : injective f) : normed_comm_group E :=
{ ..seminormed_group.induced E F f, ..metric_space.induced f h _ }
end induced
section seminormed_comm_group
variables [seminormed_comm_group E] [seminormed_comm_group F] {a a₁ a₂ b b₁ b₂ : E} {r r₁ r₂ : ℝ}
@[simp, to_additive] lemma dist_mul_left (a b₁ b₂ : E) : dist (a * b₁) (a * b₂) = dist b₁ b₂ :=
by simp [dist_eq_norm_div]
@[to_additive] lemma dist_inv (x y : E) : dist x⁻¹ y = dist x y⁻¹ :=
by simp_rw [dist_eq_norm_div, ←norm_inv' (x⁻¹ / y), inv_div, div_inv_eq_mul, mul_comm]
@[simp, to_additive] lemma dist_inv_inv (a b : E) : dist a⁻¹ b⁻¹ = dist a b :=
by rw [dist_inv, inv_inv]
@[simp, to_additive] lemma dist_div_left (a b₁ b₂ : E) : dist (a / b₁) (a / b₂) = dist b₁ b₂ :=
by simp only [div_eq_mul_inv, dist_mul_left, dist_inv_inv]
@[simp, to_additive] lemma dist_self_mul_right (a b : E) : dist a (a * b) = ∥b∥ :=
by rw [←dist_one_left, ←dist_mul_left a 1 b, mul_one]
@[simp, to_additive] lemma dist_self_mul_left (a b : E) : dist (a * b) a = ∥b∥ :=
by rw [dist_comm, dist_self_mul_right]
@[simp, to_additive] lemma dist_self_div_right (a b : E) : dist a (a / b) = ∥b∥ :=
by rw [div_eq_mul_inv, dist_self_mul_right, norm_inv']
@[simp, to_additive] lemma dist_self_div_left (a b : E) : dist (a / b) a = ∥b∥ :=
by rw [dist_comm, dist_self_div_right]
@[to_additive] lemma dist_mul_mul_le (a₁ a₂ b₁ b₂ : E) :
dist (a₁ * a₂) (b₁ * b₂) ≤ dist a₁ b₁ + dist a₂ b₂ :=
by simpa only [dist_mul_left, dist_mul_right] using dist_triangle (a₁ * a₂) (b₁ * a₂) (b₁ * b₂)
@[to_additive] lemma dist_mul_mul_le_of_le (h₁ : dist a₁ b₁ ≤ r₁) (h₂ : dist a₂ b₂ ≤ r₂) :
dist (a₁ * a₂) (b₁ * b₂) ≤ r₁ + r₂ :=
(dist_mul_mul_le a₁ a₂ b₁ b₂).trans $ add_le_add h₁ h₂
@[to_additive] lemma dist_div_div_le (a₁ a₂ b₁ b₂ : E) :
dist (a₁ / a₂) (b₁ / b₂) ≤ dist a₁ b₁ + dist a₂ b₂ :=
by simpa only [div_eq_mul_inv, dist_inv_inv] using dist_mul_mul_le a₁ a₂⁻¹ b₁ b₂⁻¹
@[to_additive] lemma dist_div_div_le_of_le (h₁ : dist a₁ b₁ ≤ r₁) (h₂ : dist a₂ b₂ ≤ r₂) :
dist (a₁ / a₂) (b₁ / b₂) ≤ r₁ + r₂ :=
(dist_div_div_le a₁ a₂ b₁ b₂).trans $ add_le_add h₁ h₂
@[to_additive] lemma abs_dist_sub_le_dist_mul_mul (a₁ a₂ b₁ b₂ : E) :
|dist a₁ b₁ - dist a₂ b₂| ≤ dist (a₁ * a₂) (b₁ * b₂) :=
by simpa only [dist_mul_left, dist_mul_right, dist_comm b₂]
using abs_dist_sub_le (a₁ * a₂) (b₁ * b₂) (b₁ * a₂)
lemma norm_multiset_sum_le {E} [seminormed_add_comm_group E] (m : multiset E) :
∥m.sum∥ ≤ (m.map (λ x, ∥x∥)).sum :=
m.le_sum_of_subadditive norm norm_zero norm_add_le
@[to_additive]
lemma norm_multiset_prod_le (m : multiset E) : ∥m.prod∥ ≤ (m.map $ λ x, ∥x∥).sum :=
begin
rw [←multiplicative.of_add_le, of_add_multiset_prod, multiset.map_map],
refine multiset.le_prod_of_submultiplicative (multiplicative.of_add ∘ norm) _ (λ x y, _) _,
{ simp only [comp_app, norm_one', of_add_zero] },
{ exact norm_mul_le' _ _ }
end
lemma norm_sum_le {E} [seminormed_add_comm_group E] (s : finset ι) (f : ι → E) :
∥∑ i in s, f i∥ ≤ ∑ i in s, ∥f i∥ :=
s.le_sum_of_subadditive norm norm_zero norm_add_le f
@[to_additive] lemma norm_prod_le (s : finset ι) (f : ι → E) : ∥∏ i in s, f i∥ ≤ ∑ i in s, ∥f i∥ :=
begin