@@ -61,6 +61,16 @@ rawSemiring R S = record
6161 ; 1# = R.1# , S.1#
6262 } where module R = RawSemiring R; module S = RawSemiring S
6363
64+ rawRingWithoutOne : RawRingWithoutOne a ℓ₁ → RawRingWithoutOne b ℓ₂ → RawRingWithoutOne (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
65+ rawRingWithoutOne R S = record
66+ { Carrier = R.Carrier × S.Carrier
67+ ; _≈_ = Pointwise R._≈_ S._≈_
68+ ; _+_ = zip R._+_ S._+_
69+ ; _*_ = zip R._*_ S._*_
70+ ; -_ = map R.-_ S.-_
71+ ; 0# = R.0# , S.0#
72+ } where module R = RawRingWithoutOne R; module S = RawRingWithoutOne S
73+
6474rawRing : RawRing a ℓ₁ → RawRing b ℓ₂ → RawRing (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
6575rawRing R S = record
6676 { Carrier = R.Carrier × S.Carrier
@@ -317,6 +327,59 @@ kleeneAlgebra K L = record
317327 }
318328 } where module K = KleeneAlgebra K; module L = KleeneAlgebra L
319329
330+ ringWithoutOne : RingWithoutOne a ℓ₁ → RingWithoutOne b ℓ₂ → RingWithoutOne (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
331+ ringWithoutOne R S = record
332+ { isRingWithoutOne = record
333+ { +-isAbelianGroup = AbelianGroup.isAbelianGroup ((abelianGroup R.+-abelianGroup S.+-abelianGroup))
334+ ; *-cong = Semigroup.∙-cong (semigroup R.*-semigroup S.*-semigroup)
335+ ; *-assoc = Semigroup.assoc (semigroup R.*-semigroup S.*-semigroup)
336+ ; distrib = (λ x y z → (R.distribˡ , S.distribˡ) <*> x <*> y <*> z)
337+ , (λ x y z → (R.distribʳ , S.distribʳ) <*> x <*> y <*> z)
338+ ; zero = uncurry (λ x y → R.zeroˡ x , S.zeroˡ y)
339+ , uncurry (λ x y → R.zeroʳ x , S.zeroʳ y)
340+ }
341+
342+ } where module R = RingWithoutOne R; module S = RingWithoutOne S
343+
344+ nonAssociativeRing : NonAssociativeRing a ℓ₁ → NonAssociativeRing b ℓ₂ → NonAssociativeRing (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
345+ nonAssociativeRing R S = record
346+ { isNonAssociativeRing = record
347+ { +-isAbelianGroup = AbelianGroup.isAbelianGroup ((abelianGroup R.+-abelianGroup S.+-abelianGroup))
348+ ; *-cong = UnitalMagma.∙-cong (unitalMagma R.*-unitalMagma S.*-unitalMagma)
349+ ; *-identity = UnitalMagma.identity (unitalMagma R.*-unitalMagma S.*-unitalMagma)
350+ ; distrib = (λ x y z → (R.distribˡ , S.distribˡ) <*> x <*> y <*> z)
351+ , (λ x y z → (R.distribʳ , S.distribʳ) <*> x <*> y <*> z)
352+ ; zero = uncurry (λ x y → R.zeroˡ x , S.zeroˡ y)
353+ , uncurry (λ x y → R.zeroʳ x , S.zeroʳ y)
354+ }
355+
356+ } where module R = NonAssociativeRing R; module S = NonAssociativeRing S
357+
358+ quasiring : Quasiring a ℓ₁ → Quasiring b ℓ₂ → Quasiring (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
359+ quasiring R S = record
360+ { isQuasiring = record
361+ { +-isMonoid = Monoid.isMonoid ((monoid R.+-monoid S.+-monoid))
362+ ; *-cong = Monoid.∙-cong (monoid R.*-monoid S.*-monoid)
363+ ; *-assoc = Monoid.assoc (monoid R.*-monoid S.*-monoid)
364+ ; *-identity = Monoid.identity ((monoid R.*-monoid S.*-monoid))
365+ ; distrib = (λ x y z → (R.distribˡ , S.distribˡ) <*> x <*> y <*> z)
366+ , (λ x y z → (R.distribʳ , S.distribʳ) <*> x <*> y <*> z)
367+ ; zero = uncurry (λ x y → R.zeroˡ x , S.zeroˡ y)
368+ , uncurry (λ x y → R.zeroʳ x , S.zeroʳ y)
369+ }
370+
371+ } where module R = Quasiring R; module S = Quasiring S
372+
373+ nearring : Nearring a ℓ₁ → Nearring b ℓ₂ → Nearring (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
374+ nearring R S = record
375+ { isNearring = record
376+ { isQuasiring = Quasiring.isQuasiring (quasiring R.quasiring S.quasiring)
377+ ; +-inverse = (λ x → (R.+-inverseˡ , S.+-inverseˡ) <*> x)
378+ , (λ x → (R.+-inverseʳ , S.+-inverseʳ) <*> x)
379+ ; ⁻¹-cong = map R.⁻¹-cong S.⁻¹-cong
380+ }
381+ } where module R = Nearring R; module S = Nearring S
382+
320383ring : Ring a ℓ₁ → Ring b ℓ₂ → Ring (a ⊔ b) (ℓ₁ ⊔ ℓ₂)
321384ring R S = record
322385 { -_ = uncurry (λ x y → R.-_ x , S.-_ y)
0 commit comments