l3lab/ntp-mathlib huggingface dataset:
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      

Proof state:
case refine_3
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝¹ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
src✝ : R' ⊗[R] S ≃ₗ[R] S' :=
  _root_.TensorProduct.comm R R' S ≪≫ₗ
    LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
r : R'
x✝ x y : R' ⊗[R] S
hx :
  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
      ((TensorProduct.comm R R' S) (r • x)) =
    r •
      (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S')))) ((TensorProduct.comm R R' S) x)
hy :
  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
      ((TensorProduct.comm R R' S) (r • y)) =
    r •
      (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S')))) ((TensorProduct.comm R R' S) y)
⊢ (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
      ((TensorProduct.comm R R' S) (r • (x + y))) =
    r •
      (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
        ((TensorProduct.comm R R' S) (x + y))

Next tactic:
rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
  

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
e : R' ⊗[R] S ≃ₗ[R'] S' :=
  let src :=
    _root_.TensorProduct.comm R R' S ≪≫ₗ
      LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))));
  {
    toLinearMap :=
      { toAddHom := src.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : R') (x : R' ⊗[R] S),
              (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                  ((TensorProduct.comm R R' S) (r • x)) =
                r •
                  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                    ((TensorProduct.comm R R' S) x)) },
    invFun := src.invFun, left_inv := (_ : Function.LeftInverse src.invFun src.toFun),
    right_inv := (_ : Function.RightInverse src.invFun src.toFun) }
⊢ IsPushout R R' S S'

Next tactic:
have :
    (toAlgHom R S S').toLinearMap =
      (e.toLinearMap.restrictScalars R).comp (TensorProduct.mk R R' S 1) := by
    ext
    simp [h.1.equiv_tmul, Algebra.smul_def]
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
  have :
    (toAlgHom R S S').toLinearMap =
      (e.toLinearMap.restrictScalars R).comp (TensorProduct.mk R R' S 1) := by
    

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
e : R' ⊗[R] S ≃ₗ[R'] S' :=
  let src :=
    _root_.TensorProduct.comm R R' S ≪≫ₗ
      LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))));
  {
    toLinearMap :=
      { toAddHom := src.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : R') (x : R' ⊗[R] S),
              (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                  ((TensorProduct.comm R R' S) (r • x)) =
                r •
                  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                    ((TensorProduct.comm R R' S) x)) },
    invFun := src.invFun, left_inv := (_ : Function.LeftInverse src.invFun src.toFun),
    right_inv := (_ : Function.RightInverse src.invFun src.toFun) }
⊢ AlgHom.toLinearMap (toAlgHom R S S') = ↑R ↑e ∘ₗ (TensorProduct.mk R R' S) 1

Next tactic:
ext
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
  have :
    (toAlgHom R S S').toLinearMap =
      (e.toLinearMap.restrictScalars R).comp (TensorProduct.mk R R' S 1) := by
    ext
    

Proof state:
case h
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝¹ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
e : R' ⊗[R] S ≃ₗ[R'] S' :=
  let src :=
    _root_.TensorProduct.comm R R' S ≪≫ₗ
      LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))));
  {
    toLinearMap :=
      { toAddHom := src.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : R') (x : R' ⊗[R] S),
              (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                  ((TensorProduct.comm R R' S) (r • x)) =
                r •
                  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                    ((TensorProduct.comm R R' S) x)) },
    invFun := src.invFun, left_inv := (_ : Function.LeftInverse src.invFun src.toFun),
    right_inv := (_ : Function.RightInverse src.invFun src.toFun) }
x✝ : S
⊢ (AlgHom.toLinearMap (toAlgHom R S S')) x✝ = (↑R ↑e ∘ₗ (TensorProduct.mk R R' S) 1) x✝

Next tactic:
simp [h.1.equiv_tmul, Algebra.smul_def]
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
  have :
    (toAlgHom R S S').toLinearMap =
      (e.toLinearMap.restrictScalars R).comp (TensorProduct.mk R R' S 1) := by
    ext
    simp [h.1.equiv_tmul, Algebra.smul_def]
  

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
e : R' ⊗[R] S ≃ₗ[R'] S' :=
  let src :=
    _root_.TensorProduct.comm R R' S ≪≫ₗ
      LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))));
  {
    toLinearMap :=
      { toAddHom := src.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : R') (x : R' ⊗[R] S),
              (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                  ((TensorProduct.comm R R' S) (r • x)) =
                r •
                  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                    ((TensorProduct.comm R R' S) x)) },
    invFun := src.invFun, left_inv := (_ : Function.LeftInverse src.invFun src.toFun),
    right_inv := (_ : Function.RightInverse src.invFun src.toFun) }
this : AlgHom.toLinearMap (toAlgHom R S S') = ↑R ↑e ∘ₗ (TensorProduct.mk R R' S) 1
⊢ IsPushout R R' S S'

Next tactic:
constructor
@[symm]
theorem Algebra.IsPushout.symm (h : Algebra.IsPushout R S R' S') : Algebra.IsPushout R R' S S' := by
  let _ := (Algebra.TensorProduct.includeRight : R' →ₐ[R] S ⊗ R').toRingHom.toAlgebra
  let e : R' ⊗[R] S ≃ₗ[R'] S' := by
    refine' { (_root_.TensorProduct.comm R R' S).trans <|
      h.1.equiv.restrictScalars R with map_smul' := _ }
    intro r x
    change
      h.1.equiv (TensorProduct.comm R R' S (r • x)) = r • h.1.equiv (TensorProduct.comm R R' S x)
    refine TensorProduct.induction_on x ?_ ?_ ?_
    · simp only [smul_zero, map_zero]
    · intro x y
      simp only [smul_tmul', smul_eq_mul, TensorProduct.comm_tmul, smul_def,
        TensorProduct.algebraMap_apply, id.map_eq_id, RingHom.id_apply, TensorProduct.tmul_mul_tmul,
        one_mul, h.1.equiv_tmul, AlgHom.toLinearMap_apply, _root_.map_mul,
        IsScalarTower.coe_toAlgHom']
      ring
    · intro x y hx hy
      rw [map_add, map_add, smul_add, map_add, map_add, hx, hy, smul_add]
  have :
    (toAlgHom R S S').toLinearMap =
      (e.toLinearMap.restrictScalars R).comp (TensorProduct.mk R R' S 1) := by
    ext
    simp [h.1.equiv_tmul, Algebra.smul_def]
  constructor
  

Proof state:
case out
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³¹ : AddCommMonoid M
inst✝³⁰ : AddCommMonoid N
inst✝²⁹ : CommRing R
inst✝²⁸ : CommRing S
inst✝²⁷ : Algebra R S
inst✝²⁶ : Module R M
inst✝²⁵ : Module R N
inst✝²⁴ : Module S N
inst✝²³ : IsScalarTower R S N
f : M →ₗ[R] N
h✝ : IsBaseChange S f
P : Type u_2
Q : Type u_3
inst✝²² : AddCommMonoid P
inst✝²¹ : Module R P
inst✝²⁰ : AddCommMonoid Q
inst✝¹⁹ : Module S Q
T : Type u_4
O : Type u_5
inst✝¹⁸ : CommRing T
inst✝¹⁷ : Algebra R T
inst✝¹⁶ : Algebra S T
inst✝¹⁵ : IsScalarTower R S T
inst✝¹⁴ : AddCommMonoid O
inst✝¹³ : Module R O
inst✝¹² : Module S O
inst✝¹¹ : Module T O
inst✝¹⁰ : IsScalarTower S T O
inst✝⁹ : IsScalarTower R S O
inst✝⁸ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁷ : CommRing R'
inst✝⁶ : CommRing S'
inst✝⁵ : Algebra R R'
inst✝⁴ : Algebra S S'
inst✝³ : Algebra R' S'
inst✝² : Algebra R S'
inst✝¹ : IsScalarTower R R' S'
inst✝ : IsScalarTower R S S'
h : IsPushout R S R' S'
x✝ : Algebra R' (S ⊗[R] R') := RingHom.toAlgebra ↑TensorProduct.includeRight
e : R' ⊗[R] S ≃ₗ[R'] S' :=
  let src :=
    _root_.TensorProduct.comm R R' S ≪≫ₗ
      LinearEquiv.restrictScalars R (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))));
  {
    toLinearMap :=
      { toAddHom := src.toAddHom,
        map_smul' :=
          (_ :
            ∀ (r : R') (x : R' ⊗[R] S),
              (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                  ((TensorProduct.comm R R' S) (r • x)) =
                r •
                  (IsBaseChange.equiv (_ : IsBaseChange S (AlgHom.toLinearMap (toAlgHom R R' S'))))
                    ((TensorProduct.comm R R' S) x)) },
    invFun := src.invFun, left_inv := (_ : Function.LeftInverse src.invFun src.toFun),
    right_inv := (_ : Function.RightInverse src.invFun src.toFun) }
this : AlgHom.toLinearMap (toAlgHom R S S') = ↑R ↑e ∘ₗ (TensorProduct.mk R R' S) 1
⊢ IsBaseChange R' (AlgHom.toLinearMap (toAlgHom R S S'))

Next tactic:
rw [this]
/-- If `S' = S ⊗[R] R'`, then any pair of `R`-algebra homomorphisms `f : S → A` and `g : R' → A`
such that `f x` and `g y` commutes for all `x, y` descends to a (unique) homomoprhism `S' → A`.
-/
--@[simps (config := .lemmasOnly) apply] --Porting note: removed and added by hand
noncomputable def Algebra.pushoutDesc [H : Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A]
    [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (hf : ∀ x y, f x * g y = g y * f x) :
    S' →ₐ[R] A := by
  

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³³ : AddCommMonoid M
inst✝³² : AddCommMonoid N
inst✝³¹ : CommRing R
inst✝³⁰ : CommRing S
inst✝²⁹ : Algebra R S
inst✝²⁸ : Module R M
inst✝²⁷ : Module R N
inst✝²⁶ : Module S N
inst✝²⁵ : IsScalarTower R S N
f✝ : M →ₗ[R] N
h : IsBaseChange S f✝
P : Type u_2
Q : Type u_3
inst✝²⁴ : AddCommMonoid P
inst✝²³ : Module R P
inst✝²² : AddCommMonoid Q
inst✝²¹ : Module S Q
T : Type u_4
O : Type u_5
inst✝²⁰ : CommRing T
inst✝¹⁹ : Algebra R T
inst✝¹⁸ : Algebra S T
inst✝¹⁷ : IsScalarTower R S T
inst✝¹⁶ : AddCommMonoid O
inst✝¹⁵ : Module R O
inst✝¹⁴ : Module S O
inst✝¹³ : Module T O
inst✝¹² : IsScalarTower S T O
inst✝¹¹ : IsScalarTower R S O
inst✝¹⁰ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁹ : CommRing R'
inst✝⁸ : CommRing S'
inst✝⁷ : Algebra R R'
inst✝⁶ : Algebra S S'
inst✝⁵ : Algebra R' S'
inst✝⁴ : Algebra R S'
inst✝³ : IsScalarTower R R' S'
inst✝² : IsScalarTower R S S'
H : IsPushout R S R' S'
A : Type u_8
inst✝¹ : Semiring A
inst✝ : Algebra R A
f : S →ₐ[R] A
g : R' →ₐ[R] A
hf : ∀ (x : S) (y : R'), f x * g y = g y * f x
⊢ S' →ₐ[R] A

Next tactic:
letI := Module.compHom A f.toRingHom
/-- If `S' = S ⊗[R] R'`, then any pair of `R`-algebra homomorphisms `f : S → A` and `g : R' → A`
such that `f x` and `g y` commutes for all `x, y` descends to a (unique) homomoprhism `S' → A`.
-/
--@[simps (config := .lemmasOnly) apply] --Porting note: removed and added by hand
noncomputable def Algebra.pushoutDesc [H : Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A]
    [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (hf : ∀ x y, f x * g y = g y * f x) :
    S' →ₐ[R] A := by
  letI := Module.compHom A f.toRingHom
  

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³³ : AddCommMonoid M
inst✝³² : AddCommMonoid N
inst✝³¹ : CommRing R
inst✝³⁰ : CommRing S
inst✝²⁹ : Algebra R S
inst✝²⁸ : Module R M
inst✝²⁷ : Module R N
inst✝²⁶ : Module S N
inst✝²⁵ : IsScalarTower R S N
f✝ : M →ₗ[R] N
h : IsBaseChange S f✝
P : Type u_2
Q : Type u_3
inst✝²⁴ : AddCommMonoid P
inst✝²³ : Module R P
inst✝²² : AddCommMonoid Q
inst✝²¹ : Module S Q
T : Type u_4
O : Type u_5
inst✝²⁰ : CommRing T
inst✝¹⁹ : Algebra R T
inst✝¹⁸ : Algebra S T
inst✝¹⁷ : IsScalarTower R S T
inst✝¹⁶ : AddCommMonoid O
inst✝¹⁵ : Module R O
inst✝¹⁴ : Module S O
inst✝¹³ : Module T O
inst✝¹² : IsScalarTower S T O
inst✝¹¹ : IsScalarTower R S O
inst✝¹⁰ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁹ : CommRing R'
inst✝⁸ : CommRing S'
inst✝⁷ : Algebra R R'
inst✝⁶ : Algebra S S'
inst✝⁵ : Algebra R' S'
inst✝⁴ : Algebra R S'
inst✝³ : IsScalarTower R R' S'
inst✝² : IsScalarTower R S S'
H : IsPushout R S R' S'
A : Type u_8
inst✝¹ : Semiring A
inst✝ : Algebra R A
f : S →ₐ[R] A
g : R' →ₐ[R] A
hf : ∀ (x : S) (y : R'), f x * g y = g y * f x
this : Module S A := Module.compHom A ↑f
⊢ S' →ₐ[R] A

Next tactic:
haveI : IsScalarTower R S A :=
    { smul_assoc := fun r s a =>
        show f (r • s) * a = r • (f s * a) by rw [f.map_smul, smul_mul_assoc] }
/-- If `S' = S ⊗[R] R'`, then any pair of `R`-algebra homomorphisms `f : S → A` and `g : R' → A`
such that `f x` and `g y` commutes for all `x, y` descends to a (unique) homomoprhism `S' → A`.
-/
--@[simps (config := .lemmasOnly) apply] --Porting note: removed and added by hand
noncomputable def Algebra.pushoutDesc [H : Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A]
    [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (hf : ∀ x y, f x * g y = g y * f x) :
    S' →ₐ[R] A := by
  letI := Module.compHom A f.toRingHom
  haveI : IsScalarTower R S A :=
    { smul_assoc := fun r s a =>
        show f (r • s) * a = r • (f s * a) by 

Proof state:
R : Type u_1
M : Type v₁
N : Type v₂
S : Type v₃
inst✝³³ : AddCommMonoid M
inst✝³² : AddCommMonoid N
inst✝³¹ : CommRing R
inst✝³⁰ : CommRing S
inst✝²⁹ : Algebra R S
inst✝²⁸ : Module R M
inst✝²⁷ : Module R N
inst✝²⁶ : Module S N
inst✝²⁵ : IsScalarTower R S N
f✝ : M →ₗ[R] N
h : IsBaseChange S f✝
P : Type u_2
Q : Type u_3
inst✝²⁴ : AddCommMonoid P
inst✝²³ : Module R P
inst✝²² : AddCommMonoid Q
inst✝²¹ : Module S Q
T : Type u_4
O : Type u_5
inst✝²⁰ : CommRing T
inst✝¹⁹ : Algebra R T
inst✝¹⁸ : Algebra S T
inst✝¹⁷ : IsScalarTower R S T
inst✝¹⁶ : AddCommMonoid O
inst✝¹⁵ : Module R O
inst✝¹⁴ : Module S O
inst✝¹³ : Module T O
inst✝¹² : IsScalarTower S T O
inst✝¹¹ : IsScalarTower R S O
inst✝¹⁰ : IsScalarTower R T O
R' : Type u_6
S' : Type u_7
inst✝⁹ : CommRing R'
inst✝⁸ : CommRing S'
inst✝⁷ : Algebra R R'
inst✝⁶ : Algebra S S'
inst✝⁵ : Algebra R' S'
inst✝⁴ : Algebra R S'
inst✝³ : IsScalarTower R R' S'
inst✝² : IsScalarTower R S S'
H : IsPushout R S R' S'
A : Type u_8
inst✝¹ : Semiring A
inst✝ : Algebra R A
f : S →ₐ[R] A
g : R' →ₐ[R] A
hf : ∀ (x : S) (y : R'), f x * g y = g y * f x
this : Module S A := Module.compHom A ↑f
r : R
s : S
a : A
⊢ f (r • s) * a = r • (f s * a)

Next tactic:
rw [f.map_smul, smul_mul_assoc]