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.

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 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
    instance StarMemClass.instStar {R : Type u} {S : Type w} [Star R] [SetLike S R] [hS : StarMemClass S R] (s : S) :
    Star s
    Equations
      @[simp]
      theorem StarMemClass.coe_star {R : Type u} {S : Type w} [Star R] [SetLike S R] [hS : StarMemClass S R] (s : S) (x : s) :
      (star x) = star x
      class InvolutiveStar (R : Type u) extends Star R :

      Typeclass for a star operation with is involutive.

      Instances
        @[simp]
        theorem star_star {R : Type u} [InvolutiveStar R] (r : R) :
        star (star r) = r
        theorem star_mem_iff {R : Type u} {S : Type u_1} [SetLike S R] [InvolutiveStar R] [StarMemClass S R] {s : S} {x : R} :
        star x s x s
        theorem mem_of_star_mem {S : Type u_1} {R : Type u_2} [InvolutiveStar R] [SetLike S R] [StarMemClass S R] {s : S} {r : R} (hr : star r s) :
        r s
        @[simp]
        theorem star_inj {R : Type u} [InvolutiveStar R] {x y : R} :
        star x = star y x = y
        def Equiv.star {R : Type u} [InvolutiveStar R] :

        star as an equivalence when it is involutive.

        Equations
          Instances For
            theorem eq_star_of_eq_star {R : Type u} [InvolutiveStar R] {r s : R} (h : r = star s) :
            s = star r
            theorem eq_star_iff_eq_star {R : Type u} [InvolutiveStar R] {r s : R} :
            r = star s s = star r
            theorem star_eq_iff_star_eq {R : Type u} [InvolutiveStar 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
              class StarMul (R : Type u) [Mul R] extends InvolutiveStar R :

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

              Instances
                theorem star_star_mul {R : Type u} [Mul R] [StarMul R] (x y : R) :
                star (star x * y) = star y * x
                theorem star_mul_star {R : Type u} [Mul R] [StarMul R] (x y : R) :
                star (x * star y) = y * star x
                @[simp]
                theorem semiconjBy_star_star_star {R : Type u} [Mul R] [StarMul R] {x y z : R} :
                theorem SemiconjBy.star_star_star {R : Type u} [Mul R] [StarMul R] {x y 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] [StarMul R] {x y : R} :
                theorem Commute.star_star {R : Type u} [Mul R] [StarMul R] {x 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] [StarMul R] {x y : R} :
                theorem Commute.star_right {R : Type u} [Mul R] [StarMul R] {x y : R} :
                Commute (star x) yCommute x (star y)

                Alias of the forward direction of commute_star_comm.

                theorem Commute.star_left {R : Type u} [Mul R] [StarMul R] {x y : R} :
                Commute x (star y)Commute (star x) y

                Alias of the reverse direction of commute_star_comm.

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

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

                def starMulEquiv {R : Type u} [Mul R] [StarMul R] :

                star as a MulEquiv from R to Rᵐᵒᵖ

                Equations
                  Instances For
                    @[simp]
                    theorem starMulEquiv_apply {R : Type u} [Mul R] [StarMul R] (x : R) :
                    def starMulAut {R : Type u} [CommSemigroup R] [StarMul R] :

                    star as a MulAut for commutative R.

                    Equations
                      Instances For
                        @[simp]
                        theorem starMulAut_apply {R : Type u} [CommSemigroup R] [StarMul R] (a✝ : R) :
                        starMulAut a✝ = star a✝
                        @[simp]
                        theorem star_one (R : Type u) [MulOneClass R] [StarMul R] :
                        star 1 = 1
                        @[simp]
                        theorem Pi.star_mulSingle {ι : Type u_1} {R : ιType u_2} [DecidableEq ι] [(i : ι) → MulOneClass (R i)] [(i : ι) → StarMul (R i)] (i : ι) (r : R i) :
                        @[simp]
                        theorem star_pow {R : Type u} [Monoid R] [StarMul R] (x : R) (n : ) :
                        star (x ^ n) = star x ^ n
                        @[simp]
                        theorem star_inv {R : Type u} [Group R] [StarMul R] (x : R) :
                        @[simp]
                        theorem star_zpow {R : Type u} [Group R] [StarMul R] (x : R) (z : ) :
                        star (x ^ z) = star x ^ z
                        @[simp]
                        theorem star_div {R : Type u} [CommGroup R] [StarMul R] (x y : R) :
                        star (x / y) = star x / star y

                        When multiplication is commutative, star preserves division.

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

                        Any commutative monoid admits the trivial *-structure.

                        See note [reducible non-instances].

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

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

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

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

                            Instances
                              def starAddEquiv {R : Type u} [AddMonoid R] [StarAddMonoid R] :
                              R ≃+ R

                              star as an AddEquiv

                              Equations
                                Instances For
                                  @[simp]
                                  theorem starAddEquiv_apply {R : Type u} [AddMonoid R] [StarAddMonoid R] (a✝ : R) :
                                  starAddEquiv a✝ = star a✝
                                  @[simp]
                                  theorem star_zero (R : Type u) [AddMonoid R] [StarAddMonoid R] :
                                  star 0 = 0
                                  @[simp]
                                  theorem Pi.star_single {ι : Type u_1} {R : ιType u_2} [DecidableEq ι] [(i : ι) → AddMonoid (R i)] [(i : ι) → StarAddMonoid (R i)] (i : ι) (r : R i) :
                                  star (single i r) = single i (star r)
                                  @[simp]
                                  theorem star_eq_zero {R : Type u} [AddMonoid R] [StarAddMonoid R] {x : R} :
                                  star x = 0 x = 0
                                  theorem star_ne_zero {R : Type u} [AddMonoid R] [StarAddMonoid R] {x : R} :
                                  star x 0 x 0
                                  @[simp]
                                  theorem star_neg {R : Type u} [AddGroup R] [StarAddMonoid R] (r : R) :
                                  star (-r) = -star r
                                  @[simp]
                                  theorem star_sub {R : Type u} [AddGroup R] [StarAddMonoid R] (r s : R) :
                                  star (r - s) = star r - star s
                                  @[simp]
                                  theorem star_nsmul {R : Type u} [AddMonoid R] [StarAddMonoid R] (n : ) (x : R) :
                                  star (n x) = n star x
                                  @[simp]
                                  theorem star_zsmul {R : Type u} [AddGroup R] [StarAddMonoid R] (n : ) (x : R) :
                                  star (n x) = n star x
                                  class StarRing (R : Type u) [NonUnitalNonAssocSemiring R] extends StarMul R :

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

                                  Instances

                                    star as a RingEquiv from R to Rᵐᵒᵖ

                                    Equations
                                      Instances For
                                        @[simp]
                                        theorem star_natCast {R : Type u} [NonAssocSemiring R] [StarRing R] (n : ) :
                                        star n = n
                                        @[simp]
                                        theorem star_intCast {R : Type u} [NonAssocRing R] [StarRing R] (z : ) :
                                        star z = z

                                        star as a ring automorphism, for commutative R.

                                        Equations
                                          Instances For
                                            @[simp]
                                            theorem starRingAut_apply {R : Type u} [CommSemiring R] [StarRing R] (a✝ : R) :
                                            starRingAut a✝ = star a✝
                                            def starRingEnd (R : Type u) [CommSemiring R] [StarRing R] :
                                            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 scope 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

                                                star as a ring endomorphism, for commutative R. This is used to denote complex conjugation, and is available under the notation conj in the scope 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} [CommSemiring R] [StarRing R] (x : R) :

                                                    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 RingHom.star_apply {R : Type u} [CommSemiring R] [StarRing R] {S : Type u_1} [NonAssocSemiring S] (f : S →+* R) (s : S) :
                                                    (star f) s = star (f s)
                                                    @[simp]
                                                    theorem conj_trivial {R : Type u} [CommSemiring R] [StarRing R] [TrivialStar R] (a : R) :
                                                    (starRingEnd R) a = a
                                                    @[simp]
                                                    theorem star_inv₀ {R : Type u} [GroupWithZero R] [StarMul R] (x : R) :
                                                    @[simp]
                                                    theorem star_zpow₀ {R : Type u} [GroupWithZero R] [StarMul R] (x : R) (z : ) :
                                                    star (x ^ z) = star x ^ z
                                                    @[simp]
                                                    theorem star_div₀ {R : Type u} [CommGroupWithZero R] [StarMul R] (x y : R) :
                                                    star (x / y) = star x / star y

                                                    When multiplication is commutative, star preserves division.

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

                                                    Any commutative semiring admits the trivial *-structure.

                                                    See note [reducible non-instances].

                                                    Equations
                                                      Instances For
                                                        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 additive 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 StarMul.toStarModule {R : Type u} [CommMonoid R] [StarMul R] :

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

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

                                                          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

                                                            Instances #

                                                            instance Units.instStarMul {R : Type u} [Monoid R] [StarMul R] :
                                                            Equations
                                                              @[simp]
                                                              theorem Units.coe_star {R : Type u} [Monoid R] [StarMul R] (u : Rˣ) :
                                                              (star u) = star u
                                                              @[simp]
                                                              theorem Units.coe_star_inv {R : Type u} [Monoid R] [StarMul R] (u : Rˣ) :
                                                              (star u)⁻¹ = star u⁻¹
                                                              instance Units.instStarModule {R : Type u} [Monoid R] [StarMul R] {A : Type u_1} [Star A] [SMul R A] [StarModule R A] :
                                                              theorem IsUnit.star {R : Type u} [Monoid R] [StarMul R] {a : R} :
                                                              IsUnit aIsUnit (star a)
                                                              @[simp]
                                                              theorem isUnit_star {R : Type u} [Monoid R] [StarMul R] {a : R} :
                                                              instance Invertible.star {R : Type u_1} [MulOneClass R] [StarMul R] (r : R) [Invertible r] :
                                                              Equations
                                                                theorem star_invOf {R : Type u_1} [Monoid R] [StarMul R] (r : R) [Invertible r] [Invertible (star r)] :
                                                                theorem IsRegular.star {R : Type u} [Mul R] [StarMul R] {x : R} (hx : IsRegular x) :
                                                                @[simp]
                                                                theorem isRegular_star_iff {R : Type u} [Mul R] [StarMul R] {x : R} :

                                                                The opposite type carries the same star operation.

                                                                Equations
                                                                  @[simp]
                                                                  theorem MulOpposite.unop_star {R : Type u} [Star R] (r : Rᵐᵒᵖ) :
                                                                  unop (star r) = star (unop r)
                                                                  @[simp]
                                                                  theorem MulOpposite.op_star {R : Type u} [Star R] (r : R) :
                                                                  op (star r) = star (op r)

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