Theorem: CategoryTheory.Mat_.isoBiproductEmbedding_hom
File: Mathlib/CategoryTheory/Preadditive/Mat.lean

Proof steps:
state_before: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ ((biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
      biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) =
    𝟙 M
state_after: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) =
    𝟙 M
tactic: simp only [biproduct.lift_desc]
state_before: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) =
    𝟙 M
state_after: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) i
      j =
    𝟙 M i j
tactic: funext i j
state_before: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) i
      j =
    𝟙 M i j
state_after: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) i
      j =
    if h : i = j then eqToHom ⋯ else 0
tactic: dsimp [id_def]
state_before: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (∑ j : M.ι, (fun j_1 k => if h : j_1 = j then eqToHom ⋯ else 0) ≫ fun j_1 k => if h : j = k then eqToHom ⋯ else 0) i
      j =
    if h : i = j then eqToHom ⋯ else 0
state_after: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j =
    if h : i = j then eqToHom ⋯ else 0

case h.h.h₀
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ∀ b ∈ Finset.univ,
    b ≠ i → ((fun j k => if h : j = b then eqToHom ⋯ else 0) ≫ fun j k => if h : b = k then eqToHom ⋯ else 0) i j = 0

case h.h.h₁
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ i ∉ Finset.univ →
    ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j = 0
tactic: rw [Finset.sum_apply, Finset.sum_apply, Finset.sum_eq_single i]
state_before: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j =
    if h : i = j then eqToHom ⋯ else 0

case h.h.h₀
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ∀ b ∈ Finset.univ,
    b ≠ i → ((fun j k => if h : j = b then eqToHom ⋯ else 0) ≫ fun j k => if h : b = k then eqToHom ⋯ else 0) i j = 0

case h.h.h₁
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ i ∉ Finset.univ →
    ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j = 0
state_after: case h.h.h₀
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ∀ b ∈ Finset.univ,
    b ≠ i → ((fun j k => if h : j = b then eqToHom ⋯ else 0) ≫ fun j k => if h : b = k then eqToHom ⋯ else 0) i j = 0

case h.h.h₁
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ i ∉ Finset.univ →
    ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j = 0

case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j =
    if h : i = j then eqToHom ⋯ else 0
tactic: rotate_left
state_before: case h.h
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j k => if h : j = i then eqToHom ⋯ else 0) ≫ fun j k => if h : i = k then eqToHom ⋯ else 0) i j =
    if h : i = j then eqToHom ⋯ else 0
state_after: no goals
tactic: simp
state_before: C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
      biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) =
    𝟙 (⨁ fun i => (embedding C).obj (M.X i))
state_after: case w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ ∀ (j : M.ι),
    ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
          biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
        biproduct.π (fun i => (embedding C).obj (M.X i)) j =
      𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) j
tactic: apply biproduct.hom_ext
state_before: case w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
⊢ ∀ (j : M.ι),
    ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
          biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
        biproduct.π (fun i => (embedding C).obj (M.X i)) j =
      𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) j
state_after: case w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i : M.ι
⊢ ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
        biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
      biproduct.π (fun i => (embedding C).obj (M.X i)) i =
    𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
tactic: intro i
state_before: case w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i : M.ι
⊢ ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
        biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
      biproduct.π (fun i => (embedding C).obj (M.X i)) i =
    𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
state_after: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i : M.ι
⊢ ∀ (j : M.ι),
    biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
        ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
            biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
          biproduct.π (fun i => (embedding C).obj (M.X i)) i =
      biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
        𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
tactic: apply biproduct.hom_ext'
state_before: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i : M.ι
⊢ ∀ (j : M.ι),
    biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
        ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
            biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
          biproduct.π (fun i => (embedding C).obj (M.X i)) i =
      biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
        𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
state_after: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
      ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
          biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
        biproduct.π (fun i => (embedding C).obj (M.X i)) i =
    biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
      𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
tactic: intro j
state_before: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
      ((biproduct.desc fun i j k => if h : i = k then eqToHom ⋯ else 0) ≫
          biproduct.lift fun i j k => if h : j = i then eqToHom ⋯ else 0) ≫
        biproduct.π (fun i => (embedding C).obj (M.X i)) i =
    biproduct.ι (fun i => (embedding C).obj (M.X i)) j ≫
      𝟙 (⨁ fun i => (embedding C).obj (M.X i)) ≫ biproduct.π (fun i => (embedding C).obj (M.X i)) i
state_after: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j_1 k => if h : j = k then eqToHom ⋯ else 0) ≫ fun j k => if h : j = i then eqToHom ⋯ else 0) =
    if h : j = i then eqToHom ⋯ else 0
tactic: simp only [Category.id_comp, Category.assoc, biproduct.lift_π, biproduct.ι_desc_assoc,
      biproduct.ι_π]
state_before: case w.w
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j_1 k => if h : j = k then eqToHom ⋯ else 0) ≫ fun j k => if h : j = i then eqToHom ⋯ else 0) =
    if h : j = i then eqToHom ⋯ else 0
state_after: case w.w.H.unit.unit
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j_1 k => if h : j = k then eqToHom ⋯ else 0) ≫ fun j k => if h : j = i then eqToHom ⋯ else 0) PUnit.unit
      PUnit.unit =
    (if h : j = i then eqToHom ⋯ else 0) PUnit.unit PUnit.unit
tactic: ext ⟨⟩ ⟨⟩
state_before: case w.w.H.unit.unit
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ ((fun j_1 k => if h : j = k then eqToHom ⋯ else 0) ≫ fun j k => if h : j = i then eqToHom ⋯ else 0) PUnit.unit
      PUnit.unit =
    (if h : j = i then eqToHom ⋯ else 0) PUnit.unit PUnit.unit
state_after: case w.w.H.unit.unit
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (if h : j = i then eqToHom ⋯ else 0) = (if h : j = i then eqToHom ⋯ else 0) PUnit.unit PUnit.unit
tactic: simp only [embedding, comp_apply, comp_dite, dite_comp, comp_zero, zero_comp,
      Finset.sum_dite_eq', Finset.mem_univ, ite_true, eqToHom_refl, Category.comp_id]
state_before: case w.w.H.unit.unit
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
⊢ (if h : j = i then eqToHom ⋯ else 0) = (if h : j = i then eqToHom ⋯ else 0) PUnit.unit PUnit.unit
state_after: case pos
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
h : j = i
⊢ eqToHom ⋯ = eqToHom ⋯ PUnit.unit PUnit.unit

case neg
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
inst✝ : Preadditive C
M : Mat_ C
i j : M.ι
h : ¬j = i
⊢ 0 = 0 PUnit.unit PUnit.unit
tactic: split_ifs with h