Skip to content

Commit a40639a

Browse files
committed
feat: port Analysis.Normed.MulAction + #19053 (#4288)
Both the new file and the other fixes are done in the same PR, since according to the description of leanprover-community/mathlib3#19053 "this should be very easy to forward-port".
1 parent 0123bf2 commit a40639a

File tree

4 files changed

+129
-58
lines changed

4 files changed

+129
-58
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ import Mathlib.Analysis.Normed.Group.InfiniteSum
455455
import Mathlib.Analysis.Normed.Group.Pointwise
456456
import Mathlib.Analysis.Normed.Group.Quotient
457457
import Mathlib.Analysis.Normed.Group.Seminorm
458+
import Mathlib.Analysis.Normed.MulAction
458459
import Mathlib.Analysis.Normed.Order.Basic
459460
import Mathlib.Analysis.Normed.Order.Lattice
460461
import Mathlib.Analysis.Normed.Order.UpperLower
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/-
2+
Copyright (c) 2023 Eric Wieser. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Eric Wieser
5+
6+
! This file was ported from Lean 3 source module analysis.normed.mul_action
7+
! leanprover-community/mathlib commit ba5ff5ad5d120fb0ef094ad2994967e9bfaf5112
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.Topology.MetricSpace.Algebra
12+
import Mathlib.Analysis.Normed.Field.Basic
13+
14+
/-!
15+
# Lemmas for `BoundedSMul` over normed additive groups
16+
17+
Lemmas which hold only in `NormedSpace α β` are provided in another file.
18+
19+
Notably we prove that `NonUnitalSeminormedRing`s have bounded actions by left- and right-
20+
multiplication. This allows downstream files to write general results about `BoundedSMul`, and then
21+
deduce `const_mul` and `mul_const` results as an immediate corollary.
22+
-/
23+
24+
25+
variable {α β : Type _}
26+
27+
section SeminormedAddGroup
28+
29+
variable [SeminormedAddGroup α] [SeminormedAddGroup β] [SMulZeroClass α β]
30+
31+
variable [BoundedSMul α β]
32+
33+
theorem norm_smul_le (r : α) (x : β) : ‖r • x‖ ≤ ‖r‖ * ‖x‖ := by
34+
simpa [smul_zero] using dist_smul_pair r 0 x
35+
#align norm_smul_le norm_smul_le
36+
37+
theorem nnnorm_smul_le (r : α) (x : β) : ‖r • x‖₊ ≤ ‖r‖₊ * ‖x‖₊ :=
38+
norm_smul_le _ _
39+
#align nnnorm_smul_le nnnorm_smul_le
40+
41+
theorem dist_smul_le (s : α) (x y : β) : dist (s • x) (s • y) ≤ ‖s‖ * dist x y := by
42+
simpa only [dist_eq_norm, sub_zero] using dist_smul_pair s x y
43+
#align dist_smul_le dist_smul_le
44+
45+
theorem nndist_smul_le (s : α) (x y : β) : nndist (s • x) (s • y) ≤ ‖s‖₊ * nndist x y :=
46+
dist_smul_le s x y
47+
#align nndist_smul_le nndist_smul_le
48+
49+
theorem lipschitzWith_smul (s : α) : LipschitzWith ‖s‖₊ ((· • ·) s : β → β) :=
50+
lipschitzWith_iff_dist_le_mul.2 <| dist_smul_le _
51+
#align lipschitz_with_smul lipschitzWith_smul
52+
53+
end SeminormedAddGroup
54+
55+
/-- Left multiplication is bounded. -/
56+
instance NonUnitalSeminormedRing.to_boundedSMul [NonUnitalSeminormedRing α] : BoundedSMul α α where
57+
dist_smul_pair' x y₁ y₂ := by simpa [mul_sub, dist_eq_norm] using norm_mul_le x (y₁ - y₂)
58+
dist_pair_smul' x₁ x₂ y := by simpa [sub_mul, dist_eq_norm] using norm_mul_le (x₁ - x₂) y
59+
#align non_unital_semi_normed_ring.to_has_bounded_smul NonUnitalSeminormedRing.to_boundedSMul
60+
61+
/-- Right multiplication is bounded. -/
62+
instance NonUnitalSeminormedRing.to_has_bounded_op_smul [NonUnitalSeminormedRing α] :
63+
BoundedSMul αᵐᵒᵖ α where
64+
dist_smul_pair' x y₁ y₂ := by
65+
simpa [sub_mul, dist_eq_norm, mul_comm] using norm_mul_le (y₁ - y₂) x.unop
66+
dist_pair_smul' x₁ x₂ y := by
67+
simpa [mul_sub, dist_eq_norm, mul_comm] using norm_mul_le y (x₁ - x₂).unop
68+
#align non_unital_semi_normed_ring.to_has_bounded_op_smul NonUnitalSeminormedRing.to_has_bounded_op_smul
69+
70+
section SeminormedRing
71+
72+
variable [SeminormedRing α] [SeminormedAddCommGroup β] [Module α β]
73+
74+
theorem BoundedSMul.of_norm_smul_le (h : ∀ (r : α) (x : β), ‖r • x‖ ≤ ‖r‖ * ‖x‖) :
75+
BoundedSMul α β :=
76+
{ dist_smul_pair' := fun a b₁ b₂ => by simpa [smul_sub, dist_eq_norm] using h a (b₁ - b₂)
77+
dist_pair_smul' := fun a₁ a₂ b => by simpa [sub_smul, dist_eq_norm] using h (a₁ - a₂) b }
78+
#align has_bounded_smul.of_norm_smul_le BoundedSMul.of_norm_smul_le
79+
80+
end SeminormedRing
81+
82+
section NormedDivisionRing
83+
84+
variable [NormedDivisionRing α] [SeminormedAddGroup β]
85+
86+
variable [MulActionWithZero α β] [BoundedSMul α β]
87+
88+
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
89+
by_cases h : r = 0
90+
· simp [h, zero_smul α x]
91+
· refine' le_antisymm (norm_smul_le r x) _
92+
calc
93+
‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
94+
_ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := (mul_le_mul_of_nonneg_left (norm_smul_le _ _) (norm_nonneg _))
95+
_ = ‖r • x‖ := by rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
96+
#align norm_smul norm_smul
97+
98+
theorem nnnorm_smul (r : α) (x : β) : ‖r • x‖₊ = ‖r‖₊ * ‖x‖₊ :=
99+
NNReal.eq <| norm_smul r x
100+
#align nnnorm_smul nnnorm_smul
101+
102+
end NormedDivisionRing
103+
104+
section NormedDivisionRingModule
105+
106+
variable [NormedDivisionRing α] [SeminormedAddCommGroup β]
107+
108+
variable [Module α β] [BoundedSMul α β]
109+
110+
theorem dist_smul₀ (s : α) (x y : β) : dist (s • x) (s • y) = ‖s‖ * dist x y := by
111+
simp_rw [dist_eq_norm, (norm_smul s (x - y)).symm, smul_sub]
112+
#align dist_smul₀ dist_smul₀
113+
114+
theorem nndist_smul₀ (s : α) (x y : β) : nndist (s • x) (s • y) = ‖s‖₊ * nndist x y :=
115+
NNReal.eq <| dist_smul₀ s x y
116+
#align nndist_smul₀ nndist_smul₀
117+
118+
end NormedDivisionRingModule

Mathlib/Analysis/NormedSpace/Basic.lean

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Patrick Massot, Johannes Hölzl
55
66
! This file was ported from Lean 3 source module analysis.normed_space.basic
7-
! leanprover-community/mathlib commit f9dd3204df14a0749cd456fac1e6849dfe7d2b88
7+
! leanprover-community/mathlib commit ba5ff5ad5d120fb0ef094ad2994967e9bfaf5112
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
1111
import Mathlib.Algebra.Algebra.Pi
1212
import Mathlib.Algebra.Algebra.RestrictScalars
1313
import Mathlib.Analysis.Normed.Field.Basic
14+
import Mathlib.Analysis.Normed.MulAction
1415
import Mathlib.Data.Real.Sqrt
1516
import Mathlib.Topology.Algebra.Module.Basic
1617

@@ -53,47 +54,18 @@ end Prio
5354

5455
variable [NormedField α] [SeminormedAddCommGroup β]
5556

56-
-- note: while these are currently strictly weaker than the versions without `le`, they will cease
57-
-- to be if we eventually generalize `NormedSpace` from `NormedField α` to `NormedRing α`.
58-
section LE
59-
60-
theorem norm_smul_le [NormedSpace α β] (r : α) (x : β) : ‖r • x‖ ≤ ‖r‖ * ‖x‖ :=
61-
NormedSpace.norm_smul_le _ _
62-
#align norm_smul_le norm_smul_le
63-
64-
theorem nnnorm_smul_le [NormedSpace α β] (s : α) (x : β) : ‖s • x‖₊ ≤ ‖s‖₊ * ‖x‖₊ :=
65-
norm_smul_le s x
66-
#align nnnorm_smul_le nnnorm_smul_le
67-
68-
theorem dist_smul_le [NormedSpace α β] (s : α) (x y : β) : dist (s • x) (s • y) ≤ ‖s‖ * dist x y :=
69-
by simpa only [dist_eq_norm, ← smul_sub] using norm_smul_le _ _
70-
#align dist_smul_le dist_smul_le
71-
72-
theorem nndist_smul_le [NormedSpace α β] (s : α) (x y : β) :
73-
nndist (s • x) (s • y) ≤ ‖s‖₊ * nndist x y :=
74-
dist_smul_le s x y
75-
#align nndist_smul_le nndist_smul_le
76-
77-
end LE
78-
7957
-- see Note [lower instance priority]
80-
instance (priority := 100) NormedSpace.boundedSMul [NormedSpace α β] : BoundedSMul α β where
81-
dist_smul_pair' x y₁ y₂ := by simpa [dist_eq_norm, smul_sub] using norm_smul_le x (y₁ - y₂)
82-
dist_pair_smul' x₁ x₂ y := by simpa [dist_eq_norm, sub_smul] using norm_smul_le (x₁ - x₂) y
58+
instance (priority := 100) NormedSpace.boundedSMul [NormedSpace α β] : BoundedSMul α β :=
59+
BoundedSMul.of_norm_smul_le NormedSpace.norm_smul_le
8360
#align normed_space.has_bounded_smul NormedSpace.boundedSMul
8461

8562
instance NormedField.toNormedSpace : NormedSpace α α where norm_smul_le a b := norm_mul_le a b
8663
#align normed_field.to_normed_space NormedField.toNormedSpace
8764

88-
theorem norm_smul [NormedSpace α β] (s : α) (x : β) : ‖s • x‖ = ‖s‖ * ‖x‖ := by
89-
by_cases h : s = 0
90-
· simp [h]
91-
· refine' le_antisymm (norm_smul_le s x) _
92-
calc
93-
‖s‖ * ‖x‖ = ‖s‖ * ‖s⁻¹ • s • x‖ := by rw [inv_smul_smul₀ h]
94-
_ ≤ ‖s‖ * (‖s⁻¹‖ * ‖s • x‖) := (mul_le_mul_of_nonneg_left (norm_smul_le _ _) (norm_nonneg _))
95-
_ = ‖s • x‖ := by rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
96-
#align norm_smul norm_smul
65+
-- shortcut instance
66+
instance NormedField.to_boundedSMul : BoundedSMul α α :=
67+
NormedSpace.boundedSMul
68+
#align normed_field.to_has_bounded_smul NormedField.to_boundedSMul
9769

9870
theorem norm_zsmul (α) [NormedField α] [NormedSpace α β] (n : ℤ) (x : β) :
9971
‖n • x‖ = ‖(n : α)‖ * ‖x‖ := by rw [← norm_smul, ← Int.smul_one_eq_coe, smul_assoc, one_smul]
@@ -109,23 +81,6 @@ theorem inv_norm_smul_mem_closed_unit_ball [NormedSpace ℝ β] (x : β) :
10981
div_self_le_one]
11082
#align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball
11183

112-
theorem dist_smul₀ [NormedSpace α β] (s : α) (x y : β) : dist (s • x) (s • y) = ‖s‖ * dist x y := by
113-
simp only [dist_eq_norm, (norm_smul _ _).symm, smul_sub]
114-
#align dist_smul₀ dist_smul₀
115-
116-
theorem nnnorm_smul [NormedSpace α β] (s : α) (x : β) : ‖s • x‖₊ = ‖s‖₊ * ‖x‖₊ :=
117-
NNReal.eq <| norm_smul s x
118-
#align nnnorm_smul nnnorm_smul
119-
120-
theorem nndist_smul₀ [NormedSpace α β] (s : α) (x y : β) :
121-
nndist (s • x) (s • y) = ‖s‖₊ * nndist x y :=
122-
NNReal.eq <| dist_smul₀ s x y
123-
#align nndist_smul₀ nndist_smul₀
124-
125-
theorem lipschitzWith_smul [NormedSpace α β] (s : α) : LipschitzWith ‖s‖₊ ((· • ·) s : β → β) :=
126-
lipschitzWith_iff_dist_le_mul.2 fun x y => by rw [dist_smul₀, coe_nnnorm]
127-
#align lipschitz_with_smul lipschitzWith_smul
128-
12984
theorem norm_smul_of_nonneg [NormedSpace ℝ β] {t : ℝ} (ht : 0 ≤ t) (x : β) : ‖t • x‖ = t * ‖x‖ := by
13085
rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht]
13186
#align norm_smul_of_nonneg norm_smul_of_nonneg
@@ -291,7 +246,7 @@ instance Pi.normedSpace {E : ι → Type _} [Fintype ι] [∀ i, SeminormedAddCo
291246
norm_smul_le a f := by
292247
simp_rw [← coe_nnnorm, ← NNReal.coe_mul, NNReal.coe_le_coe, Pi.nnnorm_def,
293248
NNReal.mul_finset_sup]
294-
exact Finset.sup_mono_fun fun _ _ => norm_smul_le _ _
249+
exact Finset.sup_mono_fun fun _ _ => norm_smul_le a _
295250
#align pi.normed_space Pi.normedSpace
296251

297252
instance MulOpposite.normedSpace : NormedSpace α Eᵐᵒᵖ :=

Mathlib/Analysis/SpecialFunctions/Exp.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
55
66
! This file was ported from Lean 3 source module analysis.special_functions.exp
7-
! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
7+
! leanprover-community/mathlib commit ba5ff5ad5d120fb0ef094ad2994967e9bfaf5112
88
! Please do not edit these lines, except to modify the commit id
99
! if you have ported upstream changes.
1010
-/
@@ -44,7 +44,6 @@ theorem exp_bound_sq (x z : ℂ) (hz : ‖z‖ ≤ 1) :
4444
_ = ‖exp x‖ * ‖exp z - 1 - z‖ := (norm_mul _ _)
4545
_ ≤ ‖exp x‖ * ‖z‖ ^ 2 :=
4646
mul_le_mul_of_nonneg_left (abs_exp_sub_one_sub_id_le hz) (norm_nonneg _)
47-
4847
#align complex.exp_bound_sq Complex.exp_bound_sq
4948

5049
theorem locally_lipschitz_exp {r : ℝ} (hr_nonneg : 0 ≤ r) (hr_le : r ≤ 1) (x y : ℂ)
@@ -64,7 +63,6 @@ theorem locally_lipschitz_exp {r : ℝ} (hr_nonneg : 0 ≤ r) (hr_le : r ≤ 1)
6463
_ ≤ ‖y - x‖ * ‖exp x‖ + ‖exp x‖ * (r * ‖y - x‖) :=
6564
(add_le_add_left (mul_le_mul le_rfl hyx_sq_le (sq_nonneg _) (norm_nonneg _)) _)
6665
_ = (1 + r) * ‖exp x‖ * ‖y - x‖ := by ring
67-
6866
#align complex.locally_lipschitz_exp Complex.locally_lipschitz_exp
6967

7068
-- Porting note: proof by term mode `locally_lipschitz_exp zero_le_one le_rfl x`
@@ -236,7 +234,6 @@ theorem tendsto_exp_div_pow_atTop (n : ℕ) : Tendsto (fun x => exp x / x ^ n) a
236234
(div_le_div_of_le (mul_pos (exp_pos _) hC₀).le
237235
(exp_le_exp.2 <| (Nat.ceil_lt_add_one hx₀.le).le))
238236
_ = exp x / C := by rw [add_comm, exp_add, mul_div_mul_left _ _ (exp_pos _).ne']
239-
240237
#align real.tendsto_exp_div_pow_at_top Real.tendsto_exp_div_pow_atTop
241238

242239
/-- The function `x^n * exp(-x)` tends to `0` at `+∞`, for any natural number `n`. -/

0 commit comments

Comments
 (0)