instance RepresentablyFlat.comp (F : C ⥤ D) (G : D ⥤ E) [RepresentablyFlat F]
    [RepresentablyFlat G] : RepresentablyFlat (F ⋙ G) := by
  constructor
  intro X
  have : Nonempty (StructuredArrow X (F ⋙ G)) := by
    have f₁ : StructuredArrow X G := Nonempty.some inferInstance
    have f₂ : StructuredArrow f₁.right F := Nonempty.some inferInstance
    exact ⟨StructuredArrow.mk (f₁.hom ≫ G.map f₂.hom)⟩
  suffices : IsCofilteredOrEmpty (StructuredArrow X (F ⋙ G))
  · constructor
  constructor
  · intro Y Z
    let W :=
      @IsCofiltered.min (StructuredArrow X G) _ _ (StructuredArrow.mk Y.hom)
        (StructuredArrow.mk Z.hom)
    let Y' : W ⟶ _ := IsCofiltered.minToLeft _ _
    let Z' : W ⟶ _ := IsCofiltered.minToRight _ _
    let W' :=
      @IsCofiltered.min (StructuredArrow W.right F) _ _ (StructuredArrow.mk Y'.right)
        (StructuredArrow.mk Z'.right)
    let Y'' : W' ⟶ _ := IsCofiltered.minToLeft _ _
    let Z'' : W' ⟶ _ := IsCofiltered.minToRight _ _
    use StructuredArrow.mk (W.hom ≫ G.map W'.hom)
    use StructuredArrow.homMk Y''.right (by simp [← G.map_comp])
    use StructuredArrow.homMk Z''.right (by simp [← G.map_comp])
  · intro Y Z f g
    let W :=
      @IsCofiltered.eq (StructuredArrow X G) _ _ (StructuredArrow.mk Y.hom)
        (StructuredArrow.mk Z.hom) (StructuredArrow.homMk (F.map f.right) (StructuredArrow.w f))
        (StructuredArrow.homMk (F.map g.right) (StructuredArrow.w g))
    let h : W ⟶ _ := IsCofiltered.eqHom _ _
    let h_cond : h ≫ _ = h ≫ _ := IsCofiltered.eq_condition _ _
    let W' :=
      @IsCofiltered.eq (StructuredArrow W.right F) _ _ (StructuredArrow.mk h.right)
        (StructuredArrow.mk (h.right ≫ F.map f.right)) (StructuredArrow.homMk f.right rfl)
        (StructuredArrow.homMk g.right (congr_arg CommaMorphism.right h_cond).symm)
    let h' : W' ⟶ _ := IsCofiltered.eqHom _ _
    let h'_cond : h' ≫ _ = h' ≫ _ := IsCofiltered.eq_condition _ _
    use StructuredArrow.mk (W.hom ≫ G.map W'.hom)
    use StructuredArrow.homMk h'.right (by simp [← G.map_comp])
    

Proof state:
case h
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
E : Type u₃
inst✝² : Category.{v₃, u₃} E
F : C ⥤ D
G : D ⥤ E
inst✝¹ : RepresentablyFlat F
inst✝ : RepresentablyFlat G
X : E
this : Nonempty (StructuredArrow X (F ⋙ G))
Y Z : StructuredArrow X (F ⋙ G)
f g : Y ⟶ Z
W : StructuredArrow X G :=
  IsCofiltered.eq (StructuredArrow.homMk (F.map f.right)) (StructuredArrow.homMk (F.map g.right))
h : W ⟶ StructuredArrow.mk Y.hom :=
  IsCofiltered.eqHom (StructuredArrow.homMk (F.map f.right)) (StructuredArrow.homMk (F.map g.right))
h_cond : h ≫ StructuredArrow.homMk (F.map f.right) = h ≫ StructuredArrow.homMk (F.map g.right) :=
  IsCofiltered.eq_condition (StructuredArrow.homMk (F.map f.right)) (StructuredArrow.homMk (F.map g.right))
W' : StructuredArrow W.right F := IsCofiltered.eq (StructuredArrow.homMk f.right) (StructuredArrow.homMk g.right)
h' : W' ⟶ StructuredArrow.mk h.right :=
  IsCofiltered.eqHom (StructuredArrow.homMk f.right) (StructuredArrow.homMk g.right)
h'_cond : h' ≫ StructuredArrow.homMk f.right = h' ≫ StructuredArrow.homMk g.right :=
  IsCofiltered.eq_condition (StructuredArrow.homMk f.right) (StructuredArrow.homMk g.right)
⊢ StructuredArrow.homMk h'.right ≫ f = StructuredArrow.homMk h'.right ≫ g

Next tactic:
ext