Star monoids, rings, and modules #
We introduce the basic algebraic notions of star monoids, star rings, and star modules. A star algebra is simply a star ring that is also a star module.
These are implemented as "mixin" typeclasses, so to summon a star ring (for example)
one needs to write (R : Type) [ring R] [star_ring R]
.
This avoids difficulties with diamond inheritance.
For now we simply do not introduce notations,
as different users are expected to feel strongly about the relative merits of
r^*
, r†
, rᘁ
, and so on.
Our star rings are actually star semirings, but of course we can prove
star_neg : star (-r) = - star r
when the underlying semiring is a ring.
- star : R → R
Notation typeclass (with no default notation!) for an algebraic structure with a star operation.
- to_has_star : has_star R
- star_involutive : function.involutive star
Typeclass for a star operation with is involutive.
In a commutative ring, make simp
prefer leaving the order unchanged.
star
as an mul_equiv
from R
to Rᵐᵒᵖ
Equations
- star_mul_equiv = {to_fun := λ (x : R), mul_opposite.op (star x), inv_fun := ((function.involutive.to_equiv star star_mul_equiv._proof_1).trans mul_opposite.op_equiv).inv_fun, left_inv := _, right_inv := _, map_mul' := _}
star
as a mul_aut
for commutative R
.
Equations
- star_mul_aut = {to_fun := star has_involutive_star.to_has_star, inv_fun := (function.involutive.to_equiv star star_mul_aut._proof_1).inv_fun, left_inv := _, right_inv := _, map_mul' := _}
When multiplication is commutative, star
preserves division.
Any commutative monoid admits the trivial *
-structure.
See note [reducible non-instances].
Equations
- star_monoid_of_comm = {to_has_involutive_star := {to_has_star := {star := id R}, star_involutive := _}, star_mul := _}
Note that since star_monoid_of_comm
is reducible, simp
can already prove this. -
star
as an add_equiv
Equations
- star_add_equiv = {to_fun := star has_involutive_star.to_has_star, inv_fun := (function.involutive.to_equiv star star_add_equiv._proof_1).inv_fun, left_inv := _, right_inv := _, map_add' := _}
star
as an ring_equiv
from R
to Rᵐᵒᵖ
Equations
- star_ring_equiv = {to_fun := λ (x : R), mul_opposite.op (star x), inv_fun := (star_add_equiv.trans mul_opposite.op_add_equiv).inv_fun, left_inv := _, right_inv := _, map_mul' := _, map_add' := _}
This is not a simp lemma, since we usually want simp to keep star_ring_aut
bundled.
For example, for complex conjugation, we don't want simp to turn conj x
into the bare function star x
automatically since most lemmas are about conj x
.
Alias of star_ring_aut_self_apply
.
Alias of star_ring_aut_self_apply
.
Any commutative semiring admits the trivial *
-structure.
See note [reducible non-instances].
Equations
- star_ring_of_comm = {to_star_monoid := {to_has_involutive_star := {to_has_star := {star := id R}, star_involutive := _}, star_mul := _}, star_add := _}
An ordered *
-ring is a ring which is both an ordered ring and a *
-ring,
and 0 ≤ star r * r
for every r
.
(In a Banach algebra, the natural ordering is given by the positive cone
which is the closure of the sums of elements star r * r
.
This ordering makes the Banach algebra an ordered *
-ring.)
Instances
A star module A
over a star ring R
is a module which is a star add monoid,
and the two star structures are compatible in the sense
star (r • a) = star r • star a
.
Note that it is up to the user of this typeclass to enforce
[semiring R] [star_ring R] [add_comm_monoid A] [star_add_monoid A] [module R A]
, and that
the statement only requires [has_star R] [has_star A] [has_scalar R A]
.
If used as [comm_ring R] [star_ring R] [semiring A] [star_ring A] [algebra R A]
, this represents a
star algebra.
A commutative star monoid is a star module over itself via monoid.to_mul_action
.
Equations
Instance needed to define star-linear maps over a commutative star ring (ex: conjugate-linear maps when R = ℂ).
Instances #
Equations
- units.star_module = {star_smul := _}
The opposite type carries the same star operation.
Equations
- mul_opposite.has_star = {star := λ (r : Rᵐᵒᵖ), mul_opposite.op (star (mul_opposite.unop r))}
Equations
A commutative star monoid is a star module over its opposite via
monoid.to_opposite_mul_action
.