l3lab/ntp-mathlib huggingface dataset:
protected theorem mul_one (x : A ⊗[R] B) : mul x (1 ⊗ₜ 1) = x := by
  refine TensorProduct.induction_on x ?_ ?_ ?_ <;> 

Proof state:
case refine_1
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonAssocSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonAssocSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x : A ⊗[R] B
⊢ (mul 0) (1 ⊗ₜ[R] 1) = 0

Next tactic:
simp (config := { contextual := true })
protected theorem mul_one (x : A ⊗[R] B) : mul x (1 ⊗ₜ 1) = x := by
  refine TensorProduct.induction_on x ?_ ?_ ?_ <;> 

Proof state:
case refine_2
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonAssocSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonAssocSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x : A ⊗[R] B
⊢ ∀ (x : A) (y : B), (mul (x ⊗ₜ[R] y)) (1 ⊗ₜ[R] 1) = x ⊗ₜ[R] y

Next tactic:
simp (config := { contextual := true })
protected theorem mul_one (x : A ⊗[R] B) : mul x (1 ⊗ₜ 1) = x := by
  refine TensorProduct.induction_on x ?_ ?_ ?_ <;> 

Proof state:
case refine_3
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonAssocSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonAssocSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x : A ⊗[R] B
⊢ ∀ (x y : A ⊗[R] B), (mul x) (1 ⊗ₜ[R] 1) = x → (mul y) (1 ⊗ₜ[R] 1) = y → (mul (x + y)) (1 ⊗ₜ[R] 1) = x + y

Next tactic:
simp (config := { contextual := true })
protected theorem mul_assoc (x y z : A ⊗[R] B) : mul (mul x y) z = mul x (mul y z) := by
  -- restate as an equality of morphisms so that we can use `ext`
  

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonUnitalSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonUnitalSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x y z : A ⊗[R] B
⊢ (mul ((mul x) y)) z = (mul x) ((mul y) z)

Next tactic:
suffices LinearMap.llcomp R _ _ _ mul ∘ₗ mul =
      (LinearMap.llcomp R _ _ _ LinearMap.lflip <| LinearMap.llcomp R _ _ _ mul.flip ∘ₗ mul).flip by
    exact FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this x) y) z
protected theorem mul_assoc (x y z : A ⊗[R] B) : mul (mul x y) z = mul x (mul y z) := by
  -- restate as an equality of morphisms so that we can use `ext`
  suffices LinearMap.llcomp R _ _ _ mul ∘ₗ mul =
      (LinearMap.llcomp R _ _ _ LinearMap.lflip <| LinearMap.llcomp R _ _ _ mul.flip ∘ₗ mul).flip by
    

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonUnitalSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonUnitalSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x y z : A ⊗[R] B
this :
  (LinearMap.llcomp R (?m.413752 ⊗[R] ?m.413753) (?m.413752 ⊗[R] ?m.413753)
          (?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753))
        mul ∘ₗ
      mul =
    LinearMap.flip
      (((LinearMap.llcomp R (?m.413752 ⊗[R] ?m.413753)
            (?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753)
            (?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753))
          LinearMap.lflip)
        ((LinearMap.llcomp R (?m.413752 ⊗[R] ?m.413753) (?m.413752 ⊗[R] ?m.413753)
              (?m.413752 ⊗[R] ?m.413753 →ₗ[R] ?m.413752 ⊗[R] ?m.413753))
            (LinearMap.flip mul) ∘ₗ
          mul))
⊢ (mul ((mul x) y)) z = (mul x) ((mul y) z)

Next tactic:
exact FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this x) y) z
protected theorem mul_assoc (x y z : A ⊗[R] B) : mul (mul x y) z = mul x (mul y z) := by
  -- restate as an equality of morphisms so that we can use `ext`
  suffices LinearMap.llcomp R _ _ _ mul ∘ₗ mul =
      (LinearMap.llcomp R _ _ _ LinearMap.lflip <| LinearMap.llcomp R _ _ _ mul.flip ∘ₗ mul).flip by
    exact FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this x) y) z
  

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonUnitalSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonUnitalSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x y z : A ⊗[R] B
⊢ (LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B)) mul ∘ₗ mul =
    LinearMap.flip
      (((LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B →ₗ[R] A ⊗[R] B)
            (A ⊗[R] B →ₗ[R] A ⊗[R] B →ₗ[R] A ⊗[R] B))
          LinearMap.lflip)
        ((LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B)) (LinearMap.flip mul) ∘ₗ mul))

Next tactic:
ext xa xb ya yb za zb
protected theorem mul_assoc (x y z : A ⊗[R] B) : mul (mul x y) z = mul x (mul y z) := by
  -- restate as an equality of morphisms so that we can use `ext`
  suffices LinearMap.llcomp R _ _ _ mul ∘ₗ mul =
      (LinearMap.llcomp R _ _ _ LinearMap.lflip <| LinearMap.llcomp R _ _ _ mul.flip ∘ₗ mul).flip by
    exact FunLike.congr_fun (FunLike.congr_fun (FunLike.congr_fun this x) y) z
  ext xa xb ya yb za zb
  

Proof state:
case a.h.h.a.h.h.a.h.h
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : NonUnitalSemiring A
inst✝⁶ : Module R A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : IsScalarTower R A A
inst✝³ : NonUnitalSemiring B
inst✝² : Module R B
inst✝¹ : SMulCommClass R B B
inst✝ : IsScalarTower R B B
x y z : A ⊗[R] B
xa : A
xb : B
ya : A
yb : B
za : A
zb : B
⊢ ((AlgebraTensorModule.curry
          (((AlgebraTensorModule.curry
                (((AlgebraTensorModule.curry
                      ((LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B)) mul ∘ₗ mul))
                    xa)
                  xb))
              ya)
            yb))
        za)
      zb =
    ((AlgebraTensorModule.curry
          (((AlgebraTensorModule.curry
                (((AlgebraTensorModule.curry
                      (LinearMap.flip
                        (((LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B →ₗ[R] A ⊗[R] B)
                              (A ⊗[R] B →ₗ[R] A ⊗[R] B →ₗ[R] A ⊗[R] B))
                            LinearMap.lflip)
                          ((LinearMap.llcomp R (A ⊗[R] B) (A ⊗[R] B) (A ⊗[R] B →ₗ[R] A ⊗[R] B)) (LinearMap.flip mul) ∘ₗ
                            mul))))
                    xa)
                  xb))
              ya)
            yb))
        za)
      zb

Next tactic:
exact congr_arg₂ (· ⊗ₜ ·) (mul_assoc xa ya za) (mul_assoc xb yb zb)
instance instSemiring : Semiring (A ⊗[R] B) where
  left_distrib a b c := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a b c : A ⊗[R] B
⊢ a * (b + c) = a * b + a * c

Next tactic:
simp [HMul.hMul, Mul.mul]
instance instSemiring : Semiring (A ⊗[R] B) where
  left_distrib a b c := by simp [HMul.hMul, Mul.mul]
  right_distrib a b c := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a b c : A ⊗[R] B
⊢ (a + b) * c = a * c + b * c

Next tactic:
simp [HMul.hMul, Mul.mul]
instance instSemiring : Semiring (A ⊗[R] B) where
  left_distrib a b c := by simp [HMul.hMul, Mul.mul]
  right_distrib a b c := by simp [HMul.hMul, Mul.mul]
  zero_mul a := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a : A ⊗[R] B
⊢ 0 * a = 0

Next tactic:
simp [HMul.hMul, Mul.mul]
instance instSemiring : Semiring (A ⊗[R] B) where
  left_distrib a b c := by simp [HMul.hMul, Mul.mul]
  right_distrib a b c := by simp [HMul.hMul, Mul.mul]
  zero_mul a := by simp [HMul.hMul, Mul.mul]
  mul_zero a := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a : A ⊗[R] B
⊢ a * 0 = 0

Next tactic:
simp [HMul.hMul, Mul.mul]
@[simp]
theorem tmul_pow (a : A) (b : B) (k : ℕ) : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k) := by
  

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a : A
b : B
k : ℕ
⊢ a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k)

Next tactic:
induction' k with k ih
@[simp]
theorem tmul_pow (a : A) (b : B) (k : ℕ) : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k) := by
  induction' k with k ih
  · 

Proof state:
case zero
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a : A
b : B
⊢ a ⊗ₜ[R] b ^ Nat.zero = (a ^ Nat.zero) ⊗ₜ[R] (b ^ Nat.zero)

Next tactic:
simp [one_def]
@[simp]
theorem tmul_pow (a : A) (b : B) (k : ℕ) : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k) := by
  induction' k with k ih
  · simp [one_def]
  · 

Proof state:
case succ
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
a : A
b : B
k : ℕ
ih : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k)
⊢ a ⊗ₜ[R] b ^ Nat.succ k = (a ^ Nat.succ k) ⊗ₜ[R] (b ^ Nat.succ k)

Next tactic:
simp [pow_succ, ih]
/-- The ring morphism `A →+* A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
@[simps]
def includeLeftRingHom : A →+* A ⊗[R] B where
  toFun a := a ⊗ₜ 1
  map_zero' := by simp
  map_add' := by simp [add_tmul]
  map_one' := rfl
  map_mul' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
⊢ ∀ (x y : A),
    OneHom.toFun { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) }
        (x * y) =
      OneHom.toFun { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) }
          x *
        OneHom.toFun { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) }
          y

Next tactic:
simp
/-- The ring morphism `A →+* A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
@[simps]
def includeLeftRingHom : A →+* A ⊗[R] B where
  toFun a := a ⊗ₜ 1
  map_zero' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) },
          map_mul' := (_ : ∀ (a a_1 : A), (a * a_1) ⊗ₜ[R] 1 = (a * a_1) ⊗ₜ[R] (1 * 1)) })
      0 =
    0

Next tactic:
simp
/-- The ring morphism `A →+* A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
@[simps]
def includeLeftRingHom : A →+* A ⊗[R] B where
  toFun a := a ⊗ₜ 1
  map_zero' := by simp
  map_add' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁶ : CommSemiring R
inst✝⁵ : Semiring A
inst✝⁴ : Algebra R A
inst✝³ : Semiring B
inst✝² : Algebra R B
inst✝¹ : Semiring C
inst✝ : Algebra R C
⊢ ∀ (x y : A),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) },
            map_mul' := (_ : ∀ (a a_1 : A), (a * a_1) ⊗ₜ[R] 1 = (a * a_1) ⊗ₜ[R] (1 * 1)) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) },
              map_mul' := (_ : ∀ (a a_1 : A), (a * a_1) ⊗ₜ[R] 1 = (a * a_1) ⊗ₜ[R] (1 * 1)) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun a => a ⊗ₜ[R] 1, map_one' := (_ : (fun a => a ⊗ₜ[R] 1) 1 = (fun a => a ⊗ₜ[R] 1) 1) },
              map_mul' := (_ : ∀ (a a_1 : A), (a * a_1) ⊗ₜ[R] 1 = (a * a_1) ⊗ₜ[R] (1 * 1)) })
          y

Next tactic:
simp [add_tmul]
instance leftAlgebra [SMulCommClass R S A] : Algebra S (A ⊗[R] B) :=
  { commutes' := fun r x => by
      

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R B
inst✝⁴ : Semiring C
inst✝³ : Algebra R C
inst✝² : CommSemiring S
inst✝¹ : Algebra S A
inst✝ : SMulCommClass R S A
r : S
x : A ⊗[R] B
⊢ (RingHom.comp includeLeftRingHom (algebraMap S A)) r * x = x * (RingHom.comp includeLeftRingHom (algebraMap S A)) r

Next tactic:
dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
instance leftAlgebra [SMulCommClass R S A] : Algebra S (A ⊗[R] B) :=
  { commutes' := fun r x => by
      dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
      

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R B
inst✝⁴ : Semiring C
inst✝³ : Algebra R C
inst✝² : CommSemiring S
inst✝¹ : Algebra S A
inst✝ : SMulCommClass R S A
r : S
x : A ⊗[R] B
⊢ (algebraMap S A) r ⊗ₜ[R] 1 * x = x * (algebraMap S A) r ⊗ₜ[R] 1

Next tactic:
rw [algebraMap_eq_smul_one, ← smul_tmul', ← one_def, mul_smul_comm, smul_mul_assoc, mul_one,
        one_mul]
instance leftAlgebra [SMulCommClass R S A] : Algebra S (A ⊗[R] B) :=
  { commutes' := fun r x => by
      dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
      rw [algebraMap_eq_smul_one, ← smul_tmul', ← one_def, mul_smul_comm, smul_mul_assoc, mul_one,
        one_mul]
    smul_def' := fun r x => by
      

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R B
inst✝⁴ : Semiring C
inst✝³ : Algebra R C
inst✝² : CommSemiring S
inst✝¹ : Algebra S A
inst✝ : SMulCommClass R S A
r : S
x : A ⊗[R] B
⊢ r • x = (RingHom.comp includeLeftRingHom (algebraMap S A)) r * x

Next tactic:
dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
instance leftAlgebra [SMulCommClass R S A] : Algebra S (A ⊗[R] B) :=
  { commutes' := fun r x => by
      dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
      rw [algebraMap_eq_smul_one, ← smul_tmul', ← one_def, mul_smul_comm, smul_mul_assoc, mul_one,
        one_mul]
    smul_def' := fun r x => by
      dsimp only [RingHom.toFun_eq_coe, RingHom.comp_apply, includeLeftRingHom_apply]
      

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R B
inst✝⁴ : Semiring C
inst✝³ : Algebra R C
inst✝² : CommSemiring S
inst✝¹ : Algebra S A
inst✝ : SMulCommClass R S A
r : S
x : A ⊗[R] B
⊢ r • x = (algebraMap S A) r ⊗ₜ[R] 1 * x

Next tactic:
rw [algebraMap_eq_smul_one, ← smul_tmul', smul_mul_assoc, ← one_def, one_mul]
theorem algebraMap_apply' (r : R) :
    algebraMap R (A ⊗[R] B) r = 1 ⊗ₜ algebraMap R B r := by
  

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
r : R
⊢ (algebraMap R (A ⊗[R] B)) r = 1 ⊗ₜ[R] (algebraMap R B) r

Next tactic:
rw [algebraMap_apply, Algebra.algebraMap_eq_smul_one, Algebra.algebraMap_eq_smul_one, smul_tmul]
/-- The `R`-algebra morphism `A →ₐ[R] A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
def includeLeft [SMulCommClass R S A] : A →ₐ[S] A ⊗[R] B :=
  { includeLeftRingHom with commutes' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Semiring B
inst✝⁵ : Algebra R B
inst✝⁴ : Semiring C
inst✝³ : Algebra R C
inst✝² : CommSemiring S
inst✝¹ : Algebra S A
inst✝ : SMulCommClass R S A
src✝ : A →+* A ⊗[R] B := includeLeftRingHom
⊢ ∀ (r : S),
    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 S A) r) =
      (algebraMap S (A ⊗[R] B)) r

Next tactic:
simp
/-- The algebra morphism `B →ₐ[R] A ⊗[R] B` sending `b` to `1 ⊗ₜ b`. -/
def includeRight : B →ₐ[R] A ⊗[R] B where
  toFun b := 1 ⊗ₜ b
  map_zero' := by simp
  map_add' := by simp [tmul_add]
  map_one' := rfl
  map_mul' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
⊢ ∀ (x y : B),
    OneHom.toFun { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) }
        (x * y) =
      OneHom.toFun { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) }
          x *
        OneHom.toFun { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) }
          y

Next tactic:
simp
/-- The algebra morphism `B →ₐ[R] A ⊗[R] B` sending `b` to `1 ⊗ₜ b`. -/
def includeRight : B →ₐ[R] A ⊗[R] B where
  toFun b := 1 ⊗ₜ b
  map_zero' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) },
          map_mul' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a * a_1) = (1 * 1) ⊗ₜ[R] (a * a_1)) })
      0 =
    0

Next tactic:
simp
/-- The algebra morphism `B →ₐ[R] A ⊗[R] B` sending `b` to `1 ⊗ₜ b`. -/
def includeRight : B →ₐ[R] A ⊗[R] B where
  toFun b := 1 ⊗ₜ b
  map_zero' := by simp
  map_add' := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
⊢ ∀ (x y : B),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) },
            map_mul' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a * a_1) = (1 * 1) ⊗ₜ[R] (a * a_1)) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) },
              map_mul' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a * a_1) = (1 * 1) ⊗ₜ[R] (a * a_1)) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) },
              map_mul' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a * a_1) = (1 * 1) ⊗ₜ[R] (a * a_1)) })
          y

Next tactic:
simp [tmul_add]
/-- The algebra morphism `B →ₐ[R] A ⊗[R] B` sending `b` to `1 ⊗ₜ b`. -/
def includeRight : B →ₐ[R] A ⊗[R] B where
  toFun b := 1 ⊗ₜ b
  map_zero' := by simp
  map_add' := by simp [tmul_add]
  map_one' := rfl
  map_mul' := by simp
  commutes' r := by 

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
r : R
⊢ OneHom.toFun
      (↑↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun b => 1 ⊗ₜ[R] b, map_one' := (_ : (fun b => 1 ⊗ₜ[R] b) 1 = (fun b => 1 ⊗ₜ[R] b) 1) },
                map_mul' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a * a_1) = (1 * 1) ⊗ₜ[R] (a * a_1)) },
            map_zero' := (_ : 1 ⊗ₜ[R] 0 = 0),
            map_add' := (_ : ∀ (a a_1 : B), 1 ⊗ₜ[R] (a + a_1) = 1 ⊗ₜ[R] a + 1 ⊗ₜ[R] a_1) })
      ((algebraMap R B) r) =
    (algebraMap R (A ⊗[R] B)) r

Next tactic:
simp only [algebraMap_apply']
theorem includeLeftRingHom_comp_algebraMap :
    (includeLeftRingHom.comp (algebraMap R A) : R →+* A ⊗[R] B) =
      includeRight.toRingHom.comp (algebraMap R B) := by
  

Proof state:
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
⊢ RingHom.comp includeLeftRingHom (algebraMap R A) = RingHom.comp (↑includeRight) (algebraMap R B)

Next tactic:
ext
theorem includeLeftRingHom_comp_algebraMap :
    (includeLeftRingHom.comp (algebraMap R A) : R →+* A ⊗[R] B) =
      includeRight.toRingHom.comp (algebraMap R B) := by
  ext
  

Proof state:
case a
R : Type uR
S : Type uS
A : Type uA
B : Type uB
C : Type uC
D : Type uD
E : Type uE
F : Type uF
inst✝⁸ : CommSemiring R
inst✝⁷ : Semiring A
inst✝⁶ : Algebra R A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Semiring C
inst✝² : Algebra R C
inst✝¹ : CommSemiring S
inst✝ : Algebra S A
x✝ : R
⊢ (RingHom.comp includeLeftRingHom (algebraMap R A)) x✝ = (RingHom.comp (↑includeRight) (algebraMap R B)) x✝

Next tactic:
simp