Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 99bd01e

Browse files
committedFeb 3, 2024
[fix agda#2273] Add NNO-related modules
1 parent 5dc1cb9 commit 99bd01e

File tree

4 files changed

+105
-3
lines changed

4 files changed

+105
-3
lines changed
 

‎CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ New modules
4646
Additions to existing modules
4747
-----------------------------
4848

49+
* In `Algebra.Bundles`
50+
```agda
51+
record NNO c ℓ : Set (suc (c ⊔ ℓ))
52+
```
53+
54+
* In `Algebra.Bundles.Raw`
55+
```agda
56+
record RawNNO c ℓ : Set (suc (c ⊔ ℓ))
57+
```
58+
4959
* In `Algebra.Module.Bundles`, raw bundles are re-exported and the bundles expose their raw counterparts.
5060

5161
* In `Algebra.Module.Construct.DirectProduct`:
@@ -84,6 +94,19 @@ Additions to existing modules
8494
rawModule : RawModule R c ℓ
8595
```
8696

97+
* In `Algebra.Morphism.Structures`
98+
```agda
99+
module NNOMorphisms (N₁ : RawNNO a ℓ₁) (N₂ : RawNNO b ℓ₂) where
100+
record IsNNOHomomorphism (⟦_⟧ : N₁.Carrier → N₂.Carrier) : Set _
101+
record IsNNOMonomorphism (⟦_⟧ : N₁.Carrier → N₂.Carrier) : Set _
102+
record IsNNOIsomorphism (⟦_⟧ : N₁.Carrier → N₂.Carrier) : Set _
103+
```
104+
105+
* In `Algebra.Structures`
106+
```agda
107+
record IsNNO (+1# : Op₁ A) (0# : A) : Set _
108+
```
109+
87110
* In `Data.Fin.Properties`:
88111
```agda
89112
nonZeroIndex : Fin n → ℕ.NonZero n

‎src/Algebra/Bundles.agda

+22-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,32 @@ open import Level
2323
-- Re-export definitions of 'raw' bundles
2424

2525
open Raw public
26-
using (RawMagma; RawMonoid; RawGroup
26+
using ( RawNNO; RawMagma; RawMonoid; RawGroup
2727
; RawNearSemiring; RawSemiring
2828
; RawRingWithoutOne; RawRing
2929
; RawQuasigroup; RawLoop; RawKleeneAlgebra)
3030

31+
------------------------------------------------------------------------
32+
-- Bundles with 1 unary operation & 1 element
33+
------------------------------------------------------------------------
34+
35+
record NNO c ℓ : Set (suc (c ⊔ ℓ)) where
36+
infix 8 _+1#
37+
infix 4 _≈_
38+
field
39+
Carrier : Set c
40+
_≈_ : Rel Carrier ℓ
41+
_+1# : Op₁ Carrier
42+
0# : Carrier
43+
isNNO : IsNNO _≈_ _+1# 0#
44+
45+
open IsNNO isNNO public
46+
47+
rawNNO : RawNNO _ _
48+
rawNNO = record { _≈_ = _≈_; _+1# = _+1#; 0# = 0# }
49+
50+
open RawNNO rawNNO public
51+
3152
------------------------------------------------------------------------
3253
-- Bundles with 1 binary operation
3354
------------------------------------------------------------------------

‎src/Algebra/Morphism/Structures.agda

+46-2
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,65 @@
66

77
{-# OPTIONS --cubical-compatible --safe #-}
88

9-
open import Relation.Binary.Core
10-
119
module Algebra.Morphism.Structures where
1210

1311
open import Algebra.Core
1412
open import Algebra.Bundles
1513
import Algebra.Morphism.Definitions as MorphismDefinitions
1614
open import Level using (Level; _⊔_)
1715
open import Function.Definitions
16+
open import Relation.Binary.Core
1817
open import Relation.Binary.Morphism.Structures
1918

2019
private
2120
variable
2221
a b ℓ₁ ℓ₂ : Level
2322

23+
------------------------------------------------------------------------
24+
-- Morphisms over NNO-like structures
25+
------------------------------------------------------------------------
26+
27+
module NNOMorphisms (N₁ : RawNNO a ℓ₁) (N₂ : RawNNO b ℓ₂) where
28+
29+
open RawNNO N₁ renaming (Carrier to A; _≈_ to _≈₁_; _+1# to _+1#₁; 0# to 0#₁)
30+
open RawNNO N₂ renaming (Carrier to B; _≈_ to _≈₂_; _+1# to _+1#₂; 0# to 0#₂)
31+
open MorphismDefinitions A B _≈₂_
32+
33+
34+
record IsNNOHomomorphism (⟦_⟧ : A B) : Set (a ⊔ ℓ₁ ⊔ ℓ₂) where
35+
field
36+
isRelHomomorphism : IsRelHomomorphism _≈₁_ _≈₂_ ⟦_⟧
37+
+1#-homo : Homomorphic₁ ⟦_⟧ _+1#₁ _+1#₂
38+
0#-homo : Homomorphic₀ ⟦_⟧ 0#₁ 0#₂
39+
40+
record IsNNOMonomorphism (⟦_⟧ : A B) : Set (a ⊔ ℓ₁ ⊔ ℓ₂) where
41+
field
42+
isNNOHomomorphism : IsNNOHomomorphism ⟦_⟧
43+
injective : Injective _≈₁_ _≈₂_ ⟦_⟧
44+
45+
open IsNNOHomomorphism isNNOHomomorphism public
46+
47+
isRelMonomorphism : IsRelMonomorphism _≈₁_ _≈₂_ ⟦_⟧
48+
isRelMonomorphism = record
49+
{ isHomomorphism = isRelHomomorphism
50+
; injective = injective
51+
}
52+
53+
54+
record IsNNOIsomorphism (⟦_⟧ : A B) : Set (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂) where
55+
field
56+
isNNOMonomorphism : IsNNOMonomorphism ⟦_⟧
57+
surjective : Surjective _≈₁_ _≈₂_ ⟦_⟧
58+
59+
open IsNNOMonomorphism isNNOMonomorphism public
60+
61+
isRelIsomorphism : IsRelIsomorphism _≈₁_ _≈₂_ ⟦_⟧
62+
isRelIsomorphism = record
63+
{ isMonomorphism = isRelMonomorphism
64+
; surjective = surjective
65+
}
66+
67+
2468
------------------------------------------------------------------------
2569
-- Morphisms over magma-like structures
2670
------------------------------------------------------------------------

‎src/Algebra/Structures.agda

+14
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ import Algebra.Consequences.Setoid as Consequences
2727
open import Data.Product.Base using (_,_; proj₁; proj₂)
2828
open import Level using (_⊔_)
2929

30+
------------------------------------------------------------------------
31+
-- Structures with 1 unary operation & 1 element
32+
------------------------------------------------------------------------
33+
34+
record IsNNO (+1# : Op₁ A) (0# : A) : Set (a ⊔ ℓ) where
35+
field
36+
isEquivalence : IsEquivalence _≈_
37+
+1#-cong : Congruent₁ +1#
38+
39+
open IsEquivalence isEquivalence public
40+
41+
setoid : Setoid a ℓ
42+
setoid = record { isEquivalence = isEquivalence }
43+
3044
------------------------------------------------------------------------
3145
-- Structures with 1 binary operation
3246
------------------------------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.