Theorem: CategoryTheory.HomOrthogonal.matrixDecomposition_comp
File: Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean

tactic: ext (⟨c, ⟨⟩⟩⟨a, j_property⟩)
state_before: C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
i : ι
⊢ ↑(matrixDecomposition o) (z ≫ w) i = ↑(matrixDecomposition o) w i ⬝ ↑(matrixDecomposition o) z i

tactic: simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
state_before: case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
⊢ ↑(matrixDecomposition o) (z ≫ w) ((fun b => h b) c)
      { val := c, property := (_ : (fun b => h b) c = (fun b => h b) c) } { val := a, property := j_property } =
    (↑(matrixDecomposition o) w ((fun b => h b) c) ⬝ ↑(matrixDecomposition o) z ((fun b => h b) c))
      { val := c, property := (_ : (fun b => h b) c = (fun b => h b) c) } { val := a, property := j_property }

tactic: simp only [Matrix.mul_apply, Limits.biproduct.components,
  HomOrthogonal.matrixDecomposition_apply, Category.comp_id, Category.id_comp, Category.assoc,
  End.mul_def, eqToHom_refl, eqToHom_trans_assoc, Finset.sum_congr]
state_before: case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ ↑(matrixDecomposition o) (z ≫ w) ((fun b => h b) c)
      { val := c, property := (_ : (fun b => h b) c = (fun b => h b) c) } { val := a, property := j_property✝ } =
    (↑(matrixDecomposition o) w ((fun b => h b) c) ⬝ ↑(matrixDecomposition o) z ((fun b => h b) c))
      { val := c, property := (_ : (fun b => h b) c = (fun b => h b) c) } { val := a, property := j_property✝ }

tactic: conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
state_before: case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫ z ≫ w ≫ biproduct.π (fun b => s (h b)) c =
    Finset.sum Finset.univ fun x =>
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            biproduct.π (fun b => s (g b)) ↑x ≫ biproduct.ι (fun a => s (g a)) ↑x ≫ w ≫ biproduct.π (fun b => s (h b)) c

tactic: simp only [Preadditive.sum_comp, Preadditive.comp_sum]
state_before: case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫
          ((Finset.sum Finset.univ fun j => biproduct.π (fun b => s (g b)) j ≫ biproduct.ι (fun b => s (g b)) j) ≫ w) ≫
            biproduct.π (fun b => s (h b)) c =
    Finset.sum Finset.univ fun x =>
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            biproduct.π (fun b => s (g b)) ↑x ≫ biproduct.ι (fun a => s (g a)) ↑x ≫ w ≫ biproduct.π (fun b => s (h b)) c

tactic: apply Finset.sum_congr_set
state_before: case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ (Finset.sum Finset.univ fun j =>
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            ((biproduct.π (fun b => s (g b)) j ≫ biproduct.ι (fun b => s (g b)) j) ≫ w) ≫
              biproduct.π (fun b => s (h b)) c) =
    Finset.sum Finset.univ fun x =>
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            biproduct.π (fun b => s (g b)) ↑x ≫ biproduct.ι (fun a => s (g a)) ↑x ≫ w ≫ biproduct.π (fun b => s (h b)) c

tactic: intros
state_before: case a.mk.refl.h.mk.w
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ ∀ (x : β) (h_1 : x ∈ (fun a => g a) ⁻¹' {h c}),
    eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            ((biproduct.π (fun b => s (g b)) x ≫ biproduct.ι (fun b => s (g b)) x) ≫ w) ≫
              biproduct.π (fun b => s (h b)) c =
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
        biproduct.ι (fun a => s (f a)) a ≫
          z ≫
            biproduct.π (fun b => s (g b)) ↑{ val := x, property := h_1 } ≫
              biproduct.ι (fun a => s (g a)) ↑{ val := x, property := h_1 } ≫ w ≫ biproduct.π (fun b => s (h b)) c

tactic: simp
state_before: case a.mk.refl.h.mk.w
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
x✝ : β
h✝ : x✝ ∈ (fun a => g a) ⁻¹' {h c}
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫
          ((biproduct.π (fun b => s (g b)) x✝ ≫ biproduct.ι (fun b => s (g b)) x✝) ≫ w) ≫
            biproduct.π (fun b => s (h b)) c =
    eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫
          biproduct.π (fun b => s (g b)) ↑{ val := x✝, property := h✝ } ≫
            biproduct.ι (fun a => s (g a)) ↑{ val := x✝, property := h✝ } ≫ w ≫ biproduct.π (fun b => s (h b)) c

tactic: intro b nm
state_before: case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
⊢ ∀ (x : β),
    ¬x ∈ (fun a => g a) ⁻¹' {h c} →
      eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
          biproduct.ι (fun a => s (f a)) a ≫
            z ≫
              ((biproduct.π (fun b => s (g b)) x ≫ biproduct.ι (fun b => s (g b)) x) ≫ w) ≫
                biproduct.π (fun b => s (h b)) c =
        0

tactic: simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
state_before: case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
b : β
nm : ¬b ∈ (fun a => g a) ⁻¹' {h c}
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫
          ((biproduct.π (fun b => s (g b)) b ≫ biproduct.ι (fun b => s (g b)) b) ≫ w) ≫
            biproduct.π (fun b => s (h b)) c =
    0

tactic: simp only [Category.assoc]
state_before: case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
b : β
nm : ¬g b = h c
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫
          ((biproduct.π (fun b => s (g b)) b ≫ biproduct.ι (fun b => s (g b)) b) ≫ w) ≫
            biproduct.π (fun b => s (h b)) c =
    0

tactic: have : biproduct.ι (fun b ↦ s (g b)) b ≫ w ≫ biproduct.π (fun b ↦ s (h b)) c = 0 := by
  apply o.eq_zero nm
state_before: case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
b : β
nm : ¬g b = h c
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫ biproduct.π (fun b => s (g b)) b ≫ biproduct.ι (fun b => s (g b)) b ≫ w ≫ biproduct.π (fun b => s (h b)) c =
    0

tactic: simp only [this, comp_zero]
state_before: case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
b : β
nm : ¬g b = h c
this : biproduct.ι (fun b => s (g b)) b ≫ w ≫ biproduct.π (fun b => s (h b)) c = 0
⊢ eqToHom (_ : s (h c) = s (f ↑{ val := a, property := j_property✝ })) ≫
      biproduct.ι (fun a => s (f a)) a ≫
        z ≫ biproduct.π (fun b => s (g b)) b ≫ biproduct.ι (fun b => s (g b)) b ≫ w ≫ biproduct.π (fun b => s (h b)) c =
    0

tactic: apply o.eq_zero nm
state_before: C : Type u
inst✝⁵ : Category C
ι : Type u_1
s : ι → C
inst✝⁴ : Preadditive C
inst✝³ : HasFiniteBiproducts C
o : HomOrthogonal s
α β γ : Type
inst✝² : Fintype α
inst✝¹ : Fintype β
inst✝ : Fintype γ
f : α → ι
g : β → ι
h : γ → ι
z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)
w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)
c : γ
a : α
j_property✝ : a ∈ (fun a => f a) ⁻¹' {(fun b => h b) c}
j_property : f a = h c
b : β
nm : ¬g b = h c
⊢ biproduct.ι (fun b => s (g b)) b ≫ w ≫ biproduct.π (fun b => s (h b)) c = 0