l3lab/ntp-mathlib huggingface dataset:
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelCocone {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  Cofork.ofπ
    (@SemiNormedGroupCat₁.mkHom _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f.1))
      f.1.range.normedMk (NormedAddGroupHom.isQuotientQuotient _).norm_le)
    (by
      ext x
      -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026): was
      -- simp only [comp_apply, Limits.zero_comp, NormedAddGroupHom.zero_apply,
      --   SemiNormedGroupCat₁.mkHom_apply, SemiNormedGroupCat₁.zero_apply,
      --   ← NormedAddGroupHom.mem_ker, f.1.range.ker_normedMk, f.1.mem_range]
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [Limits.zero_comp, comp_apply, SemiNormedGroupCat₁.mkHom_apply,
        SemiNormedGroupCat₁.zero_apply, ← NormedAddGroupHom.mem_ker, f.1.range.ker_normedMk,
        f.1.mem_range]
      

Proof state:
case w.h
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
x : ↑X
⊢ ∃ w, ↑f w = f x

Next tactic:
use x
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelCocone {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  Cofork.ofπ
    (@SemiNormedGroupCat₁.mkHom _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f.1))
      f.1.range.normedMk (NormedAddGroupHom.isQuotientQuotient _).norm_le)
    (by
      ext x
      -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026): was
      -- simp only [comp_apply, Limits.zero_comp, NormedAddGroupHom.zero_apply,
      --   SemiNormedGroupCat₁.mkHom_apply, SemiNormedGroupCat₁.zero_apply,
      --   ← NormedAddGroupHom.mem_ker, f.1.range.ker_normedMk, f.1.mem_range]
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [Limits.zero_comp, comp_apply, SemiNormedGroupCat₁.mkHom_apply,
        SemiNormedGroupCat₁.zero_apply, ← NormedAddGroupHom.mem_ker, f.1.range.ker_normedMk,
        f.1.mem_range]
      use x
      

Proof state:
case h
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
x : ↑X
⊢ ↑f x = f x

Next tactic:
rfl
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  

Proof state:
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
⊢ (cokernelCocone f).pt ⟶ s.pt

Next tactic:
fconstructor
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · 

Proof state:
case val
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
⊢ NormedAddGroupHom ↑(cokernelCocone f).pt ↑s.pt

Next tactic:
apply NormedAddGroupHom.lift _ s.π.1
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · apply NormedAddGroupHom.lift _ s.π.1
    

Proof state:
case val
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
⊢ ∀ s_1 ∈ NormedAddGroupHom.range ↑f, ↑(Cofork.π s) s_1 = 0

Next tactic:
rintro _ ⟨b, rfl⟩
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · apply NormedAddGroupHom.lift _ s.π.1
    rintro _ ⟨b, rfl⟩
    

Proof state:
case val.intro
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ ↑(Cofork.π s) ((NormedAddGroupHom.toAddMonoidHom ↑f) b) = 0

Next tactic:
change (f ≫ s.π) b = 0
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · apply NormedAddGroupHom.lift _ s.π.1
    rintro _ ⟨b, rfl⟩
    change (f ≫ s.π) b = 0
    

Proof state:
case val.intro
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ (f ≫ Cofork.π s) b = 0

Next tactic:
simp
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · apply NormedAddGroupHom.lift _ s.π.1
    rintro _ ⟨b, rfl⟩
    change (f ≫ s.π) b = 0
    simp
    -- This used to be the end of the proof before leanprover/lean4#2644
    

Proof state:
case val.intro
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ 0 b = 0

Next tactic:
erw [zero_apply]
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat₁`. -/
def cokernelLift {X Y : SemiNormedGroupCat₁.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt := by
  fconstructor
  -- The lift itself:
  · apply NormedAddGroupHom.lift _ s.π.1
    rintro _ ⟨b, rfl⟩
    change (f ≫ s.π) b = 0
    simp
    -- This used to be the end of the proof before leanprover/lean4#2644
    erw [zero_apply]
  -- The lift has norm at most one:
  

Proof state:
case property
X Y : SemiNormedGroupCat₁
f : X ⟶ Y
s : CokernelCofork f
⊢ NormedAddGroupHom.NormNoninc
    (NormedAddGroupHom.lift (NormedAddGroupHom.range ↑f) ↑(Cofork.π s)
      (_ : ∀ s_1 ∈ NormedAddGroupHom.range ↑f, ↑(Cofork.π s) s_1 = 0))

Next tactic:
exact NormedAddGroupHom.lift_normNoninc _ _ _ s.π.2
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              

Proof state:
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
⊢ Cofork.π (cokernelCocone f) ≫ cokernelLift f s = Cofork.π s

Next tactic:
ext
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              ext
              

Proof state:
case w.h
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
⊢ (Cofork.π (cokernelCocone f) ≫ cokernelLift f s) x✝ = (Cofork.π s) x✝

Next tactic:
apply NormedAddGroupHom.lift_mk f.1.range
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              ext
              apply NormedAddGroupHom.lift_mk f.1.range
              

Proof state:
case w.h.hf
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
⊢ ∀ s_1 ∈ NormedAddGroupHom.range ↑f, ↑(Cofork.π s) s_1 = 0

Next tactic:
rintro _ ⟨b, rfl⟩
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              ext
              apply NormedAddGroupHom.lift_mk f.1.range
              rintro _ ⟨b, rfl⟩
              

Proof state:
case w.h.hf.intro
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
b : ↑X✝
⊢ ↑(Cofork.π s) ((NormedAddGroupHom.toAddMonoidHom ↑f) b) = 0

Next tactic:
change (f ≫ s.π) b = 0
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              ext
              apply NormedAddGroupHom.lift_mk f.1.range
              rintro _ ⟨b, rfl⟩
              change (f ≫ s.π) b = 0
              

Proof state:
case w.h.hf.intro
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
b : ↑X✝
⊢ (f ≫ Cofork.π s) b = 0

Next tactic:
simp
instance : HasCokernels SemiNormedGroupCat₁.{u} where
  has_colimit f :=
    HasColimit.mk
      { cocone := cokernelCocone f
        isColimit :=
          isColimitAux _ (cokernelLift f)
            (fun s => by
              ext
              apply NormedAddGroupHom.lift_mk f.1.range
              rintro _ ⟨b, rfl⟩
              change (f ≫ s.π) b = 0
              simp
              -- This used to be the end of the proof before leanprover/lean4#2644
              

Proof state:
case w.h.hf.intro
X✝ Y✝ : SemiNormedGroupCat₁
f : X✝ ⟶ Y✝
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
b : ↑X✝
⊢ 0 b = 0

Next tactic:
erw [zero_apply]
example : HasCokernels SemiNormedGroupCat₁ := by 

Proof state:
⊢ HasCokernels SemiNormedGroupCat₁

Next tactic:
infer_instance
/-- The equalizer cone for a parallel pair of morphisms of seminormed groups. -/
def fork {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) : Fork f g :=
  @Fork.ofι _ _ _ _ _ _ (of (f - g : NormedAddGroupHom V W).ker)
    (NormedAddGroupHom.incl (f - g).ker) <| by
    -- porting note: not needed in mathlib3
    

Proof state:
V W : SemiNormedGroupCat
f g : V ⟶ W
⊢ NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ f =
    NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ g

Next tactic:
change NormedAddGroupHom V W at f g
/-- The equalizer cone for a parallel pair of morphisms of seminormed groups. -/
def fork {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) : Fork f g :=
  @Fork.ofι _ _ _ _ _ _ (of (f - g : NormedAddGroupHom V W).ker)
    (NormedAddGroupHom.incl (f - g).ker) <| by
    -- porting note: not needed in mathlib3
    change NormedAddGroupHom V W at f g
    

Proof state:
V W : SemiNormedGroupCat
f g : NormedAddGroupHom ↑V ↑W
⊢ NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ f =
    NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ g

Next tactic:
ext v
/-- The equalizer cone for a parallel pair of morphisms of seminormed groups. -/
def fork {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) : Fork f g :=
  @Fork.ofι _ _ _ _ _ _ (of (f - g : NormedAddGroupHom V W).ker)
    (NormedAddGroupHom.incl (f - g).ker) <| by
    -- porting note: not needed in mathlib3
    change NormedAddGroupHom V W at f g
    ext v
    

Proof state:
case h
V W : SemiNormedGroupCat
f g : NormedAddGroupHom ↑V ↑W
v : ↑(of ↥(NormedAddGroupHom.ker (f - g)))
⊢ (NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ f) v =
    (NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ g) v

Next tactic:
have : v.1 ∈ (f - g).ker := v.2
/-- The equalizer cone for a parallel pair of morphisms of seminormed groups. -/
def fork {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) : Fork f g :=
  @Fork.ofι _ _ _ _ _ _ (of (f - g : NormedAddGroupHom V W).ker)
    (NormedAddGroupHom.incl (f - g).ker) <| by
    -- porting note: not needed in mathlib3
    change NormedAddGroupHom V W at f g
    ext v
    have : v.1 ∈ (f - g).ker := v.2
    

Proof state:
case h
V W : SemiNormedGroupCat
f g : NormedAddGroupHom ↑V ↑W
v : ↑(of ↥(NormedAddGroupHom.ker (f - g)))
this : ↑v ∈ NormedAddGroupHom.ker (f - g)
⊢ (NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ f) v =
    (NormedAddGroupHom.incl (NormedAddGroupHom.ker (f - g)) ≫ g) v

Next tactic:
simpa only [NormedAddGroupHom.incl_apply, Pi.zero_apply, coe_comp, NormedAddGroupHom.coe_zero,
      NormedAddGroupHom.mem_ker, NormedAddGroupHom.coe_sub, Pi.sub_apply,
      sub_eq_zero] using this
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  

Proof state:
V W : SemiNormedGroupCat
f g : V ⟶ W
c : Fork f g
⊢ (NormedAddGroupHom.compHom (f - g)) (Fork.ι c) = 0

Next tactic:
rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]; 

Proof state:
V W : SemiNormedGroupCat
f g : V ⟶ W
c : Fork f g
⊢ (NormedAddGroupHom.compHom f) (Fork.ι c) = (NormedAddGroupHom.compHom g) (Fork.ι c)

Next tactic:
exact c.condition
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]; exact c.condition)
            (fun c => NormedAddGroupHom.ker.incl_comp_lift _ _ _) fun c g h => by
        -- porting note: the `simp_rw` was was `rw [← h]` but motive is not type correct in mathlib4
              

Proof state:
V W : SemiNormedGroupCat
f g✝ : V ⟶ W
c : Fork f g✝
g : c.pt ⟶ (fork f g✝).pt
h : g ≫ Fork.ι (fork f g✝) = Fork.ι c
⊢ g =
    (fun c => NormedAddGroupHom.ker.lift (Fork.ι c) (f - g✝) (_ : (NormedAddGroupHom.compHom (f - g✝)) (Fork.ι c) = 0))
      c

Next tactic:
ext x
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]; exact c.condition)
            (fun c => NormedAddGroupHom.ker.incl_comp_lift _ _ _) fun c g h => by
        -- porting note: the `simp_rw` was was `rw [← h]` but motive is not type correct in mathlib4
              ext x; 

Proof state:
case h
V W : SemiNormedGroupCat
f g✝ : V ⟶ W
c : Fork f g✝
g : c.pt ⟶ (fork f g✝).pt
h : g ≫ Fork.ι (fork f g✝) = Fork.ι c
x : ↑c.pt
⊢ g x =
    ((fun c => NormedAddGroupHom.ker.lift (Fork.ι c) (f - g✝) (_ : (NormedAddGroupHom.compHom (f - g✝)) (Fork.ι c) = 0))
        c)
      x

Next tactic:
dsimp
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]; exact c.condition)
            (fun c => NormedAddGroupHom.ker.incl_comp_lift _ _ _) fun c g h => by
        -- porting note: the `simp_rw` was was `rw [← h]` but motive is not type correct in mathlib4
              ext x; dsimp; 

Proof state:
case h
V W : SemiNormedGroupCat
f g✝ : V ⟶ W
c : Fork f g✝
g : c.pt ⟶ (fork f g✝).pt
h : g ≫ Fork.ι (fork f g✝) = Fork.ι c
x : ↑c.pt
⊢ g x =
    (NormedAddGroupHom.ker.lift (Fork.ι c) (f - g✝)
        (_ : (NormedAddGroupHom.compHom f) (Fork.ι c) - (NormedAddGroupHom.compHom g✝) (Fork.ι c) = 0))
      x

Next tactic:
simp_rw [← h]
instance hasLimit_parallelPair {V W : SemiNormedGroupCat.{u}} (f g : V ⟶ W) :
    HasLimit (parallelPair f g) where
  exists_limit :=
    Nonempty.intro
      { cone := fork f g
        isLimit :=
          Fork.IsLimit.mk _
            (fun c =>
              NormedAddGroupHom.ker.lift (Fork.ι c) _ <|
                show NormedAddGroupHom.compHom (f - g) c.ι = 0 by
                  rw [AddMonoidHom.map_sub, AddMonoidHom.sub_apply, sub_eq_zero]; exact c.condition)
            (fun c => NormedAddGroupHom.ker.incl_comp_lift _ _ _) fun c g h => by
        -- porting note: the `simp_rw` was was `rw [← h]` but motive is not type correct in mathlib4
              ext x; dsimp; simp_rw [← h]; 

Proof state:
case h
V W : SemiNormedGroupCat
f g✝ : V ⟶ W
c : Fork f g✝
g : c.pt ⟶ (fork f g✝).pt
h : g ≫ Fork.ι (fork f g✝) = Fork.ι c
x : ↑c.pt
⊢ g x =
    (NormedAddGroupHom.ker.lift (g ≫ Fork.ι (fork f g✝)) (f - g✝)
        (_ : NormedAddGroupHom.comp (f - g✝) (g ≫ Fork.ι (fork f g✝)) = 0))
      x

Next tactic:
rfl
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      

Proof state:
X Y : SemiNormedGroupCat
f : X ⟶ Y
⊢ f ≫ AddSubgroup.normedMk (NormedAddGroupHom.range f) = 0 ≫ AddSubgroup.normedMk (NormedAddGroupHom.range f)

Next tactic:
ext a
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      ext a
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
a : ↑X
⊢ (f ≫ AddSubgroup.normedMk (NormedAddGroupHom.range f)) a = (0 ≫ AddSubgroup.normedMk (NormedAddGroupHom.range f)) a

Next tactic:
simp only [comp_apply, Limits.zero_comp]
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      ext a
      simp only [comp_apply, Limits.zero_comp]
      -- porting note: `simp` not firing on the below
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
a : ↑X
⊢ (f ≫ AddSubgroup.normedMk (NormedAddGroupHom.range f)) a = 0 a

Next tactic:
erw [comp_apply, NormedAddGroupHom.zero_apply]
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      ext a
      simp only [comp_apply, Limits.zero_comp]
      -- porting note: `simp` not firing on the below
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [comp_apply, NormedAddGroupHom.zero_apply]
      -- porting note: Lean 3 didn't need this instance
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
a : ↑X
⊢ (AddSubgroup.normedMk (NormedAddGroupHom.range f)) (f a) = 0

Next tactic:
letI : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) :=
        (inferInstance : SeminormedAddCommGroup Y)
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      ext a
      simp only [comp_apply, Limits.zero_comp]
      -- porting note: `simp` not firing on the below
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [comp_apply, NormedAddGroupHom.zero_apply]
      -- porting note: Lean 3 didn't need this instance
      letI : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) :=
        (inferInstance : SeminormedAddCommGroup Y)
      -- porting note: again simp doesn't seem to be firing in the below line
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
a : ↑X
this : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) := inferInstance
⊢ (AddSubgroup.normedMk (NormedAddGroupHom.range f)) (f a) = 0

Next tactic:
erw [← NormedAddGroupHom.mem_ker, f.range.ker_normedMk, f.mem_range]
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) : Cofork f 0 :=
  @Cofork.ofπ _ _ _ _ _ _ (SemiNormedGroupCat.of (Y ⧸ NormedAddGroupHom.range f)) f.range.normedMk
    (by
      ext a
      simp only [comp_apply, Limits.zero_comp]
      -- porting note: `simp` not firing on the below
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [comp_apply, NormedAddGroupHom.zero_apply]
      -- porting note: Lean 3 didn't need this instance
      letI : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) :=
        (inferInstance : SeminormedAddCommGroup Y)
      -- porting note: again simp doesn't seem to be firing in the below line
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [← NormedAddGroupHom.mem_ker, f.range.ker_normedMk, f.mem_range]
    -- This used to be `simp only [exists_apply_eq_apply]` before leanprover/lean4#2644
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
a : ↑X
this : SeminormedAddCommGroup ((forget SemiNormedGroupCat).obj Y) := inferInstance
⊢ ∃ w, f w = f a

Next tactic:
convert exists_apply_eq_apply f a
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt :=
  NormedAddGroupHom.lift _ s.π
    (by
      

Proof state:
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
⊢ ∀ s_1 ∈ NormedAddGroupHom.range f, (Cofork.π s) s_1 = 0

Next tactic:
rintro _ ⟨b, rfl⟩
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt :=
  NormedAddGroupHom.lift _ s.π
    (by
      rintro _ ⟨b, rfl⟩
      

Proof state:
case intro
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ (Cofork.π s) ((NormedAddGroupHom.toAddMonoidHom f) b) = 0

Next tactic:
change (f ≫ s.π) b = 0
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt :=
  NormedAddGroupHom.lift _ s.π
    (by
      rintro _ ⟨b, rfl⟩
      change (f ≫ s.π) b = 0
      

Proof state:
case intro
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ (f ≫ Cofork.π s) b = 0

Next tactic:
simp
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def cokernelLift {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) (s : CokernelCofork f) :
    (cokernelCocone f).pt ⟶ s.pt :=
  NormedAddGroupHom.lift _ s.π
    (by
      rintro _ ⟨b, rfl⟩
      change (f ≫ s.π) b = 0
      simp
      -- This used to be the end of the proof before leanprover/lean4#2644
      

Proof state:
case intro
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
b : ↑X
⊢ 0 b = 0

Next tactic:
erw [zero_apply]
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def isColimitCokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) :
    IsColimit (cokernelCocone f) :=
  isColimitAux _ (cokernelLift f)
    (fun s => by
      

Proof state:
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
⊢ Cofork.π (cokernelCocone f) ≫ cokernelLift f s = Cofork.π s

Next tactic:
ext
/-- Auxiliary definition for `HasCokernels SemiNormedGroupCat`. -/
noncomputable
def isColimitCokernelCocone {X Y : SemiNormedGroupCat.{u}} (f : X ⟶ Y) :
    IsColimit (cokernelCocone f) :=
  isColimitAux _ (cokernelLift f)
    (fun s => by
      ext
      

Proof state:
case h
X Y : SemiNormedGroupCat
f : X ⟶ Y
s : CokernelCofork f
x✝ : ↑((parallelPair f 0).obj WalkingParallelPair.one)
⊢ (Cofork.π (cokernelCocone f) ≫ cokernelLift f s) x✝ = (Cofork.π s) x✝

Next tactic:
apply NormedAddGroupHom.lift_mk f.range