-- Lean 4 proof step from Mathlib.RingTheory.RingHom.Flat (goal)
Goal:
R S T A : Type u
inst : CommRing R
inst_1 : CommRing S
inst_2 : CommRing T
inst_3 : CommRing A
inst_4 : Algebra R S
inst_5 : Algebra R T
inst_6 : Algebra S T
inst_7 : IsScalarTower R S T
inst_8 : Algebra R A
inst_9 : Algebra S A
inst_10 : IsScalarTower R S A
h :
  CommRingCat.flat.{u} (X := CommRingCat.of (S ⊗[R] S)) (Y := CommRingCat.of S)
    (CommRingCat.ofHom (AlgHom.toRingHom (Algebra.TensorProduct.lmul' R)))
refine_4 :
  ∀ (x : (↑(CommRingCat.of S) : Type u)),
    Eq (α := (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
      ((CommRingCat.Hom.hom
              (CategoryStruct.comp (Y :=
                pushout (X := CommRingCat.of R) (Y := CommRingCat.of S) (Z := CommRingCat.of S)
                  (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
                (pushout.inl (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
                (CategoryStruct.comp (Y :=
                  pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
                    (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                      (CommRingCat.ofHom (algebraMap S T)))
                    (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                      (CommRingCat.ofHom (algebraMap S A))))
                  (pushout.map (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S))
                    (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                      (CommRingCat.ofHom (algebraMap S T)))
                    (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                      (CommRingCat.ofHom (algebraMap S A)))
                    (CommRingCat.ofHom (algebraMap S T)) (CommRingCat.ofHom (algebraMap S A)) (𝟙 (CommRingCat.of R)) ⋯
                    ⋯)
                  (Iso.hom
                    (Iso.trans (Y :=
                      pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
                        (CommRingCat.ofHom (algebraMap R T)) (CommRingCat.ofHom (algebraMap R A)))
                      (pushout.congrHom ⋯ ⋯) (Iso.symm (IsPushout.isoPushout ⋯)))))) :
            (a : (↑(CommRingCat.of S) : Type u)) → (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
          x :
        (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
      ((CommRingCat.Hom.hom
              (CategoryStruct.comp (Y :=
                pushout (X := CommRingCat.of R) (Y := CommRingCat.of S) (Z := CommRingCat.of S)
                  (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
                (pushout.inl (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
                (Iso.hom (Iso.symm (IsPushout.isoPushout ⋯)) ≫
                  CommRingCat.ofHom
                    (AlgHom.toRingHom
                      (Algebra.TensorProduct.map (IsScalarTower.toAlgHom R S T) (IsScalarTower.toAlgHom R S A) :
                        S ⊗[R] S →ₐ[R] T ⊗[R] A)))) :
            (a : (↑(CommRingCat.of S) : Type u)) → (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
          x :
        (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
⊢ Eq (α :=
    pushout (X := CommRingCat.of R) (Y := CommRingCat.of S) (Z := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
        (CommRingCat.ofHom (algebraMap R S)) ⟶
      CommRingCat.of (T ⊗[R] A))
    (CategoryStruct.comp (Y :=
      pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
        (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
          (CommRingCat.ofHom (algebraMap S T)))
        (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
          (CommRingCat.ofHom (algebraMap S A))))
      (pushout.map (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S))
        (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
          (CommRingCat.ofHom (algebraMap S T)))
        (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
          (CommRingCat.ofHom (algebraMap S A)))
        (CommRingCat.ofHom (algebraMap S T)) (CommRingCat.ofHom (algebraMap S A)) (𝟙 (CommRingCat.of R)) ⋯ ⋯)
      (Iso.hom
        (Iso.trans (Y :=
          pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
            (CommRingCat.ofHom (algebraMap R T)) (CommRingCat.ofHom (algebraMap R A)))
          (pushout.congrHom ⋯ ⋯) (Iso.symm (IsPushout.isoPushout ⋯)))))
    (Iso.hom (Iso.symm (IsPushout.isoPushout ⋯)) ≫
      CommRingCat.ofHom
        (AlgHom.toRingHom
          (Algebra.TensorProduct.map (IsScalarTower.toAlgHom R S T) (IsScalarTower.toAlgHom R S A) :
            S ⊗[R] S →ₐ[R] T ⊗[R] A)))
have refine_4₁ : ∀ (x : (↑(CommRingCat.of S) : Type u)),
  Eq (α := (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
    ((CommRingCat.Hom.hom
            (CategoryStruct.comp (Y :=
              pushout (X := CommRingCat.of R) (Y := CommRingCat.of S) (Z := CommRingCat.of S)
                (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
              (pushout.inr (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
              (CategoryStruct.comp (Y :=
                pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
                  (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                    (CommRingCat.ofHom (algebraMap S T)))
                  (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                    (CommRingCat.ofHom (algebraMap S A))))
                (pushout.map (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S))
                  (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                    (CommRingCat.ofHom (algebraMap S T)))
                  (CategoryStruct.comp (Y := CommRingCat.of S) (CommRingCat.ofHom (algebraMap R S))
                    (CommRingCat.ofHom (algebraMap S A)))
                  (CommRingCat.ofHom (algebraMap S T)) (CommRingCat.ofHom (algebraMap S A)) (𝟙 (CommRingCat.of R)) sorry sorry)
                (Iso.hom
                  (Iso.trans (Y :=
                    pushout (X := CommRingCat.of R) (Y := CommRingCat.of T) (Z := CommRingCat.of A)
                      (CommRingCat.ofHom (algebraMap R T)) (CommRingCat.ofHom (algebraMap R A)))
                    (pushout.congrHom sorry sorry) (Iso.symm (IsPushout.isoPushout sorry)))))) :
          (a : (↑(CommRingCat.of S) : Type u)) → (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
        x :
      (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
    ((CommRingCat.Hom.hom
            (CategoryStruct.comp (Y :=
              pushout (X := CommRingCat.of R) (Y := CommRingCat.of S) (Z := CommRingCat.of S)
                (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
              (pushout.inr (CommRingCat.ofHom (algebraMap R S)) (CommRingCat.ofHom (algebraMap R S)))
              (Iso.hom (Iso.symm (IsPushout.isoPushout sorry)) ≫
                CommRingCat.ofHom
                  (AlgHom.toRingHom
                    (Algebra.TensorProduct.map (IsScalarTower.toAlgHom R S T) (IsScalarTower.toAlgHom R S A) :
                      S ⊗[R] S →ₐ[R] T ⊗[R] A)))) :
          (a : (↑(CommRingCat.of S) : Type u)) → (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
        x :
      (↑(CommRingCat.of (T ⊗[R] A)) : Type u))
Tactic: ext