Zulip Chat Archive

Stream: mathlib4

Topic: redefine Graded Algebra


Kenny Lau (Oct 07 2025 at 19:04):

This is not part of the projective space project, but I think this might make some things smoother. I propose the following redefinition:

import Mathlib.RingTheory.GradedAlgebra.Basic

#check GradedAlgebra
/-
GradedAlgebra.{u_1, u_2, u_3} {ฮน : Type u_1} {R : Type u_2} {A : Type u_3}
  [DecidableEq ฮน] [AddMonoid ฮน] [CommSemiring R] [Semiring A] [Algebra R A]
  (๐’œ : ฮน โ†’ Submodule R A) : Type (max u_1 u_3)
-/

abbrev GradedAlgebra' {ฮน R A ฯƒ : Type*}
    [DecidableEq ฮน] [AddMonoid ฮน]
    [Semiring A] [SMul R A]
    [SetLike ฯƒ A] [AddSubmonoidClass ฯƒ A] [SMulMemClass ฯƒ R A]
    (๐’œ : ฮน โ†’ ฯƒ) :=
  GradedRing ๐’œ

Alternatively, I propose to not touch the existing GradedAlgebra, but when defining GradedAlgHom we secretly use the new assumptions

Kenny Lau (Oct 07 2025 at 19:05):

basically i just want to unbundle the "base ring" from a graded ring

Eric Wieser (Oct 07 2025 at 19:37):

But I would guess that's not your motivation

Eric Wieser (Oct 07 2025 at 19:37):

Currently the only class that satisfies AddSubmonoidClass and SMulMemClass and GradedRing is Submodule, unless LieSubmodule somehow fits

Kenny Lau (Oct 07 2025 at 19:39):

right, ok, my "real" motivation is to characterise the following map:

given a Nat-graded R-algebra A, and an R-algebra S,
one can construct a Nat-grading on the S-algebra S โŠ—[R] A.

the map A -> S โŠ—[R] A preserves the grading and R-action, but the LHS is a graded R-algebra and the RHS is a graded S-algebra.

Kenny Lau (Oct 07 2025 at 19:40):

so, under my new proposal, I would be able to write toTensor : ๐’œ โ†’โ‚แต[R] S โŠ—แต ๐’œ

Kenny Lau (Oct 07 2025 at 19:42):

actually I suppose in my definition above the base ring is still baked in...

Kenny Lau (Oct 07 2025 at 19:42):

which brings me to the second suggestion:

Kenny Lau (Oct 07 2025 at 19:42):

Kenny Lau said:

Alternatively, I propose to not touch the existing GradedAlgebra, but when defining GradedAlgHom we secretly use the new assumptions

Kenny Lau (Oct 07 2025 at 19:42):

so as objects they are just graded rings, but I can now package into a class the statement that "the morphism preserves the R-actions"

Kenny Lau (Oct 07 2025 at 19:43):

so as cursed as it is, a GradedAlgHom is a map between two GradedRing's

Kenny Lau (Oct 08 2025 at 21:58):

Eric Wieser said:

Currently the only class that satisfies AddSubmonoidClass and SMulMemClass and GradedRing is Submodule

The catch is that it isn't Submodule, it's Submodule R, meaning that the base ring is tied down to the type, which I want to avoid, because I want to restrict to a smaller ring.

I guess I can still do that via (๐’œ : ฮน โ†’ Submodule S A) [GradedAlgebra ๐’œ] [Algebra R S] and then just refer to R all of the time, but is that really better than [SMulMemClass R ฯƒ A] (๐’œ : ฮน โ†’ ฯƒ) [GradedRing ๐’œ]? This latter formulation allows me to avoid mentioning S at all (at the expense of , uh, ฯƒ := Submodule S A I guess...)

ok maybe I can reconsider this a bit

Kenny Lau (Oct 08 2025 at 22:00):

this brings me back actually to an old proposal of mine:

[Algebra R Rโ‚] (๐’œ : ฮน โ†’ Submodule Rโ‚ A) [IsScalarTower R Rโ‚ A]
[Algebra R Rโ‚‚] (โ„ฌ : ฮน โ†’ Submodule Rโ‚‚ A) [IsScalarTower R Rโ‚‚ A]
structure ๐’œ โ†’โ‚[R] โ„ฌ where

Kenny Lau (Oct 08 2025 at 22:01):

compare this to:

[SMulMemClass R ฯƒ A] (๐’œ : ฮน โ†’ ฯƒ)
[SMulMemClass R ฯ„ B] (โ„ฌ : ฮน โ†’ ฯ„)
structure ๐’œ โ†’โ‚[R] โ„ฌ where

Kenny Lau (Oct 08 2025 at 22:01):

I think "on paper" ฯƒ and ฯ„ look cleaner but in practice maybe fixing it to Submodule R1/2 is faster

Kenny Lau (Oct 08 2025 at 23:14):

let me really type out the two proposals so that we can concretely see the fuller picture:

import Mathlib

set_option autoImplicit false

namespace Proposal1

structure GradedAlgHom (R : Type*) {S T A B ฮน : Type*}
    [CommRing R] [CommRing S] [CommRing T] [Ring A] [Ring B]
    [Algebra R S] [Algebra S A] [Algebra R A] [IsScalarTower R S A]
    [Algebra R T] [Algebra T B] [Algebra R B] [IsScalarTower R T B]
    [DecidableEq ฮน] [AddMonoid ฮน]
    (๐’œ : ฮน โ†’ Submodule S A) (โ„ฌ : ฮน โ†’ Submodule T B) [GradedAlgebra ๐’œ] [GradedAlgebra โ„ฌ]
    extends A โ†’โ‚[R] B where
  map_mem' {i} {x} : x โˆˆ ๐’œ i โ†’ toFun x โˆˆ โ„ฌ i

end Proposal1


namespace Proposal2

structure GradedAlgHom (R : Type*) {A B ฮน ฯƒ ฯ„: Type*}
    [CommRing R] [Ring A] [Ring B] [Algebra R A] [Algebra R B]
    [DecidableEq ฮน] [AddMonoid ฮน]
    [SetLike ฯƒ A] [AddSubmonoidClass ฯƒ A] [SMulMemClass ฯƒ R A]
    [SetLike ฯ„ B] [AddSubmonoidClass ฯ„ B] [SMulMemClass ฯ„ R B]
    (๐’œ : ฮน โ†’ ฯƒ) (โ„ฌ : ฮน โ†’ ฯ„) [GradedRing ๐’œ] [GradedRing โ„ฌ]
    extends A โ†’โ‚[R] B where
  map_mem' {i} {x} : x โˆˆ ๐’œ i โ†’ toFun x โˆˆ โ„ฌ i

end Proposal2

Kenny Lau (Oct 08 2025 at 23:16):

/poll Which one do you prefer?
:one:
:two:

Kenny Lau (Oct 09 2025 at 11:44):

made #30365

Eric Wieser (Oct 09 2025 at 12:42):

I agree that :one: isn't a perfect solution (but I think it's a better compromise than :two:)

Kenny Lau (Oct 09 2025 at 12:42):

I did use 1 in #30365

Antoine Chambert-Loir (Oct 09 2025 at 20:07):

I would like to have graded algebras graded by a monoid (not an addmonoid). This stuff appears in Berkovich's theory.

Kenny Lau (Oct 09 2025 at 20:08):

is there a difference that is not covered by Additive?

Antoine Chambert-Loir (Oct 10 2025 at 15:07):

Since there is no mathematical difference, no, but that will force (eventually, when people will want to formalize this) to insert many toAdditive in formulas.

Kenny Lau (Oct 10 2025 at 15:07):

should we call it MulGradedAlgebra?


Last updated: Dec 20 2025 at 21:32 UTC