Skip to content

feat(RingTheory/GradedAlgebra): homogeneous relation#27307

Open
xyzw12345 wants to merge 95 commits intoleanprover-community:masterfrom
xyzw12345:xyzw12345_HomogeneousRelation
Open

feat(RingTheory/GradedAlgebra): homogeneous relation#27307
xyzw12345 wants to merge 95 commits intoleanprover-community:masterfrom
xyzw12345:xyzw12345_HomogeneousRelation

Conversation

@xyzw12345
Copy link
Copy Markdown
Collaborator

@xyzw12345 xyzw12345 commented Jul 20, 2025

In this PR, we defined the concept of a homogeneous relation and proved some properties about homogeneous relations. The main result of this PR is showing that taking RingQuot by a homogeneous relation can give a graded structure on the quotient ring. This result can be used to define graded structures on rings obtained using RingQuot, e.g. the Symmetric Algebra defined in #21539 can be verified to have such a structure.

Co-authored-by:
Zhixuan Dai @atstarrysky 22300180006@m.fudan.edu.cn
Yiming Fu @pelicanhere fakegreenall@foxmail.com
Zhenyan Fu @pumpkin678 fuzhenyan@mail.dlut.edu.cn
Raphael Douglas Giles @Raph-DG raphaeldouglasgiles@gmail.com
Jiedong Jiang @jjdishere emailboxofjjd@163.com

This PR continues the work from #22279.

Original PR: #22279

@xyzw12345
Copy link
Copy Markdown
Collaborator Author

xyzw12345 commented Sep 23, 2025

@ocfnash Thanks for the suggestion! I agree that RingQuot is more like a legacy, so we should probably not just write it for this case. Do you think that it will make more sense to talk about GradedAlgebra structure given by a surjective RingHom or AlgHom whose kernel is a homogeneous ideal?
I mean, we do have things like SymmetricAlgebra that we want to have a GradedAlgebra structure on it but it's defined by RingQuot, so we probably still want the RingQuot case. But since we would also want to have the case of taking quotient by a homogeneous ideal, maybe we can just work with a surjective RingHom?

Copy link
Copy Markdown
Member

@erdOne erdOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you specialize everything to quotients by RingCons (and by extension HasQuotient.Quotient by [I.IsTwoSided]?

As long as this is doable and not painful I think it is fine if we are working with RingQuot here.


/-- The canonical isomorphism of an internal direct sum with the ambient ring -/
noncomputable def coeRingEquiv (hM : DirectSum.IsInternal M) :
(DirectSum ι fun i => ↥(M i)) ≃+* A := RingEquiv.ofBijective (DirectSum.coeRingHom M) hM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(DirectSum ι fun i => ↥(M i)) ≃+* A := RingEquiv.ofBijective (DirectSum.coeRingHom M) hM
(DirectSum ι (M ·)) ≃+* A := RingEquiv.ofBijective (DirectSum.coeRingHom M) hM

Can you add some API for this iso?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add some API, and probably split the part about direct sum and graded rings into a separate PR (if that's a reasonable to do?)

@erdOne erdOne added the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 15, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2025
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>
@xyzw12345
Copy link
Copy Markdown
Collaborator Author

Can you specialize everything to quotients by RingCons (and by extension HasQuotient.Quotient by [I.IsTwoSided]?

As long as this is doable and not painful I think it is fine if we are working with RingQuot here.

I'll try to confirm this tomorrow morning (in my time zone), sorry for postponing replying to your reviews for so long, and thanks for the review!

xyzw12345 and others added 6 commits February 9, 2026 23:14
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>
Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com>
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 9, 2026
Copy link
Copy Markdown
Contributor

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you proven that the Submodule.quotientRel associated to a HomogeneousIdeal is a homogeneous relation?

def linearMap : (⨁ i, α i) →ₗ[R] ⨁ i, β i := DFinsupp.mapRange.linearMap f

@[simp] lemma linearMap_of [DecidableEq ι] (i : ι) (x : α i) :
(linearMap f) (of α i x) = of β i (f i x) := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(linearMap f) (of α i x) = of β i (f i x) := by
linearMap f (of α i x) = of β i (f i x) := by

(optional)

I'd make variables implicit in linearMap_of/apply/id/comp since they can be inferred from both sides.

change DFinsupp.mapRange.linearMap f (DFinsupp.single i x) = DFinsupp.single i (f i x)
simp

@[simp] lemma linearMap_apply (i : ι) (x : ⨁ i, α i) : (linearMap f) x i = f i (x i) := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@[simp] lemma linearMap_apply (i : ι) (x : ⨁ i, α i) : (linearMap f) x i = f i (x i) := by
@[simp] lemma linearMap_apply (i : ι) (x : ⨁ i, α i) : linearMap f x i = f i (x i) := by

(optional)

| add _ _ hx hy => simp [hx, hy]

@[simp] lemma linearMap_id :
(linearMap (fun i ↦ LinearMap.id (R := R) (M := α i))) = LinearMap.id := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(linearMap (fun i ↦ LinearMap.id (R := R) (M := α i))) = LinearMap.id := by
linearMap (fun i ↦ .id (R := R) (M := α i)) = .id := by

variable [∀ i, AddCommMonoid (α i)] [∀ i, AddCommMonoid (β i)]
variable [∀ i, Module R (α i)] [∀ i, Module R (β i)]

variable (f : ∀ (i : ι), α i →ₗ[R] β i)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variable (f : ∀ (i : ι), α i →ₗ[R] β i)
variable (f : ∀ i : ι, α i →ₗ[R] β i)

(optional, you might also omit : ι)


@[simp] lemma linearMap_comp {γ : ι → Type*} [∀ i, AddCommMonoid (γ i)] [∀ i, Module R (γ i)]
(g : ∀ (i : ι), β i →ₗ[R] γ i) :
(linearMap (fun i ↦ (g i).comp (f i))) = (linearMap g).comp (linearMap f) := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(linearMap (fun i ↦ (g i).comp (f i))) = (linearMap g).comp (linearMap f) := by
linearMap (fun i ↦ (g i).comp (f i)) = (linearMap g).comp (linearMap f) := by

Comment on lines +782 to +783
(h : f.comp e.toAlgHom = g.comp e.toAlgHom) : f = g := AlgHom.ext
fun x ↦ (by simpa using congr($h (e.symm x)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(h : f.comp e.toAlgHom = g.comp e.toAlgHom) : f = g := AlgHom.ext
fun x ↦ (by simpa using congr($h (e.symm x)))
(h : f.comp e.toAlgHom = g.comp e.toAlgHom) : f = g :=
AlgHom.ext fun x ↦ by simpa using congr($h (e.symm x))

map f x = map f y ↔ ∀ i, f i (x i) = f i (y i) := by
simp_rw [DirectSum.ext_iff, map_apply]

lemma map_eq_toAddMonoid [DecidableEq ι] : map f = toAddMonoid (fun i ↦ (of β i).comp (f i)) := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma map_eq_toAddMonoid [DecidableEq ι] : map f = toAddMonoid (fun i ↦ (of β i).comp (f i)) := by
lemma map_eq_toAddMonoid [DecidableEq ι] : map f = toAddMonoid fun i ↦ (of β i).comp (f i) := by


theorem lof_eq_of (i : ι) (b : M i) : lof R ι M i b = of M i b := rfl

@[simp] theorem lof_toAddMonoidHom_eq_of (i : ι) : (lof R ι M i).toAddMonoidHom = of M i := rfl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@[simp] theorem lof_toAddMonoidHom_eq_of (i : ι) : (lof R ι M i).toAddMonoidHom = of M i := rfl
@[simp] theorem toAddMonoidHom_lof_eq_of (i : ι) : (lof R ι M i).toAddMonoidHom = of M i := rfl

obtain ⟨v, rfl⟩ := hy
exact ⟨u + v, by simp⟩

lemma linearMap_eq_iff (x y : ⨁ i, α i) :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma linearMap_eq_iff (x y : ⨁ i, α i) :
lemma linearMap_eq_iff {x y : ⨁ i, α i} :


end Semiring

lemma comp_inj {R A B C : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Semiring C]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You call the RingEquiv version comp_injective so this should probably be named the same.
And why not state this using Function.Injective? The statements are already defeq.

@xyzw12345
Copy link
Copy Markdown
Collaborator Author

Have you proven that the Submodule.quotientRel associated to a HomogeneousIdeal is a homogeneous relation?

Thanks for the reminder! I will add that proof to this PR when I am available.

@alreadydone
Copy link
Copy Markdown
Contributor

alreadydone commented Feb 11, 2026

Thanks!
I think for rings it would be more convenient to use the quotient by Submodule/Ideal instead of RingQuot. Hopefully it's not hard to transport the GradedAlgebra instance across the isomorphism? I think I'll also need that the ideal generated by a homogeneous polynomial is homogeneous (IsDomain condition may be required). We should also show that any submodule generated by homogeneous elements is homogeneous. Of course these should be separate PRs ...

@AntoineChambert-Loir
Copy link
Copy Markdown
Collaborator

In #36501 , we have unfortunately duplicated (by anticipation, the file had a Lean3 version in 2023) some of your efforts. It seems worthwhile to have the versions for modules and submodules (though we only treated homogeneous submodules for the moment, because we had missed docs#ModuleCon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.