Tom de Jong, 9 January 2026 The extended partial Dedekind reals as a pointed dcpo. \begin{code} {-# OPTIONS --safe --without-K #-} open import MLTT.Spartan open import UF.FunExt open import UF.PropTrunc open import UF.Subsingletons module DomainTheory.Examples.ExtendedPartialDedekindReals (pt : propositional-truncations-exist) (fe : Fun-Ext) (pe : Prop-Ext) where open PropositionalTruncation pt open import DomainTheory.Basics.Dcpo pt fe ๐คโ open import DomainTheory.Basics.Pointed pt fe ๐คโ open import OrderedTypes.Poset fe open PosetAxioms open import Notation.Order using (_<_ ; _โฎ_) open import Rationals.Order open import Rationals.Type open import UF.Base open import UF.Powerset open unions-of-small-families pt ๐คโ ๐คโ โ open import Various.DedekindNonAxiomatic pt fe pe extended-partial-Dedekind-reals : ๐คโฬ extended-partial-Dedekind-reals = ๐กโ private L U : ๐กโ โ ๐ โ L x = prโ (prโ x) U x = prโ (prโ x) L-is-lower : (x : ๐กโ) โ is-lower (L x) L-is-lower x = prโ (prโ (prโ x)) L-is-upper-open : (x : ๐กโ) โ is-upper-open (L x) L-is-upper-open x = prโ (prโ (prโ x)) U-is-upper : (x : ๐กโ) โ is-upper (U x) U-is-upper x = prโ (prโ (prโ (prโ x))) U-is-lower-open : (x : ๐กโ) โ is-lower-open (U x) U-is-lower-open x = prโ (prโ (prโ (prโ x))) orderedness : (x : ๐กโ) โ are-ordered (L x) (U x) orderedness x = prโ (prโ (prโ x)) _โ_ : ๐กโ โ ๐กโ โ ๐คโฬ x โ y = (L x โ L y) ร (U x โ U y) L-inclusion : (x y : ๐กโ) โ x โ y โ L x โ L y L-inclusion x y = prโ U-inclusion : (x y : ๐กโ) โ x โ y โ U x โ U y U-inclusion x y = prโ โ-is-prop : (x y : ๐กโ) โ is-prop (x โ y) โ-is-prop x y = ร-is-prop (โ-is-prop fe (L x) (L y)) (โ-is-prop fe (U x) (U y)) โ-refl : is-reflexive _โ_ โ-refl x = (โ-refl (L x) , โ-refl (U x)) โ-trans : is-transitive _โ_ โ-trans x y z (uโ , uโ) (vโ , vโ) = (โ-trans (L x) (L y) (L z) uโ vโ) , โ-trans (U x) (U y) (U z) uโ vโ โ-antisym : is-antisymmetric _โ_ โ-antisym x y (uโ , uโ) (vโ , vโ) = to-subtype-๏ผ (ฮป (L , U) โ รโ-is-prop (ร-is-prop (being-lower-is-prop L) (being-upper-open-is-prop L)) (ร-is-prop (being-upper-is-prop U) (being-lower-open-is-prop U)) (being-ordered-is-prop L U)) (to-ร-๏ผ (subset-extensionality pe fe uโ vโ) (subset-extensionality pe fe uโ vโ)) directed-join : {I : ๐คโฬ } (x : I โ ๐กโ) โ is-directed _โ_ x โ ๐กโ directed-join {I} x ฮด = (Lโ , Uโ) , (Lโ-is-lower , Lโ-is-upper-open) , (Uโ-is-upper , Uโ-is-lower-open) , Lโ-Uโ-are-ordered where Lโ : ๐ โ Lโ = โ (L โ x) Uโ : ๐ โ Uโ = โ (U โ x) Lโ-is-lower : is-lower Lโ Lโ-is-lower q q-in-union p p-below-q = โฅโฅ-rec (โ-is-prop Lโ p) h q-in-union where h : (ฮฃ i ๊ I , q โ L (x i)) โ p โ Lโ h (i , m) = โฃ i , L-is-lower (x i) q m p p-below-q โฃ Lโ-is-upper-open : is-upper-open Lโ Lโ-is-upper-open p = โฅโฅ-rec โ-is-prop h where h : (ฮฃ i ๊ I , p โ L (x i)) โ โ p' ๊ โ , p < p' ร p' โ Lโ h (i , m) = โฅโฅ-functor (ฮป (p' , l , n) โ p' , l , โฃ i , n โฃ) (L-is-upper-open (x i) p m) Uโ-is-upper : is-upper Uโ Uโ-is-upper q q-in-union p q-below-p = โฅโฅ-rec (โ-is-prop Uโ p) h q-in-union where h : (ฮฃ i ๊ I , q โ U (x i)) โ p โ Uโ h (i , m) = โฃ i , U-is-upper (x i) q m p q-below-p โฃ Uโ-is-lower-open : is-lower-open Uโ Uโ-is-lower-open p = โฅโฅ-rec โ-is-prop h where h : (ฮฃ i ๊ I , p โ U (x i)) โ โ p' ๊ โ , p' < p ร p' โ Uโ h (i , m) = โฅโฅ-functor (ฮป (p' , l , n) โ p' , l , โฃ i , n โฃ) (U-is-lower-open (x i) p m) Lโ-Uโ-are-ordered : are-ordered Lโ Uโ Lโ-Uโ-are-ordered p q p-in-Lโ q-in-Uโ = โฅโฅ-recโ (โ<-is-prop p q) h p-in-Lโ q-in-Uโ where h : ฮฃ i ๊ I , p โ L (x i) โ ฮฃ j ๊ I , q โ U (x j) โ p < q h (i , m) (j , n) = โฅโฅ-rec (โ<-is-prop p q) h' (semidirected-if-directed _โ_ x ฮด i j) where h' : ฮฃ k ๊ I , (x i โ x k) ร (x j โ x k) โ p < q h' (k , inclโ , inclโ) = orderedness (x k) p q (L-inclusion (x i) (x k) inclโ p m) (U-inclusion (x j) (x k) inclโ q n) directed-join-is-upper-bound : {I : ๐คโ ฬ } (x : I โ ๐กโ) (ฮด : is-directed _โ_ x) โ is-upperbound _โ_ (directed-join x ฮด) x directed-join-is-upper-bound x ฮด i = โ-is-upperbound (L โ x) i , โ-is-upperbound (U โ x) i directed-join-is-lower-bound-of-upper-bounds : {I : ๐คโ ฬ } (x : I โ ๐กโ) (ฮด : is-directed _โ_ x) โ is-lowerbound-of-upperbounds _โ_ (directed-join x ฮด) x directed-join-is-lower-bound-of-upper-bounds x ฮด y y-is-ub = โ-is-lowerbound-of-upperbounds (L โ x) (L y) (ฮป i โ L-inclusion (x i) y (y-is-ub i)) , โ-is-lowerbound-of-upperbounds (U โ x) (U y) (ฮป i โ U-inclusion (x i) y (y-is-ub i)) ๐กโ-DCPO : DCPO {๐คโ} {๐คโ} ๐กโ-DCPO = ๐กโ , _โ_ , (๐กโ-is-set , โ-is-prop , โ-refl , โ-trans , โ-antisym) , (ฮป I x ฮด โ directed-join x ฮด , directed-join-is-upper-bound x ฮด , directed-join-is-lower-bound-of-upper-bounds x ฮด) ๐กโ-DCPOโฅ : DCPOโฅ {๐คโ} {๐คโ} ๐กโ-DCPOโฅ = ๐กโ-DCPO , (โฅ๐กโ , (ฮป x โ (ฮป _ โ ๐-elim) , (ฮป _ โ ๐-elim))) \end{code}