Module: Mathlib.AlgebraicGeometry.AffineTransitionLimit

Goal state before:
pp: I : Type u
inst✝⁵ : Category.{u, u} I
S X : Scheme
D : I ⥤ Scheme
t : D ⟶ (Functor.const I).obj S
f : X ⟶ S
inst✝⁴ : ∀ (i : I), CompactSpace ↥(D.obj i)
inst✝³ : LocallyOfFiniteType f
inst✝² : IsCofiltered I
inst✝¹ : ∀ {i j : I} (f : i ⟶ j), IsAffineHom (D.map f)
A : ExistsHomHomCompEqCompAux D t f
inst✝ : ∀ (i : I), IsAffineHom (A.c.π.app i)
j : A.𝒰D.I₀
this✝² : IsAffine (A.𝒰D.X j)
this✝¹ : ∀ (i : Over A.i'), IsAffine ((Over.post D ⋙ Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).obj i)
this✝ : IsAffine ((Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).mapCone ((Over.conePost D A.i').obj A.c)).pt
this : LocallyOfFiniteType ((A.𝒰X j.fst.fst).f j.fst.snd ≫ Scheme.Cover.pullbackHom A.𝒰S f j.fst.fst)
H₁ :
  pullback.fst (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      D.map A.hii' ≫ A.a =
    pullback.snd (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      pullback.fst ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst))
          ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst)) ≫
        (A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.fst f (A.𝒰S.f j.fst.fst)
H₂ :
  pullback.fst (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      D.map A.hii' ≫ A.b =
    pullback.snd (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      pullback.snd ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst))
          ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst)) ≫
        (A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.fst f (A.𝒰S.f j.fst.fst)
⊢ ∃ k hki',
    (Precoverage.ZeroHypercover.pullback₁ (D.map hki') A.𝒰D).f j ≫ D.map (hki' ≫ A.hii') ≫ A.a =
      (Precoverage.ZeroHypercover.pullback₁ (D.map hki') A.𝒰D).f j ≫ D.map (hki' ≫ A.hii') ≫ A.b

Tactic:
obtain ⟨k, hik, hjk, H⟩ := Scheme.exists_hom_hom_comp_eq_comp_of_isAffine_of_locallyOfFiniteType
    (Over.post D ⋙ Over.pullback (A.𝒰D.f j) ⋙ Over.forget _)
    ((Over.post D ⋙ Over.pullback (A.𝒰D.f j)).whiskerLeft (Comma.natTrans _ _) ≫
      (Functor.const _).map ((A.𝒰D₀.X j.1).affineCover.f j.2 ≫
      (Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).pullbackHom _ _ ≫
      pullback.fst _ _ ≫
      (A.𝒰X j.fst.fst).f j.fst.snd ≫ Scheme.Cover.pullbackHom A.𝒰S f j.fst.fst))
    (((A.𝒰X j.1.1).f j.1.2 ≫ A.𝒰S.pullbackHom f j.1.1))
    ((Over.pullback (A.𝒰D.f j) ⋙ Over.forget _).mapCone ((Over.conePost _ _).obj A.c))
    (by
      refine isLimitOfPreserves (Over.pullback (A.𝒰D.f j) ⋙ Over.forget _) ?_
      apply isLimitOfReflects (Over.forget (D.obj A.i'))
      exact (Functor.Initial.isLimitWhiskerEquiv (Over.forget A.i') A.c).symm A.hc)
    (i := Over.mk (𝟙 _))
    (pullback.snd _ _ ≫ (A.𝒰D₀.X j.1).affineCover.f j.2 ≫
      (Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).pullbackHom _ _ ≫
      pullback.fst _ _)
    (by simp)
    (j := Over.mk (𝟙 _))
    (pullback.snd _ _ ≫ (A.𝒰D₀.X j.1).affineCover.f j.2 ≫
      (Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).pullbackHom _ _ ≫
      pullback.snd _ _)
    (by simp [pullback.condition])
    (by
      rw [← cancel_mono ((A.𝒰X j.1.1).f j.1.2), ← cancel_mono (pullback.fst f (A.𝒰S.f j.1.1))]
      have H₃ := congr(pullback.fst (A.c.π.app A.i') (A.𝒰D.f j) ≫ $(A.hab))
      simp only [pullback.condition_assoc, 𝒰D, ← A.c.w A.hii', Category.assoc] at H₃
      simpa [Scheme.Cover.pullbackHom, g, ← H₁, ← H₂, -Cone.w, -Cone.w_assoc] using! H₃)

Goal state after:
I : Type u
inst✝⁵ : Category.{u, u} I
S X : Scheme
D : I ⥤ Scheme
t : D ⟶ (Functor.const I).obj S
f : X ⟶ S
inst✝⁴ : ∀ (i : I), CompactSpace ↥(D.obj i)
inst✝³ : LocallyOfFiniteType f
inst✝² : IsCofiltered I
inst✝¹ : ∀ {i j : I} (f : i ⟶ j), IsAffineHom (D.map f)
A : ExistsHomHomCompEqCompAux D t f
inst✝ : ∀ (i : I), IsAffineHom (A.c.π.app i)
j : A.𝒰D.I₀
this✝² : IsAffine (A.𝒰D.X j)
this✝¹ : ∀ (i : Over A.i'), IsAffine ((Over.post D ⋙ Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).obj i)
this✝ : IsAffine ((Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).mapCone ((Over.conePost D A.i').obj A.c)).pt
this : LocallyOfFiniteType ((A.𝒰X j.fst.fst).f j.fst.snd ≫ Scheme.Cover.pullbackHom A.𝒰S f j.fst.fst)
H₁ :
  pullback.fst (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      D.map A.hii' ≫ A.a =
    pullback.snd (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      pullback.fst ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst))
          ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst)) ≫
        (A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.fst f (A.𝒰S.f j.fst.fst)
H₂ :
  pullback.fst (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      D.map A.hii' ≫ A.b =
    pullback.snd (D.map A.hii' ≫ pullback.lift A.a A.b ⋯)
        ((Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩) ≫
      pullback.snd ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst))
          ((A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.snd f (A.𝒰S.f j.fst.fst)) ≫
        (A.𝒰X j.fst.fst).f j.fst.snd ≫ pullback.fst f (A.𝒰S.f j.fst.fst)
k : Over A.i'
hik hjk : k ⟶ Over.mk (𝟙 A.i')
H :
  (Over.post D ⋙ Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).map hik ≫
      pullback.snd ((Over.post D).obj (Over.mk (𝟙 A.i'))).hom (A.𝒰D.f j) ≫
        (A.𝒰D₀.X j.fst).affineCover.f j.snd ≫
          Scheme.Cover.pullbackHom (Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X) A.g ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩ ≫
            pullback.fst
              ((A.𝒰X ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.snd.1 ≫
                Scheme.Cover.pullbackHom A.𝒰S f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst)
              ((A.𝒰X ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.snd.2 ≫
                Scheme.Cover.pullbackHom A.𝒰S f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst) =
    (Over.post D ⋙ Over.pullback (A.𝒰D.f j) ⋙ Over.forget (A.𝒰D.X j)).map hjk ≫
      pullback.snd ((Over.post D).obj (Over.mk (𝟙 A.i'))).hom (A.𝒰D.f j) ≫
        (A.𝒰D₀.X j.fst).affineCover.f j.snd ≫
          Scheme.Cover.pullbackHom (Scheme.Pullback.diagonalCover f A.𝒰S A.𝒰X) A.g ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩ ≫
            pullback.snd
              ((A.𝒰X ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.snd.1 ≫
                Scheme.Cover.pullbackHom A.𝒰S f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst)
              ((A.𝒰X ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst).f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.snd.2 ≫
                Scheme.Cover.pullbackHom A.𝒰S f ⟨j.fst.fst, (j.fst.snd, j.fst.snd)⟩.fst)
⊢ ∃ k hki',
    (Precoverage.ZeroHypercover.pullback₁ (D.map hki') A.𝒰D).f j ≫ D.map (hki' ≫ A.hii') ≫ A.a =
      (Precoverage.ZeroHypercover.pullback₁ (D.map hki') A.𝒰D).f j ≫ D.map (hki' ≫ A.hii') ≫ A.b