{-# OPTIONS --safe --warning=error #-} open import LogicalFormulae open import Orders open import Setoids.Setoids open import Functions open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) module Setoids.Orders where record SetoidPartialOrder {a b c : _} {A : Set a} (S : Setoid {a} {b} A) (_<_ : Rel {a} {c} A) : Set (a ⊔ b ⊔ c) where open Setoid S field wellDefined : {a b c d : A} → (a ∼ b) → (c ∼ d) → a < c → b < d irreflexive : {x : A} → (x < x) → False transitive : {a b c : A} → (a < b) → (b < c) → (a < c) record SetoidTotalOrder {a b c : _} {A : Set a} {S : Setoid {a} {b} A} {_<_ : Rel {a} {c} A} (P : SetoidPartialOrder S _<_) : Set (a ⊔ b ⊔ c) where open Setoid S field totality : (a b : A) → ((a < b) || (b < a)) || (a ∼ b) min : A → A → A min a b with totality a b min a b | inl (inl a