Skip to content

Commit 49aa5ee

Browse files
committed
feat(Algebra): generalize Picard group to Semiring (#30657)
1 parent a339811 commit 49aa5ee

File tree

2 files changed

+93
-31
lines changed

2 files changed

+93
-31
lines changed

Mathlib/CategoryTheory/Monoidal/Skeleton.lean

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Bhavik Mehta
55
-/
66
module
77

8+
public import Mathlib.Algebra.Group.Equiv.Defs
89
public import Mathlib.CategoryTheory.Monoidal.Braided.Basic
910
public import Mathlib.CategoryTheory.Monoidal.Transport
1011
public import Mathlib.CategoryTheory.Skeletal
@@ -35,14 +36,14 @@ variable {C : Type u} [Category.{v} C] [MonoidalCategory C]
3536
/-- If `C` is monoidal and skeletal, it is a monoid.
3637
See note [reducible non-instances]. -/
3738
abbrev monoidOfSkeletalMonoidal (hC : Skeletal C) : Monoid C where
38-
mul X Y := (X ⊗ Y : C)
39-
one := (𝟙_ C : C)
39+
mul X Y := X ⊗ Y
40+
one := 𝟙_ C
4041
one_mul X := hC ⟨λ_ X⟩
4142
mul_one X := hC ⟨ρ_ X⟩
4243
mul_assoc X Y Z := hC ⟨α_ X Y Z⟩
4344

4445
/-- If `C` is braided and skeletal, it is a commutative monoid. -/
45-
def commMonoidOfSkeletalBraided [BraidedCategory C] (hC : Skeletal C) : CommMonoid C :=
46+
abbrev commMonoidOfSkeletalBraided [BraidedCategory C] (hC : Skeletal C) : CommMonoid C :=
4647
{ monoidOfSkeletalMonoidal hC with mul_comm := fun X Y => hC ⟨β_ X Y⟩ }
4748

4849
namespace Skeleton
@@ -81,4 +82,51 @@ noncomputable instance instCommMonoid [BraidedCategory C] : CommMonoid (Skeleton
8182

8283
end Skeleton
8384

85+
open Functor
86+
87+
noncomputable instance : (skeletonEquivalence C).functor.Monoidal :=
88+
inferInstanceAs (Monoidal.equivalenceTransported (skeletonEquivalence C).symm).inverse.Monoidal
89+
90+
noncomputable instance : (skeletonEquivalence C).inverse.Monoidal :=
91+
inferInstanceAs (Monoidal.equivalenceTransported (skeletonEquivalence C).symm).functor.Monoidal
92+
93+
variable {D : Type*} [Category D] [MonoidalCategory D] (F : C ⥤ D) (e : C ≌ D)
94+
95+
noncomputable instance [F.LaxMonoidal] : F.mapSkeleton.LaxMonoidal := .comp ..
96+
noncomputable instance [F.OplaxMonoidal] : F.mapSkeleton.OplaxMonoidal := .comp ..
97+
noncomputable instance [F.Monoidal] : F.mapSkeleton.Monoidal := .instComp ..
98+
99+
/-- A monoidal functor between skeletal monoidal categories induces a monoid homomorphism. -/
100+
def Skeletal.monoidHom [F.Monoidal] (hC : Skeletal C) (hD : Skeletal D) :
101+
let _ := monoidOfSkeletalMonoidal hC
102+
let _ := monoidOfSkeletalMonoidal hD
103+
C →* D := by
104+
intros; exact
105+
{ toFun := F.obj
106+
map_one' := hD ⟨(Monoidal.εIso F).symm⟩
107+
map_mul' X Y := hD ⟨(Monoidal.μIso F X Y).symm⟩ }
108+
109+
/-- A monoidal functor between monoidal categories induces a monoid homomorphism between
110+
the skeleta. -/
111+
noncomputable def Skeleton.monoidHom [F.Monoidal] : Skeleton C →* Skeleton D :=
112+
(skeleton_skeletal C).monoidHom F.mapSkeleton (skeleton_skeletal D)
113+
114+
/-- A monoidal equivalence between skeletal monoidal categories induces a monoid isomorphism. -/
115+
def Skeletal.mulEquiv [e.functor.Monoidal] (hC : Skeletal C) (hD : Skeletal D) :
116+
let _ := monoidOfSkeletalMonoidal hC
117+
let _ := monoidOfSkeletalMonoidal hD
118+
C ≃* D := by
119+
intros; exact
120+
{ toFun := e.functor.obj
121+
invFun := e.inverse.obj
122+
left_inv X := hC ⟨(e.unitIso.app X).symm⟩
123+
right_inv X := hD ⟨e.counitIso.app X⟩
124+
map_mul' X Y := hD ⟨(Monoidal.μIso e.functor X Y).symm⟩ }
125+
126+
/-- A monoidal equivalence between monoidal categories induces a monoid isomorphism between
127+
the skeleta. -/
128+
noncomputable def Skeleton.mulEquiv [e.functor.Monoidal] : Skeleton C ≃* Skeleton D :=
129+
(skeleton_skeletal C).mulEquiv
130+
(((skeletonEquivalence C).trans e).trans (skeletonEquivalence D).symm) (skeleton_skeletal D)
131+
84132
end CategoryTheory

Mathlib/RingTheory/PicardGroup.lean

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -393,33 +393,39 @@ section PicardGroup
393393

394394
open CategoryTheory Module
395395

396-
variable (R : Type u) [CommRing R]
396+
variable (R : Type u) [CommSemiring R]
397397

398-
instance (M : (Skeleton <| ModuleCat.{u} R)ˣ) : Module.Invertible R M :=
398+
instance (M : (Skeleton <| SemimoduleCat.{u} R)ˣ) : Module.Invertible R M :=
399+
.right (Quotient.eq.mp M.inv_mul).some.toLinearEquivₛ
400+
401+
instance (R : Type u) [CommRing R] (M : (Skeleton <| ModuleCat.{u} R)ˣ) : Module.Invertible R M :=
399402
.right (Quotient.eq.mp M.inv_mul).some.toLinearEquiv
400403

401-
instance : Small.{u} (Skeleton <| ModuleCat.{u} R)ˣ :=
402-
let sf := Σ n, Submodule R (Fin n → R)
403-
have {M N : sf} : M = N(_ ⧸ M.2) ≃ₗ[R] _ ⧸ N.2 := by rintro rfl; exact .refl ..
404-
let f (M : (Skeleton <| ModuleCat.{u} R)ˣ) : sf := ⟨_, Finite.kerRepr R M⟩
404+
instance : Small.{u} (Skeleton <| SemimoduleCat.{u} R)ˣ :=
405+
let sf := Σ n, ModuleCon R (Fin n → R)
406+
have {c₁ c₂ : sf} : c₁ = c₂c₁.2.Quotient ≃ₗ[R] c₂.2.Quotient := by rintro rfl; exact .refl ..
407+
let f (M : (Skeleton <| SemimoduleCat.{u} R)ˣ) : sf := ⟨_, Finite.kerReprₛ R M⟩
405408
small_of_injective (f := f) fun M N eq ↦ Units.ext <| Quotient.out_equiv_out.mp
406-
⟨((Finite.reprEquiv R M).symm ≪≫ₗ this eq ≪≫ₗ Finite.reprEquiv R N).toModuleIso⟩
409+
⟨((Finite.reprEquivₛ R M).symm ≪≫ₗ this eq ≪≫ₗ Finite.reprEquivₛ R N).toModuleIsoₛ⟩
410+
411+
instance (R : Type u) [CommRing R] : Small.{u} (Skeleton <| ModuleCat.{u} R)ˣ :=
412+
small_map (Units.mapEquiv <| Skeleton.mulEquiv ModuleCat.equivalenceSemimoduleCat).toEquiv
407413

408-
/-- The Picard group of a commutative ring R consists of the invertible R-modules,
414+
/-- The Picard group of a commutative semiring R consists of the invertible R-modules,
409415
up to isomorphism. -/
410-
def CommRing.Pic (R : Type u) [CommRing R] : Type u :=
411-
Shrink (Skeleton <| ModuleCat.{u} R)ˣ
416+
def CommRing.Pic (R : Type u) [CommSemiring R] : Type u :=
417+
Shrink (Skeleton <| SemimoduleCat.{u} R)ˣ
412418

413419
open CommRing (Pic)
414420

415421
noncomputable instance : CommGroup (Pic R) := (equivShrink _).symm.commGroup
416422

417423
section CommRing
418424

419-
variable (M N : Type*) [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N]
425+
variable (M N : Type*) [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N]
420426
[Module.Invertible R M] [Module.Invertible R N]
421427

422-
instance : Module.Invertible R (Finite.repr R M) := .congr (Finite.reprEquiv R M).symm
428+
instance : Module.Invertible R (Finite.reprₛ R M) := .congr (Finite.reprEquivₛ R M).symm
423429

424430
namespace CommRing.Pic
425431

@@ -429,29 +435,32 @@ abbrev AsModule (M : Pic R) : Type u := ((equivShrink _).symm M).val
429435

430436
noncomputable instance : CoeSort (Pic R) (Type u) := ⟨AsModule⟩
431437

432-
private noncomputable def equivShrinkLinearEquiv (M : (Skeleton <| ModuleCat.{u} R)ˣ) :
438+
noncomputable instance (R) [CommRing R] (M : Pic R) : AddCommGroup M :=
439+
Module.addCommMonoidToAddCommGroup R
440+
441+
private noncomputable def equivShrinkLinearEquiv (M : (Skeleton <| SemimoduleCat.{u} R)ˣ) :
433442
(id <| equivShrink _ M : Pic R) ≃ₗ[R] M :=
434-
have {M N : Skeleton (ModuleCat.{u} R)} : M = N → M ≃ₗ[R] N := by rintro rfl; exact .refl ..
443+
have {M N : Skeleton (SemimoduleCat.{u} R)} : M = N → M ≃ₗ[R] N := by rintro rfl; exact .refl ..
435444
this (by simp)
436445

437446
/-- The class of an invertible module in the Picard group. -/
438447
protected noncomputable def mk : Pic R := equivShrink _ <|
439-
letI M' := Finite.repr R M
448+
letI M' := Finite.reprₛ R M
440449
.mkOfMulEqOne ⟦.of R M'⟧ ⟦.of R (Dual R M')⟧ <| by
441450
rw [← toSkeleton, ← toSkeleton, mul_comm, ← Skeleton.toSkeleton_tensorObj]
442-
exact Quotient.sound ⟨(Invertible.linearEquiv R _).toModuleIso
451+
exact Quotient.sound ⟨(Invertible.linearEquiv R _).toModuleIsoₛ
443452

444453
/-- `mk R M` is indeed the class of `M`. -/
445454
noncomputable def mk.linearEquiv : Pic.mk R M ≃ₗ[R] M :=
446455
equivShrinkLinearEquiv R _ ≪≫ₗ (Quotient.mk_out (s := isIsomorphicSetoid _)
447-
(ModuleCat.of R (Finite.repr R M))).some.toLinearEquiv ≪≫ₗ Finite.reprEquiv R M
456+
(SemimoduleCat.of R (Finite.reprₛ R M))).some.toLinearEquivₛ ≪≫ₗ Finite.reprEquivₛ R M
448457

449458
variable {R M N}
450459

451460
theorem mk_eq_iff {N : Pic R} : Pic.mk R M = N ↔ Nonempty (M ≃ₗ[R] N) where
452461
mp := (· ▸ ⟨(mk.linearEquiv R M).symm⟩)
453462
mpr := fun ⟨e⟩ ↦ ((equivShrink _).apply_eq_iff_eq_symm_apply).mpr <|
454-
Units.ext <| Quotient.mk_eq_iff_out.mpr ⟨(Finite.reprEquiv R M ≪≫ₗ e).toModuleIso
463+
Units.ext <| Quotient.mk_eq_iff_out.mpr ⟨(Finite.reprEquivₛ R M ≪≫ₗ e).toModuleIsoₛ
455464

456465
theorem mk_eq_self {M : Pic R} : Pic.mk R M = M := mk_eq_iff.mpr ⟨.refl ..⟩
457466

@@ -463,7 +472,7 @@ theorem mk_eq_mk_iff : Pic.mk R M = Pic.mk R N ↔ Nonempty (M ≃ₗ[R] N) :=
463472
mk_eq_iff.trans ⟨fun ⟨e⟩ ↦ ⟨e ≪≫ₗ eN⟩, fun ⟨e⟩ ↦ ⟨e ≪≫ₗ eN.symm⟩⟩
464473

465474
theorem mk_self : Pic.mk R R = 1 :=
466-
congr_arg (equivShrink _) <| Units.ext <| Quotient.sound ⟨(Finite.reprEquiv R R).toModuleIso
475+
congr_arg (equivShrink _) <| Units.ext <| Quotient.sound ⟨(Finite.reprEquivₛ R R).toModuleIsoₛ
467476

468477
theorem mk_eq_one_iff : Pic.mk R M = 1 ↔ Nonempty (M ≃ₗ[R] R) := by
469478
rw [← mk_self, mk_eq_mk_iff]
@@ -475,38 +484,43 @@ theorem mk_tensor : Pic.mk R (M ⊗[R] N) = Pic.mk R M * Pic.mk R N :=
475484
congr_arg (equivShrink _) <| Units.ext <| by
476485
simp_rw [Pic.mk, Equiv.symm_apply_apply]
477486
refine (Quotient.sound ?_).trans (Skeleton.toSkeleton_tensorObj ..)
478-
exact ⟨(Finite.reprEquiv R _ ≪≫ₗ TensorProduct.congr
479-
(Finite.reprEquiv R M).symm (Finite.reprEquiv R N).symm).toModuleIso
487+
exact ⟨(Finite.reprEquivₛ R _ ≪≫ₗ TensorProduct.congr
488+
(Finite.reprEquivₛ R M).symm (Finite.reprEquivₛ R N).symm).toModuleIsoₛ
480489

481490
theorem mk_dual : Pic.mk R (Dual R M) = (Pic.mk R M)⁻¹ :=
482491
congr_arg (equivShrink _) <| Units.ext <| by
483492
rw [Pic.mk, Equiv.symm_apply_apply]
484-
exact Quotient.sound ⟨(Finite.reprEquiv R _ ≪≫ₗ (Finite.reprEquiv R _).dualMap).toModuleIso
493+
exact Quotient.sound ⟨(Finite.reprEquivₛ R _ ≪≫ₗ (Finite.reprEquivₛ R _).dualMap).toModuleIsoₛ
485494

486495
theorem inv_eq_dual (M : Pic R) : M⁻¹ = Pic.mk R (Dual R M) := by
487496
rw [mk_dual, mk_eq_self]
488497

489498
theorem mul_eq_tensor (M N : Pic R) : M * N = Pic.mk R (M ⊗[R] N) := by
490499
rw [mk_tensor, mk_eq_self, mk_eq_self]
491500

492-
theorem subsingleton_iff : Subsingleton (Pic R) ↔
493-
∀ (M : Type u) [AddCommGroup M] [Module R M], Module.Invertible R M → Free R M :=
501+
theorem subsingleton_iffₛ : Subsingleton (Pic R) ↔
502+
∀ (M : Type u) [AddCommMonoid M] [Module R M], Module.Invertible R M → Free R M :=
494503
.trans ⟨fun _ M _ _ _ ↦ Subsingleton.elim ..,
495504
fun h ↦ ⟨fun M N ↦ by rw [← mk_eq_self (M := M), ← mk_eq_self (M := N), h, h]⟩⟩ <|
496505
forall₄_congr fun _ _ _ _ ↦ mk_eq_one_iff.trans Invertible.free_iff_linearEquiv.symm
497506

507+
theorem subsingleton_iff {R : Type u} [CommRing R] : Subsingleton (Pic R) ↔
508+
∀ (M : Type u) [AddCommGroup M] [Module R M], Module.Invertible R M → Free R M :=
509+
subsingleton_iffₛ.trans
510+
fun h M ↦ h M, fun h M ↦ let _ := @Module.addCommMonoidToAddCommGroup R; h M⟩
511+
498512
instance [Subsingleton (Pic R)] : Free R M :=
499-
have := subsingleton_iff.mp ‹_› (Finite.repr R M) inferInstance
500-
.of_equiv (Finite.reprEquiv R M)
513+
have := subsingleton_iffₛ.mp ‹_› (Finite.reprₛ R M) inferInstance
514+
.of_equiv (Finite.reprEquivₛ R M)
501515

502516
/- TODO: it's still true that an invertible module over a (commutative) local semiring is free;
503517
in fact invertible modules over a semiring are Zariski-locally free.
504518
See [BorgerJun2024], Theorem 11.7. -/
505-
instance [IsLocalRing R] : Subsingleton (Pic R) :=
519+
instance (R) [CommRing R] [IsLocalRing R] : Subsingleton (Pic R) :=
506520
subsingleton_iff.mpr fun _ _ _ _ ↦ free_of_flat_of_isLocalRing
507521

508522
/-- The Picard group of a semilocal ring is trivial. -/
509-
instance [Finite (MaximalSpectrum R)] : Subsingleton (Pic R) :=
523+
instance (R) [CommRing R] [Finite (MaximalSpectrum R)] : Subsingleton (Pic R) :=
510524
subsingleton_iff.mpr fun _ _ _ _ ↦ free_of_flat_of_finrank_eq _ _ 1
511525
fun _ ↦ let _ := @Ideal.Quotient.field; Invertible.finrank_eq_one ..
512526

0 commit comments

Comments
 (0)