Skip to content

Commit 3f6bdbb

Browse files
committed
add: (Is)IntegralSemiring
1 parent 37c11d5 commit 3f6bdbb

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ New modules
5757
Additions to existing modules
5858
-----------------------------
5959

60+
* In `Algebra.Bundles`:
61+
```agda
62+
IntegralSemiring : (c ℓ : Level) → Set _
63+
```
64+
6065
* In `Algebra.Consequences.Base`:
6166
```agda
6267
integral⇒noZeroDivisors : Integral _≈_ 1# 0# _•_ → ¬ (1# ≈ 0#) →
@@ -98,3 +103,8 @@ Additions to existing modules
98103
Integral : A → A → Op₂ A → Set _
99104
```
100105
(see [discussion on issue #2554](https://github.com/agda/agda-stdlib/issues/2554))
106+
107+
* In `Algebra.Structures`:
108+
```agda
109+
IsIntegralSemiring : (+ * : Op₂ A) (0# 1# : A) → Set _
110+
```

src/Algebra/Bundles.agda

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,36 @@ record IdempotentSemiring c ℓ : Set (suc (c ⊔ ℓ)) where
841841
; idempotentMonoid to +-idempotentMonoid
842842
)
843843

844+
record IntegralSemiring c ℓ : Set (suc (c ⊔ ℓ)) where
845+
infixl 7 _*_
846+
infixl 6 _+_
847+
infix 4 _≈_
848+
field
849+
Carrier : Set c
850+
_≈_ : Rel Carrier ℓ
851+
_+_ : Op₂ Carrier
852+
_*_ : Op₂ Carrier
853+
0# : Carrier
854+
1# : Carrier
855+
isIntegralSemiring : IsIntegralSemiring _≈_ _+_ _*_ 0# 1#
856+
857+
open IsIntegralSemiring isIntegralSemiring public
858+
859+
semiring : Semiring _ _
860+
semiring = record { isSemiring = isSemiring }
861+
862+
open Semiring semiring public
863+
using
864+
( _≉_; +-rawMagma; +-magma; +-unitalMagma; +-commutativeMagma
865+
; +-semigroup; +-commutativeSemigroup
866+
; *-rawMagma; *-magma; *-semigroup
867+
; +-rawMonoid; +-monoid; +-commutativeMonoid
868+
; *-rawMonoid; *-monoid
869+
; nearSemiring; semiringWithoutOne
870+
; semiringWithoutAnnihilatingZero
871+
; rawSemiring
872+
)
873+
844874
record KleeneAlgebra c ℓ : Set (suc (c ⊔ ℓ)) where
845875
infix 8 _⋆
846876
infixl 7 _*_

src/Algebra/Structures.agda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,14 @@ record IsSemiring (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where
582582
)
583583

584584

585+
record IsIntegralSemiring (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where
586+
field
587+
isSemiring : IsSemiring + * 0# 1#
588+
integral : Integral 1# 0# *
589+
590+
open IsSemiring isSemiring public
591+
592+
585593
record IsCommutativeSemiring (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where
586594
field
587595
isSemiring : IsSemiring + * 0# 1#

0 commit comments

Comments
 (0)