Skip to content

Commit 74d9913

Browse files
alreadydonemichaellee94
authored andcommitted
feat(RingTheory/PicardGroup): invertible modules over semirings are locally free (leanprover-community#41528)
Theorem 10.7 in *Facets of module theory over semirings* (Borger & Jun, https://arxiv.org/abs/2405.18645, Adv Math). Aristotle [discovered](https://aristotle.harmonic.fun/dashboard/requests/3e3dc70f-a9aa-4b84-a6fd-a812851c3bfb) a simpler proof using `Invertible.bijective_of_surjective` available in Mathlib. (The task started at 01:37 AM and Aristotle found the proof at 01:46 AM.) Also generalizes lemmas and adds a new def about local semirings. Co-authored-by: Aristotle (Harmonic) [aristotle-harmonic@harmonic.fun](mailto:aristotle-harmonic@harmonic.fun)
1 parent b4ccc31 commit 74d9913

3 files changed

Lines changed: 62 additions & 25 deletions

File tree

Mathlib/RingTheory/LocalRing/Basic.lean

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ theorem of_nonunits_add [Nontrivial R]
3636
isUnit_or_isUnit_of_add_one {a b} hab :=
3737
or_iff_not_and_not.2 fun H => h a b H.1 H.2 <| hab.symm ▸ isUnit_one
3838

39+
variable [IsLocalRing R]
40+
41+
theorem isUnit_or_isUnit_of_isUnit_add {a b : R} (h : IsUnit (a + b)) : IsUnit a ∨ IsUnit b := by
42+
rcases h with ⟨u, hu⟩
43+
rw [← Units.inv_mul_eq_one, mul_add] at hu
44+
apply Or.imp _ _ (isUnit_or_isUnit_of_add_one hu) <;> exact (u⁻¹.isUnit_units_mul _).mp
45+
46+
theorem nonunits_add {a b : R} (ha : a ∈ nonunits R) (hb : b ∈ nonunits R) : a + b ∈ nonunits R :=
47+
fun H ↦ not_or_intro ha hb (isUnit_or_isUnit_of_isUnit_add H)
48+
49+
variable (R) in
50+
/-- The nonunits of a local semiring form an additive submonoid. -/
51+
@[expose] def nonunitsAddSubmonoid : AddSubmonoid R where
52+
carrier := nonunits R
53+
zero_mem' := by simp
54+
add_mem' := nonunits_add
55+
56+
theorem exists_of_isUnit_sum {ι : Type*} {s : Finset ι} {f : ι → R}
57+
(h : IsUnit (∑ i ∈ s, f i)) : ∃ i ∈ s, IsUnit (f i) := by
58+
contrapose! h; exact (nonunitsAddSubmonoid R).sum_mem h
59+
3960
end Semiring
4061

4162
section CommSemiring
@@ -66,16 +87,6 @@ theorem of_unique_nonzero_prime (h : ∃! P : Ideal R, P ≠ ⊥ ∧ Ideal.IsPri
6687
· rintro rfl
6788
exact hPnot_top (hM.1.2 P (bot_lt_iff_ne_bot.2 hPnonzero)))
6889

69-
variable [IsLocalRing R]
70-
71-
theorem isUnit_or_isUnit_of_isUnit_add {a b : R} (h : IsUnit (a + b)) : IsUnit a ∨ IsUnit b := by
72-
rcases h with ⟨u, hu⟩
73-
rw [← Units.inv_mul_eq_one, mul_add] at hu
74-
apply Or.imp _ _ (isUnit_or_isUnit_of_add_one hu) <;> exact isUnit_of_mul_isUnit_right
75-
76-
theorem nonunits_add {a b : R} (ha : a ∈ nonunits R) (hb : b ∈ nonunits R) : a + b ∈ nonunits R :=
77-
fun H => not_or_intro ha hb (isUnit_or_isUnit_of_isUnit_add H)
78-
7990
end CommSemiring
8091

8192
section Ring

Mathlib/RingTheory/LocalRing/MaximalIdeal/Defs.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ variable (R : Type*) [CommSemiring R] [IsLocalRing R]
2828

2929
/-- The ideal of elements that are not units. -/
3030
def maximalIdeal : Ideal R where
31-
carrier := nonunits R
32-
zero_mem' := zero_mem_nonunits.2 <| zero_ne_one
33-
add_mem' {_ _} hx hy := nonunits_add hx hy
31+
__ := nonunitsAddSubmonoid R
3432
smul_mem' _ _ := mul_mem_nonunits_right
3533

3634
end IsLocalRing

Mathlib/RingTheory/PicardGroup.lean

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,35 @@ instance (L) [AddCommMonoid L] [Module R L] [Module A L] [IsScalarTower R A L]
367367
[Module.Invertible A L] : Module.Invertible A (L ⊗[R] M) :=
368368
.congr (AlgebraTensorModule.cancelBaseChange R A A L M)
369369

370+
/-- An invertible module over a commutative semiring is Zariski-locally free of rank 1.
371+
Theorem 10.7 in [BorgerJun2024].
372+
373+
More precisely, there is a finite set of elements of `R` that generate the unit ideal,
374+
and localizing `M` at any one of them yields a free module.
375+
376+
Finite projective modules over a local commutative semiring may not be free,
377+
see Remark 7.10, Example 9.6 and 9.8. -/
378+
theorem exists_finset_free_localization :
379+
∃ s : Finset R, Ideal.span (s : Set R) = ⊤ ∧
380+
∀ r ∈ s, Free (Localization.Away r) (LocalizedModule.Away r M) := by
381+
classical
382+
-- write 1 = ∑ᵢ fᵢ(mᵢ) with `mᵢ : M` and `fᵢ : Dual R M`
383+
obtain ⟨S, hS⟩ := ((linearEquiv R M).symm 1).exists_finset
384+
refine ⟨S.image fun i ↦ i.1 i.2, ?_, fun r hr ↦ ?_⟩
385+
-- Part 1: The evaluations fᵢ(mᵢ) generate the unit ideal
386+
· simpa [Ideal.eq_top_iff_one, (LinearEquiv.symm_apply_eq _).mp hS, linearEquiv]
387+
using Ideal.sum_mem _ fun i hi ↦ Ideal.subset_span (Finset.mem_image_of_mem _ hi)
388+
-- Part 2: After localizing at any f(m), the module becomes free
389+
obtain ⟨⟨f, m⟩, _, rfl⟩ := Finset.mem_image.mp hr
390+
-- Extend f to a R_{f(m)}-linear functional f' on the localized module
391+
let f' : Dual (Localization.Away (f m)) (LocalizedModule.Away (f m) M) :=
392+
.extendScalarsOfIsLocalization (.powers (f m)) _ <| IsLocalizedModule.map
393+
(.powers (f m)) (LocalizedModule.mkLinearMap _ M) (Algebra.linearMap R _) f
394+
-- f'(m/1) = f(m)/1 is a unit in R_{f(m)}, so f' is surjective and therefore bijective
395+
have surj : Function.Surjective f' := LinearMap.range_eq_top.mp <| Ideal.eq_top_of_isUnit_mem
396+
_ ⟨_, IsLocalizedModule.map_apply ..⟩ (IsLocalization.Away.algebraMap_isUnit (f m))
397+
exact .of_equiv <| .symm <| .ofBijective f' (bijective_of_surjective surj)
398+
370399
end CommSemiring
371400

372401
end Algebra
@@ -404,8 +433,7 @@ open CommRing (Pic)
404433

405434
noncomputable instance : CommGroup (Pic R) := fast_instance% (equivShrink _).symm.commGroup
406435

407-
variable (M N : Type*) [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N]
408-
[Module.Invertible R M] [Module.Invertible R N]
436+
variable [Module.Invertible R M] [Module.Invertible R N]
409437

410438
instance : Module.Invertible R (Finite.reprₛ R M) := .congr (Finite.reprEquivₛ R M).symm
411439

@@ -503,11 +531,14 @@ instance [Subsingleton (Pic R)] : Free R M :=
503531
have := subsingleton_iffₛ.mp ‹_› (Finite.reprₛ R M) inferInstance
504532
.of_equiv (Finite.reprEquivₛ R M)
505533

506-
/- TODO: it's still true that the Picard group of a (commutative) local semiring is trivial;
507-
in fact invertible modules over a semiring are Zariski-locally free (but projective module may
508-
not be). See Remark 7.10, Example 9.6 and 9.8, and Theorem 11.7 in [BorgerJun2024]. -/
509-
instance (R) [CommRing R] [IsLocalRing R] : Subsingleton (Pic R) :=
510-
subsingleton_iff.mpr fun _ _ _ _ ↦ free_of_flat_of_isLocalRing
534+
/-- The Picard group of a local semiring is trivial. -/
535+
instance [IsLocalRing R] : Subsingleton (Pic R) := subsingleton_iffₛ.mpr fun M _ _ _ ↦ by
536+
obtain ⟨S, hS⟩ := ((Invertible.linearEquiv R M).symm 1).exists_finset
537+
replace hS : 1 = ∑ i ∈ S, i.1 i.2 := by
538+
simpa [LinearEquiv.symm_apply_eq, Invertible.linearEquiv] using hS
539+
obtain ⟨⟨f, m⟩, mem, hfm⟩ := IsLocalRing.exists_of_isUnit_sum (hS ▸ isUnit_one)
540+
exact .of_equiv <| .symm <| .ofBijective f (Invertible.bijective_of_surjective <|
541+
LinearMap.range_eq_top.mp <| Ideal.eq_top_of_isUnit_mem _ ⟨m, rfl⟩ hfm)
511542

512543
/-- The Picard group of a semilocal ring is trivial. -/
513544
instance (R) [CommRing R] [Finite (MaximalSpectrum R)] : Subsingleton (Pic R) :=
@@ -592,18 +623,15 @@ end PicardGroup
592623

593624
namespace Module.Invertible
594625

595-
variable (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M] [Module.Invertible R M]
626+
variable [Module.Invertible R M]
596627

597-
set_option backward.defeqAttrib.useBackward true in
598-
-- TODO: generalize to CommSemiring by generalizing `CommRing.Pic.instSubsingletonOfIsLocalRing`
599628
theorem tensorProductComm_eq_refl : TensorProduct.comm R M M = .refl .. := by
600629
let f (P : Ideal R) [P.IsMaximal] := LocalizedModule.mkLinearMap P.primeCompl M
601630
let ff (P : Ideal R) [P.IsMaximal] := TensorProduct.map (f P) (f P)
602631
refine LinearEquiv.toLinearMap_injective <| LinearMap.eq_of_localization_maximal _ ff _ ff _ _
603632
fun P _ ↦ .trans (b := (TensorProduct.comm ..).toLinearMap) ?_ ?_
604633
· apply IsLocalizedModule.linearMap_ext P.primeCompl (ff P) (ff P)
605-
ext; dsimp
606-
apply IsLocalizedModule.map_apply
634+
ext; exact IsLocalizedModule.map_apply _ (ff P) ..
607635
let Rp := Localization P.primeCompl
608636
have ⟨e⟩ := free_iff_linearEquiv.mp (inferInstance : Free Rp (LocalizedModule P.primeCompl M))
609637
have e := e.restrictScalars R

0 commit comments

Comments
 (0)