l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem toOuterMeasure_ofMultiset_apply :
    (ofMultiset s hs).toOuterMeasure t =
      (∑' x, (s.filter (· ∈ t)).count x : ℝ≥0∞) / (Multiset.card s) := by
  simp_rw [div_eq_mul_inv, ← ENNReal.tsum_mul_right, toOuterMeasure_apply]
  refine' tsum_congr fun x => _
  by_cases hx : x ∈ t <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
s : Multiset α
hs : s ≠ 0
t : Set α
x : α
hx : x ∈ t
⊢ Set.indicator t (⇑(ofMultiset s hs)) x =
    ↑(Multiset.count x (Multiset.filter (fun x => x ∈ t) s)) * (↑(Multiset.card s))⁻¹

Next tactic:
simp [Set.indicator, hx, div_eq_mul_inv]
@[simp]
theorem toOuterMeasure_ofMultiset_apply :
    (ofMultiset s hs).toOuterMeasure t =
      (∑' x, (s.filter (· ∈ t)).count x : ℝ≥0∞) / (Multiset.card s) := by
  simp_rw [div_eq_mul_inv, ← ENNReal.tsum_mul_right, toOuterMeasure_apply]
  refine' tsum_congr fun x => _
  by_cases hx : x ∈ t <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
s : Multiset α
hs : s ≠ 0
t : Set α
x : α
hx : x ∉ t
⊢ Set.indicator t (⇑(ofMultiset s hs)) x =
    ↑(Multiset.count x (Multiset.filter (fun x => x ∈ t) s)) * (↑(Multiset.card s))⁻¹

Next tactic:
simp [Set.indicator, hx, div_eq_mul_inv]
theorem continuousWithinAt_Ioi_iff_Ici {a : α} {f : α → β} :
    ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : PartialOrder α
inst✝ : TopologicalSpace β
a : α
f : α → β
⊢ ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a

Next tactic:
simp only [← Ici_diff_left, continuousWithinAt_diff_self]
theorem nhds_left_sup_nhds_right (a : α) : 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
⊢ 𝓝[≤] a ⊔ 𝓝[≥] a = 𝓝 a

Next tactic:
rw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ]
theorem nhds_left'_sup_nhds_right (a : α) : 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
⊢ 𝓝[<] a ⊔ 𝓝[≥] a = 𝓝 a

Next tactic:
rw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ]
theorem nhds_left_sup_nhds_right' (a : α) : 𝓝[≤] a ⊔ 𝓝[>] a = 𝓝 a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
⊢ 𝓝[≤] a ⊔ 𝓝[>] a = 𝓝 a

Next tactic:
rw [← nhdsWithin_union, Iic_union_Ioi, nhdsWithin_univ]
theorem nhds_left'_sup_nhds_right' (a : α) : 𝓝[<] a ⊔ 𝓝[>] a = 𝓝[≠] a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
⊢ 𝓝[<] a ⊔ 𝓝[>] a = 𝓝[≠] a

Next tactic:
rw [← nhdsWithin_union, Iio_union_Ioi]
theorem continuousAt_iff_continuous_left_right {a : α} {f : α → β} :
    ContinuousAt f a ↔ ContinuousWithinAt f (Iic a) a ∧ ContinuousWithinAt f (Ici a) a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
f : α → β
⊢ ContinuousAt f a ↔ ContinuousWithinAt f (Iic a) a ∧ ContinuousWithinAt f (Ici a) a

Next tactic:
simp only [ContinuousWithinAt, ContinuousAt, ← tendsto_sup, nhds_left_sup_nhds_right]
theorem continuousAt_iff_continuous_left'_right' {a : α} {f : α → β} :
    ContinuousAt f a ↔ ContinuousWithinAt f (Iio a) a ∧ ContinuousWithinAt f (Ioi a) a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝² : TopologicalSpace α
inst✝¹ : LinearOrder α
inst✝ : TopologicalSpace β
a : α
f : α → β
⊢ ContinuousAt f a ↔ ContinuousWithinAt f (Iio a) a ∧ ContinuousWithinAt f (Ioi a) a

Next tactic:
rw [continuousWithinAt_Ioi_iff_Ici, continuousWithinAt_Iio_iff_Iic,
    continuousAt_iff_continuous_left_right]
/-- Constant zero function has sum `0` -/
theorem hasSum_zero : HasSum (fun _ => 0 : β → α) 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 β
⊢ HasSum (fun x => 0) 0

Next tactic:
simp [HasSum, tendsto_const_nhds]
theorem hasSum_empty [IsEmpty β] : HasSum f 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✝ : IsEmpty β
⊢ HasSum f 0

Next tactic:
convert @hasSum_zero α β _ _
theorem tsum_eq_zero_of_not_summable (h : ¬Summable f) : ∑' 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 β
h : ¬Summable f
⊢ ∑' (b : β), f b = 0

Next tactic:
simp [tsum_def, h]
theorem Function.Injective.hasSum_iff {g : γ → β} (hg : Injective g)
    (hf : ∀ x, x ∉ Set.range g → f x = 0) : HasSum (f ∘ g) a ↔ 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 β
g : γ → β
hg : Injective g
hf : ∀ x ∉ Set.range g, f x = 0
⊢ HasSum (f ∘ g) a ↔ HasSum f a

Next tactic:
simp only [HasSum, Tendsto, comp_apply, hg.map_atTop_finset_sum_eq hf]
@[simp] theorem hasSum_extend_zero {g : β → γ} (hg : Injective g) :
    HasSum (extend g f 0) a ↔ 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 β
g : β → γ
hg : Injective g
⊢ HasSum (extend g f 0) a ↔ HasSum f a

Next tactic:
rw [← hg.hasSum_iff, extend_comp hg]
@[simp] theorem hasSum_extend_zero {g : β → γ} (hg : Injective g) :
    HasSum (extend g f 0) a ↔ HasSum f a := by
  rw [← hg.hasSum_iff, extend_comp hg]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g✝ : β → α
a b : α
s : Finset β
g : β → γ
hg : Injective g
⊢ ∀ x ∉ Set.range g, extend g f 0 x = 0

Next tactic:
exact extend_apply' _ _
theorem hasSum_subtype_iff_of_support_subset {s : Set β} (hf : support f ⊆ s) :
    HasSum (f ∘ (↑) : s → α) a ↔ HasSum f a :=
  Subtype.coe_injective.hasSum_iff <| 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 β
s : Set β
hf : support f ⊆ s
⊢ ∀ x ∉ Set.range fun a => ↑a, f x = 0

Next tactic:
simpa using support_subset_iff'.1 hf
theorem hasSum_subtype_iff_indicator {s : Set β} :
    HasSum (f ∘ (↑) : s → α) a ↔ HasSum (s.indicator 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 β
s : Set β
⊢ HasSum (f ∘ Subtype.val) a ↔ HasSum (Set.indicator s f) a

Next tactic:
rw [← Set.indicator_range_comp, Subtype.range_coe,
    hasSum_subtype_iff_of_support_subset Set.support_indicator_subset]
protected theorem Finset.hasSum (s : Finset β) (f : β → α) :
    HasSum (f ∘ (↑) : (↑s : Set β) → α) (∑ 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 b : α
s✝ s : Finset β
f : β → α
⊢ HasSum (f ∘ Subtype.val) (∑ b in s, f b)

Next tactic:
rw [← sum_attach]
protected theorem Finset.hasSum (s : Finset β) (f : β → α) :
    HasSum (f ∘ (↑) : (↑s : Set β) → α) (∑ b in s, f b) := by
  rw [← sum_attach]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a b : α
s✝ s : Finset β
f : β → α
⊢ HasSum (f ∘ Subtype.val) (∑ x in attach s, f ↑x)

Next tactic:
exact hasSum_fintype _
protected theorem Set.Finite.summable {s : Set β} (hs : s.Finite) (f : β → α) :
    Summable (f ∘ (↑) : s → α) := 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 β
s : Set β
hs : Set.Finite s
f : β → α
⊢ Summable (f ∘ Subtype.val)

Next tactic:
have := hs.toFinset.summable f
protected theorem Set.Finite.summable {s : Set β} (hs : s.Finite) (f : β → α) :
    Summable (f ∘ (↑) : s → α) := by
  have := hs.toFinset.summable f
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f✝ g : β → α
a b : α
s✝ : Finset β
s : Set β
hs : Set.Finite s
f : β → α
this : Summable (f ∘ Subtype.val)
⊢ Summable (f ∘ Subtype.val)

Next tactic:
rwa [hs.coe_toFinset] at this
theorem summable_of_finite_support (h : (support f).Finite) : Summable f := 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 β
h : Set.Finite (support f)
⊢ Summable f

Next tactic:
apply summable_of_ne_finset_zero (s := h.toFinset)
theorem summable_of_finite_support (h : (support f).Finite) : Summable f := by
  apply summable_of_ne_finset_zero (s := h.toFinset); 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a b : α
s : Finset β
h : Set.Finite (support f)
⊢ ∀ b ∉ Set.Finite.toFinset h, f b = 0

Next tactic:
simp
theorem Summable.hasSum (ha : Summable f) : HasSum 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 b : α
s : Finset β
ha : Summable f
⊢ HasSum f (∑' (b : β), f b)

Next tactic:
simp only [tsum_def, ha, dite_true]
theorem Summable.hasSum (ha : Summable f) : HasSum f (∑' b, f b) := by
  simp only [tsum_def, ha, dite_true]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g : β → α
a b : α
s : Finset β
ha : Summable f
⊢ HasSum f (if Set.Finite (support fun b => f b) then ∑ᶠ (b : β), f b else Classical.choose (_ : Summable fun b => f b))

Next tactic:
by_cases H : (support f).Finite
theorem Summable.hasSum (ha : Summable f) : HasSum f (∑' b, f b) := by
  simp only [tsum_def, ha, dite_true]
  by_cases H : (support f).Finite
  · 

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 β
ha : Summable f
H : Set.Finite (support f)
⊢ HasSum f (if Set.Finite (support fun b => f b) then ∑ᶠ (b : β), f b else Classical.choose (_ : Summable fun b => f b))

Next tactic:
simp [H, hasSum_sum_of_ne_finset_zero, finsum_eq_sum]
theorem Summable.hasSum (ha : Summable f) : HasSum f (∑' b, f b) := by
  simp only [tsum_def, ha, dite_true]
  by_cases H : (support f).Finite
  · simp [H, hasSum_sum_of_ne_finset_zero, finsum_eq_sum]
  · 

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 β
ha : Summable f
H : ¬Set.Finite (support f)
⊢ HasSum f (if Set.Finite (support fun b => f b) then ∑ᶠ (b : β), f b else Classical.choose (_ : Summable fun b => f b))

Next tactic:
simpa [H] using Classical.choose_spec ha
theorem hasSum_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 0) : HasSum f (f b) :=
  suffices HasSum f (∑ b' in {b}, f b') by simpa using this
  hasSum_sum_of_ne_finset_zero <| 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 β
f : β → α
b : β
hf : ∀ (b' : β), b' ≠ b → f b' = 0
⊢ ∀ b_1 ∉ {b}, f b_1 = 0

Next tactic:
simpa [hf]
theorem hasSum_single {f : β → α} (b : β) (hf : ∀ (b') (_ : b' ≠ b), f b' = 0) : HasSum f (f b) :=
  suffices HasSum f (∑ b' in {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 b✝ : α
s : Finset β
f : β → α
b : β
hf : ∀ (b' : β), b' ≠ b → f b' = 0
this : HasSum f (∑ b' in {b}, f b')
⊢ HasSum f (f b)

Next tactic:
simpa using this
theorem hasSum_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    HasSum (fun 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✝ b✝ : α
s : Finset β
b : β
inst✝ : DecidablePred fun x => x = b
a : α
⊢ HasSum (fun b' => if b' = b then a else 0) a

Next tactic:
convert @hasSum_single _ _ _ _ (fun b' => if b' = b then a else 0) b (fun b' hb' => if_neg hb')
theorem hasSum_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    HasSum (fun b' => if b' = b then a else 0) a := by
  convert @hasSum_single _ _ _ _ (fun b' => if b' = b then a else 0) b (fun b' hb' => if_neg hb')
  

Proof state:
case h.e'_6
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a✝ b✝ : α
s : Finset β
b : β
inst✝ : DecidablePred fun x => x = b
a : α
⊢ a = if b = b then a else 0

Next tactic:
exact (if_pos rfl).symm
theorem hasSum_pi_single [DecidableEq β] (b : β) (a : α) : HasSum (Pi.single b a) 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✝ : DecidableEq β
b : β
a : α
⊢ HasSum (Pi.single b a) a

Next tactic:
convert hasSum_ite_eq b a
theorem hasSum_pi_single [DecidableEq β] (b : β) (a : α) : HasSum (Pi.single b a) a := by
  convert hasSum_ite_eq b a
  

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✝ : DecidableEq β
b : β
a : α
x✝ : β
⊢ Pi.single b a x✝ = if x✝ = b then a else 0

Next tactic:
simp [Pi.single_apply]
theorem Equiv.hasSum_iff (e : γ ≃ β) : HasSum (f ∘ e) a ↔ HasSum f a :=
  e.injective.hasSum_iff <| 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 β
e : γ ≃ β
⊢ ∀ x ∉ Set.range ⇑e, f x = 0

Next tactic:
simp
theorem Equiv.hasSum_iff_of_support {g : γ → α} (e : support f ≃ support g)
    (he : ∀ x : support f, g (e x) = f x) : HasSum f a ↔ HasSum g 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 β
g : γ → α
e : ↑(support f) ≃ ↑(support g)
he : ∀ (x : ↑(support f)), g ↑(e x) = f ↑x
⊢ HasSum f a ↔ HasSum g a

Next tactic:
have : (g ∘ (↑)) ∘ e = f ∘ (↑) := funext he
theorem Equiv.hasSum_iff_of_support {g : γ → α} (e : support f ≃ support g)
    (he : ∀ x : support f, g (e x) = f x) : HasSum f a ↔ HasSum g a := by
  have : (g ∘ (↑)) ∘ e = f ∘ (↑) := funext he
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝¹ : AddCommMonoid α
inst✝ : TopologicalSpace α
f g✝ : β → α
a b : α
s : Finset β
g : γ → α
e : ↑(support f) ≃ ↑(support g)
he : ∀ (x : ↑(support f)), g ↑(e x) = f ↑x
this : (g ∘ Subtype.val) ∘ ⇑e = f ∘ Subtype.val
⊢ HasSum f a ↔ HasSum g a

Next tactic:
rw [← hasSum_subtype_support, ← this, e.hasSum_iff, hasSum_subtype_support]
protected theorem Summable.map_iff_of_leftInverse [AddCommMonoid γ] [TopologicalSpace γ] {G G'}
    [AddMonoidHomClass G α γ] [AddMonoidHomClass G' γ α] (g : G) (g' : G') (hg : Continuous g)
    (hg' : Continuous g') (hinv : Function.LeftInverse g' g) : Summable (g ∘ f) ↔ Summable f :=
  ⟨fun h => 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✝³ : AddCommMonoid γ
inst✝² : TopologicalSpace γ
G : Type u_5
G' : Type u_6
inst✝¹ : AddMonoidHomClass G α γ
inst✝ : AddMonoidHomClass G' γ α
g : G
g' : G'
hg : Continuous ⇑g
hg' : Continuous ⇑g'
hinv : LeftInverse ⇑g' ⇑g
h : Summable (⇑g ∘ f)
⊢ Summable f

Next tactic:
have := h.map _ hg'
protected theorem Summable.map_iff_of_leftInverse [AddCommMonoid γ] [TopologicalSpace γ] {G G'}
    [AddMonoidHomClass G α γ] [AddMonoidHomClass G' γ α] (g : G) (g' : G') (hg : Continuous g)
    (hg' : Continuous g') (hinv : Function.LeftInverse g' g) : Summable (g ∘ f) ↔ Summable f :=
  ⟨fun h => by
    have := h.map _ hg'
    

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✝³ : AddCommMonoid γ
inst✝² : TopologicalSpace γ
G : Type u_5
G' : Type u_6
inst✝¹ : AddMonoidHomClass G α γ
inst✝ : AddMonoidHomClass G' γ α
g : G
g' : G'
hg : Continuous ⇑g
hg' : Continuous ⇑g'
hinv : LeftInverse ⇑g' ⇑g
h : Summable (⇑g ∘ f)
this : Summable (⇑g' ∘ ⇑g ∘ f)
⊢ Summable f

Next tactic:
rwa [← Function.comp.assoc, hinv.id] at this
theorem HasSum.unique {a₁ a₂ : α} [T2Space α] : HasSum f a₁ → HasSum f a₂ → a₁ = 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 β
a₁ a₂ : α
inst✝ : T2Space α
⊢ HasSum f a₁ → HasSum f a₂ → a₁ = a₂

Next tactic:
classical exact tendsto_nhds_unique
theorem HasSum.unique {a₁ a₂ : α} [T2Space α] : HasSum f a₁ → HasSum f a₂ → a₁ = a₂ := by
  classical 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommMonoid α
inst✝¹ : TopologicalSpace α
f g : β → α
a b : α
s : Finset β
a₁ a₂ : α
inst✝ : T2Space α
⊢ HasSum f a₁ → HasSum f a₂ → a₁ = a₂

Next tactic:
exact tendsto_nhds_unique
theorem Summable.hasSum_iff_tendsto_nat [T2Space α] {f : ℕ → α} {a : α} (hf : Summable f) :
    HasSum f a ↔ Tendsto (fun n : ℕ => ∑ i in range n, f i) atTop (𝓝 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✝ : T2Space α
f : ℕ → α
a : α
hf : Summable f
⊢ HasSum f a ↔ Tendsto (fun n => ∑ i in range n, f i) atTop (𝓝 a)

Next tactic:
refine' ⟨fun h => h.tendsto_sum_nat, fun h => _⟩
theorem Summable.hasSum_iff_tendsto_nat [T2Space α] {f : ℕ → α} {a : α} (hf : Summable f) :
    HasSum f a ↔ Tendsto (fun n : ℕ => ∑ i in range n, f i) atTop (𝓝 a) := by
  refine' ⟨fun h => h.tendsto_sum_nat, fun 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✝ : T2Space α
f : ℕ → α
a : α
hf : Summable f
h : Tendsto (fun n => ∑ i in range n, f i) atTop (𝓝 a)
⊢ HasSum f a

Next tactic:
rw [tendsto_nhds_unique h hf.hasSum.tendsto_sum_nat]
theorem Summable.hasSum_iff_tendsto_nat [T2Space α] {f : ℕ → α} {a : α} (hf : Summable f) :
    HasSum f a ↔ Tendsto (fun n : ℕ => ∑ i in range n, f i) atTop (𝓝 a) := by
  refine' ⟨fun h => h.tendsto_sum_nat, fun h => _⟩
  rw [tendsto_nhds_unique h hf.hasSum.tendsto_sum_nat]
  

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✝ : T2Space α
f : ℕ → α
a : α
hf : Summable f
h : Tendsto (fun n => ∑ i in range n, f i) atTop (𝓝 a)
⊢ HasSum f (∑' (b : ℕ), f b)

Next tactic:
exact hf.hasSum
theorem HasSum.add (hf : HasSum f a) (hg : HasSum g b) : HasSum (fun b => f b + g b) (a + 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 α
hf : HasSum f a
hg : HasSum g b
⊢ HasSum (fun b => f b + g b) (a + b)

Next tactic:
dsimp only [HasSum] at hf hg ⊢
theorem HasSum.add (hf : HasSum f a) (hg : HasSum g b) : HasSum (fun b => f b + g b) (a + b) := by
  dsimp only [HasSum] at hf hg ⊢
  

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 α
hf : Tendsto (fun s => ∑ b in s, f b) atTop (𝓝 a)
hg : Tendsto (fun s => ∑ b in s, g b) atTop (𝓝 b)
⊢ Tendsto (fun s => ∑ b in s, (f b + g b)) atTop (𝓝 (a + b))

Next tactic:
simp_rw [sum_add_distrib]
theorem HasSum.add (hf : HasSum f a) (hg : HasSum g b) : HasSum (fun b => f b + g b) (a + b) := by
  dsimp only [HasSum] at hf hg ⊢
  simp_rw [sum_add_distrib]
  

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 α
hf : Tendsto (fun s => ∑ b in s, f b) atTop (𝓝 a)
hg : Tendsto (fun s => ∑ b in s, g b) atTop (𝓝 b)
⊢ Tendsto (fun s => ∑ x in s, f x + ∑ x in s, g x) atTop (𝓝 (a + b))

Next tactic:
exact hf.add hg
theorem hasSum_sum {f : γ → β → α} {a : γ → α} {s : Finset γ} :
    (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i) := 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 α
f : γ → β → α
a : γ → α
s : Finset γ
⊢ (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i)

Next tactic:
classical
  exact Finset.induction_on s (by simp only [hasSum_zero, sum_empty, forall_true_iff]) <| by
    -- Porting note: with some help, `simp` used to be able to close the goal
    simp (config := { contextual := true }) only [mem_insert, forall_eq_or_imp, not_false_iff,
      sum_insert, and_imp]
    exact fun x s _ IH hx h ↦ hx.add (IH h)
theorem hasSum_sum {f : γ → β → α} {a : γ → α} {s : Finset γ} :
    (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i) := by
  classical
  

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 α
f : γ → β → α
a : γ → α
s : Finset γ
⊢ (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i)

Next tactic:
exact Finset.induction_on s (by simp only [hasSum_zero, sum_empty, forall_true_iff]) <| by
    -- Porting note: with some help, `simp` used to be able to close the goal
    simp (config := { contextual := true }) only [mem_insert, forall_eq_or_imp, not_false_iff,
      sum_insert, and_imp]
    exact fun x s _ IH hx h ↦ hx.add (IH h)
theorem hasSum_sum {f : γ → β → α} {a : γ → α} {s : Finset γ} :
    (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i) := by
  classical
  exact Finset.induction_on s (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 α
f : γ → β → α
a : γ → α
s : Finset γ
⊢ (∀ i ∈ ∅, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in ∅, f i b) (∑ i in ∅, a i)

Next tactic:
simp only [hasSum_zero, sum_empty, forall_true_iff]
theorem hasSum_sum {f : γ → β → α} {a : γ → α} {s : Finset γ} :
    (∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i) := by
  classical
  exact Finset.induction_on s (by simp only [hasSum_zero, sum_empty, forall_true_iff]) <| by
    -- Porting note: with some help, `simp` used to be able to close the goal
    

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 α
f : γ → β → α
a : γ → α
s : Finset γ
⊢ ∀ ⦃a_1 : γ⦄ {s : Finset γ},
    a_1 ∉ s →
      ((∀ i ∈ s, HasSum (f i) (a i)) → HasSum (fun b => ∑ i in s, f i b) (∑ i in s, a i)) →
        (∀ i ∈ insert a_1 s, HasSum (f i) (a i)) →
          HasSum (fun b => ∑ i in insert a_1 s, f i b) (∑ i in insert a_1 s, a i)

Next tactic:
simp (config := { contextual := true }) only [mem_insert, forall_eq_or_imp, not_false_iff,
      sum_insert, and_imp]