-- Module: Mathlib.CategoryTheory.GradedObject.Trifunctor
Goal:
C₁ : Type u_1
C₂ : Type u_2
C₃ : Type u_3
C₄ : Type u_4
C₁₂ : Type u_5
C₂₃ : Type u_6
inst : Category.{v_1, u_1} C₁
inst_1 : Category.{v_2, u_2} C₂
inst_2 : Category.{v_3, u_3} C₃
inst_3 : Category.{v_4, u_4} C₄
inst_4 : Category.{v_5, u_5} C₁₂
inst_5 : Category.{v_6, u_6} C₂₃
F₁₂ : C₁ ⥤ Functor.{v_2, v_5, u_2, u_5} C₂ C₁₂
G : C₁₂ ⥤ Functor.{v_3, v_4, u_3, u_4} C₃ C₄
I₁ : Type u_7
I₂ : Type u_8
I₃ : Type u_9
J : Type u_10
r : I₁ × I₂ × I₃ → J
ρ₁₂ : BifunctorComp₁₂IndexData.{u_7, u_8, u_9, u_10, u_11} r
X₁ : GradedObject I₁ C₁
X₂ : GradedObject I₂ C₂
X₃ : GradedObject I₃ C₃
inst_6 : (((mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).HasMap ρ₁₂.p
inst_7 : ((Functor.obj (mapBifunctor G ρ₁₂.I₁₂ I₃) (mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj X₃).HasMap ρ₁₂.q
H : HasGoodTrifunctor₁₂Obj F₁₂ G ρ₁₂ X₁ X₂ X₃
j : J
c₁₂ : (i₁₂ : ρ₁₂.I₁₂) → (((mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).CofanMapObjFun ρ₁₂.p i₁₂ :=
  fun (i₁₂ : ρ₁₂.I₁₂) ↦ (((mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).cofanMapObj ρ₁₂.p i₁₂
h₁₂ : (i₁₂ : ρ₁₂.I₁₂) → IsColimit (c₁₂ i₁₂)
c : ((Functor.obj (mapBifunctor G ρ₁₂.I₁₂ I₃) (mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj X₃).CofanMapObjFun ρ₁₂.q j :=
  ((Functor.obj (mapBifunctor G ρ₁₂.I₁₂ I₃) (mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj X₃).cofanMapObj ρ₁₂.q j
hc : IsColimit c
c₁₂' : (i : (↑(ρ₁₂.q ⁻¹' {j}) : Type (max u_9 u_11))) →
  Cocone (J := Discrete (↑(ρ₁₂.p ⁻¹' {(↑i : ρ₁₂.I₁₂ × I₃).1}) : Type (max u_7 u_8)))
    (Discrete.functor ((((mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).mapObjFun ρ₁₂.p (↑i : ρ₁₂.I₁₂ × I₃).1) ⋙
      G.flip.obj (X₃ (↑i : ρ₁₂.I₁₂ × I₃).2)) :=
  fun (i : (↑(ρ₁₂.q ⁻¹' {j}) : Type (max u_9 u_11))) ↦
    (G.flip.obj (X₃ (↑i : ρ₁₂.I₁₂ × I₃).2)).mapCocone (c₁₂ (↑i : ρ₁₂.I₁₂ × I₃).1)
hc₁₂' : (i : (↑(ρ₁₂.q ⁻¹' {j}) : Type (max u_9 u_11))) → IsColimit (c₁₂' i)
Z : GradedObject (I₁ × I₂ × I₃) C₄ := (((mapTrifunctor (bifunctorComp₁₂ F₁₂ G) I₁ I₂ I₃).obj X₁).obj X₂).obj X₃
p' : I₁ × I₂ × I₃ → Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃ :=
  fun (x : I₁ × I₂ × I₃) ↦
    match (motive := I₁ × I₂ × I₃ → Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) x with
    | (i₁, i₂, i₃) => (ρ₁₂.p (i₁, i₂), i₃)
e : (i₁₂ : ρ₁₂.I₁₂) →
  (i₃ : I₃) → (↑(p' ⁻¹' {(i₁₂, i₃)}) : Type (max (max u_7 u_8) u_9)) ≃ (↑(ρ₁₂.p ⁻¹' {i₁₂}) : Type (max u_7 u_8)) :=
  fun (i₁₂ : ρ₁₂.I₁₂) (i₃ : I₃) ↦
    {
      toFun := fun (x : (↑(p' ⁻¹' {(i₁₂, i₃)}) : Type (max (max u_7 u_8) u_9))) ↦
        match (motive :=
          (↑(p' ⁻¹' {(i₁₂, i₃)}) : Type (max (max u_7 u_8) u_9)) → (↑(ρ₁₂.p ⁻¹' {i₁₂}) : Type (max u_7 u_8))) x with
        | ⟨(i₁, i₂, i₃'), hi⟩ => Subtype.mk (p := fun (x : I₁ × I₂) ↦ x ∈ ρ₁₂.p ⁻¹' {i₁₂}) (i₁, i₂) ⋯,
      invFun := fun (x : (↑(ρ₁₂.p ⁻¹' {i₁₂}) : Type (max u_7 u_8))) ↦
        match (motive :=
          (↑(ρ₁₂.p ⁻¹' {i₁₂}) : Type (max u_7 u_8)) → (↑(p' ⁻¹' {(i₁₂, i₃)}) : Type (max (max u_7 u_8) u_9))) x with
        | ⟨(i₁, i₂), hi⟩ => Subtype.mk (p := fun (x : I₁ × I₂ × I₃) ↦ x ∈ p' ⁻¹' {(i₁₂, i₃)}) (i₁, i₂, i₃) ⋯,
      left_inv := ⋯, right_inv := ⋯ }
x : (↑(ρ₁₂.q ⁻¹' {j}) : Type (max u_9 u_11))
i₁₂ : ρ₁₂.I₁₂
i₃ : I₃
hi : (i₁₂, i₃) ∈ ρ₁₂.q ⁻¹' {j}
refine :
  ∀
    (x :
      Discrete
        (↑(p' ⁻¹'
              {((↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                      ρ₁₂.I₁₂ × I₃).1,
                  (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                      ρ₁₂.I₁₂ × I₃).2)}) :
          Type (max (max u_7 u_8) u_9)))
    (i₁ : I₁) (i₂ : I₂) (i₃' : I₃)
    (hi_1 :
      (i₁, i₂, i₃') ∈
        p' ⁻¹'
          {((↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                  ρ₁₂.I₁₂ × I₃).1,
              (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                  ρ₁₂.I₁₂ × I₃).2)}),
    X₃
        (↑{
                    as :=
                      Subtype.mk (p := fun (x : I₁ × I₂ × I₃) ↦
                        x ∈
                          p' ⁻¹'
                            {((↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃)
                                        hi) :
                                    ρ₁₂.I₁₂ × I₃).1,
                                (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃)
                                        hi) :
                                    ρ₁₂.I₁₂ × I₃).2)})
                        (i₁, i₂, i₃') hi_1 :
                    Discrete
                      (↑(p' ⁻¹'
                            {((↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃)
                                        hi) :
                                    ρ₁₂.I₁₂ × I₃).1,
                                (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃)
                                        hi) :
                                    ρ₁₂.I₁₂ × I₃).2)}) :
                        Type (max (max u_7 u_8) u_9)) }.as :
              I₁ × I₂ × I₃).2.2 =
      X₃ (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) : ρ₁₂.I₁₂ × I₃).2
⊢ Discrete.functor
      (Z.mapObjFun p'
        ((↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) : ρ₁₂.I₁₂ × I₃).1,
          (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
              ρ₁₂.I₁₂ × I₃).2)) ≅
    (Discrete.equivalence (e i₁₂ i₃)).functor ⋙
      Discrete.functor
          ((((mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).mapObjFun ρ₁₂.p
            (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                ρ₁₂.I₁₂ × I₃).1) ⋙
        G.flip.obj
          (X₃
            (↑(Subtype.mk (p := fun (x : Prod.{u_11, u_9} ρ₁₂.I₁₂ I₃) ↦ x ∈ ρ₁₂.q ⁻¹' {j}) (i₁₂, i₃) hi) :
                ρ₁₂.I₁₂ × I₃).2)

Tactic:
refine (Discrete.natIso (fun ⟨⟨i₁, i₂, i₃'⟩, hi⟩ =>
        (G.obj ((F₁₂.obj (X₁ i₁)).obj (X₂ i₂))).mapIso (eqToIso ?_)))