Theorem: CategoryTheory.Limits.biproduct.ι_toSubtype
File: Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean

tactic: apply biproduct.hom_ext
state_before: 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
⊢ ι f j ≫ toSubtype f p = if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0

tactic: intro i
state_before: 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
⊢ ∀ (j_1 : Subtype p),
    (ι f j ≫ toSubtype f p) ≫ π (Subtype.restrict p f) j_1 =
      (if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0) ≫ π (Subtype.restrict p f) j_1

tactic: rw [biproduct.toSubtype, Category.assoc, biproduct.lift_π, biproduct.ι_π]
state_before: 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
⊢ (ι f j ≫ toSubtype f p) ≫ π (Subtype.restrict p f) i =
    (if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0) ≫ π (Subtype.restrict p f) i

tactic: by_cases h : p j
state_before: 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 : j = ↑i then eqToHom (_ : f j = f ↑i) else 0) =
    (if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0) ≫ π (Subtype.restrict p f) i

tactic: rw [dif_pos h, biproduct.ι_π]
state_before: 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 : j = ↑i then eqToHom (_ : f j = f ↑i) else 0) =
    (if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0) ≫ π (Subtype.restrict p f) i

tactic: split_ifs with h₁ h₂ h₂
state_before: 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 : j = ↑i then eqToHom (_ : f j = f ↑i) else 0) =
    if h_1 : { val := j, property := h } = i then
      eqToHom (_ : Subtype.restrict p f { val := j, property := h } = Subtype.restrict p f i)
    else 0

tactic: exacts [rfl, False.elim (h₂ (Subtype.ext h₁)), False.elim (h₁ (congr_arg Subtype.val h₂)), rfl]
state_before: 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₁ : j = ↑i
h₂ : { val := j, property := h } = i
⊢ eqToHom (_ : f j = f ↑i) = eqToHom (_ : Subtype.restrict p f { val := j, property := h } = Subtype.restrict p f i)

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₁ : j = ↑i
h₂ : ¬{ val := j, property := h } = i
⊢ eqToHom (_ : f j = f ↑i) = 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₁ : ¬j = ↑i
h₂ : { val := j, property := h } = i
⊢ 0 = eqToHom (_ : Subtype.restrict p f { val := j, property := h } = Subtype.restrict p f i)

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₁ : ¬j = ↑i
h₂ : ¬{ val := j, property := h } = i
⊢ 0 = 0

tactic: rw [dif_neg h, dif_neg (show j ≠ i from fun h₂ => h (h₂.symm ▸ i.2)), zero_comp]
state_before: 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 : j = ↑i then eqToHom (_ : f j = f ↑i) else 0) =
    (if h : p j then ι (Subtype.restrict p f) { val := j, property := h } else 0) ≫ π (Subtype.restrict p f) i