| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Convenient syntax for "equational reasoning" using a partial order |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
-- Example uses: |
| 8 |
-- |
| 9 |
-- u≤x : u ≤ x |
| 10 |
-- u≤x = begin |
| 11 |
-- u ≈⟨ u≈v ⟩ |
| 12 |
-- v ≡⟨ v≡w ⟩ |
| 13 |
-- w <⟨ w≤x ⟩ |
| 14 |
-- x ∎ |
| 15 |
-- |
| 16 |
-- u<x : u < x |
| 17 |
-- u<x = begin-strict |
| 18 |
-- u ≈⟨ u≈v ⟩ |
| 19 |
-- v ≡⟨ v≡w ⟩ |
| 20 |
-- w <⟨ w≤x ⟩ |
| 21 |
-- x ∎ |
| 22 |
-- |
| 23 |
-- u<e : u < e |
| 24 |
-- u<e = begin-strict |
| 25 |
-- u ≈⟨ u≈v ⟩ |
| 26 |
-- v ≡⟨ v≡w ⟩ |
| 27 |
-- w <⟨ w<x ⟩ |
| 28 |
-- x ≤⟨ x≤y ⟩ |
| 29 |
-- y <⟨ y<z ⟩ |
| 30 |
-- z ≡⟨ d≡z ⟨ |
| 31 |
-- d ≈⟨ e≈d ⟨ |
| 32 |
-- e ∎ |
| 33 |
-- |
| 34 |
-- u≈w : u ≈ w |
| 35 |
-- u≈w = begin-equality |
| 36 |
-- u ≈⟨ u≈v ⟩ |
| 37 |
-- v ≡⟨ v≡w ⟩ |
| 38 |
-- w ∎ |
| 39 |
|
| 40 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 41 |
|
| 42 |
open import Relation.Binary.Bundles using (Poset) |
| 43 |
|
| 44 |
module Relation.Binary.Reasoning.PartialOrder |
| 45 |
{p₁ p₂ p₃} (P : Poset p₁ p₂ p₃) where |
| 46 |
|
| 47 |
open Poset P |
| 48 |
open import Relation.Binary.Construct.NonStrictToStrict _≈_ _≤_ |
| 49 |
as Strict |
| 50 |
using (_<_) |
| 51 |
|
| 52 |
------------------------------------------------------------------------ |
| 53 |
-- Re-export contents of base module |
| 54 |
|
| 55 |
open import Relation.Binary.Reasoning.Base.Triple |
| 56 |
isPreorder |
| 57 |
(Strict.<-asym antisym) |
| 58 |
(Strict.<-trans isPartialOrder) |
| 59 |
(Strict.<-resp-≈ isEquivalence ≤-resp-≈) |
| 60 |
Strict.<⇒≤ |
| 61 |
(Strict.<-≤-trans Eq.sym trans antisym ≤-respʳ-≈) |
| 62 |
(Strict.≤-<-trans trans antisym ≤-respˡ-≈) |
| 63 |
public |