Ayberk Tosun, 8 March 2021.
Ported from `ayberkt/formal-topology-in-UF`.
* Frames.
* Frame homomorphisms.
* Frame bases.
\begin{code}[hide]
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan hiding (π; β; β)
open import UF.Base
open import UF.FunExt
open import UF.PropTrunc
open import MLTT.List hiding ([_])
module Locales.Frame
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
where
open import Slice.Family
open import UF.Hedberg
open import UF.Logic
open import UF.Sets
open import UF.Sets-Properties
open import UF.Subsingletons
open import UF.Subsingletons-FunExt
open import UF.Subsingletons-Properties
open import UF.SubtypeClassifier
open import UF.SubtypeClassifier-Properties
open AllCombinators pt fe
\end{code}
\section{Preliminaries}
\begin{code}
private
variable
π€β² π₯β² π¦β² π€β²β² π₯β²β² : Universe
\end{code}
We define some order-theoretic notions that are also defined in the
`Dcpo` module. Ideally, this should be factored out into a standalone
module to be imported by both this module and the `Dcpo` module.
\begin{code}
is-reflexive : {A : π€ Μ } β (A β A β Ξ© π₯) β Ξ© (π€ β π₯)
is-reflexive {A = A} _β€_ = β±― x κ A , x β€ x
is-transitive : {A : π€ Μ } β (A β A β Ξ© π₯) β Ξ© (π€ β π₯)
is-transitive {A = A} _β€_ =
β±― x κ A , β±― y κ A , β±― z κ A , x β€ y β y β€ z β x β€ z
is-preorder : {A : π€ Μ } β (A β A β Ξ© π₯) β Ξ© (π€ β π₯)
is-preorder {A = A} _β€_ = is-reflexive _β€_ β§ is-transitive _β€_
\end{code}
Antisymmetry is not propositional unless A is a set. We will always
work with sets but the fact they are sets will be a corollary of their
equipment with an antisymmetric order so they are not sets a priori.
\begin{code}
is-antisymmetric : {A : π€ Μ } β (A β A β Ξ© π₯) β (π€ β π₯) Μ
is-antisymmetric {A = A} _β€_ = {x y : A} β (x β€ y) holds β (y β€ x) holds β x οΌ y
being-antisymmetric-is-prop : {A : π€ Μ } (_β€_ : A β A β Ξ© π₯)
β is-set A
β is-prop (is-antisymmetric _β€_)
being-antisymmetric-is-prop {π€} {A} _β€_ A-is-set =
Ξ -is-prop' fe (Ξ» x β Ξ -is-prop' fe (Ξ» y β Ξ β-is-prop fe (Ξ» _ _ β A-is-set {x} {y})))
is-partial-order : (A : π€ Μ )β (A β A β Ξ© π₯) β π€ β π₯ Μ
is-partial-order A _β€_ = is-preorder _β€_ holds Γ is-antisymmetric _β€_
being-partial-order-is-prop : (A : π€ Μ )(_β€_ : A β A β Ξ© π₯)
β is-prop (is-partial-order A _β€_)
being-partial-order-is-prop A _β€_ = prop-criterion Ξ³
where
Ξ³ : is-partial-order A _β€_ β is-prop (is-partial-order A _β€_)
Ξ³ (p , a) = Γ-is-prop
(holds-is-prop (is-preorder _β€_))
(being-antisymmetric-is-prop _β€_ i)
where
i : is-set A
i = type-with-prop-valued-refl-antisym-rel-is-set
(Ξ» x y β (x β€ y) holds)
(Ξ» x y β holds-is-prop (x β€ y))
(prβ p)
(Ξ» x y β a {x} {y})
\end{code}
\section{Definition of poset}
A (π€, π₯)-poset is a poset whose
- carrier lives in universe π€, and
- whose relation lives in universe π₯.
\begin{code}
poset-structure : (π₯ : Universe) β π€ Μ β π€ β π₯ βΊ Μ
poset-structure π₯ A =
Ξ£ _β€_ κ (A β A β Ξ© π₯) , (is-partial-order A _β€_)
Poset : (π€ π₯ : Universe) β π€ βΊ β π₯ βΊ Μ
Poset π€ π₯ = Ξ£ A κ π€ Μ , poset-structure π₯ A
β£_β£β : Poset π€ π₯ β π€ Μ
β£ A , _ β£β = A
rel-syntax : (P : Poset π€ π₯) β β£ P β£β β β£ P β£β β Ξ© π₯
rel-syntax (_ , _β€_ , _) = _β€_
infix 5 rel-syntax
syntax rel-syntax P x y = x β€[ P ] y
poset-eq-syntax : (P : Poset π€ π₯) β β£ P β£β β β£ P β£β β Ξ© π₯
poset-eq-syntax P x y = x β€[ P ] y β§ y β€[ P ] x
syntax poset-eq-syntax P x y = x β£[ P ] y
β€-is-reflexive : (P : Poset π€ π₯)
β is-reflexive (Ξ» x y β x β€[ P ] x) holds
β€-is-reflexive (_ , _ , ((r , _) , _)) = r
β£-is-reflexive : (P : Poset π€ π₯) β is-reflexive (Ξ» x y β x β£[ P ] x) holds
β£-is-reflexive P x = β€-is-reflexive P x , β€-is-reflexive P x
reflexivity+ : (P : Poset π€ π₯)
β {x y : prβ P} β x οΌ y β (x β€[ P ] y) holds
reflexivity+ P {x} {y} p =
transport (Ξ» - β (x β€[ P ] -) holds) p (β€-is-reflexive P x)
β€-is-transitive : (P : Poset π€ π₯)
β is-transitive (Ξ» x y β x β€[ P ] y) holds
β€-is-transitive (_ , _ , ((_ , t) , _)) = t
β€-is-antisymmetric : (P : Poset π€ π₯)
β is-antisymmetric (Ξ» x y β x β€[ P ] y)
β€-is-antisymmetric (_ , _ , (_ , a)) = a
carrier-of-[_]-is-set : (P : Poset π€ π₯) β is-set β£ P β£β
carrier-of-[_]-is-set P@ (A , _)=
type-with-prop-valued-refl-antisym-rel-is-set
(Ξ» x y β (x β€[ P ] y) holds)
(Ξ» x y β holds-is-prop (x β€[ P ] y))
(β€-is-reflexive P)
(Ξ» x y β β€-is-antisymmetric P {x} {y})
\end{code}
Some convenient syntax for reasoning with posets.
\begin{code}
module PosetNotation (P : Poset π€ π₯) where
_β€_ : β£ P β£β β β£ P β£β β Ξ© π₯
x β€ y = x β€[ P ] y
infix 4 _β€_
_β£_ : β£ P β£β β β£ P β£β β Ξ© π₯
x β£ y = x β£[ P ] y
module PosetReasoning (P : Poset π€ π₯) where
open PosetNotation P using (_β€_)
_β€β¨_β©_ : (x : β£ P β£β) {y z : β£ P β£β}
β (x β€ y) holds β (y β€ z) holds β (x β€ z) holds
x β€β¨ p β© q = β€-is-transitive P _ _ _ p q
_οΌβ¨_β©β_ : (x : β£ P β£β) {y z : β£ P β£β}
β x οΌ y β (y β€ z) holds β (x β€ z) holds
x οΌβ¨ p β©β q = transport (Ξ» - β (- β€ _) holds) (p β»ΒΉ) q
_β : (x : β£ P β£β) β (x β€ x) holds
_β = β€-is-reflexive P
infixr 0 _β€β¨_β©_
infixr 0 _οΌβ¨_β©β_
infix 1 _β
infix 1 _οΌ[_]οΌ_
_οΌ[_]οΌ_ : {A : π€ Μ } β A β is-set A β A β Ξ© π€
x οΌ[ iss ]οΌ y = (x οΌ y) , iss
\end{code}
\section{Meets}
\begin{code}
module Meets {A : π€ Μ } (_β€_ : A β A β Ξ© π₯) where
is-top : A β Ξ© (π€ β π₯)
is-top t = β±― x κ A , (x β€ t)
_is-a-lower-bound-of_ : A β A Γ A β Ξ© π₯
l is-a-lower-bound-of (x , y) = (l β€ x) β§ (l β€ y)
lower-bound : A Γ A β π€ β π₯ Μ
lower-bound (x , y) =
Ξ£ l κ A , (l is-a-lower-bound-of (x , y)) holds
_is-glb-of_ : A β A Γ A β Ξ© (π€ β π₯)
l is-glb-of (x , y) = l is-a-lower-bound-of (x , y)
β§ (β±― (lβ² , _) κ lower-bound (x , y) , (lβ² β€ l))
glb-is-an-upper-boundβ : {x y z : A} β (z is-glb-of (x , y) β z β€ x) holds
glb-is-an-upper-boundβ ((pβ , _) , _) = pβ
glb-is-an-upper-boundβ : {x y z : A} β (z is-glb-of (x , y) β z β€ y) holds
glb-is-an-upper-boundβ ((_ , pβ) , _) = pβ
glb-is-greatest : {x y z w : A}
β (z is-glb-of (x , y)) holds
β (w is-a-lower-bound-of (x , y) β w β€ z) holds
glb-is-greatest {_} {_} {_} {w} (_ , q) Ο
= q (w , Ο
)
\end{code}
\section{Joins}
\begin{code}
module Joins {A : π€ Μ } (_β€_ : A β A β Ξ© π₯) where
is-least : A β Ξ© (π€ β π₯)
is-least x = β±― y κ A , x β€ y
_is-an-upper-bound-of_ : A β Fam π¦ A β Ξ© (π₯ β π¦)
u is-an-upper-bound-of U = β±― i κ index U , (U [ i ]) β€ u
_is-an-upper-bound-ofβ_ : A β A Γ A β Ξ© π₯
u is-an-upper-bound-ofβ (v , w) = (v β€ u) β§ (w β€ u)
upper-bound : Fam π¦ A β π€ β π₯ β π¦ Μ
upper-bound U = Ξ£ u κ A , (u is-an-upper-bound-of U) holds
upper-boundβ : A Γ A β π€ β π₯ Μ
upper-boundβ (x , y) = Ξ£ u κ A , (u is-an-upper-bound-ofβ (x , y)) holds
_is-lub-of_ : A β Fam π¦ A β Ξ© (π€ β π₯ β π¦)
u is-lub-of U = (u is-an-upper-bound-of U)
β§ (β±― (uβ² , _) κ upper-bound U , (u β€ uβ²))
_is-lub-ofβ_ : A β A Γ A β Ξ© (π€ β π₯)
u is-lub-ofβ (v , w) = (u is-an-upper-bound-ofβ (v , w))
β§ (β±― (uβ² , _) κ upper-boundβ (v , w) , (u β€ uβ²))
lubβ-is-an-upper-boundβ : {x y z : A} β (z is-lub-ofβ (x , y) β x β€ z) holds
lubβ-is-an-upper-boundβ ((pβ , _) , _) = pβ
lubβ-is-an-upper-boundβ : {x y z : A} β (z is-lub-ofβ (x , y) β y β€ z) holds
lubβ-is-an-upper-boundβ ((_ , pβ) , _) = pβ
lubβ-is-least : {x y z w : A}
β (z is-lub-ofβ (x , y)) holds
β (w is-an-upper-bound-ofβ (x , y) β z β€ w) holds
lubβ-is-least {_} {_} {_} {w} (_ , q) Ο
= q (w , Ο
)
module JoinNotation {A : π€ Μ } (β_ : Fam π¦ A β A) where
join-syntax : (I : π¦ Μ )β (I β A) β A
join-syntax I f = β (I , f)
ββ¨β©-syntax : {I : π¦ Μ } β (I β A) β A
ββ¨β©-syntax {I = I} f = join-syntax I f
infix 2 join-syntax
infix 2 ββ¨β©-syntax
syntax join-syntax I (Ξ» i β e) = ββ¨ i βΆ I β© e
syntax ββ¨β©-syntax (Ξ» i β e) = ββ¨ i β© e
\end{code}
\section{Definition of frame}
A (π€, π₯, π¦)-frame is a frame whose
- carrier lives in universe π€,
- order lives in universe π₯, and
- index types live in universe π¦.
\begin{code}
frame-data : (π₯ π¦ : Universe) β π€ Μ β π€ β π₯ βΊ β π¦ βΊ Μ
frame-data π₯ π¦ A = (A β A β Ξ© π₯)
Γ A
Γ (A β A β A)
Γ (Fam π¦ A β A)
satisfies-frame-laws : {A : π€ Μ } β frame-data π₯ π¦ A β π€ β π₯ β π¦ βΊ Μ
satisfies-frame-laws {π€ = π€} {π₯} {π¦} {A = A} (_β€_ , π , _β_ , β_) =
Ξ£ p κ is-partial-order A _β€_ , rest p holds
where
open Meets _β€_
open Joins _β€_
open JoinNotation β_
rest : is-partial-order A _β€_ β Ξ© (π€ β π₯ β π¦ βΊ)
rest p = Ξ² β§ Ξ³ β§ Ξ΄ β§ Ξ΅
where
P : Poset π€ π₯
P = A , _β€_ , p
iss : is-set A
iss = carrier-of-[ P ]-is-set
Ξ² = is-top π
Ξ³ = β±― (x , y) κ (A Γ A) , ((x β y) is-glb-of (x , y))
Ξ΄ = β±― U κ Fam π¦ A , (β U) is-lub-of U
Ξ΅ = β±― (x , U) κ A Γ Fam π¦ A ,
(x β (ββ¨ i β© U [ i ]) οΌ[ iss ]οΌ ββ¨ i β© x β (U [ i ]))
\end{code}
The proof `satisfying-frame-laws-is-prop` has been added on 2024-04-15.
\begin{code}
satisfying-frame-laws-is-prop : {A : π€ Μ} (d : frame-data π₯ π¦ A)
β is-prop (satisfies-frame-laws d)
satisfying-frame-laws-is-prop {π€} {π₯} {π¦} {A} d@(_β€_ , π , _β_ , β_) =
Ξ£-is-prop (being-partial-order-is-prop A _β€_) β
where
open Meets _β€_
open Joins _β€_
open JoinNotation β_
Ξ² = is-top π
Ξ³ = β±― (x , y) κ (A Γ A) , ((x β y) is-glb-of (x , y))
Ξ΄ = β±― U κ Fam π¦ A , (β U) is-lub-of U
Ξ΅ : is-set A β Ξ© (π€ β π¦ βΊ)
Ξ΅ Ο = β±― (x , U) κ A Γ Fam π¦ A ,
(x β (ββ¨ i β© U [ i ]) οΌ[ Ο ]οΌ ββ¨ i β© x β (U [ i ]))
β‘ : (p : is-partial-order A _β€_) (Ο : is-set A)
β is-prop ((Ξ² β§ Ξ³ β§ Ξ΄ β§ Ξ΅ Ο) holds)
β‘ p Ο = holds-is-prop (Ξ² β§ Ξ³ β§ Ξ΄ β§ Ξ΅ Ο)
Ο : is-partial-order A _β€_ β is-set A
Ο p = carrier-of-[ (A , _β€_ , p) ]-is-set
β : (p : is-partial-order A _β€_) β is-prop ((Ξ² β§ Ξ³ β§ Ξ΄ β§ Ξ΅ (Ο p)) holds)
β p = β‘ p (Ο p)
frame-structure : (π₯ π¦ : Universe) β π€ Μ β π€ β π₯ βΊ β π¦ βΊ Μ
frame-structure π₯ π¦ A = Ξ£ d κ frame-data π₯ π¦ A , satisfies-frame-laws d
\end{code}
The type of (π€, π₯, π¦)-frames is then defined as:
\begin{code}
Frame : (π€ π₯ π¦ : Universe) β π€ βΊ β π₯ βΊ β π¦ βΊ Μ
Frame π€ π₯ π¦ = Ξ£ A κ (π€ Μ ), frame-structure π₯ π¦ A
\end{code}
The underlying poset of a frame:
\begin{code}
poset-of : Frame π€ π₯ π¦ β Poset π€ π₯
poset-of (A , (_β€_ , _ , _ , _) , p , _) = A , _β€_ , p
\end{code}
Some projections.
\begin{code}
β¨_β© : Frame π€ π₯ π¦ β π€ Μ
β¨ (A , (_β€_ , _ , _ , _) , p , _) β© = A
π[_] : (F : Frame π€ π₯ π¦) β β¨ F β©
π[ (A , (_ , π , _ , _) , p , _) ] = π
is-top : (F : Frame π€ π₯ π¦) β β¨ F β© β Ξ© (π€ β π₯)
is-top F t = β±― x κ β¨ F β© , x β€[ poset-of F ] t
π-is-top : (F : Frame π€ π₯ π¦) β (is-top F π[ F ]) holds
π-is-top (A , _ , _ , p , _) = p
π-is-unique : (F : Frame π€ π₯ π¦) β (t : β¨ F β©) β is-top F t holds β t οΌ π[ F ]
π-is-unique F t t-top = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : (t β€[ poset-of F ] π[ F ]) holds
Ξ² = π-is-top F t
Ξ³ : (π[ F ] β€[ poset-of F ] t) holds
Ξ³ = t-top π[ F ]
only-π-is-above-π : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β (π[ F ] β€[ poset-of F ] x) holds β x οΌ π[ F ]
only-π-is-above-π F x p =
π-is-unique F x Ξ» y β y β€β¨ π-is-top F y β© π[ F ] β€β¨ p β© x β
where
open PosetReasoning (poset-of F)
meet-of : (F : Frame π€ π₯ π¦) β β¨ F β© β β¨ F β© β β¨ F β©
meet-of (_ , (_ , _ , _β§_ , _) , _ , _) x y = x β§ y
infixl 4 meet-of
syntax meet-of F x y = x β§[ F ] y
join-of : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β β¨ F β©
join-of (_ , (_ , _ , _ , β_) , _ , _) = β_
infix 4 join-of
syntax join-of F U = β[ F ] U
\end{code}
\begin{code}
β§[_]-is-glb : (A : Frame π€ π₯ π¦) (x y : β¨ A β©)
β let
open Meets (Ξ» x y β x β€[ poset-of A ] y)
in
((x β§[ A ] y) is-glb-of (x , y)) holds
β§[_]-is-glb (A , _ , _ , (_ , Ξ³ , _ , _)) x y = Ξ³ (x , y)
β§[_]-is-glbβ : (A : Frame π€ π₯ π¦) {x y z : β¨ A β©}
β let
open Meets (Ξ» x y β x β€[ poset-of A ] y)
in
z οΌ x β§[ A ] y β (z is-glb-of (x , y)) holds
β§[_]-is-glbβ L@(A , _ , _ , (_ , Ξ³ , _ , _)) {x} {y} {z} p =
transport (Ξ» - β (- is-glb-of (x , y)) holds) (p β»ΒΉ) (β§[ L ]-is-glb x y)
where
open Meets (Ξ» x y β x β€[ poset-of L ] y)
β§[_]-lowerβ : (A : Frame π€ π₯ π¦) (x y : β¨ A β©)
β ((x β§[ A ] y) β€[ poset-of A ] x) holds
β§[_]-lowerβ (A , _ , _ , (_ , Ξ³ , _ , _)) x y = prβ (prβ (Ξ³ (x , y)))
β§[_]-lowerβ : (A : Frame π€ π₯ π¦) (x y : β¨ A β©)
β ((x β§[ A ] y) β€[ poset-of A ] y) holds
β§[_]-lowerβ (A , _ , _ , (_ , Ξ³ , _ , _)) x y = prβ (prβ (Ξ³ (x , y)))
β§[_]-greatest : (A : Frame π€ π₯ π¦) (x y : β¨ A β©)
β (z : β¨ A β©)
β (z β€[ poset-of A ] x) holds
β (z β€[ poset-of A ] y) holds
β (z β€[ poset-of A ] (x β§[ A ] y)) holds
β§[_]-greatest (A , _ , _ , (_ , Ξ³ , _ , _)) x y z p q =
prβ (Ξ³ (x , y)) (z , p , q)
\end{code}
\begin{code}
π-right-unit-of-β§ : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©) β x β§[ F ] π[ F ] οΌ x
π-right-unit-of-β§ F x = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : ((x β§[ F ] π[ F ]) β€[ poset-of F ] x) holds
Ξ² = β§[ F ]-lowerβ x π[ F ]
Ξ³ : (x β€[ poset-of F ] (x β§[ F ] π[ F ])) holds
Ξ³ = β§[ F ]-greatest x π[ F ] x (β€-is-reflexive (poset-of F) x) (π-is-top F x)
\end{code}
\begin{code}
β[_]-upper : (A : Frame π€ π₯ π¦) (U : Fam π¦ β¨ A β©) (i : index U)
β ((U [ i ]) β€[ poset-of A ] (β[ A ] U)) holds
β[_]-upper (A , _ , _ , (_ , _ , c , _)) U i = prβ (c U) i
β[_]-least : (A : Frame π€ π₯ π¦) β (U : Fam π¦ β¨ A β©)
β let open Joins (Ξ» x y β x β€[ poset-of A ] y)
in ((u , _) : upper-bound U) β ((β[ A ] U) β€[ poset-of A ] u) holds
β[_]-least (A , _ , _ , (_ , _ , c , _)) U = prβ (c U)
\end{code}
\begin{code}
π : (π€ : Universe) β π€ Μ
π π€ = π {π€} + π {π€}
pattern β = inl β
pattern β = inr β
andβ : {π€ : Universe} β π π€ β π π€ β π π€
andβ (inl β) _ = inl β
andβ (inr β) y = y
binary-family : {A : π€ Μ } β (π¦ : Universe) β A β A β Fam π¦ A
binary-family {A = A} π¦ x y = π π¦ , Ξ±
where
Ξ± : π π¦ β A
Ξ± (inl *) = x
Ξ± (inr *) = y
binary-family-syntax : {A : π€ Μ } {π¦ : Universe} β A β A β Fam π¦ A
binary-family-syntax {π¦ = π¦} x y = binary-family π¦ x y
syntax binary-family-syntax x y = β
x , y β
fmap-binary-family : {A : π€ Μ } {B : π₯ Μ }
β (π¦ : Universe)
β (f : A β B)
β (x y : A)
β β
f z β£ z Ξ΅ (binary-family π¦ x y) β
οΌ binary-family π¦ (f x) (f y)
fmap-binary-family π¦ f x y = ap (Ξ» - β π π¦ , -) (dfunext fe Ξ³)
where
Ξ³ : β
f z β£ z Ξ΅ binary-family π¦ x y β [_] βΌ binary-family π¦ (f x) (f y) [_]
Ξ³ (inl *) = refl
Ξ³ (inr *) = refl
binary-join : (F : Frame π€ π₯ π¦) β β¨ F β© β β¨ F β© β β¨ F β©
binary-join {π¦ = π¦} F x y = β[ F ] binary-family π¦ x y
infix 3 binary-join
syntax binary-join F x y = x β¨[ F ] y
β¨[_]-least : (F : Frame π€ π₯ π¦)
β let open Joins (Ξ» x y β x β€[ poset-of F ] y) in
{x y z : β¨ F β©}
β (x β€[ poset-of F ] z) holds
β (y β€[ poset-of F ] z) holds
β ((x β¨[ F ] y) β€[ poset-of F ] z) holds
β¨[_]-least {π¦ = π¦} F {x} {y} {z} xβ€z yβ€z =
β[ F ]-least (binary-family π¦ x y) (z , Ξ³)
where
Ξ³ : _
Ξ³ (inl *) = xβ€z
Ξ³ (inr *) = yβ€z
β¨[_]-upperβ : (F : Frame π€ π₯ π¦)
β let open Joins (Ξ» x y β x β€[ poset-of F ] y) in
(x y : β¨ F β©) β (x β€[ poset-of F ] (x β¨[ F ] y)) holds
β¨[_]-upperβ {π¦ = π¦} F x y = β[ F ]-upper (binary-family π¦ x y) (inl β)
β¨[_]-upperβ : (F : Frame π€ π₯ π¦)
β let open Joins (Ξ» x y β x β€[ poset-of F ] y) in
(x y : β¨ F β©) β (y β€[ poset-of F ] (x β¨[ F ] y)) holds
β¨[_]-upperβ {π¦ = π¦} F x y = β[ F ]-upper (binary-family π¦ x y) (inr β)
β¨[_]-is-commutative : (F : Frame π€ π₯ π¦)
β (x y : β¨ F β©)
β (x β¨[ F ] y) οΌ (y β¨[ F ] x)
β¨[_]-is-commutative F x y =
β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
open PosetNotation (poset-of F)
open PosetReasoning (poset-of F)
Ξ² : ((x β¨[ F ] y) β€ (y β¨[ F ] x)) holds
Ξ² = β¨[ F ]-least (β¨[ F ]-upperβ y x) (β¨[ F ]-upperβ y x)
Ξ³ : ((y β¨[ F ] x) β€ (x β¨[ F ] y)) holds
Ξ³ = β¨[ F ]-least (β¨[ F ]-upperβ x y) (β¨[ F ]-upperβ x y)
β¨[_]-assoc : (F : Frame π€ π₯ π¦)
β (x y z : β¨ F β©)
β (x β¨[ F ] y) β¨[ F ] z οΌ x β¨[ F ] (y β¨[ F ] z)
β¨[_]-assoc F x y z =
β€-is-antisymmetric (poset-of F) (β¨[ F ]-least Ξ² Ξ³) (β¨[ F ]-least Ξ΄ Ξ΅)
where
open PosetNotation (poset-of F)
open PosetReasoning (poset-of F)
Ξ· : (y β€ ((x β¨[ F ] y) β¨[ F ] z)) holds
Ξ· = y β€β¨ β¨[ F ]-upperβ x y β©
x β¨[ F ] y β€β¨ β¨[ F ]-upperβ (x β¨[ F ] y) z β©
(x β¨[ F ] y) β¨[ F ] z β
ΞΈ : (y β€ (x β¨[ F ] (y β¨[ F ] z))) holds
ΞΈ = y β€β¨ β¨[ F ]-upperβ y z β©
y β¨[ F ] z β€β¨ β¨[ F ]-upperβ x (y β¨[ F ] z) β©
x β¨[ F ] (y β¨[ F ] z) β
Ξ΄ : (x β€ ((x β¨[ F ] y) β¨[ F ] z)) holds
Ξ΄ = x β€β¨ β¨[ F ]-upperβ x y β©
x β¨[ F ] y β€β¨ β¨[ F ]-upperβ (x β¨[ F ] y) z β©
(x β¨[ F ] y) β¨[ F ] z β
Ξ΅ : ((y β¨[ F ] z) β€ ((x β¨[ F ] y) β¨[ F ] z)) holds
Ξ΅ = β¨[ F ]-least Ξ· (β¨[ F ]-upperβ (x β¨[ F ] y) z)
Ξ² : ((x β¨[ F ] y) β€ (x β¨[ F ] (y β¨[ F ] z))) holds
Ξ² = β¨[ F ]-least (β¨[ F ]-upperβ x (y β¨[ F ] z)) ΞΈ
Ξ³ : (z β€ (x β¨[ F ] (y β¨[ F ] z))) holds
Ξ³ = z β€β¨ β¨[ F ]-upperβ y z β©
y β¨[ F ] z β€β¨ β¨[ F ]-upperβ x (y β¨[ F ] z) β©
x β¨[ F ] (y β¨[ F ] z) β
\end{code}
By fixing the left or right argument of `_β¨_` to anything, we get a monotonic
map.
\begin{code}
β¨[_]-left-monotone : (F : Frame π€ π₯ π¦)
β {x y z : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β ((x β¨[ F ] z) β€[ poset-of F ] (y β¨[ F ] z)) holds
β¨[_]-left-monotone F {x = x} {y} {z} p = β¨[ F ]-least Ξ³ (β¨[ F ]-upperβ y z)
where
open PosetNotation (poset-of F) using (_β€_)
open PosetReasoning (poset-of F)
Ξ³ : (x β€ (y β¨[ F ] z)) holds
Ξ³ = x β€β¨ p β© y β€β¨ β¨[ F ]-upperβ y z β© y β¨[ F ] z β
β¨[_]-right-monotone : (F : Frame π€ π₯ π¦)
β {x y z : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β ((z β¨[ F ] x) β€[ poset-of F ] (z β¨[ F ] y)) holds
β¨[_]-right-monotone F {x} {y} {z} p =
z β¨[ F ] x οΌβ¨ β¨[ F ]-is-commutative z x β©β
x β¨[ F ] z β€β¨ β¨[ F ]-left-monotone p β©
y β¨[ F ] z οΌβ¨ β¨[ F ]-is-commutative y z β©β
z β¨[ F ] y β
where
open PosetReasoning (poset-of F)
\end{code}
\begin{code}
β
: {A : π€ Μ } β (π¦ : Universe) β Fam π¦ A
β
π¦ = π {π¦} , Ξ» ()
π[_] : (F : Frame π€ π₯ π¦) β β¨ F β©
π[ F ] = β[ F ] (β
_)
is-bottom : (F : Frame π€ π₯ π¦) β β¨ F β© β Ξ© (π€ β π₯)
is-bottom F b = β±― x κ β¨ F β© , (b β€[ poset-of F ] x)
π-is-bottom : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©) β (π[ F ] β€[ poset-of F ] x) holds
π-is-bottom F x = β[ F ]-least (π , Ξ» ()) (x , Ξ» ())
only-π-is-below-π : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β (x β€[ poset-of F ] π[ F ]) holds β x οΌ π[ F ]
only-π-is-below-π F x p =
β€-is-antisymmetric (poset-of F) p (π-is-bottom F x)
π-is-unique : (F : Frame π€ π₯ π¦) (b : β¨ F β©)
β ((x : β¨ F β©) β (b β€[ poset-of F ] x) holds) β b οΌ π[ F ]
π-is-unique F b Ο = only-π-is-below-π F b (Ο π[ F ])
π-right-unit-of-β¨ : (F : Frame π€ π₯ π¦) (x : β¨ F β©) β π[ F ] β¨[ F ] x οΌ x
π-right-unit-of-β¨ {π¦ = π¦} F x = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
open PosetNotation (poset-of F)
Ξ² : ((π[ F ] β¨[ F ] x) β€ x) holds
Ξ² = β¨[ F ]-least (π-is-bottom F x) (β€-is-reflexive (poset-of F) x)
Ξ³ : (x β€ (π[ F ] β¨[ F ] x)) holds
Ξ³ = β[ F ]-upper (binary-family π¦ π[ F ] x) (inr β)
π-left-unit-of-β¨ : (F : Frame π€ π₯ π¦) (x : β¨ F β©) β x β¨[ F ] π[ F ] οΌ x
π-left-unit-of-β¨ {π¦ = π¦} F x =
x β¨[ F ] π[ F ] οΌβ¨ β¨[ F ]-is-commutative x π[ F ] β©
π[ F ] β¨[ F ] x οΌβ¨ π-right-unit-of-β¨ F x β©
x β
\end{code}
\begin{code}
distributivity : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©)
β (U : Fam π¦ β¨ F β©)
β let open JoinNotation (Ξ» - β β[ F ] -) in
x β§[ F ] (ββ¨ i β© (U [ i ]))
οΌ ββ¨ i β© (x β§[ F ] (U [ i ]))
distributivity (_ , _ , _ , (_ , _ , _ , d)) x U = d (x , U)
\end{code}
\section{Scott-continuity}
\begin{code}
is-directed : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Ξ© (π₯ β π¦)
is-directed F (I , Ξ²) =
β₯ I β₯Ξ©
β§ (β±― i κ I , β±― j κ I , (Ζ k κ I , ((Ξ² i β€ Ξ² k) β§ (Ξ² j β€ Ξ² k)) holds))
where open PosetNotation (poset-of F)
directedness-entails-inhabitation : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β (is-directed F S β β₯ index S β₯Ξ©) holds
directedness-entails-inhabitation F S = prβ
is-scott-continuous : (F : Frame π€ π₯ π¦)
β (G : Frame π€β² π₯β² π¦)
β (f : β¨ F β© β β¨ G β©)
β Ξ© (π€ β π₯ β π¦ βΊ β π€β² β π₯β²)
is-scott-continuous {π¦ = π¦} F G f =
β±― S κ Fam π¦ β¨ F β© , is-directed F S β f (β[ F ] S) is-lub-of β
f s β£ s Ξ΅ S β
where
open Joins (Ξ» x y β x β€[ poset-of G ] y) using (_is-lub-of_)
id-is-scott-continuous : (F : Frame π€ π₯ π¦) β is-scott-continuous F F id holds
id-is-scott-continuous F S Ξ΄ = β[ F ]-upper S , β[ F ]-least S
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
\end{code}
\section{Frame homomorphisms}
\begin{code}
is-monotonic : (P : Poset π€ π₯) (Q : Poset π€β² π₯β²)
β (prβ P β prβ Q) β Ξ© (π€ β π₯ β π₯β²)
is-monotonic P Q f =
β±― (x , y) κ (prβ P Γ prβ P) , ((x β€[ P ] y) β f x β€[ Q ] f y)
_βmβ_ : (P : Poset π€ π₯) (Q : Poset π€β² π₯β²) β π€ β π₯ β π€β² β π₯β² Μ
P βmβ Q = Ξ£ f κ (β£ P β£β β β£ Q β£β) , (is-monotonic P Q f) holds
monotone-image-on-directed-family-is-directed : (F : Frame π€ π₯ π¦)
β (G : Frame π€β² π₯β² π¦)
β (S : Fam π¦ β¨ F β©)
β is-directed F S holds
β (f : β¨ F β© β β¨ G β©)
β is-monotonic (poset-of F) (poset-of G) f holds
β is-directed G β
f s β£ s Ξ΅ S β holds
monotone-image-on-directed-family-is-directed F G S (ΞΉ , Ο
) f ΞΌ = ΞΉ , Ξ³
where
open PropositionalTruncation pt
I = index S
Ξ³ : (β±― i κ I , β±― j κ I ,
(Ζ k κ I ,
((f (S [ i ]) β€[ poset-of G ] f (S [ k ]))
β§ (f (S [ j ]) β€[ poset-of G ] f (S [ k ]))) holds)) holds
Ξ³ i j = β₯β₯-rec β₯β₯-is-prop Ξ² (Ο
i j)
where
Ξ² : (Ξ£ k κ I , (((S [ i ]) β€[ poset-of F ] (S [ k ]))
β§ ((S [ j ]) β€[ poset-of F ] (S [ k ]))) holds)
β (β k κ I , ((f (S [ i ]) β€[ poset-of G ] f (S [ k ]))
β§ (f (S [ j ]) β€[ poset-of G ] f (S [ k ]))) holds)
Ξ² (k , p , q) = β£ k , ΞΌ (S [ i ] , S [ k ]) p , ΞΌ (S [ j ] , S [ k ]) q β£
is-join-preserving : (F : Frame π€ π₯ π¦) (G : Frame π€' π₯' π¦)
β (β¨ F β© β β¨ G β©) β Ξ© (π€ β π€' β π¦ βΊ)
is-join-preserving {π¦ = π¦} F G f =
β±― S κ Fam π¦ β¨ F β© , f (β[ F ] S) οΌ[ iss ]οΌ β[ G ] β
f s β£ s Ξ΅ S β
where
iss = carrier-of-[ poset-of G ]-is-set
join-preserving-implies-scott-continuous : (F : Frame π€ π₯ π¦) (G : Frame π€' π₯' π¦)
β (f : β¨ F β© β β¨ G β©)
β is-join-preserving F G f holds
β is-scott-continuous F G f holds
join-preserving-implies-scott-continuous F G f Ο S _ = Ξ³
where
open Joins (Ξ» x y β x β€[ poset-of G ] y)
Ξ³ : (f (β[ F ] S) is-lub-of β
f s β£ s Ξ΅ S β) holds
Ξ³ = transport
(Ξ» - β (- is-lub-of (fmap-syntax (Ξ» s β f s)) S) holds)
(Ο S β»ΒΉ)
(β[ G ]-upper β
f s β£ s Ξ΅ S β , β[ G ]-least β
f s β£ s Ξ΅ S β)
\end{code}
\section{Some properties of frames}
\begin{code}
β§[_]-unique : (F : Frame π€ π₯ π¦) {x y z : β¨ F β©}
β let open Meets (Ξ» x y β x β€[ poset-of F ] y) in
(z is-glb-of (x , y)) holds β z οΌ (x β§[ F ] y)
β§[ F ]-unique {x} {y} {z} (p , q) = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : (z β€[ poset-of F ] (x β§[ F ] y)) holds
Ξ² = β§[ F ]-greatest x y z (prβ p) (prβ p)
Ξ³ : ((x β§[ F ] y) β€[ poset-of F ] z) holds
Ξ³ = q ((x β§[ F ] y) , β§[ F ]-lowerβ x y , β§[ F ]-lowerβ x y)
\end{code}
\begin{code}
β[_]-unique : (F : Frame π€ π₯ π¦) (U : Fam π¦ β¨ F β©) (u : β¨ F β©)
β let open Joins (Ξ» x y β x β€[ poset-of F ] y) in
(u is-lub-of U) holds β u οΌ β[ F ] U
β[_]-unique F U u (p , q) = β€-is-antisymmetric (poset-of F) Ξ³ Ξ²
where
open PosetNotation (poset-of F)
Ξ³ : (u β€ (β[ F ] U)) holds
Ξ³ = q ((β[ F ] U) , β[ F ]-upper U)
Ξ² : ((β[ F ] U) β€ u) holds
Ξ² = β[ F ]-least U (u , p)
connecting-lemmaβ : (F : Frame π€ π₯ π¦) {x y : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β x οΌ x β§[ F ] y
connecting-lemmaβ F {x} {y} p = β§[ F ]-unique (Ξ² , Ξ³)
where
open Meets (Ξ» x y β x β€[ poset-of F ] y)
Ξ² : (x is-a-lower-bound-of (x , y)) holds
Ξ² = β€-is-reflexive (poset-of F) x , p
Ξ³ : (β±― (z , _) κ lower-bound (x , y) , z β€[ poset-of F ] x) holds
Ξ³ (z , q , _) = q
connecting-lemmaβ : (F : Frame π€ π₯ π¦) {x y : β¨ F β©}
β x οΌ x β§[ F ] y
β (x β€[ poset-of F ] y) holds
connecting-lemmaβ F {x} {y} p = x οΌβ¨ p β©β x β§[ F ] y β€β¨ β§[ F ]-lowerβ x y β© y β
where
open PosetReasoning (poset-of F)
connecting-lemmaβ : (F : Frame π€ π₯ π¦) {x y : β¨ F β©}
β y οΌ x β¨[ F ] y
β (x β€[ poset-of F ] y) holds
connecting-lemmaβ F {x} {y} p =
x β€β¨ β¨[ F ]-upperβ x y β© x β¨[ F ] y οΌβ¨ p β»ΒΉ β©β y β
where
open PosetReasoning (poset-of F)
connecting-lemmaβ : (F : Frame π€ π₯ π¦) {x y : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β y οΌ x β¨[ F ] y
connecting-lemmaβ F {x} {y} p = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : (y β€[ poset-of F ] (x β¨[ F ] y)) holds
Ξ² = β¨[ F ]-upperβ x y
Ξ³ : ((x β¨[ F ] y) β€[ poset-of F ] y) holds
Ξ³ = β¨[ F ]-least p (β€-is-reflexive (poset-of F) y)
yoneda : (F : Frame π€ π₯ π¦)
β (x y : β¨ F β©)
β ((z : β¨ F β©) β ((z β€[ poset-of F ] x) β (z β€[ poset-of F ] y)) holds)
β (x β€[ poset-of F ] y) holds
yoneda F x y Ο = Ο x (β€-is-reflexive (poset-of F) x)
scott-continuous-implies-monotone : (F : Frame π€ π₯ π¦) (G : Frame π€β² π₯β² π¦)
β (f : β¨ F β© β β¨ G β©)
β is-scott-continuous F G f holds
β is-monotonic (poset-of F) (poset-of G) f holds
scott-continuous-implies-monotone {π¦ = π¦} F G f Ο (x , y) p =
f x β€β¨ i β©
f x β¨[ G ] f y οΌβ¨ ii β©β
β[ G ] β
f z β£ z Ξ΅ binary-family π¦ x y β οΌβ¨ iii β©β
f (x β¨[ F ] y) οΌβ¨ iv β©β
f y β
where
open PosetReasoning (poset-of G)
open PropositionalTruncation pt
Ξ΄ : is-directed F (binary-family π¦ x y) holds
Ξ΄ = β£ inr β β£ , β
where
rx : (x β€[ poset-of F ] x) holds
rx = β€-is-reflexive (poset-of F) x
ry : (y β€[ poset-of F ] y) holds
ry = β€-is-reflexive (poset-of F) y
β : _
β (inl β) (inl β) = β£ inl β , rx , rx β£
β (inl β) (inr β) = β£ inr β , p , ry β£
β (inr β) (inl β) = β£ inr β , ry , p β£
β (inr β) (inr β) = β£ inr β , ry , ry β£
i = β¨[ G ]-upperβ (f x) (f y)
ii = ap (Ξ» - β β[ G ] -) (fmap-binary-family π¦ f x y β»ΒΉ)
iii = (β[ G ]-unique
β
f z β£ z Ξ΅ binary-family π¦ x y β
(f (β[ F ] β
x , y β))
(Ο β
x , y β Ξ΄)) β»ΒΉ
iv = ap f (connecting-lemmaβ F p) β»ΒΉ
scott-continuous-join-eq : (F : Frame π€ π₯ π¦)
β (G : Frame π€β² π₯β² π¦)
β (f : β¨ F β© β β¨ G β©)
β is-scott-continuous F G f holds
β (S : Fam π¦ β¨ F β©)
β is-directed F S holds
β f (β[ F ] S) οΌ β[ G ] β
f s β£ s Ξ΅ S β
scott-continuous-join-eq F G f ΞΆ S Ξ΄ =
β[ G ]-unique β
f s β£ s Ξ΅ S β (f (β[ F ] S)) (ΞΆ S Ξ΄)
β-of-scott-cont-is-scott-cont : (F : Frame π€ π₯ π¦)
(G : Frame π€β² π₯β² π¦)
(H : Frame π€β²β² π₯β²β² π¦)
β (g : β¨ G β© β β¨ H β©)
β (f : β¨ F β© β β¨ G β©)
β is-scott-continuous G H g holds
β is-scott-continuous F G f holds
β is-scott-continuous F H (g β f) holds
β-of-scott-cont-is-scott-cont F G H g f ΞΆg ΞΆf S Ξ΄ =
Ξ² , Ξ³
where
open Joins (Ξ» x y β x β€[ poset-of H ] y)
open PosetReasoning (poset-of H)
ΞΌf : is-monotonic (poset-of F) (poset-of G) f holds
ΞΌf = scott-continuous-implies-monotone F G f ΞΆf
ΞΌg : is-monotonic (poset-of G) (poset-of H) g holds
ΞΌg = scott-continuous-implies-monotone G H g ΞΆg
β : is-directed G β
f s β£ s Ξ΅ S β holds
β = monotone-image-on-directed-family-is-directed F G S Ξ΄ f ΞΌf
Ξ² : (g (f (β[ F ] S)) is-an-upper-bound-of β
g (f s) β£ s Ξ΅ S β) holds
Ξ² k = g (f (S [ k ])) β€β¨ i β©
β[ H ] β
g (f s) β£ s Ξ΅ S β β€β¨ ii β©
g (β[ G ] β
f s β£ s Ξ΅ S β) οΌβ¨ iii β©β
g (f (β[ F ] S)) β
where
i = β[ H ]-upper β
g (f s) β£ s Ξ΅ S β k
ii = β[ H ]-least
β
g (f s) β£ s Ξ΅ S β
(g (β[ G ] β
f s β£ s Ξ΅ S β) , prβ (ΞΆg β
f s β£ s Ξ΅ S β β ))
iii = ap g (scott-continuous-join-eq F G f ΞΆf S Ξ΄ β»ΒΉ)
Ξ³ : (β±― (u , _) κ upper-bound β
g (f s) β£ s Ξ΅ S β ,
(g (f (β[ F ] S)) β€[ poset-of H ] u)) holds
Ξ³ (u , p) = g (f (β[ F ] S)) β€β¨ i β©
g (β[ G ] β
f s β£ s Ξ΅ S β) οΌβ¨ ii β©β
β[ H ] β
g (f s) β£ s Ξ΅ S β β€β¨ iii β©
u β
where
β» : (f (β[ F ] S) β€[ poset-of G ] (β[ G ] β
f s β£ s Ξ΅ S β)) holds
β» = prβ (ΞΆf S Ξ΄) ((β[ G ] β
f s β£ s Ξ΅ S β)
, β[ G ]-upper (β
f s β£ s Ξ΅ S β))
i = ΞΌg (f (β[ F ] S) , β[ G ] β
f s β£ s Ξ΅ S β) β»
ii = scott-continuous-join-eq G H g ΞΆg β
f s β£ s Ξ΅ S β β
iii = β[ H ]-least β
g (f s) β£ s Ξ΅ S β (u , p)
\end{code}
\begin{code}
β§[_]-is-commutative : (F : Frame π€ π₯ π¦) (x y : β¨ F β©)
β x β§[ F ] y οΌ y β§[ F ] x
β§[ F ]-is-commutative x y = β§[ F ]-unique (Ξ² , Ξ³)
where
open Meets (Ξ» x y β x β€[ poset-of F ] y)
open PosetNotation (poset-of F) using (_β€_)
Ξ² : ((x β§[ F ] y) is-a-lower-bound-of (y , x)) holds
Ξ² = (β§[ F ]-lowerβ x y) , (β§[ F ]-lowerβ x y)
Ξ³ : (β±― (l , _) κ lower-bound (y , x) , l β€ (x β§[ F ] y)) holds
Ξ³ (l , p , q) = β§[ F ]-greatest x y l q p
β§[_]-is-associative : (F : Frame π€ π₯ π¦) (x y z : β¨ F β©)
β x β§[ F ] (y β§[ F ] z) οΌ (x β§[ F ] y) β§[ F ] z
β§[ F ]-is-associative x y z = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
open PosetReasoning (poset-of F)
abstract
Ξ² : ((x β§[ F ] (y β§[ F ] z)) β€[ poset-of F ] ((x β§[ F ] y) β§[ F ] z)) holds
Ξ² = β§[ F ]-greatest (x β§[ F ] y) z (x β§[ F ] (y β§[ F ] z)) Ξ΄ Ξ΅
where
Ξ΄ : ((x β§[ F ] (y β§[ F ] z)) β€[ poset-of F ] (x β§[ F ] y)) holds
Ξ΄ = β§[ F ]-greatest x y (x β§[ F ] (y β§[ F ] z)) Ξ΄β Ξ΄β
where
Ξ΄β : ((x β§[ F ] (y β§[ F ] z)) β€[ poset-of F ] x) holds
Ξ΄β = β§[ F ]-lowerβ x (y β§[ F ] z)
Ξ΄β : ((x β§[ F ] (y β§[ F ] z)) β€[ poset-of F ] y) holds
Ξ΄β = x β§[ F ] (y β§[ F ] z) β€β¨ β§[ F ]-lowerβ x (y β§[ F ] z) β©
y β§[ F ] z β€β¨ β§[ F ]-lowerβ y z β©
y β
Ξ΅ : ((x β§[ F ] (y β§[ F ] z)) β€[ poset-of F ] z) holds
Ξ΅ = x β§[ F ] (y β§[ F ] z) β€β¨ β§[ F ]-lowerβ x (y β§[ F ] z) β©
y β§[ F ] z β€β¨ β§[ F ]-lowerβ y z β©
z β
Ξ³ : (((x β§[ F ] y) β§[ F ] z) β€[ poset-of F ] (x β§[ F ] (y β§[ F ] z))) holds
Ξ³ = β§[ F ]-greatest x (y β§[ F ] z) ((x β§[ F ] y) β§[ F ] z) ΞΆ Ξ·
where
ΞΆ : (((x β§[ F ] y) β§[ F ] z) β€[ poset-of F ] x) holds
ΞΆ = (x β§[ F ] y) β§[ F ] z β€β¨ β§[ F ]-lowerβ (x β§[ F ] y) z β©
x β§[ F ] y β€β¨ β§[ F ]-lowerβ x y β©
x β
Ξ· : (((x β§[ F ] y) β§[ F ] z) β€[ poset-of F ] (y β§[ F ] z)) holds
Ξ· = β§[ F ]-greatest y z ((x β§[ F ] y) β§[ F ] z) Ξ·β Ξ·β
where
Ξ·β : (((x β§[ F ] y) β§[ F ] z) β€[ poset-of F ] y) holds
Ξ·β = (x β§[ F ] y) β§[ F ] z β€β¨ β§[ F ]-lowerβ (x β§[ F ] y) z β©
x β§[ F ] y β€β¨ β§[ F ]-lowerβ x y β©
y β
Ξ·β : (((x β§[ F ] y) β§[ F ] z) β€[ poset-of F ] z) holds
Ξ·β = β§[ F ]-lowerβ (x β§[ F ] y) z
\end{code}
\begin{code}
β§[_]-left-monotone : (F : Frame π€ π₯ π¦)
β {x y z : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β ((x β§[ F ] z) β€[ poset-of F ] (y β§[ F ] z)) holds
β§[ F ]-left-monotone {x} {y} {z} p = β§[ F ]-greatest y z (x β§[ F ] z) Ξ² Ξ³
where
open PosetReasoning (poset-of F)
Ξ² : ((x β§[ F ] z) β€[ poset-of F ] y) holds
Ξ² = x β§[ F ] z β€β¨ β§[ F ]-lowerβ x z β© x β€β¨ p β© y β
Ξ³ : ((x β§[ F ] z) β€[ poset-of F ] z) holds
Ξ³ = β§[ F ]-lowerβ x z
β§[_]-right-monotone : (F : Frame π€ π₯ π¦)
β {x y z : β¨ F β©}
β (x β€[ poset-of F ] y) holds
β ((z β§[ F ] x) β€[ poset-of F ] (z β§[ F ] y)) holds
β§[ F ]-right-monotone {x} {y} {z} p =
z β§[ F ] x οΌβ¨ β§[ F ]-is-commutative z x β©β
x β§[ F ] z β€β¨ β§[ F ]-left-monotone p β©
y β§[ F ] z οΌβ¨ β§[ F ]-is-commutative y z β©β
z β§[ F ] y β
where
open PosetReasoning (poset-of F)
\end{code}
\begin{code}
π-right-annihilator-for-β§ : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β x β§[ F ] π[ F ] οΌ π[ F ]
π-right-annihilator-for-β§ F x =
only-π-is-below-π F (x β§[ F ] π[ F ]) (β§[ F ]-lowerβ x π[ F ])
π-left-annihilator-for-β§ : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β π[ F ] β§[ F ] x οΌ π[ F ]
π-left-annihilator-for-β§ F x =
π[ F ] β§[ F ] x οΌβ¨ β§[ F ]-is-commutative π[ F ] x β©
x β§[ F ] π[ F ] οΌβ¨ π-right-annihilator-for-β§ F x β©
π[ F ] β
π-right-annihilator-for-β¨ : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β x β¨[ F ] π[ F ] οΌ π[ F ]
π-right-annihilator-for-β¨ F x =
only-π-is-above-π F (x β¨[ F ] π[ F ]) (β¨[ F ]-upperβ x π[ F ])
π-left-annihilator-for-β¨ : (F : Frame π€ π₯ π¦) (x : β¨ F β©)
β π[ F ] β¨[ F ] x οΌ π[ F ]
π-left-annihilator-for-β¨ F x =
π[ F ] β¨[ F ] x οΌβ¨ β¨[ F ]-is-commutative π[ F ] x β©
x β¨[ F ] π[ F ] οΌβ¨ π-right-annihilator-for-β¨ F x β©
π[ F ] β
π-left-unit-of-β§ : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©) β π[ F ] β§[ F ] x οΌ x
π-left-unit-of-β§ F x = π[ F ] β§[ F ] x οΌβ¨ β§[ F ]-is-commutative π[ F ] x β©
x β§[ F ] π[ F ] οΌβ¨ π-right-unit-of-β§ F x β©
x β
\end{code}
\begin{code}
distributivityβ² : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©)
β (S : Fam π¦ β¨ F β©)
β let open JoinNotation (Ξ» - β β[ F ] -) in
x β§[ F ] (ββ¨ i β© (S [ i ]))
οΌ ββ¨ i β© ((S [ i ]) β§[ F ] x)
distributivityβ² F x S =
x β§[ F ] (ββ¨ i β© S [ i ]) οΌβ¨ distributivity F x S β©
ββ¨ i β© (x β§[ F ] (S [ i ])) οΌβ¨ β β©
ββ¨ i β© (S [ i ]) β§[ F ] x β
where
open PosetReasoning (poset-of F)
open JoinNotation (Ξ» - β β[ F ] -)
β‘ = β§[ F ]-is-commutative x β (_[_] S)
β = ap (Ξ» - β join-of F (index S , -)) (dfunext fe β‘)
distributivityβ²-right : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©)
β (S : Fam π¦ β¨ F β©)
β let open JoinNotation (Ξ» - β β[ F ] -) in
(ββ¨ i β© (S [ i ])) β§[ F ] x οΌ ββ¨ i β© ((S [ i ]) β§[ F ] x)
distributivityβ²-right F x S =
(ββ¨ i β© (S [ i ])) β§[ F ] x οΌβ¨ β β©
x β§[ F ] (ββ¨ i β© (S [ i ])) οΌβ¨ distributivityβ² F x S β©
ββ¨ i β© (S [ i ] β§[ F ] x) β
where
open JoinNotation (Ξ» - β β[ F ] -)
β = β§[ F ]-is-commutative (ββ¨ i β© (S [ i ])) x
absorption-right : (F : Frame π€ π₯ π¦) (x y : β¨ F β©)
β x β¨[ F ] (x β§[ F ] y) οΌ x
absorption-right F x y = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : ((x β¨[ F ] (x β§[ F ] y)) β€[ poset-of F ] x) holds
Ξ² = β¨[ F ]-least (β€-is-reflexive (poset-of F) x) (β§[ F ]-lowerβ x y)
Ξ³ : (x β€[ poset-of F ] (x β¨[ F ] (x β§[ F ] y))) holds
Ξ³ = β¨[ F ]-upperβ x (x β§[ F ] y)
absorption-left : (F : Frame π€ π₯ π¦) (x y : β¨ F β©)
β x β¨[ F ] (y β§[ F ] x) οΌ x
absorption-left F x y =
x β¨[ F ] (y β§[ F ] x) οΌβ¨ ap (Ξ» - β x β¨[ F ] -) (β§[ F ]-is-commutative y x) β©
x β¨[ F ] (x β§[ F ] y) οΌβ¨ absorption-right F x y β©
x β
absorptionα΅α΅-right : (F : Frame π€ π₯ π¦) β (x y : β¨ F β©) β x β§[ F ] (x β¨[ F ] y) οΌ x
absorptionα΅α΅-right F x y = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ² : ((x β§[ F ] (x β¨[ F ] y)) β€[ poset-of F ] x) holds
Ξ² = β§[ F ]-lowerβ x (x β¨[ F ] y)
Ξ³ : (x β€[ poset-of F ] (x β§[ F ] (x β¨[ F ] y))) holds
Ξ³ = β§[ F ]-greatest x (x β¨[ F ] y) x
(β€-is-reflexive (poset-of F) x)
(β¨[ F ]-upperβ x y)
absorptionα΅α΅-left : (F : Frame π€ π₯ π¦) (x y : β¨ F β©)
β x β§[ F ] (y β¨[ F ] x) οΌ x
absorptionα΅α΅-left F x y =
x β§[ F ] (y β¨[ F ] x) οΌβ¨ ap (Ξ» - β x β§[ F ] -) (β¨[ F ]-is-commutative y x) β©
x β§[ F ] (x β¨[ F ] y) οΌβ¨ absorptionα΅α΅-right F x y β©
x β
binary-distributivity : (F : Frame π€ π₯ π¦)
β (x y z : β¨ F β©)
β x β§[ F ] (y β¨[ F ] z) οΌ (x β§[ F ] y) β¨[ F ] (x β§[ F ] z)
binary-distributivity {π¦ = π¦} F x y z =
x β§[ F ] (y β¨[ F ] z) οΌβ¨ β β©
β[ F ] β
x β§[ F ] w β£ w Ξ΅ binary-family π¦ y z β οΌβ¨ β‘ β©
(x β§[ F ] y) β¨[ F ] (x β§[ F ] z) β
where
β = distributivity F x (binary-family π¦ y z)
β‘ = ap (Ξ» - β join-of F -) (fmap-binary-family π¦ (Ξ» - β x β§[ F ] -) y z)
binary-distributivity-right : (F : Frame π€ π₯ π¦)
β {x y z : β¨ F β©}
β (x β¨[ F ] y) β§[ F ] z οΌ (x β§[ F ] z) β¨[ F ] (y β§[ F ] z)
binary-distributivity-right F {x} {y} {z} =
(x β¨[ F ] y) β§[ F ] z οΌβ¨ β
β©
z β§[ F ] (x β¨[ F ] y) οΌβ¨ β
‘ β©
(z β§[ F ] x) β¨[ F ] (z β§[ F ] y) οΌβ¨ β
’ β©
(x β§[ F ] z) β¨[ F ] (z β§[ F ] y) οΌβ¨ β
£ β©
(x β§[ F ] z) β¨[ F ] (y β§[ F ] z) β
where
β
= β§[ F ]-is-commutative (x β¨[ F ] y) z
β
‘ = binary-distributivity F z x y
β
’ = ap (Ξ» - β - β¨[ F ] (z β§[ F ] y)) (β§[ F ]-is-commutative z x)
β
£ = ap (Ξ» - β (x β§[ F ] z) β¨[ F ] -) (β§[ F ]-is-commutative z y)
binary-distributivity-op : (F : Frame π€ π₯ π¦) (x y z : β¨ F β©)
β x β¨[ F ] (y β§[ F ] z) οΌ (x β¨[ F ] y) β§[ F ] (x β¨[ F ] z)
binary-distributivity-op F x y z =
x β¨[ F ] (y β§[ F ] z) οΌβ¨ β β©
x β¨[ F ] ((z β§[ F ] x) β¨[ F ] (z β§[ F ] y)) οΌβ¨ I β©
x β¨[ F ] (z β§[ F ] (x β¨[ F ] y)) οΌβ¨ II β©
x β¨[ F ] ((x β¨[ F ] y) β§[ F ] z) οΌβ¨ III β©
(x β§[ F ] (x β¨[ F ] y)) β¨[ F ] ((x β¨[ F ] y) β§[ F ] z) οΌβ¨ IV β©
((x β¨[ F ] y) β§[ F ] x) β¨[ F ] ((x β¨[ F ] y) β§[ F ] z) οΌβ¨ V β©
(x β¨[ F ] y) β§[ F ] (x β¨[ F ] z) β
where
w = (x β¨[ F ] y) β§[ F ] z
I = ap (Ξ» - β x β¨[ F ] -) ((binary-distributivity F z x y) β»ΒΉ)
II = ap (Ξ» - β x β¨[ F ] -) (β§[ F ]-is-commutative z (x β¨[ F ] y))
III = ap (Ξ» - β - β¨[ F ] w) (absorptionα΅α΅-right F x y) β»ΒΉ
IV = ap (Ξ» - β - β¨[ F ] w) (β§[ F ]-is-commutative x (x β¨[ F ] y))
V = (binary-distributivity F (x β¨[ F ] y) x z) β»ΒΉ
β : x β¨[ F ] (y β§[ F ] z) οΌ x β¨[ F ] ((z β§[ F ] x) β¨[ F ] (z β§[ F ] y))
β = x β¨[ F ] (y β§[ F ] z) οΌβ¨ i β©
(x β¨[ F ] (z β§[ F ] x)) β¨[ F ] (y β§[ F ] z) οΌβ¨ ii β©
(x β¨[ F ] (z β§[ F ] x)) β¨[ F ] (z β§[ F ] y) οΌβ¨ iii β©
x β¨[ F ] ((z β§[ F ] x) β¨[ F ] (z β§[ F ] y)) β
where
i = ap (Ξ» - β - β¨[ F ] (y β§[ F ] z)) (absorption-left F x z) β»ΒΉ
ii = ap (Ξ» - β (x β¨[ F ] (z β§[ F ] x)) β¨[ F ] -) (β§[ F ]-is-commutative y z)
iii = β¨[ F ]-assoc x (z β§[ F ] x) (z β§[ F ] y)
\end{code}
\begin{code}
β[_]-iterated-join : (F : Frame π€ π₯ π¦) (I : π¦ Μ )(J : I β π¦ Μ)
β (f : (i : I) β J i β β¨ F β©)
β β[ F ] ((Ξ£ i κ I , J i) , uncurry f)
οΌ β[ F ] β
β[ F ] β
f i j β£ j βΆ J i β β£ i βΆ I β
β[ F ]-iterated-join I J f = β[ F ]-unique _ _ (Ξ² , Ξ³)
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
open PosetReasoning (poset-of F) renaming (_β to _QED)
Ξ² : ((β[ F ] (Ξ£ J , uncurry f))
is-an-upper-bound-of
β
β[ F ] β
f i j β£ j βΆ J i β β£ i βΆ I β) holds
Ξ² i = β[ F ]-least _ (_ , Ξ» jα΅’ β β[ F ]-upper _ (i , jα΅’))
Ξ³ : (β±― (u , _) κ upper-bound β
β[ F ] β
f i j β£ j βΆ J i β β£ i βΆ I β ,
(β[ F ] (Ξ£ J , uncurry f)) β€[ poset-of F ] _ ) holds
Ξ³ (u , p) = β[ F ]-least (Ξ£ J , uncurry f) (_ , Ξ΄)
where
Ξ΄ : (u is-an-upper-bound-of (Ξ£ J , uncurry f)) holds
Ξ΄ (i , j) = f i j β€β¨ β[ F ]-upper _ j β©
β[ F ] β
f i j β£ j βΆ J i β β€β¨ p i β©
u QED
\end{code}
\begin{code}
β§[_]-is-idempotent : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©) β x οΌ x β§[ F ] x
β§[ F ]-is-idempotent x = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
Ξ± : (x β€[ poset-of F ] x) holds
Ξ± = β€-is-reflexive (poset-of F) x
Ξ² : (x β€[ poset-of F ] (x β§[ F ] x)) holds
Ξ² = β§[ F ]-greatest x x x Ξ± Ξ±
Ξ³ : ((x β§[ F ] x) β€[ poset-of F ] x) holds
Ξ³ = β§[ F ]-lowerβ x x
β¨[_]-is-idempotent : (F : Frame π€ π₯ π¦)
β (x : β¨ F β©) β x οΌ x β¨[ F ] x
β¨[ F ]-is-idempotent x = β€-is-antisymmetric (poset-of F) β β‘
where
β : (x β€[ poset-of F ] (x β¨[ F ] x)) holds
β = β¨[ F ]-upperβ x x
β‘ : ((x β¨[ F ] x) β€[ poset-of F ] x) holds
β‘ = β¨[ F ]-least (β€-is-reflexive (poset-of F) x) (β€-is-reflexive (poset-of F) x)
\end{code}
\begin{code}
distributivity+ : (F : Frame π€ π₯ π¦)
β let open JoinNotation (Ξ» - β β[ F ] -) in
(U@(I , _) V@(J , _) : Fam π¦ β¨ F β©)
β (ββ¨ i β© (U [ i ])) β§[ F ] (ββ¨ j β© (V [ j ]))
οΌ (ββ¨ (i , j) βΆ (I Γ J) β© ((U [ i ]) β§[ F ] (V [ j ])))
distributivity+ F U@(I , _) V@(J , _) =
(ββ¨ i β© (U [ i ])) β§[ F ] (ββ¨ j β© (V [ j ])) οΌβ¨ i β©
(ββ¨ j β© (V [ j ])) β§[ F ] (ββ¨ i β© (U [ i ])) οΌβ¨ ii β©
(ββ¨ i β© (ββ¨ j β© (V [ j ])) β§[ F ] (U [ i ])) οΌβ¨ iii β©
(ββ¨ i β© (U [ i ] β§[ F ] (ββ¨ j β© (V [ j ])))) οΌβ¨ iv β©
(ββ¨ i β© (ββ¨ j β© (U [ i ] β§[ F ] V [ j ]))) οΌβ¨ v β©
(ββ¨ (i , j) βΆ I Γ J β© (U [ i ] β§[ F ] V [ j ])) β
where
open JoinNotation (Ξ» - β β[ F ] -)
i = β§[ F ]-is-commutative (ββ¨ i β© (U [ i ])) (ββ¨ j β© (V [ j ]))
ii = distributivity F (ββ¨ j β© (V [ j ])) U
iii = ap
(Ξ» - β β[ F ] (I , -))
(dfunext fe Ξ» i β β§[ F ]-is-commutative (ββ¨ j β© V [ j ]) (U [ i ]))
iv = ap
(Ξ» - β join-of F (I , -))
(dfunext fe Ξ» i β distributivity F (U [ i ]) V)
v = β[ F ]-iterated-join I (Ξ» _ β J) (Ξ» i j β U [ i ] β§[ F ] V [ j ]) β»ΒΉ
\end{code}
\section{Bases of frames}
We first define the notion of a βsmallβ basis for a frame. Given a
(π€, π₯, π¦)-frame, a small basis for it is a π¦-family, which has a
further subfamily covering any given element of the frame.
\begin{code}
is-basis-for : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β (π€ β π₯ β π¦ βΊ) Μ
is-basis-for {π¦ = π¦} F (I , Ξ²) =
(x : β¨ F β©) β Ξ£ J κ Fam π¦ I , (x is-lub-of β
Ξ² j β£ j Ξ΅ J β) holds
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
\end{code}
A π¦-frame has a (small) basis iff there exists a π¦-family
that forms a basis for it. Having a basis should be a property and
not a structure so this is important.
\begin{code}
has-basis : (F : Frame π€ π₯ π¦) β Ξ© (π€ β π₯ β π¦ βΊ)
has-basis {π¦ = π¦} F = β₯ Ξ£ β¬ κ Fam π¦ β¨ F β© , is-basis-for F β¬ β₯Ξ©
covering-index-family : (F : Frame π€ π₯ π¦) (β¬ : Fam π¦ β¨ F β©) (b : is-basis-for F β¬)
β β¨ F β© β Fam π¦ (index β¬)
covering-index-family F β¬ p x = prβ (p x)
covers : (F : Frame π€ π₯ π¦) (β¬ : Fam π¦ β¨ F β©) (b : is-basis-for F β¬)
β (x : β¨ F β©) β let
β = covering-index-family F β¬ b x
in
x οΌ β[ F ] β
β¬ [ i ] β£ i Ξ΅ β β
covers F β¬ b x = β[ F ]-unique β
β¬ [ i ] β£ i Ξ΅ β β x (prβ (b x))
where
β = covering-index-family F β¬ b x
\end{code}
We also have the notion of a directed basis, in which every covering
family is directed.
\begin{code}
is-directed-basis : (F : Frame π€ π₯ π¦) (β¬ : Fam π¦ β¨ F β©)
β π€ β π₯ β π¦ βΊ Μ
is-directed-basis {π¦ = π¦} F β¬ =
Ξ£ b κ is-basis-for F β¬ ,
Ξ x κ β¨ F β© , let
π₯ = covering-index-family F β¬ b x
in
is-directed F β
β¬ [ j ] β£ j Ξ΅ π₯ β holds
has-directed-basisβ : (F : Frame π€ π₯ π¦) β (π€ β π₯ β π¦ βΊ) Μ
has-directed-basisβ {π¦ = π¦} F =
Ξ£ β¬ κ Fam π¦ β¨ F β© , is-directed-basis F β¬
has-directed-basis : (F : Frame π€ π₯ π¦) β Ξ© (π€ β π₯ β π¦ βΊ)
has-directed-basis {π¦ = π¦} F = β₯ has-directed-basisβ F β₯Ξ©
directed-cover : (F : Frame π€ π₯ π¦) β has-directed-basisβ F β β¨ F β© β Fam π¦ β¨ F β©
directed-cover F (β¬ , Ξ²) U = β
β¬ [ i ] β£ i Ξ΅ prβ (prβ Ξ² U) β
covers-are-directed : (F : Frame π€ π₯ π¦)
β (b : has-directed-basisβ F)
β (U : β¨ F β©)
β is-directed F (directed-cover F b U) holds
covers-are-directed F (β¬ , Ξ²) U = prβ Ξ² U
\end{code}
The main development in this section is that every small basis can be
extended to a directed one whilst keeping it small.
\begin{code}
join-in-frame : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©) β List (index S) β β¨ F β©
join-in-frame F S = foldr (Ξ» i - β (S [ i ]) β¨[ F ] -) π[ F ]
directify : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Fam π¦ β¨ F β©
directify F (I , Ξ±) = List I , (foldr (Ξ» i - β Ξ± i β¨[ F ] -) π[ F ])
where open PosetNotation (poset-of F)
\end{code}
We could have defined `directify` in an alternative way, using the auxiliary
`join-list` function:
\begin{code}
join-list : (F : Frame π€ π₯ π¦) β List β¨ F β© β β¨ F β©
join-list F = foldr (binary-join F) π[ F ]
infix 3 join-list
syntax join-list F xs = ββ[ F ] xs
join-in-frameβ² : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©) β List (index S) β β¨ F β©
join-in-frameβ² F (I , Ξ±) = join-list F β map Ξ±
directifyβ² : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Fam π¦ β¨ F β©
directifyβ² F (I , Ξ±) = List I , join-in-frameβ² F (I , Ξ±)
\end{code}
However, the direct definition given in `directify` turns out to be more
convenient for some purposes, so we avoid using `directifyβ²` as the default
definition. It is a trivial fact that `directify` is the same as `directifyβ²`.
\begin{code}
join-in-frame-equality : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β join-in-frame F S βΌ join-in-frameβ² F S
join-in-frame-equality F S [] = refl
join-in-frame-equality F S (i β· is) =
join-in-frame F S (i β· is) οΌβ¨ refl β©
(S [ i ]) β¨[ F ] join-in-frame F S is οΌβ¨ β β©
(S [ i ]) β¨[ F ] join-in-frameβ² F S is οΌβ¨ refl β©
join-in-frameβ² F S (i β· is) β
where
β = ap (Ξ» - β (S [ i ]) β¨[ F ] -) (join-in-frame-equality F S is)
\end{code}
Note that `directify` is a monoid homomorphism from the free monoid on I
to (_β¨_, π).
\begin{code}
directify-functorial : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β (is js : List (index S))
β directify F S [ is ++ js ]
οΌ directify F S [ is ] β¨[ F ] directify F S [ js ]
directify-functorial F S@(I , Ξ±) = Ξ³
where
Ξ³ : (is js : List I)
β directify F S [ is ++ js ]
οΌ directify F S [ is ] β¨[ F ] directify F S [ js ]
Ξ³ [] js = directify F S [ [] ++ js ] οΌβ¨ refl β©
directify F S [ js ] οΌβ¨ β β©
π[ F ] β¨[ F ] directify F S [ js ] β
where
β = π-right-unit-of-β¨ F (directify F S [ js ]) β»ΒΉ
Ξ³ (i β· is) js =
directify F S [ (i β· is) ++ js ] οΌβ¨ refl β©
Ξ± i β¨[ F ] directify F S [ is ++ js ] οΌβ¨ β β©
Ξ± i β¨[ F ] (directify F S [ is ] β¨[ F ] directify F S [ js ]) οΌβ¨ β‘ β©
(Ξ± i β¨[ F ] directify F S [ is ]) β¨[ F ] directify F S [ js ] οΌβ¨ refl β©
directify F S [ i β· is ] β¨[ F ] directify F S [ js ] β
where
β = ap (Ξ» - β binary-join F (Ξ± i) -) (Ξ³ is js)
β‘ = β¨[ F ]-assoc (Ξ± i) (directify F S [ is ]) (directify F S [ js ]) β»ΒΉ
\end{code}
`directify` does what it is supposed to do: the family it gives is a
directed one.
\begin{code}
directify-is-directed : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β is-directed F (directify F S) holds
directify-is-directed F S@(I , Ξ±) = β£ [] β£ , Ο
where
open PropositionalTruncation pt
open PosetNotation (poset-of F)
Ο
: (β±― is κ List I
, β±― js κ List I
, (Ζ ks κ List I
, (((directify F S [ is ] β€ directify F S [ ks ])
β§ (directify F S [ js ] β€ directify F S [ ks ])) holds))) holds
Ο
is js = β£ (is ++ js) , Ξ² , Ξ³ β£
where
open PosetReasoning (poset-of F)
β‘ = directify-functorial F S is js β»ΒΉ
Ξ² : (directify F S [ is ] β€ directify F S [ is ++ js ]) holds
Ξ² = directify F S [ is ] β€β¨ β β©
directify F S [ is ] β¨[ F ] directify F S [ js ] οΌβ¨ β‘ β©β
directify F S [ is ++ js ] β
where
β = β¨[ F ]-upperβ (directify F S [ is ]) (directify F S [ js ])
Ξ³ : (directify F S [ js ] β€ directify F S [ is ++ js ]) holds
Ξ³ = directify F S [ js ] β€β¨ β β©
directify F S [ is ] β¨[ F ] directify F S [ js ] οΌβ¨ β‘ β©β
directify F S [ is ++ js ] β
where
β = β¨[ F ]-upperβ (directify F S [ is ]) (directify F S [ js ])
closed-under-binary-joins : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Ξ© (π€ β π₯ β π¦)
closed-under-binary-joins {π¦ = π¦} F S =
β±― i κ index S , β±― j κ index S ,
Ζ k κ index S , ((S [ k ]) is-lub-of (binary-family π¦ (S [ i ]) (S [ j ]))) holds
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
contains-bottom : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ FΒ β© β Ξ© (π€ β π₯ β π¦)
contains-bottom F U = Ζ i κ index U , is-bottom F (U [ i ]) holds
closed-under-finite-joins : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Ξ© (π€ β π₯ β π¦)
closed-under-finite-joins F S =
contains-bottom F S β§ closed-under-binary-joins F S
closed-under-fin-joins-implies-directed : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β (closed-under-finite-joins F S
β is-directed F S) holds
closed-under-fin-joins-implies-directed F S (iβ , Γ°) =
β₯β₯-rec (holds-is-prop (is-directed F S)) Ξ³ iβ
where
open PropositionalTruncation pt
open PosetNotation (poset-of F)
open Joins (Ξ» x y β x β€[ poset-of F ] y)
Ξ³ : (Ξ£ i κ index S , is-bottom F (S [ i ]) holds)
β is-directed F S holds
Ξ³ (i , _) = β£ i β£ , Ξ΄
where
Ξ΄ : (m n : index S)
β (Ζ o κ index S , ((S [ m ] β€ S [ o ]) β§ (S [ n ] β€ S [ o ])) holds) holds
Ξ΄ m n = β₯β₯-rec β-is-prop Ο΅ (Γ° m n)
where
Ο΅ : Ξ£ o κ index S , ((S [ o ]) is-lub-of (binary-family π¦ (S [ m ]) (S [ n ]))) holds
β (Ζ o κ index S , ((S [ m ] β€ S [ o ]) β§ (S [ n ] β€ S [ o ])) holds) holds
Ο΅ (o , Ο , _) = β£ o , Ο (inl β) , Ο (inr β) β£
directify-is-closed-under-fin-joins : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β closed-under-finite-joins F (directify F S) holds
directify-is-closed-under-fin-joins F S = β , β‘
where
open PropositionalTruncation pt
β : contains-bottom F (directify F S) holds
β = β£ [] , π-is-bottom F β£
β‘ : closed-under-binary-joins F (directify F S) holds
β‘ is js = β£ (is ++ js) , β , β£ β£
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
open PosetReasoning (poset-of F)
Ν° = directify-functorial F S is js β»ΒΉ
β : ((directify F S [ is ++ js ])
is-an-upper-bound-of
β
directify F S [ is ] , directify F S [ js ] β) holds
β (inl p) = directify F S [ is ] β€β¨ β
β©
directify F S [ is ] β¨[ F ] directify F S [ js ] οΌβ¨ Ν° β©β
directify F S [ is ++ js ] β
where
β
= β¨[ F ]-upperβ (directify F S [ is ]) (directify F S [ js ])
β (inr p) = directify F S [ js ] β€β¨ β
β©
directify F S [ is ] β¨[ F ] directify F S [ js ] οΌβ¨ Ν° β©β
directify F S [ is ++ js ] β
where
β
= β¨[ F ]-upperβ (directify F S [ is ]) (directify F S [ js ])
β£ : ((u , _) : upper-bound β
directify F S [ is ] , directify F S [ js ] β)
β ((directify F S [ is ++ js ]) β€[ poset-of F ] u) holds
β£ (u , ΞΆ) =
directify F S [ is ++ js ] οΌβ¨ Ν° β»ΒΉ β©β
directify F S [ is ] β¨[ F ] directify F S [ js ] β€β¨ β» β©
u β
where
β» = β¨[ F ]-least (ΞΆ (inl β) ) (ΞΆ (inr β))
\end{code}
`directify` also preserves the join while doing what it is supposed to
do.
\begin{code}
directify-preserves-joins : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β β[ F ] S οΌ β[ F ] directify F S
directify-preserves-joins F S = β€-is-antisymmetric (poset-of F) Ξ² Ξ³
where
open PosetNotation (poset-of F)
open PosetReasoning (poset-of F)
Ξ² : ((β[ F ] S) β€ (β[ F ] directify F S)) holds
Ξ² = β[ F ]-least S ((β[ F ] (directify F S)) , Ξ½)
where
Ξ½ : (i : index S) β (S [ i ] β€ (β[ F ] directify F S)) holds
Ξ½ i =
S [ i ] οΌβ¨ π-right-unit-of-β¨ F (S [ i ]) β»ΒΉ β©β
π[ F ] β¨[ F ] S [ i ] οΌβ¨ β¨[ F ]-is-commutative π[ F ] (S [ i ]) β©β
S [ i ] β¨[ F ] π[ F ] οΌβ¨ refl β©β
directify F S [ i β· [] ] β€β¨ β[ F ]-upper (directify F S) (i β· []) β©
β[ F ] directify F S β
Ξ³ : ((β[ F ] directify F S) β€[ poset-of F ] (β[ F ] S)) holds
Ξ³ = β[ F ]-least (directify F S) ((β[ F ] S) , ΞΊ)
where
ΞΊ : (is : List (index S)) β ((directify F S [ is ]) β€ (β[ F ] S)) holds
ΞΊ [] = π-is-bottom F (β[ F ] S)
ΞΊ (i β· is) = S [ i ] β¨[ F ] directify F S [ is ] β€β¨ β β©
β[ F ] S β
where
β = β¨[ F ]-least (β[ F ]-upper S i) (ΞΊ is)
directify-preserves-joinsβ : (F : Frame π€ π₯ π¦) (S : Fam π¦ β¨ F β©)
β let open Joins (Ξ» x y β x β€[ poset-of F ] y) in
(x : β¨ F β©)
β (x is-lub-of S β x is-lub-of directify F S) holds
directify-preserves-joinsβ F S x p =
transport (Ξ» - β (- is-lub-of directify F S) holds) (q β»ΒΉ)
(β[ F ]-upper (directify F S) , β[ F ]-least (directify F S))
where
open Joins (Ξ» x y β x β€[ poset-of F ] y)
abstract
q : x οΌ β[ F ] directify F S
q = x οΌβ¨ β[ F ]-unique S x p β©
β[ F ] S οΌβ¨ directify-preserves-joins F S β©
β[ F ] directify F S β
\end{code}
\begin{code}
directified-basis-is-basis : (F : Frame π€ π₯ π¦)
β (β¬ : Fam π¦ β¨ F β©)
β is-basis-for F β¬
β is-basis-for F (directify F β¬)
directified-basis-is-basis {π¦ = π¦} F β¬ Ξ² = Ξ²β
where
open PosetNotation (poset-of F)
open Joins (Ξ» x y β x β€ y)
β¬β = directify F β¬
π₯ : β¨ F β© β Fam π¦ (index β¬)
π₯ x = prβ (Ξ² x)
π¦ : β¨ F β© β Fam π¦ (List (index β¬))
π¦ x = List (index (π₯ x)) , (Ξ» - β π₯ x [ - ]) <$>_
abstract
Ο : (x : β¨ F β©)
β (is : List (index (π₯ x)))
β directify F β¬ [ (Ξ» - β π₯ x [ - ]) <$> is ]
οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ x β [ is ]
Ο x [] = refl
Ο x (i β· is) = ap (Ξ» - β (_ β¨[ F ] -)) (Ο x is)
Ο : (x : β¨ F β©)
β β
directify F β¬ [ is ] β£ is Ξ΅ π¦ x β οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ x β
Ο x = to-Ξ£-οΌ (refl , dfunext fe (Ο x))
Ξ²β : (x : β¨ F β©)
β Ξ£ J κ Fam π¦ (index β¬β) , (x is-lub-of β
β¬β [ j ] β£ j Ξ΅ J β) holds
Ξ²β x = π¦ x , transport (Ξ» - β (x is-lub-of -) holds) (Ο x β»ΒΉ) Ξ΄
where
p : (x is-lub-of β
β¬ [ j ] β£ j Ξ΅ π₯ x β) holds
p = prβ (Ξ² x)
Ξ΄ : (x is-lub-of directify F β
β¬ [ j ] β£ j Ξ΅ π₯ x β) holds
Ξ΄ = directify-preserves-joinsβ F β
β¬ [ j ] β£ j Ξ΅ π₯ x β x p
Ξ΄ : (x : β¨ F β©)
β is-directed F β
directify F β¬ [ is ] β£ is Ξ΅ π¦ x β holds
Ξ΄ x = transport (Ξ» - β is-directed F - holds) (Ο x β»ΒΉ) Ξ΅
where
Ξ΅ = directify-is-directed F β
β¬ [ j ] β£ j Ξ΅ π₯ x β
covers-of-directified-basis-are-directed : (F : Frame π€ π₯ π¦)
β (β¬ : Fam π¦ β¨ F β©)
β (Ξ² : is-basis-for F β¬)
β (x : β¨ F β©)
β let
β¬β = directify F β¬
Ξ²β = directified-basis-is-basis F β¬ Ξ²
π₯β = prβ (Ξ²β x)
in
is-directed F β
β¬β [ i ] β£ i Ξ΅ π₯β β holds
covers-of-directified-basis-are-directed {π¦ = π¦} F β¬ Ξ² x =
transport (Ξ» - β is-directed F - holds) (Ο β»ΒΉ) Ξ΅
where
π₯ = prβ (Ξ² x)
π¦ : Fam π¦ (List (index β¬))
π¦ = β
(Ξ» - β π₯ [ - ]) <$> is β£ is βΆ List (index π₯) β
abstract
Ο : (is : List (index π₯))
β directify F β¬ [ (Ξ» - β π₯ [ - ]) <$> is ]
οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ β [ is ]
Ο [] = refl
Ο (i β· is) = ap (Ξ» - β (_ β¨[ F ] -)) (Ο is)
Ο : β
directify F β¬ [ is ] β£ is Ξ΅ π¦ β οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ β
Ο = to-Ξ£-οΌ (refl , dfunext fe Ο)
Ξ΅ : is-directed F (directify F β
β¬ [ j ] β£ j Ξ΅ π₯ β) holds
Ξ΅ = directify-is-directed F β
β¬ [ j ] β£ j Ξ΅ π₯ β
directify-basis : (F : Frame π€ π₯ π¦)
β (has-basis F β has-directed-basis F) holds
directify-basis {π¦ = π¦} F = β₯β₯-rec (holds-is-prop (has-directed-basis F)) Ξ³
where
open PropositionalTruncation pt
open PosetNotation (poset-of F)
open Joins (Ξ» x y β x β€ y)
Ξ³ : Ξ£ β¬ κ Fam π¦ β¨ F β© , is-basis-for F β¬ β has-directed-basis F holds
Ξ³ (β¬ , Ξ²) = β£ directify F β¬ , (directified-basis-is-basis F β¬ Ξ²) , Ξ΄ β£
where
π₯ : β¨ F β© β Fam π¦ (index β¬)
π₯ x = prβ (Ξ² x)
π¦ : β¨ F β© β Fam π¦ (List (index β¬))
π¦ x = List (index (π₯ x)) , (Ξ» - β π₯ x [ - ]) <$>_
Ο : (x : β¨ F β©)
β (is : List (index (π₯ x)))
β directify F β¬ [ (Ξ» - β π₯ x [ - ]) <$> is ]
οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ x β [ is ]
Ο x [] = refl
Ο x (i β· is) = ap (Ξ» - β (_ β¨[ F ] -)) (Ο x is)
Ο : (x : β¨ F β©)
β β
directify F β¬ [ is ] β£ is Ξ΅ π¦ x β οΌ directify F β
β¬ [ j ] β£ j Ξ΅ π₯ x β
Ο x = to-Ξ£-οΌ (refl , dfunext fe (Ο x))
Ξ΄ : (x : β¨ F β©)
β is-directed F β
directify F β¬ [ is ] β£ is Ξ΅ π¦ x β holds
Ξ΄ x = transport (Ξ» - β is-directed F - holds) (Ο x β»ΒΉ) Ξ΅
where
Ξ΅ = directify-is-directed F β
β¬ [ j ] β£ j Ξ΅ π₯ x β
\end{code}
\section{Locale notation}
A _locale_ is a type that has a frame of opens.
\begin{code}
record Locale (π€ π₯ π¦ : Universe) : π€ βΊ β π₯ βΊ β π¦ βΊ Μ where
field
β¨_β©β : π€ Μ
frame-str-of : frame-structure π₯ π¦ β¨_β©β
πͺ : Frame π€ π₯ π¦
πͺ = β¨_β©β , frame-str-of
to-locale-οΌ : (X Y : Locale π€ π₯ π¦) β Locale.πͺ X οΌ Locale.πͺ Y β X οΌ Y
to-locale-οΌ X Y refl = refl
\end{code}
\section{Cofinality}
\begin{code}
cofinal-in : (F : Frame π€ π₯ π¦) β Fam π¦ β¨ F β© β Fam π¦ β¨ F β© β Ξ© (π₯ β π¦)
cofinal-in F R S =
β±― i κ index R , Ζ j κ index S , ((R [ i ]) β€[ poset-of F ] (S [ j ])) holds
cofinal-implies-join-covered : (F : Frame π€ π₯ π¦) (R S : Fam π¦ β¨ F β©)
β cofinal-in F R S holds
β ((β[ F ] R) β€[ poset-of F ] (β[ F ] S)) holds
cofinal-implies-join-covered F R S Ο = β[ F ]-least R ((β[ F ] S) , Ξ²)
where
open PosetReasoning (poset-of F)
open PropositionalTruncation pt
Ξ² : (i : index R) β ((R [ i ]) β€[ poset-of F ] (β[ F ] S)) holds
Ξ² i = β₯β₯-rec (holds-is-prop ((R [ i ]) β€[ poset-of F ] (β[ F ] S))) Ξ³ (Ο i)
where
Ξ³ : Ξ£ j κ index S , (R [ i ] β€[ poset-of F ] (S [ j ])) holds
β (R [ i ] β€[ poset-of F ] (β[ F ] S)) holds
Ξ³ (j , p) = R [ i ] β€β¨ p β© S [ j ] β€β¨ β[ F ]-upper S j β© β[ F ] S β
bicofinal-implies-same-join : (F : Frame π€ π₯ π¦) (R S : Fam π¦ β¨ F β©)
β cofinal-in F R S holds
β cofinal-in F S R holds
β β[ F ] R οΌ β[ F ] S
bicofinal-implies-same-join F R S Ο Ο =
β€-is-antisymmetric
(poset-of F)
(cofinal-implies-join-covered F R S Ο)
(cofinal-implies-join-covered F S R Ο)
bicofinal-with-directed-family-implies-directed : (F : Frame π€ π₯ π¦)
(R S : Fam π¦ β¨ F β©)
β cofinal-in F R S holds
β cofinal-in F S R holds
β is-directed F R holds
β is-directed F S holds
bicofinal-with-directed-family-implies-directed F R S Ο Ο (Ξ΄β , Ξ΄β) = β , β‘
where
open PropositionalTruncation pt
open PosetNotation (poset-of F)
β : β₯ index S β₯Ξ© holds
β = β₯β₯-rec (holds-is-prop β₯ index S β₯Ξ©) β β Ξ΄β
where
β β : index R β β₯ index S β₯Ξ© holds
β β i = β₯β₯-rec (holds-is-prop β₯ index S β₯Ξ©) β β (Ο i)
where
β β : Ξ£ j κ index S , (R [ i ] β€ S [ j ]) holds
β β₯ index S β₯Ξ© holds
β β = β£_β£ β prβ
β‘ : (jβ jβ : index S)
β (Ζ j κ index S , (S [ jβ ] β€ S [ j ]) holds
Γ (S [ jβ ] β€ S [ j ]) holds) holds
β‘ jβ jβ = β₯β₯-recβ β-is-prop β‘β (Ο jβ) (Ο jβ)
where
β‘β : Ξ£ iβ κ index R , (S [ jβ ] β€ R [ iβ ]) holds
β Ξ£ iβ κ index R , (S [ jβ ] β€ R [ iβ ]) holds
β (Ζ j κ index S , (S [ jβ ] β€ S [ j ]) holds
Γ (S [ jβ ] β€ S [ j ]) holds) holds
β‘β (iβ , pβ) (iβ , pβ) = β₯β₯-rec β-is-prop β‘β (Ξ΄β iβ iβ)
where
β‘β : Ξ£ i κ index R , (R [ iβ ] β€ R [ i ]) holds
Γ (R [ iβ ] β€ R [ i ]) holds
β (Ζ j κ index S , (S [ jβ ] β€ S [ j ]) holds
Γ (S [ jβ ] β€ S [ j ]) holds) holds
β‘β (i , qβ , qβ) = β₯β₯-rec β-is-prop β‘β (Ο i)
where
β‘β : Ξ£ j κ (index S) , (R [ i ] β€ S [ j ]) holds
β (Ζ j κ index S , (S [ jβ ] β€ S [ j ]) holds
Γ (S [ jβ ] β€ S [ j ]) holds) holds
β‘β (j , p) = β£ j , rβ , rβ β£
where
open PosetReasoning (poset-of F)
rβ : (S [ jβ ] β€ S [ j ]) holds
rβ = S [ jβ ] β€β¨ pβ β© R [ iβ ] β€β¨ qβ β© R [ i ] β€β¨ p β© S [ j ] β
rβ : (S [ jβ ] β€ S [ j ]) holds
rβ = S [ jβ ] β€β¨ pβ β© R [ iβ ] β€β¨ qβ β© R [ i ] β€β¨ p β© S [ j ] β
open PropositionalTruncation pt
β¨[_]-iterated-join : (F : Frame π€ π₯ π¦) (Sβ Sβ : Fam π¦ β¨ F β©)
β β₯ index Sβ β₯
β β₯ index Sβ β₯
β (β[ F ] Sβ) β¨[ F ] (β[ F ] Sβ)
οΌ β[ F ] β
(Sβ [ i ]) β¨[ F ] (Sβ [ j ]) β£ (i , j) βΆ (index Sβ Γ index Sβ) β
β¨[_]-iterated-join {π¦ = π¦} F Sβ Sβ iβ iβ =
β€-is-antisymmetric (poset-of F) β β‘
where
open PosetReasoning (poset-of F)
open Joins (Ξ» x y β x β€[ poset-of F ] y)
fam-lhs : Fam π¦ β¨ F β©
fam-lhs = binary-family π¦ (β[ F ] Sβ) (β[ F ] Sβ)
fam-rhs : Fam π¦ β¨ F β©
fam-rhs = β
(Sβ [ i ]) β¨[ F ] (Sβ [ j ]) β£ (i , j) βΆ (index Sβ Γ index Sβ) β
β : ((β[ F ] fam-lhs) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β = β¨[ F ]-least β β β β
where
β : ((β[ F ] fam-rhs) is-an-upper-bound-of Sβ) holds
β i = β₯β₯-rec (holds-is-prop (_ β€[ poset-of F ] _)) β£ iβ
where
β£ : index Sβ
β ((Sβ [ i ]) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β£ j =
Sβ [ i ] β€β¨ β
β©
(Sβ [ i ]) β¨[ F ] (Sβ [ j ]) β€β¨ β
‘ β©
β[ F ] fam-rhs β
where
β
= β¨[ F ]-upperβ (Sβ [ i ]) (Sβ [ j ])
β
‘ : (((Sβ [ i ]) β¨[ F ] (Sβ [ j ])) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β
‘ = β[ F ]-upper fam-rhs (i , j)
β β : ((β[ F ] Sβ) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β β = β[ F ]-least Sβ ((β[ F ] fam-rhs) , β )
β₯ : ((β[ F ] fam-rhs) is-an-upper-bound-of Sβ) holds
β₯ j = β₯β₯-rec (holds-is-prop (_ β€[ poset-of F ] _)) β’ iβ
where
β’ : index Sβ β ((Sβ [ j ]) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β’ i =
Sβ [ j ] β€β¨ β
β©
(Sβ [ i ]) β¨[ F ] (Sβ [ j ]) β€β¨ β
‘ β©
β[ F ] fam-rhs β
where
β
: ((Sβ [ j ]) β€[ poset-of F ] (Sβ [ i ] β¨[ F ] Sβ [ j ])) holds
β
= β¨[ F ]-upperβ (Sβ [ i ]) (Sβ [ j ])
β
‘ : ((Sβ [ i ] β¨[ F ] Sβ [ j ]) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β
‘ = β[ F ]-upper fam-rhs (i , j)
β β : ((β[ F ] Sβ) β€[ poset-of F ] (β[ F ] fam-rhs)) holds
β β = β[ F ]-least Sβ ((β[ F ] fam-rhs) , β₯)
β‘ : ((β[ F ] fam-rhs) β€[ poset-of F ] (β[ F ] fam-lhs)) holds
β‘ = β[ F ]-least fam-rhs ((β[ F ] fam-lhs) , β‘β)
where
β‘β : ((β[ F ] fam-lhs) is-an-upper-bound-of fam-rhs) holds
β‘β (i , j) =
(Sβ [ i ]) β¨[ F ] (Sβ [ j ]) β€β¨ β
β©
(β[ F ] Sβ) β¨[ F ] (Sβ [ j ]) β€β¨ β
‘ β©
(β[ F ] Sβ) β¨[ F ] (β[ F ] Sβ) οΌβ¨ β
’ β©β
β[ F ] fam-lhs β
where
β
= β¨[ F ]-left-monotone (β[ F ]-upper Sβ i)
β
‘ = β¨[ F ]-right-monotone (β[ F ]-upper Sβ j)
β
’ = refl
\end{code}
If a function preserves (1) binary joins and (2) directed joins then it
preserves arbitrary joins.
\begin{code}
sc-and-β¨-preserving-β-β-preserving : (F : Frame π€ π₯ π¦) (G : Frame π€β² π₯β² π¦)
β (h : β¨ F β© β β¨ G β©)
β is-scott-continuous F G h holds
β (h π[ F ] οΌ π[ G ])
β (((x y : β¨ F β©) β h (x β¨[ F ] y) οΌ h x β¨[ G ] h y))
β is-join-preserving F G h holds
sc-and-β¨-preserving-β-β-preserving F G h ΞΆ Ο Ο S =
h (β[ F ] S) οΌβ¨ ap h p β©
h (β[ F ] Sβ) οΌβ¨ β β©
β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β οΌβ¨ β₯ β©
β[ G ] β
h x β£ x Ξ΅ S β β
where
open PropositionalTruncation pt
open PosetReasoning (poset-of G)
Sβ = directify F S
Ξ΄ : is-directed F Sβ holds
Ξ΄ = directify-is-directed F S
p : β[ F ] S οΌ β[ F ] Sβ
p = directify-preserves-joins F S
β = β[ G ]-unique β
h x β£ x Ξ΅ Sβ β (h (β[ F ] Sβ)) (ΞΆ Sβ Ξ΄)
open Joins (Ξ» x y β x β€[ poset-of G ] y)
lemma : ((β[ G ] β
h x β£ x Ξ΅ S β) is-an-upper-bound-of β
h xβ β£ xβ Ξ΅ Sβ β) holds
lemma [] =
h π[ F ] οΌβ¨ Ο β©β
π[ G ] β€β¨ π-is-bottom G (β[ G ] β
h x β£ x Ξ΅ S β) β©
β[ G ] β
h x β£ x Ξ΅ S β β
lemma (i β· iβ) =
h ((S [ i ]) β¨[ F ] directify F S [ iβ ]) οΌβ¨ Ο _ _ β©β
h (S [ i ]) β¨[ G ] h (directify F S [ iβ ]) β€β¨ β β©
β[ G ] β
h x β£ x Ξ΅ S β β
where
β β : (h (S [ i ]) β€[ poset-of G ] (β[ G ] β
h x β£ x Ξ΅ S β)) holds
β β = β[ G ]-upper β
h x β£ x Ξ΅ S β i
β β : (h (directify F S [ iβ ]) β€[ poset-of G ] (β[ G ] β
h x β£ x Ξ΅ S β)) holds
β β = lemma iβ
β = β¨[ G ]-least β β β β
β₯β : ((β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β) β€[ poset-of G ] (β[ G ] β
h x β£ x Ξ΅ S β)) holds
β₯β = β[ G ]-least β
h xβ β£ xβ Ξ΅ Sβ β ((β[ G ] β
h x β£ x Ξ΅ S β) , lemma)
β₯β : ((β[ G ] β
h x β£ x Ξ΅ S β) β€[ poset-of G ] (β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β)) holds
β₯β = β[ G ]-least β
h x β£ x Ξ΅ S β ((β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β) , β )
where
β : ((β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β) is-an-upper-bound-of β
h x β£ x Ξ΅ S β) holds
β i = h (S [ i ]) οΌβ¨ ap h (π-left-unit-of-β¨ F (S [ i ]) β»ΒΉ) β©β
h (S [ i ] β¨[ F ] π[ F ]) οΌβ¨ refl β©β
h (Sβ [ i β· [] ]) β€β¨ β‘ β©
β[ G ] β
h xβ β£ xβ Ξ΅ Sβ β β
where
β‘ = β[ G ]-upper β
h xβ β£ xβ Ξ΅ Sβ β (i β· [])
β₯ = β€-is-antisymmetric (poset-of G) β₯β β₯β
join-π-lemmaβ : (F : Frame π€ π₯ π¦)
β {x y : β¨ F β©}
β x β¨[ F ] y οΌ π[ F ]
β x οΌ π[ F ]
join-π-lemmaβ F {x} {y} p = only-π-is-below-π F x β
where
open PosetReasoning (poset-of F)
β : (x β€[ poset-of F ] π[ F ]) holds
β = x β€β¨ β¨[ F ]-upperβ x y β© x β¨[ F ] y οΌβ¨ p β©β π[ F ] β
join-π-lemmaβ : (F : Frame π€ π₯ π¦)
β {x y : β¨ F β©}
β x β¨[ F ] y οΌ π[ F ]
β y οΌ π[ F ]
join-π-lemmaβ F {x} {y} p = only-π-is-below-π F y β
where
open PosetReasoning (poset-of F)
β : (y β€[ poset-of F ] π[ F ]) holds
β = y β€β¨ β¨[ F ]-upperβ x y β© x β¨[ F ] y οΌβ¨ p β©β π[ F ] β
\end{code}
The proofs `order-is-set`, `frame-data-is-set`, and `frame-structure-is-set`
below have been been added on 2024-04-17.
\begin{code}
order-is-set : {π₯ : Universe} (pe : propext π₯) (A : π€ Μ) β is-set (A β A β Ξ© π₯)
order-is-set {π₯} pe A {_β€β_} {_β€β_} =
Ξ -is-set fe Ξ» x β Ξ -is-set fe Ξ» y β Ξ©-is-set fe pe
frame-data-is-set : (A : π€ Μ) (Ο : is-set A) (π₯ π¦ : Universe) β propext π₯ β is-set (frame-data π₯ π¦ A)
frame-data-is-set A Ο π₯ π¦ pe =
Ξ£-is-set (order-is-set pe A) Ξ» _β€_ β
Γ-is-set
Ο
(Γ-is-set (Ξ -is-set fe Ξ» _ β Ξ -is-set fe Ξ» _ β Ο) (Ξ -is-set fe Ξ» _ β Ο))
frame-structure-is-set : {π€ : Universe}
β (A : π€ Μ) (π₯ π¦ : Universe)
β propext π₯
β is-set (frame-structure π₯ π¦ A)
frame-structure-is-set A π₯ π¦ pe {(dβ , pβ)} {(dβ , pβ)} =
Ξ£-is-set
(frame-data-is-set A Ο π₯ π¦ pe)
(Ξ» d β props-are-sets (satisfying-frame-laws-is-prop d))
where
Ο : is-set A
Ο = carrier-of-[ poset-of (A , (dβ , pβ)) ]-is-set
\end{code}
Added on 2024-08-18.
\begin{code}
open import UF.Equiv using (_β_; logically-equivalent-props-are-equivalent)
open import UF.Size using (_is_small)
local-smallness-of-frame-gives-local-smallness-of-carrier
: (F : Frame π€ π₯ π¦)
β (x y : β¨ F β©)
β (x οΌ y) is π₯ small
local-smallness-of-frame-gives-local-smallness-of-carrier F x y =
(x β£[ poset-of F ] y) holds , e
where
open PosetNotation (poset-of F) using (_β€_)
s : (x β£[ poset-of F ] y) holds β x οΌ y
s = uncurry (β€-is-antisymmetric (poset-of F))
r : x οΌ y β (x β£[ poset-of F ] y) holds
r p = reflexivity+ (poset-of F) p , reflexivity+ (poset-of F) (p β»ΒΉ)
e : (x β£[ poset-of F ] y) holds β (x οΌ y)
e = logically-equivalent-props-are-equivalent
(holds-is-prop (x β£[ poset-of F ] y))
carrier-of-[ poset-of F ]-is-set
s
r
local-smallness-of-carrier-gives-local-smallness-of-frame
: (F : Frame π€ π₯ π¦)
β (x y : β¨ F β©)
β (x β€[ poset-of F ] y) holds is π€ small
local-smallness-of-carrier-gives-local-smallness-of-frame F x y =
(x β§[ F ] y οΌ x) , e
where
open PosetNotation (poset-of F) using (_β€_)
s : x β§[ F ] y οΌ x β (x β€ y) holds
s p = connecting-lemmaβ F (p β»ΒΉ)
r : (x β€ y) holds β x β§[ F ] y οΌ x
r p = connecting-lemmaβ F p β»ΒΉ
e : (x β§[ F ] y οΌ x) β (x β€ y) holds
e = logically-equivalent-props-are-equivalent
carrier-of-[ poset-of F ]-is-set
(holds-is-prop (x β€ y))
s
r
\end{code}