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 {๐ค} {๐ฃ}
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
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
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
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
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 = ๐โ
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