|
8 | 8 |
|
9 | 9 | module Data.List.Relation.Binary.Lex where |
10 | 10 |
|
11 | | -open import Data.Empty using (⊥; ⊥-elim) |
12 | 11 | open import Data.Unit.Base using (⊤; tt) |
13 | 12 | open import Data.Product.Base using (_×_; _,_; proj₁; proj₂; uncurry) |
14 | 13 | open import Data.List.Base using (List; []; _∷_) |
| 14 | +open import Data.List.Relation.Binary.Pointwise.Base |
| 15 | + using (Pointwise; []; _∷_; head; tail) |
15 | 16 | open import Data.Sum.Base using (_⊎_; inj₁; inj₂; [_,_]) |
16 | 17 | open import Function.Base using (_∘_; flip; id) |
17 | 18 | open import Function.Bundles using (_⇔_; mk⇔) |
18 | 19 | open import Level using (_⊔_) |
19 | | -open import Relation.Nullary.Negation using (¬_) |
| 20 | +open import Relation.Nullary.Negation.Core using (¬_; contradiction) |
20 | 21 | open import Relation.Nullary.Decidable as Dec |
21 | 22 | using (Dec; yes; no; _×-dec_; _⊎-dec_) |
22 | 23 | open import Relation.Binary.Core using (Rel) |
23 | 24 | open import Relation.Binary.Structures using (IsEquivalence) |
24 | 25 | open import Relation.Binary.Definitions |
25 | | - using (Symmetric; Transitive; Irreflexive; Asymmetric; Antisymmetric; Decidable; _Respects₂_; _Respects_) |
26 | | -open import Data.List.Relation.Binary.Pointwise.Base |
27 | | - using (Pointwise; []; _∷_; head; tail) |
| 26 | + using (Symmetric; Transitive; Irreflexive; Asymmetric; Antisymmetric |
| 27 | + ; Decidable; _Respects₂_; _Respects_) |
| 28 | + |
28 | 29 |
|
29 | 30 | ------------------------------------------------------------------------ |
30 | 31 | -- Re-exporting the core definitions and properties |
@@ -57,9 +58,9 @@ module _ {a ℓ₁ ℓ₂} {A : Set a} {P : Set} |
57 | 58 | where |
58 | 59 | as : Antisymmetric _≋_ _<_ |
59 | 60 | as (base _) (base _) = [] |
60 | | - as (this x≺y) (this y≺x) = ⊥-elim (asym x≺y y≺x) |
61 | | - as (this x≺y) (next y≈x ys<xs) = ⊥-elim (ir (sym y≈x) x≺y) |
62 | | - as (next x≈y xs<ys) (this y≺x) = ⊥-elim (ir (sym x≈y) y≺x) |
| 61 | + as (this x≺y) (this y≺x) = contradiction y≺x (asym x≺y) |
| 62 | + as (this x≺y) (next y≈x ys<xs) = contradiction x≺y (ir (sym y≈x)) |
| 63 | + as (next x≈y xs<ys) (this y≺x) = contradiction y≺x (ir (sym x≈y)) |
63 | 64 | as (next x≈y xs<ys) (next y≈x ys<xs) = x≈y ∷ as xs<ys ys<xs |
64 | 65 |
|
65 | 66 | toSum : ∀ {x y xs ys} → (x ∷ xs) < (y ∷ ys) → (x ≺ y ⊎ (x ≈ y × xs < ys)) |
|
0 commit comments