@@ -25,7 +25,7 @@ For now we simply do not introduce notations,
2525as different users are expected to feel strongly about the relative merits of
2626`r^*`, `r†`, `rᘁ`, and so on.
2727
28- Our star rings are actually star semirings, but of course we can prove
28+ Our star rings are actually star non-unital, non-associative, semirings, but of course we can prove
2929`star_neg : star (-r) = - star r` when the underlying semiring is a ring.
3030-/
3131
@@ -121,21 +121,21 @@ export TrivialStar (star_trivial)
121121
122122attribute [simp] star_trivial
123123
124- /-- A `*`-semigroup is a semigroup `R` with an involutive operation `star`
124+ /-- A `*`-magma is a magma `R` with an involutive operation `star`
125125such that `star (r * s) = star s * star r`.
126126-/
127- class StarSemigroup (R : Type u) [Semigroup R] extends InvolutiveStar R where
127+ class StarMul (R : Type u) [Mul R] extends InvolutiveStar R where
128128 /-- `star` skew-distributes over multiplication. -/
129129 star_mul : ∀ r s : R, star (r * s) = star s * star r
130- #align star_semigroup StarSemigroup
130+ #align star_semigroup StarMul
131131
132- export StarSemigroup (star_mul)
132+ export StarMul (star_mul)
133133
134134attribute [simp 900 ] star_mul
135135
136- section StarSemigroup
136+ section StarMul
137137
138- variable [Semigroup R] [StarSemigroup R]
138+ variable [Mul R] [StarMul R]
139139
140140theorem star_star_mul (x y : R) : star (star x * y) = star y * x := by rw [star_mul, star_star]
141141#align star_star_mul star_star_mul
@@ -164,17 +164,17 @@ theorem commute_star_comm {x y : R} : Commute (star x) y ↔ Commute x (star y)
164164 rw [← commute_star_star, star_star]
165165#align commute_star_comm commute_star_comm
166166
167- end StarSemigroup
167+ end StarMul
168168
169169/-- In a commutative ring, make `simp` prefer leaving the order unchanged. -/
170170@[simp]
171- theorem star_mul' [CommSemigroup R] [StarSemigroup R] (x y : R) : star (x * y) = star x * star y :=
171+ theorem star_mul' [CommSemigroup R] [StarMul R] (x y : R) : star (x * y) = star x * star y :=
172172 (star_mul x y).trans (mul_comm _ _)
173173#align star_mul' star_mul'
174174
175175/-- `star` as a `MulEquiv` from `R` to `Rᵐᵒᵖ` -/
176176@ [simps apply]
177- def starMulEquiv [Semigroup R] [StarSemigroup R] : R ≃* Rᵐᵒᵖ :=
177+ def starMulEquiv [Mul R] [StarMul R] : R ≃* Rᵐᵒᵖ :=
178178 { (InvolutiveStar.star_involutive.toPerm star).trans opEquiv with
179179 toFun := fun x => MulOpposite.op (star x)
180180 map_mul' := fun x y => by simp only [star_mul, op_mul] }
@@ -183,7 +183,7 @@ def starMulEquiv [Semigroup R] [StarSemigroup R] : R ≃* Rᵐᵒᵖ :=
183183
184184/-- `star` as a `MulAut` for commutative `R`. -/
185185@ [simps apply]
186- def starMulAut [CommSemigroup R] [StarSemigroup R] : MulAut R :=
186+ def starMulAut [CommSemigroup R] [StarMul R] : MulAut R :=
187187 { InvolutiveStar.star_involutive.toPerm star with
188188 toFun := star
189189 map_mul' := star_mul' }
@@ -193,32 +193,32 @@ def starMulAut [CommSemigroup R] [StarSemigroup R] : MulAut R :=
193193variable (R)
194194
195195@[simp]
196- theorem star_one [Monoid R] [StarSemigroup R] : star (1 : R) = 1 :=
196+ theorem star_one [MulOneClass R] [StarMul R] : star (1 : R) = 1 :=
197197 op_injective <| (starMulEquiv : R ≃* Rᵐᵒᵖ).map_one.trans (op_one _).symm
198198#align star_one star_one
199199
200200variable {R}
201201
202202@[simp]
203- theorem star_pow [Monoid R] [StarSemigroup R] (x : R) (n : ℕ) : star (x ^ n) = star x ^ n :=
203+ theorem star_pow [Monoid R] [StarMul R] (x : R) (n : ℕ) : star (x ^ n) = star x ^ n :=
204204 op_injective <|
205205 ((starMulEquiv : R ≃* Rᵐᵒᵖ).toMonoidHom.map_pow x n).trans (op_pow (star x) n).symm
206206#align star_pow star_pow
207207
208208@[simp]
209- theorem star_inv [Group R] [StarSemigroup R] (x : R) : star x⁻¹ = (star x)⁻¹ :=
209+ theorem star_inv [Group R] [StarMul R] (x : R) : star x⁻¹ = (star x)⁻¹ :=
210210 op_injective <| ((starMulEquiv : R ≃* Rᵐᵒᵖ).toMonoidHom.map_inv x).trans (op_inv (star x)).symm
211211#align star_inv star_inv
212212
213213@[simp]
214- theorem star_zpow [Group R] [StarSemigroup R] (x : R) (z : ℤ) : star (x ^ z) = star x ^ z :=
214+ theorem star_zpow [Group R] [StarMul R] (x : R) (z : ℤ) : star (x ^ z) = star x ^ z :=
215215 op_injective <|
216216 ((starMulEquiv : R ≃* Rᵐᵒᵖ).toMonoidHom.map_zpow x z).trans (op_zpow (star x) z).symm
217217#align star_zpow star_zpow
218218
219219/-- When multiplication is commutative, `star` preserves division. -/
220220@[simp]
221- theorem star_div [CommGroup R] [StarSemigroup R] (x y : R) : star (x / y) = star x / star y :=
221+ theorem star_div [CommGroup R] [StarMul R] (x y : R) : star (x / y) = star x / star y :=
222222 map_div (starMulAut : R ≃* R) _ _
223223#align star_div star_div
224224
@@ -227,17 +227,17 @@ theorem star_div [CommGroup R] [StarSemigroup R] (x y : R) : star (x / y) = star
227227See note [reducible non-instances].
228228-/
229229@[reducible]
230- def starSemigroupOfComm {R : Type *} [CommMonoid R] : StarSemigroup R where
230+ def starMulOfComm {R : Type *} [CommMonoid R] : StarMul R where
231231 star := id
232232 star_involutive _ := rfl
233233 star_mul := mul_comm
234- #align star_semigroup_of_comm starSemigroupOfComm
234+ #align star_semigroup_of_comm starMulOfComm
235235
236236section
237237
238- attribute [local instance ] starSemigroupOfComm
238+ attribute [local instance ] starMulOfComm
239239
240- /-- Note that since `starSemigroupOfComm ` is reducible, `simp` can already prove this. -/
240+ /-- Note that since `starMulOfComm ` is reducible, `simp` can already prove this. -/
241241theorem star_id_of_comm {R : Type *} [CommSemiring R] {x : R} : star x = x :=
242242 rfl
243243#align star_id_of_comm star_id_of_comm
@@ -302,35 +302,35 @@ theorem star_zsmul [AddGroup R] [StarAddMonoid R] (x : R) (n : ℤ) : star (n
302302 (starAddEquiv : R ≃+ R).toAddMonoidHom.map_zsmul _ _
303303#align star_zsmul star_zsmul
304304
305- /-- A `*`-ring `R` is a (semi)ring with an involutive `star` operation which is additive
306- which makes `R` with its multiplicative structure into a `*`-semigroup
305+ /-- A `*`-ring `R` is a non-unital, non-associative (semi)ring with an involutive `star` operation
306+ which is additive which makes `R` with its multiplicative structure into a `*`-multiplication
307307(i.e. `star (r * s) = star s * star r`). -/
308- class StarRing (R : Type u) [NonUnitalSemiring R] extends StarSemigroup R where
308+ class StarRing (R : Type u) [NonUnitalNonAssocSemiring R] extends StarMul R where
309309 /-- `star` commutes with addition -/
310310 star_add : ∀ r s : R, star (r + s) = star r + star s
311311#align star_ring StarRing
312312
313- instance (priority := 100 ) StarRing.toStarAddMonoid [NonUnitalSemiring R] [StarRing R] :
313+ instance (priority := 100 ) StarRing.toStarAddMonoid [NonUnitalNonAssocSemiring R] [StarRing R] :
314314 StarAddMonoid R where
315315 star_add := StarRing.star_add
316316#align star_ring.to_star_add_monoid StarRing.toStarAddMonoid
317317
318318/-- `star` as a `RingEquiv` from `R` to `Rᵐᵒᵖ` -/
319319@ [simps apply]
320- def starRingEquiv [NonUnitalSemiring R] [StarRing R] : R ≃+* Rᵐᵒᵖ :=
320+ def starRingEquiv [NonUnitalNonAssocSemiring R] [StarRing R] : R ≃+* Rᵐᵒᵖ :=
321321 { starAddEquiv.trans (MulOpposite.opAddEquiv : R ≃+ Rᵐᵒᵖ), starMulEquiv with
322322 toFun := fun x => MulOpposite.op (star x) }
323323#align star_ring_equiv starRingEquiv
324324#align star_ring_equiv_apply starRingEquiv_apply
325325
326326@ [simp, norm_cast]
327- theorem star_natCast [Semiring R] [StarRing R] (n : ℕ) : star (n : R) = n :=
327+ theorem star_natCast [NonAssocSemiring R] [StarRing R] (n : ℕ) : star (n : R) = n :=
328328 (congr_arg unop (map_natCast (starRingEquiv : R ≃+* Rᵐᵒᵖ) n)).trans (unop_natCast _)
329329#align star_nat_cast star_natCast
330330
331331--Porting note: new theorem
332332@[simp]
333- theorem star_ofNat [Semiring R] [StarRing R] (n : ℕ) [n.AtLeastTwo] :
333+ theorem star_ofNat [NonAssocSemiring R] [StarRing R] (n : ℕ) [n.AtLeastTwo] :
334334 star (no_index (OfNat.ofNat n) : R) = OfNat.ofNat n :=
335335 star_natCast _
336336
@@ -459,7 +459,7 @@ See note [reducible non-instances].
459459-/
460460@[reducible]
461461def starRingOfComm {R : Type *} [CommSemiring R] : StarRing R :=
462- { starSemigroupOfComm with
462+ { starMulOfComm with
463463 star := id
464464 star_add := fun _ _ => rfl }
465465#align star_ring_of_comm starRingOfComm
@@ -486,7 +486,7 @@ export StarModule (star_smul)
486486attribute [simp] star_smul
487487
488488/-- A commutative star monoid is a star module over itself via `Monoid.toMulAction`. -/
489- instance StarSemigroup.to_starModule [CommMonoid R] [StarSemigroup R] : StarModule R R :=
489+ instance StarSemigroup.to_starModule [CommMonoid R] [StarMul R] : StarModule R R :=
490490 ⟨star_mul'⟩
491491#align star_semigroup.to_star_module StarSemigroup.to_starModule
492492
517517
518518namespace Units
519519
520- variable [Monoid R] [StarSemigroup R]
520+ variable [Monoid R] [StarMul R]
521521
522- instance : StarSemigroup Rˣ where
522+ instance : StarMul Rˣ where
523523 star u :=
524524 { val := star u
525525 inv := star ↑u⁻¹
@@ -543,12 +543,12 @@ instance {A : Type*} [Star A] [SMul R A] [StarModule R A] : StarModule Rˣ A :=
543543
544544end Units
545545
546- theorem IsUnit.star [Monoid R] [StarSemigroup R] {a : R} : IsUnit a → IsUnit (star a)
546+ theorem IsUnit.star [Monoid R] [StarMul R] {a : R} : IsUnit a → IsUnit (star a)
547547 | ⟨u, hu⟩ => ⟨Star.star u, hu ▸ rfl⟩
548548#align is_unit.star IsUnit.star
549549
550550@[simp]
551- theorem isUnit_star [Monoid R] [StarSemigroup R] {a : R} : IsUnit (star a) ↔ IsUnit a :=
551+ theorem isUnit_star [Monoid R] [StarMul R] {a : R} : IsUnit (star a) ↔ IsUnit a :=
552552 ⟨fun h => star_star a ▸ h.star, IsUnit.star⟩
553553#align is_unit_star isUnit_star
554554
@@ -560,14 +560,14 @@ theorem Ring.inverse_star [Semiring R] [StarRing R] (a : R) :
560560 rw [Ring.inverse_non_unit _ ha, Ring.inverse_non_unit _ (mt isUnit_star.mp ha), star_zero]
561561#align ring.inverse_star Ring.inverse_star
562562
563- instance Invertible.star {R : Type *} [Monoid R] [StarSemigroup R] (r : R) [Invertible r] :
563+ instance Invertible.star {R : Type *} [MulOneClass R] [StarMul R] (r : R) [Invertible r] :
564564 Invertible (star r) where
565565 invOf := Star.star (⅟ r)
566566 invOf_mul_self := by rw [← star_mul, mul_invOf_self, star_one]
567567 mul_invOf_self := by rw [← star_mul, invOf_mul_self, star_one]
568568#align invertible.star Invertible.star
569569
570- theorem star_invOf {R : Type *} [Monoid R] [StarSemigroup R] (r : R) [Invertible r]
570+ theorem star_invOf {R : Type *} [Monoid R] [StarMul R] (r : R) [Invertible r]
571571 [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
572572 have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
573573 simp only [mul_invOf_self, mul_one]
@@ -594,7 +594,7 @@ theorem op_star [Star R] (r : R) : op (star r) = star (op r) :=
594594instance [InvolutiveStar R] : InvolutiveStar Rᵐᵒᵖ where
595595 star_involutive r := unop_injective (star_star r.unop)
596596
597- instance [Monoid R] [StarSemigroup R] : StarSemigroup Rᵐᵒᵖ where
597+ instance [Mul R] [StarMul R] : StarMul Rᵐᵒᵖ where
598598 star_mul x y := unop_injective (star_mul y.unop x.unop)
599599
600600instance [AddMonoid R] [StarAddMonoid R] : StarAddMonoid Rᵐᵒᵖ where
@@ -607,7 +607,7 @@ end MulOpposite
607607
608608/-- A commutative star monoid is a star module over its opposite via
609609`Monoid.toOppositeMulAction`. -/
610- instance StarSemigroup.toOpposite_starModule [CommMonoid R] [StarSemigroup R] :
610+ instance StarSemigroup.toOpposite_starModule [CommMonoid R] [StarMul R] :
611611 StarModule Rᵐᵒᵖ R :=
612612 ⟨fun r s => star_mul' s r.unop⟩
613613#align star_semigroup.to_opposite_star_module StarSemigroup.toOpposite_starModule
0 commit comments