Skip to content

Commit b1b0f15

Browse files
committed
feat(RingTheory): an algebra that is an invertible module is isomorphic to the base ring (leanprover-community#29954)
This PR considers the case where we have an `R`-algebra `A` which is also an invertible `R`-module, then constructs an isomorphism between `R` and `A` as `R`-algebras: ```lean variable (R A : Type*) [CommSemiring R] [Semiring A] [Algebra R A] [Module.Invertible R A] def algEquivOfRing : R ≃ₐ[R] A := ```
1 parent cfb4670 commit b1b0f15

2 files changed

Lines changed: 93 additions & 0 deletions

File tree

Mathlib/Algebra/Algebra/Equiv.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,25 @@ def ULift.algEquiv {R : Type u} {A : Type v} [CommSemiring R] [Semiring A] [Alge
817817
ULift.{w} A ≃ₐ[R] A where
818818
__ := ULift.ringEquiv
819819
commutes' _ := rfl
820+
821+
/-- If an `R`-algebra `A` is isomorphic to `R` as `R`-module, then the canonical map `R → A` is an
822+
equivalence of `R`-algebras.
823+
824+
Note that if `e : R ≃ₗ[R] A` is the linear equivalence, then this is not the same as the equivalence
825+
of algebras provided here unless `e 1 = 1`. -/
826+
@[simps] def LinearEquiv.algEquivOfRing
827+
{R A : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A]
828+
(e : R ≃ₗ[R] A) : R ≃ₐ[R] A where
829+
__ := Algebra.ofId R A
830+
invFun x := e.symm (e 1 * x)
831+
left_inv x := calc
832+
e.symm (e 1 * (algebraMap R A) x)
833+
= e.symm (x • e 1) := by rw [Algebra.smul_def, mul_comm]
834+
_ = x := by rw [map_smul, e.symm_apply_apply, smul_eq_mul, mul_one]
835+
right_inv x := calc
836+
(algebraMap R A) (e.symm (e 1 * x))
837+
= (algebraMap R A) (e.symm (e 1 * x)) * e (e.symm 11) := by
838+
rw [smul_eq_mul, mul_one, e.apply_symm_apply, mul_one]
839+
_ = x := by rw [map_smul, Algebra.smul_def, mul_left_comm, ← Algebra.smul_def _ (e 1),
840+
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, ← mul_assoc, ← Algebra.smul_def,
841+
← map_smul, smul_eq_mul, mul_one, e.apply_symm_apply, one_mul]

Mathlib/RingTheory/PicardGroup.lean

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,83 @@ theorem bijective_of_surjective [Module.Invertible R N] {f : M →ₗ[R] N}
281281
simpa [lTensor_bijective_iff] using bijective_self_of_surjective
282282
(f.lTensor _ ∘ₗ (linearEquiv R M).symm.toLinearMap) (by simpa [lTensor_surjective_iff] using hf)
283283

284+
section LinearEquiv
285+
variable {R M N} [Module.Invertible R N] {f : M →ₗ[R] N} {g : N →ₗ[R] M}
286+
287+
theorem rightInverse_of_leftInverse (hfg : Function.LeftInverse f g) :
288+
Function.RightInverse f g :=
289+
Function.rightInverse_of_injective_of_leftInverse
290+
(bijective_of_surjective hfg.surjective).injective hfg
291+
292+
theorem leftInverse_of_rightInverse (hfg : Function.RightInverse f g) :
293+
Function.LeftInverse f g :=
294+
rightInverse_of_leftInverse hfg
295+
296+
variable (f g) in
297+
theorem leftInverse_iff_rightInverse :
298+
Function.LeftInverse f g ↔ Function.RightInverse f g :=
299+
⟨rightInverse_of_leftInverse, leftInverse_of_rightInverse⟩
300+
301+
/-- If `f : M →ₗ[R] N` and `g : N →ₗ[R] M` where `M` and `N` are invertible `R`-modules, and `f` is
302+
a left inverse of `g`, then in fact `f` is also the right inverse of `g`, and we promote this to
303+
an `R`-module isomorphism. -/
304+
def linearEquivOfLeftInverse (hfg : Function.LeftInverse f g) : M ≃ₗ[R] N :=
305+
.ofLinear f g (LinearMap.ext hfg) (LinearMap.ext <| rightInverse_of_leftInverse hfg)
306+
307+
@[simp] lemma linearEquivOfLeftInverse_apply (hfg : Function.LeftInverse f g) (x : M) :
308+
linearEquivOfLeftInverse hfg x = f x := rfl
309+
310+
@[simp] lemma linearEquivOfLeftInverse_symm_apply (hfg : Function.LeftInverse f g) (x : N) :
311+
(linearEquivOfLeftInverse hfg).symm x = g x := rfl
312+
313+
/-- If `f : M →ₗ[R] N` and `g : N →ₗ[R] M` where `M` and `N` are invertible `R`-modules, and `f` is
314+
a right inverse of `g`, then in fact `f` is also the left inverse of `g`, and we promote this to
315+
an `R`-module isomorphism. -/
316+
def linearEquivOfRightInverse (hfg : Function.RightInverse f g) : M ≃ₗ[R] N :=
317+
.ofLinear f g (LinearMap.ext <| leftInverse_of_rightInverse hfg) (LinearMap.ext hfg)
318+
319+
@[simp] lemma linearEquivOfRightInverse_apply (hfg : Function.RightInverse f g) (x : M) :
320+
linearEquivOfRightInverse hfg x = f x := rfl
321+
322+
@[simp] lemma linearEquivOfRightInverse_symm_apply (hfg : Function.RightInverse f g) (x : N) :
323+
(linearEquivOfRightInverse hfg).symm x = g x := rfl
324+
325+
end LinearEquiv
326+
284327
section Algebra
285328

329+
section algEquivOfRing
330+
variable (A : Type*) [Semiring A] [Algebra R A] [Module.Invertible R A]
331+
332+
/-- If an `R`-algebra `A` is also an invertible `R`-module, then it is in fact isomorphic to the
333+
base ring `R`. The algebra structure gives us a map `A ⊗ A → A`, which after tensoring by `Aᵛ`
334+
becomes a map `A → R`, which is the inverse map we seek. -/
335+
noncomputable def algEquivOfRing : R ≃ₐ[R] A :=
336+
let inv : A →ₗ[R] R :=
337+
linearEquiv R A ∘ₗ
338+
(LinearMap.mul' R A).lTensor (Dual R A) ∘ₗ
339+
(leftCancelEquiv A (linearEquiv R A)).symm
340+
have right : inv ∘ₗ Algebra.linearMap R A = LinearMap.id :=
341+
let ⟨s, hs⟩ := exists_finset ((linearEquiv R A).symm 1)
342+
LinearMap.ext_ring <| by simp [inv, hs, sum_tmul, map_sum, ← (LinearEquiv.symm_apply_eq _).1 hs]
343+
{ linearEquivOfRightInverse (f := Algebra.linearMap R A) (g := inv) (LinearMap.ext_iff.1 right),
344+
Algebra.ofId R A with }
345+
346+
variable {A} in
347+
@[simp] lemma algEquivOfRing_apply (x : R) : algEquivOfRing R A x = algebraMap R A x := rfl
348+
349+
end algEquivOfRing
350+
286351
instance : Module.Invertible A (A ⊗[R] M) :=
287352
.right (M := A ⊗[R] Dual R M) <| (AlgebraTensorModule.distribBaseChange ..).symm ≪≫ₗ
288353
AlgebraTensorModule.congr (.refl A A) (linearEquiv R M) ≪≫ₗ AlgebraTensorModule.rid ..
289354

355+
variable {R M N A} in
356+
theorem of_isLocalization (S : Submonoid R) [IsLocalization S A]
357+
(f : M →ₗ[R] N) [IsLocalizedModule S f] [Module A N] [IsScalarTower R A N] :
358+
Module.Invertible A N :=
359+
.congr (IsLocalizedModule.isBaseChange S A f).equiv
360+
290361
instance (L) [AddCommMonoid L] [Module R L] [Module A L] [IsScalarTower R A L]
291362
[Module.Invertible A L] : Module.Invertible A (L ⊗[R] M) :=
292363
.congr (AlgebraTensorModule.cancelBaseChange R A A L M)

0 commit comments

Comments
 (0)