--------------------------------------------------------------------------------
title: The Sierpiลski locale
author: Ayberk Tosun
date-completed: 2024-02-12
dates-updated: [2024-03-09]
--------------------------------------------------------------------------------
This module contains the definition of the Sierpiลski locale as the Scott locale
of the Sierpiลski the dcpo.
In the future, other constructions of the Sierpiลski locale might be added here.
\begin{code}
{-# OPTIONS --safe --without-K --lossy-unification #-}
open import UF.FunExt
open import MLTT.Spartan hiding (๐)
open import UF.PropTrunc
open import UF.Subsingletons
open import UF.Size hiding (is-locally-small)
module Locales.Sierpinski.Definition
(๐ค : Universe)
(pe : Prop-Ext)
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
(sr : Set-Replacement pt) where
open import DomainTheory.BasesAndContinuity.Bases pt fe ๐ค
open import DomainTheory.BasesAndContinuity.Continuity pt fe ๐ค
open import DomainTheory.Basics.Dcpo pt fe ๐ค renaming (โจ_โฉ to โจ_โฉโ)
open import DomainTheory.Basics.Miscelanea pt fe ๐ค
open import DomainTheory.Basics.Pointed pt fe ๐ค renaming (โฅ to โฅโ)
open import DomainTheory.Basics.WayBelow pt fe ๐ค
open import DomainTheory.Lifting.LiftingSet pt fe ๐ค pe
open import DomainTheory.Lifting.LiftingSetAlgebraic pt pe fe ๐ค
open import DomainTheory.Topology.ScottTopology pt fe ๐ค
open import Lifting.Construction ๐ค hiding (โฅ)
open import Lifting.Miscelanea-PropExt-FunExt ๐ค pe fe
open import Locales.Frame pt fe hiding (๐; is-directed)
open import UF.DiscreteAndSeparated
open import UF.Equiv
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier
open Locale
open PropositionalTruncation pt
\end{code}
We first define the Sierpinski dcpo
\begin{code}
๐๐โบ : DCPO {๐ค โบ} {๐ค โบ}
๐๐โบ = ๐-DCPO {X = ๐ {๐ค}} ๐-is-set
\end{code}
which is locally small and also algebraic:
\begin{code}
๐-is-locally-small : is-locally-small ๐๐โบ
๐-is-locally-small = ๐-is-locally-small {X = ๐ {๐ค}} ๐-is-set
๐๐โบ-is-algebraic : is-algebraic-dcpo (๐-DCPO {X = ๐ {๐ค}} ๐-is-set)
๐๐โบ-is-algebraic = ๐-is-algebraic-dcpo ๐-is-set
\end{code}
Unfortunately, we do not have the required machinery for making a locally small
copy of a dcpo from an extrinsic proof that it is locally small. In hindsight,
it would have been easier to work with such extrinsic proofs of local smallness,
but I didn't do this and right now, I don't have the time to migrate my
formalization to this style.
Therefore, I defined the function `๐-DCPOโป` which directly gives the locally
small copy of the dcpo in consideration. Instead of working with `๐๐โบ`, I work
with `๐๐` instead to circumvent this problem.
\begin{code}
๐๐ : DCPO {๐ค โบ} {๐ค}
๐๐ = ๐-DCPOโป {X = ๐ {๐ค}} ๐-is-set
\end{code}
These two dcpos are of course order-isomorphic.
\begin{code}
โ-implies-โโบ : (x y : โจ ๐๐ โฉโ) โ x โโจ ๐๐ โฉ y โ x โโจ ๐๐โบ โฉ y
โ-implies-โโบ x y p q = โ-to-โ' p q
โโบ-implies-โ : (x y : โจ ๐๐ โฉโ) โ x โโจ ๐๐โบ โฉ y โ x โโจ ๐๐ โฉ y
โโบ-implies-โ x y p = (ฮป q โ transport is-defined (p q) q) , ฮป _ โ refl
\end{code}
The proposition `๐` is the bottom element of this dcpo, meaning it can be
made into a pointed dcpo:
\begin{code}
๐๐โฅ : DCPOโฅ {๐ค โบ} {๐ค}
๐๐โฅ = ๐๐ , (๐ , (ฮป ()) , ๐-is-prop) , ฮป _ โ (ฮป ()) , ฮป ()
\end{code}
The proposition `๐` is the top element of this dcpo.
\begin{code}
๐-is-top : (x : โจ ๐๐ โฉโ) โ x โโจ ๐๐ โฉ ฮท โ
๐-is-top (P , q) = (ฮป _ โ โ) , ฮป _ โ refl
\end{code}
Furthermore, the dcpo `๐๐` is compact.
\begin{code}
๐๐-is-compact : is-compact ๐๐ (ฮท โ)
๐๐-is-compact I ฮฑ (โฃiโฃ , upโป) pโป =
โฅโฅ-rec โ-is-prop โ (ฮทs-are-compact ๐-is-set โ I ฮฑ ฮด p)
where
open is-locally-small ๐-is-locally-small
up : is-semidirected (underlying-order ๐๐โบ) ฮฑ
up i j = โฅโฅ-rec โ-is-prop โ (upโป i j)
where
โ : ฮฃ k ๊ I , (ฮฑ i โโจ ๐๐ โฉ ฮฑ k) ร (ฮฑ j โโจ ๐๐ โฉ ฮฑ k)
โ โ k ๊ I , (ฮฑ i โโจ ๐๐โบ โฉ ฮฑ k) ร (ฮฑ j โโจ ๐๐โบ โฉ ฮฑ k)
โ (k , p , q) = โฃ k , โ-implies-โโบ (ฮฑ i) (ฮฑ k) p , โ-implies-โโบ (ฮฑ j) (ฮฑ k) q โฃ
ฮด : is-directed (underlying-order ๐๐โบ) ฮฑ
ฮด = โฃiโฃ , up
p : ฮท โ โโจ ๐๐โบ โฉ (โ (๐-DCPO ๐-is-set) ฮด)
p = โ-to-โ' (prโ pโป , ฮป _ โ refl)
โ : ฮฃ i ๊ I , underlying-order (๐-DCPO ๐-is-set) (ฮท โ) (ฮฑ i)
โ โ i ๊ I , ฮท โ โโจ ๐๐ โฉ (ฮฑ i)
โ (i , q) = โฃ i , โโบ-implies-โ (ฮท โ) (ฮฑ i) q โฃ
\end{code}
We define a function for mapping inhabitants of the Sierpiลski dcpo to the type
of propositions:
\begin{code}
to-ฮฉ : โจ ๐๐ โฉโ โ ฮฉ ๐ค
to-ฮฉ (P , _ , h) = P , h
\end{code}
Conversely, we define a function mapping every proposition `P : ฮฉ ๐ค` to the
carrier set of the Sierpiลski dcpo.
\begin{code}
to-๐๐ : ฮฉ ๐ค โ โจ ๐๐ โฉโ
to-๐๐ (P , h) = P , (ฮป _ โ โ) , h
\end{code}
It is obvious that these form an equivalence.
\begin{code}
ฮฉ-equivalent-to-๐ : ฮฉ ๐ค โ โจ ๐๐ โฉโ
ฮฉ-equivalent-to-๐ = to-๐๐ , ((to-ฮฉ , โ ) , (to-ฮฉ , โก))
where
ฯ : {A : ๐ค ฬ } โ is-prop (A โ ๐)
ฯ = ฮ -is-prop fe (ฮป _ โ ๐-is-prop)
ฯ : {A : ๐ค ฬ } โ is-prop (is-prop A)
ฯ = being-prop-is-prop fe
โ : (to-๐๐ โ to-ฮฉ) โผ id
โ (P , f , h) = to-subtype-๏ผ (ฮป _ โ ร-is-prop ฯ ฯ) refl
โก : to-ฮฉ โ to-๐๐ โผ id
โก (P , h) = to-subtype-๏ผ (ฮป _ โ ฯ) refl
\end{code}
For convenience we define abbreviations for the copies of `โค` and `โฅ` in `๐๐`.
\begin{code}
โคโ : โจ ๐๐ โฉโ
โคโ = to-๐๐ โค
โฅโ : โจ ๐๐ โฉโ
โฅโ = to-๐๐ โฅ
\end{code}
We now proceed to the definition of the Sierpiลski locale.
First, we show that `๐๐` has a specified small compact basis.
\begin{code}
open import Locales.ScottLocale.Definition pt fe ๐ค
open import Locales.ScottLocale.ScottLocalesOfAlgebraicDcpos pt fe ๐ค
hscb : has-specified-small-compact-basis ๐๐
hscb = (๐ {๐ค} + ๐ {๐ค}) , ฮฒ , ฯ
where
ฮฒ : ๐ + ๐ โ โจ ๐๐ โฉโ
ฮฒ (inl โ) = โฅโ
ฮฒ (inr โ) = โคโ
ฮฒ-is-compact : (b : ๐ + ๐) โ is-compact ๐๐ (ฮฒ b)
ฮฒ-is-compact (inl โ) = โฅ-is-compact ๐๐โฅ
ฮฒ-is-compact (inr โ) = ๐๐-is-compact
ฮฒ-is-upward-directed : (x : โจ ๐๐ โฉโ)
โ is-semidirected (underlying-order ๐๐) (โ-inclusion ๐๐ ฮฒ x)
ฮฒ-is-upward-directed x (inl โ , p) (z , q) = let
u = (z , q)
rโ = reflexivity ๐๐ (ฮฒ (inl โ))
rโ = reflexivity ๐๐ (ฮฒ z)
in
โฃ u , โฅ-is-least ๐๐โฅ (ฮฒ z) , rโ โฃ
ฮฒ-is-upward-directed x (inr โ , pโ) (z , q) = let
rโ = reflexivity ๐๐ (ฮฒ (inr โ))
rโ = reflexivity ๐๐ (ฮฒ (inr โ))
in
โฃ (inr โ , pโ) , rโ , ๐-is-top (ฮฒ z) โฃ
covering : (x : โจ ๐๐ โฉโ) โ is-sup (underlying-order ๐๐) x (โ-inclusion ๐๐ ฮฒ x)
covering ๐ซ@(P , f , h) = prโ , โ
where
โ : is-lowerbound-of-upperbounds (underlying-order ๐๐) (P , f , h) (โ-inclusion ๐๐ ฮฒ (P , f , h))
โ ๐ซโฒ@(Pโฒ , fโฒ , hโฒ) ฯ
= โก
where
โ : P โ ๐ซ โโจ ๐๐ โฉ ๐ซโฒ
โ p = transport (ฮป - โ - โโจ ๐๐ โฉ ๐ซโฒ) eq (ฯ
(inr โ , q))
where
q : ฮฒ (inr โ) โโจ ๐๐ โฉ ๐ซ
q = (ฮป _ โ p) , ฮป _ โ ๐-is-prop โ (f p)
eq : ฮฒ (inr โ) ๏ผ ๐ซ
eq = antisymmetry ๐๐ (ฮฒ (inr โ)) ๐ซ q (๐-is-top ๐ซ)
โก : underlying-order ๐๐ (P , f , h) ๐ซโฒ
โก = (ฮป p โ prโ (โ p) p) , ฮป p โ ๐-is-prop โ (f p)
ฯ : is-small-compact-basis ๐๐ ฮฒ
ฯ = record
{ basis-is-compact = ฮฒ-is-compact
; โแดฎ-is-small = ฮป x b โ (ฮฒ b โโจ ๐๐ โฉ x) , โ-refl (ฮฒ b โโจ ๐๐ โฉ x)
; โแดฎ-is-directed = ฮป x โ โฃ inl โ , โฅ-is-least ๐๐โฅ x โฃ , ฮฒ-is-upward-directed x
; โแดฎ-is-sup = covering
}
๐๐-is-structurally-algebraic : structurally-algebraic ๐๐
๐๐-is-structurally-algebraic =
structurally-algebraic-if-specified-small-compact-basis ๐๐ hscb
\end{code}
Using this compact basis, we define the Sierpiลski locale as the Scott locale of
`๐๐`.
\begin{code}
open ScottLocaleConstruction ๐๐ hscb pe
๐ : Locale (๐ค โบ) ๐ค ๐ค
๐ = ScottLocale
\end{code}
Added on 2024-03-08.
There are three important opens of the Sierpiลski locale.
````````````````````````````````````````````````````````````````````````````````
ฮฉ
|
{โคโ}
|
โ
````````````````````````````````````````````````````````````````````````````````
The top and bottom one are the full subset and the empty subset of `ฮฉ`. We now
define the singleton open lying in the middle. We call this Scott open `truth`.
We first define the subset `โจ ๐๐ โฉ โ ฮฉ` underlying this map, which is in fact
just the identity map since given a proposition `P`, `P ๏ผ โค` iff `P` holds.
\begin{code}
open DefnOfScottLocale ๐๐ ๐ค pe
truthโ : โจ ๐๐ โฉโ โ ฮฉ ๐ค
truthโ (P , _ , i) = (P , i)
\end{code}
We now package this subset up with the proof that it is Scott open.
\begin{code}
open DefnOfScottTopology ๐๐ ๐ค
truthโ-is-upward-closed : is-upwards-closed truthโ holds
truthโ-is-upward-closed U V u (ฯ , _) = ฯ u
truthแตฃ : ๐ชโแดฟ
truthแตฃ =
record
{ pred = truthโ
; pred-is-upwards-closed = ฯ
; pred-is-inaccessible-by-dir-joins = ฮน
}
where
ฯ
: is-upwards-closed truthโ holds
ฯ
U V u (ฯ , _) = ฯ u
ฮน : is-inaccessible-by-directed-joins truthโ holds
ฮน U ฮผ = ฮผ
truth : โจ ๐ช ๐ โฉ
truth = from-๐ชโแดฟ truthแตฃ
\end{code}