File tree 2 files changed +51
-0
lines changed
src/Data/List/Relation/Binary/Equality/Setoid
2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ New modules
89
89
Algebra.Module.Bundles.Raw
90
90
```
91
91
92
+ * Properties of ` List ` modulo ` Setoid ` equality (currently only the ([ ] ,++) monoid):
93
+ ```
94
+ Data.List.Relation.Binary.Equality.Setoid.Properties
95
+ ```
96
+
92
97
* Prime factorisation of natural numbers.
93
98
```
94
99
Data.Nat.Primality.Factorisation
Original file line number Diff line number Diff line change
1
+ ------------------------------------------------------------------------
2
+ -- The Agda standard library
3
+ --
4
+ -- Properties of List modulo ≋
5
+ ------------------------------------------------------------------------
6
+
7
+ {-# OPTIONS --cubical-compatible --safe #-}
8
+
9
+ open import Relation.Binary.Bundles using (Setoid)
10
+
11
+ module Data.List.Relation.Binary.Equality.Setoid.Properties
12
+ {c ℓ} (S : Setoid c ℓ)
13
+ where
14
+
15
+ open import Algebra.Bundles using (Monoid)
16
+ open import Algebra.Structures using (IsMonoid)
17
+ open import Data.List.Base using (List; []; _++_)
18
+ import Data.List.Properties as List
19
+ import Data.List.Relation.Binary.Equality.Setoid as ≋
20
+ open import Data.Product.Base using (_,_)
21
+ open import Function.Base using (_∘_)
22
+ open import Level using (_⊔_)
23
+
24
+ open ≋ S using (_≋_; ≋-refl; ≋-reflexive; ≋-isEquivalence; ++⁺)
25
+
26
+ ------------------------------------------------------------------------
27
+ -- The []-++-Monoid
28
+
29
+ -- Structure
30
+
31
+ isMonoid : IsMonoid _≋_ _++_ []
32
+ isMonoid = record
33
+ { isSemigroup = record
34
+ { isMagma = record
35
+ { isEquivalence = ≋-isEquivalence
36
+ ; ∙-cong = ++⁺
37
+ }
38
+ ; assoc = λ xs ys zs → ≋-reflexive (List.++-assoc xs ys zs)
39
+ }
40
+ ; identity = (λ _ → ≋-refl) , ≋-reflexive ∘ List.++-identityʳ
41
+ }
42
+
43
+ -- Bundle
44
+
45
+ monoid : Monoid c (c ⊔ ℓ)
46
+ monoid = record { isMonoid = isMonoid }
You can’t perform that action at this time.
0 commit comments