/-- `ιInvApp` is the right inverse of `D.ι i` on `U`. -/
theorem π_ιInvApp_π (i j : D.J) (U : Opens (D.U i).carrier) :
    D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U ≫ D.diagramOverOpenπ U j =
      D.diagramOverOpenπ U j := by
  -- Porting note : originally, the proof of monotonicity was left a blank and proved in the end
  -- but Lean 4 doesn't like this any more, so the proof is restructured
  rw [← @cancel_mono (f := (componentwiseDiagram 𝖣.diagram.multispan _).map
    (Quiver.Hom.op (WalkingMultispan.Hom.snd (i, j))) ≫ 𝟙 _) _ _ (by
    rw [Category.comp_id]
    apply (config := { allowSynthFailures := true }) mono_comp
    change Mono ((_ ≫ D.f j i).c.app _)
    rw [comp_c_app]
    apply (config := { allowSynthFailures := true }) mono_comp
    erw [D.ι_image_preimage_eq i j U]
    · infer_instance
    · have : IsIso (D.t i j).c := by apply c_isIso_of_iso
      infer_instance)]
  simp_rw [Category.assoc]
  rw [limit.w_assoc]
  erw [limit.lift_π_assoc]
  rw [Category.comp_id, Category.comp_id]
  change _ ≫ _ ≫ (_ ≫ _) ≫ _ = _
  rw [congr_app (D.t_id _), id_c_app]
  simp_rw [Category.assoc]
  rw [← Functor.map_comp_assoc]
  -- Porting note : change `rw` to `erw`
  erw [IsOpenImmersion.inv_naturality_assoc]
  erw [IsOpenImmersion.app_invApp_assoc]
  iterate 3 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ diagramOverOpenπ D U i ≫
      (CategoryTheory.GlueData.U D.toGlueData i).presheaf.map
          (((eqToIso
                  (_ :
                    op U =
                      op
                        ((Opens.map
                              (colimit.ι (MultispanIndex.multispan (diagram D.toGlueData))
                                  (op (WalkingMultispan.right i)).unop).base).obj
                          ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)))).inv ≫
              (homOfLE (_ : ⇑(f D.toGlueData i i).base '' (⇑(f D.toGlueData i i).base ⁻¹' U.carrier) ⊆ U.carrier)).op) ≫
            (IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData i i))).op.map
              (𝟙 ((Opens.map (f D.toGlueData i i).base).op.obj (op U)) ≫
                eqToHom
                  (_ :
                    (Opens.map (𝟙 (V D.toGlueData (i, i))).base).op.obj
                        ((Opens.map (f D.toGlueData i i).base).op.obj (op U)) =
                      (Opens.map (t D.toGlueData i i).base).op.obj
                        ((Opens.map (f D.toGlueData i i).base).op.obj (op U))))) ≫
        (CategoryTheory.GlueData.U D.toGlueData i).presheaf.map
            (eqToHom
                (_ :
                  (Opens.map (ι D.toGlueData i).base).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U) =
                    (IsOpenImmersion.openFunctor (_ : IsOpenImmersion (f D.toGlueData i i))).obj
                      ((Opens.map (t D.toGlueData i i).base).obj ((Opens.map (f D.toGlueData i i).base).obj U)))).op ≫
          (f D.toGlueData i j).c.app
              (op
                ((Opens.map (ι D.toGlueData i).base).obj
                  ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U))) ≫
            (V D.toGlueData (i, j)).presheaf.map
              (eqToHom
                (_ :
                  (Opens.map (f D.toGlueData i j).base).op.obj
                      (op
                        ((Opens.map (ι D.toGlueData i).base).obj
                          ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U))) =
                    op
                      ((Opens.map
                            (colimit.ι (MultispanIndex.multispan (diagram D.toGlueData))
                                (op (WalkingMultispan.left (i, j))).unop).base).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)))) =
    limit.π (diagramOverOpen D U) (op (WalkingMultispan.left (i, j)))

Next tactic:
rw [← Functor.map_comp_assoc]