@@ -64,7 +64,7 @@ module _ {a} {A : Set a} where
64
64
<-asymmetric : Asymmetric _<_
65
65
<-asymmetric = ≤-antisym⇒<-asym ≤-antisym
66
66
67
- open IsEquivalence ≈-isEquivalence renaming (sym to ≈-sym)
67
+ open IsEquivalence ≈-isEquivalence using () renaming (sym to ≈-sym) public
68
68
69
69
<-trans : Transitive _<_
70
70
<-trans i<j j<k =
@@ -78,20 +78,51 @@ module _ {a} {A : Set a} where
78
78
<⇒¬>⊎≈ x<y (inj₁ y<x) = <-asymmetric x<y y<x
79
79
<⇒¬>⊎≈ x<y (inj₂ x≈y) = <-irrefl (≈-sym x≈y) x<y
80
80
81
+ ≥⇒≮ : ∀ {x y} → y ≤ x → ¬ (x < y)
82
+ ≥⇒≮ y≤x x<y = contradiction (to ≤⇔<∨≈ y≤x) (<⇒¬>⊎≈ x<y)
83
+
84
+ open HasPartialOrder ⦃...⦄
85
+
81
86
record HasDecPartialOrder : Set (sucˡ a) where
82
87
field
83
88
⦃ hasPartialOrder ⦄ : HasPartialOrder
84
89
⦃ dec-≤ ⦄ : _≤_ ⁇²
85
90
⦃ dec-< ⦄ : _<_ ⁇²
86
91
92
+ record HasTotalOrder : Set (sucˡ a) where
93
+ field
94
+ ⦃ hasPartialOrder ⦄ : HasPartialOrder
95
+ ≤-total : Total _≤_
96
+
97
+ ≤-isTotalOrder : IsTotalOrder _≈_ _≤_
98
+ ≤-isTotalOrder = record { isPartialOrder = ≤-isPartialOrder ; total = ≤-total }
99
+
100
+ ≮⇒≥ : Decidable _≈_ → ∀ {x y} → ¬ (x < y) → y ≤ x
101
+ ≮⇒≥ _≈?_ {x} {y} x≮y with x ≈? y | ≤-total y x
102
+ ... | yes x≈y | _ = IsPreorder.reflexive ≤-isPreorder (≈-sym x≈y)
103
+ ... | _ | inj₁ y≤x = y≤x
104
+ ... | no x≉y | inj₂ x≤y = contradiction (≤∧≉⇒< (x≤y , x≉y)) x≮y
105
+
106
+ open HasTotalOrder ⦃...⦄
107
+
108
+ record HasDecTotalOrder : Set (sucˡ a) where
109
+ field
110
+ ⦃ hasTotalOrder ⦄ : HasTotalOrder
111
+ ⦃ dec-≤ ⦄ : _≤_ ⁇²
112
+ ⦃ dec-< ⦄ : _<_ ⁇²
113
+
87
114
HasPreorder≡ = HasPreorder {_≈_ = _≡_}
88
115
HasDecPreorder≡ = HasDecPreorder {_≈_ = _≡_}
89
116
HasPartialOrder≡ = HasPartialOrder {_≈_ = _≡_}
90
117
HasDecPartialOrder≡ = HasDecPartialOrder {_≈_ = _≡_}
118
+ HasTotalOrder≡ = HasTotalOrder {_≈_ = _≡_}
119
+ HasDecTotalOrder≡ = HasDecTotalOrder {_≈_ = _≡_}
91
120
92
121
open HasPreorder ⦃...⦄ public
93
122
open HasPartialOrder ⦃...⦄ public hiding (hasPreorder)
94
123
open HasDecPartialOrder ⦃...⦄ public hiding (hasPartialOrder)
124
+ open HasTotalOrder ⦃...⦄ public hiding (hasPartialOrder)
125
+ open HasDecTotalOrder ⦃...⦄ public hiding (hasTotalOrder)
95
126
96
127
module _ {a} {A : Set a} {_≈_ : Rel A a} where
97
128
0 commit comments