l3lab/ntp-mathlib huggingface dataset:
theorem HasSum.sigma [RegularSpace α] {γ : β → Type*} {f : (Σ b : β, γ b) → α} {g : β → α} {a : α}
    (ha : HasSum f a) (hf : ∀ b, HasSum (fun c => f ⟨b, c⟩) (g b)) : HasSum g a := by
  classical
  refine' (atTop_basis.tendsto_iff (closed_nhds_basis a)).mpr _
  rintro s ⟨hs, hsc⟩
  rcases mem_atTop_sets.mp (ha hs) with ⟨u, hu⟩
  use u.image Sigma.fst, trivial
  intro bs hbs
  simp only [Set.mem_preimage, ge_iff_le, Finset.le_iff_subset] at hu
  have : Tendsto (fun t : Finset (Σb, γ b) => ∑ p in t.filter fun p => p.1 ∈ bs, f p) atTop
      (𝓝 <| ∑ b in bs, g b) := by
    simp only [← sigma_preimage_mk, sum_sigma]
    refine' tendsto_finset_sum _ fun b _ => _
    change
      Tendsto (fun t => (fun t => ∑ s in t, f ⟨b, s⟩) (preimage t (Sigma.mk b) _)) atTop (𝓝 (g b))
    exact (hf b).comp (tendsto_finset_preimage_atTop_atTop (sigma_mk_injective))
  refine' hsc.mem_of_tendsto this (eventually_atTop.2 ⟨u, fun t ht => hu _ fun x hx => _⟩)
  

Proof state:
case right
α : Type u_1
β : Type u_2
γ✝ : Type u_3
δ : Type u_4
inst✝³ : AddCommMonoid α
inst✝² : TopologicalSpace α
f✝ g✝ : β → α
a✝ b : α
s✝ : Finset β
inst✝¹ : ContinuousAdd α
inst✝ : RegularSpace α
γ : β → Type u_5
f : (b : β) × γ b → α
g : β → α
a : α
ha : HasSum f a
hf : ∀ (b : β), HasSum (fun c => f { fst := b, snd := c }) (g b)
s : Set α
hs : s ∈ 𝓝 a
hsc : IsClosed s
u : Finset ((b : β) × γ b)
bs : Finset β
hbs : bs ∈ Set.Ici (image Sigma.fst u)
hu : ∀ (b : Finset ((b : β) × γ b)), u ⊆ b → ∑ b in b, f b ∈ s
this : Tendsto (fun t => ∑ p in filter (fun p => p.fst ∈ bs) t, f p) atTop (𝓝 (∑ b in bs, g b))
t : Finset ((b : β) × γ b)
ht : t ≥ u
x : (b : β) × γ b
hx : x ∈ u
⊢ x ∈ filter (fun p => p.fst ∈ bs) t

Next tactic:
exact mem_filter.2 ⟨ht hx, hbs <| mem_image_of_mem _ hx⟩
theorem HasSum.sigma_of_hasSum [T3Space α] {γ : β → Type*} {f : (Σb : β, γ b) → α} {g : β → α}
    {a : α} (ha : HasSum g a) (hf : ∀ b, HasSum (fun c => f ⟨b, c⟩) (g b)) (hf' : Summable f) :
    HasSum f a := by 

Proof state:
α : Type u_1
β : Type u_2
γ✝ : Type u_3
δ : Type u_4
inst✝³ : AddCommMonoid α
inst✝² : TopologicalSpace α
f✝ g✝ : β → α
a✝ b : α
s : Finset β
inst✝¹ : ContinuousAdd α
inst✝ : T3Space α
γ : β → Type u_5
f : (b : β) × γ b → α
g : β → α
a : α
ha : HasSum g a
hf : ∀ (b : β), HasSum (fun c => f { fst := b, snd := c }) (g b)
hf' : Summable f
⊢ HasSum f a

Next tactic:
simpa [(hf'.hasSum.sigma hf).unique ha] using hf'.hasSum
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
⊢ a + x = a' + f b

Next tactic:
have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
    · simp only [Function.update_apply, hb', if_false]
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
⊢ ∀ (b' : β), (f b' + if b' = b then x else 0) = update f b x b' + if b' = b then f b else 0

Next tactic:
intro b'
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
b' : β
⊢ (f b' + if b' = b then x else 0) = update f b x b' + if b' = b then f b else 0

Next tactic:
split_ifs with hb'
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · 

Proof state:
case pos
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
b' : β
hb' : b' = b
⊢ f b' + x = update f b x b' + f b

Next tactic:
simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
    · 

Proof state:
case neg
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
b' : β
hb' : ¬b' = b
⊢ f b' + 0 = update f b x b' + 0

Next tactic:
simp only [Function.update_apply, hb', if_false]
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
    · simp only [Function.update_apply, hb', if_false]
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
this : ∀ (b' : β), (f b' + if b' = b then x else 0) = update f b x b' + if b' = b then f b else 0
⊢ a + x = a' + f b

Next tactic:
have h := hf.add (hasSum_ite_eq b x)
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
    · simp only [Function.update_apply, hb', if_false]
  have h := hf.add (hasSum_ite_eq b x)
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
this : ∀ (b' : β), (f b' + if b' = b then x else 0) = update f b x b' + if b' = b then f b else 0
h : HasSum (fun b_1 => f b_1 + if b_1 = b then x else 0) (a + x)
⊢ a + x = a' + f b

Next tactic:
simp_rw [this] at h
/-- Version of `HasSum.update` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that `f.update` has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `f.update` given that both exist. -/
theorem HasSum.update' {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a a' : α} (hf : HasSum f a) (b : β) (x : α)
    (hf' : HasSum (update f b x) a') : a + x = a' + f b := by
  have : ∀ b', f b' + ite (b' = b) x 0 = update f b x b' + ite (b' = b) (f b) 0 := by
    intro b'
    split_ifs with hb'
    · simpa only [Function.update_apply, hb', eq_self_iff_true] using add_comm (f b) x
    · simp only [Function.update_apply, hb', if_false]
  have h := hf.add (hasSum_ite_eq b x)
  simp_rw [this] at h
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a a' : α
hf : HasSum f a
b : β
x : α
hf' : HasSum (update f b x) a'
this : ∀ (b' : β), (f b' + if b' = b then x else 0) = update f b x b' + if b' = b then f b else 0
h : HasSum (fun b_1 => update f b x b_1 + if b_1 = b then f b else 0) (a + x)
⊢ a + x = a' + f b

Next tactic:
exact HasSum.unique h (hf'.add (hasSum_ite_eq b (f b)))
/-- Version of `hasSum_ite_sub_hasSum` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that the `ite` expression has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `ite (n = b) 0 (f n)` given that both exist. -/
theorem eq_add_of_hasSum_ite {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a : α} (hf : HasSum f a) (b : β) (a' : α)
    (hf' : HasSum (fun n => ite (n = b) 0 (f n)) a') : a = a' + f b := by
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a : α
hf : HasSum f a
b : β
a' : α
hf' : HasSum (fun n => if n = b then 0 else f n) a'
⊢ a = a' + f b

Next tactic:
refine' (add_zero a).symm.trans (hf.update' b 0 _)
/-- Version of `hasSum_ite_sub_hasSum` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that the `ite` expression has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `ite (n = b) 0 (f n)` given that both exist. -/
theorem eq_add_of_hasSum_ite {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a : α} (hf : HasSum f a) (b : β) (a' : α)
    (hf' : HasSum (fun n => ite (n = b) 0 (f n)) a') : a = a' + f b := by
  refine' (add_zero a).symm.trans (hf.update' b 0 _)
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a : α
hf : HasSum f a
b : β
a' : α
hf' : HasSum (fun n => if n = b then 0 else f n) a'
⊢ HasSum (update f b 0) a'

Next tactic:
convert hf'
/-- Version of `hasSum_ite_sub_hasSum` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that the `ite` expression has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `ite (n = b) 0 (f n)` given that both exist. -/
theorem eq_add_of_hasSum_ite {α β : Type*} [TopologicalSpace α] [AddCommMonoid α] [T2Space α]
    [ContinuousAdd α] [DecidableEq β] {f : β → α} {a : α} (hf : HasSum f a) (b : β) (a' : α)
    (hf' : HasSum (fun n => ite (n = b) 0 (f n)) a') : a = a' + f b := by
  refine' (add_zero a).symm.trans (hf.update' b 0 _)
  convert hf'
  

Proof state:
case h.e'_5.h
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁷ : AddCommMonoid α✝
inst✝⁶ : TopologicalSpace α✝
f✝ g : β✝ → α✝
a✝ b✝ : α✝
s : Finset β✝
inst✝⁵ : ContinuousAdd α✝
α : Type u_5
β : Type u_6
inst✝⁴ : TopologicalSpace α
inst✝³ : AddCommMonoid α
inst✝² : T2Space α
inst✝¹ : ContinuousAdd α
inst✝ : DecidableEq β
f : β → α
a : α
hf : HasSum f a
b : β
a' : α
hf' : HasSum (fun n => if n = b then 0 else f n) a'
x✝ : β
⊢ update f b 0 x✝ = if x✝ = b then 0 else f x✝

Next tactic:
apply update_apply
theorem tsum_congr_set_coe (f : β → α) {s t : Set β} (h : s = t) :
    ∑' x : s, f x = ∑' x : t, f x := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
f : β → α
s t : Set β
h : s = t
⊢ ∑' (x : ↑s), f ↑x = ∑' (x : ↑t), f ↑x

Next tactic:
rw [h]
theorem tsum_eq_finsum (hf : (support f).Finite) :
    ∑' b, f b = ∑ᶠ b, f b := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
hf : Set.Finite (support f)
⊢ ∑' (b : β), f b = ∑ᶠ (b : β), f b

Next tactic:
simp [tsum_def, summable_of_finite_support hf, hf]
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
⊢ ∑' (b : β), f b = ∑ b in s, f b

Next tactic:
have I : support f ⊆ s := by
    intros x hx
    contrapose! hx
    rw [nmem_support]
    exact hf _ hx
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
⊢ support f ⊆ ↑s

Next tactic:
intros x hx
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    intros x hx
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
x : β
hx : x ∈ support f
⊢ x ∈ ↑s

Next tactic:
contrapose! hx
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    intros x hx
    contrapose! hx
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
x : β
hx : x ∉ ↑s
⊢ x ∉ support f

Next tactic:
rw [nmem_support]
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    intros x hx
    contrapose! hx
    rw [nmem_support]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
x : β
hx : x ∉ ↑s
⊢ f x = 0

Next tactic:
exact hf _ hx
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    intros x hx
    contrapose! hx
    rw [nmem_support]
    exact hf _ hx
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
I : support f ⊆ ↑s
⊢ ∑' (b : β), f b = ∑ b in s, f b

Next tactic:
simp only [tsum_def, summable_of_ne_finset_zero hf, Set.Finite.subset (finite_toSet s) I,
     ite_true, dite_eq_ite]
theorem tsum_eq_sum {s : Finset β} (hf : ∀ (b) (_ : b ∉ s), f b = 0) :
    ∑' b, f b = ∑ b in s, f b := by
  have I : support f ⊆ s := by
    intros x hx
    contrapose! hx
    rw [nmem_support]
    exact hf _ hx
  simp only [tsum_def, summable_of_ne_finset_zero hf, Set.Finite.subset (finite_toSet s) I,
     ite_true, dite_eq_ite]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
s : Finset β
hf : ∀ b ∉ s, f b = 0
I : support f ⊆ ↑s
⊢ ∑ᶠ (b : β), f b = ∑ b in s, f b

Next tactic:
exact finsum_eq_sum_of_support_subset f I
@[simp]
theorem tsum_zero : ∑' _ : β, (0 : α) = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
⊢ ∑' (x : β), 0 = 0

Next tactic:
rw [tsum_eq_finsum]
@[simp]
theorem tsum_zero : ∑' _ : β, (0 : α) = 0 := by rw [tsum_eq_finsum] <;> 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
⊢ ∑ᶠ (b : β), 0 = 0

Next tactic:
simp
@[simp]
theorem tsum_zero : ∑' _ : β, (0 : α) = 0 := by rw [tsum_eq_finsum] <;> 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
⊢ Set.Finite (support fun x => 0)

Next tactic:
simp
@[simp]
theorem tsum_empty [IsEmpty β] : ∑' b, f b = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
inst✝ : IsEmpty β
⊢ ∑' (b : β), f b = 0

Next tactic:
rw [tsum_eq_sum (s := (∅ : Finset β))]
@[simp]
theorem tsum_empty [IsEmpty β] : ∑' b, f b = 0 := by
  rw [tsum_eq_sum (s := (∅ : Finset β))] <;> 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
inst✝ : IsEmpty β
⊢ ∑ b in ∅, f b = 0

Next tactic:
simp
@[simp]
theorem tsum_empty [IsEmpty β] : ∑' b, f b = 0 := by
  rw [tsum_eq_sum (s := (∅ : Finset β))] <;> 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a a₁ a₂ : α
inst✝ : IsEmpty β
⊢ ∀ b ∉ ∅, f b = 0

Next tactic:
simp
theorem tsum_fintype [Fintype β] (f : β → α) : ∑' b, f b = ∑ b, f b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
inst✝ : Fintype β
f : β → α
⊢ ∑' (b : β), f b = ∑ b : β, f b

Next tactic:
apply tsum_eq_sum
theorem tsum_fintype [Fintype β] (f : β → α) : ∑' b, f b = ∑ b, f b := by
  apply tsum_eq_sum; 

Proof state:
case hf
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
inst✝ : Fintype β
f : β → α
⊢ ∀ b ∉ univ, f b = 0

Next tactic:
simp
theorem tsum_bool (f : Bool → α) : ∑' i : Bool, f i = f false + f true := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
f : Bool → α
⊢ ∑' (i : Bool), f i = f false + f true

Next tactic:
rw [tsum_fintype, Fintype.sum_bool, add_comm]
theorem tsum_eq_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 0) :
    ∑' b, f b = f b := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
f : β → α
b : β
hf : ∀ (b' : β), b' ≠ b → f b' = 0
⊢ ∑' (b : β), f b = f b

Next tactic:
rw [tsum_eq_sum (s := {b}), sum_singleton]
theorem tsum_eq_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 0) :
    ∑' b, f b = f b := by
  rw [tsum_eq_sum (s := {b}), sum_singleton]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
f : β → α
b : β
hf : ∀ (b' : β), b' ≠ b → f b' = 0
⊢ ∀ b_1 ∉ {b}, f b_1 = 0

Next tactic:
exact fun b' hb' ↦ hf b' (by simpa using hb')
theorem tsum_eq_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 0) :
    ∑' b, f b = f b := by
  rw [tsum_eq_sum (s := {b}), sum_singleton]
  exact fun b' hb' ↦ hf b' (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a a₁ a₂ : α
f : β → α
b : β
hf : ∀ (b' : β), b' ≠ b → f b' = 0
b' : β
hb' : b' ∉ {b}
⊢ b' ≠ b

Next tactic:
simpa using hb'
@[simp]
theorem tsum_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    ∑' b', (if b' = b then a else 0) = a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a✝ a₁ a₂ : α
b : β
inst✝ : DecidablePred fun x => x = b
a : α
⊢ (∑' (b' : β), if b' = b then a else 0) = a

Next tactic:
rw [tsum_eq_single b]
@[simp]
theorem tsum_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    ∑' b', (if b' = b then a else 0) = a := by
  rw [tsum_eq_single b]
  · 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a✝ a₁ a₂ : α
b : β
inst✝ : DecidablePred fun x => x = b
a : α
⊢ (if b = b then a else 0) = a

Next tactic:
simp