Additively-graded multiplicative structures #
This module provides a set of heterogeneous typeclasses for defining a multiplicative structure
over the sigma type GradedMonoid A
such that (*) : A i → A j → A (i + j)
; that is to say, A
forms an additively-graded monoid. The typeclasses are:
These respectively imbue:
One (GradedMonoid A)
Mul (GradedMonoid A)
Monoid (GradedMonoid A)
CommMonoid (GradedMonoid A)
the base type A 0
with:
GradedMonoid.GradeZero.One
GradedMonoid.GradeZero.Mul
GradedMonoid.GradeZero.Monoid
GradedMonoid.GradeZero.CommMonoid
and the i
th grade A i
with A 0
-actions (•
) defined as left-multiplication:
For now, these typeclasses are primarily used in the construction of DirectSum.Ring
and the rest
of that file.
Dependent graded products #
This also introduces List.dProd
, which takes the (possibly non-commutative) product of a list
of graded elements of type A i
. This definition primarily exist to allow GradedMonoid.mk
and DirectSum.of
to be pulled outside a product, such as in GradedMonoid.mk_list_dProd
and
DirectSum.of_list_dProd
.
Internally graded monoids #
In addition to the above typeclasses, in the most frequent case when A
is an indexed collection of
SetLike
subobjects (such as AddSubmonoid
s, AddSubgroup
s, or Submodule
s), this file
provides the Prop
typeclasses:
SetLike.GradedOne A
(which provides the obviousGradedMonoid.GOne A
instance)SetLike.GradedMul A
(which provides the obviousGradedMonoid.GMul A
instance)SetLike.GradedMonoid A
(which provides the obviousGradedMonoid.GMonoid A
andGradedMonoid.GCommMonoid A
instances)
which respectively provide the API lemmas
SetLike.one_mem_graded
SetLike.mul_mem_graded
SetLike.pow_mem_graded
,SetLike.list_prod_map_mem_graded
Strictly this last class is unnecessary as it has no fields not present in its parents, but it is
included for convenience. Note that there is no need for SetLike.GradedRing
or similar, as all
the information it would contain is already supplied by GradedMonoid
when A
is a collection
of objects satisfying AddSubmonoidClass
such as Submodule
s. These constructions are explored
in Algebra.DirectSum.Internal
.
This file also defines:
SetLike.isHomogeneous A
(which says thata
is homogeneous iffa ∈ A i
for somei : ι
)SetLike.homogeneousSubmonoid A
, which is, as the name suggests, the submonoid consisting of all the homogeneous elements.
tags #
graded monoid
Equations
- GradedMonoid.instInhabitedGradedMonoid = inferInstanceAs (Inhabited (Sigma A))
Actions #
If R
acts on each A i
, then it acts on GradedMonoid A
via the .2
projection.
Equations
- GradedMonoid.instSMulGradedMonoid = { smul := fun (r : α) (g : GradedMonoid A) => GradedMonoid.mk g.fst (r • g.snd) }
Equations
- (_ : SMulCommClass α β (GradedMonoid A)) = (_ : SMulCommClass α β (GradedMonoid A))
Equations
- (_ : IsScalarTower α β (GradedMonoid A)) = (_ : IsScalarTower α β (GradedMonoid A))
Equations
- GradedMonoid.instMulActionGradedMonoid = MulAction.mk (_ : ∀ (g : GradedMonoid A), 1 • g = g) (_ : ∀ (r₁ r₂ : α) (g : GradedMonoid A), (r₁ * r₂) • g = r₁ • r₂ • g)
Typeclasses #
GOne
implies One (GradedMonoid A)
Equations
- GradedMonoid.GOne.toOne A = { one := { fst := 0, snd := GradedMonoid.GOne.one } }
GMul
implies Mul (GradedMonoid A)
.
Equations
- GradedMonoid.GMul.toMul A = { mul := fun (x y : GradedMonoid A) => { fst := x.fst + y.fst, snd := GradedMonoid.GMul.mul x.snd y.snd } }
A default implementation of power on a graded monoid, like npowRec
.
GMonoid.gnpow
should be used instead.
Equations
- GradedMonoid.GMonoid.gnpowRec 0 x = cast (_ : A 0 = A (0 • x✝)) GradedMonoid.GOne.one
- GradedMonoid.GMonoid.gnpowRec (Nat.succ n) x = cast (_ : A (x✝ + n • x✝) = A ((n + 1) • x✝)) (GradedMonoid.GMul.mul x (GradedMonoid.GMonoid.gnpowRec n x))
Instances For
A tactic to for use as an optional value for GMonoid.gnpow_zero'
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A tactic to for use as an optional value for GMonoid.gnpow_succ'
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A graded version of Monoid
Like Monoid.npow
, this has an optional GMonoid.gnpow
field to allow definitional control of
natural powers of a graded monoid.
- mul : {i j : ι} → A i → A j → A (i + j)
- one : A 0
- one_mul : ∀ (a : GradedMonoid A), 1 * a = a
Multiplication by
one
on the left is the identity - mul_one : ∀ (a : GradedMonoid A), a * 1 = a
Multiplication by
one
on the right is the identity Multiplication is associative
Optional field to allow definitional control of natural powers
- gnpow_zero' : ∀ (a : GradedMonoid A), GradedMonoid.mk (0 • a.fst) (GradedMonoid.GMonoid.gnpow 0 a.snd) = 1
The zeroth power will yield 1
- gnpow_succ' : ∀ (n : ℕ) (a : GradedMonoid A), GradedMonoid.mk (Nat.succ n • a.fst) (GradedMonoid.GMonoid.gnpow (Nat.succ n) a.snd) = a * { fst := n • a.fst, snd := GradedMonoid.GMonoid.gnpow n a.snd }
Successor powers behave as expected
Instances
GMonoid
implies a Monoid (GradedMonoid A)
.
Equations
- One or more equations did not get rendered due to their size.
A graded version of CommMonoid
.
- mul : {i j : ι} → A i → A j → A (i + j)
- one : A 0
- one_mul : ∀ (a : GradedMonoid A), 1 * a = a
- mul_one : ∀ (a : GradedMonoid A), a * 1 = a
- gnpow_zero' : ∀ (a : GradedMonoid A), GradedMonoid.mk (0 • a.fst) (GradedMonoid.GMonoid.gnpow 0 a.snd) = 1
- gnpow_succ' : ∀ (n : ℕ) (a : GradedMonoid A), GradedMonoid.mk (Nat.succ n • a.fst) (GradedMonoid.GMonoid.gnpow (Nat.succ n) a.snd) = a * { fst := n • a.fst, snd := GradedMonoid.GMonoid.gnpow n a.snd }
- mul_comm : ∀ (a b : GradedMonoid A), a * b = b * a
Multiplication is commutative
Instances
GCommMonoid
implies a CommMonoid (GradedMonoid A)
, although this is only used as an
instance locally to define notation in gmonoid
and similar typeclasses.
Equations
- GradedMonoid.GCommMonoid.toCommMonoid A = let src := GradedMonoid.GMonoid.toMonoid A; CommMonoid.mk (_ : ∀ (a b : GradedMonoid A), a * b = b * a)
Instances for A 0
#
The various g*
instances are enough to promote the AddCommMonoid (A 0)
structure to various
types of multiplicative structure.
1 : A 0
is the value provided in GOne.one
.
Equations
- GradedMonoid.GradeZero.one A = { one := GradedMonoid.GOne.one }
(•) : A 0 → A i → A i
is the value provided in GradedMonoid.GMul.mul
, composed with
an Eq.rec
to turn A (0 + i)
into A i
.
Equations
- GradedMonoid.GradeZero.smul A i = { smul := fun (x : A 0) (y : A i) => (_ : 0 + i = i) ▸ GradedMonoid.GMul.mul x y }
(*) : A 0 → A 0 → A 0
is the value provided in GradedMonoid.GMul.mul
, composed with
an Eq.rec
to turn A (0 + 0)
into A 0
.
Equations
- GradedMonoid.GradeZero.mul A = { mul := fun (x x_1 : A 0) => x • x_1 }
Equations
- GradedMonoid.instNatPowOfNatToOfNat0ToZero A = { pow := fun (x : A 0) (n : ℕ) => (_ : n • 0 = 0) ▸ GradedMonoid.GMonoid.gnpow n x }
The Monoid
structure derived from GMonoid A
.
Equations
- One or more equations did not get rendered due to their size.
The CommMonoid
structure derived from GCommMonoid A
.
Equations
- One or more equations did not get rendered due to their size.
GradedMonoid.mk 0
is a MonoidHom
, using the GradedMonoid.GradeZero.monoid
structure.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Each grade A i
derives an A 0
-action structure from GMonoid A
.
Equations
- One or more equations did not get rendered due to their size.
Dependent products of graded elements #
The index used by List.dProd
. Propositionally this is equal to (l.map fι).Sum
, but
definitionally it needs to have a different form to avoid introducing Eq.rec
s in List.dProd
.
Equations
- List.dProdIndex l fι = List.foldr (fun (i : α) (b : ι) => fι i + b) 0 l
Instances For
A dependent product for graded monoids represented by the indexed family of types A i
.
This is a dependent version of (l.map fA).prod
.
For a list l : List α
, this computes the product of fA a
over a
, where each fA
is of type
A (fι a)
.
Equations
- List.dProd l fι fA = List.foldrRecOn l (fun (i : α) (b : ι) => fι i + b) 0 GradedMonoid.GOne.one fun (x : ι) (x_1 : A x) (a : α) (x_2 : a ∈ l) => GradedMonoid.GMul.mul (fA a) x_1
Instances For
A variant of GradedMonoid.mk_list_dProd
for rewriting in the other direction.
Concrete instances #
If all grades are the same type and themselves form a monoid, then there is a trivial grading structure.
Equations
- One or more equations did not get rendered due to their size.
If all grades are the same type and themselves form a commutative monoid, then there is a trivial grading structure.
Equations
- CommMonoid.gCommMonoid ι = let src := Monoid.gMonoid ι; GradedMonoid.GCommMonoid.mk (_ : ∀ (x x_1 : GradedMonoid fun (x : ι) => R), x * x_1 = x_1 * x)
Shorthands for creating instance of the above typeclasses for collections of subobjects #
Equations
- SetLike.gOne A = { one := { val := 1, property := (_ : 1 ∈ A 0) } }
A version of GradedMonoid.GMonoid
for internally graded objects.
Instances
Build a GMonoid
instance for a collection of subobjects.
Equations
- One or more equations did not get rendered due to their size.
Build a GCommMonoid
instance for a collection of subobjects.
Equations
- SetLike.gCommMonoid A = let src := SetLike.gMonoid A; GradedMonoid.GCommMonoid.mk (_ : ∀ (x x_1 : GradedMonoid fun (i : ι) => ↥(A i)), x * x_1 = x_1 * x)
Coercing a dependent product of subtypes is the same as taking the regular product of the coercions.
A version of List.coe_dProd_set_like
with Subtype.mk
.
An element a : R
is said to be homogeneous if there is some i : ι
such that a ∈ A i
.
Equations
- SetLike.Homogeneous A a = ∃ (i : ι), a ∈ A i
Instances For
When A
is a SetLike.GradedMonoid A
, then the homogeneous elements forms a submonoid.
Equations
- One or more equations did not get rendered due to their size.