Skip to content

Commit 42277c6

Browse files
nomeataYaelDillies
andcommitted
feat(ENat): iSup_add (#15344)
From the Carleson project Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
1 parent a9daf40 commit 42277c6

File tree

12 files changed

+191
-19
lines changed

12 files changed

+191
-19
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,7 @@ import Mathlib.Data.ENNReal.Lemmas
22802280
import Mathlib.Data.ENNReal.Operations
22812281
import Mathlib.Data.ENNReal.Real
22822282
import Mathlib.Data.ENat.Basic
2283+
import Mathlib.Data.ENat.BigOperators
22832284
import Mathlib.Data.ENat.Lattice
22842285
import Mathlib.Data.Erased
22852286
import Mathlib.Data.FP.Basic

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,17 @@ protected theorem add_lt_add_of_lt_of_le [Preorder α] [AddLeftMono α]
227227
a + c < b + d :=
228228
(WithTop.add_lt_add_right hc hab).trans_le <| add_le_add_left hcd _
229229

230+
lemma addLECancellable_of_ne_top [Preorder α] [ContravariantClass α α (· + ·) (· ≤ ·)]
231+
(ha : a ≠ ⊤) : AddLECancellable a := fun _b _c ↦ WithTop.le_of_add_le_add_left ha
232+
233+
lemma addLECancellable_of_lt_top [Preorder α] [ContravariantClass α α (· + ·) (· ≤ ·)]
234+
(ha : a < ⊤) : AddLECancellable a := addLECancellable_of_ne_top ha.ne
235+
236+
lemma addLECancellable_iff_ne_top [Nonempty α] [Preorder α]
237+
[ContravariantClass α α (· + ·) (· ≤ ·)] : AddLECancellable a ↔ a ≠ ⊤ where
238+
mp := by rintro h rfl; exact (coe_lt_top <| Classical.arbitrary _).not_le <| h <| by simp
239+
mpr := addLECancellable_of_ne_top
240+
230241
-- There is no `WithTop.map_mul_of_mulHom`, since `WithTop` does not have a multiplication.
231242
@[simp]
232243
protected theorem map_add {F} [Add β] [FunLike F α β] [AddHomClass F α β]

Mathlib/Algebra/Order/Sub/WithTop.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ theorem sub_top {a : WithTop α} : a - ⊤ = (⊥ : α) := by cases a <;> rfl
5555
simp only [← coe_sub, coe_ne_top, sub_top, zero_ne_top, top_sub_coe, false_and, Ne,
5656
not_true_eq_false, not_false_eq_true, and_false, and_self]
5757

58+
lemma sub_ne_top_iff {a b : WithTop α} : a - b ≠ ⊤ ↔ a ≠ ⊤ ∨ b = ⊤ := by simp [or_iff_not_imp_left]
59+
5860
theorem map_sub [Sub β] [Bot β] {f : α → β} (h : ∀ x y, f (x - y) = f x - f y) (h₀ : f ⊥ = ⊥) :
5961
∀ x y : WithTop α, (x - y).map f = x.map f - y.map f
6062
| _, ⊤ => by simp only [sub_top, map_coe, h₀, map_top]

Mathlib/Data/ENNReal/Inv.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,10 @@ variable {ι κ : Sort*} {f g : ι → ℝ≥0∞} {s : Set ℝ≥0∞} {a : ℝ
626626

627627
@[simp] lemma iSup_eq_zero : ⨆ i, f i = 0 ↔ ∀ i, f i = 0 := iSup_eq_bot
628628

629-
@[simp] lemma iSup_zero_eq_zero : ⨆ _ : ι, (0 : ℝ≥0∞) = 0 := by simp
629+
@[simp] lemma iSup_zero : ⨆ _ : ι, (0 : ℝ≥0∞) = 0 := by simp
630+
631+
@[deprecated (since := "2024-10-22")]
632+
alias iSup_zero_eq_zero := iSup_zero
630633

631634
lemma iSup_natCast : ⨆ n : ℕ, (n : ℝ≥0∞) = ∞ :=
632635
(iSup_eq_top _).2 fun _b hb => ENNReal.exists_nat_gt (lt_top_iff_ne_top.1 hb)

Mathlib/Data/ENNReal/Operations.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ theorem sub_eq_sInf {a b : ℝ≥0∞} : a - b = sInf { d | a ≤ d + b } :=
308308
/-- This is a special case of `WithTop.sub_top` in the `ENNReal` namespace -/
309309
theorem sub_top : a - ∞ = 0 := WithTop.sub_top
310310

311-
-- Porting note: added `@[simp]`
312311
@[simp] theorem sub_eq_top_iff : a - b = ∞ ↔ a = ∞ ∧ b ≠ ∞ := WithTop.sub_eq_top_iff
312+
lemma sub_ne_top_iff : a - b ≠ ∞ ↔ a ≠ ∞ ∨ b = ∞ := WithTop.sub_ne_top_iff
313313

314314
-- This is unsafe because we could have `a = b = ∞`
315315
@[aesop (rule_sets := [finiteness]) unsafe 75% apply]

Mathlib/Data/ENat/Basic.lean

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury Kudryashov
55
-/
6-
import Mathlib.Data.Nat.SuccPred
76
import Mathlib.Algebra.CharZero.Lemmas
8-
import Mathlib.Algebra.Order.Sub.WithTop
97
import Mathlib.Algebra.Order.Ring.WithTop
8+
import Mathlib.Algebra.Order.Sub.WithTop
109
import Mathlib.Data.Nat.Cast.Order.Basic
10+
import Mathlib.Data.Nat.SuccPred
11+
import Mathlib.Order.Nat
1112

1213
/-!
1314
# Definition and basic properties of extended natural numbers
@@ -22,6 +23,13 @@ Lean 3, this difference was hidden in typeclass instances. Since these instances
2223
equal, we did not duplicate generic lemmas about `WithTop α` and `WithTop.some` coercion for `ENat`
2324
and `Nat.cast` coercion. If you need to apply a lemma about `WithTop`, you may either rewrite back
2425
and forth using `ENat.some_eq_coe`, or restate the lemma for `ENat`.
26+
27+
## TODO
28+
29+
Unify `ENat.add_iSup`/`ENat.iSup_add` with `ENNReal.add_iSup`/`ENNReal.iSup_add`. The key property
30+
of `ENat` and `ENNReal` we are using is that all `a` are either absorbing for addition (`a + b = a`
31+
for all `b`), or that it's order-cancellable (`a + b ≤ a + c → b ≤ c` for all `b`, `c`), and
32+
similarly for multiplication.
2533
-/
2634

2735
deriving instance Zero, CanonicallyOrderedCommSemiring, Nontrivial,
@@ -44,7 +52,7 @@ instance : SuccOrder ℕ∞ := inferInstanceAs (SuccOrder (WithTop ℕ))
4452
instance : WellFoundedLT ℕ∞ := inferInstanceAs (WellFoundedLT (WithTop ℕ))
4553
instance : CharZero ℕ∞ := inferInstanceAs (CharZero (WithTop ℕ))
4654

47-
variable {m n : ℕ∞}
55+
variable {a b c m n : ℕ∞}
4856

4957
/-- Lemmas about `WithTop` expect (and can output) `WithTop.some` but the normal form for coercion
5058
`ℕ → ℕ∞` is `Nat.cast`. -/
@@ -261,27 +269,44 @@ theorem nat_induction {P : ℕ∞ → Prop} (a : ℕ∞) (h0 : P 0) (hsuc : ∀
261269
· exact htop A
262270
· exact A _
263271

264-
lemma add_one_nat_le_withTop_of_lt {m : ℕ} {n : WithTop ℕ∞} (h : m < n) : (m + 1 : ℕ) ≤ n := by
272+
protected lemma exists_nat_gt {n : ℕ∞} (hn : n ≠ ⊤) : ∃ m : ℕ, n < m := by
273+
lift n to ℕ using hn
274+
obtain ⟨m, hm⟩ := exists_gt n
275+
exact ⟨m, Nat.cast_lt.2 hm⟩
276+
277+
@[simp] lemma sub_eq_top_iff : a - b = ⊤ ↔ a = ⊤ ∧ b ≠ ⊤ := WithTop.sub_eq_top_iff
278+
lemma sub_ne_top_iff : a - b ≠ ⊤ ↔ a ≠ ⊤ ∨ b = ⊤ := WithTop.sub_ne_top_iff
279+
280+
lemma addLECancellable_of_ne_top : a ≠ ⊤ → AddLECancellable a := WithTop.addLECancellable_of_ne_top
281+
lemma addLECancellable_of_lt_top : a < ⊤ → AddLECancellable a := WithTop.addLECancellable_of_lt_top
282+
283+
protected lemma le_sub_of_add_le_left (ha : a ≠ ⊤) : a + b ≤ c → b ≤ c - a :=
284+
(addLECancellable_of_ne_top ha).le_tsub_of_add_le_left
285+
286+
protected lemma sub_sub_cancel (h : a ≠ ⊤) (h2 : b ≤ a) : a - (a - b) = b :=
287+
(addLECancellable_of_ne_top <| ne_top_of_le_ne_top h tsub_le_self).tsub_tsub_cancel_of_le h2
288+
289+
lemma add_one_natCast_le_withTop_of_lt {m : ℕ} {n : WithTop ℕ∞} (h : m < n) : (m + 1 : ℕ) ≤ n := by
265290
match n with
266291
| ⊤ => exact le_top
267292
| (⊤ : ℕ∞) => exact WithTop.coe_le_coe.2 (OrderTop.le_top _)
268293
| (n : ℕ) => simpa only [Nat.cast_le, ge_iff_le, Nat.cast_lt] using h
269294

270295
@[simp] lemma coe_top_add_one : ((⊤ : ℕ∞) : WithTop ℕ∞) + 1 = (⊤ : ℕ∞) := rfl
271296

272-
@[simp] lemma add_one_eq_coe_top_iff (n : WithTop ℕ∞) :
273-
n + 1 = (⊤ : ℕ∞) ↔ n = (⊤ : ℕ∞) := by
297+
@[simp] lemma add_one_eq_coe_top_iff : n + 1 = (⊤ : ℕ∞) ↔ n = (⊤ : ℕ∞) := by
274298
match n with
275299
| ⊤ => exact Iff.rfl
276-
| (⊤ : ℕ∞) => exact Iff.rfl
277300
| (n : ℕ) => norm_cast; simp only [coe_ne_top, iff_false, ne_eq]
278301

279-
@[simp] lemma nat_ne_coe_top (n : ℕ) : (n : WithTop ℕ∞) ≠ (⊤ : ℕ∞) := ne_of_beq_false rfl
302+
@[simp] lemma natCast_ne_coe_top (n : ℕ) : (n : WithTop ℕ∞) ≠ (⊤ : ℕ∞) := nofun
303+
304+
@[deprecated (since := "2024-10-22")]
305+
alias nat_ne_coe_top := natCast_ne_coe_top
280306

281-
lemma one_le_iff_ne_zero_withTop {n : WithTop ℕ∞} :
282-
1 ≤ n ↔ n ≠ 0 :=
307+
lemma one_le_iff_ne_zero_withTop {n : WithTop ℕ∞} : 1 ≤ n ↔ n ≠ 0 :=
283308
fun h ↦ (zero_lt_one.trans_le h).ne',
284-
fun h ↦ add_one_nat_le_withTop_of_lt (pos_iff_ne_zero.mpr h)⟩
309+
fun h ↦ add_one_natCast_le_withTop_of_lt (pos_iff_ne_zero.mpr h)⟩
285310

286311
lemma add_one_pos : 0 < n + 1 :=
287312
succ_def n ▸ Order.bot_lt_succ n
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/-
2+
Copyright (c) 2024 Joachim Breitner, Yaël Dillies. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joachim Breitner, Yaël Dillies
5+
-/
6+
import Mathlib.Algebra.Order.BigOperators.Group.Finset
7+
import Mathlib.Data.ENat.Lattice
8+
9+
/-!
10+
# Sum of suprema in `ENat`
11+
-/
12+
13+
namespace ENat
14+
15+
lemma sum_iSup {α ι : Type*} {s : Finset α} {f : α → ι → ℕ∞}
16+
(hf : ∀ i j, ∃ k, ∀ a, f a i ≤ f a k ∧ f a j ≤ f a k) :
17+
∑ a ∈ s, ⨆ i, f a i = ⨆ i, ∑ a ∈ s, f a i := by
18+
induction' s using Finset.cons_induction with a s ha ihs
19+
· simp
20+
simp_rw [Finset.sum_cons, ihs]
21+
refine iSup_add_iSup fun i j ↦ (hf i j).imp fun k hk ↦ ?_
22+
gcongr
23+
exacts [(hk a).1, (hk _).2]
24+
25+
lemma sum_iSup_of_monotone {α ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {s : Finset α}
26+
{f : α → ι → ℕ∞} (hf : ∀ a, Monotone (f a)) : (∑ a ∈ s, iSup (f a)) = ⨆ n, ∑ a ∈ s, f a n :=
27+
sum_iSup fun i j ↦ (exists_ge_ge i j).imp fun _k ⟨hi, hj⟩ a ↦ ⟨hf a hi, hf a hj⟩
28+
29+
end ENat

Mathlib/Data/ENat/Lattice.lean

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ lemma sInf_eq_zero : sInf s = 0 ↔ 0 ∈ s := by
7474
lemma sSup_eq_zero' : sSup s = 0 ↔ s = ∅ ∨ s = {0} :=
7575
sSup_eq_bot'
7676

77-
lemma iSup_eq_zero : iSup f = 0 ↔ ∀ i, f i = 0 :=
78-
iSup_eq_bot
77+
@[simp] lemma iSup_eq_zero : iSup f = 0 ↔ ∀ i, f i = 0 := iSup_eq_bot
78+
@[simp] lemma iSup_zero : ⨆ _ : ι, (0 : ℕ∞) = 0 := by simp
7979

8080
lemma sSup_eq_top_of_infinite (h : s.Infinite) : sSup s = ⊤ := by
8181
apply (sSup_eq_top ..).mpr
@@ -109,4 +109,103 @@ lemma exists_eq_iSup₂_of_lt_top {ι₁ ι₂ : Type*} {f : ι₁ → ι₂ →
109109
rw [iSup_prod'] at h ⊢
110110
exact Prod.exists'.mp (exists_eq_iSup_of_lt_top h)
111111

112+
variable {ι κ : Sort*} {f g : ι → ℕ∞} {s : Set ℕ∞} {a : ℕ∞}
113+
114+
lemma iSup_natCast : ⨆ n : ℕ, (n : ℕ∞) = ⊤ :=
115+
(iSup_eq_top _).2 fun _b hb ↦ ENat.exists_nat_gt (lt_top_iff_ne_top.1 hb)
116+
117+
proof_wanted mul_iSup (a : ℕ∞) (f : ι → ℕ∞) : a * ⨆ i, f i = ⨆ i, a * f i
118+
proof_wanted iSup_mul (f : ι → ℕ∞) (a : ℕ∞) : (⨆ i, f i) * a = ⨆ i, f i * a
119+
proof_wanted mul_sSup : a * sSup s = ⨆ b ∈ s, a * b
120+
proof_wanted sSup_mul : sSup s * a = ⨆ b ∈ s, b * a
121+
122+
proof_wanted mul_iInf' (_h₀ : a = 0 → Nonempty ι) :
123+
a * ⨅ i, f i = ⨅ i, a * f i
124+
125+
proof_wanted iInf_mul' (_h₀ : a = 0 → Nonempty ι) : (⨅ i, f i) * a = ⨅ i, f i * a
126+
127+
/-- If `a ≠ 0` and `a ≠ ⊤`, then right multiplication by `a` maps infimum to infimum.
128+
See also `ENNReal.iInf_mul` that assumes `[Nonempty ι]` but does not require `a ≠ 0`. -/
129+
proof_wanted mul_iInf_of_ne (_ha₀ : a ≠ 0) (_ha : a ≠ ⊤) : a * ⨅ i, f i = ⨅ i, a * f i
130+
131+
/-- If `a ≠ 0` and `a ≠ ⊤`, then right multiplication by `a` maps infimum to infimum.
132+
See also `ENNReal.iInf_mul` that assumes `[Nonempty ι]` but does not require `a ≠ 0`. -/
133+
proof_wanted iInf_mul_of_ne (_ha₀ : a ≠ 0) (_ha : a ≠ ⊤) : (⨅ i, f i) * a = ⨅ i, f i * a
134+
135+
proof_wanted mul_iInf [Nonempty ι] : a * ⨅ i, f i = ⨅ i, a * f i
136+
proof_wanted iInf_mul [Nonempty ι] : (⨅ i, f i) * a = ⨅ i, f i * a
137+
138+
lemma add_iSup [Nonempty ι] (f : ι → ℕ∞) : a + ⨆ i, f i = ⨆ i, a + f i := by
139+
obtain rfl | ha := eq_or_ne a ⊤
140+
· simp
141+
refine le_antisymm ?_ <| iSup_le fun i ↦ add_le_add_left (le_iSup ..) _
142+
refine add_le_of_le_tsub_left_of_le (le_iSup_of_le (Classical.arbitrary _) le_self_add) ?_
143+
exact iSup_le fun i ↦ ENat.le_sub_of_add_le_left ha <| le_iSup (a + f ·) i
144+
145+
lemma iSup_add [Nonempty ι] (f : ι → ℕ∞) : (⨆ i, f i) + a = ⨆ i, f i + a := by
146+
simp [add_comm, add_iSup]
147+
148+
lemma add_biSup' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℕ∞) :
149+
a + ⨆ i, ⨆ _ : p i, f i = ⨆ i, ⨆ _ : p i, a + f i := by
150+
haveI : Nonempty {i // p i} := nonempty_subtype.2 h
151+
simp only [iSup_subtype', add_iSup]
152+
153+
lemma biSup_add' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℕ∞) :
154+
(⨆ i, ⨆ _ : p i, f i) + a = ⨆ i, ⨆ _ : p i, f i + a := by simp only [add_comm, add_biSup' h]
155+
156+
lemma add_biSup {ι : Type*} {s : Set ι} (hs : s.Nonempty) (f : ι → ℕ∞) :
157+
a + ⨆ i ∈ s, f i = ⨆ i ∈ s, a + f i := add_biSup' hs _
158+
159+
lemma biSup_add {ι : Type*} {s : Set ι} (hs : s.Nonempty) (f : ι → ℕ∞) :
160+
(⨆ i ∈ s, f i) + a = ⨆ i ∈ s, f i + a := biSup_add' hs _
161+
162+
lemma add_sSup (hs : s.Nonempty) : a + sSup s = ⨆ b ∈ s, a + b := by
163+
rw [sSup_eq_iSup, add_biSup hs]
164+
165+
lemma sSup_add (hs : s.Nonempty) : sSup s + a = ⨆ b ∈ s, b + a := by
166+
rw [sSup_eq_iSup, biSup_add hs]
167+
168+
lemma iSup_add_iSup_le [Nonempty ι] [Nonempty κ] {g : κ → ℕ∞} (h : ∀ i j, f i + g j ≤ a) :
169+
iSup f + iSup g ≤ a := by simp_rw [iSup_add, add_iSup]; exact iSup₂_le h
170+
171+
lemma biSup_add_biSup_le' {p : ι → Prop} {q : κ → Prop} (hp : ∃ i, p i) (hq : ∃ j, q j)
172+
{g : κ → ℕ∞} (h : ∀ i, p i → ∀ j, q j → f i + g j ≤ a) :
173+
(⨆ i, ⨆ _ : p i, f i) + ⨆ j, ⨆ _ : q j, g j ≤ a := by
174+
simp_rw [biSup_add' hp, add_biSup' hq]
175+
exact iSup₂_le fun i hi => iSup₂_le (h i hi)
176+
177+
lemma biSup_add_biSup_le {ι κ : Type*} {s : Set ι} {t : Set κ} (hs : s.Nonempty) (ht : t.Nonempty)
178+
{f : ι → ℕ∞} {g : κ → ℕ∞} {a : ℕ∞} (h : ∀ i ∈ s, ∀ j ∈ t, f i + g j ≤ a) :
179+
(⨆ i ∈ s, f i) + ⨆ j ∈ t, g j ≤ a := biSup_add_biSup_le' hs ht h
180+
181+
lemma iSup_add_iSup (h : ∀ i j, ∃ k, f i + g j ≤ f k + g k) : iSup f + iSup g = ⨆ i, f i + g i := by
182+
cases isEmpty_or_nonempty ι
183+
· simp only [iSup_of_empty, bot_eq_zero, zero_add]
184+
· refine le_antisymm ?_ (iSup_le fun a => add_le_add (le_iSup _ _) (le_iSup _ _))
185+
refine iSup_add_iSup_le fun i j => ?_
186+
rcases h i j with ⟨k, hk⟩
187+
exact le_iSup_of_le k hk
188+
189+
lemma iSup_add_iSup_of_monotone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → ℕ∞}
190+
(hf : Monotone f) (hg : Monotone g) : iSup f + iSup g = ⨆ a, f a + g a :=
191+
iSup_add_iSup fun i j ↦ (exists_ge_ge i j).imp fun _k ⟨hi, hj⟩ ↦ by gcongr <;> apply_rules
192+
193+
proof_wanted smul_iSup {R} [SMul R ℕ∞] [IsScalarTower R ℕ∞ ℕ∞] (f : ι → ℕ∞) (c : R) :
194+
c • ⨆ i, f i = ⨆ i, c • f i
195+
196+
proof_wanted smul_sSup {R} [SMul R ℕ∞] [IsScalarTower R ℕ∞ ℕ∞] (s : Set ℕ∞) (c : R) :
197+
c • sSup s = ⨆ a ∈ s, c • a
198+
199+
lemma sub_iSup [Nonempty ι] (ha : a ≠ ⊤) : a - ⨆ i, f i = ⨅ i, a - f i := by
200+
obtain ⟨i, hi⟩ | h := em (∃ i, a < f i)
201+
· rw [tsub_eq_zero_iff_le.2 <| le_iSup_of_le _ hi.le, (iInf_eq_bot _).2, bot_eq_zero]
202+
exact fun x hx ↦ ⟨i, by simpa [hi.le, tsub_eq_zero_of_le]⟩
203+
simp_rw [not_exists, not_lt] at h
204+
refine le_antisymm (le_iInf fun i ↦ tsub_le_tsub_left (le_iSup ..) _) <|
205+
ENat.le_sub_of_add_le_left (ne_top_of_le_ne_top ha <| iSup_le h) <|
206+
add_le_of_le_tsub_right_of_le (iInf_le_of_le (Classical.arbitrary _) tsub_le_self) <|
207+
iSup_le fun i ↦ ?_
208+
rw [← ENat.sub_sub_cancel ha (h _)]
209+
exact tsub_le_tsub_left (iInf_le (a - f ·) i) _
210+
112211
end ENat

Mathlib/MeasureTheory/Measure/MeasureSpace.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ theorem measure_eq_top_iff_of_symmDiff (hμst : μ (s ∆ t) ≠ ∞) : μ s =
233233
apply hμuv
234234
rw [Set.symmDiff_def, eq_top_iff]
235235
calc
236-
∞ = μ u - μ v := (WithTop.sub_eq_top_iff.2 ⟨hμu, hμv⟩).symm
236+
∞ = μ u - μ v := by rw [ENNReal.sub_eq_top_iff.2 ⟨hμu, hμv⟩]
237237
_ ≤ μ (u \ v) := le_measure_diff
238238
_ ≤ μ (u \ v ∪ v \ u) := measure_mono subset_union_left
239239

Mathlib/Topology/Instances/ENat.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ instance : ContinuousMul ℕ∞ where
9191
protected theorem continuousAt_sub {a b : ℕ∞} (h : a ≠ ⊤ ∨ b ≠ ⊤) :
9292
ContinuousAt (· - ·).uncurry (a, b) := by
9393
match a, b, h with
94-
| (a : ℕ), (b : ℕ), _ =>
95-
simpa [ContinuousAt, nhds_prod_eq] using tendsto_pure_nhds _ _
94+
| (a : ℕ), (b : ℕ), _ => simp [ContinuousAt, nhds_prod_eq]
9695
| (a : ℕ), ⊤, _ =>
9796
suffices ∀ᶠ b in 𝓝 ⊤, (a - b : ℕ∞) = 0 by
9897
simpa [ContinuousAt, nhds_prod_eq, tsub_eq_zero_of_le]

0 commit comments

Comments
 (0)