case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ ι (Subtype.restrict p f) i ≫ fromSubtype f p ≫ π f j =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
⊢ fromSubtype f p ≫ π f j = if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
ext i
case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ ι (Subtype.restrict p f) i ≫ fromSubtype f p ≫ π f j =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ ι (Subtype.restrict p f) i ≫ fromSubtype f p ≫ π f j =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
dsimp
case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ ι (Subtype.restrict p f) i ≫ fromSubtype f p ≫ π f j =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
rw [biproduct.fromSubtype, biproduct.ι_desc_assoc, biproduct.ι_π]
case pos
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0

case neg
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : ¬p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
case w
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
by_cases h : p j
case pos
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    if h_1 : i = { val := j, property := h } then
      eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })
    else 0
case pos
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
rw [dif_pos h, biproduct.ι_π]
case pos.inl.inl
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ↑i = j
h₂ : i = { val := j, property := h }
⊢ eqToHom (_ : f ↑i = f j) = eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })

case pos.inl.inr
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ↑i = j
h₂ : ¬i = { val := j, property := h }
⊢ eqToHom (_ : f ↑i = f j) = 0

case pos.inr.inl
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ¬↑i = j
h₂ : i = { val := j, property := h }
⊢ 0 = eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })

case pos.inr.inr
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ¬↑i = j
h₂ : ¬i = { val := j, property := h }
⊢ 0 = 0
case pos
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    if h_1 : i = { val := j, property := h } then
      eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })
    else 0
split_ifs with h₁ h₂ h₂
no goals
case pos.inl.inl
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ↑i = j
h₂ : i = { val := j, property := h }
⊢ eqToHom (_ : f ↑i = f j) = eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })

case pos.inl.inr
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ↑i = j
h₂ : ¬i = { val := j, property := h }
⊢ eqToHom (_ : f ↑i = f j) = 0

case pos.inr.inl
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ¬↑i = j
h₂ : i = { val := j, property := h }
⊢ 0 = eqToHom (_ : Subtype.restrict p f i = Subtype.restrict p f { val := j, property := h })

case pos.inr.inr
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : p j
h₁ : ¬↑i = j
h₂ : ¬i = { val := j, property := h }
⊢ 0 = 0
exacts [rfl, False.elim (h₂ (Subtype.ext h₁)), False.elim (h₁ (congr_arg Subtype.val h₂)), rfl]
no goals
case neg
J : Type w
C : Type u
inst✝⁴ : Category C
inst✝³ : HasZeroMorphisms C
f : J → C
inst✝² : HasBiproduct f
p : J → Prop
inst✝¹ : HasBiproduct (Subtype.restrict p f)
inst✝ : DecidablePred p
j : J
i : Subtype p
h : ¬p j
⊢ (if h : ↑i = j then eqToHom (_ : f ↑i = f j) else 0) =
    ι (Subtype.restrict p f) i ≫ if h : p j then π (Subtype.restrict p f) { val := j, property := h } else 0
rw [dif_neg h, dif_neg (show (i : J) ≠ j from fun h₂ => h (h₂ ▸ i.2)), comp_zero]