Ayberk Tosun, 13 September 2023

\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.Properties (pt : propositional-truncations-exist)
                                      (fe : Fun-Ext) where

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

open PropositionalTruncation pt

open AllCombinators pt fe

open Locale

\end{code}

Let `X` be a locale and let `U` and `V` be two opens of it. Consider the
following ordering:

    โˆ€ K : ๐’ฆ(X). K โ‰ค U โ‡’ K โ‰ค V

which says any compact open below `U` is also below `V`.

\begin{code}

compact-rel-syntax : (X : Locale ๐“ค ๐“ฅ ๐“ฆ) โ†’ โŸจ ๐’ช X โŸฉ โ†’ โŸจ ๐’ช X โŸฉ โ†’ ฮฉ (๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โบ)
compact-rel-syntax X U V = โฑฏ (K , _) ๊ž‰ ๐’ฆ X , K โ‰ค U โ‡’ K โ‰ค V
 where
  open PosetNotation (poset-of (๐’ช X))

syntax compact-rel-syntax X U V = U โ‰คโ‚–[ X ] V

\end{code}

We denote this `_โ‰คโ‚–_`

\begin{code}

spectral-yoneda : (X : Locale ๐“ค ๐“ฅ ๐“ฆ)
                โ†’ is-spectral X holds
                โ†’ (U V : โŸจ ๐’ช X โŸฉ)
                โ†’ (U โ‰คโ‚–[ X ] V) holds
                โ†’ (U โ‰ค[ poset-of (๐’ช X) ] V) holds
spectral-yoneda {_} {_} {๐“ฆ} X (_ , c) U V ฯ† =
 โˆฅโˆฅ-rec (holds-is-prop (U โ‰ค[ poset-of (๐’ช X) ] V)) โ€  (c U)
  where
   open PosetReasoning (poset-of (๐’ช X))
   open PosetNotation  (poset-of (๐’ช X))
   open Joins _โ‰ค_

   โ€  : ฮฃ S ๊ž‰ Fam ๐“ฆ โŸจ ๐’ช X โŸฉ , consists-of-compact-opens X S holds
                           ร— is-directed (๐’ช X) S holds ร— (U ๏ผ โ‹[ ๐’ช X ] S)
     โ†’ (U โ‰ค[ poset-of (๐’ช X) ] V) holds
   โ€  (S , ฮบ , d , c) = U โ‰คโŸจ โ…  โŸฉ โ‹[ ๐’ช X ] S โ‰คโŸจ โ…ก โŸฉ V โ– 
     where
      ฯˆ : (i : index S) โ†’ (S [ i ] โ‰ค U) holds
      ฯˆ i = S [ i ] โ‰คโŸจ โ‹[ ๐’ช X ]-upper S i โŸฉ โ‹[ ๐’ช X ] S ๏ผโŸจ c โปยน โŸฉโ‚š U โ– 

      โ€ก : (V is-an-upper-bound-of S) holds
      โ€ก i = ฯ† (S [ i ] , ฮบ i) (ฯˆ i)

      โ…  = reflexivity+ (poset-of (๐’ช X)) c
      โ…ก = โ‹[ ๐’ช X ]-least S (V , โ€ก)

\end{code}