/-- A product of distinguished triangles is distinguished -/
lemma productTriangle_distinguished {J : Type*} (T : J → Triangle C)
    (hT : ∀ j, T j ∈ distTriang C)
    [HasProduct (fun j => (T j).obj₁)] [HasProduct (fun j => (T j).obj₂)]
    [HasProduct (fun j => (T j).obj₃)] [HasProduct (fun j => (T j).obj₁⟦(1 : ℤ)⟧)] :
    productTriangle T ∈ distTriang C := by
  /- The proof proceeds by constructing a morphism of triangles
    `φ' : T' ⟶ productTriangle T` with `T'` distinguished, and such that
    `φ'.hom₁` and `φ'.hom₂` are identities. Then, it suffices to show that
    `φ'.hom₃` is an isomorphism, which is achieved by using Yoneda's lemma
    and diagram chases. -/
  let f₁ := Pi.map (fun j => (T j).mor₁)
  obtain ⟨Z, f₂, f₃, hT'⟩ := distinguished_cocone_triangle f₁
  let T' := Triangle.mk f₁ f₂ f₃
  change T' ∈ distTriang C at hT'
  let φ : ∀ j, T' ⟶ T j := fun j => completeDistinguishedTriangleMorphism _ _
    hT' (hT j) (Pi.π _ j) (Pi.π _ j) (by simp)
  let φ' := productTriangle.lift _ φ
  have h₁ : φ'.hom₁ = 𝟙 _ := by aesop_cat
  have h₂ : φ'.hom₂ = 𝟙 _ := by aesop_cat
  have : IsIso φ'.hom₁ := by rw [h₁]; infer_instance
  have : IsIso φ'.hom₂ := by rw [h₂]; infer_instance
  suffices IsIso φ'.hom₃ by
    have : IsIso φ' := by
      apply Triangle.isIso_of_isIsos
      

Proof state:
case h₁
C : Type u
inst✝⁸ : Category.{v, u} C
inst✝⁷ : HasZeroObject C
inst✝⁶ : HasShift C ℤ
inst✝⁵ : Preadditive C
inst✝⁴ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
J : Type u_1
T : J → Triangle C
hT : ∀ (j : J), T j ∈ distinguishedTriangles
inst✝³ : HasProduct fun j => (T j).obj₁
inst✝² : HasProduct fun j => (T j).obj₂
inst✝¹ : HasProduct fun j => (T j).obj₃
inst✝ : HasProduct fun j => (shiftFunctor C 1).obj (T j).obj₁
f₁ : (∏ fun j => (T j).obj₁) ⟶ ∏ fun j => (T j).obj₂ := Pi.map fun j => (T j).mor₁
Z : C
f₂ : (∏ fun j => (T j).obj₂) ⟶ Z
f₃ : Z ⟶ (shiftFunctor C 1).obj (∏ fun j => (T j).obj₁)
T' : Triangle C := Triangle.mk f₁ f₂ f₃
hT' : T' ∈ distinguishedTriangles
φ : (j : J) → T' ⟶ T j :=
  fun j =>
    completeDistinguishedTriangleMorphism T' (T j) hT' (_ : T j ∈ distinguishedTriangles) (Pi.π (fun j => (T j).obj₁) j)
      (Pi.π (fun j => (T j).obj₂) j)
      (_ :
        limMap (Discrete.natTrans fun X => (fun j => (T j).mor₁) X.as) ≫
            limit.π (Discrete.functor fun j => (T j).obj₂) { as := j } =
          Pi.π (fun j => (T j).obj₁) j ≫ (T j).mor₁)
φ' : T' ⟶ productTriangle fun j => T j := productTriangle.lift (fun j => T j) φ
h₁ : φ'.hom₁ = 𝟙 T'.obj₁
h₂ : φ'.hom₂ = 𝟙 T'.obj₂
this✝¹ : IsIso φ'.hom₁
this✝ : IsIso φ'.hom₂
this : IsIso φ'.hom₃
⊢ IsIso φ'.hom₁
case h₂
C : Type u
inst✝⁸ : Category.{v, u} C
inst✝⁷ : HasZeroObject C
inst✝⁶ : HasShift C ℤ
inst✝⁵ : Preadditive C
inst✝⁴ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
J : Type u_1
T : J → Triangle C
hT : ∀ (j : J), T j ∈ distinguishedTriangles
inst✝³ : HasProduct fun j => (T j).obj₁
inst✝² : HasProduct fun j => (T j).obj₂
inst✝¹ : HasProduct fun j => (T j).obj₃
inst✝ : HasProduct fun j => (shiftFunctor C 1).obj (T j).obj₁
f₁ : (∏ fun j => (T j).obj₁) ⟶ ∏ fun j => (T j).obj₂ := Pi.map fun j => (T j).mor₁
Z : C
f₂ : (∏ fun j => (T j).obj₂) ⟶ Z
f₃ : Z ⟶ (shiftFunctor C 1).obj (∏ fun j => (T j).obj₁)
T' : Triangle C := Triangle.mk f₁ f₂ f₃
hT' : T' ∈ distinguishedTriangles
φ : (j : J) → T' ⟶ T j :=
  fun j =>
    completeDistinguishedTriangleMorphism T' (T j) hT' (_ : T j ∈ distinguishedTriangles) (Pi.π (fun j => (T j).obj₁) j)
      (Pi.π (fun j => (T j).obj₂) j)
      (_ :
        limMap (Discrete.natTrans fun X => (fun j => (T j).mor₁) X.as) ≫
            limit.π (Discrete.functor fun j => (T j).obj₂) { as := j } =
          Pi.π (fun j => (T j).obj₁) j ≫ (T j).mor₁)
φ' : T' ⟶ productTriangle fun j => T j := productTriangle.lift (fun j => T j) φ
h₁ : φ'.hom₁ = 𝟙 T'.obj₁
h₂ : φ'.hom₂ = 𝟙 T'.obj₂
this✝¹ : IsIso φ'.hom₁
this✝ : IsIso φ'.hom₂
this : IsIso φ'.hom₃
⊢ IsIso φ'.hom₂
case h₃
C : Type u
inst✝⁸ : Category.{v, u} C
inst✝⁷ : HasZeroObject C
inst✝⁶ : HasShift C ℤ
inst✝⁵ : Preadditive C
inst✝⁴ : ∀ (n : ℤ), Functor.Additive (shiftFunctor C n)
hC : Pretriangulated C
J : Type u_1
T : J → Triangle C
hT : ∀ (j : J), T j ∈ distinguishedTriangles
inst✝³ : HasProduct fun j => (T j).obj₁
inst✝² : HasProduct fun j => (T j).obj₂
inst✝¹ : HasProduct fun j => (T j).obj₃
inst✝ : HasProduct fun j => (shiftFunctor C 1).obj (T j).obj₁
f₁ : (∏ fun j => (T j).obj₁) ⟶ ∏ fun j => (T j).obj₂ := Pi.map fun j => (T j).mor₁
Z : C
f₂ : (∏ fun j => (T j).obj₂) ⟶ Z
f₃ : Z ⟶ (shiftFunctor C 1).obj (∏ fun j => (T j).obj₁)
T' : Triangle C := Triangle.mk f₁ f₂ f₃
hT' : T' ∈ distinguishedTriangles
φ : (j : J) → T' ⟶ T j :=
  fun j =>
    completeDistinguishedTriangleMorphism T' (T j) hT' (_ : T j ∈ distinguishedTriangles) (Pi.π (fun j => (T j).obj₁) j)
      (Pi.π (fun j => (T j).obj₂) j)
      (_ :
        limMap (Discrete.natTrans fun X => (fun j => (T j).mor₁) X.as) ≫
            limit.π (Discrete.functor fun j => (T j).obj₂) { as := j } =
          Pi.π (fun j => (T j).obj₁) j ≫ (T j).mor₁)
φ' : T' ⟶ productTriangle fun j => T j := productTriangle.lift (fun j => T j) φ
h₁ : φ'.hom₁ = 𝟙 T'.obj₁
h₂ : φ'.hom₂ = 𝟙 T'.obj₂
this✝¹ : IsIso φ'.hom₁
this✝ : IsIso φ'.hom₂
this : IsIso φ'.hom₃
⊢ IsIso φ'.hom₃

Next tactic:
all_goals infer_instance