Skip to content

Commit d88a041

Browse files
j-loreauxurkud
andcommitted
feat: port Topology.Instances.ENNReal (#2734)
API changes: * Add `HasSum.sum_range_add`, `sum_add_tsum_nat_add'`, and `tsum_eq_zero_add'`. We had these (or stronger) results for topological groups. These versions works for monoids. * Rename `tendsto_atTop_csupr` to `tendsto_atTop_csupᵢ`, `tendsto_atBot_csupr` to `tendsto_atBot_csupᵢ`, `tendsto_atBot_cinfi` to `tendsto_atBot_cinfᵢ`, and `tendsto_atTop_cinfi` to `tendsto_atTop_cinfᵢ`. * Add a shortcut instance for `T5Space ENNReal`. * Add `ENNReal.nhdsWithin_Ioi_one_neBot`, `ENNReal.nhdsWithin_Ioi_nat_neBot`, `ENNReal.nhdsWithin_Ioi_ofNat_nebot`, and `ENNReal.nhdsWithin_Iio_neBot`. * Add `ENNReal.hasBasis_nhds_of_ne_top` and `ENNReal.hasBasis_nhds_of_ne_top'`. * Add `ENNReal.binfᵢ_le_nhds` and `ENNReal.tendsto_nhds_of_Icc`. * Use `Real.nnabs` instead of `nnnorm` to avoid dependency on `analysis.normed.group.basic` (forward-port of leanprover-community/mathlib3#18562). * Add `ENNReal.tsum_eq_limsup_sum_nat`. * Add `ENNReal.tsum_comp_le_tsum_of_injective`, `ENNReal.tsum_le_tsum_comp_of_surjective`, use them to golf some proofs. * Add `ENNReal.tsum_bunionᵢ_le_tsum`, `ENNReal.tsum_unionᵢ_le_tsum`. We had versions of these lemmas for finite collections. The proofs for infinite collections are simpler. Most of these changes were done to fix some long proofs: it was easier for me (@urkud) to add supporting lemmas and golf the proof than to fix the original code. Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Yury Kudryashov <urkud@urkud.name>
1 parent 703e6b7 commit d88a041

File tree

5 files changed

+1619
-30
lines changed

5 files changed

+1619
-30
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,7 @@ import Mathlib.Topology.GDelta
13731373
import Mathlib.Topology.Hom.Open
13741374
import Mathlib.Topology.Homeomorph
13751375
import Mathlib.Topology.Inseparable
1376+
import Mathlib.Topology.Instances.ENNReal
13761377
import Mathlib.Topology.Instances.Int
13771378
import Mathlib.Topology.Instances.NNReal
13781379
import Mathlib.Topology.Instances.Nat

Mathlib/Topology/Algebra/InfiniteSum/Basic.lean

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,6 @@ We show the formula `(∑ i in range k, f i) + (∑' i, f (i + k)) = (∑' i, f
946946
`sum_add_tsum_nat_add`, as well as several results relating sums on `ℕ` and `ℤ`.
947947
-/
948948

949-
950949
section Nat
951950

952951
theorem hasSum_nat_add_iff {f : ℕ → α} (k : ℕ) {a : α} :
@@ -967,16 +966,31 @@ theorem hasSum_nat_add_iff' {f : ℕ → α} (k : ℕ) {a : α} :
967966
simp [hasSum_nat_add_iff]
968967
#align has_sum_nat_add_iff' hasSum_nat_add_iff'
969968

969+
theorem HasSum.sum_range_add [AddCommMonoid M] [TopologicalSpace M] [ContinuousAdd M] {f : ℕ → M}
970+
{k : ℕ} {a : M} (h : HasSum (fun n ↦ f (n + k)) a) : HasSum f ((∑ i in range k, f i) + a) := by
971+
refine ((range k).hasSum f).add_compl ?_
972+
rwa [← (notMemRangeEquiv k).symm.hasSum_iff]
973+
974+
theorem sum_add_tsum_nat_add' [AddCommMonoid M] [TopologicalSpace M] [ContinuousAdd M] [T2Space M]
975+
{f : ℕ → M} {k : ℕ} (h : Summable (fun n => f (n + k))) :
976+
((∑ i in range k, f i) + ∑' i, f (i + k)) = ∑' i, f i :=
977+
h.hasSum.sum_range_add.tsum_eq.symm
978+
970979
theorem sum_add_tsum_nat_add [T2Space α] {f : ℕ → α} (k : ℕ) (h : Summable f) :
971-
((∑ i in range k, f i) + ∑' i, f (i + k)) = ∑' i, f i := by
972-
simpa only [add_comm] using
973-
((hasSum_nat_add_iff k).1 ((summable_nat_add_iff k).2 h).hasSum).unique h.hasSum
980+
((∑ i in range k, f i) + ∑' i, f (i + k)) = ∑' i, f i :=
981+
sum_add_tsum_nat_add' <| (summable_nat_add_iff k).2 h
974982
#align sum_add_tsum_nat_add sum_add_tsum_nat_add
975983

976-
theorem tsum_eq_zero_add [T2Space α] {f : ℕ → α} (hf : Summable f) :
984+
theorem tsum_eq_zero_add' [AddCommMonoid M] [TopologicalSpace M] [ContinuousAdd M] [T2Space M]
985+
{f : ℕ → M} (hf : Summable (fun n => f (n + 1))) :
977986
(∑' b, f b) = f 0 + ∑' b, f (b + 1) := by
978-
simpa only [sum_range_one] using (sum_add_tsum_nat_add 1 hf).symm
987+
simpa only [sum_range_one] using (sum_add_tsum_nat_add' hf).symm
988+
989+
theorem tsum_eq_zero_add [T2Space α] {f : ℕ → α} (hf : Summable f) :
990+
(∑' b, f b) = f 0 + ∑' b, f (b + 1) :=
991+
tsum_eq_zero_add' <| (summable_nat_add_iff 1).2 hf
979992
#align tsum_eq_zero_add tsum_eq_zero_add
993+
980994
/-- For `f : ℕ → α`, then `∑' k, f (k + i)` tends to zero. This does not require a summability
981995
assumption on `f`, as otherwise all sums are zero. -/
982996
theorem tendsto_sum_nat_add [T2Space α] (f : ℕ → α) :

Mathlib/Topology/Algebra/Order/MonotoneConvergence.lean

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,46 +122,46 @@ theorem tendsto_atTop_isGLB (h_anti : Antitone f) (ha : IsGLB (Set.range f) a) :
122122

123123
end IsGLB
124124

125-
section Csupr
125+
section Csupᵢ
126126

127127
variable [ConditionallyCompleteLattice α] [SupConvergenceClass α] {f : ι → α} {a : α}
128128

129-
theorem tendsto_atTop_csupr (h_mono : Monotone f) (hbdd : BddAbove <| range f) :
129+
theorem tendsto_atTop_csupᵢ (h_mono : Monotone f) (hbdd : BddAbove <| range f) :
130130
Tendsto f atTop (𝓝 (⨆ i, f i)) := by
131131
cases isEmpty_or_nonempty ι
132132
exacts[tendsto_of_isEmpty, tendsto_atTop_isLUB h_mono (isLUB_csupᵢ hbdd)]
133-
#align tendsto_at_top_csupr tendsto_atTop_csupr
133+
#align tendsto_at_top_csupr tendsto_atTop_csupᵢ
134134

135-
theorem tendsto_atBot_csupr (h_anti : Antitone f) (hbdd : BddAbove <| range f) :
136-
Tendsto f atBot (𝓝 (⨆ i, f i)) := by convert tendsto_atTop_csupr h_anti.dual hbdd.dual
137-
#align tendsto_at_bot_csupr tendsto_atBot_csupr
135+
theorem tendsto_atBot_csupᵢ (h_anti : Antitone f) (hbdd : BddAbove <| range f) :
136+
Tendsto f atBot (𝓝 (⨆ i, f i)) := by convert tendsto_atTop_csupᵢ h_anti.dual hbdd.dual
137+
#align tendsto_at_bot_csupr tendsto_atBot_csupᵢ
138138

139-
end Csupr
139+
end Csupᵢ
140140

141-
section Cinfi
141+
section Cinfᵢ
142142

143143
variable [ConditionallyCompleteLattice α] [InfConvergenceClass α] {f : ι → α} {a : α}
144144

145-
theorem tendsto_atBot_cinfi (h_mono : Monotone f) (hbdd : BddBelow <| range f) :
146-
Tendsto f atBot (𝓝 (⨅ i, f i)) := by convert tendsto_atTop_csupr h_mono.dual hbdd.dual
147-
#align tendsto_at_bot_cinfi tendsto_atBot_cinfi
145+
theorem tendsto_atBot_cinfᵢ (h_mono : Monotone f) (hbdd : BddBelow <| range f) :
146+
Tendsto f atBot (𝓝 (⨅ i, f i)) := by convert tendsto_atTop_csupᵢ h_mono.dual hbdd.dual
147+
#align tendsto_at_bot_cinfi tendsto_atBot_cinfᵢ
148148

149-
theorem tendsto_atTop_cinfi (h_anti : Antitone f) (hbdd : BddBelow <| range f) :
150-
Tendsto f atTop (𝓝 (⨅ i, f i)) := by convert tendsto_atBot_csupr h_anti.dual hbdd.dual
151-
#align tendsto_at_top_cinfi tendsto_atTop_cinfi
149+
theorem tendsto_atTop_cinfᵢ (h_anti : Antitone f) (hbdd : BddBelow <| range f) :
150+
Tendsto f atTop (𝓝 (⨅ i, f i)) := by convert tendsto_atBot_csupᵢ h_anti.dual hbdd.dual
151+
#align tendsto_at_top_cinfi tendsto_atTop_cinfᵢ
152152

153-
end Cinfi
153+
end Cinfᵢ
154154

155155
section supᵢ
156156

157157
variable [CompleteLattice α] [SupConvergenceClass α] {f : ι → α} {a : α}
158158

159159
theorem tendsto_atTop_supᵢ (h_mono : Monotone f) : Tendsto f atTop (𝓝 (⨆ i, f i)) :=
160-
tendsto_atTop_csupr h_mono (OrderTop.bddAbove _)
160+
tendsto_atTop_csupᵢ h_mono (OrderTop.bddAbove _)
161161
#align tendsto_at_top_supr tendsto_atTop_supᵢ
162162

163163
theorem tendsto_atBot_supᵢ (h_anti : Antitone f) : Tendsto f atBot (𝓝 (⨆ i, f i)) :=
164-
tendsto_atBot_csupr h_anti (OrderTop.bddAbove _)
164+
tendsto_atBot_csupᵢ h_anti (OrderTop.bddAbove _)
165165
#align tendsto_at_bot_supr tendsto_atBot_supᵢ
166166

167167
end supᵢ
@@ -171,11 +171,11 @@ section infᵢ
171171
variable [CompleteLattice α] [InfConvergenceClass α] {f : ι → α} {a : α}
172172

173173
theorem tendsto_atBot_infᵢ (h_mono : Monotone f) : Tendsto f atBot (𝓝 (⨅ i, f i)) :=
174-
tendsto_atBot_cinfi h_mono (OrderBot.bddBelow _)
174+
tendsto_atBot_cinfᵢ h_mono (OrderBot.bddBelow _)
175175
#align tendsto_at_bot_infi tendsto_atBot_infᵢ
176176

177177
theorem tendsto_atTop_infᵢ (h_anti : Antitone f) : Tendsto f atTop (𝓝 (⨅ i, f i)) :=
178-
tendsto_atTop_cinfi h_anti (OrderBot.bddBelow _)
178+
tendsto_atTop_cinfᵢ h_anti (OrderBot.bddBelow _)
179179
#align tendsto_at_top_infi tendsto_atTop_infᵢ
180180

181181
end infᵢ
@@ -225,7 +225,7 @@ instance Pi.Inf_convergence_class' {ι : Type _} [Preorder α] [TopologicalSpace
225225
theorem tendsto_of_monotone {ι α : Type _} [Preorder ι] [TopologicalSpace α]
226226
[ConditionallyCompleteLinearOrder α] [OrderTopology α] {f : ι → α} (h_mono : Monotone f) :
227227
Tendsto f atTop atTop ∨ ∃ l, Tendsto f atTop (𝓝 l) :=
228-
if H : BddAbove (range f) then Or.inr ⟨_, tendsto_atTop_csupr h_mono H⟩
228+
if H : BddAbove (range f) then Or.inr ⟨_, tendsto_atTop_csupᵢ h_mono H⟩
229229
else Or.inl <| tendsto_atTop_atTop_of_monotone' h_mono H
230230
#align tendsto_of_monotone tendsto_of_monotone
231231

0 commit comments

Comments
 (0)