Skip to content

Commit 4a2a8cb

Browse files
xroblotpechersky
authored andcommitted
feat(FieldTheory/LinearDisjoint): trace (resp. norm) and algebraMap commutes (leanprover-community#25832)
For `A` and `B` two linearly disjoint `R`-subalgebras in a commutative algebra `S` and `b` a `R`-basis of `B`, we construct a `A`-basis of `S = A ⊔ B` from `b` (and a similar construction using a `R`-basis of `A`). Then, we prove in this situation that `trace` commutes with `algebraMap`, that is: ```lean Algebra.trace A S (algebraMap B S x) = algebraMap R A (Algebra.trace R B x) ``` and a similar result for the norm. We also add a similar basis construction for `A` and `B` two linearly disjoint intermediate fields with the hypothesis that `A.toSubalgebra ⊔ B.toSubalgebra = ⊤`. This hypothesis is equivalent to `A ⊔ B = ⊤` in many cases (for example, one of the two extensions is algebraic over the base field) but not always.
1 parent eb30b51 commit 4a2a8cb

File tree

2 files changed

+159
-9
lines changed

2 files changed

+159
-9
lines changed

Mathlib/FieldTheory/LinearDisjoint.lean

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2024 Jz Pan. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jz Pan
55
-/
6-
import Mathlib.FieldTheory.IntermediateField.Adjoin.Basic
76
import Mathlib.RingTheory.AlgebraicIndependent.RankAndCardinality
87
import Mathlib.RingTheory.LinearDisjoint
98

@@ -256,6 +255,52 @@ theorem linearIndependent_right (H : A.LinearDisjoint B)
256255
{ι : Type*} {b : ι → B} (hb : LinearIndependent F b) : LinearIndependent A (B.val ∘ b) :=
257256
(linearDisjoint_iff'.1 H).linearIndependent_right_of_flat hb
258257

258+
/--
259+
If `A` and `B` are linearly disjoint and such that `A.toSubalgebra ⊔ B.toSubalgebra = ⊤`,
260+
then any `F`-basis of `B` is also an `A`-basis of `E`.
261+
Note that the condition `A.toSubalgebra ⊔ B.toSubalgebra = ⊤` is equivalent to
262+
`A ⊔ B = ⊤` in many cases, see `IntermediateField.sup_toSubalgebra_of_isAlgebraic_right` and similar
263+
results.
264+
-/
265+
noncomputable def basisOfBasisRight (H : A.LinearDisjoint B)
266+
(H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤) {ι : Type*} (b : Basis ι F B) :
267+
Basis ι A E :=
268+
(linearDisjoint_iff'.mp H).basisOfBasisRight H' b
269+
270+
@[simp]
271+
theorem basisOfBasisRight_apply (H : A.LinearDisjoint B) (H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤)
272+
{ι : Type*} (b : Basis ι F B) (i : ι) :
273+
H.basisOfBasisRight H' b i = algebraMap B E (b i) :=
274+
(linearDisjoint_iff'.mp H).algebraMap_basisOfBasisRight_apply H' b i
275+
276+
theorem algebraMap_basisOfBasisRight_repr_apply (H : A.LinearDisjoint B)
277+
(H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤) {ι : Type*} (b : Basis ι F B) (x : B) (i : ι) :
278+
algebraMap A E ((H.basisOfBasisRight H' b).repr x i) = algebraMap F E (b.repr x i) :=
279+
(linearDisjoint_iff'.mp H).algebraMap_basisOfBasisRight_repr_apply H' b x i
280+
281+
/--
282+
If `A` and `B` are linearly disjoint and such that `A.toSubalgebra ⊔ B.toSubalgebra = ⊤`,
283+
then any `F`-basis of `A` is also a `B`-basis of `E`.
284+
Note that the condition `A.toSubalgebra ⊔ B.toSubalgebra = ⊤` is equivalent to
285+
`A ⊔ B = ⊤` in many cases, see `IntermediateField.sup_toSubalgebra_of_isAlgebraic_right` and similar
286+
results.
287+
-/
288+
noncomputable def basisOfBasisLeft (H : A.LinearDisjoint B)
289+
(H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤) {ι : Type*} (b : Basis ι F A) :
290+
Basis ι B E :=
291+
(linearDisjoint_iff'.mp H).basisOfBasisLeft H' b
292+
293+
@[simp]
294+
theorem basisOfBasisLeft_apply (H : A.LinearDisjoint B) (H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤)
295+
{ι : Type*} (b : Basis ι F A) (i : ι) :
296+
H.basisOfBasisLeft H' b i = algebraMap A E (b i) :=
297+
(linearDisjoint_iff'.mp H).basisOfBasisLeft_apply H' b i
298+
299+
theorem basisOfBasisLeft_repr_apply (H : A.LinearDisjoint B)
300+
(H' : A.toSubalgebra ⊔ B.toSubalgebra = ⊤) {ι : Type*} (b : Basis ι F A) (x : A) (i : ι) :
301+
algebraMap B E ((H.basisOfBasisLeft H' b).repr x i) = algebraMap F E (b.repr x i) :=
302+
(linearDisjoint_iff'.mp H).basisOfBasisLeft_repr_apply H' b x i
303+
259304
/-- If there exists an `F`-basis of `B` which remains linearly independent over `A`, then
260305
`A` and `B` are linearly disjoint. -/
261306
theorem of_basis_right {ι : Type*} (b : Basis ι F B)
@@ -634,6 +679,26 @@ theorem algEquiv_of_isAlgebraic (H : A.LinearDisjoint L)
634679
.of_isField ((Algebra.TensorProduct.congr f1 f2).symm.toMulEquiv.isField
635680
(H.isField_of_isAlgebraic halg))
636681

682+
/--
683+
If `A` and `B` are linearly disjoint, then `trace` and `algebraMap` commutes.
684+
-/
685+
theorem trace_algebraMap [FiniteDimensional F E] (h₁ : A.LinearDisjoint B) (h₂ : A ⊔ B = ⊤)
686+
(x : B) :
687+
Algebra.trace A E (algebraMap B E x) = algebraMap F A (Algebra.trace F B x) := by
688+
rw [linearDisjoint_iff'] at h₁
689+
refine h₁.trace_algebraMap ?_ x
690+
simpa [sup_toSubalgebra_of_isAlgebraic_right] using congr_arg toSubalgebra h₂
691+
692+
/--
693+
If `A` and `B` are linearly disjoint, then `norm` and `algebraMap` commutes.
694+
-/
695+
theorem norm_algebraMap [FiniteDimensional F E] (h₁ : A.LinearDisjoint B) (h₂ : A ⊔ B = ⊤)
696+
(x : B) :
697+
Algebra.norm A (algebraMap B E x) = algebraMap F A (Algebra.norm F x) := by
698+
rw [linearDisjoint_iff'] at h₁
699+
refine h₁.norm_algebraMap ?_ x
700+
simpa [sup_toSubalgebra_of_isAlgebraic_right] using congr_arg toSubalgebra h₂
701+
637702
end LinearDisjoint
638703

639704
end IntermediateField

Mathlib/RingTheory/LinearDisjoint.lean

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ Authors: Jz Pan
66
import Mathlib.Algebra.Algebra.Subalgebra.MulOpposite
77
import Mathlib.Algebra.Algebra.Subalgebra.Rank
88
import Mathlib.Algebra.Polynomial.Basis
9-
import Mathlib.LinearAlgebra.Basis.VectorSpace
10-
import Mathlib.LinearAlgebra.Dimension.FreeAndStrongRankCondition
119
import Mathlib.LinearAlgebra.LinearDisjoint
1210
import Mathlib.LinearAlgebra.TensorProduct.Subalgebra
1311
import Mathlib.RingTheory.Adjoin.Dimension
1412
import Mathlib.RingTheory.Algebraic.Basic
1513
import Mathlib.RingTheory.IntegralClosure.Algebra.Defs
1614
import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic
17-
import Mathlib.RingTheory.Localization.FractionRing
18-
import Mathlib.RingTheory.TensorProduct.Finite
15+
import Mathlib.RingTheory.Norm.Defs
1916
import Mathlib.RingTheory.TensorProduct.Nontrivial
17+
import Mathlib.RingTheory.Trace.Defs
2018

2119
/-!
2220
@@ -244,6 +242,72 @@ protected def mulMap :=
244242
@[simp]
245243
theorem 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+
247311
include H in
248312
/-- If `A` and `B` are subalgebras in a commutative algebra `S` over `R`, and if they are
249313
linearly disjoint, and if they are free `R`-modules, then `A ⊔ B` is also a free `R`-module. -/
@@ -463,24 +527,45 @@ namespace LinearDisjoint
463527

464528
variable [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,
470556
then for any family of `R`-linearly independent elements of `A`,
471557
they are also `B`-linearly independent. -/
472558
theorem 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,
477564
then `A` and `B` are linearly disjoint. -/
478565
theorem 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-
484569
variable (R) in
485570
/-- If `A` and `B` are flat algebras over `R`, such that `A ⊗[R] B` is a domain, and such that
486571
the algebra maps are injective, then there exists an `R`-algebra `K` that is a field that `A`

0 commit comments

Comments
 (0)