--- title: Distributive lattice of compact opens author: Ayberk Tosun date-started: 2024-02-24 date-completed: 2024-02-27 dates-updated: [2024-04-30] --- \begin{code} {-# OPTIONS --safe --without-K --lossy-unification #-} open import MLTT.Spartan open import UF.FunExt open import UF.Logic open import UF.PropTrunc open import UF.Size open import UF.SubtypeClassifier open import UF.UA-FunExt open import UF.Univalence module Locales.Spectrality.LatticeOfCompactOpens (ua : Univalence) (pt : propositional-truncations-exist) (sr : Set-Replacement pt) where private fe : Fun-Ext fe {π€} {π₯} = univalence-gives-funext' π€ π₯ (ua π€) (ua (π€ β π₯)) open import Locales.Compactness.Definition pt fe open import Locales.DistributiveLattice.Definition fe pt open import Locales.Frame pt fe open import Locales.SmallBasis pt fe sr open import Locales.Spectrality.SpectralLocale pt fe open import UF.Equiv open AllCombinators pt fe open Locale open PropositionalTruncation pt \end{code} We fix a large and locally small locale `X`, assumed to be spectral with a small type of compact opens. \begin{code} module π¦-Lattice (X : Locale (π€ βΊ) π€ π€) (Οβ : is-spectral-with-small-basis ua X holds) where \end{code} We define some shorthand notation to simplify the proofs. \begin{code} Ο : is-spectral X holds Ο = ssb-implies-spectral ua X Οβ π-is-compact : is-compact-open X π[ πͺ X ] holds π-is-compact = spectral-locales-are-compact X Ο πβ : π¦ X πβ = π[ πͺ X ] , π-is-compact πβ : π¦ X πβ = π[ πͺ X ] , π-is-compact X \end{code} We now construct the distributive lattice of compact opens. \begin{code} π¦β¦ Xβ¦ : DistributiveLattice (π€ βΊ) π¦β¦ Xβ¦ = record { X = π¦ X ; π = πβ ; π = πβ ; _β§_ = _β§β_ ; _β¨_ = _β¨β_ ; X-is-set = π¦-is-set X ; β§-associative = Ξ± ; β§-commutative = Ξ² ; β§-unit = Ξ³ ; β§-idempotent = Ξ΄ ; β§-absorptive = Ο΅ ; β¨-associative = ΞΆ ; β¨-commutative = Ξ· ; β¨-unit = ΞΈ ; β¨-idempotent = ΞΉ ; β¨-absorptive = ΞΌ ; distributivityα΅ = Ξ½ } where open OperationsOnCompactOpens X Ο \end{code} The compact opens obviously satisfy all the distributive lattice laws, since every frame is a distributive lattice. Because the opens in consideration are packaged up with their proofs of compactness though, we need to lift these laws to the subtype consisting of compact opens. We take care of this bureaucracy below. \begin{code} Ξ± : (π¦β π¦β π¦β : π¦ X) β π¦β β§β (π¦β β§β π¦β) οΌ (π¦β β§β π¦β) β§β π¦β Ξ± π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) = to-π¦-οΌ X ΞΊ ΞΊβ² β where ΞΊ : is-compact-open X (Kβ β§[ πͺ X ] (Kβ β§[ πͺ X ] Kβ)) holds ΞΊ = binary-coherence X Ο _ _ ΞΊβ (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) ΞΊβ² : is-compact-open X ((Kβ β§[ πͺ X ] Kβ) β§[ πͺ X ] Kβ) holds ΞΊβ² = binary-coherence X Ο _ _ (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) ΞΊβ β : Kβ β§[ πͺ X ] (Kβ β§[ πͺ X ] Kβ) οΌ (Kβ β§[ πͺ X ] Kβ) β§[ πͺ X ] Kβ β = β§[ πͺ X ]-is-associative Kβ Kβ Kβ Ξ² : (π¦β π¦β : π¦ X) β π¦β β§β π¦β οΌ π¦β β§β π¦β Ξ² (Kβ , ΞΊβ) (Kβ , ΞΊβ) = to-π¦-οΌ X (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) (β§[ πͺ X ]-is-commutative Kβ Kβ) Ξ³ : (π¦ : π¦ X) β π¦ β§β πβ οΌ π¦ Ξ³ (K , ΞΊ) = to-π¦-οΌ X (binary-coherence X Ο K π[ πͺ X ] ΞΊ π-is-compact) ΞΊ (π-right-unit-of-β§ (πͺ X) K) Ξ΄ : (π¦ : π¦ X) β π¦ β§β π¦ οΌ π¦ Ξ΄ (K , ΞΊ) = to-π¦-οΌ X (binary-coherence X Ο K K ΞΊ ΞΊ) ΞΊ (β§[ πͺ X ]-is-idempotent K β»ΒΉ ) Ο΅ : (π¦β π¦β : π¦ X) β π¦β β§β (π¦β β¨β π¦β) οΌ π¦β Ο΅ (Kβ , ΞΊβ) (Kβ , ΞΊβ) = to-π¦-οΌ X ΞΊ ΞΊβ (absorptionα΅α΅-right (πͺ X) Kβ Kβ) where ΞΊ : is-compact-open X (Kβ β§[ πͺ X ] (Kβ β¨[ πͺ X ] Kβ)) holds ΞΊ = binary-coherence X Ο Kβ (Kβ β¨[ πͺ X ] Kβ) ΞΊβ (compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ) ΞΆ : (π¦β π¦β π¦β : π¦ X) β π¦β β¨β (π¦β β¨β π¦β) οΌ (π¦β β¨β π¦β) β¨β π¦β ΞΆ π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) = to-π¦-οΌ X (compact-opens-are-closed-under-β¨ X Kβ (Kβ β¨[ πͺ X ] Kβ) ΞΊβ ΞΊ) (compact-opens-are-closed-under-β¨ X (Kβ β¨[ πͺ X ] Kβ) Kβ ΞΊβ² ΞΊβ) (β¨[ πͺ X ]-assoc Kβ Kβ Kβ β»ΒΉ) where ΞΊ : is-compact-open X (Kβ β¨[ πͺ X ] Kβ) holds ΞΊ = compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ ΞΊβ² : is-compact-open X (Kβ β¨[ πͺ X ] Kβ) holds ΞΊβ² = compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ Ξ· : (π¦β π¦β : π¦ X) β π¦β β¨β π¦β οΌ π¦β β¨β π¦β Ξ· π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) = to-π¦-οΌ X (compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ) (compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ) (β¨[ πͺ X ]-is-commutative Kβ Kβ) ΞΈ : (π¦ : π¦ X) β π¦ β¨β (π[ πͺ X ] , π-is-compact X) οΌ π¦ ΞΈ (K , ΞΊ) = to-π¦-οΌ X (compact-opens-are-closed-under-β¨ X K π[ πͺ X ] ΞΊ (π-is-compact X)) ΞΊ (π-left-unit-of-β¨ (πͺ X) K) ΞΉ : (π¦ : π¦ X) β π¦ β¨β π¦ οΌ π¦ ΞΉ (K , ΞΊ) = to-π¦-οΌ X (compact-opens-are-closed-under-β¨ X K K ΞΊ ΞΊ) ΞΊ (β¨[ πͺ X ]-is-idempotent K β»ΒΉ) ΞΌ : (π¦β π¦β : π¦ X) β π¦β β¨β (π¦β β§β π¦β) οΌ π¦β ΞΌ π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) = to-π¦-οΌ X (compact-opens-are-closed-under-β¨ X Kβ (Kβ β§[ πͺ X ] Kβ) ΞΊβ ΞΊ) ΞΊβ (absorption-right (πͺ X) Kβ Kβ) where ΞΊ : is-compact-open X (Kβ β§[ πͺ X ] Kβ) holds ΞΊ = binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ Ξ½ : (π¦β π¦β π¦β : π¦ X) β π¦β β§β (π¦β β¨β π¦β) οΌ (π¦β β§β π¦β) β¨β (π¦β β§β π¦β) Ξ½ π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) π¦β@(Kβ , ΞΊβ) = to-π¦-οΌ X ΞΊ ΞΊβ² β where ΞΊ = binary-coherence X Ο Kβ (Kβ β¨[ πͺ X ] Kβ) ΞΊβ (compact-opens-are-closed-under-β¨ X Kβ Kβ ΞΊβ ΞΊβ) ΞΊβ² = compact-opens-are-closed-under-β¨ X (Kβ β§[ πͺ X ] Kβ) (Kβ β§[ πͺ X ] Kβ) (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) (binary-coherence X Ο Kβ Kβ ΞΊβ ΞΊβ) β : Kβ β§[ πͺ X ] (Kβ β¨[ πͺ X ] Kβ) οΌ (Kβ β§[ πͺ X ] Kβ) β¨[ πͺ X ] (Kβ β§[ πͺ X ] Kβ) β = binary-distributivity (πͺ X) Kβ Kβ Kβ \end{code} The lattice `π¦β¦ Xβ¦` is a small distributive lattice because we assumed the type of compact opens to be small. \begin{code} π¦β¦ Xβ¦-is-small : is-small β£ π¦β¦ Xβ¦ β£α΅ π¦β¦ Xβ¦-is-small = smallness-of-π¦ ua X Οβ \end{code} Added on 2024-04-12. \begin{code} π¦β» : π€ Μ π¦β» = resized β£ π¦β¦ Xβ¦ β£α΅ π¦β¦ Xβ¦-is-small to-small-copy : β£ π¦β¦ Xβ¦ β£α΅ β π¦β» to-small-copy K = let e = resizing-condition π¦β¦ Xβ¦-is-small in inverse β e β (ββ-is-equiv e) K to-original : π¦β» β β£ π¦β¦ Xβ¦ β£α΅ to-original = β resizing-condition π¦β¦ Xβ¦-is-small β \end{code} Added on 2024-04-30. \begin{code} open OperationsOnCompactOpens X Ο open DistributiveLattice hiding (X) ΞΉβ-preserves-β¨ : (Kβ Kβ : β£ π¦β¦ Xβ¦ β£α΅) β prβ (Kβ β¨β Kβ) οΌ prβ Kβ β¨[ πͺ X ] prβ Kβ ΞΉβ-preserves-β¨ Kβ Kβ = β€-is-antisymmetric (poset-of (πͺ X)) β β‘ where β : (ΞΉβ (Kβ β¨β Kβ) β€[ poset-of (πͺ X) ] (ΞΉβ Kβ β¨[ πͺ X ] ΞΉβ Kβ)) holds β = β¨[ πͺ X ]-least (β¨[ πͺ X ]-upperβ (ΞΉβ Kβ) (ΞΉβ Kβ)) (β¨[ πͺ X ]-upperβ (ΞΉβ Kβ) (ΞΉβ Kβ)) β‘ : ((ΞΉβ Kβ β¨[ πͺ X ] ΞΉβ Kβ) β€[ poset-of (πͺ X) ] ΞΉβ (Kβ β¨β Kβ)) holds β‘ = β¨[ πͺ X ]-least (β¨[ πͺ X ]-upperβ (ΞΉβ Kβ) (ΞΉβ Kβ)) (β¨[ πͺ X ]-upperβ (ΞΉβ Kβ) (ΞΉβ Kβ)) ΞΉβ-preserves-β§ : (Kβ Kβ : β£ π¦β¦ Xβ¦ β£α΅) β prβ (Kβ β§β Kβ) οΌ prβ Kβ β§[ πͺ X ] prβ Kβ ΞΉβ-preserves-β§ Kβ Kβ = β€-is-antisymmetric (poset-of (πͺ X)) β β‘ where β : (prβ (Kβ β§β Kβ) β€[ poset-of (πͺ X) ] (prβ Kβ β§[ πͺ X ] prβ Kβ)) holds β = β§[ πͺ X ]-greatest (ΞΉβ Kβ) (ΞΉβ Kβ) (prβ (Kβ β§β Kβ)) (β§[ πͺ X ]-lowerβ (ΞΉβ Kβ) (ΞΉβ Kβ)) (β§[ πͺ X ]-lowerβ (prβ Kβ) (prβ Kβ)) β‘ : ((prβ Kβ β§[ πͺ X ] prβ Kβ) β€[ poset-of (πͺ X) ] prβ (Kβ β§β Kβ)) holds β‘ = β§[ πͺ X ]-greatest (prβ Kβ) (prβ Kβ) (prβ (Kβ β§β Kβ)) (β§[ πͺ X ]-lowerβ (ΞΉβ Kβ) (ΞΉβ Kβ)) (β§[ πͺ X ]-lowerβ (prβ Kβ) (prβ Kβ)) \end{code}