Tom de Jong, 26 Feburary 2020
Minor updates on 28 January 2022
We construct the rounded ideal completion of an abstract basis, cf. Section
2.2.6 in Domain Theory by Abramsky and Jung.
Further properties and developments are in the file IdealCompletion-Properties.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan hiding (J)
open import UF.FunExt
open import UF.PropTrunc
open import UF.Subsingletons
module DomainTheory.IdealCompletion.IdealCompletion
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
(pe : Prop-Ext)
(π₯ : Universe)
where
open import DomainTheory.Basics.Dcpo pt fe π₯
open import OrderedTypes.Poset fe
open import UF.Powerset
open import UF.Sets
open import UF.Sets-Properties
open import UF.SubtypeClassifier
open import UF.Subsingletons-FunExt
open PosetAxioms
open PropositionalTruncation pt
module Ideals
{P : π€ Μ }
(_βΊ_ : P β P β π₯ β π£ Μ )
(βΊ-prop-valued : {p q : P} β is-prop (p βΊ q))
(INTβ : {qβ qβ p : P} β qβ βΊ p β qβ βΊ p
β β r κ P , qβ βΊ r Γ qβ βΊ r Γ r βΊ p)
(INTβ : (p : P) β β q κ P , q βΊ p)
(βΊ-trans : {p q r : P} β p βΊ q β q βΊ r β p βΊ r)
where
is-lowerset : (P β Ξ© (π₯ β π£)) β π₯ β π€ β π£ Μ
is-lowerset A = (p q : P) β p βΊ q β q β A β p β A
being-lowerset-is-prop : (I : P β Ξ© (π₯ β π£)) β is-prop (is-lowerset I)
being-lowerset-is-prop I = Ξ β-is-prop fe (Ξ» p q l i β β-is-prop I p)
is-inhabited-set : (P β Ξ© (π₯ β π£)) β π€ β π₯ β π£ Μ
is-inhabited-set A = β p κ P , p β A
being-inhabited-set-is-prop : (I : P β Ξ© (π₯ β π£))
β is-prop (is-inhabited-set I)
being-inhabited-set-is-prop I = β₯β₯-is-prop
is-semidirected-set : (P β Ξ© (π₯ β π£)) β π₯ β π€ β π£ Μ
is-semidirected-set A = (p q : P) β p β A β q β A
β β r κ P , r β A
Γ p βΊ r Γ q βΊ r
being-semidirected-set-is-prop : (I : P β Ξ© (π₯ β π£))
β is-prop (is-semidirected-set I)
being-semidirected-set-is-prop I = Ξ β-is-prop fe (Ξ» p q i j β β-is-prop)
is-directed-set : (P β Ξ© (π₯ β π£)) β π₯ β π€ β π£ Μ
is-directed-set A = is-inhabited-set A Γ is-semidirected-set A
being-directed-set-is-prop : (I : P β Ξ© (π₯ β π£))
β is-prop (is-directed-set I)
being-directed-set-is-prop I =
Γ-is-prop
(being-inhabited-set-is-prop I)
(being-semidirected-set-is-prop I)
directed-sets-are-inhabited : (A : P β Ξ© (π₯ β π£))
β is-directed-set A β is-inhabited-set A
directed-sets-are-inhabited A = prβ
directed-sets-are-semidirected : (A : P β Ξ© (π₯ β π£))
β is-directed-set A
β is-semidirected-set A
directed-sets-are-semidirected A = prβ
is-ideal : (P β Ξ© (π₯ β π£)) β π₯ β π€ β π£ Μ
is-ideal I = is-lowerset I Γ is-directed-set I
being-ideal-is-prop : (I : P β Ξ© (π₯ β π£)) β is-prop (is-ideal I)
being-ideal-is-prop I =
Γ-is-prop
(being-lowerset-is-prop I)
(being-directed-set-is-prop I)
ideals-are-lowersets : (I : P β Ξ© (π₯ β π£)) β is-ideal I β is-lowerset I
ideals-are-lowersets I = prβ
ideals-are-directed-sets : (I : P β Ξ© (π₯ β π£))
β is-ideal I β is-directed-set I
ideals-are-directed-sets I = prβ
ideals-are-inhabited : (I : P β Ξ© (π₯ β π£))
β is-ideal I β is-inhabited-set I
ideals-are-inhabited I ΞΉ =
directed-sets-are-inhabited I (ideals-are-directed-sets I ΞΉ)
ideals-are-semidirected : (I : P β Ξ© (π₯ β π£))
β is-ideal I β is-semidirected-set I
ideals-are-semidirected I ΞΉ =
directed-sets-are-semidirected I (ideals-are-directed-sets I ΞΉ)
Idl : π₯ βΊ β π£ βΊ β π€ Μ
Idl = Ξ£ I κ (P β Ξ© (π₯ β π£)) , is-ideal I
carrier : Idl β P β Ξ© (π₯ β π£)
carrier = prβ
ideality : (I : Idl) β is-ideal (carrier I)
ideality = prβ
_βα΅’_ : P β Idl β π₯ β π£ Μ
p βα΅’ I = p β carrier I
_β_ : Idl β Idl β π₯ β π€ β π£ Μ
I β J = carrier I β carrier J
Idl-β : {π : π₯ Μ } (Ξ± : π β Idl) β is-directed _β_ Ξ± β Idl
Idl-β {π} Ξ± Ξ΄ = (βΞ± , ls , inh , Ξ΅)
where
open unions-of-small-families pt π₯ π£ P
βΞ± : P β Ξ© (π₯ β π£)
βΞ± = β (carrier β Ξ±)
ls : is-lowerset βΞ±
ls p q l = β₯β₯-functor Ξ³
where
Ξ³ : (Ξ£ a κ π , q βα΅’ Ξ± a) β (Ξ£ a κ π , p βα΅’ Ξ± a)
Ξ³ (a , u) = a , ideals-are-lowersets (carrier (Ξ± a)) (ideality (Ξ± a))
p q l u
inh : β p κ P , p β βΞ±
inh = β₯β₯-rec β₯β₯-is-prop Ξ³ (inhabited-if-directed _β_ Ξ± Ξ΄)
where
Ξ³ : π β β p κ P , p β βΞ±
Ξ³ a = β₯β₯-functor h inh'
where
inh' : is-inhabited-set (carrier (Ξ± a))
inh' = directed-sets-are-inhabited (carrier (Ξ± a))
(ideals-are-directed-sets (carrier (Ξ± a)) (ideality (Ξ± a)))
h : (Ξ£ p κ P , p βα΅’ Ξ± a) β (Ξ£ p κ P , p β βΞ±)
h (p , u) = p , β£ a , u β£
Ξ΅ : is-semidirected-set βΞ±
Ξ΅ p q i j = β₯β₯-recβ β₯β₯-is-prop Ξ³ i j
where
Ξ³ : (Ξ£ a κ π , p βα΅’ Ξ± a)
β (Ξ£ b κ π , q βα΅’ Ξ± b)
β β r κ P , r β βΞ± Γ p βΊ r Γ q βΊ r
Ξ³ (a , ia) (b , jb) =
β₯β₯-rec β₯β₯-is-prop g (semidirected-if-directed _β_ Ξ± Ξ΄ a b)
where
g : (Ξ£ c κ π , Ξ± a β Ξ± c Γ Ξ± b β Ξ± c)
β β r κ P , r β βΞ± Γ p βΊ r Γ q βΊ r
g (c , l , m) = do
(r , k , u , v) β directed-sets-are-semidirected (carrier (Ξ± c))
(ideals-are-directed-sets (carrier (Ξ± c))
(ideality (Ξ± c)))
p q ic jc
β£ r , β£ c , k β£ , u , v β£
where
ic : p βα΅’ Ξ± c
ic = l p ia
jc : q βα΅’ Ξ± c
jc = m q jb
Idl-DCPO : DCPO {π₯ βΊ β π£ βΊ β π€} {π₯ β π€ β π£}
Idl-DCPO = Idl , _β_ , Ξ³
where
Ξ³ : dcpo-axioms _β_
Ξ³ = pa , dc
where
pa : poset-axioms _β_
pa = s , pv , r , t , a
where
s : is-set Idl
s = subtypes-of-sets-are-sets' carrier
(prβ-lc Ξ» {I} β being-ideal-is-prop I)
(powersets-are-sets'' fe fe pe)
pv : is-prop-valued _β_
pv I J = β-is-prop' fe fe (carrier I) (carrier J)
r : (I : Idl) β I β I
r I = β-refl' (carrier I)
t : is-transitive _β_
t I J K = β-trans' (carrier I) (carrier J) (carrier K)
a : is-antisymmetric _β_
a I J u v = to-subtype-οΌ
(Ξ» K β being-ideal-is-prop K)
(subset-extensionality'' pe fe fe u v)
dc : is-directed-complete _β_
dc π Ξ± Ξ΄ = (Idl-β Ξ± Ξ΄) , ub , lb
where
ub : (a : π) β Ξ± a β Idl-β Ξ± Ξ΄
ub a p p-in-a = β£ a , p-in-a β£
lb : is-lowerbound-of-upperbounds _β_ (Idl-β Ξ± Ξ΄) Ξ±
lb I ub p p-in-βΞ± = β₯β₯-rec (β-is-prop (carrier I) p) h p-in-βΞ±
where
h : (Ξ£ a κ π , p βα΅’ Ξ± a) β p βα΅’ I
h (a , q) = ub a p q
\end{code}