[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ PushoutCocone f g
[PROOFSTEP]
letI := RingHom.toAlgebra f
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ PushoutCocone f g
[PROOFSTEP]
letI := RingHom.toAlgebra g
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ PushoutCocone f g
[PROOFSTEP]
fapply Limits.PushoutCocone.mk
[GOAL]
case W
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
case inl
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 ⟶ ?W
case inr
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 ⟶ ?W
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr
[PROOFSTEP]
show CommRingCat
[GOAL]
case W
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
case inl
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 ⟶
    let_fun this := ?W;
    this
case inr
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 ⟶
    let_fun this := ?W;
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr
[PROOFSTEP]
exact CommRingCat.of (A ⊗[R] B)
[GOAL]
case inl
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case inr
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr
[PROOFSTEP]
show A ⟶ _
[GOAL]
case inl
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case inr
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := ?inl;
      this) =
    g ≫ ?inr
[PROOFSTEP]
exact Algebra.TensorProduct.includeLeftRingHom
[GOAL]
case inr
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫ ?inr
[PROOFSTEP]
show B ⟶ _
[GOAL]
case inr
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 ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫
      let_fun this := ?inr;
      this
[PROOFSTEP]
exact Algebra.TensorProduct.includeRight.toRingHom
[GOAL]
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫
      let_fun this := ↑Algebra.TensorProduct.includeRight;
      this
[PROOFSTEP]
ext r
[GOAL]
case eq.w
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 =
    ↑(g ≫
          let_fun this := ↑Algebra.TensorProduct.includeRight;
          this)
      r
[PROOFSTEP]
trans algebraMap R (A ⊗[R] B) r
[GOAL]
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
[PROOFSTEP]
exact Algebra.TensorProduct.includeLeft.commutes (R := R) r
[GOAL]
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
[PROOFSTEP]
exact (Algebra.TensorProduct.includeRight.commutes (R := R) r).symm
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ A ⟶ (pushoutCocone f g).pt
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ A ⟶ (pushoutCocone f g).pt
[PROOFSTEP]
letI := g.toAlgebra
[GOAL]
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
[PROOFSTEP]
exact Algebra.TensorProduct.includeLeftRingHom
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ B ⟶ (pushoutCocone f g).pt
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ B ⟶ (pushoutCocone f g).pt
[PROOFSTEP]
letI := g.toAlgebra
[GOAL]
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
[PROOFSTEP]
exact Algebra.TensorProduct.includeRight.toRingHom
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ CommRingCat
[PROOFSTEP]
letI := f.toAlgebra
[GOAL]
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ CommRingCat
[PROOFSTEP]
letI := g.toAlgebra
[GOAL]
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
[PROOFSTEP]
exact CommRingCat.of (A ⊗[R] B)
[GOAL]
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 }
[PROOFSTEP]
letI := RingHom.toAlgebra f
[GOAL]
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 }
[PROOFSTEP]
letI := RingHom.toAlgebra g
[GOAL]
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 }
[PROOFSTEP]
letI := RingHom.toAlgebra (f ≫ s.inl)
[GOAL]
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 }
[PROOFSTEP]
let f' : A →ₐ[R] s.pt := { s.inl with commutes' := fun r => rfl }
[GOAL]
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 }
[PROOFSTEP]
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
[GOAL]
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
[PROOFSTEP]
change (g ≫ s.inr) r = (f ≫ s.inl) r
[GOAL]
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
[PROOFSTEP]
congr 1
[GOAL]
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
[PROOFSTEP]
exact (s.ι.naturality Limits.WalkingSpan.Hom.snd).trans (s.ι.naturality Limits.WalkingSpan.Hom.fst).symm
[GOAL]
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 }
[PROOFSTEP]
letI : Algebra R A := f.toAlgebra
[GOAL]
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 }
[PROOFSTEP]
letI : Algebra R B := g.toAlgebra
[GOAL]
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 }
[PROOFSTEP]
letI : Algebra R (pushoutCocone f g).pt :=
  show Algebra R (A ⊗[R] B) by
    infer_instance
      -- The factor map is a ⊗ b ↦ f(a) * g(b).
[GOAL]
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
⊢ Algebra (↑R) (↑A ⊗[↑R] ↑B)
[PROOFSTEP]
infer_instance
  -- The factor map is a ⊗ b ↦ f(a) * g(b).
[GOAL]
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ { 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 }
[PROOFSTEP]
use AlgHom.toRingHom (Algebra.TensorProduct.productMap f' g')
[GOAL]
case property
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ PushoutCocone.inl (pushoutCocone f g) ≫ ↑(Algebra.TensorProduct.productMap f' g') = PushoutCocone.inl s ∧
    PushoutCocone.inr (pushoutCocone f g) ≫ ↑(Algebra.TensorProduct.productMap f' g') = 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 = ↑(Algebra.TensorProduct.productMap f' g')
[PROOFSTEP]
simp only [pushoutCocone_inl, pushoutCocone_inr]
[GOAL]
case property
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ Algebra.TensorProduct.includeLeftRingHom ≫
        ↑(Algebra.TensorProduct.productMap
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inl s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑A),
                        OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
              commutes' :=
                (_ :
                  ∀ (r : ↑R),
                    OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r) =
                      OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r)) }
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inr s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑B),
                        OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
              commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }) =
      PushoutCocone.inl s ∧
    ↑Algebra.TensorProduct.includeRight ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }) =
        PushoutCocone.inr s ∧
      ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
        Algebra.TensorProduct.includeLeftRingHom ≫ m = PushoutCocone.inl s →
          ↑Algebra.TensorProduct.includeRight ≫ m = PushoutCocone.inr s →
            m =
              ↑(Algebra.TensorProduct.productMap
                  {
                    toRingHom :=
                      { toMonoidHom := ↑(PushoutCocone.inl s),
                        map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                        map_add' :=
                          (_ :
                            ∀ (x y : ↑A),
                              OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                    commutes' :=
                      (_ :
                        ∀ (r : ↑R),
                          OneHom.toFun
                              (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (x y : ↑A),
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                              OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                              (↑(algebraMap ↑R ↑A) r) =
                            OneHom.toFun
                              (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                    map_add' :=
                                      (_ :
                                        ∀ (x y : ↑A),
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                              OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                              (↑(algebraMap ↑R ↑A) r)) }
                  {
                    toRingHom :=
                      { toMonoidHom := ↑(PushoutCocone.inr s),
                        map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                        map_add' :=
                          (_ :
                            ∀ (x y : ↑B),
                              OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                                OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                    commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
constructor
[GOAL]
case property.left
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ Algebra.TensorProduct.includeLeftRingHom ≫
      ↑(Algebra.TensorProduct.productMap
          {
            toRingHom :=
              { toMonoidHom := ↑(PushoutCocone.inl s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                map_add' :=
                  (_ :
                    ∀ (x y : ↑A),
                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
            commutes' :=
              (_ :
                ∀ (r : ↑R),
                  OneHom.toFun
                      (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                            map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                            map_add' :=
                              (_ :
                                ∀ (x y : ↑A),
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                      (↑(algebraMap ↑R ↑A) r) =
                    OneHom.toFun
                      (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                            map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                            map_add' :=
                              (_ :
                                ∀ (x y : ↑A),
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                      (↑(algebraMap ↑R ↑A) r)) }
          {
            toRingHom :=
              { toMonoidHom := ↑(PushoutCocone.inr s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                map_add' :=
                  (_ :
                    ∀ (x y : ↑B),
                      OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                        OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
            commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }) =
    PushoutCocone.inl s
[PROOFSTEP]
ext x
[GOAL]
case property.left.w
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj A
⊢ ↑(Algebra.TensorProduct.includeLeftRingHom ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inl s) x
[PROOFSTEP]
letI : Semiring ((forget CommRingCat).obj A) := A.str.toSemiring
[GOAL]
case property.left.w
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj A
this : Semiring ((forget CommRingCat).obj A) := Ring.toSemiring
⊢ ↑(Algebra.TensorProduct.includeLeftRingHom ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inl s) x
[PROOFSTEP]
letI : Algebra R ((forget CommRingCat).obj A) := show Algebra R A by infer_instance
[GOAL]
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj A
this : Semiring ((forget CommRingCat).obj A) := Ring.toSemiring
⊢ Algebra ↑R ↑A
[PROOFSTEP]
infer_instance
[GOAL]
case property.left.w
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
this✝¹ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj A
this✝ : Semiring ((forget CommRingCat).obj A) := Ring.toSemiring
this : Algebra (↑R) ((forget CommRingCat).obj A) :=
  let_fun this := inferInstance;
  this
⊢ ↑(Algebra.TensorProduct.includeLeftRingHom ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inl s) x
[PROOFSTEP]
exact Algebra.TensorProduct.productMap_left_apply _ _ x
[GOAL]
case property.right
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ ↑Algebra.TensorProduct.includeRight ≫
        ↑(Algebra.TensorProduct.productMap
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inl s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑A),
                        OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
              commutes' :=
                (_ :
                  ∀ (r : ↑R),
                    OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r) =
                      OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r)) }
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inr s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑B),
                        OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
              commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }) =
      PushoutCocone.inr s ∧
    ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
      Algebra.TensorProduct.includeLeftRingHom ≫ m = PushoutCocone.inl s →
        ↑Algebra.TensorProduct.includeRight ≫ m = PushoutCocone.inr s →
          m =
            ↑(Algebra.TensorProduct.productMap
                {
                  toRingHom :=
                    { toMonoidHom := ↑(PushoutCocone.inl s),
                      map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : ↑A),
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                              OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                  commutes' :=
                    (_ :
                      ∀ (r : ↑R),
                        OneHom.toFun
                            (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (x y : ↑A),
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                            OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                            (↑(algebraMap ↑R ↑A) r) =
                          OneHom.toFun
                            (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                  map_add' :=
                                    (_ :
                                      ∀ (x y : ↑A),
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                            OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                            (↑(algebraMap ↑R ↑A) r)) }
                {
                  toRingHom :=
                    { toMonoidHom := ↑(PushoutCocone.inr s),
                      map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : ↑B),
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                              OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                  commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
constructor
[GOAL]
case property.right.left
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ ↑Algebra.TensorProduct.includeRight ≫
      ↑(Algebra.TensorProduct.productMap
          {
            toRingHom :=
              { toMonoidHom := ↑(PushoutCocone.inl s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                map_add' :=
                  (_ :
                    ∀ (x y : ↑A),
                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
            commutes' :=
              (_ :
                ∀ (r : ↑R),
                  OneHom.toFun
                      (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                            map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                            map_add' :=
                              (_ :
                                ∀ (x y : ↑A),
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                      (↑(algebraMap ↑R ↑A) r) =
                    OneHom.toFun
                      (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                            map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                            map_add' :=
                              (_ :
                                ∀ (x y : ↑A),
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                      (↑(algebraMap ↑R ↑A) r)) }
          {
            toRingHom :=
              { toMonoidHom := ↑(PushoutCocone.inr s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                map_add' :=
                  (_ :
                    ∀ (x y : ↑B),
                      OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                        OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
            commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }) =
    PushoutCocone.inr s
[PROOFSTEP]
ext x
[GOAL]
case property.right.left.w
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj B
⊢ ↑(↑Algebra.TensorProduct.includeRight ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inr s) x
[PROOFSTEP]
letI : Semiring ((forget CommRingCat).obj B) := B.str.toSemiring
[GOAL]
case property.right.left.w
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj B
this : Semiring ((forget CommRingCat).obj B) := Ring.toSemiring
⊢ ↑(↑Algebra.TensorProduct.includeRight ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inr s) x
[PROOFSTEP]
letI : Algebra R ((forget CommRingCat).obj B) := show Algebra R B by infer_instance
[GOAL]
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj B
this : Semiring ((forget CommRingCat).obj B) := Ring.toSemiring
⊢ Algebra ↑R ↑B
[PROOFSTEP]
infer_instance
[GOAL]
case property.right.left.w
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
this✝¹ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
x : (forget CommRingCat).obj B
this✝ : Semiring ((forget CommRingCat).obj B) := Ring.toSemiring
this : Algebra (↑R) ((forget CommRingCat).obj B) :=
  let_fun this := inferInstance;
  this
⊢ ↑(↑Algebra.TensorProduct.includeRight ≫
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) }))
      x =
    ↑(PushoutCocone.inr s) x
[PROOFSTEP]
exact Algebra.TensorProduct.productMap_right_apply _ _ x
[GOAL]
case property.right.right
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
⊢ ∀ {m : (pushoutCocone f g).pt ⟶ s.pt},
    Algebra.TensorProduct.includeLeftRingHom ≫ m = PushoutCocone.inl s →
      ↑Algebra.TensorProduct.includeRight ≫ m = PushoutCocone.inr s →
        m =
          ↑(Algebra.TensorProduct.productMap
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inl s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑A),
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
                commutes' :=
                  (_ :
                    ∀ (r : ↑R),
                      OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r) =
                        OneHom.toFun
                          (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                                map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                                map_add' :=
                                  (_ :
                                    ∀ (x y : ↑A),
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                          OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                          (↑(algebraMap ↑R ↑A) r)) }
              {
                toRingHom :=
                  { toMonoidHom := ↑(PushoutCocone.inr s),
                    map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : ↑B),
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                            OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
                commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
intro h eq1 eq2
[GOAL]
case property.right.right
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
⊢ h =
    ↑(Algebra.TensorProduct.productMap
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inl s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑A),
                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
          commutes' :=
            (_ :
              ∀ (r : ↑R),
                OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r) =
                  OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r)) }
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inr s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑B),
                    OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
          commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
let h' : A ⊗[R] B →ₐ[R] s.pt :=
  { h with
    commutes' := fun r => by
      change h (f r ⊗ₜ[R] 1) = s.inl (f r)
      rw [← eq1]
      simp only [pushoutCocone_pt, coe_of, AlgHom.toRingHom_eq_coe]
      rfl }
[GOAL]
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
r : ↑R
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : ↑(pushoutCocone f g).pt),
                  OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) })
      (↑(algebraMap (↑R) (↑A ⊗[↑R] ↑B)) r) =
    ↑(algebraMap ↑R ↑s.pt) r
[PROOFSTEP]
change h (f r ⊗ₜ[R] 1) = s.inl (f r)
[GOAL]
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
r : ↑R
⊢ ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)
[PROOFSTEP]
rw [← eq1]
[GOAL]
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
r : ↑R
⊢ ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(Algebra.TensorProduct.includeLeftRingHom ≫ h) (↑f r)
[PROOFSTEP]
simp only [pushoutCocone_pt, coe_of, AlgHom.toRingHom_eq_coe]
[GOAL]
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
r : ↑R
⊢ ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(Algebra.TensorProduct.includeLeftRingHom ≫ h) (↑f r)
[PROOFSTEP]
rfl
[GOAL]
case property.right.right
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
⊢ h =
    ↑(Algebra.TensorProduct.productMap
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inl s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑A),
                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
          commutes' :=
            (_ :
              ∀ (r : ↑R),
                OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r) =
                  OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r)) }
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inr s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑B),
                    OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
          commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
suffices h' = Algebra.TensorProduct.productMap f' g' by
  ext x
  change h' x = Algebra.TensorProduct.productMap f' g' x
  rw [this]
[GOAL]
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
this : h' = Algebra.TensorProduct.productMap f' g'
⊢ h =
    ↑(Algebra.TensorProduct.productMap
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inl s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑A),
                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
          commutes' :=
            (_ :
              ∀ (r : ↑R),
                OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r) =
                  OneHom.toFun
                    (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                          map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                          map_add' :=
                            (_ :
                              ∀ (x y : ↑A),
                                OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                  OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                    (↑(algebraMap ↑R ↑A) r)) }
        {
          toRingHom :=
            { toMonoidHom := ↑(PushoutCocone.inr s), map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
              map_add' :=
                (_ :
                  ∀ (x y : ↑B),
                    OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                      OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
          commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
[PROOFSTEP]
ext x
[GOAL]
case w
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
this : h' = Algebra.TensorProduct.productMap f' g'
x : (forget CommRingCat).obj (pushoutCocone f g).pt
⊢ ↑h x =
    ↑↑(Algebra.TensorProduct.productMap
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inl s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑A),
                        OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inl s)) x + OneHom.toFun (↑↑(PushoutCocone.inl s)) y) },
              commutes' :=
                (_ :
                  ∀ (r : ↑R),
                    OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r) =
                      OneHom.toFun
                        (↑↑{ toMonoidHom := ↑(PushoutCocone.inl s),
                              map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inl s)) 0 = 0),
                              map_add' :=
                                (_ :
                                  ∀ (x y : ↑A),
                                    OneHom.toFun (↑↑(PushoutCocone.inl s)) (x + y) =
                                      OneHom.toFun (↑↑(PushoutCocone.inl s)) x +
                                        OneHom.toFun (↑↑(PushoutCocone.inl s)) y) })
                        (↑(algebraMap ↑R ↑A) r)) }
            {
              toRingHom :=
                { toMonoidHom := ↑(PushoutCocone.inr s),
                  map_zero' := (_ : OneHom.toFun (↑↑(PushoutCocone.inr s)) 0 = 0),
                  map_add' :=
                    (_ :
                      ∀ (x y : ↑B),
                        OneHom.toFun (↑↑(PushoutCocone.inr s)) (x + y) =
                          OneHom.toFun (↑↑(PushoutCocone.inr s)) x + OneHom.toFun (↑↑(PushoutCocone.inr s)) y) },
              commutes' := (_ : ∀ (r : ↑R), ↑(g ≫ PushoutCocone.inr s) r = ↑(f ≫ PushoutCocone.inl s) r) })
      x
[PROOFSTEP]
change h' x = Algebra.TensorProduct.productMap f' g' x
[GOAL]
case w
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
this✝ : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
this : h' = Algebra.TensorProduct.productMap f' g'
x : (forget CommRingCat).obj (pushoutCocone f g).pt
⊢ ↑h' x = ↑(Algebra.TensorProduct.productMap f' g') x
[PROOFSTEP]
rw [this]
[GOAL]
case property.right.right
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
⊢ h' = Algebra.TensorProduct.productMap f' g'
[PROOFSTEP]
apply Algebra.TensorProduct.ext'
[GOAL]
case property.right.right.H
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
⊢ ∀ (a : ↑A) (b : ↑B), ↑h' (a ⊗ₜ[↑R] b) = ↑(Algebra.TensorProduct.productMap f' g') (a ⊗ₜ[↑R] b)
[PROOFSTEP]
intro a b
[GOAL]
case property.right.right.H
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
a : ↑A
b : ↑B
⊢ ↑h' (a ⊗ₜ[↑R] b) = ↑(Algebra.TensorProduct.productMap f' g') (a ⊗ₜ[↑R] b)
[PROOFSTEP]
simp only [PushoutCocone.ι_app_left, pushoutCocone_pt, coe_of, RingHom.toMonoidHom_eq_coe, AlgHom.coe_mk,
  RingHom.coe_mk, MonoidHom.coe_coe, ← eq1, AlgHom.toRingHom_eq_coe, PushoutCocone.ι_app_right, ← eq2,
  Algebra.TensorProduct.productMap_apply_tmul]
[GOAL]
case property.right.right.H
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
a : ↑A
b : ↑B
⊢ ↑h (a ⊗ₜ[↑R] b) = ↑(Algebra.TensorProduct.includeLeftRingHom ≫ h) a * ↑(↑Algebra.TensorProduct.includeRight ≫ h) b
[PROOFSTEP]
change _ = h (a ⊗ₜ 1) * h (1 ⊗ₜ b)
[GOAL]
case property.right.right.H
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
a : ↑A
b : ↑B
⊢ ↑h (a ⊗ₜ[↑R] b) = ↑h (a ⊗ₜ[↑R] 1) * ↑h (1 ⊗ₜ[↑R] b)
[PROOFSTEP]
rw [← h.map_mul, Algebra.TensorProduct.tmul_mul_tmul, mul_one, one_mul]
[GOAL]
case property.right.right.H
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
this : Algebra ↑R ↑(pushoutCocone f g).pt :=
  let_fun this := inferInstance;
  this
h : (pushoutCocone f g).pt ⟶ s.pt
eq1 : Algebra.TensorProduct.includeLeftRingHom ≫ h = PushoutCocone.inl s
eq2 : ↑Algebra.TensorProduct.includeRight ≫ h = PushoutCocone.inr s
h' : ↑A ⊗[↑R] ↑B →ₐ[↑R] ↑s.pt :=
  {
    toRingHom :=
      { toMonoidHom := ↑h, map_zero' := (_ : OneHom.toFun (↑↑h) 0 = 0),
        map_add' :=
          (_ :
            ∀ (x y : ↑(pushoutCocone f g).pt),
              OneHom.toFun (↑↑h) (x + y) = OneHom.toFun (↑↑h) x + OneHom.toFun (↑↑h) y) },
    commutes' := (_ : ∀ (r : ↑R), ↑h (↑f r ⊗ₜ[↑R] 1) = ↑(PushoutCocone.inl s) (↑f r)) }
a : ↑A
b : ↑B
⊢ ↑h (a ⊗ₜ[↑R] b) = ↑h (a ⊗ₜ[↑R] b)
[PROOFSTEP]
rfl
[GOAL]
⊢ IsTerminal (of PUnit)
[PROOFSTEP]
refine IsTerminal.ofUnique (h := fun X => ⟨⟨⟨⟨1, rfl⟩, fun _ _ => rfl⟩, ?_, ?_⟩, ?_⟩)
[GOAL]
case refine_1
X : CommRingCat
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
          map_mul' :=
            (_ :
              ∀ (x x_1 : ↑X),
                OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                  OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
      0 =
    0
[PROOFSTEP]
dsimp
[GOAL]
case refine_2
X : CommRingCat
⊢ ∀ (x y : ↑X),
    OneHom.toFun
        (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : ↑X),
                  OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                    OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
        (x + y) =
      OneHom.toFun
          (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
              map_mul' :=
                (_ :
                  ∀ (x x_1 : ↑X),
                    OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                      OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
          x +
        OneHom.toFun
          (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
              map_mul' :=
                (_ :
                  ∀ (x x_1 : ↑X),
                    OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                      OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
          y
[PROOFSTEP]
intros
[GOAL]
case refine_2
X : CommRingCat
x✝ y✝ : ↑X
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
          map_mul' :=
            (_ :
              ∀ (x x_1 : ↑X),
                OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                  OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
      (x✝ + y✝) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : ↑X),
                  OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                    OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
        x✝ +
      OneHom.toFun
        (↑{ toOneHom := { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : ↑X),
                  OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1) =
                    OneHom.toFun { toFun := 1, map_one' := (_ : OfNat.ofNat 1 1 = OfNat.ofNat 1 1) } (x * x_1)) })
        y✝
[PROOFSTEP]
dsimp
[GOAL]
case refine_3
X : CommRingCat
⊢ ∀ (a : X ⟶ of PUnit), a = default
[PROOFSTEP]
intros f
[GOAL]
case refine_3
X : CommRingCat
f : X ⟶ of PUnit
⊢ f = default
[PROOFSTEP]
ext
[GOAL]
case refine_3.w
X : CommRingCat
f : X ⟶ of PUnit
x✝ : (forget CommRingCat).obj X
⊢ ↑f x✝ = ↑default x✝
[PROOFSTEP]
rfl
[GOAL]
⊢ HasStrictTerminalObjects CommRingCat
[PROOFSTEP]
apply hasStrictTerminalObjects_of_terminal_is_strict (CommRingCat.of PUnit)
[GOAL]
⊢ ∀ (A : CommRingCat) (f : of PUnit ⟶ A), IsIso f
[PROOFSTEP]
intro X f
[GOAL]
X : CommRingCat
f : of PUnit ⟶ X
⊢ IsIso f
[PROOFSTEP]
refine ⟨⟨⟨1, rfl, fun _ _ => rfl⟩, by ext; rfl, ?_⟩⟩
[GOAL]
X : CommRingCat
f : of PUnit ⟶ X
⊢ f ≫
      { toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
        map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } =
    𝟙 (of PUnit)
[PROOFSTEP]
ext
[GOAL]
case w
X : CommRingCat
f : of PUnit ⟶ X
x✝ : (forget CommRingCat).obj (of PUnit)
⊢ ↑(f ≫
          { toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
            map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) })
      x✝ =
    ↑(𝟙 (of PUnit)) x✝
[PROOFSTEP]
rfl
[GOAL]
X : CommRingCat
f : of PUnit ⟶ X
⊢ { toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
        map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } ≫
      f =
    𝟙 X
[PROOFSTEP]
ext x
[GOAL]
case w
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
⊢ ↑({ toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
            map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } ≫
          f)
      x =
    ↑(𝟙 X) x
[PROOFSTEP]
have e : (0 : X) = 1 := by
  rw [← f.map_one, ← f.map_zero]
  congr
[GOAL]
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
⊢ 0 = 1
[PROOFSTEP]
rw [← f.map_one, ← f.map_zero]
[GOAL]
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
⊢ ↑f 0 = ↑f 1
[PROOFSTEP]
congr
[GOAL]
case w
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
e : 0 = 1
⊢ ↑({ toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
            map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } ≫
          f)
      x =
    ↑(𝟙 X) x
[PROOFSTEP]
replace e : 0 * x = 1 * x := congr_arg (· * x) e
[GOAL]
case w
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
e : 0 * x = 1 * x
⊢ ↑({ toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
            map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } ≫
          f)
      x =
    ↑(𝟙 X) x
[PROOFSTEP]
rw [one_mul, zero_mul, ← f.map_zero] at e 
[GOAL]
case w
X : CommRingCat
f : of PUnit ⟶ X
x : (forget CommRingCat).obj X
e : ↑f 0 = x
⊢ ↑({ toMonoidHom := 1, map_zero' := (_ : OneHom.toFun (↑1) 0 = OneHom.toFun (↑1) 0),
            map_add' := (_ : ∀ (x x_1 : ↑X), OneHom.toFun (↑1) (x + x_1) = OneHom.toFun (↑1) (x + x_1)) } ≫
          f)
      x =
    ↑(𝟙 X) x
[PROOFSTEP]
exact e
[GOAL]
X : CommRingCat
hX : IsTerminal X
⊢ Subsingleton PUnit
[PROOFSTEP]
infer_instance
[GOAL]
A B : CommRingCat
c : Cone (pair A B)
j : Discrete WalkingPair
⊢ (fun c => RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
        c ≫
      NatTrans.app (prodFan A B).π j =
    NatTrans.app c.π j
[PROOFSTEP]
ext
[GOAL]
case w
A B : CommRingCat
c : Cone (pair A B)
j : Discrete WalkingPair
x✝ : (forget CommRingCat).obj c.pt
⊢ ↑((fun c => RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
            c ≫
          NatTrans.app (prodFan A B).π j)
      x✝ =
    ↑(NatTrans.app c.π j) x✝
[PROOFSTEP]
rcases j with ⟨⟨⟩⟩
[GOAL]
case w.mk.left
A B : CommRingCat
c : Cone (pair A B)
x✝ : (forget CommRingCat).obj c.pt
⊢ ↑((fun c => RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
            c ≫
          NatTrans.app (prodFan A B).π { as := WalkingPair.left })
      x✝ =
    ↑(NatTrans.app c.π { as := WalkingPair.left }) x✝
[PROOFSTEP]
simp only [pair_obj_left, prodFan_pt, BinaryFan.π_app_left, BinaryFan.π_app_right, FunctorToTypes.map_comp_apply,
  forget_map, coe_of, RingHom.prod_apply]
[GOAL]
case w.mk.right
A B : CommRingCat
c : Cone (pair A B)
x✝ : (forget CommRingCat).obj c.pt
⊢ ↑((fun c => RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
            c ≫
          NatTrans.app (prodFan A B).π { as := WalkingPair.right })
      x✝ =
    ↑(NatTrans.app c.π { as := WalkingPair.right }) x✝
[PROOFSTEP]
simp only [pair_obj_left, prodFan_pt, BinaryFan.π_app_left, BinaryFan.π_app_right, FunctorToTypes.map_comp_apply,
  forget_map, coe_of, RingHom.prod_apply]
[GOAL]
case w.mk.left
A B : CommRingCat
c : Cone (pair A B)
x✝ : (forget CommRingCat).obj c.pt
⊢ ↑(RingHom.prod (BinaryFan.fst c) (BinaryFan.snd c) ≫ BinaryFan.fst (prodFan A B)) x✝ = ↑(BinaryFan.fst c) x✝
[PROOFSTEP]
rfl
[GOAL]
case w.mk.right
A B : CommRingCat
c : Cone (pair A B)
x✝ : (forget CommRingCat).obj c.pt
⊢ ↑(RingHom.prod (BinaryFan.fst c) (BinaryFan.snd c) ≫ BinaryFan.snd (prodFan A B)) x✝ = ↑(BinaryFan.snd c) x✝
[PROOFSTEP]
rfl
[GOAL]
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
⊢ m =
    (fun c => RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
      s
[PROOFSTEP]
ext x
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
⊢ ↑m x =
    ↑((fun c =>
            RingHom.prod (NatTrans.app c.π { as := WalkingPair.left }) (NatTrans.app c.π { as := WalkingPair.right }))
          s)
      x
[PROOFSTEP]
change m x = (BinaryFan.fst s x, BinaryFan.snd s x)
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
⊢ ↑m x = (↑(BinaryFan.fst s) x, ↑(BinaryFan.snd s) x)
[PROOFSTEP]
have eq1 := congr_hom (h ⟨WalkingPair.left⟩) x
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
eq1 :
  ↑(m ≫ NatTrans.app (prodFan A B).π { as := WalkingPair.left }) x = ↑(NatTrans.app s.π { as := WalkingPair.left }) x
⊢ ↑m x = (↑(BinaryFan.fst s) x, ↑(BinaryFan.snd s) x)
[PROOFSTEP]
have eq2 := congr_hom (h ⟨WalkingPair.right⟩) x
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
eq1 :
  ↑(m ≫ NatTrans.app (prodFan A B).π { as := WalkingPair.left }) x = ↑(NatTrans.app s.π { as := WalkingPair.left }) x
eq2 :
  ↑(m ≫ NatTrans.app (prodFan A B).π { as := WalkingPair.right }) x = ↑(NatTrans.app s.π { as := WalkingPair.right }) x
⊢ ↑m x = (↑(BinaryFan.fst s) x, ↑(BinaryFan.snd s) x)
[PROOFSTEP]
dsimp at eq1 eq2 
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
eq1 : ↑(m ≫ BinaryFan.fst (prodFan A B)) x = ↑(BinaryFan.fst s) x
eq2 : ↑(m ≫ BinaryFan.snd (prodFan A B)) x = ↑(BinaryFan.snd s) x
⊢ ↑m x = (↑(BinaryFan.fst s) x, ↑(BinaryFan.snd s) x)
[PROOFSTEP]
rw [← eq1, ← eq2]
[GOAL]
case w
A B : CommRingCat
s : Cone (pair A B)
m : s.pt ⟶ (prodFan A B).pt
h : ∀ (j : Discrete WalkingPair), m ≫ NatTrans.app (prodFan A B).π j = NatTrans.app s.π j
x : (forget CommRingCat).obj s.pt
eq1 : ↑(m ≫ BinaryFan.fst (prodFan A B)) x = ↑(BinaryFan.fst s) x
eq2 : ↑(m ≫ BinaryFan.snd (prodFan A B)) x = ↑(BinaryFan.snd s) x
⊢ ↑m x = (↑(m ≫ BinaryFan.fst (prodFan A B)) x, ↑(m ≫ BinaryFan.snd (prodFan A B)) x)
[PROOFSTEP]
rfl
[GOAL]
A B : CommRingCat
f g : A ⟶ B
⊢ ofHom (Subring.subtype (RingHom.eqLocus f g)) ≫ f = ofHom (Subring.subtype (RingHom.eqLocus f g)) ≫ g
[PROOFSTEP]
ext ⟨x, e⟩
[GOAL]
case w.mk
A B : CommRingCat
f g : A ⟶ B
x : ↑A
e : x ∈ RingHom.eqLocus f g
⊢ ↑(ofHom (Subring.subtype (RingHom.eqLocus f g)) ≫ f) { val := x, property := e } =
    ↑(ofHom (Subring.subtype (RingHom.eqLocus f g)) ≫ g) { val := x, property := e }
[PROOFSTEP]
simpa using e
[GOAL]
A B : CommRingCat
f g : A ⟶ B
⊢ IsLimit (equalizerFork f g)
[PROOFSTEP]
fapply Fork.IsLimit.mk'
[GOAL]
case create
A B : CommRingCat
f g : A ⟶ B
⊢ (s : Fork f g) →
    { l //
      l ≫ Fork.ι (equalizerFork f g) = Fork.ι s ∧
        ∀
          {m :
            ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
              ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero},
          m ≫ Fork.ι (equalizerFork f g) = Fork.ι s → m = l }
[PROOFSTEP]
intro s
[GOAL]
case create
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
⊢ { l //
    l ≫ Fork.ι (equalizerFork f g) = Fork.ι s ∧
      ∀
        {m :
          ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
            ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero},
        m ≫ Fork.ι (equalizerFork f g) = Fork.ι s → m = l }
[PROOFSTEP]
haveI : SubsemiringClass (Subring A) ((parallelPair f g).obj WalkingParallelPair.zero) :=
  show SubsemiringClass (Subring A) A by infer_instance
[GOAL]
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
⊢ SubsemiringClass (Subring ↑A) ↑A
[PROOFSTEP]
infer_instance
[GOAL]
case create
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
⊢ { l //
    l ≫ Fork.ι (equalizerFork f g) = Fork.ι s ∧
      ∀
        {m :
          ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
            ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero},
        m ≫ Fork.ι (equalizerFork f g) = Fork.ι s → m = l }
[PROOFSTEP]
use s.ι.codRestrict _ fun x => (ConcreteCategory.congr_hom s.condition x : _)
[GOAL]
case property
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
⊢ RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
          (_ :
            ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
              ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x) ≫
        Fork.ι (equalizerFork f g) =
      Fork.ι s ∧
    ∀
      {m :
        ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
          ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero},
      m ≫ Fork.ι (equalizerFork f g) = Fork.ι s →
        m =
          RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
            (_ :
              ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
                ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x)
[PROOFSTEP]
constructor
[GOAL]
case property.left
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
⊢ RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
        (_ :
          ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
            ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x) ≫
      Fork.ι (equalizerFork f g) =
    Fork.ι s
[PROOFSTEP]
ext
[GOAL]
case property.left.w
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
x✝ : (forget CommRingCat).obj (((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)
⊢ ↑(RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
            (_ :
              ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
                ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x) ≫
          Fork.ι (equalizerFork f g))
      x✝ =
    ↑(Fork.ι s) x✝
[PROOFSTEP]
rfl
[GOAL]
case property.right
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
⊢ ∀
    {m :
      ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
        ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero},
    m ≫ Fork.ι (equalizerFork f g) = Fork.ι s →
      m =
        RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
          (_ :
            ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
              ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x)
[PROOFSTEP]
intro m hm
[GOAL]
case property.right
A B : CommRingCat
f g : A ⟶ B
s : Fork f g
this : SubsemiringClass (Subring ↑A) ↑((parallelPair f g).obj WalkingParallelPair.zero)
m :
  ((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero ⟶
    ((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero
hm : m ≫ Fork.ι (equalizerFork f g) = Fork.ι s
⊢ m =
    RingHom.codRestrict (Fork.ι s) (RingHom.eqLocus f g)
      (_ :
        ∀ (x : ↑(((Functor.const WalkingParallelPair).obj s.pt).obj WalkingParallelPair.zero)),
          ↑(Fork.ι s ≫ f) x = ↑(Fork.ι s ≫ g) x)
[PROOFSTEP]
exact RingHom.ext fun x => Subtype.ext <| ConcreteCategory.congr_hom hm x
[GOAL]
A B : CommRingCat
f g : A ⟶ B
⊢ IsLocalRingHom (Fork.ι (equalizerFork f g))
[PROOFSTEP]
constructor
[GOAL]
case map_nonunit
A B : CommRingCat
f g : A ⟶ B
⊢ ∀ (a : ↑(((Functor.const WalkingParallelPair).obj (equalizerFork f g).pt).obj WalkingParallelPair.zero)),
    IsUnit (↑(Fork.ι (equalizerFork f g)) a) → IsUnit a
[PROOFSTEP]
rintro ⟨a, h₁ : _ = _⟩ (⟨⟨x, y, h₃, h₄⟩, rfl : x = _⟩ : IsUnit a)
[GOAL]
case map_nonunit.mk.intro.mk
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
⊢ IsUnit { val := x, property := h₁ }
[PROOFSTEP]
have : y ∈ RingHom.eqLocus f g :=
  by
  apply (f.isUnit_map ⟨⟨x, y, h₃, h₄⟩, rfl⟩ : IsUnit (f x)).mul_left_inj.mp
  conv_rhs => rw [h₁]
  rw [← f.map_mul, ← g.map_mul, h₄, f.map_one, g.map_one]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
⊢ y ∈ RingHom.eqLocus f g
[PROOFSTEP]
apply (f.isUnit_map ⟨⟨x, y, h₃, h₄⟩, rfl⟩ : IsUnit (f x)).mul_left_inj.mp
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
⊢ ↑f y * ↑f x = ↑g y * ↑f x
[PROOFSTEP]
conv_rhs => rw [h₁]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
| ↑g y * ↑f x
[PROOFSTEP]
rw [h₁]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
| ↑g y * ↑f x
[PROOFSTEP]
rw [h₁]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
| ↑g y * ↑f x
[PROOFSTEP]
rw [h₁]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
⊢ ↑f y * ↑f x = ↑g y * ↑g x
[PROOFSTEP]
rw [← f.map_mul, ← g.map_mul, h₄, f.map_one, g.map_one]
[GOAL]
case map_nonunit.mk.intro.mk
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
this : y ∈ RingHom.eqLocus f g
⊢ IsUnit { val := x, property := h₁ }
[PROOFSTEP]
rw [isUnit_iff_exists_inv]
[GOAL]
case map_nonunit.mk.intro.mk
A B : CommRingCat
f g : A ⟶ B
x y : ↑A
h₃ : x * y = 1
h₄ : y * x = 1
h₁ : ↑f x = ↑g x
this : y ∈ RingHom.eqLocus f g
⊢ ∃ b, { val := x, property := h₁ } * b = 1
[PROOFSTEP]
exact ⟨⟨y, this⟩, Subtype.eq h₃⟩
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
⊢ IsLocalRingHom (limit.π F WalkingParallelPair.zero)
[PROOFSTEP]
have := limMap_π (diagramIsoParallelPair F).hom WalkingParallelPair.zero
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
this :
  limMap (diagramIsoParallelPair F).hom ≫
      limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
        WalkingParallelPair.zero =
    limit.π F WalkingParallelPair.zero ≫ NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero
⊢ IsLocalRingHom (limit.π F WalkingParallelPair.zero)
[PROOFSTEP]
rw [← IsIso.comp_inv_eq] at this 
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
this :
  (limMap (diagramIsoParallelPair F).hom ≫
        limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
          WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero) =
    limit.π F WalkingParallelPair.zero
⊢ IsLocalRingHom (limit.π F WalkingParallelPair.zero)
[PROOFSTEP]
rw [← this]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
this :
  (limMap (diagramIsoParallelPair F).hom ≫
        limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
          WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero) =
    limit.π F WalkingParallelPair.zero
⊢ IsLocalRingHom
    ((limMap (diagramIsoParallelPair F).hom ≫
        limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
          WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero))
[PROOFSTEP]
rw [←
  limit.isoLimitCone_hom_π
    ⟨_, equalizerForkIsLimit (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right)⟩
    WalkingParallelPair.zero]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
this :
  (limMap (diagramIsoParallelPair F).hom ≫
        limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
          WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero) =
    limit.π F WalkingParallelPair.zero
⊢ IsLocalRingHom
    ((limMap (diagramIsoParallelPair F).hom ≫
        (limit.isoLimitCone
              { cone := equalizerFork (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right),
                isLimit :=
                  equalizerForkIsLimit (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right) }).hom ≫
          NatTrans.app
            { cone := equalizerFork (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right),
                  isLimit :=
                    equalizerForkIsLimit (F.map WalkingParallelPairHom.left)
                      (F.map WalkingParallelPairHom.right) }.cone.π
            WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero))
[PROOFSTEP]
change IsLocalRingHom ((lim.map _ ≫ _ ≫ (equalizerFork _ _).ι) ≫ _)
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPair ⥤ CommRingCat
this :
  (limMap (diagramIsoParallelPair F).hom ≫
        limit.π (parallelPair (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))
          WalkingParallelPair.zero) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero) =
    limit.π F WalkingParallelPair.zero
⊢ IsLocalRingHom
    ((lim.map (diagramIsoParallelPair F).hom ≫
        (limit.isoLimitCone
              { cone := equalizerFork (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right),
                isLimit :=
                  equalizerForkIsLimit (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right) }).hom ≫
          Fork.ι (equalizerFork (F.map WalkingParallelPairHom.left) (F.map WalkingParallelPairHom.right))) ≫
      inv (NatTrans.app (diagramIsoParallelPair F).hom WalkingParallelPair.zero))
[PROOFSTEP]
infer_instance
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPairᵒᵖ ⥤ CommRingCat
⊢ IsLocalRingHom (limit.π F (op one))
[PROOFSTEP]
have : _ = limit.π F (walkingParallelPairOpEquiv.functor.obj _) :=
  (limit.isoLimitCone_inv_π ⟨_, IsLimit.whiskerEquivalence (limit.isLimit F) walkingParallelPairOpEquiv⟩
      WalkingParallelPair.zero :
    _)
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPairᵒᵖ ⥤ CommRingCat
this :
  (limit.isoLimitCone
          { cone := Cone.whisker walkingParallelPairOpEquiv.functor (limit.cone F),
            isLimit := IsLimit.whiskerEquivalence (limit.isLimit F) walkingParallelPairOpEquiv }).inv ≫
      limit.π (walkingParallelPairOpEquiv.functor ⋙ F) zero =
    limit.π F (walkingParallelPairOpEquiv.functor.obj zero)
⊢ IsLocalRingHom (limit.π F (op one))
[PROOFSTEP]
erw [← this]
[GOAL]
A B : CommRingCat
f g : A ⟶ B
F : WalkingParallelPairᵒᵖ ⥤ CommRingCat
this :
  (limit.isoLimitCone
          { cone := Cone.whisker walkingParallelPairOpEquiv.functor (limit.cone F),
            isLimit := IsLimit.whiskerEquivalence (limit.isLimit F) walkingParallelPairOpEquiv }).inv ≫
      limit.π (walkingParallelPairOpEquiv.functor ⋙ F) zero =
    limit.π F (walkingParallelPairOpEquiv.functor.obj zero)
⊢ IsLocalRingHom
    ((limit.isoLimitCone
          { cone := Cone.whisker walkingParallelPairOpEquiv.functor (limit.cone F),
            isLimit := IsLimit.whiskerEquivalence (limit.isLimit F) walkingParallelPairOpEquiv }).inv ≫
      limit.π (walkingParallelPairOpEquiv.functor ⋙ F) zero)
[PROOFSTEP]
infer_instance
[GOAL]
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) ≫
      f =
    ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) ≫
      g
[PROOFSTEP]
ext ⟨x, e⟩
[GOAL]
case w.mk
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
x : ↑A × ↑B
e : x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))
⊢ ↑(ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) ≫
          f)
      { val := x, property := e } =
    ↑(ofHom
            (RingHom.comp (RingHom.snd ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) ≫
          g)
      { val := x, property := e }
[PROOFSTEP]
simpa [CommRingCat.ofHom] using e
[GOAL]
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ IsLimit (pullbackCone f g)
[PROOFSTEP]
fapply PullbackCone.IsLimit.mk
[GOAL]
case lift
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ (s : PullbackCone f g) →
    s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
[PROOFSTEP]
intro s
[GOAL]
case lift
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
⊢ s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
[PROOFSTEP]
apply (s.fst.prod s.snd).codRestrict
[GOAL]
case lift.h
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
⊢ ∀ (x : ↑s.pt),
    ↑(RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s)) x ∈
      RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))
[PROOFSTEP]
intro x
[GOAL]
case lift.h
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
x : ↑s.pt
⊢ ↑(RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s)) x ∈
    RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))
[PROOFSTEP]
exact congr_arg (fun f : s.pt →+* C => f x) s.condition
[GOAL]
case fac_left
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ ∀ (s : PullbackCone f g),
    RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
          (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
          (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
        ofHom
          (RingHom.comp (RingHom.fst ↑A ↑B)
            (Subring.subtype
              (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
      PullbackCone.fst s
[PROOFSTEP]
intro s
[GOAL]
case fac_left
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
⊢ RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
        (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
        (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
[PROOFSTEP]
ext x
[GOAL]
case fac_left.w
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
x : (forget CommRingCat).obj s.pt
⊢ ↑(RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
            (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
          ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.fst s) x
[PROOFSTEP]
rfl
[GOAL]
case fac_right
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ ∀ (s : PullbackCone f g),
    RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
          (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
          (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
        ofHom
          (RingHom.comp (RingHom.snd ↑A ↑B)
            (Subring.subtype
              (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
      PullbackCone.snd s
[PROOFSTEP]
intro s
[GOAL]
case fac_right
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
⊢ RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
        (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
        (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
[PROOFSTEP]
ext x
[GOAL]
case fac_right.w
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
x : (forget CommRingCat).obj s.pt
⊢ ↑(RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
            (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x) ≫
          ofHom
            (RingHom.comp (RingHom.snd ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.snd s) x
[PROOFSTEP]
rfl
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
⊢ ∀ (s : PullbackCone f g)
    (m :
      s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }),
    m ≫
          ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
        PullbackCone.fst s →
      m ≫
            ofHom
              (RingHom.comp (RingHom.snd ↑A ↑B)
                (Subring.subtype
                  (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
          PullbackCone.snd s →
        m =
          RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
            (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x)
[PROOFSTEP]
intro s m e₁ e₂
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
⊢ m =
    RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
      (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
      (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x)
[PROOFSTEP]
refine RingHom.ext fun (x : s.pt) => Subtype.ext ?_
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
x : ↑s.pt
⊢ ↑(↑m x) =
    ↑(↑(RingHom.codRestrict (RingHom.prod (PullbackCone.fst s) (PullbackCone.snd s))
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)))
            (_ : ∀ (x : ↑s.pt), ↑(PullbackCone.fst s ≫ f) x = ↑(PullbackCone.snd s ≫ g) x))
        x)
[PROOFSTEP]
change (m x).1 = (_, _)
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
x : ↑s.pt
⊢ ↑(↑m x) = (↑(PullbackCone.fst s) x, ↑(PullbackCone.snd s) x)
[PROOFSTEP]
have eq1 := (congr_arg (fun f : s.pt →+* A => f x) e₁ : _)
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
x : ↑s.pt
eq1 :
  ↑(m ≫
          ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.fst s) x
⊢ ↑(↑m x) = (↑(PullbackCone.fst s) x, ↑(PullbackCone.snd s) x)
[PROOFSTEP]
have eq2 := (congr_arg (fun f : s.pt →+* B => f x) e₂ : _)
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
x : ↑s.pt
eq1 :
  ↑(m ≫
          ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.fst s) x
eq2 :
  ↑(m ≫
          ofHom
            (RingHom.comp (RingHom.snd ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.snd s) x
⊢ ↑(↑m x) = (↑(PullbackCone.fst s) x, ↑(PullbackCone.snd s) x)
[PROOFSTEP]
rw [← eq1, ← eq2]
[GOAL]
case uniq
A B C : CommRingCat
f : A ⟶ C
g : B ⟶ C
s : PullbackCone f g
m : s.pt ⟶ of { x // x ∈ RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B)) }
e₁ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.fst ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.fst s
e₂ :
  m ≫
      ofHom
        (RingHom.comp (RingHom.snd ↑A ↑B)
          (Subring.subtype
            (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))) =
    PullbackCone.snd s
x : ↑s.pt
eq1 :
  ↑(m ≫
          ofHom
            (RingHom.comp (RingHom.fst ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.fst s) x
eq2 :
  ↑(m ≫
          ofHom
            (RingHom.comp (RingHom.snd ↑A ↑B)
              (Subring.subtype
                (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
      x =
    ↑(PullbackCone.snd s) x
⊢ ↑(↑m x) =
    (↑(m ≫
            ofHom
              (RingHom.comp (RingHom.fst ↑A ↑B)
                (Subring.subtype
                  (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
        x,
      ↑(m ≫
            ofHom
              (RingHom.comp (RingHom.snd ↑A ↑B)
                (Subring.subtype
                  (RingHom.eqLocus (RingHom.comp f (RingHom.fst ↑A ↑B)) (RingHom.comp g (RingHom.snd ↑A ↑B))))))
        x)
[PROOFSTEP]
rfl
