@@ -393,33 +393,39 @@ section PicardGroup
393393
394394open 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,
409415up 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
413419open CommRing (Pic)
414420
415421noncomputable instance : CommGroup (Pic R) := (equivShrink _).symm.commGroup
416422
417423section 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
424430namespace CommRing.Pic
425431
@@ -429,29 +435,32 @@ abbrev AsModule (M : Pic R) : Type u := ((equivShrink _).symm M).val
429435
430436noncomputable 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. -/
438447protected 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`. -/
445454noncomputable 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
449458variable {R M N}
450459
451460theorem 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
456465theorem 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
465474theorem 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
468477theorem 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
481490theorem 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
486495theorem inv_eq_dual (M : Pic R) : M⁻¹ = Pic.mk R (Dual R M) := by
487496 rw [mk_dual, mk_eq_self]
488497
489498theorem 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+
498512instance [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