------------------------------------------------------------------------ -- The Agda standard library -- -- Lexicographic ordering of lists ------------------------------------------------------------------------ {-# OPTIONS --cubical-compatible --safe #-} module Data.List.Relation.Binary.Lex where open import Data.Unit.Base using (⊤; tt) open import Data.Product.Base using (_×_; _,_; proj₁; proj₂; uncurry) open import Data.List.Base using (List; []; _∷_) open import Data.List.Relation.Binary.Pointwise.Base using (Pointwise; []; _∷_; head; tail) open import Data.Sum.Base using (_⊎_; inj₁; inj₂; [_,_]) open import Function.Base using (_∘_; flip; id) open import Function.Bundles using (_⇔_; mk⇔) open import Level using (_⊔_) open import Relation.Nullary.Negation.Core using (¬_; contradiction) open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _×-dec_; _⊎-dec_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions using (Symmetric; Transitive; Irreflexive; Asymmetric; Antisymmetric ; Decidable; _Respects₂_; _Respects_) ------------------------------------------------------------------------ -- Re-exporting the core definitions and properties open import Data.List.Relation.Binary.Lex.Core public ------------------------------------------------------------------------ -- Properties module _ {a ℓ₁ ℓ₂} {A : Set a} {P : Set} {_≈_ : Rel A ℓ₁} {_≺_ : Rel A ℓ₂} where private _≋_ = Pointwise _≈_ _<_ = Lex P _≈_ _≺_ ¬≤-this : ∀ {x y xs ys} → ¬ (x ≈ y) → ¬ (x ≺ y) → ¬ (x ∷ xs) < (y ∷ ys) ¬≤-this x≉y x≮y (this x≺y) = x≮y x≺y ¬≤-this x≉y x≮y (next x≈y xs