Skip to content

Commit 76b99a7

Browse files
author
Matthew Daggitt
committed
Added extra ordering relations to Data.Integer and improved compatability of Data.Integer.Properties with planned changes to Data.Integer
1 parent 9946556 commit 76b99a7

File tree

3 files changed

+116
-73
lines changed

3 files changed

+116
-73
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ Backwards compatible changes
235235
∩⇔× : x ∈ p ∩ q ⇔ (x ∈ p × x ∈ q)
236236
```
237237

238+
* Added relations to `Data.Integer`
239+
```agda
240+
_≥_ : Rel ℤ _
241+
_<_ : Rel ℤ _
242+
_>_ : Rel ℤ _
243+
_≰_ : Rel ℤ _
244+
_≱_ : Rel ℤ _
245+
_≮_ : Rel ℤ _
246+
_≯_ : Rel ℤ _
247+
```
248+
238249
* Added proofs to `Data.Integer.Properties`
239250
```agda
240251
+-injective : + m ≡ + n → m ≡ n
@@ -260,6 +271,7 @@ Backwards compatible changes
260271
+-inverse : Inverse (+ 0) -_ _+_
261272
+-0-isMonoid : IsMonoid _≡_ _+_ (+ 0)
262273
+-0-isGroup : IsGroup _≡_ _+_ (+ 0) (-_)
274+
+-0-abelianGroup : AbelianGroup _ _
263275
neg-distrib-+ : - (m + n) ≡ (- m) + (- n)
264276
◃-distrib-+ : s ◃ (m + n) ≡ (s ◃ m) + (s ◃ n)
265277

src/Data/Integer/Base.agda

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open import Relation.Binary.Core using (_≡_; refl)
1818
infix 8 -_
1919
infixl 7 _*_ _⊓_
2020
infixl 6 _+_ _-_ _⊖_ _⊔_
21-
infix 4 _≤_
21+
infix 4 _≤_ _≥_ _<_ _>_ _≰_ _≱_ _≮_ _≯_
2222

2323
------------------------------------------------------------------------
2424
-- The types
@@ -149,6 +149,27 @@ data _≤_ : ℤ → ℤ → Set where
149149
-≤- : {m n} (n≤m : n ℕ.≤ m) -[1+ m ] ≤ -[1+ n ]
150150
+≤+ : {m n} (m≤n : m ℕ.≤ n) + m ≤ + n
151151

152+
_≥_ : Rel ℤ _
153+
x ≥ y = y ≤ x
154+
155+
_<_ : Rel ℤ _
156+
x < y = suc x ≤ y
157+
158+
_>_ : Rel ℤ _
159+
x > y = y < x
160+
161+
_≰_ : Rel ℤ _
162+
x ≰ y = ¬ (x ≤ y)
163+
164+
_≱_ : Rel ℤ _
165+
x ≱ y = ¬ (x ≥ y)
166+
167+
_≮_ : Rel ℤ _
168+
x ≮ y = ¬ (x < y)
169+
170+
_≯_ : Rel ℤ _
171+
x ≯ y = ¬ (x > y)
172+
152173
drop‿+≤+ : {m n} + m ≤ + n ℕ._≤_ m n
153174
drop‿+≤+ (+≤+ m≤n) = m≤n
154175

0 commit comments

Comments
 (0)