# 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] [StarRing 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 non-unital, non-associative, semirings, but of course we can prove star_neg : star (-r) = - star r when the underlying semiring is a ring.

class Star (R : Type u) :

Notation typeclass (with no default notation!) for an algebraic structure with a star operation.

• star : RR

A star operation (e.g. complex conjugate).

Instances
class StarMemClass (S : Type u_1) (R : Type u_2) [Star R] [SetLike S R] :

StarMemClass S G states S is a type of subsets s ⊆ G closed under star.

• star_mem : ∀ {s : S} {r : R}, r sstar r s

Closure under star.

Instances
theorem StarMemClass.star_mem {S : Type u_1} {R : Type u_2} [Star R] [SetLike S R] [self : ] {s : S} {r : R} :
r sstar r s

Closure under star.

instance StarMemClass.instStar {R : Type u} {S : Type w} [Star R] [SetLike S R] [hS : ] (s : S) :
Star s
Equations
• = { star := fun (r : s) => star r, }
@[simp]
theorem StarMemClass.coe_star {R : Type u} {S : Type w} [Star R] [SetLike S R] [hS : ] (s : S) (x : s) :
(star x) = star x
class InvolutiveStar (R : Type u) extends :

Typeclass for a star operation with is involutive.

• star : RR
• star_involutive :

Involutive condition.

Instances
theorem InvolutiveStar.star_involutive {R : Type u} [self : ] :

Involutive condition.

@[simp]
theorem star_star {R : Type u} [] (r : R) :
star (star r) = r
theorem star_injective {R : Type u} [] :
@[simp]
theorem star_inj {R : Type u} [] {x : R} {y : R} :
star x = star y x = y
def Equiv.star {R : Type u} [] :

star as an equivalence when it is involutive.

Equations
• Equiv.star =
Instances For
theorem eq_star_of_eq_star {R : Type u} [] {r : R} {s : R} (h : r = star s) :
s = star r
theorem eq_star_iff_eq_star {R : Type u} [] {r : R} {s : R} :
r = star s s = star r
theorem star_eq_iff_star_eq {R : Type u} [] {r : R} {s : R} :
star r = s star s = r
class TrivialStar (R : Type u) [Star R] :

Typeclass for a trivial star operation. This is mostly meant for ℝ.

• star_trivial : ∀ (r : R), star r = r

Condition that star is trivial

Instances
@[simp]
theorem TrivialStar.star_trivial {R : Type u} [Star R] [self : ] (r : R) :
star r = r

Condition that star is trivial

class StarMul (R : Type u) [Mul R] extends :

A *-magma is a magma R with an involutive operation star such that star (r * s) = star s * star r.

• star : RR
• star_involutive :
• star_mul : ∀ (r s : R), star (r * s) = star s * star r

star skew-distributes over multiplication.

Instances
@[simp]
theorem StarMul.star_mul {R : Type u} [Mul R] [self : ] (r : R) (s : R) :
star (r * s) = star s * star r

star skew-distributes over multiplication.

theorem star_star_mul {R : Type u} [Mul R] [] (x : R) (y : R) :
star (star x * y) = star y * x
theorem star_mul_star {R : Type u} [Mul R] [] (x : R) (y : R) :
star (x * star y) = y * star x
@[simp]
theorem semiconjBy_star_star_star {R : Type u} [Mul R] [] {x : R} {y : R} {z : R} :
theorem SemiconjBy.star_star_star {R : Type u} [Mul R] [] {x : R} {y : R} {z : R} :
SemiconjBy x y zSemiconjBy (star x) (star z) (star y)

Alias of the reverse direction of semiconjBy_star_star_star.

@[simp]
theorem commute_star_star {R : Type u} [Mul R] [] {x : R} {y : R} :
theorem Commute.star_star {R : Type u} [Mul R] [] {x : R} {y : R} :
Commute x yCommute (star x) (star y)

Alias of the reverse direction of commute_star_star.

theorem commute_star_comm {R : Type u} [Mul R] [] {x : R} {y : R} :
@[simp]
theorem star_mul' {R : Type u} [] [] (x : R) (y : R) :
star (x * y) = star x * star y

In a commutative ring, make simp prefer leaving the order unchanged.

@[simp]
theorem starMulEquiv_apply {R : Type u} [Mul R] [] (x : R) :
starMulEquiv x =
def starMulEquiv {R : Type u} [Mul R] [] :

star as a MulEquiv from R to Rᵐᵒᵖ

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem starMulAut_apply {R : Type u} [] [] :
∀ (a : R), starMulAut a = star a
def starMulAut {R : Type u} [] [] :

star as a MulAut for commutative R.

Equations
• starMulAut = let __src := ; { toFun := star, invFun := __src.invFun, left_inv := , right_inv := , map_mul' := }
Instances For
@[simp]
theorem star_one (R : Type u) [] [] :
star 1 = 1
@[simp]
theorem star_pow {R : Type u} [] [] (x : R) (n : ) :
star (x ^ n) = star x ^ n
@[simp]
theorem star_inv {R : Type u} [] [] (x : R) :
@[simp]
theorem star_zpow {R : Type u} [] [] (x : R) (z : ) :
star (x ^ z) = star x ^ z
@[simp]
theorem star_div {R : Type u} [] [] (x : R) (y : R) :
star (x / y) = star x / star y

When multiplication is commutative, star preserves division.

@[reducible, inline]
abbrev starMulOfComm {R : Type u_1} [] :

Any commutative monoid admits the trivial *-structure.

See note [reducible non-instances].

Equations
• starMulOfComm =
Instances For
theorem star_id_of_comm {R : Type u_1} [] {x : R} :
star x = x

Note that since starMulOfComm is reducible, simp can already prove this.

class StarAddMonoid (R : Type u) [] extends :

A *-additive monoid R is an additive monoid with an involutive star operation which preserves addition.

• star : RR
• star_involutive :
• star_add : ∀ (r s : R), star (r + s) = star r + star s

star commutes with addition

Instances
@[simp]
theorem StarAddMonoid.star_add {R : Type u} [] [self : ] (r : R) (s : R) :
star (r + s) = star r + star s

star commutes with addition

@[simp]
theorem starAddEquiv_apply {R : Type u} [] [] :
∀ (a : R), starAddEquiv a = star a
def starAddEquiv {R : Type u} [] [] :
R ≃+ R

star as an AddEquiv

Equations
• starAddEquiv = let __src := ; { toFun := star, invFun := __src.invFun, left_inv := , right_inv := , map_add' := }
Instances For
@[simp]
theorem star_zero (R : Type u) [] [] :
star 0 = 0
@[simp]
theorem star_eq_zero {R : Type u} [] [] {x : R} :
star x = 0 x = 0
theorem star_ne_zero {R : Type u} [] [] {x : R} :
star x 0 x 0
@[simp]
theorem star_neg {R : Type u} [] [] (r : R) :
star (-r) = -star r
@[simp]
theorem star_sub {R : Type u} [] [] (r : R) (s : R) :
star (r - s) = star r - star s
@[simp]
theorem star_nsmul {R : Type u} [] [] (x : R) (n : ) :
star (n x) = n star x
@[simp]
theorem star_zsmul {R : Type u} [] [] (x : R) (n : ) :
star (n x) = n star x
class StarRing (R : Type u) extends :

A *-ring R is a non-unital, non-associative (semi)ring with an involutive star operation which is additive which makes R with its multiplicative structure into a *-multiplication (i.e. star (r * s) = star s * star r).

• star : RR
• star_involutive :
• star_mul : ∀ (r s : R), star (r * s) = star s * star r
• star_add : ∀ (r s : R), star (r + s) = star r + star s

star commutes with addition

Instances
theorem StarRing.star_add {R : Type u} [self : ] (r : R) (s : R) :
star (r + s) = star r + star s

star commutes with addition

@[instance 100]
instance StarRing.toStarAddMonoid {R : Type u} [] :
Equations
@[simp]
theorem starRingEquiv_apply {R : Type u} [] (x : R) :
starRingEquiv x =
def starRingEquiv {R : Type u} [] :

star as a RingEquiv from R to Rᵐᵒᵖ

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem star_natCast {R : Type u} [] [] (n : ) :
star n = n
@[simp]
theorem star_ofNat {R : Type u} [] [] (n : ) [n.AtLeastTwo] :
star () =
@[simp]
theorem star_intCast {R : Type u} [Ring R] [] (z : ) :
star z = z
@[simp]
theorem starRingAut_apply {R : Type u} [] [] :
∀ (a : R), starRingAut a = star a
def starRingAut {R : Type u} [] [] :

star as a ring automorphism, for commutative R.

Equations
• starRingAut = let __src := starAddEquiv; let __src_1 := starMulAut; { toFun := star, invFun := __src.invFun, left_inv := , right_inv := , map_mul' := , map_add' := }
Instances For
def starRingEnd (R : Type u) [] [] :
R →+* R

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 ComplexConjugate.

Note that this is the preferred form (over starRingAut, available under the same hypotheses) because the notation E →ₗ⋆[R] F for an R-conjugate-linear map (short for E →ₛₗ[starRingEnd R] F) does not pretty-print if there is a coercion involved, as would be the case for (↑starRingAut : R →* R).

Equations
• = starRingAut
Instances For

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 ComplexConjugate.

Note that this is the preferred form (over starRingAut, available under the same hypotheses) because the notation E →ₗ⋆[R] F for an R-conjugate-linear map (short for E →ₛₗ[starRingEnd R] F) does not pretty-print if there is a coercion involved, as would be the case for (↑starRingAut : R →* R).

Equations
Instances For
theorem starRingEnd_apply {R : Type u} [] [] (x : R) :
() x = star x

This is not a simp lemma, since we usually want simp to keep starRingEnd 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.

theorem starRingEnd_self_apply {R : Type u} [] [] (x : R) :
() (() x) = x
instance RingHom.involutiveStar {R : Type u} [] [] {S : Type u_1} [] :
Equations
• RingHom.involutiveStar =
theorem RingHom.star_def {R : Type u} [] [] {S : Type u_1} [] (f : S →+* R) :
star f = ().comp f
theorem RingHom.star_apply {R : Type u} [] [] {S : Type u_1} [] (f : S →+* R) (s : S) :
(star f) s = star (f s)
theorem Complex.conj_conj {R : Type u} [] [] (x : R) :
() (() x) = x

Alias of starRingEnd_self_apply.

theorem RCLike.conj_conj {R : Type u} [] [] (x : R) :
() (() x) = x

Alias of starRingEnd_self_apply.

@[simp]
theorem conj_trivial {R : Type u} [] [] [] (a : R) :
() a = a
@[simp]
theorem star_inv' {R : Type u} [] [] (x : R) :
@[simp]
theorem star_zpow₀ {R : Type u} [] [] (x : R) (z : ) :
star (x ^ z) = star x ^ z
@[simp]
theorem star_div' {R : Type u} [] [] (x : R) (y : R) :
star (x / y) = star x / star y

When multiplication is commutative, star preserves division.

@[reducible, inline]
abbrev starRingOfComm {R : Type u_1} [] :

Any commutative semiring admits the trivial *-structure.

See note [reducible non-instances].

Equations
• starRingOfComm = let __src := starMulOfComm;
Instances For
instance Nat.instStarRing :
Equations
instance Int.instStarRing :
Equations
Equations
Equations
class StarModule (R : Type u) (A : Type v) [Star R] [Star A] [SMul R 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] [StarRing R] [AddCommMonoid A] [StarAddMonoid A] [Module R A], and that the statement only requires [Star R] [Star A] [SMul R A].

If used as [CommRing R] [StarRing R] [Semiring A] [StarRing A] [Algebra R A], this represents a star algebra.

• star_smul : ∀ (r : R) (a : A), star (r a) = star r star a

star commutes with scalar multiplication

Instances
@[simp]
theorem StarModule.star_smul {R : Type u} {A : Type v} [Star R] [Star A] [SMul R A] [self : ] (r : R) (a : A) :
star (r a) = star r star a

star commutes with scalar multiplication

instance StarMul.toStarModule {R : Type u} [] [] :

A commutative star monoid is a star module over itself via Monoid.toMulAction.

Equations
• =
instance StarAddMonoid.toStarModuleNat {α : Type u_1} [] [] :
Equations
• =
instance RingHomInvPair.instStarRingEnd {R : Type u} [] [] :

Instance needed to define star-linear maps over a commutative star ring (ex: conjugate-linear maps when R = ℂ).

Equations
• =
class StarHomClass (F : Type u_1) (R : outParam (Type u_2)) (S : outParam (Type u_3)) [Star R] [Star S] [FunLike F R S] :

StarHomClass F R S states that F is a type of star-preserving maps from R to S.

• map_star : ∀ (f : F) (r : R), f (star r) = star (f r)

the maps preserve star

Instances
theorem StarHomClass.map_star {F : Type u_1} {R : outParam (Type u_2)} {S : outParam (Type u_3)} [Star R] [Star S] [FunLike F R S] [self : StarHomClass F R S] (f : F) (r : R) :
f (star r) = star (f r)

the maps preserve star

### Instances #

instance Units.instStarMul {R : Type u} [] [] :
Equations
• Units.instStarMul =
@[simp]
theorem Units.coe_star {R : Type u} [] [] (u : Rˣ) :
(star u) = star u
@[simp]
theorem Units.coe_star_inv {R : Type u} [] [] (u : Rˣ) :
(star u)⁻¹ = star u⁻¹
instance Units.instStarModule {R : Type u} [] [] {A : Type u_1} [Star A] [SMul R A] [] :
Equations
• =
theorem IsUnit.star {R : Type u} [] [] {a : R} :
IsUnit (star a)
@[simp]
theorem isUnit_star {R : Type u} [] [] {a : R} :
theorem Ring.inverse_star {R : Type u} [] [] (a : R) :
instance Invertible.star {R : Type u_1} [] [] (r : R) [] :
Equations
• = { invOf := , invOf_mul_self := , mul_invOf_self := }
theorem star_invOf {R : Type u_1} [] [] (r : R) [] [Invertible (star r)] :
= (star r)
theorem IsLeftRegular.star {R : Type u} [Mul R] [] {x : R} (hx : ) :
theorem IsRightRegular.star {R : Type u} [Mul R] [] {x : R} (hx : ) :
theorem IsRegular.star {R : Type u} [Mul R] [] {x : R} (hx : ) :
@[simp]
theorem isRightRegular_star_iff {R : Type u} [Mul R] [] {x : R} :
@[simp]
theorem isLeftRegular_star_iff {R : Type u} [Mul R] [] {x : R} :
@[simp]
theorem isRegular_star_iff {R : Type u} [Mul R] [] {x : R} :
instance MulOpposite.instStar {R : Type u} [Star R] :

The opposite type carries the same star operation.

Equations
• MulOpposite.instStar = { star := fun (r : Rᵐᵒᵖ) => }
@[simp]
theorem MulOpposite.unop_star {R : Type u} [Star R] (r : Rᵐᵒᵖ) :
@[simp]
theorem MulOpposite.op_star {R : Type u} [Star R] (r : R) :
=
instance MulOpposite.instInvolutiveStar {R : Type u} [] :
Equations
• MulOpposite.instInvolutiveStar =
instance MulOpposite.instStarMul {R : Type u} [Mul R] [] :
Equations
• MulOpposite.instStarMul =
instance MulOpposite.instStarAddMonoid {R : Type u} [] [] :
Equations
A commutative star monoid is a star module over its opposite via Monoid.toOppositeMulAction.