Skip to content

Commit 70a6c7a

Browse files
javierdiaz72omelkonian
authored andcommitted
Add instances of total orders
1 parent 3b82fcb commit 70a6c7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Class/HasOrder/Instance.agda

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,25 @@ instance
2020
ℕ-hasPartialOrder = HasPartialOrder ∋ record
2121
{ ≤-antisym = Nat.≤-antisym }
2222
ℕ-hasDecPartialOrder = HasDecPartialOrder {A = ℕ} ∋ record {}
23+
ℕ-hasTotalOrder = HasTotalOrder ∋ record
24+
{ ≤-total = Nat.≤-total }
25+
ℕ-hasDecTotalOrder = HasDecTotalOrder {A = ℕ} ∋ record {}
2326

2427
import Data.Integer.Properties as Int hiding (_≟_)
2528
ℤ-hasPreorder = HasPreorder ∋ record {Int; ≤⇔<∨≈ = let open Int in mk⇔
2629
(λ a≤b case _ ≟ _ of λ where (yes p) inj₂ p ; (no ¬p) inj₁ (≤∧≢⇒< a≤b ¬p))
2730
[ <⇒≤ , ≤-reflexive ] }
2831
ℤ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Int.≤-antisym }
2932
ℤ-hasDecPartialOrder = HasDecPartialOrder {A = ℤ} ∋ record {}
33+
ℤ-hasTotalOrder = HasTotalOrder ∋ record
34+
{ ≤-total = Int.≤-total }
35+
ℤ-hasDecTotalOrder = HasDecTotalOrder {A = ℤ} ∋ record {}
3036

3137
import Data.Rational.Properties as Rat hiding (_≟_)
3238

3339
ℚ-hasPreorder = hasPreorderFromNonStrict Rat.≤-isPreorder _≟_
3440
ℚ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Rat.≤-antisym }
3541
ℚ-hasDecPartialOrder = HasDecPartialOrder {A = ℚ} ∋ record {}
42+
ℚ-hasTotalOrder = HasTotalOrder ∋ record
43+
{ ≤-total = Rat.≤-total }
44+
ℚ-hasDecTotalOrder = HasDecTotalOrder {A = ℚ} ∋ record {}

0 commit comments

Comments
 (0)