l3lab/ntp-mathlib huggingface dataset:
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  

Proof state:
case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category.{v, u} 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 }

Next tactic:
simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  

Proof state:
case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category.{v, u} 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✝ }

Next 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]
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  

Proof state:
case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => 

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
rw [← Category.id_comp w, ← biproduct.total]
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  

Proof state:
case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
simp only [Preadditive.sum_comp, Preadditive.comp_sum]
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  

Proof state:
case a.mk.refl.h.mk
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
apply Finset.sum_congr_set
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · 

Proof state:
case a.mk.refl.h.mk.w
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
intros
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    

Proof state:
case a.mk.refl.h.mk.w
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
simp
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · 

Proof state:
case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category.{v, u} 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 ∉ (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

Next tactic:
intro b nm
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · intro b nm
    

Proof state:
case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · intro b nm
    simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
    

Proof state:
case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
simp only [Category.assoc]
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · intro b nm
    simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
    simp only [Category.assoc]
    -- porting note: this used to be 4 times `convert comp_zero`
    

Proof state:
case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
have : biproduct.ι (fun b ↦ s (g b)) b ≫ w ≫ biproduct.π (fun b ↦ s (h b)) c = 0 := by
      apply o.eq_zero nm
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · intro b nm
    simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
    simp only [Category.assoc]
    -- porting note: this used to be 4 times `convert comp_zero`
    have : biproduct.ι (fun b ↦ s (g b)) b ≫ w ≫ biproduct.π (fun b ↦ s (h b)) c = 0 := by
      

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
apply o.eq_zero nm
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Fintype α] [Fintype β]
    [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 : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
  ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩
  simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property
  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]
  conv_lhs => rw [← Category.id_comp w, ← biproduct.total]
  simp only [Preadditive.sum_comp, Preadditive.comp_sum]
  apply Finset.sum_congr_set
  · intros
    simp
  · intro b nm
    simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm
    simp only [Category.assoc]
    -- porting note: this used to be 4 times `convert comp_zero`
    have : biproduct.ι (fun b ↦ s (g b)) b ≫ w ≫ biproduct.π (fun b ↦ s (h b)) c = 0 := by
      apply o.eq_zero nm
    

Proof state:
case a.mk.refl.h.mk.w'
C : Type u
inst✝⁵ : Category.{v, u} 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

Next tactic:
simp only [this, comp_zero]