@@ -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+
360363instance (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
510513end 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+
512543namespace Submodule
513544
514545open Module Invertible
0 commit comments