Ayberk Tosun, 19 August 2023

The module contains the definition of a spectral locale.

This used to live in the `CompactRegular` module which is now deprecated and
will be broken down into smaller modules.

\begin{code}[hide]

{-# OPTIONS --safe --without-K --lossy-unification #-}

open import MLTT.Spartan
open import Slice.Family
open import UF.FunExt
open import UF.Logic
open import UF.PropTrunc
open import UF.SubtypeClassifier

module Locales.Spectrality.SpectralLocale (pt : propositional-truncations-exist)
                                          (fe : Fun-Ext) where

open import Locales.Frame pt fe
open import Locales.Compactness.Definition pt fe

open PropositionalTruncation pt

open AllCombinators pt fe

open Locale

\end{code}

The following predicate expresses what it means for a locale's compact opens to
be closed under binary meets.

\begin{code}

compacts-of-[_]-are-closed-under-binary-meets : Locale ๐“ค ๐“ฅ ๐“ฆ โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
compacts-of-[ X ]-are-closed-under-binary-meets =
 let
  _โˆงโ‚“_ = meet-of (๐’ช X)
 in
  โฑฏ Kโ‚ ๊ž‰ โŸจ ๐’ช X โŸฉ , โฑฏ Kโ‚‚ ๊ž‰ โŸจ ๐’ช X โŸฉ ,
   is-compact-open X Kโ‚ โ‡’ is-compact-open X Kโ‚‚ โ‡’ is-compact-open X (Kโ‚ โˆงโ‚“ Kโ‚‚)

\end{code}

Now we express closure under finite meets, which amounts to closure under binary
meets combined with the empty meet (i.e. the top element) being compact.

\begin{code}

compacts-of-[_]-are-closed-under-finite-meets : Locale ๐“ค ๐“ฅ ๐“ฆ โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
compacts-of-[ X ]-are-closed-under-finite-meets =
 is-compact X โˆง compacts-of-[ X ]-are-closed-under-binary-meets

\end{code}

The following predicate expresses the property of a given family to consist of
compact opens i.e. all the opens it gives being compact opens.

\begin{code}

consists-of-compact-opens : (X : Locale ๐“ค ๐“ฅ ๐“ฆ) โ†’ Fam ๐“ฆ โŸจ ๐’ช X โŸฉ โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
consists-of-compact-opens X S = โฑฏ i ๊ž‰ index S , is-compact-open X (S [ i ])

\end{code}

We are now ready to define the notion of a spectral locale:

\begin{code}

has-a-directed-cover-of-compact-opens : (X : Locale ๐“ค ๐“ฅ ๐“ฆ) (U : โŸจ ๐’ช X โŸฉ)
                                      โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
has-a-directed-cover-of-compact-opens {_} {_} {๐“ฆ} X U =
 ฦŽ S ๊ž‰ Fam ๐“ฆ โŸจ ๐’ช X โŸฉ , consists-of-compact-opens X S holds
                     ร— is-directed (๐’ช X) S holds
                     ร— (U ๏ผ โ‹[ ๐’ช X ] S)

is-spectral : Locale ๐“ค ๐“ฅ ๐“ฆ โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
is-spectral {_} {_} {๐“ฆ} X = โฆ…๐Ÿโฆ† โˆง โฆ…๐Ÿโฆ†
 where
  โฆ…๐Ÿโฆ† = compacts-of-[ X ]-are-closed-under-finite-meets
  โฆ…๐Ÿโฆ† = โฑฏ U ๊ž‰ โŸจ ๐’ช X โŸฉ , has-a-directed-cover-of-compact-opens X U

\end{code}

Spectral locales are compact:

\begin{code}

spectral-locales-are-compact : (X : Locale ๐“ค ๐“ฅ ๐“ฆ)
                             โ†’ (is-spectral X โ‡’ is-compact X) holds
spectral-locales-are-compact X ((ฮบ , _) , _) = ฮบ

\end{code}

We define a couple of projections of the components of being a spectral locale.

We denote by `binary-coherence` the fact that that the compact opens are closed
under binary meets.

\begin{code}

binary-coherence : (X : Locale ๐“ค ๐“ฅ ๐“ฆ) (ฯƒ : is-spectral X holds) (Kโ‚ Kโ‚‚ : โŸจ ๐’ช X โŸฉ)
                 โ†’ (is-compact-open X Kโ‚
                 โ‡’ is-compact-open X Kโ‚‚
                 โ‡’ is-compact-open X (Kโ‚ โˆง[ ๐’ช X ] Kโ‚‚)) holds
binary-coherence X ฯƒ = prโ‚‚ (prโ‚ ฯƒ)

\end{code}

The fact that the top open is compact is denoted `spectral-implies-compact`.

\begin{code}

spectral-implies-compact : (X : Locale ๐“ค ๐“ฅ ๐“ฆ) (ฯƒ : is-spectral X holds)
                         โ†’ is-compact-open X ๐Ÿ[ ๐’ช X ] holds
spectral-implies-compact X ฯƒ = prโ‚ (prโ‚ ฯƒ)

\end{code}

Addition on 2024-02-24.

\begin{code}

module OperationsOnCompactOpens (X : Locale ๐“ค ๐“ฅ ๐“ฆ) (ฯƒ : is-spectral X holds) where

 _โˆงโ‚–_ : ๐’ฆ X โ†’ ๐’ฆ X โ†’ ๐’ฆ X
 _โˆงโ‚–_ (Kโ‚ , ฮบโ‚) (Kโ‚‚ , ฮบโ‚‚) = (Kโ‚ โˆง[ ๐’ช X ] Kโ‚‚) , binary-coherence X ฯƒ Kโ‚ Kโ‚‚ ฮบโ‚ ฮบโ‚‚

 _โˆจโ‚–_ : ๐’ฆ X โ†’ ๐’ฆ X โ†’ ๐’ฆ X
 (Kโ‚ , ฮบโ‚) โˆจโ‚– (Kโ‚‚ , ฮบโ‚‚) =
  (Kโ‚ โˆจ[ ๐’ช X ] Kโ‚‚) , compact-opens-are-closed-under-โˆจ X Kโ‚ Kโ‚‚ ฮบโ‚ ฮบโ‚‚

\end{code}

Added on 2024-04-29.

Inclusion of the compact opens of `X`.

\begin{code}

 ฮนโ‚– : ๐’ฆ X โ†’ โŸจ ๐’ช X โŸฉ
 ฮนโ‚– (K , _) = K

\end{code}