Skip to content

Commit eba55e9

Browse files
committed
chore: generalise ENNReal lemmas to WithTop (#17786)
That way, they will also apply to a potential future `ENNRat`.
1 parent b14fe2c commit eba55e9

File tree

11 files changed

+110
-77
lines changed

11 files changed

+110
-77
lines changed

Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ section Preorder
143143

144144
variable [Preorder α]
145145

146+
@[to_additive]
147+
lemma mul_left_mono [CovariantClass α α (· * ·) (· ≤ ·)] {a : α} : Monotone (a * ·) :=
148+
fun _ _ h ↦ mul_le_mul_left' h _
149+
150+
@[to_additive]
151+
lemma mul_right_mono [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a : α} : Monotone (· * a) :=
152+
fun _ _ h ↦ mul_le_mul_right' h _
153+
146154
@[to_additive (attr := gcongr)]
147155
theorem mul_lt_mul_of_lt_of_lt [MulLeftStrictMono α]
148156
[MulRightStrictMono α]
@@ -280,6 +288,14 @@ end PartialOrder
280288
section LinearOrder
281289
variable [LinearOrder α] {a b c d : α}
282290

291+
@[to_additive]
292+
lemma mul_max [CovariantClass α α (· * ·) (· ≤ ·)] (a b c : α) :
293+
a * max b c = max (a * b) (a * c) := mul_left_mono.map_max
294+
295+
@[to_additive]
296+
lemma max_mul [CovariantClass α α (swap (· * ·)) (· ≤ ·)] :
297+
max a b * c = max (a * c) (b * c) := mul_right_mono.map_max
298+
283299
@[to_additive] lemma min_lt_max_of_mul_lt_mul
284300
[MulLeftMono α] [MulRightMono α]
285301
(h : a * b < c * d) : min a b < max c d := by
@@ -1055,38 +1071,36 @@ section Mono
10551071
variable [Mul α] [Preorder α] [Preorder β] {f g : β → α} {s : Set β}
10561072

10571073
@[to_additive const_add]
1058-
theorem Monotone.const_mul' [MulLeftMono α] (hf : Monotone f) (a : α) :
1059-
Monotone fun x => a * f x := fun _ _ h => mul_le_mul_left' (hf h) a
1074+
theorem Monotone.const_mul' [MulLeftMono α] (hf : Monotone f) (a : α) : Monotone fun x ↦ a * f x :=
1075+
mul_left_mono.comp hf
10601076

10611077
@[to_additive const_add]
10621078
theorem MonotoneOn.const_mul' [MulLeftMono α] (hf : MonotoneOn f s) (a : α) :
1063-
MonotoneOn (fun x => a * f x) s := fun _ hx _ hy h => mul_le_mul_left' (hf hx hy h) a
1079+
MonotoneOn (fun x => a * f x) s := mul_left_mono.comp_monotoneOn hf
10641080

10651081
@[to_additive const_add]
1066-
theorem Antitone.const_mul' [MulLeftMono α] (hf : Antitone f) (a : α) :
1067-
Antitone fun x => a * f x := fun _ _ h => mul_le_mul_left' (hf h) a
1082+
theorem Antitone.const_mul' [MulLeftMono α] (hf : Antitone f) (a : α) : Antitone fun x ↦ a * f x :=
1083+
mul_left_mono.comp_antitone hf
10681084

10691085
@[to_additive const_add]
10701086
theorem AntitoneOn.const_mul' [MulLeftMono α] (hf : AntitoneOn f s) (a : α) :
1071-
AntitoneOn (fun x => a * f x) s := fun _ hx _ hy h => mul_le_mul_left' (hf hx hy h) a
1087+
AntitoneOn (fun x => a * f x) s := mul_left_mono.comp_antitoneOn hf
10721088

10731089
@[to_additive add_const]
10741090
theorem Monotone.mul_const' [MulRightMono α] (hf : Monotone f) (a : α) :
1075-
Monotone fun x => f x * a := fun _ _ h => mul_le_mul_right' (hf h) a
1091+
Monotone fun x => f x * a := mul_right_mono.comp hf
10761092

10771093
@[to_additive add_const]
1078-
theorem MonotoneOn.mul_const' [MulRightMono α] (hf : MonotoneOn f s)
1079-
(a : α) :
1080-
MonotoneOn (fun x => f x * a) s := fun _ hx _ hy h => mul_le_mul_right' (hf hx hy h) a
1094+
theorem MonotoneOn.mul_const' [MulRightMono α] (hf : MonotoneOn f s) (a : α) :
1095+
MonotoneOn (fun x => f x * a) s := mul_right_mono.comp_monotoneOn hf
10811096

10821097
@[to_additive add_const]
1083-
theorem Antitone.mul_const' [MulRightMono α] (hf : Antitone f) (a : α) :
1084-
Antitone fun x => f x * a := fun _ _ h => mul_le_mul_right' (hf h) a
1098+
theorem Antitone.mul_const' [MulRightMono α] (hf : Antitone f) (a : α) : Antitone fun x ↦ f x * a :=
1099+
mul_right_mono.comp_antitone hf
10851100

10861101
@[to_additive add_const]
1087-
theorem AntitoneOn.mul_const' [MulRightMono α] (hf : AntitoneOn f s)
1088-
(a : α) :
1089-
AntitoneOn (fun x => f x * a) s := fun _ hx _ hy h => mul_le_mul_right' (hf hx hy h) a
1102+
theorem AntitoneOn.mul_const' [MulRightMono α] (hf : AntitoneOn f s) (a : α) :
1103+
AntitoneOn (fun x => f x * a) s := mul_right_mono.comp_antitoneOn hf
10901104

10911105
/-- The product of two monotone functions is monotone. -/
10921106
@[to_additive add "The sum of two monotone functions is monotone."]

Mathlib/Algebra/Order/Ring/WithTop.lean

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,39 @@ protected def _root_.RingHom.withTopMap {R S : Type*} [CanonicallyOrderedCommSem
195195
(f : R →+* S) (hf : Function.Injective f) : WithTop R →+* WithTop S :=
196196
{MonoidWithZeroHom.withTopMap f.toMonoidWithZeroHom hf, f.toAddMonoidHom.withTopMap with}
197197

198+
variable [PosMulStrictMono α] {a a₁ a₂ b₁ b₂ : WithTop α}
199+
200+
@[gcongr]
201+
protected lemma mul_lt_mul (ha : a₁ < a₂) (hb : b₁ < b₂) : a₁ * b₁ < a₂ * b₂ := by
202+
have := posMulStrictMono_iff_mulPosStrictMono.1 ‹_›
203+
lift a₁ to α using ha.lt_top.ne
204+
lift b₁ to α using hb.lt_top.ne
205+
obtain rfl | ha₂ := eq_or_ne a₂ ⊤
206+
· rw [top_mul (by simpa [bot_eq_zero] using hb.bot_lt.ne')]
207+
exact coe_lt_top _
208+
obtain rfl | hb₂ := eq_or_ne b₂ ⊤
209+
· rw [mul_top (by simpa [bot_eq_zero] using ha.bot_lt.ne')]
210+
exact coe_lt_top _
211+
lift a₂ to α using ha₂
212+
lift b₂ to α using hb₂
213+
norm_cast at *
214+
obtain rfl | hb₁ := eq_zero_or_pos b₁
215+
· rw [mul_zero]
216+
exact mul_pos (by simpa [bot_eq_zero] using ha.bot_lt) hb
217+
· exact mul_lt_mul ha hb.le hb₁ (zero_le _)
218+
219+
variable [NoZeroDivisors α] [Nontrivial α] {a b : WithTop α}
220+
221+
protected lemma pow_right_strictMono : ∀ {n : ℕ}, n ≠ 0 → StrictMono fun a : WithTop α ↦ a ^ n
222+
| 0, h => absurd rfl h
223+
| 1, _ => by simpa only [pow_one] using strictMono_id
224+
| n + 2, _ => fun x y h ↦ by
225+
simp_rw [pow_succ _ (n + 1)]
226+
exact WithTop.mul_lt_mul (WithTop.pow_right_strictMono n.succ_ne_zero h) h
227+
228+
@[gcongr] protected lemma pow_lt_pow_left (hab : a < b) {n : ℕ} (hn : n ≠ 0) : a ^ n < b ^ n :=
229+
WithTop.pow_right_strictMono hn hab
230+
198231
end WithTop
199232

200233
namespace WithBot

Mathlib/Analysis/CStarAlgebra/Spectrum.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ lemma IsSelfAdjoint.toReal_spectralRadius_complex_eq_norm {a : A} (ha : IsSelfAd
124124

125125
theorem IsStarNormal.spectralRadius_eq_nnnorm (a : A) [IsStarNormal a] :
126126
spectralRadius ℂ a = ‖a‖₊ := by
127-
refine (ENNReal.pow_strictMono two_ne_zero).injective ?_
127+
refine (ENNReal.pow_right_strictMono two_ne_zero).injective ?_
128128
have heq :
129129
(fun n : ℕ => (‖(a⋆ * a) ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ)) =
130130
(fun x => x ^ 2) ∘ fun n : ℕ => (‖a ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ) := by

Mathlib/Analysis/NormedSpace/ENorm.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ noncomputable instance : SemilatticeSup (ENorm 𝕜 V) :=
151151
map_add_le' := fun _ _ =>
152152
max_le (le_trans (e₁.map_add_le _ _) <| add_le_add (le_max_left _ _) (le_max_left _ _))
153153
(le_trans (e₂.map_add_le _ _) <| add_le_add (le_max_right _ _) (le_max_right _ _))
154-
map_smul_le' := fun c x => le_of_eq <| by simp only [map_smul, ENNReal.mul_max] }
154+
map_smul_le' := fun c x => le_of_eq <| by simp only [map_smul, mul_max] }
155155
le_sup_left := fun _ _ _ => le_max_left _ _
156156
le_sup_right := fun _ _ _ => le_max_right _ _
157157
sup_le := fun _ _ _ h₁ h₂ x => max_le (h₁ x) (h₂ x) }

Mathlib/Data/ENNReal/Inv.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,6 @@ protected theorem div_mul_cancel (h0 : a ≠ 0) (hI : a ≠ ∞) : b / a * a = b
9797
protected theorem mul_div_cancel' (h0 : a ≠ 0) (hI : a ≠ ∞) : a * (b / a) = b := by
9898
rw [mul_comm, ENNReal.div_mul_cancel h0 hI]
9999

100-
protected theorem mul_eq_left (ha : a ≠ 0) (h'a : a ≠ ∞) : a * b = a ↔ b = 1 := by
101-
refine ⟨fun h ↦ ?_, fun h ↦ by rw [h, mul_one]⟩
102-
have : a * b * a⁻¹ = a * a⁻¹ := by rw [h]
103-
rwa [mul_assoc, mul_comm b, ← mul_assoc, ENNReal.mul_inv_cancel ha h'a, one_mul] at this
104-
105-
protected theorem mul_eq_right (ha : a ≠ 0) (h'a : a ≠ ∞) : b * a = a ↔ b = 1 := by
106-
rw [mul_comm]
107-
exact ENNReal.mul_eq_left ha h'a
108-
109100
-- Porting note: `simp only [div_eq_mul_inv, mul_comm, mul_assoc]` doesn't work in the following two
110101
protected theorem mul_comm_div : a / b * c = a * (c / b) := by
111102
simp only [div_eq_mul_inv, mul_right_comm, ← mul_assoc]

Mathlib/Data/ENNReal/Operations.lean

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,28 @@ variable {a b c d : ℝ≥0∞} {r p q : ℝ≥0}
2727

2828
section Mul
2929

30-
-- Porting note (#11215): TODO: generalize to `WithTop`
3130
@[mono, gcongr]
32-
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := by
33-
rcases lt_iff_exists_nnreal_btwn.1 ac with ⟨a', aa', a'c⟩
34-
lift a to ℝ≥0 using ne_top_of_lt aa'
35-
rcases lt_iff_exists_nnreal_btwn.1 bd with ⟨b', bb', b'd⟩
36-
lift b to ℝ≥0 using ne_top_of_lt bb'
37-
norm_cast at *
38-
calc
39-
↑(a * b) < ↑(a' * b') := coe_lt_coe.2 (mul_lt_mul₀ aa' bb')
40-
_ ≤ c * d := mul_le_mul' a'c.le b'd.le
41-
42-
-- TODO: generalize to `MulLeftMono α`
43-
theorem mul_left_mono : Monotone (a * ·) := fun _ _ => mul_le_mul' le_rfl
44-
45-
-- TODO: generalize to `MulRightMono α`
46-
theorem mul_right_mono : Monotone (· * a) := fun _ _ h => mul_le_mul' h le_rfl
31+
theorem mul_lt_mul (ac : a < c) (bd : b < d) : a * b < c * d := WithTop.mul_lt_mul ac bd
4732

48-
-- Porting note (#11215): TODO: generalize to `WithTop`
49-
theorem pow_strictMono : ∀ {n : ℕ}, n ≠ 0 → StrictMono fun x : ℝ≥0∞ => x ^ n
50-
| 0, h => absurd rfl h
51-
| 1, _ => by simpa only [pow_one] using strictMono_id
52-
| n + 2, _ => fun x y h ↦ by
53-
simp_rw [pow_succ _ (n + 1)]; exact mul_lt_mul (pow_strictMono n.succ_ne_zero h) h
33+
@[deprecated mul_left_mono (since := "2024-10-15")]
34+
protected theorem mul_left_mono : Monotone (a * ·) := mul_left_mono
35+
36+
@[deprecated mul_right_mono (since := "2024-10-15")]
37+
protected theorem mul_right_mono : Monotone (· * a) := mul_right_mono
38+
39+
protected lemma pow_right_strictMono {n : ℕ} (hn : n ≠ 0) : StrictMono fun a : ℝ≥0∞ ↦ a ^ n :=
40+
WithTop.pow_right_strictMono hn
5441

55-
@[gcongr] protected theorem pow_lt_pow_left (h : a < b) {n : ℕ} (hn : n ≠ 0) :
56-
a ^ n < b ^ n :=
57-
ENNReal.pow_strictMono hn h
42+
@[deprecated (since := "2024-10-15")] alias pow_strictMono := ENNReal.pow_right_strictMono
5843

59-
theorem max_mul : max a b * c = max (a * c) (b * c) := mul_right_mono.map_max
44+
@[gcongr] protected lemma pow_lt_pow_left (hab : a < b) {n : ℕ} (hn : n ≠ 0) : a ^ n < b ^ n :=
45+
WithTop.pow_lt_pow_left hab hn
6046

61-
theorem mul_max : a * max b c = max (a * b) (a * c) := mul_left_mono.map_max
47+
@[deprecated max_mul (since := "2024-10-15")]
48+
protected theorem max_mul : max a b * c = max (a * c) (b * c) := mul_right_mono.map_max
49+
50+
@[deprecated mul_max (since := "2024-10-15")]
51+
protected theorem mul_max : a * max b c = max (a * b) (a * c) := mul_left_mono.map_max
6252

6353
-- Porting note (#11215): TODO: generalize to `WithTop`
6454
theorem mul_left_strictMono (h0 : a ≠ 0) (hinf : a ≠ ∞) : StrictMono (a * ·) := by
@@ -101,6 +91,12 @@ theorem mul_lt_mul_left (h0 : a ≠ 0) (hinf : a ≠ ∞) : a * b < a * c ↔ b
10191
theorem mul_lt_mul_right : c ≠ 0 → c ≠ ∞ → (a * c < b * c ↔ a < b) :=
10292
mul_comm c a ▸ mul_comm c b ▸ mul_lt_mul_left
10393

94+
protected lemma mul_eq_left (ha₀ : a ≠ 0) (ha : a ≠ ∞) : a * b = a ↔ b = 1 := by
95+
simpa using ENNReal.mul_eq_mul_left ha₀ ha (c := 1)
96+
97+
protected lemma mul_eq_right (hb₀ : b ≠ 0) (hb : b ≠ ∞) : a * b = b ↔ a = 1 := by
98+
simpa using ENNReal.mul_eq_mul_right hb₀ hb (b := 1)
99+
104100
end Mul
105101

106102
section OperationsAndOrder

Mathlib/MeasureTheory/Measure/Haar/Unique.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ instance (priority := 100) IsHaarMeasure.isInvInvariant_of_regular
967967
have : c ^ 2 = 1 ^ 2 :=
968968
(ENNReal.mul_eq_mul_right (measure_pos_of_nonempty_interior _ K.interior_nonempty).ne'
969969
K.isCompact.measure_lt_top.ne).1 this
970-
have : c = 1 := (ENNReal.pow_strictMono two_ne_zero).injective this
970+
have : c = 1 := (ENNReal.pow_right_strictMono two_ne_zero).injective this
971971
rw [hc, this, one_smul]
972972

973973
/-- Any inner regular Haar measure is invariant under inversion in an abelian group. -/
@@ -992,7 +992,7 @@ instance (priority := 100) IsHaarMeasure.isInvInvariant_of_innerRegular
992992
have : c ^ 2 = 1 ^ 2 :=
993993
(ENNReal.mul_eq_mul_right (measure_pos_of_nonempty_interior _ K.interior_nonempty).ne'
994994
K.isCompact.measure_lt_top.ne).1 this
995-
have : c = 1 := (ENNReal.pow_strictMono two_ne_zero).injective this
995+
have : c = 1 := (ENNReal.pow_right_strictMono two_ne_zero).injective this
996996
rw [hc, this, one_smul]
997997

998998
@[to_additive]

Mathlib/MeasureTheory/OuterMeasure/Operations.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ instance instSMul : SMul R (OuterMeasure α) :=
7777
mono := fun {s t} h => by
7878
simp only
7979
rw [← smul_one_mul c, ← smul_one_mul c (m t)]
80-
exact ENNReal.mul_left_mono (m.mono h)
80+
exact mul_left_mono (m.mono h)
8181
iUnion_nat := fun s _ => by
8282
simp_rw [← smul_one_mul c (m _), ENNReal.tsum_mul_left]
83-
exact ENNReal.mul_left_mono (measure_iUnion_le _) }⟩
83+
exact mul_left_mono (measure_iUnion_le _) }⟩
8484

8585
@[simp]
8686
theorem coe_smul (c : R) (m : OuterMeasure α) : ⇑(c • m) = c • ⇑m :=

Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,10 @@ theorem finite_of_discr_bdd_of_isReal :
353353
convert hx₁
354354
· simp only [IntermediateField.lift_top]
355355
· simp only [IntermediateField.lift_adjoin, Set.image_singleton]
356-
have := one_le_convexBodyLTFactor K
357-
convert lt_of_le_of_lt (mul_right_mono (coe_le_coe.mpr this))
358-
(ENNReal.mul_lt_mul_left' (by positivity) coe_ne_top (minkowskiBound_lt_boundOfDiscBdd hK₂))
359-
simp_rw [ENNReal.coe_one, one_mul]
360-
356+
calc
357+
minkowskiBound K 1 < B := minkowskiBound_lt_boundOfDiscBdd hK₂
358+
_ = 1 * B := by rw [one_mul]
359+
_ ≤ convexBodyLTFactor K * B := by gcongr; exact mod_cast one_le_convexBodyLTFactor K
361360

362361
theorem finite_of_discr_bdd_of_isComplex :
363362
{K : { F : IntermediateField ℚ A // FiniteDimensional ℚ F} |
@@ -402,10 +401,10 @@ theorem finite_of_discr_bdd_of_isComplex :
402401
convert hx₁
403402
· simp only [IntermediateField.lift_top]
404403
· simp only [IntermediateField.lift_adjoin, Set.image_singleton]
405-
have := one_le_convexBodyLT'Factor K
406-
convert lt_of_le_of_lt (mul_right_mono (coe_le_coe.mpr this))
407-
(ENNReal.mul_lt_mul_left' (by positivity) coe_ne_top (minkowskiBound_lt_boundOfDiscBdd hK₂))
408-
simp_rw [ENNReal.coe_one, one_mul]
404+
calc
405+
minkowskiBound K 1 < B := minkowskiBound_lt_boundOfDiscBdd hK₂
406+
_ = 1 * B := by rw [one_mul]
407+
_ ≤ convexBodyLT'Factor K * B := by gcongr; exact mod_cast one_le_convexBodyLT'Factor K
409408

410409
/-- **Hermite Theorem**. Let `N` be an integer. There are only finitely many number fields
411410
(in some fixed extension of `ℚ`) of discriminant bounded by `N`. -/

Mathlib/Topology/EMetricSpace/Lipschitz.lean

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ theorem edist_le_mul (h : LipschitzWith K f) (x y : α) : edist (f x) (f y) ≤
138138

139139
theorem edist_le_mul_of_le (h : LipschitzWith K f) (hr : edist x y ≤ r) :
140140
edist (f x) (f y) ≤ K * r :=
141-
(h x y).trans <| ENNReal.mul_left_mono hr
141+
(h x y).trans <| mul_left_mono hr
142142

143143
theorem edist_lt_mul_of_lt (h : LipschitzWith K f) (hK : K ≠ 0) (hr : edist x y < r) :
144144
edist (f x) (f y) < K * r :=
@@ -163,7 +163,7 @@ protected theorem of_edist_le (h : ∀ x y, edist (f x) (f y) ≤ edist x y) : L
163163
fun x y => by simp only [ENNReal.coe_one, one_mul, h]
164164

165165
protected theorem weaken (hf : LipschitzWith K f) {K' : ℝ≥0} (h : K ≤ K') : LipschitzWith K' f :=
166-
fun x y => le_trans (hf x y) <| ENNReal.mul_right_mono (ENNReal.coe_le_coe.2 h)
166+
fun x y => le_trans (hf x y) <| mul_right_mono (ENNReal.coe_le_coe.2 h)
167167

168168
theorem ediam_image_le (hf : LipschitzWith K f) (s : Set α) :
169169
EMetric.diam (f '' s) ≤ K * EMetric.diam s := by
@@ -218,7 +218,7 @@ protected theorem comp {Kf Kg : ℝ≥0} {f : β → γ} {g : α → β} (hf : L
218218
(hg : LipschitzWith Kg g) : LipschitzWith (Kf * Kg) (f ∘ g) := fun x y =>
219219
calc
220220
edist (f (g x)) (f (g y)) ≤ Kf * edist (g x) (g y) := hf _ _
221-
_ ≤ Kf * (Kg * edist x y) := ENNReal.mul_left_mono (hg _ _)
221+
_ ≤ Kf * (Kg * edist x y) := mul_left_mono (hg _ _)
222222
_ = (Kf * Kg : ℝ≥0) * edist x y := by rw [← mul_assoc, ENNReal.coe_mul]
223223

224224
theorem comp_lipschitzOnWith {Kf Kg : ℝ≥0} {f : β → γ} {g : α → β} {s : Set α}
@@ -235,7 +235,7 @@ protected theorem prod_snd : LipschitzWith 1 (@Prod.snd α β) :=
235235
protected theorem prod {f : α → β} {Kf : ℝ≥0} (hf : LipschitzWith Kf f) {g : α → γ} {Kg : ℝ≥0}
236236
(hg : LipschitzWith Kg g) : LipschitzWith (max Kf Kg) fun x => (f x, g x) := by
237237
intro x y
238-
rw [ENNReal.coe_mono.map_max, Prod.edist_eq, ENNReal.max_mul]
238+
rw [ENNReal.coe_mono.map_max, Prod.edist_eq, max_mul]
239239
exact max_le_max (hf x y) (hg x y)
240240

241241
protected theorem prod_mk_left (a : α) : LipschitzWith 1 (Prod.mk a : β → α × β) := by
@@ -250,8 +250,8 @@ protected theorem uncurry {f : α → β → γ} {Kα Kβ : ℝ≥0} (hα : ∀
250250
simp only [Function.uncurry, ENNReal.coe_add, add_mul]
251251
apply le_trans (edist_triangle _ (f a₂ b₁) _)
252252
exact
253-
add_le_add (le_trans (hα _ _ _) <| ENNReal.mul_left_mono <| le_max_left _ _)
254-
(le_trans (hβ _ _ _) <| ENNReal.mul_left_mono <| le_max_right _ _)
253+
add_le_add (le_trans (hα _ _ _) <| mul_left_mono <| le_max_left _ _)
254+
(le_trans (hβ _ _ _) <| mul_left_mono <| le_max_right _ _)
255255

256256
/-- Iterates of a Lipschitz function are Lipschitz. -/
257257
protected theorem iterate {f : α → α} (hf : LipschitzWith K f) : ∀ n, LipschitzWith (K ^ n) f^[n]
@@ -299,7 +299,7 @@ protected theorem continuousOn (hf : LipschitzOnWith K f s) : ContinuousOn f s :
299299
theorem edist_le_mul_of_le (h : LipschitzOnWith K f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s)
300300
{r : ℝ≥0∞} (hr : edist x y ≤ r) :
301301
edist (f x) (f y) ≤ K * r :=
302-
(h hx hy).trans <| ENNReal.mul_left_mono hr
302+
(h hx hy).trans <| mul_left_mono hr
303303

304304
theorem edist_lt_of_edist_lt_div (hf : LipschitzOnWith K f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s)
305305
{d : ℝ≥0∞} (hd : edist x y < d / K) : edist (f x) (f y) < d :=
@@ -314,7 +314,7 @@ protected theorem comp {g : β → γ} {t : Set β} {Kg : ℝ≥0} (hg : Lipschi
314314
protected theorem prod {g : α → γ} {Kf Kg : ℝ≥0} (hf : LipschitzOnWith Kf f s)
315315
(hg : LipschitzOnWith Kg g s) : LipschitzOnWith (max Kf Kg) (fun x => (f x, g x)) s := by
316316
intro _ hx _ hy
317-
rw [ENNReal.coe_mono.map_max, Prod.edist_eq, ENNReal.max_mul]
317+
rw [ENNReal.coe_mono.map_max, Prod.edist_eq, max_mul]
318318
exact max_le_max (hf hx hy) (hg hx hy)
319319

320320
theorem ediam_image2_le (f : α → β → γ) {K₁ K₂ : ℝ≥0} (s : Set α) (t : Set β)
@@ -325,8 +325,8 @@ theorem ediam_image2_le (f : α → β → γ) {K₁ K₂ : ℝ≥0} (s : Set α
325325
refine (edist_triangle _ (f a₂ b₁) _).trans ?_
326326
exact
327327
add_le_add
328-
((hf₁ b₁ hb₁ ha₁ ha₂).trans <| ENNReal.mul_left_mono <| EMetric.edist_le_diam_of_mem ha₁ ha₂)
329-
((hf₂ a₂ ha₂ hb₁ hb₂).trans <| ENNReal.mul_left_mono <| EMetric.edist_le_diam_of_mem hb₁ hb₂)
328+
((hf₁ b₁ hb₁ ha₁ ha₂).trans <| mul_left_mono <| EMetric.edist_le_diam_of_mem ha₁ ha₂)
329+
((hf₂ a₂ ha₂ hb₁ hb₂).trans <| mul_left_mono <| EMetric.edist_le_diam_of_mem hb₁ hb₂)
330330

331331
end LipschitzOnWith
332332

0 commit comments

Comments
 (0)