@@ -6,17 +6,15 @@ Authors: Jz Pan
66import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite
77import Mathlib.Algebra.Algebra.Subalgebra.Rank
88import Mathlib.Algebra.Polynomial.Basis
9- import Mathlib.LinearAlgebra.Basis.VectorSpace
10- import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition
119import Mathlib.LinearAlgebra.LinearDisjoint
1210import Mathlib.LinearAlgebra.TensorProduct.Subalgebra
1311import Mathlib.RingTheory.Adjoin.Dimension
1412import Mathlib.RingTheory.Algebraic.Basic
1513import Mathlib.RingTheory.IntegralClosure.Algebra.Defs
1614import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic
17- import Mathlib.RingTheory.Localization.FractionRing
18- import Mathlib.RingTheory.TensorProduct.Finite
15+ import Mathlib.RingTheory.Norm.Defs
1916import Mathlib.RingTheory.TensorProduct.Nontrivial
17+ import Mathlib.RingTheory.Trace.Defs
2018
2119/-!
2220
@@ -244,6 +242,72 @@ protected def mulMap :=
244242@[simp]
245243theorem val_mulMap_tmul (a : A) (b : B) : (H.mulMap (a ⊗ₜ[R] b) : S) = a.1 * b.1 := rfl
246244
245+ /--
246+ If `A` and `B` are linearly disjoint subalgebras in a commutative algebra `S` over `R`
247+ such that `A ⊔ B = S`, then this is the natural isomorphism
248+ `A ⊗[R] B ≃ₐ[A] S` induced by multiplication in `S`.
249+ -/
250+ noncomputable def mulMapLeftOfSupEqTop (H' : A ⊔ B = ⊤) :
251+ A ⊗[R] B ≃ₐ[A] S :=
252+ (AlgEquiv.ofInjective (Algebra.TensorProduct.productLeftAlgHom
253+ (Algebra.ofId A S) B.val) H.injective).trans ((Subalgebra.equivOfEq _ _ (by
254+ apply Subalgebra.restrictScalars_injective R
255+ rw [restrictScalars_top, ← H']
256+ exact mulMap_range A B)).trans Subalgebra.topEquiv)
257+
258+ @[simp]
259+ theorem mulMapLeftOfSupEqTop_tmul (H' : A ⊔ B = ⊤) (a : A) (b : B) :
260+ H.mulMapLeftOfSupEqTop H' (a ⊗ₜ[R] b) = (a : S) * (b : S) := rfl
261+
262+ /--
263+ If `A` and `B` are linearly disjoint subalgebras in a commutative algebra `S` over `R`
264+ such that `A ⊔ B = S`, then any `R`-basis of `B` is also an `A`-basis of `S`.
265+ -/
266+ noncomputable def basisOfBasisRight (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R B) :
267+ Basis ι A S :=
268+ (b.baseChange A).map (H.mulMapLeftOfSupEqTop H').toLinearEquiv
269+
270+ @[simp]
271+ theorem algebraMap_basisOfBasisRight_apply (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R B) (i : ι) :
272+ H.basisOfBasisRight H' b i = algebraMap B S (b i) := by
273+ simp [basisOfBasisRight, Subalgebra.algebraMap_def]
274+
275+ @[simp]
276+ theorem mulMapLeftOfSupEqTop_symm_apply (H' : A ⊔ B = ⊤) (x : B) :
277+ (H.mulMapLeftOfSupEqTop H').symm x = 1 ⊗ₜ[R] x :=
278+ (H.mulMapLeftOfSupEqTop H').symm_apply_eq.mpr (by simp)
279+
280+ theorem algebraMap_basisOfBasisRight_repr_apply (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R B)
281+ (x : B) (i : ι) :
282+ algebraMap A S ((H.basisOfBasisRight H' b).repr x i) = algebraMap R S (b.repr x i) := by
283+ simp [basisOfBasisRight, Algebra.algebraMap_eq_smul_one]
284+
285+ theorem leftMulMatrix_basisOfBasisRight_algebraMap (H' : A ⊔ B = ⊤) {ι : Type *} [Fintype ι]
286+ [DecidableEq ι] (b : Basis ι R B) (x : B) :
287+ Algebra.leftMulMatrix (H.basisOfBasisRight H' b) (algebraMap B S x) =
288+ RingHom.mapMatrix (algebraMap R A) (Algebra.leftMulMatrix b x) := by
289+ ext
290+ simp [Algebra.leftMulMatrix_eq_repr_mul, ← H.algebraMap_basisOfBasisRight_repr_apply H',
291+ Subalgebra.algebraMap_def]
292+
293+ /--
294+ If `A` and `B` are subalgebras in a commutative algebra `S` over `R`, and if they are
295+ linearly disjoint and such that `A ⊔ B = S`, then any `R`-basis of `A` is also a `B`-basis of `S`.
296+ -/
297+ noncomputable def basisOfBasisLeft (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R A) :
298+ Basis ι B S :=
299+ (b.baseChange B).map (H.symm.mulMapLeftOfSupEqTop (by rwa [sup_comm])).toLinearEquiv
300+
301+ @[simp]
302+ theorem basisOfBasisLeft_apply (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R A) (i : ι) :
303+ H.basisOfBasisLeft H' b i = algebraMap A S (b i) :=
304+ H.symm.algebraMap_basisOfBasisRight_apply (by rwa [sup_comm]) b i
305+
306+ theorem basisOfBasisLeft_repr_apply (H' : A ⊔ B = ⊤) {ι : Type *} (b : Basis ι R A)
307+ (x : A) (i : ι) :
308+ algebraMap B S ((H.basisOfBasisLeft H' b).repr x i) = algebraMap R S (b.repr x i) :=
309+ H.symm.algebraMap_basisOfBasisRight_repr_apply (by rwa [sup_comm]) b x i
310+
247311include H in
248312/-- If `A` and `B` are subalgebras in a commutative algebra `S` over `R`, and if they are
249313linearly disjoint, and if they are free `R`-modules, then `A ⊔ B` is also a free `R`-module. -/
@@ -463,24 +527,45 @@ namespace LinearDisjoint
463527
464528variable [CommRing R] [CommRing S] [Algebra R S]
465529
466- variable (A B : Subalgebra R S)
530+ variable {A B : Subalgebra R S}
531+
532+ /--
533+ If `A` and `B` are subalgebras in a commutative algebra `S` over `R`, and if they are
534+ linearly disjoint and such that `A ⊔ B = S`, then `trace` and `algebraMap` commutes.
535+ -/
536+ theorem trace_algebraMap (H : A.LinearDisjoint B) (H' : A ⊔ B = ⊤) [Module.Free R B]
537+ [Module.Finite R B] (x : B) :
538+ Algebra.trace A S (algebraMap B S x) = algebraMap R A (Algebra.trace R B x) := by
539+ simp_rw [Algebra.trace_eq_matrix_trace (Module.Free.chooseBasis R B),
540+ Algebra.trace_eq_matrix_trace (H.basisOfBasisRight H' (Module.Free.chooseBasis R B)),
541+ Matrix.trace, map_sum, leftMulMatrix_basisOfBasisRight_algebraMap, RingHom.mapMatrix_apply,
542+ Matrix.diag_apply, Matrix.map_apply]
543+
544+ /--
545+ If `A` and `B` are subalgebras in a commutative algebra `S` over `R`, and if they are
546+ linearly disjoint and such that `A ⊔ B = S`, then `norm` and `algebraMap` commutes.
547+ -/
548+ theorem norm_algebraMap (H : A.LinearDisjoint B) (H' : A ⊔ B = ⊤) [Module.Free R B]
549+ [Module.Finite R B] (x : B) :
550+ Algebra.norm A (algebraMap B S x) = algebraMap R A (Algebra.norm R x) := by
551+ simp_rw [Algebra.norm_eq_matrix_det (Module.Free.chooseBasis R B),
552+ Algebra.norm_eq_matrix_det (H.basisOfBasisRight H' (Module.Free.chooseBasis R B)),
553+ leftMulMatrix_basisOfBasisRight_algebraMap, RingHom.map_det]
467554
468- variable {A B} in
469555/-- In a commutative ring, if `A` and `B` are linearly disjoint, if `B` is a flat `R`-module,
470556then for any family of `R`-linearly independent elements of `A`,
471557they are also `B`-linearly independent. -/
472558theorem linearIndependent_left_of_flat (H : A.LinearDisjoint B) [Module.Flat R B]
473559 {ι : Type *} {a : ι → A} (ha : LinearIndependent R a) : LinearIndependent B (A.val ∘ a) :=
474560 H.linearIndependent_left_of_flat_of_commute ha fun _ _ ↦ mul_comm _ _
475561
562+ variable (A B) in
476563/-- In a commutative ring, if a basis of `A` is also `B`-linearly independent,
477564then `A` and `B` are linearly disjoint. -/
478565theorem of_basis_left {ι : Type *} (a : Basis ι R A)
479566 (H : LinearIndependent B (A.val ∘ a)) : A.LinearDisjoint B :=
480567 of_basis_left_of_commute A B a H fun _ _ ↦ mul_comm _ _
481568
482- variable {A B}
483-
484569variable (R) in
485570/-- If `A` and `B` are flat algebras over `R`, such that `A ⊗[R] B` is a domain, and such that
486571the algebra maps are injective, then there exists an `R`-algebra `K` that is a field that `A`
0 commit comments