Skip to content

Commit 9f0dc8c

Browse files
committed
feat(RingTheory): Module.Invertible.tmul_comm (#31308)
1 parent 2b20716 commit 9f0dc8c

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

Mathlib/RingTheory/Localization/BaseChange.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ theorem tensorProduct_compatibleSMul : CompatibleSMul R A M₁ M₂ where
9696
simp_rw [algebraMap_smul, smul_tmul', ← smul_assoc, smul_tmul, ← smul_assoc, smul_mk'_self,
9797
algebraMap_smul, smul_tmul]
9898

99+
instance [Module (Localization S) M₁] [Module (Localization S) M₂]
100+
[IsScalarTower R (Localization S) M₁] [IsScalarTower R (Localization S) M₂] :
101+
CompatibleSMul R (Localization S) M₁ M₂ :=
102+
tensorProduct_compatibleSMul S ..
103+
104+
instance (N N') [AddCommMonoid N] [Module R N] [AddCommMonoid N'] [Module R N'] (g : N →ₗ[R] N')
105+
[IsLocalizedModule S f] [IsLocalizedModule S g] :
106+
IsLocalizedModule S (TensorProduct.map f g) := by
107+
let eM := IsLocalizedModule.linearEquiv S f (TensorProduct.mk R (Localization S) M 1)
108+
let eN := IsLocalizedModule.linearEquiv S g (TensorProduct.mk R (Localization S) N 1)
109+
convert IsLocalizedModule.of_linearEquiv S (TensorProduct.mk R (Localization S) (M ⊗[R] N) 1) <|
110+
(AlgebraTensorModule.distribBaseChange R (Localization S) ..).restrictScalars R ≪≫ₗ
111+
(congr eM eN ≪≫ₗ TensorProduct.equivOfCompatibleSMul ..).symm
112+
ext; congrm(?_ ⊗ₜ ?_) <;> simp [LinearEquiv.eq_symm_apply, eM, eN]
113+
99114
/-- If `A` is a localization of `R`, tensoring two `A`-modules over `A` is the same as
100115
tensoring them over `R`. -/
101116
noncomputable def moduleTensorEquiv : M₁ ⊗[A] M₂ ≃ₗ[A] M₁ ⊗[R] M₂ :=

Mathlib/RingTheory/Localization/Basic.lean

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,27 @@ protected lemma finite [Finite R] : Finite S := by
122122
simpa using IsLocalization.exists_mk'_eq M x
123123
exact .of_surjective _ this
124124

125+
section CompatibleSMul
126+
127+
variable (N₁ N₂ : Type*) [AddCommMonoid N₁] [AddCommMonoid N₂] [Module R N₁] [Module R N₂]
128+
125129
variable (M S) in
126130
include M in
127-
theorem linearMap_compatibleSMul (N₁ N₂) [AddCommMonoid N₁] [AddCommMonoid N₂] [Module R N₁]
128-
[Module S N₁] [Module R N₂] [Module S N₂] [IsScalarTower R S N₁] [IsScalarTower R S N₂] :
131+
theorem linearMap_compatibleSMul [Module S N₁] [Module S N₂]
132+
[IsScalarTower R S N₁] [IsScalarTower R S N₂] :
129133
LinearMap.CompatibleSMul N₁ N₂ S R where
130134
map_smul f s s' := by
131135
obtain ⟨r, m, rfl⟩ := exists_mk'_eq M s
132136
rw [← (map_units S m).smul_left_cancel]
133137
simp_rw [algebraMap_smul, ← map_smul, ← smul_assoc, smul_mk'_self, algebraMap_smul, map_smul]
134138

139+
instance [Module (Localization M) N₁] [Module (Localization M) N₂]
140+
[IsScalarTower R (Localization M) N₁] [IsScalarTower R (Localization M) N₂] :
141+
LinearMap.CompatibleSMul N₁ N₂ (Localization M) R :=
142+
linearMap_compatibleSMul M ..
143+
144+
end CompatibleSMul
145+
135146
variable {g : R →+* P} (hg : ∀ y : M, IsUnit (g y))
136147

137148
variable (M) in

Mathlib/RingTheory/PicardGroup.lean

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ theorem of_isLocalization (S : Submonoid R) [IsLocalization S A]
357357
Module.Invertible A N :=
358358
.congr (IsLocalizedModule.isBaseChange S A f).equiv
359359

360+
instance (S : Submonoid R) : Module.Invertible (Localization S) (LocalizedModule S M) :=
361+
of_isLocalization S (LocalizedModule.mkLinearMap S M)
362+
360363
instance (L) [AddCommMonoid L] [Module R L] [Module A L] [IsScalarTower R A L]
361364
[Module.Invertible A L] : Module.Invertible A (L ⊗[R] M) :=
362365
.congr (AlgebraTensorModule.cancelBaseChange R A A L M)
@@ -509,6 +512,34 @@ end CommRing
509512

510513
end PicardGroup
511514

515+
namespace Module.Invertible
516+
517+
variable (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] [Module.Invertible R M]
518+
519+
-- TODO: generalize to CommSemiring by generalizing `CommRing.Pic.instSubsingletonOfIsLocalRing`
520+
theorem tensorProductComm_eq_refl : TensorProduct.comm R M M = .refl .. := by
521+
let f (P : Ideal R) [P.IsMaximal] := LocalizedModule.mkLinearMap P.primeCompl M
522+
let ff (P : Ideal R) [P.IsMaximal] := TensorProduct.map (f P) (f P)
523+
refine LinearEquiv.toLinearMap_injective <| LinearMap.eq_of_localization_maximal _ ff _ ff _ _
524+
fun P _ ↦ .trans (b := (TensorProduct.comm ..).toLinearMap) ?_ ?_
525+
· apply IsLocalizedModule.linearMap_ext P.primeCompl (ff P) (ff P)
526+
ext; dsimp
527+
apply IsLocalizedModule.map_apply
528+
let Rp := Localization P.primeCompl
529+
have ⟨e⟩ := free_iff_linearEquiv.mp (inferInstance : Free Rp (LocalizedModule P.primeCompl M))
530+
have e := e.restrictScalars R
531+
ext x y
532+
refine (congr e e ≪≫ₗ equivOfCompatibleSMul Rp ..).injective ?_
533+
suffices e y ⊗ₜ[Rp] e x = e x ⊗ₜ e y by simpa [equivOfCompatibleSMul]
534+
conv_lhs => rw [← mul_one (e y), ← smul_eq_mul, smul_tmul, smul_eq_mul,
535+
mul_comm, ← smul_eq_mul, ← smul_tmul, smul_eq_mul, mul_one]
536+
537+
variable {R M} in
538+
theorem tmul_comm {m₁ m₂ : M} : m₁ ⊗ₜ[R] m₂ = m₂ ⊗ₜ m₁ :=
539+
DFunLike.congr_fun (tensorProductComm_eq_refl ..) (m₂ ⊗ₜ m₁)
540+
541+
end Module.Invertible
542+
512543
namespace Submodule
513544

514545
open Module Invertible

0 commit comments

Comments
 (0)