# Documentation

Mathlib.Algebra.Star.Basic

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

We also define the class StarOrderedRing R, which says that the order on R respects the star operation, i.e. an element r is nonnegative iff there exists an s such that r = star s * s.

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.

## TODO #

• In a Banach star algebra without a well-defined square root, the natural ordering is given by the positive cone which is the closure of the sums of elements star r * r. A weaker version of StarOrderedRing could be defined for this case. Note that the current definition has the advantage of not requiring a topology.
class Star (R : Type u) :
• A star operation (e.g. complex conjugate).

star : RR

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

Instances
class StarMemClass (S : Type u_1) (R : Type u_2) [inst : Star R] [inst : SetLike S R] :
• Closure under star.

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

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

Instances
instance StarMemClass.star {R : Type u} {S : Type u} [inst : Star R] [inst : SetLike S R] [hS : ] (s : S) :
Star { x // x s }
Equations
• = { star := fun r => { val := star r, property := (_ : star r s) } }
class InvolutiveStar (R : Type u) extends :
• Involutive condition.

star_involutive :

Typeclass for a star operation with is involutive.

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

star as an equivalence when it is involutive.

Equations
theorem eq_star_of_eq_star {R : Type u} [inst : ] {r : R} {s : R} (h : r = star s) :
s = star r
theorem eq_star_iff_eq_star {R : Type u} [inst : ] {r : R} {s : R} :
r = star s s = star r
theorem star_eq_iff_star_eq {R : Type u} [inst : ] {r : R} {s : R} :
star r = s star s = r
class TrivialStar (R : Type u) [inst : Star R] :
• Condition that star is trivial

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

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

Instances
class StarSemigroup (R : Type u) [inst : ] extends :
• star skew-distributes over multiplication.

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

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

Instances
@[simp]
theorem star_mul' {R : Type u} [inst : ] [inst : ] (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} [inst : ] [inst : ] (x : R) :
starMulEquiv x = { unop := star x }
def starMulEquiv {R : Type u} [inst : ] [inst : ] :

star as a MulEquiv from R to Rᵐᵒᵖ

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

star as a MulAut for commutative R.

Equations
• One or more equations did not get rendered due to their size.
@[simp]
theorem star_one (R : Type u) [inst : ] [inst : ] :
star 1 = 1
@[simp]
theorem star_pow {R : Type u} [inst : ] [inst : ] (x : R) (n : ) :
star (x ^ n) = star x ^ n
@[simp]
theorem star_inv {R : Type u} [inst : ] [inst : ] (x : R) :
@[simp]
theorem star_zpow {R : Type u} [inst : ] [inst : ] (x : R) (z : ) :
star (x ^ z) = star x ^ z
@[simp]
theorem star_div {R : Type u} [inst : ] [inst : ] (x : R) (y : R) :
star (x / y) = star x / star y

When multiplication is commutative, star preserves division.

def starSemigroupOfComm {R : Type u_1} [inst : ] :

Any commutative monoid admits the trivial *-structure.

See note [reducible non-instances].

Equations
theorem star_id_of_comm {R : Type u_1} [inst : ] {x : R} :
star x = x

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

class StarAddMonoid (R : Type u) [inst : ] extends :
• star commutes with addition

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

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

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

star as an AddEquiv

Equations
• One or more equations did not get rendered due to their size.
@[simp]
theorem star_zero (R : Type u) [inst : ] [inst : ] :
star 0 = 0
@[simp]
theorem star_eq_zero {R : Type u} [inst : ] [inst : ] {x : R} :
star x = 0 x = 0
theorem star_ne_zero {R : Type u} [inst : ] [inst : ] {x : R} :
star x 0 x 0
@[simp]
theorem star_neg {R : Type u} [inst : ] [inst : ] (r : R) :
star (-r) = -star r
@[simp]
theorem star_sub {R : Type u} [inst : ] [inst : ] (r : R) (s : R) :
star (r - s) = star r - star s
@[simp]
theorem star_nsmul {R : Type u} [inst : ] [inst : ] (x : R) (n : ) :
star (n x) = n star x
@[simp]
theorem star_zsmul {R : Type u} [inst : ] [inst : ] (x : R) (n : ) :
star (n x) = n star x
class StarRing (R : Type u) [inst : ] extends :
• star commutes with addition

star_add : ∀ (r s : R), star (r + s) = star r + 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
instance StarRing.toStarAddMonoid {R : Type u} [inst : ] [inst : ] :
Equations
@[simp]
theorem starRingEquiv_apply {R : Type u} [inst : ] [inst : ] (x : R) :
starRingEquiv x = { unop := star x }
def starRingEquiv {R : Type u} [inst : ] [inst : ] :

star as an RingEquiv from R to Rᵐᵒᵖ

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

star as a ring automorphism, for commutative R.

Equations
• One or more equations did not get rendered due to their size.
def starRingEnd (R : Type u) [inst : ] [inst : ] :
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→ₗ⋆[R] F⋆[R] F for an R-conjugate-linear map (short for E →ₛₗ[starRingEnd R] F→ₛₗ[starRingEnd R] F) does not pretty-print if there is a coercion involved, as would be the case for (↑starRingAut : R →* R)↑starRingAut : R →* R)→* R).

Equations
• = starRingAut

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→ₗ⋆[R] F⋆[R] F for an R-conjugate-linear map (short for E →ₛₗ[starRingEnd R] F→ₛₗ[starRingEnd R] F) does not pretty-print if there is a coercion involved, as would be the case for (↑starRingAut : R →* R)↑starRingAut : R →* R)→* R).

Equations
theorem starRingEnd_apply {R : Type u} [inst : ] [inst : ] {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} [inst : ] [inst : ] (x : R) :
↑() (↑() x) = x
instance RingHom.involutiveStar {R : Type u} {S : Type u_1} [inst : ] [inst : ] [inst : ] :
Equations
theorem RingHom.star_def {R : Type u} {S : Type u_1} [inst : ] [inst : ] [inst : ] (f : S →+* R) :
star f =
theorem RingHom.star_apply {R : Type u} {S : Type u_1} [inst : ] [inst : ] [inst : ] (f : S →+* R) (s : S) :
↑(star f) s = star (f s)
theorem Complex.conj_conj {R : Type u} [inst : ] [inst : ] (x : R) :
↑() (↑() x) = x

Alias of starRingEnd_self_apply.

theorem IsROrC.conj_conj {R : Type u} [inst : ] [inst : ] (x : R) :
↑() (↑() x) = x

Alias of starRingEnd_self_apply.

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

When multiplication is commutative, star preserves division.

@[simp]
theorem star_bit0 {R : Type u} [inst : ] [inst : ] (r : R) :
star (bit0 r) = bit0 (star r)
@[simp]
theorem star_bit1 {R : Type u} [inst : ] [inst : ] (r : R) :
star (bit1 r) = bit1 (star r)
def starRingOfComm {R : Type u_1} [inst : ] :

Any commutative semiring admits the trivial *-structure.

See note [reducible non-instances].

Equations
• starRingOfComm = let src := starSemigroupOfComm; StarRing.mk (_ : ∀ (x x_1 : R), star (x + x_1) = star (x + x_1))
class StarOrderedRing (R : Type u) [inst : ] [inst : ] extends :
• addition commutes with ≤≤

add_le_add_left : ∀ (a b : R), a b∀ (c : R), c + a c + b
• characterization of non-negativity

nonneg_iff : ∀ (r : R), 0 r s, r = star s * s

An ordered *-ring is a ring which is both an OrderedAddCommGroup and a *-ring, and 0 ≤ r ↔ ∃ s, r = star s * s≤ r ↔ ∃ s, r = star s * s↔ ∃ s, r = star s * s∃ s, r = star s * s.

Instances
instance StarOrderedRing.instOrderedAddCommGroup {R : Type u} [inst : ] [inst : ] [inst : ] :
Equations
• One or more equations did not get rendered due to their size.
theorem star_mul_self_nonneg {R : Type u} [inst : ] [inst : ] [inst : ] {r : R} :
0 star r * r
theorem star_mul_self_nonneg' {R : Type u} [inst : ] [inst : ] [inst : ] {r : R} :
0 r * star r
theorem conjugate_nonneg {R : Type u} [inst : ] [inst : ] [inst : ] {a : R} (ha : 0 a) (c : R) :
0 star c * a * c
theorem conjugate_nonneg' {R : Type u} [inst : ] [inst : ] [inst : ] {a : R} (ha : 0 a) (c : R) :
0 c * a * star c
theorem conjugate_le_conjugate {R : Type u} [inst : ] [inst : ] [inst : ] {a : R} {b : R} (hab : a b) (c : R) :
star c * a * c star c * b * c
theorem conjugate_le_conjugate' {R : Type u} [inst : ] [inst : ] [inst : ] {a : R} {b : R} (hab : a b) (c : R) :
c * a * star c c * b * star c
class StarModule (R : Type u) (A : Type v) [inst : Star R] [inst : Star A] [inst : SMul R A] :
• star commutes with scalar multiplication

star_smul : ∀ (r : R) (a : A), star (r a) = star r 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] [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.

Instances
instance StarSemigroup.to_starModule {R : Type u} [inst : ] [inst : ] :

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

Equations

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)) [inst : Star R] [inst : Star S] extends :
Type (max(maxu_1u_2)u_3)
• the maps preserve star

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

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

Instances

### Instances #

Equations
@[simp]
theorem Units.coe_star {R : Type u} [inst : ] [inst : ] (u : Rˣ) :
↑(star u) = star u
@[simp]
theorem Units.coe_star_inv {R : Type u} [inst : ] [inst : ] (u : Rˣ) :
(star u)⁻¹ = star u⁻¹
Equations
• One or more equations did not get rendered due to their size.
theorem IsUnit.star {R : Type u} [inst : ] [inst : ] {a : R} :
IsUnit (star a)
@[simp]
theorem isUnit_star {R : Type u} [inst : ] [inst : ] {a : R} :
theorem Ring.inverse_star {R : Type u} [inst : ] [inst : ] (a : R) :
instance Invertible.star {R : Type u_1} [inst : ] [inst : ] (r : R) [inst : ] :
Equations
• = { invOf := , invOf_mul_self := (_ : * star r = 1), mul_invOf_self := (_ : star r * = 1) }
theorem star_invOf {R : Type u_1} [inst : ] [inst : ] (r : R) [inst : ] [inst : Invertible (star r)] :
= (star r)
instance MulOpposite.instStarMulOpposite {R : Type u} [inst : Star R] :

The opposite type carries the same star operation.

Equations
• MulOpposite.instStarMulOpposite = { star := fun r => { unop := star r.unop } }
@[simp]
theorem MulOpposite.unop_star {R : Type u} [inst : Star R] (r : Rᵐᵒᵖ) :
(star r).unop = star r.unop
@[simp]
theorem MulOpposite.op_star {R : Type u} [inst : Star R] (r : R) :
{ unop := star r } = star { unop := r }
instance MulOpposite.instInvolutiveStarMulOpposite {R : Type u} [inst : ] :
Equations
Equations
Equations
Equations
instance StarSemigroup.toOpposite_starModule {R : Type u} [inst : ] [inst : ] :

A commutative star monoid is a star module over its opposite via Monoid.toOppositeMulAction.

Equations