l3lab/ntp-mathlib huggingface dataset:
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  show B ⟶ _; exact Algebra.TensorProduct.includeRight.toRingHom
  ext r
  trans algebraMap R (A ⊗[R] B) r
  · 

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
r : (forget CommRingCat).obj R
⊢ (f ≫
        let_fun this := Algebra.TensorProduct.includeLeftRingHom;
        this)
      r =
    (algebraMap (↑R) (↑A ⊗[↑R] ↑B)) r

Next tactic:
exact Algebra.TensorProduct.includeLeft.commutes (R := R) r
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  show B ⟶ _; exact Algebra.TensorProduct.includeRight.toRingHom
  ext r
  trans algebraMap R (A ⊗[R] B) r
  · exact Algebra.TensorProduct.includeLeft.commutes (R := R) r
  · 

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
r : (forget CommRingCat).obj R
⊢ (algebraMap (↑R) (↑A ⊗[↑R] ↑B)) r =
    (g ≫
        let_fun this := ↑Algebra.TensorProduct.includeRight;
        this)
      r

Next tactic:
exact (Algebra.TensorProduct.includeRight.commutes (R := R) r).symm
@[simp]
theorem pushoutCocone_inl :
    (pushoutCocone f g).inl = by
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ A ⟶ (pushoutCocone f g).pt

Next tactic:
letI := f.toAlgebra
@[simp]
theorem pushoutCocone_inl :
    (pushoutCocone f g).inl = by
      letI := f.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ A ⟶ (pushoutCocone f g).pt

Next tactic:
letI := g.toAlgebra
@[simp]
theorem pushoutCocone_inl :
    (pushoutCocone f g).inl = by
      letI := f.toAlgebra
      letI := g.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ A ⟶ (pushoutCocone f g).pt

Next tactic:
exact Algebra.TensorProduct.includeLeftRingHom
@[simp]
theorem pushoutCocone_inr :
    (pushoutCocone f g).inr = by
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ B ⟶ (pushoutCocone f g).pt

Next tactic:
letI := f.toAlgebra
@[simp]
theorem pushoutCocone_inr :
    (pushoutCocone f g).inr = by
      letI := f.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ B ⟶ (pushoutCocone f g).pt

Next tactic:
letI := g.toAlgebra
@[simp]
theorem pushoutCocone_inr :
    (pushoutCocone f g).inr = by
      letI := f.toAlgebra
      letI := g.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶ (pushoutCocone f g).pt

Next tactic:
exact Algebra.TensorProduct.includeRight.toRingHom
@[simp]
theorem pushoutCocone_pt :
    (pushoutCocone f g).pt = by
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ CommRingCat

Next tactic:
letI := f.toAlgebra
@[simp]
theorem pushoutCocone_pt :
    (pushoutCocone f g).pt = by
      letI := f.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ CommRingCat

Next tactic:
letI := g.toAlgebra
@[simp]
theorem pushoutCocone_pt :
    (pushoutCocone f g).pt = by
      letI := f.toAlgebra
      letI := g.toAlgebra
      

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ CommRingCat

Next tactic:
exact CommRingCat.of (A ⊗[R] B)
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI := RingHom.toAlgebra f
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI := RingHom.toAlgebra g
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI := RingHom.toAlgebra (f ≫ s.inl)
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          congr 1
          exact
            (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans
              (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm }
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
src✝ : B ⟶ s.pt := PushoutCocone.inr s
r : ↑R
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : ↑B), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      ((algebraMap ↑R ↑B) r) =
    (algebraMap ↑R ↑s.pt) r

Next tactic:
change (g ≫ s.inr) r = (f ≫ s.inl) r
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
src✝ : B ⟶ s.pt := PushoutCocone.inr s
r : ↑R
⊢ (g ≫ PushoutCocone.inr s) r = (f ≫ PushoutCocone.inl s) r

Next tactic:
congr 1
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          congr 1
          

Proof state:
case e_a
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
src✝ : B ⟶ s.pt := PushoutCocone.inr s
r : ↑R
⊢ g ≫ PushoutCocone.inr s = f ≫ PushoutCocone.inl s

Next tactic:
exact
            (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans
              (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          congr 1
          exact
            (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans
              (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm }
    -- Porting note : Lean has forget why `A ⊗[R] B` makes sense
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝¹ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝ : Algebra ↑R ↑B := RingHom.toAlgebra g
this : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
g' : ↑B →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inr s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑B), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' := (_ : ∀ (r : ↑R), (g ≫ PushoutCocone.inr s) r = (f ≫ PushoutCocone.inl s) r) }
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI : Algebra R A := f.toAlgebra
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          congr 1
          exact
            (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans
              (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm }
    -- Porting note : Lean has forget why `A ⊗[R] B` makes sense
    letI : Algebra R A := f.toAlgebra
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝² : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝¹ : Algebra ↑R ↑B := RingHom.toAlgebra g
this✝ : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
g' : ↑B →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inr s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑B), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' := (_ : ∀ (r : ↑R), (g ≫ PushoutCocone.inr s) r = (f ≫ PushoutCocone.inl s) r) }
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI : Algebra R B := g.toAlgebra
/-- Verify that the `pushout_cocone` is indeed the colimit. -/
def pushoutCoconeIsColimit : Limits.IsColimit (pushoutCocone f g) :=
  Limits.PushoutCocone.isColimitAux' _ fun s => by
    letI := RingHom.toAlgebra f
    letI := RingHom.toAlgebra g
    letI := RingHom.toAlgebra (f ≫ s.inl)
    let f' : A →ₐ[R] s.pt :=
      { s.inl with
        commutes' := fun r => rfl }
    let g' : B →ₐ[R] s.pt :=
      { s.inr with
        commutes' := fun r => by
          change (g ≫ s.inr) r = (f ≫ s.inl) r
          congr 1
          exact
            (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans
              (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm }
    -- Porting note : Lean has forget why `A ⊗[R] B` makes sense
    letI : Algebra R A := f.toAlgebra
    letI : Algebra R B := g.toAlgebra
    

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
s : PushoutCocone f g
this✝³ : Algebra ↑R ↑A := RingHom.toAlgebra f
this✝² : Algebra ↑R ↑B := RingHom.toAlgebra g
this✝¹ : Algebra ↑R ↑s.pt := RingHom.toAlgebra (f ≫ PushoutCocone.inl s)
f' : ↑A →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inl s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' :=
      (_ :
        ∀ (r : ↑R),
          OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r) =
            OneHom.toFun
              (↑↑{ toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) })
              ((algebraMap ↑R ↑A) r)) }
g' : ↑B →ₐ[↑R] ↑s.pt :=
  let src := PushoutCocone.inr s;
  {
    toRingHom :=
      { toMonoidHom := ↑src, map_zero' := (_ : OneHom.toFun (↑↑src) 0 = 0),
        map_add' :=
          (_ : ∀ (x y : ↑B), OneHom.toFun (↑↑src) (x + y) = OneHom.toFun (↑↑src) x + OneHom.toFun (↑↑src) y) },
    commutes' := (_ : ∀ (r : ↑R), (g ≫ PushoutCocone.inr s) r = (f ≫ PushoutCocone.inl s) r) }
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ { l //
    PushoutCocone.inl (pushoutCocone f g) ≫ l = PushoutCocone.inl s ∧
      PushoutCocone.inr (pushoutCocone f g) ≫ l = PushoutCocone.inr s ∧
        ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
          PushoutCocone.inl (pushoutCocone f g) ≫ m = PushoutCocone.inl s →
            PushoutCocone.inr (pushoutCocone f g) ≫ m = PushoutCocone.inr s → m = l }

Next tactic:
letI : Algebra R (pushoutCocone f g).pt := show Algebra R (A ⊗[R] B) by infer_instance