l3lab/ntp-mathlib huggingface dataset:
/-- The kernel of `biproduct.π f i` is the inclusion from the biproduct which omits `i`
from the index set `J` into the biproduct over `J`. -/
def biproduct.isLimitFromSubtype :
    IsLimit (KernelFork.ofι (biproduct.fromSubtype f fun j => j ≠ i) (by simp) :
    KernelFork (biproduct.π f i)) :=
  Fork.IsLimit.mk' _ fun s =>
    ⟨s.ι ≫ biproduct.toSubtype _ _, by
      apply biproduct.hom_ext; intro j
      rw [KernelFork.ι_ofι, Category.assoc, Category.assoc,
        biproduct.toSubtype_fromSubtype_assoc, biproduct.map_π]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), comp_zero, comp_zero, KernelFork.condition]
      · rw [if_pos (Ne.symm h), Category.comp_id], by
      intro m hm
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Fork (π f i) 0
m :
  ((const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((const WalkingParallelPair).obj
          (KernelFork.ofι (fromSubtype f fun j => j ≠ i) (_ : (fromSubtype f fun j => ¬j = i) ≫ π f i = 0)).pt).obj
      WalkingParallelPair.zero
hm :
  m ≫ Fork.ι (KernelFork.ofι (fromSubtype f fun j => j ≠ i) (_ : (fromSubtype f fun j => ¬j = i) ≫ π f i = 0)) =
    Fork.ι s
⊢ m = Fork.ι s ≫ toSubtype f fun j => j ≠ i

Next tactic:
rw [← hm, KernelFork.ι_ofι, Category.assoc, biproduct.fromSubtype_toSubtype]
/-- The kernel of `biproduct.π f i` is the inclusion from the biproduct which omits `i`
from the index set `J` into the biproduct over `J`. -/
def biproduct.isLimitFromSubtype :
    IsLimit (KernelFork.ofι (biproduct.fromSubtype f fun j => j ≠ i) (by simp) :
    KernelFork (biproduct.π f i)) :=
  Fork.IsLimit.mk' _ fun s =>
    ⟨s.ι ≫ biproduct.toSubtype _ _, by
      apply biproduct.hom_ext; intro j
      rw [KernelFork.ι_ofι, Category.assoc, Category.assoc,
        biproduct.toSubtype_fromSubtype_assoc, biproduct.map_π]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), comp_zero, comp_zero, KernelFork.condition]
      · rw [if_pos (Ne.symm h), Category.comp_id], by
      intro m hm
      rw [← hm, KernelFork.ι_ofι, Category.assoc, biproduct.fromSubtype_toSubtype]
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Fork (π f i) 0
m :
  ((const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((const WalkingParallelPair).obj
          (KernelFork.ofι (fromSubtype f fun j => j ≠ i) (_ : (fromSubtype f fun j => ¬j = i) ≫ π f i = 0)).pt).obj
      WalkingParallelPair.zero
hm :
  m ≫ Fork.ι (KernelFork.ofι (fromSubtype f fun j => j ≠ i) (_ : (fromSubtype f fun j => ¬j = i) ≫ π f i = 0)) =
    Fork.ι s
⊢ m = m ≫ 𝟙 (⨁ Subtype.restrict (fun j => j ≠ i) f)

Next tactic:
exact (Category.comp_id _).symm
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by 

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
⊢ (ι f i ≫ toSubtype f fun j => j ≠ i) = 0

Next tactic:
simp
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
⊢ Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫
      (fromSubtype f fun j => j ≠ i) ≫ Cofork.π s =
    Cofork.π s

Next tactic:
apply biproduct.hom_ext'
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; 

Proof state:
case w
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
⊢ ∀ (j : J),
    ι f j ≫
        Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫
          (fromSubtype f fun j => j ≠ i) ≫ Cofork.π s =
      ι f j ≫ Cofork.π s

Next tactic:
intro j
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      

Proof state:
case w
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
j : J
⊢ ι f j ≫
      Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫
        (fromSubtype f fun j => j ≠ i) ≫ Cofork.π s =
    ι f j ≫ Cofork.π s

Next tactic:
rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      

Proof state:
case w
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
j : J
⊢ (if j ≠ i then 𝟙 (f j) else 0) ≫ ι (fun j => f j) j ≫ Cofork.π s = ι f j ≫ Cofork.π s

Next tactic:
rcases Classical.em (i = j) with (rfl | h)
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      rcases Classical.em (i = j) with (rfl | h)
      · 

Proof state:
case w.inl
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
⊢ (if i ≠ i then 𝟙 (f i) else 0) ≫ ι (fun j => f j) i ≫ Cofork.π s = ι f i ≫ Cofork.π s

Next tactic:
rw [if_neg (Classical.not_not.2 rfl), zero_comp, CokernelCofork.condition]
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), zero_comp, CokernelCofork.condition]
      · 

Proof state:
case w.inr
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
j : J
h : ¬i = j
⊢ (if j ≠ i then 𝟙 (f j) else 0) ≫ ι (fun j => f j) j ≫ Cofork.π s = ι f j ≫ Cofork.π s

Next tactic:
rw [if_pos (Ne.symm h), Category.id_comp]
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), zero_comp, CokernelCofork.condition]
      · rw [if_pos (Ne.symm h), Category.id_comp], by
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
⊢ ∀
    {m :
      ((const WalkingParallelPair).obj
              (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)).pt).obj
          WalkingParallelPair.one ⟶
        ((const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one},
    Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫ m =
        Cofork.π s →
      m = (fromSubtype f fun j => j ≠ i) ≫ Cofork.π s

Next tactic:
intro m hm
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), zero_comp, CokernelCofork.condition]
      · rw [if_pos (Ne.symm h), Category.id_comp], by
      intro m hm
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
m :
  ((const WalkingParallelPair).obj
          (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)).pt).obj
      WalkingParallelPair.one ⟶
    ((const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm :
  Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫ m =
    Cofork.π s
⊢ m = (fromSubtype f fun j => j ≠ i) ≫ Cofork.π s

Next tactic:
rw [← hm, CokernelCofork.π_ofπ, ← Category.assoc, biproduct.fromSubtype_toSubtype]
/-- The cokernel of `biproduct.ι f i` is the projection from the biproduct over the index set `J`
onto the biproduct omitting `i`. -/
def biproduct.isColimitToSubtype :
    IsColimit (CokernelCofork.ofπ (biproduct.toSubtype f fun j => j ≠ i) (by simp) :
    CokernelCofork (biproduct.ι f i)) :=
  Cofork.IsColimit.mk' _ fun s =>
    ⟨biproduct.fromSubtype _ _ ≫ s.π, by
      apply biproduct.hom_ext'; intro j
      rw [CokernelCofork.π_ofπ, biproduct.toSubtype_fromSubtype_assoc, biproduct.ι_map_assoc]
      rcases Classical.em (i = j) with (rfl | h)
      · rw [if_neg (Classical.not_not.2 rfl), zero_comp, CokernelCofork.condition]
      · rw [if_pos (Ne.symm h), Category.id_comp], by
      intro m hm
      rw [← hm, CokernelCofork.π_ofπ, ← Category.assoc, biproduct.fromSubtype_toSubtype]
      

Proof state:
J : Type w
K : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
f : J → C
i : J
inst✝¹ : HasBiproduct f
inst✝ : HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)
s : Cofork (ι f i) 0
m :
  ((const WalkingParallelPair).obj
          (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)).pt).obj
      WalkingParallelPair.one ⟶
    ((const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.one
hm :
  Cofork.π (CokernelCofork.ofπ (toSubtype f fun j => j ≠ i) (_ : (ι f i ≫ toSubtype f fun j => ¬j = i) = 0)) ≫ m =
    Cofork.π s
⊢ m = 𝟙 (⨁ Subtype.restrict (fun j => j ≠ i) f) ≫ m

Next tactic:
exact (Category.id_comp _).symm
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        

Proof state:
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
⊢ biproduct.fromSubtype f pᶜ ≫ biproduct.toSubtype f p = 0

Next tactic:
ext j k
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        

Proof state:
case w.w
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
j : Subtype p
k : Subtype pᶜ
⊢ biproduct.ι (Subtype.restrict pᶜ f) k ≫
      (biproduct.fromSubtype f pᶜ ≫ biproduct.toSubtype f p) ≫ biproduct.π (Subtype.restrict p f) j =
    biproduct.ι (Subtype.restrict pᶜ f) k ≫ 0 ≫ biproduct.π (Subtype.restrict p f) j

Next tactic:
simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        

Proof state:
case w.w
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
j : Subtype p
k : Subtype pᶜ
⊢ (if h : p ↑k then biproduct.ι (Subtype.restrict p f) { val := ↑k, property := h } else 0) ≫
      biproduct.π (Subtype.restrict p f) j =
    0

Next tactic:
erw [dif_neg k.2]
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        

Proof state:
case w.w
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
j : Subtype p
k : Subtype pᶜ
⊢ 0 ≫ biproduct.π (Subtype.restrict p f) j = 0

Next tactic:
simp only [zero_comp]
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        

Proof state:
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
⊢ ∀ {W' : C} (g' : W' ⟶ ⨁ f) (eq' : g' ≫ biproduct.toSubtype f p = 0),
    (fun {W} g x => g ≫ biproduct.toSubtype f pᶜ) g' eq' ≫ biproduct.fromSubtype f pᶜ = g'

Next tactic:
intro W' g' w
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        

Proof state:
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
w : g' ≫ biproduct.toSubtype f p = 0
⊢ (fun {W} g x => g ≫ biproduct.toSubtype f pᶜ) g' w ≫ biproduct.fromSubtype f pᶜ = g'

Next tactic:
ext j
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        ext j
        

Proof state:
case w
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
w : g' ≫ biproduct.toSubtype f p = 0
j : K
⊢ ((fun {W} g x => g ≫ biproduct.toSubtype f pᶜ) g' w ≫ biproduct.fromSubtype f pᶜ) ≫ biproduct.π f j =
    g' ≫ biproduct.π f j

Next tactic:
simp only [Category.assoc, biproduct.toSubtype_fromSubtype, Pi.compl_apply,
          biproduct.map_π]
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        ext j
        simp only [Category.assoc, biproduct.toSubtype_fromSubtype, Pi.compl_apply,
          biproduct.map_π]
        

Proof state:
case w
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
w : g' ≫ biproduct.toSubtype f p = 0
j : K
⊢ (g' ≫ biproduct.π (fun b => f b) j ≫ if (p j)ᶜ then 𝟙 (f j) else 0) = g' ≫ biproduct.π f j

Next tactic:
split_ifs with h
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        ext j
        simp only [Category.assoc, biproduct.toSubtype_fromSubtype, Pi.compl_apply,
          biproduct.map_π]
        split_ifs with h
        · 

Proof state:
case pos
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
w : g' ≫ biproduct.toSubtype f p = 0
j : K
h : (p j)ᶜ
⊢ g' ≫ biproduct.π (fun b => f b) j ≫ 𝟙 (f j) = g' ≫ biproduct.π f j

Next tactic:
simp
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        ext j
        simp only [Category.assoc, biproduct.toSubtype_fromSubtype, Pi.compl_apply,
          biproduct.map_π]
        split_ifs with h
        · simp
        · 

Proof state:
case neg
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
w : g' ≫ biproduct.toSubtype f p = 0
j : K
h : ¬(p j)ᶜ
⊢ g' ≫ biproduct.π (fun b => f b) j ≫ 0 = g' ≫ biproduct.π f j

Next tactic:
replace w := w =≫ biproduct.π _ ⟨j, not_not.mp h⟩
/-- The limit cone exhibiting `⨁ Subtype.restrict pᶜ f` as the kernel of
`biproduct.toSubtype f p` -/
@[simps]
def kernelForkBiproductToSubtype (p : Set K) : LimitCone (parallelPair (biproduct.toSubtype f p) 0)
    where
  cone :=
    KernelFork.ofι (biproduct.fromSubtype f pᶜ)
      (by
        ext j k
        simp only [Category.assoc, biproduct.ι_fromSubtype_assoc, biproduct.ι_toSubtype_assoc,
          comp_zero, zero_comp]
        erw [dif_neg k.2]
        simp only [zero_comp])
  isLimit :=
    KernelFork.IsLimit.ofι _ _ (fun {W} g _ => g ≫ biproduct.toSubtype f pᶜ)
      (by
        intro W' g' w
        ext j
        simp only [Category.assoc, biproduct.toSubtype_fromSubtype, Pi.compl_apply,
          biproduct.map_π]
        split_ifs with h
        · simp
        · replace w := w =≫ biproduct.π _ ⟨j, not_not.mp h⟩
          

Proof state:
case neg
J : Type w
K✝ : Type u_1
C : Type u
inst✝³ : Category.{v, u} C
inst✝² : HasZeroMorphisms C
K : Type
inst✝¹ : Fintype K
inst✝ : HasFiniteBiproducts C
f : K → C
p : Set K
W' : C
g' : W' ⟶ ⨁ f
j : K
h : ¬(p j)ᶜ
w :
  (g' ≫ biproduct.toSubtype f p) ≫ biproduct.π (Subtype.restrict p f) { val := j, property := (_ : p j) } =
    0 ≫ biproduct.π (Subtype.restrict p f) { val := j, property := (_ : p j) }
⊢ g' ≫ biproduct.π (fun b => f b) j ≫ 0 = g' ≫ biproduct.π f j

Next tactic:
simpa using w.symm