-- Lean 4 proof step from Mathlib.Algebra.Category.Ring.FinitePresentation (goal)
Goal:
J : Type uJ
inst : Category.{vJ, uJ} J
inst_1 : IsFiltered.{vJ, uJ} J
R : CommRingCat
F : CategoryTheory.Functor.{vJ, u, uJ, u + 1} J CommRingCat
α : Functor.obj (Functor.const J) R ⟶ F
S : CommRingCat
c : Cocone F
hc : IsColimit c
inst_2 :
  PreservesColimit F
    (forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
      CommRingCat.carrier))
g : S ⟶ c.pt
hc' :
  IsColimit (F :=
    F ⋙
      forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
        CommRingCat.carrier))
    (Functor.mapCocone
      (forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
        CommRingCat.carrier))
      c)
n : ℕ
P : CommRingCat := CommRingCat.of (MvPolynomial (Fin n) (↑R : Type u))
iP : R ⟶ P := CommRingCat.ofHom MvPolynomial.C
π : P ⟶ S
hg : ∀ (i : J), (iP ≫ π) ≫ g = α.app i ≫ c.ι.app i
this : Algebra (↑R : Type u) (↑S : Type u) := (CommRingCat.Hom.hom (iP ≫ π)).toAlgebra
hn :
  ∃ (f : MvPolynomial (Fin n) (↑R : Type u) →ₐ[(↑R : Type u)] (↑S : Type u)),
    Function.Surjective (α := MvPolynomial (Fin n) (↑R : Type u)) (β := (↑S : Type u))
        (⇑f : (a : MvPolynomial (Fin n) (↑R : Type u)) → (↑S : Type u)) ∧
      Ideal.FG (ker f.toRingHom)
hπ :
  Function.Surjective (α := (↑P : Type u)) (β := (↑S : Type u))
    (⇑(ConcreteCategory.hom (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
          CommRingCat.carrier) π) :
      (a : (↑P : Type u)) → (↑S : Type u))
s : Finset (↑P : Type u)
hs : Eq (α := Ideal (↑P : Type u)) (Ideal.span (↑s : Set (↑P : Type u))) (ker (CommRingCat.Hom.hom π))
j : (i : Fin n) → J
x :
  (i : Fin n) →
    (fun (X : Type u) ↦ X)
      ((F ⋙
            forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
              CommRingCat.carrier)).obj
        (j i))
h :
  ∀ (i : Fin n),
    Eq (α :=
      (fun (X : Type u) ↦ X)
        (Functor.obj.{vJ, u, uJ, u + 1}
          (Functor.obj (Functor.const J)
            (Cocone.pt (F :=
              F ⋙
                forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
                  CommRingCat.carrier))
              (Functor.mapCocone
                (forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
                  CommRingCat.carrier))
                c)))
          (j i)))
      ((ConcreteCategory.hom (FC := TypeCat.Fun)
              (NatTrans.app
                (Cocone.ι
                  (Functor.mapCocone
                    (forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
                      CommRingCat.carrier))
                    c))
                (j i)) :
            (a : (fun (X : Type u) ↦ X) ((F ⋙ forget CommRingCat).obj (j i))) →
              (fun (X : Type u) ↦ X) (((Functor.const J).obj ((forget CommRingCat).mapCocone c).pt).obj (j i)))
          (x i) :
        (fun (X : Type u) ↦ X)
          (Functor.obj.{vJ, u, uJ, u + 1}
            (Functor.obj (Functor.const J)
              (Cocone.pt (F :=
                F ⋙
                  forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
                    CommRingCat.carrier))
                (Functor.mapCocone
                  (forget CommRingCat (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
                    CommRingCat.carrier))
                  c)))
            (j i)))
      ((ConcreteCategory.hom (FC := fun (R S : CommRingCat.{u}) ↦ (↑R : Type u) →+* (↑S : Type u)) (CC :=
              CommRingCat.carrier) (π ≫ g) :
            (a : (↑P : Type u)) → (↑c.pt : Type u))
          (MvPolynomial.X i) :
        (↑c.pt : Type u))
⊢ ∃ (i : J) (g' : P ⟶ F.obj i), π ≫ g = g' ≫ c.ι.app i ∧ iP ≫ g' = α.app i
have obtain : ∀ (i : J) (hi : (a : Fin n) → j a ⟶ i), ∃ (i : J) (g' : P ⟶ F.obj i), π ≫ g = g' ≫ c.ι.app i ∧ iP ≫ g' = α.app i
Tactic: obtain ⟨i, ⟨hi⟩⟩ : ∃ i, Nonempty (∀ a, (j a ⟶ i)) := by
      have : ∃ i, ∀ a, Nonempty (j a ⟶ i) := by
        simpa using IsFiltered.sup_objs_exists (Finset.univ.image j)
      simpa [← exists_true_iff_nonempty, Classical.skolem, -exists_const_iff] using this