Skip to content

DomainTheory.Part-I

Tom de Jong, July 2024.

This file corresponds to the paper

   "Domain theory in univalent foundations I:
    Directed complete posets and Scottโ€™s Dโˆž"
   Tom de Jong
   2024
   https://doi.org/10.48550/arxiv.2407.06952

NB: The names in this file should not be unchanged to ensure they correspond
correctly to the above paper.

See DomainTheory.index.lagda for an overview of all domain theory in
TypeTopology.


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

open import UF.FunExt
open import UF.Subsingletons
open import UF.PropTrunc


Our global assumptions are function extensionality, propositional extensionality
and the existence of propositional truncations.


module DomainTheory.Part-I
        (fe : Fun-Ext)
        (pe : Prop-Ext)
        (pt : propositional-truncations-exist)
       where

open PropositionalTruncation pt

open import MLTT.Spartan

open import Naturals.Order hiding (subtraction')
open import Notation.Order hiding (_โŠ‘_ ; _โ‰ผ_)

open import UF.Base
open import UF.Equiv
open import UF.Hedberg
open import UF.ImageAndSurjection pt
open import UF.Powerset-MultiUniverse
open import UF.Sets
open import UF.Size hiding (is-locally-small)
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier hiding (โŠฅ)
open import UF.Univalence

open import OrderedTypes.Poset fe


Section 2. Foundations


Definition-2-1 : (๐“ค : Universe) (X : ๐“ฅ ฬ‡ ) โ†’ ๐“ค โบ โŠ” ๐“ฅ ฬ‡
Definition-2-1 ๐“ค X = X is ๐“ค small

Definition-2-2 : (๐“ค : Universe) โ†’ ๐“ค โบ ฬ‡
Definition-2-2 ๐“ค = ฮฉ ๐“ค

Definition-2-3 : (๐“ฅ : Universe) (X : ๐“ค ฬ‡ ) โ†’ ๐“ฅ โบ โŠ” ๐“ค ฬ‡
Definition-2-3 ๐“ฅ X = ๐“Ÿ {๐“ฅ} X

Definition-2-4 : (๐“ฅ : Universe) (X : ๐“ค ฬ‡ )
               โ†’ (X โ†’ ๐“Ÿ {๐“ฅ} X โ†’ ๐“ฅ ฬ‡ )
               ร— (๐“Ÿ {๐“ฅ} X โ†’ ๐“Ÿ {๐“ฅ} X โ†’ ๐“ฅ โŠ” ๐“ค ฬ‡ )
Definition-2-4 ๐“ฅ X = _โˆˆ_ , _โІ_


Section 3. Directed complete posets


module _
        (P : ๐“ค ฬ‡ ) (_โŠ‘_ : P โ†’ P โ†’ ๐“ฃ ฬ‡ )
       where

 open PosetAxioms

 Definition-3-1 : ๐“ค โŠ” ๐“ฃ ฬ‡
 Definition-3-1 = is-prop-valued _โŠ‘_
                ร— is-reflexive _โŠ‘_
                ร— is-transitive _โŠ‘_

 Definition-3-2 : ๐“ค โŠ” ๐“ฃ ฬ‡
 Definition-3-2 = Definition-3-1 ร— is-antisymmetric _โŠ‘_

 Lemma-3-3 : is-prop-valued _โŠ‘_
           โ†’ is-reflexive _โŠ‘_
           โ†’ is-antisymmetric _โŠ‘_
           โ†’ is-set P
 Lemma-3-3 = posets-are-sets _โŠ‘_

 module _ (๐“ฅ : Universe) where
  open import DomainTheory.Basics.Dcpo pt fe ๐“ฅ

  Definition-3-4 : {I : ๐“ฅ ฬ‡ } โ†’ (I โ†’ P) โ†’ (๐“ฅ โŠ” ๐“ฃ ฬ‡ ) ร— (๐“ฅ โŠ” ๐“ฃ ฬ‡ )
  Definition-3-4 {I} ฮฑ = is-semidirected _โŠ‘_ ฮฑ , is-directed _โŠ‘_ ฮฑ

  Remark-3-5 : {I : ๐“ฅ ฬ‡ } (ฮฑ : I โ†’ P)
             โ†’ is-directed _โŠ‘_ ฮฑ
             ๏ผ โˆฅ I โˆฅ ร— ((i j : I) โ†’ โˆฅ ฮฃ k ๊ž‰ I , (ฮฑ i โŠ‘ ฮฑ k) ร— (ฮฑ j โŠ‘ ฮฑ k) โˆฅ)
  Remark-3-5 ฮฑ = refl

  Definition-3-6 : {I : ๐“ฅ ฬ‡ } โ†’ P โ†’ (I โ†’ P) โ†’ (๐“ฅ โŠ” ๐“ฃ ฬ‡ ) ร— (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฃ ฬ‡ )
  Definition-3-6 {I} x ฮฑ = (is-upperbound _โŠ‘_ x ฮฑ) , is-sup _โŠ‘_ x ฮฑ

  Definition-3-6-ad : poset-axioms _โŠ‘_
                    โ†’ {I : ๐“ฅ ฬ‡ } (ฮฑ : I โ†’ P)
                    โ†’ {x y : P} โ†’ is-sup _โŠ‘_ x ฮฑ โ†’ is-sup _โŠ‘_ y ฮฑ โ†’ x ๏ผ y
  Definition-3-6-ad pa {I} ฮฑ = sups-are-unique _โŠ‘_ pa ฮฑ

  Definition-3-7 : ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ ฬ‡
  Definition-3-7 = is-directed-complete _โŠ‘_

  Definition-3-7-ad : (๐““ : DCPO {๐“ค} {๐“ฃ}) {I : ๐“ฅ ฬ‡ }
                      {ฮฑ : I โ†’ โŸจ ๐““ โŸฉ} โ†’ is-Directed ๐““ ฮฑ โ†’ โŸจ ๐““ โŸฉ
  Definition-3-7-ad = โˆ

  Remark-3-8 : poset-axioms _โŠ‘_
             โ†’ {I : ๐“ฅ ฬ‡ } (ฮฑ : I โ†’ P)
             โ†’ is-prop (has-sup _โŠ‘_ ฮฑ)
  Remark-3-8 = having-sup-is-prop _โŠ‘_

module _ (๐“ฅ : Universe) where
 open import DomainTheory.Basics.Dcpo pt fe ๐“ฅ

 Definition-3-9 : {๐“ค ๐“ฃ : Universe} โ†’ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฃ) โบ ฬ‡
 Definition-3-9 {๐“ค} {๐“ฃ} = DCPO {๐“ค} {๐“ฃ}

 -- Remark-3-10: No formalisable content (as it's a meta-mathematical remark on
 --              the importance of keeping track of universe levels).

 open import DomainTheory.Basics.Pointed pt fe ๐“ฅ
 open import DomainTheory.Basics.Miscelanea pt fe ๐“ฅ

 Definition-3-11 : {๐“ค ๐“ฃ : Universe} โ†’ (๐“ฅ โŠ” ๐“ค โŠ” ๐“ฃ) โบ ฬ‡
 Definition-3-11 {๐“ค} {๐“ฃ} = DCPOโŠฅ {๐“ค} {๐“ฃ}

 Definition-3-12 : (๐““ : DCPO {๐“ค} {๐“ฃ}) โ†’ ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ ฬ‡
 Definition-3-12 ๐““ = is-locally-small' ๐““

 Lemma-3-13 : (๐““ : DCPO {๐“ค} {๐“ฃ})
            โ†’ is-locally-small ๐““ โ‰ƒ is-locally-small' ๐““
 Lemma-3-13 ๐““ = local-smallness-equivalent-definitions ๐““

 open import DomainTheory.Examples.Omega pt fe pe ๐“ฅ

 Example-3-14 : DCPOโŠฅ {๐“ฅ โบ} {๐“ฅ}
 Example-3-14 = ฮฉ-DCPOโŠฅ

 module _
         (X : ๐“ค ฬ‡ )
         (X-is-set : is-set X)
        where

  open import DomainTheory.Examples.Powerset pt fe pe X-is-set

  Example-3-15 :  DCPOโŠฅ {๐“ฅ โบ โŠ” ๐“ค} {๐“ฅ โŠ” ๐“ค}
  Example-3-15 = generalized-๐“Ÿ-DCPOโŠฅ ๐“ฅ

 module _
         (X : ๐“ฅ ฬ‡ )
         (X-is-set : is-set X)
        where

  open import DomainTheory.Examples.Powerset pt fe pe X-is-set

  Example-3-15-ad :  DCPOโŠฅ {๐“ฅ โบ} {๐“ฅ}
  Example-3-15-ad = ๐“Ÿ-DCPOโŠฅ

 Proposition-3-16 : (๐““ : DCPO {๐“ค} {๐“ฃ})
                  โ†’ is-ฯ‰-complete (underlying-order ๐““)
 Proposition-3-16 = dcpos-are-ฯ‰-complete


Section 4. Scott continuous maps


 Definition-4-1 : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
                โ†’ (โŸจ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ)
                โ†’ ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ โŠ” ๐“ค' โŠ” ๐“ฃ' ฬ‡
 Definition-4-1 ๐““ ๐“” f = is-continuous ๐““ ๐“” f

 -- Remark-4-2: Note that the parameter ๐“ฅ in the type DCPO is fixed.

 module _
         (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
        where

  Lemma-4-3 : (f : โŸจ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ)
            โ†’ is-prop (is-continuous ๐““ ๐“” f)
  Lemma-4-3 = being-continuous-is-prop ๐““ ๐“”

  Lemma-4-3-ad : (f g : DCPO[ ๐““ , ๐“” ])
               โ†’ underlying-function ๐““ ๐“” f ๏ผ underlying-function ๐““ ๐“” g
               โ†’ f ๏ผ g
  Lemma-4-3-ad f g e = to-continuous-function-๏ผ ๐““ ๐“” (happly e)

  Lemma-4-4 : (f : DCPO[ ๐““ , ๐“” ])
            โ†’ is-monotone ๐““ ๐“” [ ๐““ , ๐“” ]โŸจ f โŸฉ
  Lemma-4-4 = monotone-if-continuous ๐““ ๐“”

  Lemma-4-5 : {f : โŸจ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ} โ†’ is-monotone ๐““ ๐“” f
            โ†’ {I : ๐“ฅ ฬ‡ } {ฮฑ : I โ†’ โŸจ ๐““ โŸฉ}
            โ†’ is-Directed ๐““ ฮฑ
            โ†’ is-Directed ๐“” (f โˆ˜ ฮฑ)
  Lemma-4-5 = image-is-directed ๐““ ๐“”

  Lemma-4-6 : (f : DCPO[ ๐““ , ๐“” ]) {I : ๐“ฅ ฬ‡ } {ฮฑ : I โ†’ โŸจ ๐““ โŸฉ}
              (ฮด : is-Directed ๐““ ฮฑ)
            โ†’ [ ๐““ , ๐“” ]โŸจ f โŸฉ (โˆ ๐““ ฮด) โŠ‘โŸจ ๐“” โŸฉ
              โˆ ๐“” (image-is-directed' ๐““ ๐“” f ฮด)
  Lemma-4-6 = continuous-โˆ-โŠ‘ ๐““ ๐“”

  Lemma-4-6-ad : (f : โŸจ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ) (m : is-monotone ๐““ ๐“” f)
               โ†’ ((I : ๐“ฅ ฬ‡ ) (ฮฑ : I โ†’ โŸจ ๐““ โŸฉ) (ฮด : is-Directed ๐““ ฮฑ)
                     โ†’ f (โˆ ๐““ ฮด) โŠ‘โŸจ ๐“” โŸฉ โˆ ๐“” (image-is-directed ๐““ ๐“” m ฮด))
               โ†’ is-continuous ๐““ ๐“” f
  Lemma-4-6-ad = continuity-criterion ๐““ ๐“”

 Remark-4-7 : ฮฃ ๐““ ๊ž‰ DCPO {๐“ฅ โบ} {๐“ฅ} ,
              ฮฃ f ๊ž‰ (โŸจ ๐““ โŸฉ โ†’ โŸจ ๐““ โŸฉ) , ยฌ is-continuous ๐““ ๐““ f
 Remark-4-7 = ฮฉ-DCPO , ฮฝ , II
  where
   ฮฝ : ฮฉ ๐“ฅ โ†’ ฮฉ ๐“ฅ
   ฮฝ P = ยฌ (P holds) , negations-are-props fe
   I : ยฌ (is-monotone ฮฉ-DCPO ฮฉ-DCPO ฮฝ)
   I m = m (๐Ÿ˜ , ๐Ÿ˜-is-prop) (๐Ÿ™ , ๐Ÿ™-is-prop) (ฮป _ โ†’ โ‹†) ๐Ÿ˜-elim โ‹†
   II : ยฌ (is-continuous ฮฉ-DCPO ฮฉ-DCPO ฮฝ)
   II c = I (monotone-if-continuous ฮฉ-DCPO ฮฉ-DCPO (ฮฝ , c))

 Definition-4-8 : (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'})
                โ†’ (โŸช ๐““ โŸซ โ†’ โŸช ๐“” โŸซ) โ†’ ๐“ค' ฬ‡
 Definition-4-8 ๐““ ๐“” f = is-strict ๐““ ๐“” f

 Lemma-4-9 : (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ})
             {I : ๐“ฅ ฬ‡ } {ฮฑ : I โ†’ โŸช ๐““ โŸซ}
           โ†’ is-semidirected (underlying-order (๐““ โป)) ฮฑ
           โ†’ has-sup (underlying-order (๐““ โป)) ฮฑ
 Lemma-4-9 = semidirected-complete-if-pointed

 Lemma-4-9-adโ‚ : (๐““ : DCPO {๐“ค} {๐“ฃ})
               โ†’ ({I : ๐“ฅ ฬ‡ } {ฮฑ : I โ†’ โŸจ ๐““ โŸฉ}
                     โ†’ is-semidirected (underlying-order ๐““) ฮฑ
                     โ†’ has-sup (underlying-order ๐““) ฮฑ)
               โ†’ has-least (underlying-order ๐““)
 Lemma-4-9-adโ‚ = pointed-if-semidirected-complete

 Lemma-4-9-adโ‚‚ : (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'})
                 (f : โŸช ๐““ โŸซ โ†’ โŸช ๐“” โŸซ)
               โ†’ is-continuous (๐““ โป) (๐“” โป) f
               โ†’ is-strict ๐““ ๐“” f
               โ†’ {I : ๐“ฅ ฬ‡ } {ฮฑ : I โ†’ โŸช ๐““ โŸซ}
               โ†’ (ฯƒ : is-semidirected (underlying-order (๐““ โป)) ฮฑ)
               โ†’ is-sup (underlying-order (๐“” โป)) (f (โˆหขแตˆ ๐““ ฯƒ)) (f โˆ˜ ฮฑ)
 Lemma-4-9-adโ‚‚ = preserves-semidirected-sups-if-continuous-and-strict

 Proposition-4-10-i : (๐““ : DCPO {๐“ค} {๐“ฃ}) โ†’ is-continuous ๐““ ๐““ id
 Proposition-4-10-i = id-is-continuous

 Proposition-4-10-i-ad : (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) โ†’ is-strict ๐““ ๐““ id
 Proposition-4-10-i-ad ๐““ = refl

 module _
         (๐““ : DCPO {๐“ค} {๐“ฃ})
         (๐“” : DCPO {๐“ค'} {๐“ฃ'})
        where

  Proposition-4-10-ii : (y : โŸจ ๐“” โŸฉ) โ†’ is-continuous ๐““ ๐“” (ฮป _ โ†’ y)
  Proposition-4-10-ii _ = constant-functions-are-continuous ๐““ ๐“”

  Proposition-4-10-iii : {๐“ค'' ๐“ฃ'' : Universe}
                         (๐“”' : DCPO {๐“ค''} {๐“ฃ''})
                         (f : โŸจ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ) (g : โŸจ ๐“” โŸฉ โ†’ โŸจ ๐“”' โŸฉ)
                       โ†’ is-continuous ๐““ ๐“” f
                       โ†’ is-continuous ๐“” ๐“”' g
                       โ†’ is-continuous ๐““ ๐“”' (g โˆ˜ f)
  Proposition-4-10-iii = โˆ˜-is-continuous ๐““ ๐“”

 Proposition-4-10-iii-ad : {๐“ค'' ๐“ฃ'' : Universe}
                           (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'})
                           (๐“”' : DCPOโŠฅ {๐“ค''} {๐“ฃ''})
                           (f : โŸช ๐““ โŸซ โ†’ โŸช ๐“” โŸซ) (g : โŸช ๐“” โŸซ โ†’ โŸช ๐“”' โŸซ)
                         โ†’ is-strict ๐““ ๐“” f
                         โ†’ is-strict ๐“” ๐“”' g
                         โ†’ is-strict ๐““ ๐“”' (g โˆ˜ f)
 Proposition-4-10-iii-ad = โˆ˜-is-strict

 Definition-4-11 : DCPO {๐“ค} {๐“ฃ} โ†’ DCPO {๐“ค'} {๐“ฃ'} โ†’ ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ โŠ” ๐“ค' โŠ” ๐“ฃ' ฬ‡
 Definition-4-11 ๐““ ๐“” = ๐““ โ‰ƒแตˆแถœแต–แต’ ๐“”

 Lemma-4-12 : (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'})
            โ†’ (๐““ โป) โ‰ƒแตˆแถœแต–แต’ (๐“” โป) โ†’ ๐““ โ‰ƒแตˆแถœแต–แต’โŠฅ ๐“”
 Lemma-4-12 = โ‰ƒแตˆแถœแต–แต’-to-โ‰ƒแตˆแถœแต–แต’โŠฅ

 Definition-4-13 : DCPO {๐“ค} {๐“ฃ} โ†’ DCPO {๐“ค'} {๐“ฃ'} โ†’ ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ โŠ” ๐“ค' โŠ” ๐“ฃ' ฬ‡
 Definition-4-13 ๐““ ๐“” = ๐““ continuous-retract-of ๐“”

 Lemma-4-14 : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
            โ†’ ๐““ continuous-retract-of ๐“”
            โ†’ is-locally-small ๐“”
            โ†’ is-locally-small ๐““
 Lemma-4-14 = local-smallness-preserved-by-continuous-retract


Section 5. Lifting


module _ where
 open import DomainTheory.Basics.Dcpo pt fe ๐“คโ‚€
 open import DomainTheory.Taboos.ClassicalLiftingOfNaturalNumbers pt fe
 open import Taboos.LPO

 Proposition-5-1 : is-ฯ‰-complete _โŠ‘_ โ†’ LPO
 Proposition-5-1 = โ„•โŠฅ-is-ฯ‰-complete-gives-LPO

 Proposition-5-1-ad : is-directed-complete _โŠ‘_ โ†’ LPO
 Proposition-5-1-ad = โ„•โŠฅ-is-directed-complete-gives-LPO

 -- Remark-5-2: No formalisable content.

module _ (๐“ฅ : Universe) where

 open import Lifting.Construction ๐“ฅ renaming (โŠฅ to โŠฅ๐“›)
 open import Lifting.IdentityViaSIP ๐“ฅ
 open import Lifting.Monad ๐“ฅ
 open import Lifting.Miscelanea-PropExt-FunExt ๐“ฅ pe fe

 Definition-5-3 : (X : ๐“ค ฬ‡ ) โ†’ ๐“ฅ โบ โŠ” ๐“ค ฬ‡
 Definition-5-3 X = ๐“› X

 Definition-5-4 : {X : ๐“ค ฬ‡ } โ†’ X โ†’ ๐“› X
 Definition-5-4 = ฮท

 Definition-5-5 : {X : ๐“ค ฬ‡ } โ†’ ๐“› X
 Definition-5-5 = โŠฅ๐“›

 Definition-5-6 : {X : ๐“ค ฬ‡ } โ†’ ๐“› X โ†’ ฮฉ ๐“ฅ
 Definition-5-6 l = is-defined l , being-defined-is-prop l

 Definition-5-6-ad : {X : ๐“ค ฬ‡ } (l : ๐“› X) โ†’ is-defined l โ†’ X
 Definition-5-6-ad = value

 open import UF.ClassicalLogic
 Proposition-5-7 : (X : ๐“ค ฬ‡ ) โ†’ EM ๐“ฅ โ†’ ๐“› X โ‰ƒ ๐Ÿ™ + X
 Proposition-5-7 = EM-gives-classical-lifting

 Proposition-5-7-ad : ((X : ๐“ค ฬ‡ ) โ†’ ๐“› X โ‰ƒ ๐Ÿ™ + X) โ†’ EM ๐“ฅ
 Proposition-5-7-ad = classical-lifting-gives-EM

 module _ {X : ๐“ค ฬ‡ } where

  Lemma-5-8 : {l m : ๐“› X} โ†’ (l โ‹ m โ†’ l ๏ผ m) ร— (l ๏ผ m โ†’ l โ‹ m)
  Lemma-5-8 = โ‹-to-๏ผ , ๏ผ-to-โ‹

  Remark-5-9 : is-univalent ๐“ฅ โ†’ (l m : ๐“› X)
             โ†’ (l ๏ผ m) โ‰ƒ (l โ‹ยท m)
  Remark-5-9 ua = ๐“›-Idยท ua fe

  Theorem-5-10 : {Y : ๐“ฆ ฬ‡ } โ†’ (f : X โ†’ ๐“› Y) โ†’ ๐“› X โ†’ ๐“› Y
  Theorem-5-10 f = f โ™ฏ

  Theorem-5-10-i : ฮท โ™ฏ โˆผ id {_} {๐“› X}
  Theorem-5-10-i l = โ‹-to-๏ผ (Kleisli-Lawโ‚€ l)

  Theorem-5-10-ii : {Y : ๐“ฆ ฬ‡ } (f : X โ†’ ๐“› Y)
                  โ†’ f โ™ฏ โˆ˜ ฮท โˆผ f
  Theorem-5-10-ii f l = โ‹-to-๏ผ (Kleisli-Lawโ‚ f l)

  Theorem-5-10-iii : {Y : ๐“ฆ ฬ‡ } {Z : ๐“ฃ ฬ‡ }
                     (f : X โ†’ ๐“› Y) (g : Y โ†’ ๐“› Z)
                   โ†’ (g โ™ฏ โˆ˜ f) โ™ฏ โˆผ g โ™ฏ โˆ˜ f โ™ฏ
  Theorem-5-10-iii f g l = (โ‹-to-๏ผ (Kleisli-Lawโ‚‚ f g l)) โปยน

  Remark-5-11 : type-of (๐“› X) ๏ผ ๐“ฅ โบ โŠ” ๐“ค ฬ‡
  Remark-5-11 = refl

  -- Remark-5-12: Note that we did not to assume that X is a set in the above.

  Definition-5-13 : {Y : ๐“ฅ ฬ‡ }
                  โ†’ (X โ†’ Y) โ†’ ๐“› X โ†’ ๐“› Y
  Definition-5-13 f = ๐“›ฬ‡ f

  Definition-5-13-ad : {Y : ๐“ฅ ฬ‡ } (f : X โ†’ Y)
                     โ†’ (ฮท โˆ˜ f) โ™ฏ โˆผ ๐“›ฬ‡ f
  Definition-5-13-ad f = ๐“›ฬ‡-โ™ฏ-โˆผ f

  Proposition-5-14 : ๐“› X โ†’ ๐“› X โ†’ ๐“ฅ โบ โŠ” ๐“ค ฬ‡
  Proposition-5-14 = _โŠ‘'_

  Proposition-5-14-adโ‚ : (is-set X โ†’ {l m : ๐“› X} โ†’ is-prop (l โŠ‘' m))
                       ร— ({l : ๐“› X} โ†’ l โŠ‘' l)
                       ร— ({l m n : ๐“› X} โ†’ l โŠ‘' m โ†’ m โŠ‘' n โ†’ l โŠ‘' n)
                       ร— ({l m : ๐“› X} โ†’ l โŠ‘' m โ†’ m โŠ‘' l โ†’ l ๏ผ m)
  Proposition-5-14-adโ‚ = โŠ‘'-prop-valued ,
                         โŠ‘'-is-reflexive ,
                         โŠ‘'-is-transitive ,
                         โŠ‘'-is-antisymmetric

  open import Lifting.UnivalentWildCategory ๐“ฅ X
  Proposition-5-14-adโ‚‚ : {l m : ๐“› X} โ†’ (l โŠ‘ m โ†’ l โŠ‘' m) ร— (l โŠ‘' m โ†’ l โŠ‘ m)
  Proposition-5-14-adโ‚‚ = โŠ‘-to-โŠ‘' , โŠ‘'-to-โŠ‘

 open import DomainTheory.Basics.Dcpo pt fe ๐“ฅ
 open import DomainTheory.Basics.Pointed pt fe ๐“ฅ
 open import DomainTheory.Basics.Miscelanea pt fe ๐“ฅ

 module _ where
  open import DomainTheory.Lifting.LiftingSet pt fe ๐“ฅ pe

  Proposition-5-15 : {X : ๐“ค ฬ‡ } โ†’ is-set X โ†’ DCPOโŠฅ {๐“ฅ โบ โŠ” ๐“ค} {๐“ฅ โบ โŠ” ๐“ค}
  Proposition-5-15 = ๐“›-DCPOโŠฅ

  Proposition-5-15-ad : {X : ๐“ฅ ฬ‡ } (s : is-set X) โ†’ is-locally-small (๐“›-DCPO s)
  Proposition-5-15-ad {X} s =
   record { _โŠ‘โ‚›_ = _โŠ‘_ ;
            โŠ‘โ‚›-โ‰ƒ-โŠ‘ = ฮป {l m} โ†’ logically-equivalent-props-are-equivalent
                                (โŠ‘-prop-valued fe fe s l m)
                                (โŠ‘'-prop-valued s)
                                โŠ‘-to-โŠ‘'
                                โŠ‘'-to-โŠ‘}
   where
    open import Lifting.UnivalentWildCategory ๐“ฅ X

 module _
         {X : ๐“ค ฬ‡ }
         (s : is-set X)
        where

  open import DomainTheory.Lifting.LiftingSet pt fe ๐“ฅ pe


  Proposition-5-16 : {Y : ๐“ฆ ฬ‡ } (t : is-set Y)
                     (f : X โ†’ ๐“› Y)
                  โ†’ is-continuous (๐“›-DCPO s) (๐“›-DCPO t) (f โ™ฏ)
  Proposition-5-16 t f = โ™ฏ-is-continuous s t f

  Lemma-5-17 : (l : ๐“› X)
             โ†’ l ๏ผ โˆหขหข (๐“›-DCPOโŠฅ s) (ฮท โˆ˜ value l) (being-defined-is-prop l)
  Lemma-5-17 = all-partial-elements-are-subsingleton-sups s

  Theorem-5-18 : (๐““ : DCPOโŠฅ {๐“ค'} {๐“ฃ'}) โ†’ (f : X โ†’ โŸช ๐““ โŸซ)
               โ†’ โˆƒ! fฬ… ๊ž‰ (๐“› X โ†’ โŸช ๐““ โŸซ) , is-continuous (๐“›-DCPO s) (๐““ โป) fฬ…
                                       ร— is-strict (๐“›-DCPOโŠฅ s) ๐““ fฬ…
                                       ร— (fฬ… โˆ˜ ฮท ๏ผ f)
  Theorem-5-18 = let open lifting-is-free-pointed-dcpo-on-set s in
                 ๐“›-gives-the-free-pointed-dcpo-on-a-set

 module _
         (๐““ : DCPO {๐“ค} {๐“ฃ})
        where

  open import DomainTheory.Lifting.LiftingDcpo pt fe ๐“ฅ pe
  open freely-add-โŠฅ ๐““

  Proposition-5-19 : ๐“›D โ†’ ๐“›D โ†’ ๐“ฅ โŠ” ๐“ฃ ฬ‡
  Proposition-5-19 = _โŠ‘_

  Proposition-5-19-ad : ((k l : ๐“›D) โ†’ is-prop (k โŠ‘ l))
                      ร— ((l : ๐“›D) โ†’ l โŠ‘ l)
                      ร— ((k l m : ๐“›D) โ†’ k โŠ‘ l โ†’ l โŠ‘ m โ†’ k โŠ‘ m)
                      ร— ((k l : ๐“›D) โ†’ k โŠ‘ l โ†’ l โŠ‘ k โ†’ k ๏ผ l)
  Proposition-5-19-ad = โŠ‘-is-prop-valued ,
                        โŠ‘-is-reflexive ,
                        โŠ‘-is-transitive ,
                        โŠ‘-is-antisymmetric

  Proposition-5-20 : DCPOโŠฅ {๐“ฅ โบ โŠ” ๐“ค} {๐“ฅ โŠ” ๐“ฃ}
  Proposition-5-20 = ๐“›-DCPOโŠฅ

  Proposition-5-20-ad : is-locally-small ๐““ โ†’ is-locally-small ๐“›-DCPO
  Proposition-5-20-ad = ๐“›-DCPO-is-locally-small

  Theorem-5-21 : (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'}) (f : โŸจ ๐““ โŸฉ โ†’ โŸช ๐“” โŸซ)
               โ†’ is-continuous ๐““ (๐“” โป) f
               โ†’ โˆƒ! fฬ… ๊ž‰ (๐“›D โ†’ โŸช ๐“” โŸซ) , is-continuous (๐“›-DCPOโŠฅ โป) (๐“” โป) fฬ…
                                      ร— is-strict ๐“›-DCPOโŠฅ ๐“” fฬ… ร— (fฬ… โˆ˜ ฮท ๏ผ f)
  Theorem-5-21 = ๐“›-gives-the-free-pointed-dcpo-on-a-dcpo


Section 6. Products and exponentials


module _ (๐“ฅ : Universe) where

 open import DomainTheory.Basics.Curry pt fe ๐“ฅ
 open import DomainTheory.Basics.Dcpo pt fe ๐“ฅ
 open import DomainTheory.Basics.Pointed pt fe ๐“ฅ
 open import DomainTheory.Basics.Products pt fe
 open DcpoProductsGeneral ๐“ฅ
 open import DomainTheory.Basics.ProductsContinuity pt fe ๐“ฅ
 open import DomainTheory.Basics.Exponential pt fe ๐“ฅ

 Definition-6-1 : DCPO {๐“ค} {๐“ฃ}
                โ†’ DCPO {๐“ค'} {๐“ฃ'}
                โ†’ DCPO {๐“ค โŠ” ๐“ค'} {๐“ฃ โŠ” ๐“ฃ'}
 Definition-6-1 ๐““ ๐“” = ๐““ ร—แตˆแถœแต–แต’ ๐“”

 Definition-6-1-ad : DCPOโŠฅ {๐“ค} {๐“ฃ}
                   โ†’ DCPOโŠฅ {๐“ค'} {๐“ฃ'}
                   โ†’ DCPOโŠฅ {๐“ค โŠ” ๐“ค'} {๐“ฃ โŠ” ๐“ฃ'}
 Definition-6-1-ad ๐““ ๐“” = ๐““ ร—แตˆแถœแต–แต’โŠฅ ๐“”

 Remark-6-2 : DCPO {๐“ค} {๐“ฃ}
            โ†’ DCPO {๐“ค} {๐“ฃ}
            โ†’ DCPO {๐“ค} {๐“ฃ}
 Remark-6-2 ๐““ ๐“” = ๐““ ร—แตˆแถœแต–แต’ ๐“”

 Proposition-6-3 : (๐““โ‚ : DCPO {๐“ค} {๐“ฃ}) (๐““โ‚‚ : DCPO {๐“ค'} {๐“ฃ'})
                   (๐“” : DCPO {๐“ฆ} {๐“ฆ'})
                   (f : โŸจ ๐“” โŸฉ โ†’ โŸจ ๐““โ‚ โŸฉ) (g : โŸจ ๐“” โŸฉ โ†’ โŸจ ๐““โ‚‚ โŸฉ)
                 โ†’ is-continuous ๐“” ๐““โ‚ f
                 โ†’ is-continuous ๐“” ๐““โ‚‚ g
                 โ†’ โˆƒ! k ๊ž‰ (โŸจ ๐“” โŸฉ โ†’ โŸจ ๐““โ‚ ร—แตˆแถœแต–แต’ ๐““โ‚‚ โŸฉ) ,
                           is-continuous ๐“” (๐““โ‚ ร—แตˆแถœแต–แต’ ๐““โ‚‚) k
                         ร— prโ‚ โˆ˜ k โˆผ f
                         ร— prโ‚‚ โˆ˜ k โˆผ g
 Proposition-6-3 = ร—แตˆแถœแต–แต’-is-product

 module _
         (๐““โ‚ : DCPO {๐“ค} {๐“ค'})
         (๐““โ‚‚ : DCPO {๐“ฃ} {๐“ฃ'})
         (๐“” : DCPO {๐“ฆ} {๐“ฆ'})
         (f : โŸจ ๐““โ‚ ร—แตˆแถœแต–แต’ ๐““โ‚‚ โŸฉ โ†’ โŸจ ๐“” โŸฉ)
        where

  Lemma-6-4 : ((e : โŸจ ๐““โ‚‚ โŸฉ) โ†’ is-continuous ๐““โ‚ ๐“” (ฮป d โ†’ f (d , e)))
            โ†’ ((d : โŸจ ๐““โ‚ โŸฉ) โ†’ is-continuous ๐““โ‚‚ ๐“” (ฮป e โ†’ f (d , e)))
            โ†’ is-continuous (๐““โ‚ ร—แตˆแถœแต–แต’ ๐““โ‚‚) ๐“” f
  Lemma-6-4 = continuous-in-argumentsโ†’continuous ๐““โ‚ ๐““โ‚‚ ๐“” f

  Lemma-6-4-ad : is-continuous (๐““โ‚ ร—แตˆแถœแต–แต’ ๐““โ‚‚) ๐“” f
               โ†’ ((e : โŸจ ๐““โ‚‚ โŸฉ) โ†’ is-continuous ๐““โ‚ ๐“” (ฮป d โ†’ f (d , e)))
               ร— ((d : โŸจ ๐““โ‚ โŸฉ) โ†’ is-continuous ๐““โ‚‚ ๐“” (ฮป e โ†’ f (d , e)))
  Lemma-6-4-ad c =
   (ฮป e โ†’ prโ‚‚ (continuousโ†’continuous-in-prโ‚ ๐““โ‚ ๐““โ‚‚ ๐“” (f , c) e)) ,
   (ฮป d โ†’ prโ‚‚ (continuousโ†’continuous-in-prโ‚‚ ๐““โ‚ ๐““โ‚‚ ๐“” (f , c) d))

 Definition-6-5 : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
                โ†’ DCPO {๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ค' โŠ” ๐“ฃ โŠ” ๐“ฃ'} {๐“ค โŠ” ๐“ฃ'}
 Definition-6-5 ๐““ ๐“” = ๐““ โŸนแตˆแถœแต–แต’ ๐“”

 Definition-6-5-ad : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPOโŠฅ {๐“ค'} {๐“ฃ'})
                   โ†’ DCPOโŠฅ {๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ค' โŠ” ๐“ฃ โŠ” ๐“ฃ'} {๐“ค โŠ” ๐“ฃ'}
 Definition-6-5-ad ๐““ ๐“” = ๐““ โŸนแตˆแถœแต–แต’โŠฅ' ๐“”

 Remark-6-6 : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
            โ†’ type-of (๐““ โŸนแตˆแถœแต–แต’ ๐“”) ๏ผ DCPO {๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ค' โŠ” ๐“ฃ โŠ” ๐“ฃ'} {๐“ค โŠ” ๐“ฃ'}
 Remark-6-6 ๐““ ๐“” = refl

 module _
         (๐““ : DCPO {๐“ค} {๐“ฃ'}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
        where


  We introduce two abbreviations for readability.


  ๐“”แดฐ = ๐““ โŸนแตˆแถœแต–แต’ ๐“”
  ev = underlying-function (๐“”แดฐ ร—แตˆแถœแต–แต’ ๐““) ๐“” (eval ๐““ ๐“”)

  Proposition-6-7 : (๐““' : DCPO {๐“ฆ} {๐“ฆ'})
                    (f : โŸจ ๐““' ร—แตˆแถœแต–แต’ ๐““ โŸฉ โ†’ โŸจ ๐“” โŸฉ)
                  โ†’ is-continuous (๐““' ร—แตˆแถœแต–แต’ ๐““) ๐“” f
                  โ†’ โˆƒ! fฬ… ๊ž‰ (โŸจ ๐““' โŸฉ โ†’ โŸจ ๐“”แดฐ โŸฉ) ,
                           is-continuous ๐““' ๐“”แดฐ fฬ…
                         ร— ev โˆ˜ (ฮป (d' , d) โ†’ fฬ… d' , d) โˆผ f
  Proposition-6-7 = โŸนแตˆแถœแต–แต’-is-exponential ๐““ ๐“”

  Proposition-6-7-ad : is-continuous (๐“”แดฐ ร—แตˆแถœแต–แต’ ๐““) ๐“” ev
  Proposition-6-7-ad = continuity-of-function (๐“”แดฐ ร—แตˆแถœแต–แต’ ๐““) ๐“” (eval ๐““ ๐“”)

 open import DomainTheory.Basics.LeastFixedPoint pt fe ๐“ฅ

 module _ (๐““ : DCPOโŠฅ {๐“ค} {๐“ฃ}) where

  Theorem-6-8 : DCPO[ ((๐““ โŸนแตˆแถœแต–แต’โŠฅ ๐““) โป) , (๐““ โป) ]
  Theorem-6-8 = ฮผ ๐““

  Theorem-6-8-i : (f : DCPO[ ๐““ โป , ๐““ โป ])
                โ†’ [ (๐““ โŸนแตˆแถœแต–แต’โŠฅ ๐““) โป , ๐““ โป ]โŸจ ฮผ ๐““ โŸฉ f
                ๏ผ [ ๐““ โป , ๐““ โป ]โŸจ f โŸฉ ([ (๐““ โŸนแตˆแถœแต–แต’โŠฅ ๐““) โป , ๐““ โป ]โŸจ ฮผ ๐““ โŸฉ f)
  Theorem-6-8-i = ฮผ-gives-a-fixed-point ๐““

  Theorem-6-8-ii : (f : DCPO[ (๐““ โป) , (๐““ โป) ])
                   (x : โŸช ๐““ โŸซ)
                 โ†’ [ ๐““ โป , ๐““ โป ]โŸจ f โŸฉ x  โŠ‘โŸช ๐““ โŸซ x
                 โ†’ [ (๐““ โŸนแตˆแถœแต–แต’โŠฅ ๐““) โป , ๐““ โป ]โŸจ ฮผ ๐““ โŸฉ f โŠ‘โŸช ๐““ โŸซ x
  Theorem-6-8-ii = ฮผ-gives-lowerbound-of-fixed-points ๐““


Section 7. Bilimits


module _ (๐“ฅ : Universe) where

 open import DomainTheory.Basics.Dcpo pt fe ๐“ฅ
 open import DomainTheory.Basics.Exponential pt fe ๐“ฅ
 open import DomainTheory.Basics.Miscelanea pt fe ๐“ฅ

 Definition-7-1 : (๐““ : DCPO {๐“ค} {๐“ฃ}) โ†’ DCPO[ ๐““ , ๐““ ] โ†’ ๐“ค โŠ” ๐“ฃ ฬ‡
 Definition-7-1 = is-deflation

 Definition-7-2 : (๐““ : DCPO {๐“ค} {๐“ฃ}) (๐“” : DCPO {๐“ค'} {๐“ฃ'})
                โ†’ ๐“ฅ โบ โŠ” ๐“ค โŠ” ๐“ฃ โŠ” ๐“ค' โŠ” ๐“ฃ' ฬ‡
 Definition-7-2 ๐““ ๐“” = ฮฃ s ๊ž‰ DCPO[ ๐““ , ๐“” ] ,
                      ฮฃ r ๊ž‰ DCPO[ ๐“” , ๐““ ] , is-embedding-projection-pair ๐““ ๐“” s r

 module setup
         {๐“ค ๐“ฃ : Universe}
         {I : ๐“ฅ ฬ‡ }
         (_โŠ‘_ : I โ†’ I โ†’ ๐“ฆ ฬ‡ )
         (โŠ‘-refl : {i : I} โ†’ i โŠ‘ i)
         (โŠ‘-trans : {i j k : I} โ†’ i โŠ‘ j โ†’ j โŠ‘ k โ†’ i โŠ‘ k)
         (โŠ‘-prop-valued : (i j : I) โ†’ is-prop (i โŠ‘ j))
         (I-inhabited : โˆฅ I โˆฅ)
         (I-semidirected : (i j : I) โ†’ โˆƒ k ๊ž‰ I , i โŠ‘ k ร— j โŠ‘ k)
         (๐““ : I โ†’ DCPO {๐“ค} {๐“ฃ})
         (ฮต : {i j : I} โ†’ i โŠ‘ j โ†’ โŸจ ๐““ i โŸฉ โ†’ โŸจ ๐““ j โŸฉ)
         (ฯ€ : {i j : I} โ†’ i โŠ‘ j โ†’ โŸจ ๐““ j โŸฉ โ†’ โŸจ ๐““ i โŸฉ)
         (ฮตฯ€-deflation : {i j : I} (l : i โŠ‘ j) (x : โŸจ ๐““ j โŸฉ)
                       โ†’ ฮต l (ฯ€ l x) โŠ‘โŸจ ๐““ j โŸฉ x )
         (ฮต-section-of-ฯ€ : {i j : I} (l : i โŠ‘ j) โ†’ ฯ€ l โˆ˜ ฮต l โˆผ id )
         (ฮต-is-continuous : {i j : I} (l : i โŠ‘ j)
                          โ†’ is-continuous (๐““ i) (๐““ j) (ฮต {i} {j} l))
         (ฯ€-is-continuous : {i j : I} (l : i โŠ‘ j)
                          โ†’ is-continuous (๐““ j) (๐““ i) (ฯ€ {i} {j} l))
         (ฮต-id : (i : I ) โ†’ ฮต (โŠ‘-refl {i}) โˆผ id)
         (ฯ€-id : (i : I ) โ†’ ฯ€ (โŠ‘-refl {i}) โˆผ id)
         (ฮต-comp : {i j k : I} (l : i โŠ‘ j) (m : j โŠ‘ k)
                 โ†’ ฮต m โˆ˜ ฮต l โˆผ ฮต (โŠ‘-trans l m))
         (ฯ€-comp : {i j k : I} (l : i โŠ‘ j) (m : j โŠ‘ k)
                 โ†’ ฯ€ l โˆ˜ ฯ€ m โˆผ ฯ€ (โŠ‘-trans l m))
       where

  open import DomainTheory.Bilimits.Directed pt fe ๐“ฅ ๐“ค ๐“ฃ
  open Diagram _โŠ‘_ โŠ‘-refl โŠ‘-trans โŠ‘-prop-valued
               I-inhabited I-semidirected
               ๐““ ฮต ฯ€
               ฮตฯ€-deflation ฮต-section-of-ฯ€
               ฮต-is-continuous ฯ€-is-continuous
               ฮต-id ฯ€-id ฮต-comp ฯ€-comp
  open PosetAxioms

  -- Example-7-3: See the file
  import DomainTheory.Bilimits.Sequential

  Definition-7-4 : ฮฃ ๐““โˆž ๊ž‰ ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค ฬ‡ ,
                   ฮฃ _โ‰ผ_ ๊ž‰ (๐““โˆž โ†’ ๐““โˆž โ†’ ๐“ฅ โŠ” ๐“ฃ ฬ‡ ) ,
                   poset-axioms _โ‰ผ_
  Definition-7-4 = ๐““โˆž-carrier , _โ‰ผ_  , ๐““โˆž-poset-axioms

  Lemma-7-5 : is-directed-complete _โ‰ผ_
  Lemma-7-5 = directed-completeness ๐““โˆž

  Lemma-7-5-ad : DCPO {๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค} {๐“ฅ โŠ” ๐“ฃ}
  Lemma-7-5-ad = ๐““โˆž

  -- Remark-7-6: See code for Section 8 below.

  Definition-7-7 : (i : I) โ†’ โŸจ ๐““โˆž โŸฉ โ†’ โŸจ ๐““ i โŸฉ
  Definition-7-7 = ฯ€โˆž

  Lemma-7-8 : (i : I) โ†’ is-continuous ๐““โˆž (๐““ i) (ฯ€โˆž i)
  Lemma-7-8 = ฯ€โˆž-is-continuous

  Definition-7-9 : {i j : I} (x : โŸจ ๐““ i โŸฉ)
                 โ†’ (ฮฃ k ๊ž‰ I , i โŠ‘ k ร— j โŠ‘ k) โ†’ โŸจ ๐““ j โŸฉ
  Definition-7-9 = ฮบ

  Lemma-7-10 : (i j : I) (x : โŸจ ๐““ i โŸฉ) โ†’ wconstant (ฮบ x)
  Lemma-7-10 = ฮบ-wconstant

  Lemma-7-10-ad : (i j : I) (x : โŸจ ๐““ i โŸฉ)
                โ†’ ฮฃ (ฮป ฮบ' โ†’ ฮบ x โˆผ ฮบ' โˆ˜ โˆฃ_โˆฃ)
  Lemma-7-10-ad i j x  =
   wconstant-map-to-set-factors-through-truncation-of-domain
    (sethood (๐““ j)) (ฮบ x) (ฮบ-wconstant i j x)

  Definition-7-11 : (i j : I) โ†’ โŸจ ๐““ i โŸฉ โ†’ โŸจ ๐““ j โŸฉ
  Definition-7-11 = ฯ

  Definition-7-11-ad : {i j k : I} (lแตข : i โŠ‘ k) (lโฑผ : j โŠ‘ k) (x : โŸจ ๐““ i โŸฉ)
                     โ†’ ฯ i j x ๏ผ ฮบ x (k , lแตข , lโฑผ)
  Definition-7-11-ad = ฯ-in-terms-of-ฮบ

  Definition-7-12 : (i : I) โ†’ โŸจ ๐““ i โŸฉ โ†’ โŸจ ๐““โˆž โŸฉ
  Definition-7-12 = ฮตโˆž

  Lemma-7-13 : (i j : I) โ†’ is-continuous (๐““ i) (๐““ j) (ฯ i j)
  Lemma-7-13 = ฯ-is-continuous

  Lemma-7-14 : (i : I) โ†’ is-continuous (๐““ i) ๐““โˆž (ฮตโˆž i)
  Lemma-7-14 = ฮตโˆž-is-continuous

  Theorem-7-15 : (i : I) โ†’ ฮฃ s ๊ž‰ DCPO[ ๐““ i , ๐““โˆž ] ,
                           ฮฃ r ๊ž‰ DCPO[ ๐““โˆž , ๐““ i ] ,
                               is-embedding-projection-pair (๐““ i) ๐““โˆž s r
  Theorem-7-15 i = ฮตโˆž' i , ฯ€โˆž' i , ฮตโˆž-section-of-ฯ€โˆž , ฮตโˆžฯ€โˆž-deflation

  Lemma-7-16 : (i j : I) (l : i โŠ‘ j)
             โ†’ (ฯ€ l โˆ˜ ฯ€โˆž j โˆผ ฯ€โˆž i)
             ร— (ฮตโˆž j โˆ˜ ฮต l โˆผ ฮตโˆž i)
  Lemma-7-16 i j l = ฯ€โˆž-commutes-with-ฯ€s i j l , ฮตโˆž-commutes-with-ฮตs i j l

  Theorem-7-17 : (๐“” : DCPO {๐“ค'} {๐“ฃ'}) (f : (i : I) โ†’ โŸจ ๐“” โŸฉ โ†’ โŸจ ๐““ i โŸฉ)
               โ†’ ((i : I) โ†’ is-continuous ๐“” (๐““ i) (f i))
               โ†’ ((i j : I) (l : i โŠ‘ j) โ†’ ฯ€ l โˆ˜ f j โˆผ f i)
               โ†’ โˆƒ! fโˆž ๊ž‰ (โŸจ ๐“” โŸฉ โ†’ โŸจ ๐““โˆž โŸฉ) , is-continuous ๐“” ๐““โˆž fโˆž
                                          ร— ((i : I) โ†’ ฯ€โˆž i โˆ˜ fโˆž โˆผ f i)
  Theorem-7-17 = DcpoCone.๐““โˆž-is-limit

  Lemma-7-18 : (ฯƒ : โŸจ ๐““โˆž โŸฉ) (i j : I)
             โ†’ i โŠ‘ j โ†’ ฮตโˆž i (โฆ… ฯƒ โฆ† i) โ‰ผ  ฮตโˆž j (โฆ… ฯƒ โฆ† j)
  Lemma-7-18 = ฮตโˆž-family-is-monotone

  Lemma-7-19 : (ฯƒ : โŸจ ๐““โˆž โŸฉ)
             โ†’ ฯƒ ๏ผ โˆ ๐““โˆž {I} {ฮป i โ†’ ฮตโˆž i (โฆ… ฯƒ โฆ† i)} (ฮตโˆž-family-is-directed ฯƒ)
  Lemma-7-19 = โˆ-of-ฮตโˆžs

  Lemma-7-20 : โˆ (๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž) ฮตโˆžฯ€โˆž-family-is-directed
             ๏ผ id , id-is-continuous ๐““โˆž
  Lemma-7-20 = โˆ-of-ฮตโˆžฯ€โˆžs-is-id

  Theorem-7-21 : (๐“” : DCPO {๐“ค'} {๐“ฃ'}) (g : (i : I) โ†’ โŸจ ๐““ i โŸฉ โ†’ โŸจ ๐“” โŸฉ)
               โ†’ ((i : I) โ†’ is-continuous (๐““ i) ๐“” (g i))
               โ†’ ((i j : I) (l : i โŠ‘ j) โ†’ g j โˆ˜ ฮต l โˆผ g i)
               โ†’ โˆƒ! gโˆž ๊ž‰ (โŸจ ๐““โˆž โŸฉ โ†’ โŸจ ๐“” โŸฉ) , is-continuous ๐““โˆž ๐“” gโˆž
                                           ร— ((i : I) โ†’ gโˆž โˆ˜ ฮตโˆž i โˆผ g i)
  Theorem-7-21 = DcpoCocone.๐““โˆž-is-colimit

  Proposition-7-22 : ((i : I) โ†’ is-locally-small (๐““ i)) โ†’ is-locally-small ๐““โˆž
  Proposition-7-22 = ๐““โˆž-is-locally-small


Section 8. Scott's Dโˆž model of the untyped ฮป-calculus


open import DomainTheory.Basics.Dcpo pt fe ๐“คโ‚€
open import DomainTheory.Basics.Exponential pt fe ๐“คโ‚€
open import DomainTheory.Basics.Miscelanea pt fe ๐“คโ‚€
open import DomainTheory.Basics.Pointed pt fe ๐“คโ‚€

open import DomainTheory.Bilimits.Dinfinity pt fe pe

Definition-8-1 : (n : โ„•) โ†’ DCPOโŠฅ {๐“คโ‚} {๐“คโ‚}
Definition-8-1 = ๐““โŠฅ

Definition-8-2 : (n : โ„•)
               โ†’ DCPO[ ๐““ n , ๐““ (succ n) ]
               ร— DCPO[ ๐““ (succ n) , ๐““ n ]
Definition-8-2 n = ฮต' n , ฯ€' n

Lemma-8-3 : (n : โ„•)
          โ†’ is-embedding-projection-pair (๐““ n) (๐““ (succ n)) (ฮต' n) (ฯ€' n)
Lemma-8-3 n = ฮต-section-of-ฯ€ n , ฮตฯ€-deflation n

Definition-8-4 : (n m : โ„•) โ†’ n โ‰ค m
               โ†’ DCPO[ ๐““ n , ๐““ m ]
               ร— DCPO[ ๐““ m , ๐““ n ]
Definition-8-4 n m l = (ฮตโบ l , ฮตโบ-is-continuous l) ,
                       (ฯ€โบ l , ฯ€โบ-is-continuous l)

Definition-8-5 : DCPO {๐“คโ‚} {๐“คโ‚}
Definition-8-5 = ๐““โˆž

Lemma-8-6 : (n : โ„•) โ†’ is-strict (๐““โŠฅ (succ n)) (๐““โŠฅ n) (ฯ€ n)
Lemma-8-6 = ฯ€-is-strict

Lemma-8-6-ad : (n m : โ„•) (l : n โ‰ค m) โ†’ is-strict (๐““โŠฅ m) (๐““โŠฅ n) (ฯ€โบ l)
Lemma-8-6-ad = ฯ€โบ-is-strict

Proposition-8-7 : has-least (underlying-order ๐““โˆž)
Proposition-8-7 = ๐““โˆž-has-least

Definition-8-8 : (n : โ„•) โ†’ โŸจ ๐““ n โŸฉ โ†’ โŸจ ๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž โŸฉ
Definition-8-8 = ฮต-exp


To match the paper we introduce the following notation (although the subscript
can't really function as the argument)


ฮฆโ‚™ = ฮต-exp

Lemma-8-9 : (n m : โ„•) (l : n โ‰ค m) โ†’ ฮฆโ‚™ m โˆ˜ ฮตโบ l โˆผ ฮฆโ‚™ n
Lemma-8-9 = ฮต-exp-commutes-with-ฮตโบ

Definition-8-10 : โŸจ ๐““โˆž โŸฉ โ†’ โŸจ ๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž โŸฉ
Definition-8-10 = ฮต-expโˆž

ฮฆ = Definition-8-10

Lemma-8-11 : (ฯƒ : โŸจ ๐““โˆž โŸฉ)
           โ†’ ฮฆ ฯƒ ๏ผ โˆ (๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž) {โ„•} {ฮป n โ†’ ฮฆโ‚™ (succ n) (โฆ… ฯƒ โฆ† (succ n))}
                                          (ฮต-exp-family-is-directed ฯƒ)
Lemma-8-11 = ฮต-expโˆž-alt

Definition-8-12 : (n : โ„•) โ†’ โŸจ ๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž โŸฉ โ†’ โŸจ ๐““ n โŸฉ
Definition-8-12 = ฯ€-exp


To match the paper we introduce the following notation (although the subscript
can't really function as the argument)


ฮจโ‚™ = ฯ€-exp

Lemma-8-13 : (n m : โ„•) (l : n โ‰ค m) โ†’ ฯ€โบ l โˆ˜ ฮจโ‚™ m โˆผ ฮจโ‚™ n
Lemma-8-13 = ฯ€-exp-commutes-with-ฯ€โบ

Definition-8-14 : โŸจ ๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž โŸฉ โ†’ โŸจ ๐““โˆž โŸฉ
Definition-8-14 = ฯ€-expโˆž

ฮจ = Definition-8-14

Lemma-8-15 : (f : โŸจ ๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž โŸฉ)
           โ†’ ฮจ f ๏ผ โˆ ๐““โˆž {โ„•} {ฮป n โ†’ ฮตโˆž (succ n) (ฮจโ‚™ (succ n) f)}
                             (ฯ€-exp-family-is-directed f)
Lemma-8-15 = ฯ€-expโˆž-alt

Theorem-8-16 : ฮจ โˆ˜ ฮฆ โˆผ id
             ร— ฮฆ โˆ˜ ฮจ โˆผ id
             ร— ๐““โˆž โ‰ƒแตˆแถœแต–แต’ (๐““โˆž โŸนแตˆแถœแต–แต’ ๐““โˆž)
Theorem-8-16 = ฮต-expโˆž-section-of-ฯ€-expโˆž ,
               ฯ€-expโˆž-section-of-ฮต-expโˆž ,
               ๐““โˆž-isomorphic-to-its-self-exponential

Remark-8-17 : ฮฃ ฯƒโ‚€ ๊ž‰ โŸจ ๐““โˆž โŸฉ , ฯƒโ‚€ โ‰  โŠฅ ๐““โˆžโŠฅ
Remark-8-17 = ฯƒโ‚€ , ๐““โˆžโŠฅ-is-nontrivial