Skip to content

Commit 1ec654b

Browse files
feat: add four lemmas on topological sums (#8325)
This adds four API lemmas that are useful for establishing Euler products: ```lean @[simp] lemma hasSum_unique [Unique β] (f : β → α) : HasSum f (f default) @[simp] lemma hasSum_singleton (m : β) (f : β → α) : HasSum (({m} : Set β).restrict f) (f m) lemma tsum_setElem_eq_tsum_setElem_diff [T2Space α] {f : β → α} (s t : Set β) (hf₀ : ∀ b ∈ t, f b = 0) : ∑' a : s, f a = ∑' a : (s \ t : Set β), f a lemma tsum_eq_tsum_diff_singleton {α β : Type*} [AddCommMonoid α] [TopologicalSpace α] [T2Space α] {f : β → α} (s : Set β) (b : β) (hf₀ : f b = 0) : ∑' a : s, f a = ∑' a : (s \ {b} : Set β), f a ```
1 parent 15ce6b6 commit 1ec654b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Mathlib/Topology/Algebra/InfiniteSum/Basic.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ theorem hasSum_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f
216216
hasSum_sum_of_ne_finset_zero <| by simpa [hf]
217217
#align has_sum_single hasSum_single
218218

219+
@[simp] lemma hasSum_unique [Unique β] (f : β → α) : HasSum f (f default) :=
220+
hasSum_single default (fun _ hb ↦ False.elim <| hb <| Unique.uniq ..)
221+
222+
@[simp] lemma hasSum_singleton (m : β) (f : β → α) : HasSum (({m} : Set β).restrict f) (f m) :=
223+
hasSum_unique (Set.restrict {m} f)
224+
219225
theorem hasSum_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
220226
HasSum (fun b' => if b' = b then a else 0) a := by
221227
convert @hasSum_single _ _ _ _ (fun b' => if b' = b then a else 0) b (fun b' hb' => if_neg hb')
@@ -641,6 +647,28 @@ theorem tsum_range {g : γ → β} (f : β → α) (hg : Injective g) :
641647
simp_rw [← comp_apply (g := g), tsum_univ (f ∘ g)]
642648
#align tsum_range tsum_range
643649

650+
open Set in
651+
/-- If `f b = 0` for all `b ∈ t`, then the sum over `f a` with `a ∈ s` is the same as the
652+
sum over `f a` with `a ∈ s ∖ t`. -/
653+
lemma tsum_setElem_eq_tsum_setElem_diff [T2Space α] {f : β → α} (s t : Set β)
654+
(hf₀ : ∀ b ∈ t, f b = 0) :
655+
∑' a : s, f a = ∑' a : (s \ t : Set β), f a := by
656+
simp_rw [_root_.tsum_subtype]
657+
refine tsum_congr fun b' ↦ ?_
658+
by_cases hs : b' ∈ s \ t
659+
· rw [indicator_of_mem hs f, indicator_of_mem (mem_of_mem_diff hs) f]
660+
· rw [indicator_of_not_mem hs f]
661+
rw [mem_diff, not_and, not_not_mem] at hs
662+
by_cases h₁ : b' ∈ s
663+
· simpa [indicator_of_mem h₁] using hf₀ b' <| hs h₁
664+
· exact indicator_of_not_mem h₁ f
665+
666+
/-- If `f b = 0`, then the sum over `f a` with `a ∈ s` is the same as the sum over `f a` for
667+
`a ∈ s ∖ {b}`. -/
668+
lemma tsum_eq_tsum_diff_singleton [T2Space α] {f : β → α} (s : Set β) {b : β} (hf₀ : f b = 0) :
669+
∑' a : s, f a = ∑' a : (s \ {b} : Set β), f a :=
670+
tsum_setElem_eq_tsum_setElem_diff s {b} fun _ ha ↦ ha ▸ hf₀
671+
644672
section ContinuousAdd
645673

646674
variable [ContinuousAdd α]

0 commit comments

Comments
 (0)