---
title:          Some properties of the SierpiΕski locale
author:         Ayberk Tosun
date-completed: 2024-02-12
---
\begin{code}
{-# OPTIONS --safe --without-K --lossy-unification #-}
open import UF.FunExt
open import UF.Logic
open import MLTT.Spartan hiding (π; β; β)
open import UF.PropTrunc
open import UF.Subsingletons
open import UF.Size
module Locales.Sierpinski.Properties
        (π€  : Universe)
        (pe : Prop-Ext)
        (pt : propositional-truncations-exist)
        (fe : Fun-Ext)
        (sr : Set-Replacement pt)
       where
open import DomainTheory.Basics.Dcpo    pt fe π€ renaming (β¨_β© to β¨_β©β)
open import DomainTheory.Basics.Pointed pt fe π€ renaming (β₯ to β₯β)
open import DomainTheory.Topology.ScottTopology pt fe π€
open import Lifting.Construction π€
open import Locales.Frame pt fe hiding (is-directed)
open import Locales.InitialFrame pt fe
open import Locales.ScottLocale.Definition pt fe π€
open import Locales.ScottLocale.Properties pt fe π€
open import Locales.ScottLocale.ScottLocalesOfAlgebraicDcpos pt fe π€
open import Locales.Sierpinski.Definition π€ pe pt fe sr
open import Locales.SmallBasis pt fe sr
open import Locales.Spectrality.SpectralLocale pt fe
open import MLTT.List hiding ([_])
open import Slice.Family
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier
open AllCombinators pt fe
open Locale
open PropositionalTruncation pt
\end{code}
We show that `ππ` is a Scott domain. We have already shown that it is an
algebraic lattice, so it remains to show that it is bounded complete.
\begin{code}
open import DomainTheory.BasesAndContinuity.ScottDomain pt fe π€
open DefinitionOfBoundedCompleteness
ββ-implies-β : (x y : β¨ ππ β©β)
             β x ββ¨ ππ β© y
             β (to-Ξ© x β€[ poset-of (π-π½π£π pe) ] to-Ξ© y) holds
ββ-implies-β _ _ (g , q) p = g p
β-implies-ββ : (x y : β¨ ππ β©β)
             β (to-Ξ© x β€[ poset-of (π-π½π£π pe) ] to-Ξ© y) holds
             β x ββ¨ ππ β© y
β-implies-ββ (P , f , h) (Pβ² , fβ² , hβ²) p = p , (Ξ» _ β π-is-prop β β)
ππ-bounded-complete : bounded-complete ππ holds
ππ-bounded-complete S _ = sup , Ο
 where
  Sβ : Fam π€ (Ξ© π€)
  Sβ = β
 to-Ξ© P β£ P Ξ΅ S β
  supβ : Ξ© π€
  supβ = β[ (π-π½π£π pe) ] Sβ
  sup : β¨ ππ β©β
  sup = supβ holds , (Ξ» _ β β) , β-is-prop
  Ο
 : is-upperbound (underlying-order ππ) sup (S [_])
  Ο
 i = β  , β‘
   where
    β  : is-defined (S [ i ]) β is-defined sup
    β  p = β£ i , p β£
    β‘ : value (S [ i ]) βΌ (Ξ» xβ β value sup (β  xβ))
    β‘ _ = π-is-prop β β
  Ο : is-lowerbound-of-upperbounds (underlying-order ππ) sup (S [_])
  Ο (P , f , h) q = β-implies-ββ sup (P , f , h) (β[ π-π½π£π pe ]-least Sβ ((P , h) , (Ξ» i β prβ (q i))))
  Ο : is-sup (underlying-order ππ) sup (S [_])
  Ο = Ο
 , Ο
\end{code}
Finally, we show that `ππ` trivially satisfies the decidability condition that
we assume in the proof that Scott locales of Scott domains are spectral.
\begin{code}
open import Locales.ScottLocale.ScottLocalesOfScottDomains pt fe sr π€
ππ-satisfies-dc : decidability-condition ππ
ππ-satisfies-dc π«β@(Pβ , hβ , fβ) π«β@(Pβ , hβ , fβ) ΞΊc ΞΊd =
 inl β£ up , β‘ β£
  where
   up : β¨ ππ β©β
   up = to-ππ (to-Ξ© π«β β¨[ π-π½π£π pe ] to-Ξ© π«β)
   open Joins {A = β¨ ππ β©β} (Ξ» x y β (x ββ¨ ππ β© y) , prop-valuedness ππ x y)
   β‘ : (up is-an-upper-bound-of (binary-family π€ π«β π«β)) holds
   β‘ (inl β) = (Ξ» p β β£ inl β , p β£) , Ξ» _ β π-is-prop β β
   β‘ (inr β) = (Ξ» p β β£ inr β , p β£) , Ξ» _ β π-is-prop β β
\end{code}
From all these, we obtain the fact that `π` is a spectral locale, which we call
`π-is-spectral` below.
\begin{code}
ππ-has-least : has-least (underlying-order ππ)
ππ-has-least = (β₯β ππβ₯) , β₯-is-least ππβ₯
open ScottLocaleConstruction ππ hscb pe
open SpectralScottLocaleConstruction ππ ππ-has-least hscb ππ-satisfies-dc ππ-bounded-complete pe
open ScottLocaleProperties ππ ππ-has-least hscb pe
open DefnOfScottLocale ππ π€ pe using (πͺβ-equality; _ββ_)
β¬π : Fam π€ β¨ πͺ π β©
β¬π = List (π π€) , πΈ
principal-filter-on-β-is-truth : βα΅[ β ] οΌ truth
principal-filter-on-β-is-truth = β€-is-antisymmetric (poset-of (πͺ π)) β  β‘
 where
  β β : (βα΅[ β ] ββ truth) holds
  β β (P , f , Ο) (p , _) = p β
  β  : (βα΅[ β ] ββ truth) holds
  β  = ββ-implies-ββ βα΅[ β ] truth β β
  β‘β : (truth ββ βα΅[ β ]) holds
  β‘β (P , f , Ο) p = (Ξ» x β p) , Ξ» { _ β π-is-prop β β}
  β‘ : (truth ββ βα΅[ β ]) holds
  β‘ = ββ-implies-ββ truth βα΅[ β ] β‘β
π-is-spectralα΄° : spectralα΄° π
π-is-spectralα΄° = Οα΄°
π-is-spectral : is-spectral π holds
π-is-spectral = spectralα΄°-gives-spectrality π Οα΄°
π-has-small-π¦ : has-small-π¦ π
π-has-small-π¦ = spectralα΄°-implies-small-π¦ π Οα΄°
\end{code}
Added on 2024-03-09.
A basic open of the SierpiΕski locale is either `π`, `truth`, or `π`. In fact,
because the basic open coincide with the compact opens in spectral locales, a
corollary of this is that these three elements form a basis for SierpiΕski.
\begin{code}
basis-trichotomy : (bs : List (π π€))
                 β (πΈ bs οΌ π[ πͺ π ]) + (πΈ bs οΌ truth) + (πΈ bs οΌ π[ πͺ π ])
basis-trichotomy []       = inr (inr p)
                             where
                              p : πΈ [] οΌ π[ πͺ π ]
                              p = πΈ []     οΌβ¨ πΈ-equal-to-πΈβ [] β©
                                  πΈβ []    οΌβ¨ refl             β©
                                  π[ πͺ π ] β
basis-trichotomy (β β· bs) = inl p
                             where
                              β
  = πΈ-equal-to-πΈβ (β β· bs)
                              β
‘ = ap (Ξ» - β - β¨[ πͺ π ] πΈβ bs) ββ₯-is-top
                              β
’ = π-left-annihilator-for-β¨ (πͺ π) (πΈβ bs)
                              p : πΈ (β β· bs) οΌ π[ πͺ π ]
                              p = πΈ (β β· bs)               οΌβ¨ β
     β©
                                  πΈβ (β β· bs)              οΌβ¨ refl β©
                                  βα΅[ β ] β¨[ πͺ π ] πΈβ bs   οΌβ¨ β
‘    β©
                                  π[ πͺ π ] β¨[ πͺ π ] πΈβ bs  οΌβ¨ β
’    β©
                                  π[ πͺ π ]                 β
basis-trichotomy (β β· bs) = casesβ caseβ caseβ caseβ IH
 where
  IH : (πΈ bs οΌ π[ πͺ π ]) + (πΈ bs οΌ truth) + (πΈ bs οΌ π[ πͺ π ])
  IH = basis-trichotomy bs
  caseβ : πΈ bs οΌ π[ πͺ π ]
        β (πΈ (β β· bs) οΌ π[ πͺ π ]) + (πΈ (β β· bs) οΌ truth) + (πΈ (β β· bs) οΌ π[ πͺ π ])
  caseβ q = inl r
   where
    β
‘ = ap
         (Ξ» - β βα΅[ β ] β¨[ πͺ π ] -)
         (πΈβ bs οΌβ¨ πΈ-equal-to-πΈβ bs β»ΒΉ β© πΈ bs οΌβ¨ q β© π[ πͺ π ] β )
    β
’ = π-right-annihilator-for-β¨ (πͺ π) βα΅[ β ]
    r : πΈ (β β· bs) οΌ π[ πͺ π ]
    r = πΈ (β β· bs)                οΌβ¨ πΈ-equal-to-πΈβ (β β· bs) β©
        πΈβ (β β· bs)               οΌβ¨ refl β©
        βα΅[ β ] β¨[ πͺ π ] πΈβ bs    οΌβ¨ β
‘ β©
        βα΅[ β ] β¨[ πͺ π ] π[ πͺ π ] οΌβ¨ β
’ β©
        π[ πͺ π ]                  β
  caseβ : πΈ bs οΌ truth
        β (πΈ (β β· bs) οΌ π[ πͺ π ]) + (πΈ (β β· bs) οΌ truth) + (πΈ (β β· bs) οΌ π[ πͺ π ])
  caseβ q = inr (inl r)
   where
    β
‘ = ap (Ξ» - β - β¨[ πͺ π ] πΈβ bs) principal-filter-on-β-is-truth
    β
’ = ap (Ξ» - β truth β¨[ πͺ π ] -) (πΈ-equal-to-πΈβ bs β»ΒΉ)
    β
£ = ap (Ξ» - β truth β¨[ πͺ π ] -) q
    β
€ = β¨[ πͺ π ]-is-idempotent truth β»ΒΉ
    r : πΈ (β β· bs) οΌ truth
    r = πΈ (β β· bs)               οΌβ¨ πΈ-equal-to-πΈβ (β β· bs) β©
        πΈβ (β β· bs)              οΌβ¨ refl                   β©
        βα΅[ β ] β¨[ πͺ π ] πΈβ bs   οΌβ¨ β
‘                      β©
        truth β¨[ πͺ π ] πΈβ bs     οΌβ¨ β
’                      β©
        truth β¨[ πͺ π ] πΈ bs      οΌβ¨ β
£                      β©
        truth β¨[ πͺ π ] truth     οΌβ¨ β
€                      β©
        truth                    β
  caseβ : πΈ bs οΌ π[ πͺ π ]
        β (πΈ (β β· bs) οΌ π[ πͺ π ]) + (πΈ (β β· bs) οΌ truth) + (πΈ (β β· bs) οΌ π[ πͺ π ])
  caseβ q = inr (inl r)
   where
    β
  = πΈ-equal-to-πΈβ (β β· bs)
    β
‘ = ap
         (Ξ» - β βα΅[ β ] β¨[ πͺ π ] -)
         (πΈβ bs οΌβ¨ πΈ-equal-to-πΈβ bs β»ΒΉ β© πΈ bs οΌβ¨ q β© π[ πͺ π ] β)
    β
’ = π-left-unit-of-β¨ (πͺ π) βα΅[ β ]
    β
£ = principal-filter-on-β-is-truth
    r : πΈ (β β· bs) οΌ truth
    r = πΈ (β β· bs)                οΌβ¨ β
      β©
        πΈβ (β β· bs)               οΌβ¨ refl  β©
        βα΅[ β ] β¨[ πͺ π ] πΈβ bs    οΌβ¨ β
‘     β©
        βα΅[ β ] β¨[ πͺ π ] π[ πͺ π ] οΌβ¨ β
’     β©
        βα΅[ β ]                   οΌβ¨ β
£     β©
        truth                     β
\end{code}
Added on 2024-03-11.
\begin{code}
open DefnOfScottTopology ππ π€
contains-β₯β-implies-contains-β€β : (π : β¨ πͺ π β©) β (β₯β ββ π β β€β ββ π) holds
contains-β₯β-implies-contains-β€β π ΞΌ = transport (Ξ» - β (β€β ββ -) holds) (q β»ΒΉ) β
 where
  open πͺβα΄Ώ
  q : π οΌ π[ πͺ π ]
  q = contains-bottom-implies-is-π π ΞΌ
holds-gives-equal-β€β : (P : β¨ ππ β©β) β (P ββ truth) holds β P οΌ β€β
holds-gives-equal-β€β (P , f , Ο) p =
 to-subtype-οΌ
  (Ξ» Q β Γ-is-prop (Ξ -is-prop fe (Ξ» _ β π-is-prop)) (being-prop-is-prop fe))
  (holds-gives-equal-π pe P Ο p)
contains-β€β-implies-above-truth : (π : β¨ πͺ π β©)
                                β (β€β ββ π) holds
                                β (truth β€[ poset-of (πͺ π) ] π) holds
contains-β€β-implies-above-truth π ΞΌβ = ββ-implies-ββ truth π β 
 where
  β  : (truth ββ π) holds
  β  P ΞΌβ = transport (Ξ» - β (- ββ π) holds) (holds-gives-equal-β€β P ΞΌβ β»ΒΉ) ΞΌβ
\end{code}
Added on 2024-03-11.
If a Scott open `π` is above truth, then it obviously contains the true
proposition `β€β`.
\begin{code}
above-truth-implies-contains-β€β : (π : β¨ πͺ π β©)
                                β (truth β€[ poset-of (πͺ π) ] π) holds
                                β (β€β ββ π) holds
above-truth-implies-contains-β€β π p = ββ-implies-ββ truth π p β€β β
\end{code}