@@ -64,7 +64,7 @@ module _ {a} {A : Set a} where
6464 <-asymmetric : Asymmetric _<_
6565 <-asymmetric = ≤-antisym⇒<-asym ≤-antisym
6666
67- open IsEquivalence ≈-isEquivalence renaming (sym to ≈-sym)
67+ open IsEquivalence ≈-isEquivalence using () renaming (sym to ≈-sym) public
6868
6969 <-trans : Transitive _<_
7070 <-trans i<j j<k =
@@ -78,20 +78,51 @@ module _ {a} {A : Set a} where
7878 <⇒¬>⊎≈ x<y (inj₁ y<x) = <-asymmetric x<y y<x
7979 <⇒¬>⊎≈ x<y (inj₂ x≈y) = <-irrefl (≈-sym x≈y) x<y
8080
81+ ≥⇒≮ : ∀ {x y} → y ≤ x → ¬ (x < y)
82+ ≥⇒≮ y≤x x<y = contradiction (to ≤⇔<∨≈ y≤x) (<⇒¬>⊎≈ x<y)
83+
84+ open HasPartialOrder ⦃...⦄
85+
8186 record HasDecPartialOrder : Set (sucˡ a) where
8287 field
8388 ⦃ hasPartialOrder ⦄ : HasPartialOrder
8489 ⦃ dec-≤ ⦄ : _≤_ ⁇²
8590 ⦃ dec-< ⦄ : _<_ ⁇²
8691
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+
87114 HasPreorder≡ = HasPreorder {_≈_ = _≡_}
88115 HasDecPreorder≡ = HasDecPreorder {_≈_ = _≡_}
89116 HasPartialOrder≡ = HasPartialOrder {_≈_ = _≡_}
90117 HasDecPartialOrder≡ = HasDecPartialOrder {_≈_ = _≡_}
118+ HasTotalOrder≡ = HasTotalOrder {_≈_ = _≡_}
119+ HasDecTotalOrder≡ = HasDecTotalOrder {_≈_ = _≡_}
91120
92121open HasPreorder ⦃...⦄ public
93122open HasPartialOrder ⦃...⦄ public hiding (hasPreorder)
94123open HasDecPartialOrder ⦃...⦄ public hiding (hasPartialOrder)
124+ open HasTotalOrder ⦃...⦄ public hiding (hasPartialOrder)
125+ open HasDecTotalOrder ⦃...⦄ public hiding (hasTotalOrder)
95126
96127module _ {a} {A : Set a} {_≈_ : Rel A a} where
97128
0 commit comments