l3lab/ntp-mathlib huggingface dataset:
theorem comm_symm :
    (TensorProduct.comm R A B).symm = TensorProduct.comm R B 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
⊢ AlgEquiv.symm (TensorProduct.comm R A B) = TensorProduct.comm R B A

Next tactic:
ext
theorem comm_symm :
    (TensorProduct.comm R A B).symm = TensorProduct.comm R B A := by
  ext; 

Proof state:
case 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
a✝ : B ⊗[R] A
⊢ (AlgEquiv.symm (TensorProduct.comm R A B)) a✝ = (TensorProduct.comm R B A) a✝

Next tactic:
rfl
/-- The tensor product of a pair of algebra morphisms. -/
def map (f : A →ₐ[S] B) (g : C →ₐ[R] D) : A ⊗[R] C →ₐ[S] B ⊗[R] D :=
  algHomOfLinearMapTensorProduct (AlgebraTensorModule.map f.toLinearMap g.toLinearMap) (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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[S] B
g : C →ₐ[R] D
⊢ ∀ (a₁ a₂ : A) (b₁ b₂ : C),
    (AlgebraTensorModule.map (AlgHom.toLinearMap f) (AlgHom.toLinearMap g)) ((a₁ * a₂) ⊗ₜ[R] (b₁ * b₂)) =
      (AlgebraTensorModule.map (AlgHom.toLinearMap f) (AlgHom.toLinearMap g)) (a₁ ⊗ₜ[R] b₁) *
        (AlgebraTensorModule.map (AlgHom.toLinearMap f) (AlgHom.toLinearMap g)) (a₂ ⊗ₜ[R] b₂)

Next tactic:
simp
/-- The tensor product of a pair of algebra morphisms. -/
def map (f : A →ₐ[S] B) (g : C →ₐ[R] D) : A ⊗[R] C →ₐ[S] B ⊗[R] D :=
  algHomOfLinearMapTensorProduct (AlgebraTensorModule.map f.toLinearMap g.toLinearMap) (by simp)
    (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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[S] B
g : C →ₐ[R] D
⊢ (AlgebraTensorModule.map (AlgHom.toLinearMap f) (AlgHom.toLinearMap g)) (1 ⊗ₜ[R] 1) = 1

Next tactic:
simp [one_def]
@[simp]
theorem map_comp_includeLeft (f : A →ₐ[S] B) (g : C →ₐ[R] D) :
    (map f g).comp includeLeft = includeLeft.comp f :=
  AlgHom.ext <| 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[S] B
g : C →ₐ[R] D
⊢ ∀ (x : A), (AlgHom.comp (map f g) includeLeft) x = (AlgHom.comp includeLeft f) x

Next tactic:
simp
@[simp]
theorem map_restrictScalars_comp_includeRight (f : A →ₐ[S] B) (g : C →ₐ[R] D) :
    ((map f g).restrictScalars R).comp includeRight = includeRight.comp g :=
  AlgHom.ext <| 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[S] B
g : C →ₐ[R] D
⊢ ∀ (x : C), (AlgHom.comp (AlgHom.restrictScalars R (map f g)) includeRight) x = (AlgHom.comp includeRight g) x

Next tactic:
simp
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
⊢ AlgHom.range (map f g) = AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g)

Next tactic:
apply le_antisymm
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · 

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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
⊢ AlgHom.range (map f g) ≤ AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g)

Next tactic:
rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
    

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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
⊢ ⇑(map f g) '' {t | ∃ a b, a ⊗ₜ[R] b = t} ⊆
    ↑(AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g))

Next tactic:
rintro _ ⟨_, ⟨a, b, rfl⟩, rfl⟩
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
    rintro _ ⟨_, ⟨a, b, rfl⟩, rfl⟩
    

Proof state:
case a.intro.intro.intro.intro
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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
a : A
b : C
⊢ (map f g) (a ⊗ₜ[R] b) ∈ ↑(AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g))

Next tactic:
rw [map_tmul, ← _root_.mul_one (f a), ← _root_.one_mul (g b), ← tmul_mul_tmul]
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
    rintro _ ⟨_, ⟨a, b, rfl⟩, rfl⟩
    rw [map_tmul, ← _root_.mul_one (f a), ← _root_.one_mul (g b), ← tmul_mul_tmul]
    

Proof state:
case a.intro.intro.intro.intro
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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
a : A
b : C
⊢ f a ⊗ₜ[R] 1 * 1 ⊗ₜ[R] g b ∈ ↑(AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g))

Next tactic:
exact mul_mem_sup (AlgHom.mem_range_self _ a) (AlgHom.mem_range_self _ b)
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
    rintro _ ⟨_, ⟨a, b, rfl⟩, rfl⟩
    rw [map_tmul, ← _root_.mul_one (f a), ← _root_.one_mul (g b), ← tmul_mul_tmul]
    exact mul_mem_sup (AlgHom.mem_range_self _ a) (AlgHom.mem_range_self _ b)
  · 

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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
⊢ AlgHom.range (AlgHom.comp includeLeft f) ⊔ AlgHom.range (AlgHom.comp includeRight g) ≤ AlgHom.range (map f g)

Next tactic:
rw [← map_comp_includeLeft f g, ← map_comp_includeRight f g]
theorem map_range (f : A →ₐ[R] B) (g : C →ₐ[R] D) :
    (map f g).range = (includeLeft.comp f).range ⊔ (includeRight.comp g).range := by
  apply le_antisymm
  · rw [← map_top, ← adjoin_tmul_eq_top, ← adjoin_image, adjoin_le_iff]
    rintro _ ⟨_, ⟨a, b, rfl⟩, rfl⟩
    rw [map_tmul, ← _root_.mul_one (f a), ← _root_.one_mul (g b), ← tmul_mul_tmul]
    exact mul_mem_sup (AlgHom.mem_range_self _ a) (AlgHom.mem_range_self _ b)
  · rw [← map_comp_includeLeft f g, ← map_comp_includeRight f g]
    

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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A →ₐ[R] B
g : C →ₐ[R] D
⊢ AlgHom.range (AlgHom.comp (map f g) includeLeft) ⊔ AlgHom.range (AlgHom.comp (map f g) includeRight) ≤
    AlgHom.range (map f g)

Next tactic:
exact sup_le (AlgHom.range_comp_le_range _ _) (AlgHom.range_comp_le_range _ _)
/-- Construct an isomorphism between tensor products of an S-algebra with an R-algebra
from S- and R- isomorphisms between the tensor factors.
-/
def congr (f : A ≃ₐ[S] B) (g : C ≃ₐ[R] D) : A ⊗[R] C ≃ₐ[S] B ⊗[R] D :=
  AlgEquiv.ofAlgHom (map f g) (map f.symm g.symm)
    (ext' fun b d => 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A ≃ₐ[S] B
g : C ≃ₐ[R] D
b : B
d : D
⊢ (AlgHom.comp (map ↑f ↑g) (map ↑(AlgEquiv.symm f) ↑(AlgEquiv.symm g))) (b ⊗ₜ[R] d) =
    (AlgHom.id S (B ⊗[R] D)) (b ⊗ₜ[R] d)

Next tactic:
simp
/-- Construct an isomorphism between tensor products of an S-algebra with an R-algebra
from S- and R- isomorphisms between the tensor factors.
-/
def congr (f : A ≃ₐ[S] B) (g : C ≃ₐ[R] D) : A ⊗[R] C ≃ₐ[S] B ⊗[R] D :=
  AlgEquiv.ofAlgHom (map f g) (map f.symm g.symm)
    (ext' fun b d => by simp) (ext' fun a 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✝¹⁹ : CommSemiring S
inst✝¹⁸ : Algebra R S
inst✝¹⁷ : Semiring A
inst✝¹⁶ : Algebra R A
inst✝¹⁵ : Algebra S A
inst✝¹⁴ : IsScalarTower R S A
inst✝¹³ : Semiring B
inst✝¹² : Algebra R B
inst✝¹¹ : Algebra S B
inst✝¹⁰ : IsScalarTower R S B
inst✝⁹ : Semiring C
inst✝⁸ : Algebra R C
inst✝⁷ : Algebra S C
inst✝⁶ : IsScalarTower R S C
inst✝⁵ : Semiring D
inst✝⁴ : Algebra R D
inst✝³ : Semiring E
inst✝² : Algebra R E
inst✝¹ : Semiring F
inst✝ : Algebra R F
f : A ≃ₐ[S] B
g : C ≃ₐ[R] D
a : A
c : C
⊢ (AlgHom.comp (map ↑(AlgEquiv.symm f) ↑(AlgEquiv.symm g)) (map ↑f ↑g)) (a ⊗ₜ[R] c) =
    (AlgHom.id S (A ⊗[R] C)) (a ⊗ₜ[R] c)

Next tactic:
simp
/-- `LinearMap.mul'` is an `AlgHom` on commutative rings. -/
def lmul' : S ⊗[R] S →ₐ[R] S :=
  algHomOfLinearMapTensorProduct (LinearMap.mul' R S)
    (fun a₁ a₂ b₁ 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
a₁ a₂ b₁ b₂ : S
⊢ (LinearMap.mul' R S) ((a₁ * a₂) ⊗ₜ[R] (b₁ * b₂)) =
    (LinearMap.mul' R S) (a₁ ⊗ₜ[R] b₁) * (LinearMap.mul' R S) (a₂ ⊗ₜ[R] b₂)

Next tactic:
simp only [LinearMap.mul'_apply, mul_mul_mul_comm]
/-- `LinearMap.mul'` is an `AlgHom` on commutative rings. -/
def lmul' : S ⊗[R] S →ₐ[R] S :=
  algHomOfLinearMapTensorProduct (LinearMap.mul' R S)
    (fun a₁ a₂ b₁ b₂ => by simp only [LinearMap.mul'_apply, mul_mul_mul_comm]) <| 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
⊢ (LinearMap.mul' R S) (1 ⊗ₜ[R] 1) = 1

Next tactic:
simp only [LinearMap.mul'_apply, _root_.mul_one]
theorem productMap_eq_comp_map : productMap f g = (lmul' R).comp (TensorProduct.map f g) := 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
⊢ productMap f g = AlgHom.comp (lmul' R) (map f g)

Next tactic:
ext
theorem productMap_eq_comp_map : productMap f g = (lmul' R).comp (TensorProduct.map f g) := by
  ext <;> 

Proof state:
case ha.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✝⁵ : Semiring A
inst✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
x✝ : A
⊢ (AlgHom.comp (productMap f g) includeLeft) x✝ = (AlgHom.comp (AlgHom.comp (lmul' R) (map f g)) includeLeft) x✝

Next tactic:
rfl
theorem productMap_eq_comp_map : productMap f g = (lmul' R).comp (TensorProduct.map f g) := by
  ext <;> 

Proof state:
case hb.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✝⁵ : Semiring A
inst✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
x✝ : B
⊢ (AlgHom.comp (AlgHom.restrictScalars R (productMap f g)) includeRight) x✝ =
    (AlgHom.comp (AlgHom.restrictScalars R (AlgHom.comp (lmul' R) (map f g))) includeRight) x✝

Next tactic:
rfl
theorem productMap_left_apply (a : A) : productMap f g (a ⊗ₜ 1) = f 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
a : A
⊢ (productMap f g) (a ⊗ₜ[R] 1) = f a

Next tactic:
simp
theorem productMap_right_apply (b : B) :
    productMap f g (1 ⊗ₜ b) = g 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
b : B
⊢ (productMap f g) (1 ⊗ₜ[R] b) = g b

Next tactic:
simp
theorem productMap_range : (productMap f g).range = f.range ⊔ g.range := 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✝⁴ : Semiring B
inst✝³ : CommSemiring S
inst✝² : Algebra R A
inst✝¹ : Algebra R B
inst✝ : Algebra R S
f : A →ₐ[R] S
g : B →ₐ[R] S
⊢ AlgHom.range (productMap f g) = AlgHom.range f ⊔ AlgHom.range g

Next tactic:
rw [productMap_eq_comp_map, AlgHom.range_comp, map_range, map_sup, ← AlgHom.range_comp,
    ← AlgHom.range_comp,
    ← AlgHom.comp_assoc, ← AlgHom.comp_assoc, lmul'_comp_includeLeft, lmul'_comp_includeRight,
    AlgHom.id_comp, AlgHom.id_comp]
theorem basisAux_tmul (a : A) (m : M) :
    basisAux A b (a ⊗ₜ m) = a • Finsupp.mapRange (algebraMap R A) (map_zero _) (b.repr m) := 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
m : M
⊢ (basisAux A b) (a ⊗ₜ[R] m) = a • Finsupp.mapRange ⇑(algebraMap R A) (_ : (algebraMap R A) 0 = 0) (b.repr m)

Next tactic:
ext
theorem basisAux_tmul (a : A) (m : M) :
    basisAux A b (a ⊗ₜ m) = a • Finsupp.mapRange (algebraMap R A) (map_zero _) (b.repr m) := by
  ext
  

Proof state:
case 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
m : M
a✝ : ι
⊢ ((basisAux A b) (a ⊗ₜ[R] m)) a✝ = (a • Finsupp.mapRange ⇑(algebraMap R A) (_ : (algebraMap R A) 0 = 0) (b.repr m)) a✝

Next tactic:
simp [basisAux, ← Algebra.commutes, Algebra.smul_def]
theorem basisAux_map_smul (a : A) (x : A ⊗[R] M) : basisAux A b (a • x) = a • basisAux A b x :=
  TensorProduct.induction_on 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
x : A ⊗[R] M
⊢ (basisAux A b) (a • 0) = a • (basisAux A b) 0

Next tactic:
simp
theorem basisAux_map_smul (a : A) (x : A ⊗[R] M) : basisAux A b (a • x) = a • basisAux A b x :=
  TensorProduct.induction_on x (by simp)
    (fun x y => 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
x✝ : A ⊗[R] M
x : A
y : M
⊢ (basisAux A b) (a • x ⊗ₜ[R] y) = a • (basisAux A b) (x ⊗ₜ[R] y)

Next tactic:
simp only [TensorProduct.smul_tmul', basisAux_tmul, smul_assoc]
theorem basisAux_map_smul (a : A) (x : A ⊗[R] M) : basisAux A b (a • x) = a • basisAux A b x :=
  TensorProduct.induction_on x (by simp)
    (fun x y => by simp only [TensorProduct.smul_tmul', basisAux_tmul, smul_assoc])
    fun x y hx hy => 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
x✝ x y : A ⊗[R] M
hx : (basisAux A b) (a • x) = a • (basisAux A b) x
hy : (basisAux A b) (a • y) = a • (basisAux A b) y
⊢ (basisAux A b) (a • (x + y)) = a • (basisAux A b) (x + y)

Next tactic:
simp [hx, hy]
theorem basis_repr_symm_apply (a : A) (i : ι) :
    (basis A b).repr.symm (Finsupp.single i a) = a ⊗ₜ b.repr.symm (Finsupp.single i 1) := 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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
i : ι
⊢ ((LinearEquiv.symm (basis A b).repr) fun₀ | i => a) = a ⊗ₜ[R] (LinearEquiv.symm b.repr) fun₀ | i => 1

Next tactic:
rw [basis, LinearEquiv.coe_symm_mk]
theorem basis_repr_symm_apply (a : A) (i : ι) :
    (basis A b).repr.symm (Finsupp.single i a) = a ⊗ₜ b.repr.symm (Finsupp.single i 1) := by
  rw [basis, LinearEquiv.coe_symm_mk] -- porting note: `coe_symm_mk` isn't firing in `simp`
  

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
M : Type uM
ι : Type uι
inst✝⁴ : CommRing R
inst✝³ : Ring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
b : Basis ι R M
a : A
i : ι
⊢ (LinearEquiv.invFun (basisAux A b) fun₀ | i => a) = a ⊗ₜ[R] (LinearEquiv.symm b.repr) fun₀ | i => 1

Next tactic:
simp [Equiv.uniqueProd_symm_apply, basisAux]