Skip to content

OrderedTypes.sigma-sup-lattice

Martin Escardo, 15 June 2020

We consider ฯƒ-sup-lattices. We have โ„•-indexed joins and โŠฅ (and
hence finite joins).


{-# OPTIONS --safe --without-K #-}

open import MLTT.Spartan
open import UF.FunExt
open import UF.Subsingletons

module OrderedTypes.sigma-sup-lattice (fe : Fun-Ext) where

open import UF.HedbergApplications
open import UF.SIP
open import UF.Sets
open import UF.Subsingletons-FunExt

ฯƒ-suplat-structure : ๐“ค ฬ‡ โ†’ ๐“ค ฬ‡
ฯƒ-suplat-structure X = X ร— ((โ„• โ†’ X) โ†’ X)


A compatible order for ฯƒ-suplat structure (โŠค , โŠฅ , โ‹) is a
partial order (prop-valued, reflexive, transitive and antisymmetric
binary relation) such that โŠฅ is the smallest element, โŠค is the largest
element, and โ‹ x is the least upper bound of the sequence x.


is-ฯƒ-sup-compatible-order : {X : ๐“ค ฬ‡ } โ†’ ฯƒ-suplat-structure X โ†’ (X โ†’ X โ†’ ๐“ฅ ฬ‡ ) โ†’ ๐“ค โŠ” ๐“ฅ ฬ‡
is-ฯƒ-sup-compatible-order {๐“ค} {๐“ฅ} {X} (โŠฅ , โ‹) _โ‰ค_ = I ร— II ร— III ร— IV ร— V ร— VI ร— VII
 where
  I   = (x y : X) โ†’ is-prop (x โ‰ค y)
  II  = (x : X) โ†’ x โ‰ค x
  III = (x y z : X) โ†’ x โ‰ค y โ†’ y โ‰ค z โ†’ x โ‰ค z
  IV  = (x y : X) โ†’ x โ‰ค y โ†’ y โ‰ค x โ†’ x ๏ผ y
  V   = (x : X) โ†’ โŠฅ โ‰ค x
  VI  = (x : โ„• โ†’ X) (n : โ„•) โ†’ x n โ‰ค โ‹ x
  VII = (x : โ„• โ†’ X) (u : X) โ†’ ((n : โ„•) โ†’ x n โ‰ค u) โ†’ โ‹ x โ‰ค u

We can define the binary sup x โˆจ y of two elements x and y by
โ‹ (x * y) where x * y is the infinite sequence consisting of x
followed by infinitely many y's. Then we can define the intrinsic
order by x โ‰ค y iff x โˆจ y = y.


private _*_ : {X : ๐“ค ฬ‡ } โ†’ X โ†’ X โ†’ (โ„• โ†’ X)
(x * y)       0  = x
(x * y) (succ _) = y

intrinsic-order : {X : ๐“ค ฬ‡ } โ†’ ฯƒ-suplat-structure X โ†’ (X โ†’ X โ†’ ๐“ค ฬ‡ )
intrinsic-order (โŠฅ , โ‹) x y = โ‹ (x * y) ๏ผ y

syntax intrinsic-order s x y = x โ‰ค[ s ] y


Any compatible order is logically equivalent to the intrinsic order:


any-ฯƒ-sup-order-is-intrinsic-order : {X : ๐“ค ฬ‡ } (s : ฯƒ-suplat-structure X) (_โ‰ค_ : X โ†’ X โ†’ ๐“ฅ ฬ‡ )
                                   โ†’ is-ฯƒ-sup-compatible-order s _โ‰ค_
                                   โ†’ (x y : X) โ†’ x โ‰ค y โ†” x โ‰ค[ s ] y
any-ฯƒ-sup-order-is-intrinsic-order {๐“ฅ} {X} (โŠฅ , โ‹) _โ‰ค_ (โ‰ค-prop-valued , โ‰ค-refl , โ‰ค-trans , โ‰ค-anti , bottom , โ‹-is-ub , โ‹-is-lb-of-ubs) x y = a , b
 where
  s = (โŠฅ , โ‹)
  a : x โ‰ค y โ†’ x โ‰ค[ s ] y
  a l = iv
   where
    i :  (n : โ„•) โ†’ (x * y) n โ‰ค y
    i       0  = l
    i (succ n) = โ‰ค-refl y
    ii : โ‹ (x * y) โ‰ค y
    ii = โ‹-is-lb-of-ubs (x * y) y i
    iii : y โ‰ค โ‹ (x * y)
    iii = โ‹-is-ub (x * y) (succ 0)
    iv : โ‹ (x * y) ๏ผ y
    iv = โ‰ค-anti (โ‹ (x * y)) y ii iii
  b : x โ‰ค[ s ] y โ†’ x โ‰ค y
  b l = iii
   where
    i : โ‹ (x * y) โ‰ค y
    i = transport (โ‹ (x * y) โ‰ค_) l (โ‰ค-refl (โ‹ (x * y)))
    ii : x โ‰ค โ‹ (x * y)
    ii = โ‹-is-ub (x * y) 0
    iii : x โ‰ค y
    iii = โ‰ค-trans _ _ _ ii i


Therefore, by functional and propositional extensionality, there is at
most one compatible order:


at-most-one-ฯƒ-sup-order : Prop-Ext
                        โ†’ {X : ๐“ค ฬ‡ } (s : ฯƒ-suplat-structure X) (_โ‰ค_ _โ‰ค'_ : X โ†’ X โ†’ ๐“ฅ ฬ‡ )
                        โ†’ is-ฯƒ-sup-compatible-order s _โ‰ค_
                        โ†’ is-ฯƒ-sup-compatible-order s _โ‰ค'_
                        โ†’ _โ‰ค_ ๏ผ _โ‰ค'_
at-most-one-ฯƒ-sup-order pe s _โ‰ค_ _โ‰ค'_ (i , i') (j , j') = ฮณ
 where
  a : โˆ€ x y โ†’ x โ‰ค y โ†’ x โ‰ค' y
  a x y = v โˆ˜ u
   where
    u : x โ‰ค y โ†’ x โ‰ค[ s ] y
    u = lr-implication (any-ฯƒ-sup-order-is-intrinsic-order s _โ‰ค_ (i , i') x y)
    v : x โ‰ค[ s ] y โ†’ x โ‰ค' y
    v = rl-implication (any-ฯƒ-sup-order-is-intrinsic-order s _โ‰ค'_ (j , j') x y)

  b : โˆ€ x y โ†’ x โ‰ค' y โ†’ x โ‰ค y
  b x y = v โˆ˜ u
   where
    u : x โ‰ค' y โ†’ x โ‰ค[ s ] y
    u = lr-implication (any-ฯƒ-sup-order-is-intrinsic-order s _โ‰ค'_ (j , j') x y)
    v : x โ‰ค[ s ] y โ†’ x โ‰ค y
    v = rl-implication (any-ฯƒ-sup-order-is-intrinsic-order s _โ‰ค_ (i , i') x y)

  ฮณ : _โ‰ค_ ๏ผ _โ‰ค'_
  ฮณ = dfunext fe (ฮป x โ†’ dfunext fe (ฮป y โ†’ pe (i x y) (j x y) (a x y) (b x y)))


Hence being order compatible is property (rather than just data):


being-ฯƒ-sup-order-is-prop : {X : ๐“ค ฬ‡ } (s : ฯƒ-suplat-structure X) (_โ‰ค_ : X โ†’ X โ†’ ๐“ฅ ฬ‡ )
                          โ†’ is-prop (is-ฯƒ-sup-compatible-order s _โ‰ค_)
being-ฯƒ-sup-order-is-prop (โŠฅ , โ‹) _โ‰ค_ = prop-criterion ฮณ
 where
  s = (โŠฅ , โ‹)
  ฮณ : is-ฯƒ-sup-compatible-order s _โ‰ค_ โ†’ is-prop (is-ฯƒ-sup-compatible-order s _โ‰ค_)
  ฮณ (โ‰ค-prop-valued , โ‰ค-refl , โ‰ค-trans , โ‰ค-anti , bottom , โ‹-is-ub , โ‹-is-lb-of-ubs) =
    ร—โ‚‡-is-prop (ฮ โ‚‚-is-prop fe (ฮป x y โ†’ being-prop-is-prop fe))
               (ฮ -is-prop  fe (ฮป x โ†’ โ‰ค-prop-valued x x))
               (ฮ โ‚…-is-prop fe (ฮป x _ z _ _ โ†’ โ‰ค-prop-valued x z))
               (ฮ โ‚„-is-prop fe (ฮป x y _ _ โ†’ type-with-prop-valued-refl-antisym-rel-is-set
                                            _โ‰ค_ โ‰ค-prop-valued โ‰ค-refl โ‰ค-anti))
               (ฮ -is-prop  fe (ฮป x โ†’ โ‰ค-prop-valued โŠฅ x))
               (ฮ โ‚‚-is-prop fe (ฮป x n โ†’ โ‰ค-prop-valued (x n) (โ‹ x)))
               (ฮ โ‚ƒ-is-prop fe (ฮป x u _ โ†’ โ‰ค-prop-valued (โ‹ x) u))

The ฯƒ-suplat axiom says that there exists a compatible order,
which is then unique by the above:


ฯƒ-suplat-axiom : (๐“ฅ : Universe) {X : ๐“ค ฬ‡ } โ†’ ฯƒ-suplat-structure X โ†’ ๐“ค โŠ” (๐“ฅ โบ) ฬ‡
ฯƒ-suplat-axiom ๐“ฅ {X} s = ฮฃ _โ‰ค_ ๊ž‰ (X โ†’ X โ†’ ๐“ฅ ฬ‡ ) , (is-ฯƒ-sup-compatible-order s _โ‰ค_)

ฯƒ-suplat-axiom-gives-is-set : {X : ๐“ค ฬ‡ } {s : ฯƒ-suplat-structure X}
                            โ†’ ฯƒ-suplat-axiom ๐“ฅ s โ†’ is-set X
ฯƒ-suplat-axiom-gives-is-set (_โ‰ค_ , โ‰ค-prop-valued , โ‰ค-refl , _ , โ‰ค-anti , _) =
  type-with-prop-valued-refl-antisym-rel-is-set _โ‰ค_ โ‰ค-prop-valued โ‰ค-refl โ‰ค-anti


ฯƒ-suplat-axiom-is-prop : Prop-Ext
                       โ†’ {๐“ฅ : Universe}
                       โ†’ {X : ๐“ค ฬ‡ } (s : ฯƒ-suplat-structure X)
                       โ†’ is-prop (ฯƒ-suplat-axiom ๐“ฅ {X} s)
ฯƒ-suplat-axiom-is-prop pe s (_โ‰ค_ , a) (_โ‰ค'_ , a') = to-subtype-๏ผ
                                                      (being-ฯƒ-sup-order-is-prop s)
                                                      (at-most-one-ฯƒ-sup-order pe s _โ‰ค_ _โ‰ค'_ a a')

ฯƒ-SupLat : (๐“ค ๐“ฅ  : Universe) โ†’ (๐“ค โŠ” ๐“ฅ)โบ ฬ‡
ฯƒ-SupLat ๐“ค ๐“ฅ = ฮฃ X ๊ž‰  ๐“ค ฬ‡ , ฮฃ s ๊ž‰ ฯƒ-suplat-structure X , ฯƒ-suplat-axiom ๐“ฅ s

open sip public

โŠฅโŸจ_โŸฉ : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ โŸจ ๐“ โŸฉ
โŠฅโŸจ A , (โŠฅ , โ‹) , _ โŸฉ = โŠฅ

โ‹โŸจ_โŸฉ : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ (โ„• โ†’ โŸจ ๐“ โŸฉ) โ†’ โŸจ ๐“ โŸฉ
โ‹โŸจ A , (โŠฅ , โ‹) , _ โŸฉ = โ‹

โŸจ_โŸฉ-is-set : (L : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ is-set โŸจ L โŸฉ
โŸจ_โŸฉ-is-set (X , s , a) = ฯƒ-suplat-axiom-gives-is-set a

โŸจ_โŸฉ-order : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ)
            โ†’ โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“ โŸฉ โ†’ ๐“ฅ ฬ‡
โŸจ A , (โŠฅ , โ‹) , (_โ‰ค_ , _) โŸฉ-order = _โ‰ค_

order : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ)
      โ†’ โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“ โŸฉ โ†’ ๐“ฅ ฬ‡
order = โŸจ_โŸฉ-order

syntax order ๐“ x y = x โ‰คโŸจ ๐“ โŸฉ y

โŸจ_โŸฉ-structure : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ ฯƒ-suplat-structure โŸจ ๐“ โŸฉ
โŸจ A , s , (_โ‰ค_ , i-viii) โŸฉ-structure = s

โŸจ_โŸฉ-โ‰ค-is-ฯƒ-sup-compatible-order : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ)
                                โ†’ is-ฯƒ-sup-compatible-order โŸจ ๐“ โŸฉ-structure (โŸจ ๐“ โŸฉ-order)
โŸจ A , _ , (_โ‰ค_ , i-viii) โŸฉ-โ‰ค-is-ฯƒ-sup-compatible-order = i-viii

โŸจ_โŸฉ-order-is-prop-valued : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b : โŸจ ๐“ โŸฉ) โ†’ is-prop (a โ‰คโŸจ ๐“ โŸฉ b)
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-order-is-prop-valued = i

โŸจ_โŸฉ-refl : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a : โŸจ ๐“ โŸฉ) โ†’ a โ‰คโŸจ ๐“ โŸฉ a
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-refl = ii


โŸจ_โŸฉ-trans : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b c : โŸจ ๐“ โŸฉ) โ†’ a โ‰คโŸจ ๐“ โŸฉ b โ†’ b โ‰คโŸจ ๐“ โŸฉ c โ†’ a โ‰คโŸจ ๐“ โŸฉ c
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-trans = iii


โŸจ_โŸฉ-antisym : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b : โŸจ ๐“ โŸฉ) โ†’ a โ‰คโŸจ ๐“ โŸฉ b โ†’ b โ‰คโŸจ ๐“ โŸฉ a โ†’ a ๏ผ b
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-antisym = iv


โŸจ_โŸฉ-โŠฅ-is-minimum : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a : โŸจ ๐“ โŸฉ) โ†’ โŠฅโŸจ ๐“ โŸฉ โ‰คโŸจ ๐“ โŸฉ a
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-โŠฅ-is-minimum = v


โŸจ_โŸฉ-โ‹-is-ub : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a : โ„• โ†’ โŸจ ๐“ โŸฉ) (n : โ„•) โ†’ a n โ‰คโŸจ ๐“ โŸฉ โ‹โŸจ ๐“ โŸฉ a
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-โ‹-is-ub = vi

โŸจ_โŸฉ-โ‹-is-lb-of-ubs : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a : โ„• โ†’ โŸจ ๐“ โŸฉ) (u : โŸจ ๐“ โŸฉ)
                   โ†’ ((n : โ„•) โ†’ a n โ‰คโŸจ ๐“ โŸฉ u)
                   โ†’ โ‹โŸจ ๐“ โŸฉ a โ‰คโŸจ ๐“ โŸฉ u
โŸจ A , _ , (_โ‰ค_ , i , ii , iii , iv , v , vi , vii) โŸฉ-โ‹-is-lb-of-ubs = vii

โŸจ_โŸฉ-๏ผ-gives-โ‰ค : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) {a b : โŸจ ๐“ โŸฉ} โ†’ a ๏ผ b โ†’ a โ‰คโŸจ ๐“ โŸฉ b
โŸจ ๐“ โŸฉ-๏ผ-gives-โ‰ค {a} refl = โŸจ ๐“ โŸฉ-refl a

binary-join : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“ โŸฉ
binary-join ๐“ a b = โ‹โŸจ ๐“ โŸฉ (a * b)

syntax binary-join ๐“ a b = a โˆจโŸจ ๐“ โŸฉ b
infixl 100 binary-join

โŸจ_โŸฉ-โˆจ-is-ub-left : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b :  โŸจ ๐“ โŸฉ) โ†’ a โ‰คโŸจ ๐“ โŸฉ a โˆจโŸจ ๐“ โŸฉ b
โŸจ_โŸฉ-โˆจ-is-ub-left ๐“ a b = โŸจ ๐“ โŸฉ-โ‹-is-ub (a * b) 0

โŸจ_โŸฉ-โˆจ-is-ub-right : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b :  โŸจ ๐“ โŸฉ) โ†’ b โ‰คโŸจ ๐“ โŸฉ a โˆจโŸจ ๐“ โŸฉ b
โŸจ_โŸฉ-โˆจ-is-ub-right ๐“ a b = โŸจ ๐“ โŸฉ-โ‹-is-ub (a * b) 1

โŸจ_โŸฉ-โˆจ-is-lb-of-ubs : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a b u : โŸจ ๐“ โŸฉ)
                   โ†’ a โ‰คโŸจ ๐“ โŸฉ u
                   โ†’ b โ‰คโŸจ ๐“ โŸฉ u
                   โ†’ a โˆจโŸจ ๐“ โŸฉ b โ‰คโŸจ ๐“ โŸฉ u
โŸจ_โŸฉ-โˆจ-is-lb-of-ubs ๐“ a b u l m = โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs (a * b) u f
 where
  f : (n : โ„•) โ†’ (a * b) n โ‰คโŸจ ๐“ โŸฉ u
  f 0 = l
  f (succ n) = m

โŸจ_โŸฉ-โ‹-idempotent : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (a : โŸจ ๐“ โŸฉ)
                  โ†’ โ‹โŸจ ๐“ โŸฉ (n โ†ฆ a) ๏ผ a
โŸจ_โŸฉ-โ‹-idempotent ๐“ a = โŸจ ๐“ โŸฉ-antisym _ _
                              (โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs (n โ†ฆ a) a (ฮป n โ†’ โŸจ ๐“ โŸฉ-refl a))
                              (โŸจ ๐“ โŸฉ-โ‹-is-ub (n โ†ฆ a) 0)

โŸจ_โŸฉ-โ‹-transp : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) (c : โ„• โ†’ โ„• โ†’ โŸจ ๐“ โŸฉ)
              โ†’ โ‹โŸจ ๐“ โŸฉ (i โ†ฆ โ‹โŸจ ๐“ โŸฉ (j โ†ฆ c i j)) ๏ผ โ‹โŸจ ๐“ โŸฉ (j โ†ฆ โ‹โŸจ ๐“ โŸฉ (i โ†ฆ c i j))
โŸจ_โŸฉ-โ‹-transp {๐“ค} {๐“ฅ} ๐“ c = โŸจ ๐“ โŸฉ-antisym _ _ m l
 where
  โ‹ = โ‹โŸจ ๐“ โŸฉ
  _โ‰ค_ : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“ โŸฉ โ†’ ๐“ฅ ฬ‡
  a โ‰ค b = a โ‰คโŸจ ๐“ โŸฉ b

  p : โˆ€ iโ‚€ jโ‚€ โ†’ c iโ‚€ jโ‚€ โ‰ค โ‹ (i โ†ฆ โ‹ (j โ†ฆ c i j))
  p iโ‚€ jโ‚€ = โŸจ ๐“ โŸฉ-trans _ _ _ pโ‚€ pโ‚
   where
    pโ‚€ : c iโ‚€ jโ‚€ โ‰ค โ‹ (j โ†ฆ c iโ‚€ j)
    pโ‚€ = โŸจ ๐“ โŸฉ-โ‹-is-ub (ฮป j โ†’ c iโ‚€ j) jโ‚€
    pโ‚ : โ‹ (j โ†ฆ c iโ‚€ j) โ‰ค โ‹ (i โ†ฆ โ‹ (j โ†ฆ c i j))
    pโ‚ = โŸจ ๐“ โŸฉ-โ‹-is-ub (ฮป i โ†’ โ‹ (j โ†ฆ c i j)) iโ‚€

  l : โ‹ (j โ†ฆ โ‹ (i โ†ฆ c i j)) โ‰ค โ‹ (i โ†ฆ โ‹ (j โ†ฆ c i j))
  l = โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs _ _ (ฮป j โ†’ โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs _ _ (ฮป i โ†’ p i j))

  q : โˆ€ iโ‚€ jโ‚€ โ†’ c iโ‚€ jโ‚€ โ‰ค โ‹ (j โ†ฆ โ‹ (i โ†ฆ c i j))
  q iโ‚€ jโ‚€ = โŸจ ๐“ โŸฉ-trans _ _ _ qโ‚€ qโ‚
   where
    qโ‚€ : c iโ‚€ jโ‚€ โ‰ค โ‹ (i โ†ฆ c i jโ‚€)
    qโ‚€ = โŸจ ๐“ โŸฉ-โ‹-is-ub (ฮป i โ†’ c i jโ‚€) iโ‚€
    qโ‚ : โ‹ (i โ†ฆ c i jโ‚€) โ‰ค โ‹ (j โ†ฆ โ‹ (i โ†ฆ c i j))
    qโ‚ = โŸจ ๐“ โŸฉ-โ‹-is-ub (ฮป j โ†’ โ‹ (i โ†ฆ c i j)) jโ‚€

  m : โ‹ (i โ†ฆ โ‹ (j โ†ฆ c i j)) โ‰ค โ‹ (j โ†ฆ โ‹ (i โ†ฆ c i j))
  m = โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs _ _ (ฮป i โ†’ โŸจ ๐“ โŸฉ-โ‹-is-lb-of-ubs _ _ (ฮป j โ†’ q i j))

is-ฯƒ-suplat-hom : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
                 โ†’ (โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ) โ†’ ๐“ค โŠ” ๐“ฅ ฬ‡
is-ฯƒ-suplat-hom  (_ , (โŠฅ , โ‹) , _) (_ , (โŠฅ' , โ‹') , _) f = (f โŠฅ ๏ผ โŠฅ')
                                                         ร— (โˆ€ ๐•’ โ†’ f (โ‹ ๐•’) ๏ผ โ‹' (n โ†ฆ f (๐•’ n)))

being-ฯƒ-suplat-hom-is-prop : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
                             (f : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ)
                           โ†’ is-prop (is-ฯƒ-suplat-hom ๐“ ๐“‘ f)
being-ฯƒ-suplat-hom-is-prop ๐“ ๐“‘ f = ร—-is-prop
                                     โŸจ ๐“‘ โŸฉ-is-set
                                     (ฮ -is-prop fe (ฮป _ โ†’ โŸจ ๐“‘ โŸฉ-is-set))

ฯƒ-suplat-hom-โŠฅ : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
               โ†’ (f : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ)
               โ†’ is-ฯƒ-suplat-hom ๐“ ๐“‘ f
               โ†’ f โŠฅโŸจ ๐“ โŸฉ ๏ผ โŠฅโŸจ ๐“‘ โŸฉ
ฯƒ-suplat-hom-โŠฅ ๐“ ๐“‘ f (i , ii) = i

ฯƒ-suplat-hom-โ‹ : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
                โ†’ (f : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ)
                โ†’ is-ฯƒ-suplat-hom ๐“ ๐“‘ f
                โ†’ โˆ€ ๐•’ โ†’ f (โ‹โŸจ ๐“ โŸฉ ๐•’) ๏ผ โ‹โŸจ ๐“‘ โŸฉ (n โ†ฆ f (๐•’ n))
ฯƒ-suplat-hom-โ‹ ๐“ ๐“‘ f (i , ii) = ii

is-monotone : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
            โ†’ (โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ) โ†’ ๐“ค โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡
is-monotone ๐“ ๐“‘ f = โˆ€ a b โ†’ a โ‰คโŸจ ๐“ โŸฉ b โ†’ f a โ‰คโŸจ ๐“‘ โŸฉ f b

ฯƒ-suplat-hom-โ‰ค : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฆ) (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฃ)
               โ†’ (f : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ)
               โ†’ is-ฯƒ-suplat-hom ๐“ ๐“‘ f
               โ†’ is-monotone ๐“ ๐“‘ f
ฯƒ-suplat-hom-โ‰ค ๐“ ๐“‘ f i a b l = m
 where
  c : f a * f b โˆผ f โˆ˜ (a * b)
  c 0 = refl
  c (succ n) = refl
  l' : โ‹โŸจ ๐“ โŸฉ (a * b) ๏ผ b
  l' = lr-implication (any-ฯƒ-sup-order-is-intrinsic-order _ (โŸจ ๐“ โŸฉ-order) โŸจ ๐“ โŸฉ-โ‰ค-is-ฯƒ-sup-compatible-order a b) l
  m' : โ‹โŸจ ๐“‘ โŸฉ (f a * f b) ๏ผ f b
  m' = โ‹โŸจ ๐“‘ โŸฉ (f a * f b)   ๏ผโŸจ ap โ‹โŸจ ๐“‘ โŸฉ (dfunext fe c) โŸฉ
       โ‹โŸจ ๐“‘ โŸฉ (f โˆ˜ (a * b)) ๏ผโŸจ (ฯƒ-suplat-hom-โ‹ ๐“ ๐“‘ f i (a * b))โปยน โŸฉ
       f (โ‹โŸจ ๐“ โŸฉ (a * b))   ๏ผโŸจ ap f l' โŸฉ
       f b                   โˆŽ
  m : f a โ‰คโŸจ ๐“‘ โŸฉ f b
  m = rl-implication (any-ฯƒ-sup-order-is-intrinsic-order _ (โŸจ ๐“‘ โŸฉ-order) โŸจ ๐“‘ โŸฉ-โ‰ค-is-ฯƒ-sup-compatible-order  (f a) (f b)) m'

id-is-ฯƒ-suplat-hom : (๐“ : ฯƒ-SupLat ๐“ค ๐“ฅ) โ†’ is-ฯƒ-suplat-hom ๐“ ๐“ id
id-is-ฯƒ-suplat-hom ๐“ = refl , (ฮป ๐•’ โ†’ refl)

โˆ˜-ฯƒ-suplat-hom : (๐“ : ฯƒ-SupLat ๐“ค ๐“ค') (๐“‘ : ฯƒ-SupLat ๐“ฅ ๐“ฅ') (๐“’ : ฯƒ-SupLat ๐“ฆ ๐“ฆ')
                 (f : โŸจ ๐“ โŸฉ โ†’ โŸจ ๐“‘ โŸฉ) (g : โŸจ ๐“‘ โŸฉ โ†’ โŸจ ๐“’ โŸฉ)
               โ†’ is-ฯƒ-suplat-hom ๐“ ๐“‘ f
               โ†’ is-ฯƒ-suplat-hom ๐“‘ ๐“’ g
               โ†’ is-ฯƒ-suplat-hom ๐“ ๐“’ (g โˆ˜ f)
โˆ˜-ฯƒ-suplat-hom ๐“ ๐“‘ ๐“’ f g (rโ‚€ , sโ‚€) (rโ‚ , sโ‚) = (rโ‚‚ , sโ‚‚)
 where
  rโ‚‚ = g (f โŠฅโŸจ ๐“ โŸฉ) ๏ผโŸจ ap g rโ‚€ โŸฉ
       g โŠฅโŸจ ๐“‘ โŸฉ     ๏ผโŸจ rโ‚ โŸฉ
       โŠฅโŸจ ๐“’ โŸฉ       โˆŽ

  sโ‚‚ = ฮป ๐•’ โ†’ g (f (โ‹โŸจ ๐“ โŸฉ ๐•’))           ๏ผโŸจ ap g (sโ‚€ ๐•’) โŸฉ
             g (โ‹โŸจ ๐“‘ โŸฉ (ฮป n โ†’ f (๐•’ n))) ๏ผโŸจ sโ‚ (ฮป n โ†’ f (๐•’ n)) โŸฉ
             โ‹โŸจ ๐“’ โŸฉ (ฮป n โ†’ g (f (๐•’ n))) โˆŽ