Star monoids, rings, and modules #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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.
Instances of this typeclass
Instances of other typeclasses for has_star
- has_star.has_sizeof_inst
- star_mem : ∀ {s : S} {r : R}, r ∈ s → has_star.star r ∈ s
star_mem_class S G
states S
is a type of subsets s ⊆ G
closed under star.
Instances of this typeclass
Instances of other typeclasses for star_mem_class
- star_mem_class.has_sizeof_inst
Equations
- star_mem_class.has_star s = {star := λ (r : ↥s), ⟨has_star.star ↑r, _⟩}
- to_has_star : has_star R
- star_involutive : function.involutive has_star.star
Typeclass for a star operation with is involutive.
Instances of this typeclass
- star_semigroup.to_has_involutive_star
- star_add_monoid.to_has_involutive_star
- ring_hom.has_involutive_star
- mul_opposite.has_involutive_star
- set.has_involutive_star
- prod.has_involutive_star
- subalgebra.has_involutive_star
- pi.has_involutive_star
- matrix.has_involutive_star
- unitary.has_involutive_star
- continuous_linear_map.has_involutive_star
- linear_map.has_involutive_star
- tensor_product.has_involutive_star
Instances of other typeclasses for has_involutive_star
- has_involutive_star.has_sizeof_inst
star
as an equivalence when it is involutive.
- star_trivial : ∀ (r : R), has_star.star r = r
Typeclass for a trivial star operation. This is mostly meant for ℝ
.
Instances of this typeclass
- to_has_involutive_star : has_involutive_star R
- star_mul : ∀ (r s : R), has_star.star (r * s) = has_star.star s * has_star.star r
A *
-semigroup is a semigroup R
with an involutive operations star
so star (r * s) = star s * star r
.
Instances of this typeclass
Instances of other typeclasses for star_semigroup
- star_semigroup.has_sizeof_inst
Alias of the reverse direction of semiconj_by_star_star_star
.
Alias of the reverse direction of commute_star_star
.
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 (has_star.star x), inv_fun := (equiv.trans (function.involutive.to_perm has_star.star star_mul_equiv._proof_1) 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 := has_star.star has_involutive_star.to_has_star, inv_fun := (function.involutive.to_perm has_star.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_semigroup_of_comm = {to_has_involutive_star := {to_has_star := {star := id R}, star_involutive := _}, star_mul := _}
Note that since star_semigroup_of_comm
is reducible, simp
can already prove this.
- to_has_involutive_star : has_involutive_star R
- star_add : ∀ (r s : R), has_star.star (r + s) = has_star.star r + has_star.star s
A *
-additive monoid R
is an additive monoid with an involutive star
operation which
preserves addition.
Instances of this typeclass
Instances of other typeclasses for star_add_monoid
- star_add_monoid.has_sizeof_inst
star
as an add_equiv
Equations
- star_add_equiv = {to_fun := has_star.star has_involutive_star.to_has_star, inv_fun := (function.involutive.to_perm has_star.star star_add_equiv._proof_1).inv_fun, left_inv := _, right_inv := _, map_add' := _}
- to_star_semigroup : star_semigroup R
- star_add : ∀ (r s : R), has_star.star (r + s) = has_star.star r + has_star.star s
A *
-ring R
is a (semi)ring with an involutive star
operation which is additive
which makes R
with its multiplicative structure into a *
-semigroup
(i.e. star (r * s) = star s * star r
).
Instances of this typeclass
Instances of other typeclasses for star_ring
- star_ring.has_sizeof_inst
star
as an ring_equiv
from R
to Rᵐᵒᵖ
Equations
- star_ring_equiv = {to_fun := λ (x : R), mul_opposite.op (has_star.star x), inv_fun := (star_add_equiv.trans mul_opposite.op_add_equiv).inv_fun, left_inv := _, right_inv := _, map_mul' := _, map_add' := _}
star
as a ring automorphism, for commutative R
.
Equations
- star_ring_aut = {to_fun := has_star.star has_involutive_star.to_has_star, inv_fun := star_add_equiv.inv_fun, left_inv := _, right_inv := _, map_mul' := _, map_add' := _}
star
as a ring endomorphism, for commutative R
. This is used to denote complex
conjugation, and is available under the notation conj
in the locale complex_conjugate
.
Note that this is the preferred form (over star_ring_aut
, available under the same hypotheses)
because the notation E →ₗ⋆[R] F
for an R
-conjugate-linear map (short for
E →ₛₗ[star_ring_end R] F
) does not pretty-print if there is a coercion involved, as would be the
case for (↑star_ring_aut : R →* R)
.
Equations
Instances for star_ring_end
This is not a simp lemma, since we usually want simp to keep star_ring_end
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
.
Equations
- ring_hom.has_involutive_star = {to_has_star := {star := λ (f : S →+* R), (star_ring_end R).comp f}, star_involutive := _}
Alias of star_ring_end_self_apply
.
Alias of star_ring_end_self_apply
.
When multiplication is commutative, star
preserves division.
Any commutative semiring admits the trivial *
-structure.
See note [reducible non-instances].
Equations
- star_ring_of_comm = {to_star_semigroup := {to_has_involutive_star := {to_has_star := {star := id R}, star_involutive := _}, star_mul := _}, star_add := _}
- star_smul : ∀ (r : R) (a : A), has_star.star (r • a) = has_star.star r • has_star.star a
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_smul R A]
.
If used as [comm_ring R] [star_ring R] [semiring A] [star_ring A] [algebra R A]
, this represents a
star algebra.
Instances of this typeclass
- star_module.complex_to_real
- star_semigroup.to_star_module
- units.star_module
- star_semigroup.to_opposite_star_module
- prod.star_module
- star_subalgebra.star_module
- pi.star_module
- matrix.star_module
- complex.star_module
- continuous_linear_map.star_module
- linear_map.star_module
- mul_opposite.star_module
- tensor_product.star_module
- matrix.is_star_module
- pi.matrix.is_star_module
A commutative star monoid is a star module over itself via monoid.to_mul_action
.
Instance needed to define star-linear maps over a commutative star ring (ex: conjugate-linear maps when R = ℂ).
- coe : F → Π (a : R), (λ (_x : R), S) a
- coe_injective' : function.injective star_hom_class.coe
- map_star : ∀ (f : F) (r : R), ⇑f (has_star.star r) = has_star.star (⇑f r)
star_hom_class F R S
states that F
is a type of star
-preserving maps from R
to S
.
Instances of this typeclass
Instances of other typeclasses for star_hom_class
- star_hom_class.has_sizeof_inst
Instances #
Equations
- units.star_semigroup = {to_has_involutive_star := {to_has_star := {star := λ (u : Rˣ), {val := has_star.star ↑u, inv := has_star.star ↑u⁻¹, val_inv := _, inv_val := _}}, star_involutive := _}, star_mul := _}
Equations
- invertible.star r = {inv_of := has_star.star (⅟ r), inv_of_mul_self := _, mul_inv_of_self := _}
The opposite type carries the same star operation.
Equations
- mul_opposite.has_star = {star := λ (r : Rᵐᵒᵖ), mul_opposite.op (has_star.star (mul_opposite.unop r))}
A commutative star monoid is a star module over its opposite via
monoid.to_opposite_mul_action
.