Skip to content

Commit bec437b

Browse files
jjaassoonnzjjjcommelin
committed
feat(RingTheory/GradedAlgebra): define homogeneous submodule (#18728)
and redefine homogeneous ideal as a homogeneous submodule rename `SetLike.Homogeneous` to `SetLike.IsHomogeneousElem` introduced `DirectSum.SetLike.Homogeneous` to mean a set $S$ is homogeneous iff for all $s \in S$, all of its projection $s_i \in S$ as well. Co-authored-by: zjj <zjj@zjj> Co-authored-by: Johan Commelin <johan@commelin.net>
1 parent 049e824 commit bec437b

File tree

10 files changed

+198
-53
lines changed

10 files changed

+198
-53
lines changed

Counterexamples/HomogeneousPrimeNotPrime.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Johan Commelin, Eric Wieser, Jujian Zhang
66
import Mathlib.Algebra.Divisibility.Finite
77
import Mathlib.Algebra.Divisibility.Prod
88
import Mathlib.Data.Fintype.Units
9-
import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal
9+
import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal
1010

1111
/-!
1212
# A homogeneous ideal that is homogeneously prime but not prime
@@ -138,8 +138,9 @@ theorem I_isHomogeneous : Ideal.IsHomogeneous (grading R) I := by
138138
rw [Set.image_singleton]
139139
rfl
140140

141+
141142
theorem homogeneous_mem_or_mem : ∀ {x y : R × R},
142-
SetLike.Homogeneous (grading R) x → SetLike.Homogeneous (grading R) y →
143+
SetLike.IsHomogeneousElem (grading R) x → SetLike.IsHomogeneousElem (grading R) y →
143144
x * y ∈ I → x ∈ I ∨ y ∈ I := by
144145
have h2 : Prime (2:R) := by
145146
unfold Prime

Mathlib.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4606,7 +4606,8 @@ import Mathlib.RingTheory.FreeCommRing
46064606
import Mathlib.RingTheory.FreeRing
46074607
import Mathlib.RingTheory.Generators
46084608
import Mathlib.RingTheory.GradedAlgebra.Basic
4609-
import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal
4609+
import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal
4610+
import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule
46104611
import Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
46114612
import Mathlib.RingTheory.GradedAlgebra.Noetherian
46124613
import Mathlib.RingTheory.GradedAlgebra.Radical

Mathlib/Algebra/DirectSum/Decomposition.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def decompose : M ≃ ⨁ i, ℳ i where
9191
left_inv := Decomposition.left_inv
9292
right_inv := Decomposition.right_inv
9393

94+
omit [AddSubmonoidClass σ M] in
95+
/-- A substructure `p ⊆ M` is homogeneous if for every `m ∈ p`, all homogeneous components
96+
of `m` are in `p`. -/
97+
def SetLike.IsHomogeneous {P : Type*} [SetLike P M] (p : P) : Prop :=
98+
∀ (i : ι) ⦃m : M⦄, m ∈ p → (DirectSum.decompose ℳ m i : M) ∈ p
99+
94100
protected theorem Decomposition.inductionOn {p : M → Prop} (h_zero : p 0)
95101
(h_homogeneous : ∀ {i} (m : ℳ i), p (m : M)) (h_add : ∀ m m' : M, p m → p m' → p (m + m')) :
96102
∀ m, p m := by
@@ -174,6 +180,15 @@ theorem sum_support_decompose [∀ (i) (x : ℳ i), Decidable (x ≠ 0)] (r : M)
174180
rw [decompose_symm_sum]
175181
simp_rw [decompose_symm_of]
176182

183+
theorem AddSubmonoidClass.IsHomogeneous.mem_iff
184+
{P : Type*} [SetLike P M] [AddSubmonoidClass P M] (p : P)
185+
(hp : SetLike.IsHomogeneous ℳ p) {x} :
186+
x ∈ p ↔ ∀ i, (decompose ℳ x i : M) ∈ p := by
187+
classical
188+
refine ⟨fun hx i ↦ hp i hx, fun hx ↦ ?_⟩
189+
rw [← DirectSum.sum_support_decompose ℳ x]
190+
exact sum_mem (fun i _ ↦ hx i)
191+
177192
end AddCommMonoid
178193

179194
/-- The `-` in the statements below doesn't resolve without this line.

Mathlib/Algebra/DirectSum/Internal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ end SetLike.GradeZero
397397
section HomogeneousElement
398398

399399
theorem SetLike.homogeneous_zero_submodule [Zero ι] [Semiring S] [AddCommMonoid R] [Module S R]
400-
(A : ι → Submodule S R) : SetLike.Homogeneous A (0 : R) :=
400+
(A : ι → Submodule S R) : SetLike.IsHomogeneousElem A (0 : R) :=
401401
0, Submodule.zero_mem _⟩
402402

403403
theorem SetLike.Homogeneous.smul [CommSemiring S] [Semiring R] [Algebra S R] {A : ι → Submodule S R}
404-
{s : S} {r : R} (hr : SetLike.Homogeneous A r) : SetLike.Homogeneous A (s • r) :=
404+
{s : S} {r : R} (hr : SetLike.IsHomogeneousElem A r) : SetLike.IsHomogeneousElem A (s • r) :=
405405
let ⟨i, hi⟩ := hr
406406
⟨i, Submodule.smul_mem _ _ hi⟩
407407

Mathlib/Algebra/GradedMonoid.lean

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ in `Algebra.DirectSum.Internal`.
8080
8181
This file also defines:
8282
83-
* `SetLike.isHomogeneous A` (which says that `a` is homogeneous iff `a ∈ A i` for some `i : ι`)
83+
* `SetLike.IsHomogeneousElem A` (which says that `a` is homogeneous iff `a ∈ A i` for some `i : ι`)
8484
* `SetLike.homogeneousSubmonoid A`, which is, as the name suggests, the submonoid consisting of
8585
all the homogeneous elements.
8686
@@ -649,27 +649,36 @@ section HomogeneousElements
649649
variable {R S : Type*} [SetLike S R]
650650

651651
/-- An element `a : R` is said to be homogeneous if there is some `i : ι` such that `a ∈ A i`. -/
652-
def SetLike.Homogeneous (A : ι → S) (a : R) : Prop :=
652+
def SetLike.IsHomogeneousElem (A : ι → S) (a : R) : Prop :=
653653
∃ i, a ∈ A i
654654

655655
@[simp]
656-
theorem SetLike.homogeneous_coe {A : ι → S} {i} (x : A i) : SetLike.Homogeneous A (x : R) :=
656+
theorem SetLike.isHomogeneousElem_coe {A : ι → S} {i} (x : A i) :
657+
SetLike.IsHomogeneousElem A (x : R) :=
657658
⟨i, x.prop⟩
658659

659-
theorem SetLike.homogeneous_one [Zero ι] [One R] (A : ι → S) [SetLike.GradedOne A] :
660-
SetLike.Homogeneous A (1 : R) :=
660+
@[deprecated (since := "2025-01-31")] alias SetLike.homogeneous_coe :=
661+
SetLike.isHomogeneousElem_coe
662+
663+
theorem SetLike.isHomogeneousElem_one [Zero ι] [One R] (A : ι → S) [SetLike.GradedOne A] :
664+
SetLike.IsHomogeneousElem A (1 : R) :=
661665
0, SetLike.one_mem_graded _⟩
662666

663-
theorem SetLike.homogeneous_mul [Add ι] [Mul R] {A : ι → S} [SetLike.GradedMul A] {a b : R} :
664-
SetLike.Homogeneous A a → SetLike.Homogeneous A b → SetLike.Homogeneous A (a * b)
667+
@[deprecated (since := "2025-01-31")] alias SetLike.homogeneous_one := SetLike.isHomogeneousElem_one
668+
669+
theorem SetLike.IsHomogeneousElem.mul [Add ι] [Mul R] {A : ι → S} [SetLike.GradedMul A] {a b : R} :
670+
SetLike.IsHomogeneousElem A a → SetLike.IsHomogeneousElem A b →
671+
SetLike.IsHomogeneousElem A (a * b)
665672
| ⟨i, hi⟩, ⟨j, hj⟩ => ⟨i + j, SetLike.mul_mem_graded hi hj⟩
666673

674+
@[deprecated (since := "2025-01-31")] alias SetLike.homogeneous_mul := SetLike.IsHomogeneousElem.mul
675+
667676
/-- When `A` is a `SetLike.GradedMonoid A`, then the homogeneous elements forms a submonoid. -/
668677
def SetLike.homogeneousSubmonoid [AddMonoid ι] [Monoid R] (A : ι → S) [SetLike.GradedMonoid A] :
669678
Submonoid R where
670-
carrier := { a | SetLike.Homogeneous A a }
671-
one_mem' := SetLike.homogeneous_one A
672-
mul_mem' a b := SetLike.homogeneous_mul a b
679+
carrier := { a | SetLike.IsHomogeneousElem A a }
680+
one_mem' := SetLike.isHomogeneousElem_one A
681+
mul_mem' a b := SetLike.IsHomogeneousElem.mul a b
673682

674683
end HomogeneousElements
675684

Mathlib/Algebra/GradedMulAction.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@ section HomogeneousElements
129129

130130
variable {S R N M : Type*} [SetLike S R] [SetLike N M]
131131

132-
theorem SetLike.Homogeneous.graded_smul [VAdd ιA ιB] [SMul R M] {A : ιA → S} {B : ιB → N}
132+
theorem SetLike.IsHomogeneousElem.graded_smul [VAdd ιA ιB] [SMul R M] {A : ιA → S} {B : ιB → N}
133133
[SetLike.GradedSMul A B] {a : R} {b : M} :
134-
SetLike.Homogeneous A a → SetLike.Homogeneous B b → SetLike.Homogeneous B (a • b)
134+
SetLike.IsHomogeneousElem A a → SetLike.IsHomogeneousElem B b →
135+
SetLike.IsHomogeneousElem B (a • b)
135136
| ⟨i, hi⟩, ⟨j, hj⟩ => ⟨i +ᵥ j, SetLike.GradedSMul.smul_mem hi hj⟩
136137

138+
@[deprecated (since := "2025-01-31")] alias SetLike.Homogeneous.graded_smul :=
139+
SetLike.IsHomogeneousElem.graded_smul
140+
137141
end HomogeneousElements

Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Topology.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Jujian Zhang. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jujian Zhang, Johan Commelin
55
-/
6-
import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal
6+
import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal
77
import Mathlib.Topology.Category.TopCat.Basic
88
import Mathlib.Topology.Sets.Opens
99
import Mathlib.Data.Set.Subsingleton
@@ -56,6 +56,8 @@ attribute [instance] ProjectiveSpectrum.isPrime
5656

5757
namespace ProjectiveSpectrum
5858

59+
instance (x : ProjectiveSpectrum 𝒜) : Ideal.IsPrime x.asHomogeneousIdeal.toIdeal := x.isPrime
60+
5961
/-- The zero locus of a set `s` of elements of a commutative ring `A` is the set of all relevant
6062
homogeneous prime ideals of the ring that contain the set `s`.
6163

Mathlib/RingTheory/GradedAlgebra/HomogeneousIdeal.lean renamed to Mathlib/RingTheory/GradedAlgebra/Homogeneous/Ideal.lean

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Mathlib.RingTheory.GradedAlgebra.Basic
88
import Mathlib.RingTheory.Ideal.Basic
99
import Mathlib.RingTheory.Ideal.BigOperators
1010
import Mathlib.RingTheory.Ideal.Maps
11+
import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Submodule
1112

1213
/-!
1314
# Homogeneous ideals of a graded algebra
@@ -56,49 +57,39 @@ variable (I : Ideal A)
5657

5758
/-- An `I : Ideal A` is homogeneous if for every `r ∈ I`, all homogeneous components
5859
of `r` are in `I`. -/
59-
def Ideal.IsHomogeneous : Prop :=
60-
∀ (i : ι) ⦃r : A⦄, r ∈ I → (DirectSum.decompose 𝒜 r i : A) ∈ I
60+
abbrev Ideal.IsHomogeneous : Prop := Submodule.IsHomogeneous I 𝒜
6161

6262
theorem Ideal.IsHomogeneous.mem_iff {I} (hI : Ideal.IsHomogeneous 𝒜 I) {x} :
63-
x ∈ I ↔ ∀ i, (decompose 𝒜 x i : A) ∈ I := by
64-
classical
65-
refine ⟨fun hx i ↦ hI i hx, fun hx ↦ ?_⟩
66-
rw [← DirectSum.sum_support_decompose 𝒜 x]
67-
exact Ideal.sum_mem _ (fun i _ ↦ hx i)
63+
x ∈ I ↔ ∀ i, (decompose 𝒜 x i : A) ∈ I :=
64+
AddSubmonoidClass.IsHomogeneous.mem_iff 𝒜 _ hI
6865

6966
/-- For any `Semiring A`, we collect the homogeneous ideals of `A` into a type. -/
70-
structure HomogeneousIdeal extends Submodule A A where
71-
is_homogeneous' : Ideal.IsHomogeneous 𝒜 toSubmodule
67+
abbrev HomogeneousIdeal := HomogeneousSubmodule 𝒜 𝒜
7268

7369
variable {𝒜}
7470

7571
/-- Converting a homogeneous ideal to an ideal. -/
76-
def HomogeneousIdeal.toIdeal (I : HomogeneousIdeal 𝒜) : Ideal A :=
72+
abbrev HomogeneousIdeal.toIdeal (I : HomogeneousIdeal 𝒜) : Ideal A :=
7773
I.toSubmodule
7874

79-
theorem HomogeneousIdeal.isHomogeneous (I : HomogeneousIdeal 𝒜) : I.toIdeal.IsHomogeneous 𝒜 :=
80-
I.is_homogeneous'
75+
theorem HomogeneousIdeal.isHomogeneous (I : HomogeneousIdeal 𝒜) :
76+
I.toIdeal.IsHomogeneous 𝒜 := I.is_homogeneous'
8177

8278
theorem HomogeneousIdeal.toIdeal_injective :
8379
Function.Injective (HomogeneousIdeal.toIdeal : HomogeneousIdeal 𝒜 → Ideal A) :=
84-
fun ⟨x, hx⟩ ⟨y, hy⟩ => fun (h : x = y) => by simp [h]
80+
HomogeneousSubmodule.toSubmodule_injective 𝒜 𝒜
8581

86-
instance HomogeneousIdeal.setLike : SetLike (HomogeneousIdeal 𝒜) A where
87-
coe I := I.toIdeal
88-
coe_injective' _ _ h := HomogeneousIdeal.toIdeal_injective <| SetLike.coe_injective h
82+
instance HomogeneousIdeal.setLike : SetLike (HomogeneousIdeal 𝒜) A :=
83+
HomogeneousSubmodule.setLike 𝒜 𝒜
8984

9085
@[ext]
9186
theorem HomogeneousIdeal.ext {I J : HomogeneousIdeal 𝒜} (h : I.toIdeal = J.toIdeal) : I = J :=
9287
HomogeneousIdeal.toIdeal_injective h
9388

9489
theorem HomogeneousIdeal.ext' {I J : HomogeneousIdeal 𝒜} (h : ∀ i, ∀ x ∈ 𝒜 i, x ∈ I ↔ x ∈ J) :
95-
I = J := by
96-
ext
97-
rw [I.isHomogeneous.mem_iff, J.isHomogeneous.mem_iff]
98-
apply forall_congr'
99-
exact fun i ↦ h i _ (decompose 𝒜 _ i).2
90+
I = J := HomogeneousSubmodule.ext' 𝒜 𝒜 h
10091

101-
@[simp]
92+
@[simp high]
10293
theorem HomogeneousIdeal.mem_iff {I : HomogeneousIdeal 𝒜} {x : A} : x ∈ I.toIdeal ↔ x ∈ I :=
10394
Iff.rfl
10495

@@ -113,7 +104,7 @@ variable (I : Ideal A)
113104
/-- For any `I : Ideal A`, not necessarily homogeneous, `I.homogeneousCore' 𝒜`
114105
is the largest homogeneous ideal of `A` contained in `I`, as an ideal. -/
115106
def Ideal.homogeneousCore' (I : Ideal A) : Ideal A :=
116-
Ideal.span ((↑) '' (((↑) : Subtype (Homogeneous 𝒜) → A) ⁻¹' I))
107+
Ideal.span ((↑) '' (((↑) : Subtype (SetLike.IsHomogeneousElem 𝒜) → A) ⁻¹' I))
117108

118109
theorem Ideal.homogeneousCore'_mono : Monotone (Ideal.homogeneousCore' 𝒜) :=
119110
fun _ _ I_le_J => Ideal.span_mono <| Set.image_subset _ fun _ => @I_le_J _
@@ -138,7 +129,8 @@ theorem Ideal.isHomogeneous_iff_subset_iInter :
138129
I.IsHomogeneous 𝒜 ↔ (I : Set A) ⊆ ⋂ i, GradedRing.proj 𝒜 i ⁻¹' ↑I :=
139130
subset_iInter_iff.symm
140131

141-
theorem Ideal.mul_homogeneous_element_mem_of_mem {I : Ideal A} (r x : A) (hx₁ : Homogeneous 𝒜 x)
132+
theorem Ideal.mul_homogeneous_element_mem_of_mem
133+
{I : Ideal A} (r x : A) (hx₁ : SetLike.IsHomogeneousElem 𝒜 x)
142134
(hx₂ : x ∈ I) (j : ι) : GradedRing.proj 𝒜 j (r * x) ∈ I := by
143135
classical
144136
rw [← DirectSum.sum_support_decompose 𝒜 r, Finset.sum_mul, map_sum]
@@ -152,7 +144,7 @@ theorem Ideal.mul_homogeneous_element_mem_of_mem {I : Ideal A} (r x : A) (hx₁
152144
· exact I.mul_mem_left _ hx₂
153145
· exact I.zero_mem
154146

155-
theorem Ideal.homogeneous_span (s : Set A) (h : ∀ x ∈ s, Homogeneous 𝒜 x) :
147+
theorem Ideal.homogeneous_span (s : Set A) (h : ∀ x ∈ s, SetLike.IsHomogeneousElem 𝒜 x) :
156148
(Ideal.span s).IsHomogeneous 𝒜 := by
157149
rintro i r hr
158150
rw [Ideal.span, Finsupp.span_eq_range_linearCombination] at hr
@@ -173,7 +165,7 @@ is the largest homogeneous ideal of `A` contained in `I`. -/
173165
def Ideal.homogeneousCore : HomogeneousIdeal 𝒜 :=
174166
⟨Ideal.homogeneousCore' 𝒜 I,
175167
Ideal.homogeneous_span _ _ fun _ h => by
176-
have := Subtype.image_preimage_coe (setOf (Homogeneous 𝒜)) (I : Set A)
168+
have := Subtype.image_preimage_coe (setOf (SetLike.IsHomogeneousElem 𝒜)) (I : Set A)
177169
exact (cast congr(_ ∈ $this) h).1
178170

179171
theorem Ideal.homogeneousCore_mono : Monotone (Ideal.homogeneousCore 𝒜) :=
@@ -184,7 +176,7 @@ theorem Ideal.toIdeal_homogeneousCore_le : (I.homogeneousCore 𝒜).toIdeal ≤
184176

185177
variable {𝒜 I}
186178

187-
theorem Ideal.mem_homogeneousCore_of_homogeneous_of_mem {x : A} (h : SetLike.Homogeneous 𝒜 x)
179+
theorem Ideal.mem_homogeneousCore_of_homogeneous_of_mem {x : A} (h : SetLike.IsHomogeneousElem 𝒜 x)
188180
(hmem : x ∈ I) : x ∈ I.homogeneousCore 𝒜 :=
189181
Ideal.subset_span ⟨⟨x, h⟩, hmem, rfl⟩
190182

@@ -194,7 +186,7 @@ theorem Ideal.IsHomogeneous.toIdeal_homogeneousCore_eq_self (h : I.IsHomogeneous
194186
intro x hx
195187
classical
196188
rw [← DirectSum.sum_support_decompose 𝒜 x]
197-
exact Ideal.sum_mem _ fun j _ => Ideal.subset_span ⟨⟨_, homogeneous_coe _⟩, h _ hx, rfl⟩
189+
exact Ideal.sum_mem _ fun j _ => Ideal.subset_span ⟨⟨_, isHomogeneousElem_coe _⟩, h _ hx, rfl⟩
198190

199191
@[simp]
200192
theorem HomogeneousIdeal.toIdeal_homogeneousCore_eq_self (I : HomogeneousIdeal 𝒜) :
@@ -481,7 +473,7 @@ def Ideal.homogeneousHull : HomogeneousIdeal 𝒜 :=
481473
⟨Ideal.span { r : A | ∃ (i : ι) (x : I), (DirectSum.decompose 𝒜 (x : A) i : A) = r }, by
482474
refine Ideal.homogeneous_span _ _ fun x hx => ?_
483475
obtain ⟨i, x, rfl⟩ := hx
484-
apply SetLike.homogeneous_coe
476+
apply SetLike.isHomogeneousElem_coe
485477

486478
theorem Ideal.le_toIdeal_homogeneousHull : I ≤ (Ideal.homogeneousHull 𝒜 I).toIdeal := by
487479
intro r hr
@@ -526,10 +518,9 @@ theorem Ideal.homogeneousHull_eq_iSup :
526518
I.homogeneousHull 𝒜 =
527519
⨆ i, ⟨Ideal.span (GradedRing.proj 𝒜 i '' I), Ideal.homogeneous_span 𝒜 _ (by
528520
rintro _ ⟨x, -, rfl⟩
529-
apply SetLike.homogeneous_coe)⟩ := by
521+
apply SetLike.isHomogeneousElem_coe)⟩ := by
530522
ext1
531523
rw [Ideal.toIdeal_homogeneousHull_eq_iSup, toIdeal_iSup]
532-
rfl
533524

534525
end HomogeneousHull
535526

0 commit comments

Comments
 (0)