l3lab/ntp-mathlib huggingface dataset:
theorem cauchySeq_finset_iff_tsum_vanishing :
    (CauchySeq fun s : Finset β ↦ ∑ b in s, f b) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  simp_rw [cauchySeq_finset_iff_vanishing, Set.disjoint_left, disjoint_left]
  refine ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨o, ho, o_closed, oe⟩ := exists_mem_nhds_isClosed_subset he
    obtain ⟨s, hs⟩ := vanish o ho
    refine ⟨s, fun t hts ↦ oe ?_⟩
    by_cases ht : Summable fun a : t ↦ f a
    · classical
      refine o_closed.mem_of_tendsto ht.hasSum (eventually_of_forall fun t' ↦ ?_)
      rw [← sum_subtype_map_embedding fun _ _ ↦ by rfl]
      apply hs
      simp_rw [Finset.mem_map]
      

Proof state:
case pos.a
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ e
e : Set α
he : e ∈ 𝓝 0
o : Set α
ho : o ∈ 𝓝 0
o_closed : IsClosed o
oe : o ⊆ e
s : Finset β
hs : ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ o
t : Set β
hts : ∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s
ht : Summable fun a => f ↑a
t' : Finset ↑t
⊢ ∀ ⦃a : β⦄, (∃ a_1 ∈ t', (Embedding.subtype fun x => x ∈ t) a_1 = a) → a ∉ s

Next tactic:
rintro _ ⟨b, -, rfl⟩
theorem cauchySeq_finset_iff_tsum_vanishing :
    (CauchySeq fun s : Finset β ↦ ∑ b in s, f b) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  simp_rw [cauchySeq_finset_iff_vanishing, Set.disjoint_left, disjoint_left]
  refine ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨o, ho, o_closed, oe⟩ := exists_mem_nhds_isClosed_subset he
    obtain ⟨s, hs⟩ := vanish o ho
    refine ⟨s, fun t hts ↦ oe ?_⟩
    by_cases ht : Summable fun a : t ↦ f a
    · classical
      refine o_closed.mem_of_tendsto ht.hasSum (eventually_of_forall fun t' ↦ ?_)
      rw [← sum_subtype_map_embedding fun _ _ ↦ by rfl]
      apply hs
      simp_rw [Finset.mem_map]
      rintro _ ⟨b, -, rfl⟩
      

Proof state:
case pos.a.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ e
e : Set α
he : e ∈ 𝓝 0
o : Set α
ho : o ∈ 𝓝 0
o_closed : IsClosed o
oe : o ⊆ e
s : Finset β
hs : ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ o
t : Set β
hts : ∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s
ht : Summable fun a => f ↑a
t' : Finset ↑t
b : { x // x ∈ t }
⊢ (Embedding.subtype fun x => x ∈ t) b ∉ s

Next tactic:
exact hts b.prop
theorem cauchySeq_finset_iff_tsum_vanishing :
    (CauchySeq fun s : Finset β ↦ ∑ b in s, f b) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  simp_rw [cauchySeq_finset_iff_vanishing, Set.disjoint_left, disjoint_left]
  refine ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨o, ho, o_closed, oe⟩ := exists_mem_nhds_isClosed_subset he
    obtain ⟨s, hs⟩ := vanish o ho
    refine ⟨s, fun t hts ↦ oe ?_⟩
    by_cases ht : Summable fun a : t ↦ f a
    · classical
      refine o_closed.mem_of_tendsto ht.hasSum (eventually_of_forall fun t' ↦ ?_)
      rw [← sum_subtype_map_embedding fun _ _ ↦ by rfl]
      apply hs
      simp_rw [Finset.mem_map]
      rintro _ ⟨b, -, rfl⟩
      exact hts b.prop
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ e
e : Set α
he : e ∈ 𝓝 0
o : Set α
ho : o ∈ 𝓝 0
o_closed : IsClosed o
oe : o ⊆ e
s : Finset β
hs : ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ o
t : Set β
hts : ∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s
ht : ¬Summable fun a => f ↑a
⊢ ∑' (b : ↑t), f ↑b ∈ o

Next tactic:
exact tsum_eq_zero_of_not_summable ht ▸ mem_of_mem_nhds ho
theorem cauchySeq_finset_iff_tsum_vanishing :
    (CauchySeq fun s : Finset β ↦ ∑ b in s, f b) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  simp_rw [cauchySeq_finset_iff_vanishing, Set.disjoint_left, disjoint_left]
  refine ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨o, ho, o_closed, oe⟩ := exists_mem_nhds_isClosed_subset he
    obtain ⟨s, hs⟩ := vanish o ho
    refine ⟨s, fun t hts ↦ oe ?_⟩
    by_cases ht : Summable fun a : t ↦ f a
    · classical
      refine o_closed.mem_of_tendsto ht.hasSum (eventually_of_forall fun t' ↦ ?_)
      rw [← sum_subtype_map_embedding fun _ _ ↦ by rfl]
      apply hs
      simp_rw [Finset.mem_map]
      rintro _ ⟨b, -, rfl⟩
      exact hts b.prop
    · exact tsum_eq_zero_of_not_summable ht ▸ mem_of_mem_nhds ho
  · 

Proof state:
case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set β), (∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s) → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
⊢ ∃ s, ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ e

Next tactic:
obtain ⟨s, hs⟩ := vanish _ he
theorem cauchySeq_finset_iff_tsum_vanishing :
    (CauchySeq fun s : Finset β ↦ ∑ b in s, f b) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  simp_rw [cauchySeq_finset_iff_vanishing, Set.disjoint_left, disjoint_left]
  refine ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨o, ho, o_closed, oe⟩ := exists_mem_nhds_isClosed_subset he
    obtain ⟨s, hs⟩ := vanish o ho
    refine ⟨s, fun t hts ↦ oe ?_⟩
    by_cases ht : Summable fun a : t ↦ f a
    · classical
      refine o_closed.mem_of_tendsto ht.hasSum (eventually_of_forall fun t' ↦ ?_)
      rw [← sum_subtype_map_embedding fun _ _ ↦ by rfl]
      apply hs
      simp_rw [Finset.mem_map]
      rintro _ ⟨b, -, rfl⟩
      exact hts b.prop
    · exact tsum_eq_zero_of_not_summable ht ▸ mem_of_mem_nhds ho
  · obtain ⟨s, hs⟩ := vanish _ he
    

Proof state:
case refine_2.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set β), (∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s) → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Set β), (∀ ⦃a : β⦄, a ∈ t → a ∉ ↑s) → ∑' (b : ↑t), f ↑b ∈ e
⊢ ∃ s, ∀ (t : Finset β), (∀ ⦃a : β⦄, a ∈ t → a ∉ s) → ∑ b in t, f b ∈ e

Next tactic:
exact ⟨s, fun t hts ↦ (t.tsum_subtype f).symm ▸ hs _ hts⟩
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
⊢ (CauchySeq fun s => ∑ n in s, f n) ↔ ∀ e ∈ 𝓝 0, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e

Next tactic:
refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · 

Proof state:
case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
⊢ ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e

Next tactic:
obtain ⟨s, hs⟩ := vanish e he
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    

Proof state:
case refine_1.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
s : Finset ℕ
hs : ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
⊢ ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e

Next tactic:
refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
    

Proof state:
case refine_1.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
s : Finset ℕ
hs : ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
t : Set ℕ
ht : t ⊆ {n | (if h : Finset.Nonempty s then max' s h + 1 else 0) ≤ n}
⊢ ∀ ⦃a : ℕ⦄, a ∈ t → a ∉ ↑s

Next tactic:
split_ifs at ht with h
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
    split_ifs at ht with h
    · 

Proof state:
case pos
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
s : Finset ℕ
hs : ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
t : Set ℕ
h : Finset.Nonempty s
ht : t ⊆ {n | max' s h + 1 ≤ n}
⊢ ∀ ⦃a : ℕ⦄, a ∈ t → a ∉ ↑s

Next tactic:
exact fun m hmt hms ↦ (s.le_max' _ hms).not_lt (Nat.succ_le_iff.mp <| ht hmt)
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
    split_ifs at ht with h
    · exact fun m hmt hms ↦ (s.le_max' _ hms).not_lt (Nat.succ_le_iff.mp <| ht hmt)
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
e : Set α
he : e ∈ 𝓝 0
s : Finset ℕ
hs : ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e
t : Set ℕ
h : ¬Finset.Nonempty s
ht : t ⊆ {n | 0 ≤ n}
⊢ ∀ ⦃a : ℕ⦄, a ∈ t → a ∉ ↑s

Next tactic:
exact fun _ _ hs ↦ h ⟨_, hs⟩
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
    split_ifs at ht with h
    · exact fun m hmt hms ↦ (s.le_max' _ hms).not_lt (Nat.succ_le_iff.mp <| ht hmt)
    · exact fun _ _ hs ↦ h ⟨_, hs⟩
  · 

Proof state:
case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e
e : Set α
he : e ∈ 𝓝 0
⊢ ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e

Next tactic:
obtain ⟨N, hN⟩ := vanish e he
theorem cauchySeq_finset_iff_nat_tsum_vanishing {f : ℕ → α} :
    (CauchySeq fun s : Finset ℕ ↦ ∑ n in s, f n) ↔
      ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  refine cauchySeq_finset_iff_tsum_vanishing.trans ⟨fun vanish e he ↦ ?_, fun vanish e he ↦ ?_⟩
  · obtain ⟨s, hs⟩ := vanish e he
    refine ⟨if h : s.Nonempty then s.max' h + 1 else 0, fun t ht ↦ hs _ <| Set.disjoint_left.mpr ?_⟩
    split_ifs at ht with h
    · exact fun m hmt hms ↦ (s.le_max' _ hms).not_lt (Nat.succ_le_iff.mp <| ht hmt)
    · exact fun _ _ hs ↦ h ⟨_, hs⟩
  · obtain ⟨N, hN⟩ := vanish e he
    

Proof state:
case refine_2.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝² : AddCommGroup α
inst✝¹ : UniformSpace α
inst✝ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
f : ℕ → α
vanish : ∀ e ∈ 𝓝 0, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e
e : Set α
he : e ∈ 𝓝 0
N : ℕ
hN : ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e
⊢ ∃ s, ∀ (t : Set ℕ), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e

Next tactic:
exact ⟨range N, fun t ht ↦ hN _ fun n hnt ↦
      le_of_not_lt fun h ↦ Set.disjoint_left.mp ht hnt (mem_range.mpr h)⟩
theorem summable_iff_vanishing :
    Summable f ↔ ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t, Disjoint t s → (∑ b in t, f b) ∈ e := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
⊢ Summable f ↔ ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e

Next tactic:
rw [summable_iff_cauchySeq_finset, cauchySeq_finset_iff_vanishing]
theorem summable_iff_tsum_vanishing : Summable f ↔
    ∀ e ∈ 𝓝 (0 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∑' b : t, f b) ∈ e := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
⊢ Summable f ↔ ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set β), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e

Next tactic:
rw [summable_iff_cauchySeq_finset, cauchySeq_finset_iff_tsum_vanishing]
theorem summable_iff_nat_tsum_vanishing {f : ℕ → α} : Summable f ↔
    ∀ e ∈ 𝓝 (0 : α), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∑' n : t, f n) ∈ e := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
f : ℕ → α
⊢ Summable f ↔ ∀ e ∈ 𝓝 0, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∑' (n : ↑t), f ↑n ∈ e

Next tactic:
rw [summable_iff_cauchySeq_finset, cauchySeq_finset_iff_nat_tsum_vanishing]
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
⊢ Summable g

Next tactic:
classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {refine' Finset.sum_subset (Finset.filter_subset _ _) _
            intro b hbt hb
            simp only [Finset.mem_filter, and_iff_right hbt] at hb
            exact (h b).resolve_right hb}
      eq ▸ hs _ <| Finset.disjoint_of_subset_left (Finset.filter_subset _ _) ht⟩
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
⊢ Summable g

Next tactic:
exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {refine' Finset.sum_subset (Finset.filter_subset _ _) _
            intro b hbt hb
            simp only [Finset.mem_filter, and_iff_right hbt] at hb
            exact (h b).resolve_right hb}
      eq ▸ hs _ <| Finset.disjoint_of_subset_left (Finset.filter_subset _ _) ht⟩
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e
t : Finset β
ht : Disjoint t s
⊢ ∑ b in filter (fun b => g b = f b) t, g b = ∑ b in t, g b

Next tactic:
{refine' Finset.sum_subset (Finset.filter_subset _ _) _
            intro b hbt hb
            simp only [Finset.mem_filter, and_iff_right hbt] at hb
            exact (h b).resolve_right hb}
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e
t : Finset β
ht : Disjoint t s
⊢ ∑ b in filter (fun b => g b = f b) t, g b = ∑ b in t, g b

Next tactic:
refine' Finset.sum_subset (Finset.filter_subset _ _) _
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {refine' Finset.sum_subset (Finset.filter_subset _ _) _
            

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e
t : Finset β
ht : Disjoint t s
⊢ ∀ x ∈ t, x ∉ filter (fun b => g b = f b) t → g x = 0

Next tactic:
intro b hbt hb
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {refine' Finset.sum_subset (Finset.filter_subset _ _) _
            intro b hbt hb
            

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e
t : Finset β
ht : Disjoint t s
b : β
hbt : b ∈ t
hb : b ∉ filter (fun b => g b = f b) t
⊢ g b = 0

Next tactic:
simp only [Finset.mem_filter, and_iff_right hbt] at hb
theorem Summable.summable_of_eq_zero_or_self (hf : Summable f) (h : ∀ b, g b = 0 ∨ g b = f b) :
    Summable g := by
  classical
  exact summable_iff_vanishing.2 fun e he =>
    let ⟨s, hs⟩ := summable_iff_vanishing.1 hf e he
    ⟨s, fun t ht =>
      have eq : ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t, g b :=
        calc
          ∑ b in t.filter fun b => g b = f b, f b = ∑ b in t.filter fun b => g b = f b, g b :=
            Finset.sum_congr rfl fun b hb => (Finset.mem_filter.1 hb).2.symm
          _ = ∑ b in t, g b := by
           {refine' Finset.sum_subset (Finset.filter_subset _ _) _
            intro b hbt hb
            simp only [Finset.mem_filter, and_iff_right hbt] at hb
            

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
hf : Summable f
h : ∀ (b : β), g b = 0 ∨ g b = f b
e : Set α
he : e ∈ 𝓝 0
s : Finset β
hs : ∀ (t : Finset β), Disjoint t s → ∑ b in t, f b ∈ e
t : Finset β
ht : Disjoint t s
b : β
hbt : b ∈ t
hb : ¬g b = f b
⊢ g b = 0

Next tactic:
exact (h b).resolve_right hb
theorem Summable.comp_injective {i : γ → β} (hf : Summable f) (hi : Injective i) :
    Summable (f ∘ i) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝³ : AddCommGroup α
inst✝² : UniformSpace α
inst✝¹ : UniformAddGroup α
f g : β → α
a a₁ a₂ : α
inst✝ : CompleteSpace α
i : γ → β
hf : Summable f
hi : Injective i
⊢ Summable (f ∘ i)

Next tactic:
simpa only [Set.indicator_range_comp] using
    (hi.summable_iff (fun x hx => Set.indicator_of_not_mem hx _)).2 (hf.indicator (Set.range i))
theorem sum_add_tsum_subtype_compl [T2Space α] {f : β → α} (hf : Summable f) (s : Finset β) :
    ∑ x in s, f x + ∑' x : { x // x ∉ s }, f x = ∑' x, f x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝⁴ : AddCommGroup α
inst✝³ : UniformSpace α
inst✝² : UniformAddGroup α
f✝ g : β → α
a a₁ a₂ : α
inst✝¹ : CompleteSpace α
inst✝ : T2Space α
f : β → α
hf : Summable f
s : Finset β
⊢ ∑ x in s, f x + ∑' (x : { x // x ∉ s }), f ↑x = ∑' (x : β), f x

Next tactic:
rw [← tsum_subtype_add_tsum_subtype_compl hf s]