l3lab/ntp-mathlib huggingface dataset:
/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData := by
  let γ := kernel.ι S.g ≫ cokernel.π S.f
  let g' := cokernel.desc S.f S.g S.zero
  have hg' : g' = cokernel.π γ ≫ cokernel.desc γ g' (by simp) := by rw [cokernel.π_desc]
  have wι : kernel.ι (cokernel.π γ) ≫ g' = 0 := by rw [hg', kernel.condition_assoc, zero_comp]
  let e : cokernel γ ≅ Abelian.coimage S.g :=
    IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) S.cokernelToAbelianCoimageIsCokernel
  have he : cokernel.π γ ≫ e.hom = S.cokernelToAbelianCoimage :=
    IsColimit.comp_coconePointUniqueUpToIso_hom _ _ WalkingParallelPair.one
  have fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g := by
    rw [hg', reassoc_of% he]
    

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Abelian C
S : ShortComplex C
γ : kernel S.g ⟶ cokernel S.f := kernel.ι S.g ≫ cokernel.π S.f
g' : cokernel S.f ⟶ S.X₃ := cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0)
hg' :
  g' =
    cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0)
wι : kernel.ι (cokernel.π γ) ≫ g' = 0
e : cokernel γ ≅ Abelian.coimage S.g :=
  IsColimit.coconePointUniqueUpToIso (colimit.isColimit (parallelPair (kernel.ι S.g ≫ cokernel.π S.f) 0))
    (cokernelToAbelianCoimageIsCokernel S)
he : cokernel.π γ ≫ e.hom = cokernelToAbelianCoimage S
⊢ cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0) =
    cokernelToAbelianCoimage S ≫ Abelian.factorThruCoimage S.g

Next tactic:
simp only [cokernel.π_desc, ← cancel_epi (cokernel.π S.f),
      cokernel_π_comp_cokernelToAbelianCoimage_assoc]
/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData := by
  let γ := kernel.ι S.g ≫ cokernel.π S.f
  let g' := cokernel.desc S.f S.g S.zero
  have hg' : g' = cokernel.π γ ≫ cokernel.desc γ g' (by simp) := by rw [cokernel.π_desc]
  have wι : kernel.ι (cokernel.π γ) ≫ g' = 0 := by rw [hg', kernel.condition_assoc, zero_comp]
  let e : cokernel γ ≅ Abelian.coimage S.g :=
    IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) S.cokernelToAbelianCoimageIsCokernel
  have he : cokernel.π γ ≫ e.hom = S.cokernelToAbelianCoimage :=
    IsColimit.comp_coconePointUniqueUpToIso_hom _ _ WalkingParallelPair.one
  have fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g := by
    rw [hg', reassoc_of% he]
    simp only [cokernel.π_desc, ← cancel_epi (cokernel.π S.f),
      cokernel_π_comp_cokernelToAbelianCoimage_assoc]
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Abelian C
S : ShortComplex C
γ : kernel S.g ⟶ cokernel S.f := kernel.ι S.g ≫ cokernel.π S.f
g' : cokernel S.f ⟶ S.X₃ := cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0)
hg' :
  g' =
    cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0)
wι : kernel.ι (cokernel.π γ) ≫ g' = 0
e : cokernel γ ≅ Abelian.coimage S.g :=
  IsColimit.coconePointUniqueUpToIso (colimit.isColimit (parallelPair (kernel.ι S.g ≫ cokernel.π S.f) 0))
    (cokernelToAbelianCoimageIsCokernel S)
he : cokernel.π γ ≫ e.hom = cokernelToAbelianCoimage S
fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g
⊢ RightHomologyData S

Next tactic:
have hι : IsLimit (KernelFork.ofι _ wι) :=
    KernelFork.IsLimit.ofι _ _
      (fun x hx => kernel.lift _ x (by
        simpa only [← cancel_mono e.hom, ← cancel_mono (Abelian.factorThruCoimage S.g), assoc,
          zero_comp, fac] using hx))
      (fun x hx => kernel.lift_ι _ _ _)
      (fun x hx b hb => equalizer.hom_ext (by simp only [hb, kernel.lift_ι]))
/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData := by
  let γ := kernel.ι S.g ≫ cokernel.π S.f
  let g' := cokernel.desc S.f S.g S.zero
  have hg' : g' = cokernel.π γ ≫ cokernel.desc γ g' (by simp) := by rw [cokernel.π_desc]
  have wι : kernel.ι (cokernel.π γ) ≫ g' = 0 := by rw [hg', kernel.condition_assoc, zero_comp]
  let e : cokernel γ ≅ Abelian.coimage S.g :=
    IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) S.cokernelToAbelianCoimageIsCokernel
  have he : cokernel.π γ ≫ e.hom = S.cokernelToAbelianCoimage :=
    IsColimit.comp_coconePointUniqueUpToIso_hom _ _ WalkingParallelPair.one
  have fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g := by
    rw [hg', reassoc_of% he]
    simp only [cokernel.π_desc, ← cancel_epi (cokernel.π S.f),
      cokernel_π_comp_cokernelToAbelianCoimage_assoc]
  have hι : IsLimit (KernelFork.ofι _ wι) :=
    KernelFork.IsLimit.ofι _ _
      (fun x hx => kernel.lift _ x (by
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Abelian C
S : ShortComplex C
γ : kernel S.g ⟶ cokernel S.f := kernel.ι S.g ≫ cokernel.π S.f
g' : cokernel S.f ⟶ S.X₃ := cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0)
hg' :
  g' =
    cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0)
wι : kernel.ι (cokernel.π γ) ≫ g' = 0
e : cokernel γ ≅ Abelian.coimage S.g :=
  IsColimit.coconePointUniqueUpToIso (colimit.isColimit (parallelPair (kernel.ι S.g ≫ cokernel.π S.f) 0))
    (cokernelToAbelianCoimageIsCokernel S)
he : cokernel.π γ ≫ e.hom = cokernelToAbelianCoimage S
fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g
W'✝ : C
x : W'✝ ⟶ cokernel S.f
hx : x ≫ g' = 0
⊢ x ≫ cokernel.π γ = 0

Next tactic:
simpa only [← cancel_mono e.hom, ← cancel_mono (Abelian.factorThruCoimage S.g), assoc,
          zero_comp, fac] using hx
/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData := by
  let γ := kernel.ι S.g ≫ cokernel.π S.f
  let g' := cokernel.desc S.f S.g S.zero
  have hg' : g' = cokernel.π γ ≫ cokernel.desc γ g' (by simp) := by rw [cokernel.π_desc]
  have wι : kernel.ι (cokernel.π γ) ≫ g' = 0 := by rw [hg', kernel.condition_assoc, zero_comp]
  let e : cokernel γ ≅ Abelian.coimage S.g :=
    IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) S.cokernelToAbelianCoimageIsCokernel
  have he : cokernel.π γ ≫ e.hom = S.cokernelToAbelianCoimage :=
    IsColimit.comp_coconePointUniqueUpToIso_hom _ _ WalkingParallelPair.one
  have fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g := by
    rw [hg', reassoc_of% he]
    simp only [cokernel.π_desc, ← cancel_epi (cokernel.π S.f),
      cokernel_π_comp_cokernelToAbelianCoimage_assoc]
  have hι : IsLimit (KernelFork.ofι _ wι) :=
    KernelFork.IsLimit.ofι _ _
      (fun x hx => kernel.lift _ x (by
        simpa only [← cancel_mono e.hom, ← cancel_mono (Abelian.factorThruCoimage S.g), assoc,
          zero_comp, fac] using hx))
      (fun x hx => kernel.lift_ι _ _ _)
      (fun x hx b hb => equalizer.hom_ext (by 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Abelian C
S : ShortComplex C
γ : kernel S.g ⟶ cokernel S.f := kernel.ι S.g ≫ cokernel.π S.f
g' : cokernel S.f ⟶ S.X₃ := cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0)
hg' :
  g' =
    cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0)
wι : kernel.ι (cokernel.π γ) ≫ g' = 0
e : cokernel γ ≅ Abelian.coimage S.g :=
  IsColimit.coconePointUniqueUpToIso (colimit.isColimit (parallelPair (kernel.ι S.g ≫ cokernel.π S.f) 0))
    (cokernelToAbelianCoimageIsCokernel S)
he : cokernel.π γ ≫ e.hom = cokernelToAbelianCoimage S
fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g
W'✝ : C
x : W'✝ ⟶ cokernel S.f
hx : x ≫ g' = 0
b : W'✝ ⟶ kernel (cokernel.π γ)
hb : b ≫ kernel.ι (cokernel.π γ) = x
⊢ b ≫ equalizer.ι (cokernel.π γ) 0 =
    (fun {W'} x hx => kernel.lift (cokernel.π γ) x (_ : x ≫ cokernel.π γ = 0)) x hx ≫ equalizer.ι (cokernel.π γ) 0

Next tactic:
simp only [hb, kernel.lift_ι]
/-- The canonical `RightHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.RightHomologyData := by
  let γ := kernel.ι S.g ≫ cokernel.π S.f
  let g' := cokernel.desc S.f S.g S.zero
  have hg' : g' = cokernel.π γ ≫ cokernel.desc γ g' (by simp) := by rw [cokernel.π_desc]
  have wι : kernel.ι (cokernel.π γ) ≫ g' = 0 := by rw [hg', kernel.condition_assoc, zero_comp]
  let e : cokernel γ ≅ Abelian.coimage S.g :=
    IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) S.cokernelToAbelianCoimageIsCokernel
  have he : cokernel.π γ ≫ e.hom = S.cokernelToAbelianCoimage :=
    IsColimit.comp_coconePointUniqueUpToIso_hom _ _ WalkingParallelPair.one
  have fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g := by
    rw [hg', reassoc_of% he]
    simp only [cokernel.π_desc, ← cancel_epi (cokernel.π S.f),
      cokernel_π_comp_cokernelToAbelianCoimage_assoc]
  have hι : IsLimit (KernelFork.ofι _ wι) :=
    KernelFork.IsLimit.ofι _ _
      (fun x hx => kernel.lift _ x (by
        simpa only [← cancel_mono e.hom, ← cancel_mono (Abelian.factorThruCoimage S.g), assoc,
          zero_comp, fac] using hx))
      (fun x hx => kernel.lift_ι _ _ _)
      (fun x hx b hb => equalizer.hom_ext (by simp only [hb, kernel.lift_ι]))
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
inst✝ : Abelian C
S : ShortComplex C
γ : kernel S.g ⟶ cokernel S.f := kernel.ι S.g ≫ cokernel.π S.f
g' : cokernel S.f ⟶ S.X₃ := cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0)
hg' :
  g' =
    cokernel.π γ ≫
      cokernel.desc γ g' (_ : (kernel.ι S.g ≫ cokernel.π S.f) ≫ cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0) = 0)
wι : kernel.ι (cokernel.π γ) ≫ g' = 0
e : cokernel γ ≅ Abelian.coimage S.g :=
  IsColimit.coconePointUniqueUpToIso (colimit.isColimit (parallelPair (kernel.ι S.g ≫ cokernel.π S.f) 0))
    (cokernelToAbelianCoimageIsCokernel S)
he : cokernel.π γ ≫ e.hom = cokernelToAbelianCoimage S
fac : g' = cokernel.π γ ≫ e.hom ≫ Abelian.factorThruCoimage S.g
hι : IsLimit (KernelFork.ofι (kernel.ι (cokernel.π γ)) wι)
⊢ RightHomologyData S

Next tactic:
exact
    { Q := cokernel S.f,
      H := Abelian.image (kernel.ι S.g ≫ cokernel.π S.f)
      p := cokernel.π _
      ι := kernel.ι _
      wp := cokernel.condition _
      hp := cokernelIsCokernel _
      wι := wι
      hι := hι }
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum f a₁
hg : HasSum g a₂
⊢ a₁ ≤ a₂

Next tactic:
rw [← hasSum_extend_zero he] at hf
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
⊢ a₁ ≤ a₂

Next tactic:
refine hasSum_le (fun c => ?_) hf hg
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  refine hasSum_le (fun c => ?_) hf hg
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
c : κ
⊢ extend e f 0 c ≤ g c

Next tactic:
obtain ⟨i, rfl⟩ | h := em (c ∈ Set.range e)
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  refine hasSum_le (fun c => ?_) hf hg
  obtain ⟨i, rfl⟩ | h := em (c ∈ Set.range e)
  · 

Proof state:
case inl.intro
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
i : ι
⊢ extend e f 0 (e i) ≤ g (e i)

Next tactic:
rw [he.extend_apply]
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  refine hasSum_le (fun c => ?_) hf hg
  obtain ⟨i, rfl⟩ | h := em (c ∈ Set.range e)
  · rw [he.extend_apply]
    

Proof state:
case inl.intro
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
i : ι
⊢ f i ≤ g (e i)

Next tactic:
exact h _
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  refine hasSum_le (fun c => ?_) hf hg
  obtain ⟨i, rfl⟩ | h := em (c ∈ Set.range e)
  · rw [he.extend_apply]
    exact h _
  · 

Proof state:
case inr
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h✝ : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
c : κ
h : c ∉ Set.range e
⊢ extend e f 0 c ≤ g c

Next tactic:
rw [extend_apply' _ _ _ h]
theorem hasSum_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 0 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasSum f a₁)
    (hg : HasSum g a₂) : a₁ ≤ a₂ := by
  rw [← hasSum_extend_zero he] at hf
  refine hasSum_le (fun c => ?_) hf hg
  obtain ⟨i, rfl⟩ | h := em (c ∈ Set.range e)
  · rw [he.extend_apply]
    exact h _
  · rw [extend_apply' _ _ _ h]
    

Proof state:
case inr
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g✝ : ι → α
a a₁ a₂ : α
g : κ → α
e : ι → κ
he : Injective e
hs : ∀ c ∉ Set.range e, 0 ≤ g c
h✝ : ∀ (i : ι), f i ≤ g (e i)
hf : HasSum (extend e f 0) a₁
hg : HasSum g a₂
c : κ
h : c ∉ Set.range e
⊢ OfNat.ofNat 0 c ≤ g c

Next tactic:
exact hs _ h
theorem le_hasSum (hf : HasSum f a) (i : ι) (hb : ∀ j, j ≠ i → 0 ≤ f j) : f i ≤ a :=
  calc
    f i = ∑ i in {i}, f i := by 

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : HasSum f a
i : ι
hb : ∀ (j : ι), j ≠ i → 0 ≤ f j
⊢ f i = ∑ i in {i}, f i

Next tactic:
rw [sum_singleton]
theorem le_hasSum (hf : HasSum f a) (i : ι) (hb : ∀ j, j ≠ i → 0 ≤ f j) : f i ≤ a :=
  calc
    f i = ∑ i in {i}, f i := by rw [sum_singleton]
    _ ≤ a := sum_le_hasSum _ (by 

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : HasSum f a
i : ι
hb : ∀ (j : ι), j ≠ i → 0 ≤ f j
⊢ ∀ i_1 ∉ {i}, 0 ≤ f i_1

Next tactic:
simpa
theorem tsum_le_of_sum_le' (ha₂ : 0 ≤ a₂) (h : ∀ s, ∑ i in s, f i ≤ a₂) : ∑' i, f i ≤ a₂ := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
ha₂ : 0 ≤ a₂
h : ∀ (s : Finset ι), ∑ i in s, f i ≤ a₂
⊢ ∑' (i : ι), f i ≤ a₂

Next tactic:
by_cases hf : Summable f
theorem tsum_le_of_sum_le' (ha₂ : 0 ≤ a₂) (h : ∀ s, ∑ i in s, f i ≤ a₂) : ∑' i, f i ≤ a₂ := by
  by_cases hf : Summable f
  · 

Proof state:
case pos
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
ha₂ : 0 ≤ a₂
h : ∀ (s : Finset ι), ∑ i in s, f i ≤ a₂
hf : Summable f
⊢ ∑' (i : ι), f i ≤ a₂

Next tactic:
exact tsum_le_of_sum_le hf h
theorem tsum_le_of_sum_le' (ha₂ : 0 ≤ a₂) (h : ∀ s, ∑ i in s, f i ≤ a₂) : ∑' i, f i ≤ a₂ := by
  by_cases hf : Summable f
  · exact tsum_le_of_sum_le hf h
  · 

Proof state:
case neg
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
ha₂ : 0 ≤ a₂
h : ∀ (s : Finset ι), ∑ i in s, f i ≤ a₂
hf : ¬Summable f
⊢ ∑' (i : ι), f i ≤ a₂

Next tactic:
rw [tsum_eq_zero_of_not_summable hf]
theorem tsum_le_of_sum_le' (ha₂ : 0 ≤ a₂) (h : ∀ s, ∑ i in s, f i ≤ a₂) : ∑' i, f i ≤ a₂ := by
  by_cases hf : Summable f
  · exact tsum_le_of_sum_le hf h
  · rw [tsum_eq_zero_of_not_summable hf]
    

Proof state:
case neg
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
ha₂ : 0 ≤ a₂
h : ∀ (s : Finset ι), ∑ i in s, f i ≤ a₂
hf : ¬Summable f
⊢ 0 ≤ a₂

Next tactic:
exact ha₂
theorem tsum_nonneg (h : ∀ i, 0 ≤ g i) : 0 ≤ ∑' i, g i := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), 0 ≤ g i
⊢ 0 ≤ ∑' (i : ι), g i

Next tactic:
by_cases hg : Summable g
theorem tsum_nonneg (h : ∀ i, 0 ≤ g i) : 0 ≤ ∑' i, g i := by
  by_cases hg : Summable g
  · 

Proof state:
case pos
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), 0 ≤ g i
hg : Summable g
⊢ 0 ≤ ∑' (i : ι), g i

Next tactic:
exact hg.hasSum.nonneg h
theorem tsum_nonneg (h : ∀ i, 0 ≤ g i) : 0 ≤ ∑' i, g i := by
  by_cases hg : Summable g
  · exact hg.hasSum.nonneg h
  · 

Proof state:
case neg
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), 0 ≤ g i
hg : ¬Summable g
⊢ 0 ≤ ∑' (i : ι), g i

Next tactic:
rw [tsum_eq_zero_of_not_summable hg]
theorem tsum_nonpos (h : ∀ i, f i ≤ 0) : ∑' i, f i ≤ 0 := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), f i ≤ 0
⊢ ∑' (i : ι), f i ≤ 0

Next tactic:
by_cases hf : Summable f
theorem tsum_nonpos (h : ∀ i, f i ≤ 0) : ∑' i, f i ≤ 0 := by
  by_cases hf : Summable f
  · 

Proof state:
case pos
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), f i ≤ 0
hf : Summable f
⊢ ∑' (i : ι), f i ≤ 0

Next tactic:
exact hf.hasSum.nonpos h
theorem tsum_nonpos (h : ∀ i, f i ≤ 0) : ∑' i, f i ≤ 0 := by
  by_cases hf : Summable f
  · exact hf.hasSum.nonpos h
  · 

Proof state:
case neg
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
h : ∀ (i : ι), f i ≤ 0
hf : ¬Summable f
⊢ ∑' (i : ι), f i ≤ 0

Next tactic:
rw [tsum_eq_zero_of_not_summable hf]
theorem hasSum_zero_iff_of_nonneg (hf : ∀ i, 0 ≤ f i) : HasSum f 0 ↔ f = 0 := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : ∀ (i : ι), 0 ≤ f i
⊢ HasSum f 0 ↔ f = 0

Next tactic:
refine' ⟨fun hf' => _, _⟩
theorem hasSum_zero_iff_of_nonneg (hf : ∀ i, 0 ≤ f i) : HasSum f 0 ↔ f = 0 := by
  refine' ⟨fun hf' => _, _⟩
  · 

Proof state:
case refine'_1
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : ∀ (i : ι), 0 ≤ f i
hf' : HasSum f 0
⊢ f = 0

Next tactic:
ext i
theorem hasSum_zero_iff_of_nonneg (hf : ∀ i, 0 ≤ f i) : HasSum f 0 ↔ f = 0 := by
  refine' ⟨fun hf' => _, _⟩
  · ext i
    

Proof state:
case refine'_1.h
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : ∀ (i : ι), 0 ≤ f i
hf' : HasSum f 0
i : ι
⊢ f i = OfNat.ofNat 0 i

Next tactic:
exact (hf i).antisymm' (le_hasSum hf' _ fun j _ => hf j)
theorem hasSum_zero_iff_of_nonneg (hf : ∀ i, 0 ≤ f i) : HasSum f 0 ↔ f = 0 := by
  refine' ⟨fun hf' => _, _⟩
  · ext i
    exact (hf i).antisymm' (le_hasSum hf' _ fun j _ => hf j)
  · 

Proof state:
case refine'_2
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
f g : ι → α
a a₁ a₂ : α
hf : ∀ (i : ι), 0 ≤ f i
⊢ f = 0 → HasSum f 0

Next tactic:
rintro rfl
theorem hasSum_zero_iff_of_nonneg (hf : ∀ i, 0 ≤ f i) : HasSum f 0 ↔ f = 0 := by
  refine' ⟨fun hf' => _, _⟩
  · ext i
    exact (hf i).antisymm' (le_hasSum hf' _ fun j _ => hf j)
  · rintro rfl
    

Proof state:
case refine'_2
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝² : OrderedAddCommMonoid α
inst✝¹ : TopologicalSpace α
inst✝ : OrderClosedTopology α
g : ι → α
a a₁ a₂ : α
hf : ∀ (i : ι), 0 ≤ OfNat.ofNat 0 i
⊢ HasSum 0 0

Next tactic:
exact hasSum_zero
theorem hasSum_lt (h : f ≤ g) (hi : f i < g i) (hf : HasSum f a₁) (hg : HasSum g a₂) : a₁ < a₂ := by
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝³ : OrderedAddCommGroup α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalAddGroup α
inst✝ : OrderClosedTopology α
f g : ι → α
a₁ a₂ : α
i : ι
h : f ≤ g
hi : f i < g i
hf : HasSum f a₁
hg : HasSum g a₂
⊢ a₁ < a₂

Next tactic:
have : update f i 0 ≤ update g i 0 := update_le_update_iff.mpr ⟨rfl.le, fun i _ => h i⟩
theorem hasSum_lt (h : f ≤ g) (hi : f i < g i) (hf : HasSum f a₁) (hg : HasSum g a₂) : a₁ < a₂ := by
  have : update f i 0 ≤ update g i 0 := update_le_update_iff.mpr ⟨rfl.le, fun i _ => h i⟩
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝³ : OrderedAddCommGroup α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalAddGroup α
inst✝ : OrderClosedTopology α
f g : ι → α
a₁ a₂ : α
i : ι
h : f ≤ g
hi : f i < g i
hf : HasSum f a₁
hg : HasSum g a₂
this : update f i 0 ≤ update g i 0
⊢ a₁ < a₂

Next tactic:
have : 0 - f i + a₁ ≤ 0 - g i + a₂ := hasSum_le this (hf.update i 0) (hg.update i 0)
theorem hasSum_lt (h : f ≤ g) (hi : f i < g i) (hf : HasSum f a₁) (hg : HasSum g a₂) : a₁ < a₂ := by
  have : update f i 0 ≤ update g i 0 := update_le_update_iff.mpr ⟨rfl.le, fun i _ => h i⟩
  have : 0 - f i + a₁ ≤ 0 - g i + a₂ := hasSum_le this (hf.update i 0) (hg.update i 0)
  

Proof state:
ι : Type u_1
κ : Type u_2
α : Type u_3
inst✝³ : OrderedAddCommGroup α
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalAddGroup α
inst✝ : OrderClosedTopology α
f g : ι → α
a₁ a₂ : α
i : ι
h : f ≤ g
hi : f i < g i
hf : HasSum f a₁
hg : HasSum g a₂
this✝ : update f i 0 ≤ update g i 0
this : 0 - f i + a₁ ≤ 0 - g i + a₂
⊢ a₁ < a₂

Next tactic:
simpa only [zero_sub, add_neg_cancel_left] using add_lt_add_of_lt_of_le hi this