Ayberk Tosun, completed 30 November 2022.
The main result needed in this module is the extension lemma.
\begin{code}[hide]
{-# OPTIONS --safe --without-K --lossy-unification #-}
open import MLTT.Spartan hiding (π)
open import Slice.Family
open import UF.Base
open import UF.Equiv hiding (_β )
open import UF.FunExt
open import UF.PropTrunc
open import UF.Sets
open import UF.Sets-Properties
open import UF.SubtypeClassifier
module Locales.BooleanAlgebra
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
where
open import Locales.CompactRegular pt fe
open import Locales.ContinuousMap.FrameHomomorphism-Definition pt fe
open import Locales.ContinuousMap.FrameHomomorphism-Properties pt fe
open import Locales.Frame pt fe
open import UF.Logic
open import UF.Subsingletons
open FrameHomomorphismProperties
open AllCombinators pt fe
open PropositionalTruncation pt
\end{code}
\section{Definition of a Boolean algebra}
\begin{code}
private
variable
π€β² π₯β² π¦β² π€β²β² π₯β²β² : Universe
\end{code}
Since the order is derivable from the meets (or the joins), it might be room for
further work to define the order using the meets. However, the universes will
change if we do this so it is not clear what it will result in.
\begin{code}
ba-data : {π€ : Universe} β (π₯ : Universe) β π€ Μ β π€ β π₯ βΊ Μ
ba-data π₯ A = (A β A β Ξ© π₯ )
Γ A
Γ (A β A β A)
Γ A
Γ (A β A β A)
Γ (A β A)
\end{code}
\begin{code}
module Complementation {A : π€ Μ } (iss : is-set A) (π π : A) (_β_ _β_ : A β A β A) where
_complements_ : A β A β Ξ© π€
xβ² complements x = (x β xβ² οΌ[ iss ]οΌ π) β§ (x β xβ² οΌ[ iss ]οΌ π)
\end{code}
\begin{code}
satisfies-ba-laws : {A : π€ Μ } β ba-data π₯ A β π€ β π₯ Μ
satisfies-ba-laws {π€ = π€} {π₯ = π₯} {A = A} (_β€_ , π , _β_ , π , _β_ , Β¬_) =
Ξ£ p κ is-partial-order A _β€_ , rest p holds
where
open Meets (Ξ» x y β x β€ y)
open Joins (Ξ» x y β x β€ y)
rest : is-partial-order A _β€_ β Ξ© (π€ β π₯)
rest p = Ξ² β§ Ξ³ β§ Ξ΄ β§ Ο΅ β§ ΞΆ β§ Ξ·
where
P : Poset π€ π₯
P = A , _β€_ , p
iss : is-set A
iss = carrier-of-[ P ]-is-set
open Complementation iss π π _β_ _β_
Ξ² : Ξ© (π€ β π₯)
Ξ² = β±― x κ A , β±― y κ A , (x β y) is-glb-of (x , y)
Ξ³ : Ξ© (π€ β π₯)
Ξ³ = β±― x κ A , x β€ π
Ξ΄ : Ξ© (π€ β π₯)
Ξ΄ = β±― x κ A , β±― y κ A , _is-lub-ofβ_ (x β y) (x , y)
Ο΅ : Ξ© (π€ β π₯)
Ο΅ = β±― x κ A , π β€ x
ΞΆ : Ξ© (π€ β π€)
ΞΆ = β±― x κ A , β±― y κ A , β±― z κ A , x β (y β z) οΌ[ iss ]οΌ (x β y) β (x β z)
Ξ· : Ξ© (π€ β π€)
Ξ· = β±― x κ A , (Β¬ x) complements x
\end{code}
\begin{code}
ba-structure : (π₯ : Universe) β π€ Μ β π€ β π₯ βΊ Μ
ba-structure π₯ A = Ξ£ d κ ba-data π₯ A , satisfies-ba-laws d
BooleanAlgebra : (π€ π₯ : Universe) β π€ βΊ β π₯ βΊ Μ
BooleanAlgebra π€ π₯ = Ξ£ A κ π€ Μ , ba-structure π₯ A
\end{code}
\begin{code}
βͺ_β« : BooleanAlgebra π€ π₯ β π€ Μ
βͺ A , _ β« = A
poset-of-ba : BooleanAlgebra π€ π₯ β Poset π€ π₯
poset-of-ba (A , ((_β€_ , _) , (Ο , _))) = A , _β€_ , Ο
carrier-of-ba-is-set : (B : BooleanAlgebra π€ π₯) β is-set βͺ B β«
carrier-of-ba-is-set B = carrier-of-[ poset-of-ba B ]-is-set
meet-of-ba : (B : BooleanAlgebra π€ π₯) β βͺ B β« β βͺ B β« β βͺ B β«
meet-of-ba (_ , (_ , _ , _β_ , _) , _) = _β_
β[_]-is-lowerβ : (B : BooleanAlgebra π€ π₯)
β (x y : βͺ B β«) β ((x β[ B ] y) β€[ poset-of-ba B ] x) holds
β[_]-is-lowerβ B@(_ , _ , (_ , Ο , _ , _)) x y = prβ (prβ (Ο x y))
β[_]-is-lowerβ : (B : BooleanAlgebra π€ π₯)
β (x y : βͺ B β«) β ((x β[ B ] y) β€[ poset-of-ba B ] y) holds
β[_]-is-lowerβ B@(_ , _ , (_ , Ο , _ , _)) x y = prβ (prβ (Ο x y))
β[_]-is-greatest : (B : BooleanAlgebra π€ π₯) {x y l : βͺ B β«}
β (l β€[ poset-of-ba B ] x) holds
β (l β€[ poset-of-ba B ] y) holds
β (l β€[ poset-of-ba B ] (x β[ B ] y)) holds
β[_]-is-greatest B@(_ , _ , (_ , Ο , _ , _)) {x} {y} {l} p q =
prβ (Ο x y) (l , p , q)
infixl 4 meet-of-ba
syntax meet-of-ba B x y = x β[ B ] y
join-of-ba : (B : BooleanAlgebra π€ π₯) β βͺ B β« β βͺ B β« β βͺ B β«
join-of-ba (_ , (_ , _ , _ , _ , _β_ , _) , _) = _β_
infixl 3 join-of-ba
syntax join-of-ba B x y = x β[ B ] y
β[_]-is-upperβ : (B : BooleanAlgebra π€ π₯)
β (x y : βͺ B β«) β (x β€[ poset-of-ba B ] (x β[ B ] y)) holds
β[_]-is-upperβ (_ , _ , (_ , _ , _ , Ο , _)) x y = prβ (prβ (Ο x y))
β[_]-is-upperβ : (B : BooleanAlgebra π€ π₯)
β (x y : βͺ B β«) β (y β€[ poset-of-ba B ] (x β[ B ] y)) holds
β[_]-is-upperβ (_ , _ , (_ , _ , _ , Ο , _)) x y = prβ (prβ (Ο x y))
β[_]-is-least : (B : BooleanAlgebra π€ π₯)
β {u x y : βͺ B β«}
β (x β€[ poset-of-ba B ] u) holds
β (y β€[ poset-of-ba B ] u) holds
β ((x β[ B ] y) β€[ poset-of-ba B ] u) holds
β[_]-is-least (_ , _ , (_ , _ , _ , Ο , _)) {u} {x} {y} p q =
prβ (Ο x y) (u , p , q)
β€[_] : (B : BooleanAlgebra π€ π₯) β βͺ B β«
β€[ (_ , (_ , β€ , _ , _ , _ , _) , _) ] = β€
β€[_]-is-top : (B : BooleanAlgebra π€ π₯)
β (b : βͺ B β«) β (b β€[ poset-of-ba B ] β€[ B ]) holds
β€[ _ , _ , Ο ]-is-top = prβ (prβ (prβ Ο))
β₯[_] : (B : BooleanAlgebra π€ π₯) β βͺ B β«
β₯[ (_ , (_ , _ , _ , β₯ , _ , _) , _) ] = β₯
β₯[_]-is-bottom : (B : BooleanAlgebra π€ π₯)
β (b : βͺ B β«) β (β₯[ B ] β€[ poset-of-ba B ] b) holds
β₯[ _ , _ , Ο ]-is-bottom = prβ (prβ (prβ (prβ (prβ Ο))))
Β¬[_]_ : (B : BooleanAlgebra π€ π₯) β βͺ B β« β βͺ B β«
Β¬[ B ] x = prβ (prβ (prβ (prβ (prβ (prβ (prβ B)))))) x
Β¬[_]-is-complement : (B : BooleanAlgebra π€ π₯)
β let
Ο = carrier-of-[ poset-of-ba B ]-is-set
open Complementation Ο β₯[ B ] β€[ B ] (meet-of-ba B) (join-of-ba B)
in
(x : βͺ B β«) β ((Β¬[ B ] x) complements x) holds
Β¬[_]-is-complement (_ , _ , (_ , _ , _ , _ , _ , _ , Ο)) = Ο
β-distributes-over-β : (B : BooleanAlgebra π€ π₯)
β (x y z : βͺ B β«)
β x β[ B ] (y β[ B ] z) οΌ (x β[ B ] y) β[ B ] (x β[ B ] z)
β-distributes-over-β (_ , _ , (_ , _ , _ , _ , _ , Ο , _)) = Ο
\end{code}
\begin{code}
is-lattice-homomorphism : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (βͺ B β« β β¨ L β©) β Ξ© (π€β² β π€)
is-lattice-homomorphism {π€β²} {π₯β²} {π€} {π₯} B L Ξ· = Ξ² β§ Ξ³ β§ Ξ΄ β§ Ο΅
where
iss : is-set β¨ L β©
iss = carrier-of-[ poset-of L ]-is-set
Ξ² : Ξ© π€
Ξ² = Ξ· β€[ B ] οΌ[ iss ]οΌ π[ L ]
Ξ³ : Ξ© (π€β² β π€)
Ξ³ = β±― x κ βͺ B β« , β±― y κ βͺ B β« , Ξ· (x β[ B ] y) οΌ[ iss ]οΌ Ξ· x β§[ L ] Ξ· y
Ξ΄ : Ξ© π€
Ξ΄ = Ξ· β₯[ B ] οΌ[ iss ]οΌ π[ L ]
Ο΅ : Ξ© (π€β² β π€)
Ο΅ = β±― x κ βͺ B β« , β±― y κ βͺ B β« , Ξ· (x β[ B ] y) οΌ[ iss ]οΌ Ξ· x β¨[ L ] Ξ· y
is-ba-homomorphism : (Bβ : BooleanAlgebra π€ π₯) (Bβ : BooleanAlgebra π€' π₯')
β (f : βͺ Bβ β« β βͺ Bβ β«) β Ξ© (π€ β π€')
is-ba-homomorphism {π€} {π₯} {π€'} {π₯'} Bβ Bβ f = Ξ² β§ Ξ³ β§ Ξ΄ β§ Ο΅
where
Ο : is-set βͺ Bβ β«
Ο = carrier-of-[ poset-of-ba Bβ ]-is-set
Ξ² : Ξ© π€'
Ξ² = f β€[ Bβ ] οΌ[ Ο ]οΌ β€[ Bβ ]
Ξ³ : Ξ© (π€ β π€')
Ξ³ = β±― x κ βͺ Bβ β« , β±― y κ βͺ Bβ β« , f (x β[ Bβ ] y) οΌ[ Ο ]οΌ f x β[ Bβ ] f y
Ξ΄ : Ξ© π€'
Ξ΄ = f β₯[ Bβ ] οΌ[ Ο ]οΌ β₯[ Bβ ]
Ο΅ : Ξ© (π€ β π€')
Ο΅ = β±― x κ βͺ Bβ β« , β±― y κ βͺ Bβ β« , f (x β[ Bβ ] y) οΌ[ Ο ]οΌ f x β[ Bβ ] f y
lattice-homomorphisms-are-monotone : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (h : βͺ B β« β β¨ L β©)
β is-lattice-homomorphism B L h holds
β (x y : βͺ B β«)
β (x β€[ poset-of-ba B ] y) holds
β (h x β€[ poset-of L ] h y) holds
lattice-homomorphisms-are-monotone B L h (Ξ² , Ξ³ , _) x y p =
h x οΌβ¨ β β»ΒΉ β©β h x β§[ L ] h y β€β¨ β§[ L ]-lowerβ (h x) (h y) β© h y β
where
open PosetReasoning (poset-of L)
β‘ : x β[ B ] y οΌ x
β‘ = β€-is-antisymmetric (poset-of-ba B)
(β[ B ]-is-lowerβ x y)
(β[ B ]-is-greatest (β€-is-reflexive (poset-of-ba B) x) p)
β : h x β§[ L ] h y οΌ h x
β = h x β§[ L ] h y οΌβ¨ Ξ³ x y β»ΒΉ β©
h (x β[ B ] y) οΌβ¨ ap h β‘ β©
h x β
is-ba-embedding : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (βͺ B β« β β¨ L β©) β Ξ© (π€β² β π€)
is-ba-embedding {π€β²} {π₯β²} {π€} {π₯} {π¦} B L Ξ· =
ΞΉ β§ is-lattice-homomorphism B L Ξ·
where
iss : is-set β¨ L β©
iss = carrier-of-[ poset-of L ]-is-set
issβ : is-set βͺ B β«
issβ = carrier-of-[ poset-of-ba B ]-is-set
ΞΉ : Ξ© (π€β² β π€)
ΞΉ = β±― x κ βͺ B β« , β±― y κ βͺ B β« , (Ξ· x οΌ[ iss ]οΌ Ξ· y) β (x οΌ[ issβ ]οΌ y)
embedding-preserves-meets : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (Ξ· : βͺ B β« β β¨ L β©)
β is-ba-embedding B L Ξ· holds
β (x y : βͺ B β«) β Ξ· (x β[ B ] y) οΌ Ξ· x β§[ L ] Ξ· y
embedding-preserves-meets B L Ξ· (_ , (_ , ΞΎ , _)) = ΞΎ
embedding-injective : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (Ξ· : βͺ B β« β β¨ L β©)
β is-ba-embedding B L Ξ· holds
β (x y : βͺ B β«) β Ξ· x οΌ Ξ· y β x οΌ y
embedding-injective B L Ξ· (ΞΉ , _) = ΞΉ
is-spectralβ² : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (f : βͺ B β« β β¨ L β©) β Ξ© (π€β² β π€ β π₯ β π¦ βΊ)
is-spectralβ² B L f = β±― x κ βͺ B β« , is-compact-open L (f x)
\end{code}
\begin{code}
_is-sublattice-of_ : BooleanAlgebra π€β² π₯β² β Frame π€ π₯ π¦ β Ξ© (π€β² β π€)
_is-sublattice-of_ B L = Ζ Ξ· κ (βͺ B β« β β¨ L β©) , is-ba-embedding B L Ξ· holds
\end{code}
\begin{code}
embedding-preserves-and-reflects-order : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (Ξ· : βͺ B β« β β¨ L β©)
β (ΞΌ : is-ba-embedding B L Ξ· holds)
β (x y : βͺ B β«)
β (x β€[ poset-of-ba B ] y
β Ξ· x β€[ poset-of L ] Ξ· y) holds
embedding-preserves-and-reflects-order B L Ξ· ΞΌ x y = β , β‘
where
Ξ·-meet-preserving : (x y : βͺ B β«) β Ξ· (x β[ B ] y) οΌ Ξ· x β§[ L ] Ξ· y
Ξ·-meet-preserving = embedding-preserves-meets B L Ξ· ΞΌ
β : (x β€[ poset-of-ba B ] y β Ξ· x β€[ poset-of L ] Ξ· y) holds
β p = Ξ· x οΌβ¨ ap Ξ· (β» β»ΒΉ) β©β
Ξ· (x β[ B ] y) οΌβ¨ Ξ·-meet-preserving x y β©β
Ξ· x β§[ L ] Ξ· y β€β¨ β§[ L ]-lowerβ (Ξ· x) (Ξ· y) β©
Ξ· y β
where
open PosetReasoning (poset-of L)
β» : x β[ B ] y οΌ x
β» = β€-is-antisymmetric (poset-of-ba B) β»β β»β
where
β»β : ((x β[ B ] y) β€[ poset-of-ba B ] x) holds
β»β = β[ B ]-is-lowerβ x y
β»β : (x β€[ poset-of-ba B ] (x β[ B ] y)) holds
β»β = β[ B ]-is-greatest (β€-is-reflexive (poset-of-ba B) x) p
β‘ : (Ξ· x β€[ poset-of L ] Ξ· y β x β€[ poset-of-ba B ] y) holds
β‘ p = x οΌβ¨ β β»ΒΉ β©β x β[ B ] y β€β¨ β[ B ]-is-lowerβ x y β© y β
where
open PosetReasoning (poset-of-ba B)
β₯ : Ξ· (x β[ B ] y) οΌ Ξ· x
β₯ = Ξ· (x β[ B ] y) οΌβ¨ embedding-preserves-meets B L Ξ· ΞΌ x y β©
Ξ· x β§[ L ] Ξ· y οΌβ¨ connecting-lemmaβ L p β»ΒΉ β©
Ξ· x β
β : x β[ B ] y οΌ x
β = embedding-injective B L Ξ· ΞΌ (x β[ B ] y) x β₯
embeddings-lemma : (B : BooleanAlgebra π€β² π₯β²) (L : Frame π€ π₯ π¦)
β (Ξ· : βͺ B β« β β¨ L β©)
β is-ba-embedding B L Ξ· holds
β (x : βͺ B β«) β (Ξ· x β€[ poset-of L ] π[ L ]) holds β x οΌ β₯[ B ]
embeddings-lemma B L Ξ· (ΞΉ , _ , (_ , ΞΎ , _)) x p = ΞΉ x β₯[ B ] β
where
β : Ξ· x οΌ Ξ· β₯[ B ]
β = Ξ· x οΌβ¨ only-π-is-below-π L (Ξ· x) p β© π[ L ] οΌβ¨ ΞΎ β»ΒΉ β© Ξ· β₯[ B ] β
\end{code}
\begin{code}
is-generated-by : (L : Frame π€ π¦ π¦) β (B : BooleanAlgebra π¦ π₯)
β (βͺ B β« β β¨ L β©) β Ξ© π€
is-generated-by {π¦ = π¦} L B Ξ· =
β±― x κ β¨ L β© , x οΌ[ Ο ]οΌ (β[ L ] β
Ξ· b β£ (b , _) βΆ (Ξ£ b κ βͺ B β« , Ξ· b β€ x) β)
where
Ο : is-set β¨ L β©
Ο = carrier-of-[ poset-of L ]-is-set
_β€_ = Ξ» x y β (x β€[ poset-of L ] y) holds
contains-compact-opens : (L : Frame π€ π¦ π¦) (B : BooleanAlgebra π¦ π₯)
β (βͺ B β« β β¨ L β©) β Ξ© (π€ β π¦ βΊ)
contains-compact-opens L B Ξ· =
β±― x κ β¨ L β© , is-compact-open L x β (Ζ b κ βͺ B β« , Ξ· b οΌ x)
\end{code}
\begin{code}
open FrameHomomorphisms
extension-lemma : (B : BooleanAlgebra π¦ π¦) (L Lβ² : Frame π€ π¦ π¦)
β (Ξ· : βͺ B β« β β¨ L β©)
β is-ba-embedding B L Ξ· holds
β is-spectral L holds
β is-spectralβ² B L Ξ· holds
β is-generated-by L B Ξ· holds
β contains-compact-opens L B Ξ· holds
β (h : βͺ B β« β β¨ Lβ² β©)
β is-lattice-homomorphism B Lβ² h holds
β β! hβ κ (β¨ L β© β β¨ Lβ² β©) ,
is-a-frame-homomorphism L Lβ² hβ holds Γ (h οΌ hβ β Ξ·)
extension-lemma {π¦} {π€} B L Lβ² Ξ· e@(_ , _ , _ , β₯β , β₯β) Ο s Ξ³ π h ΞΌ@(β β , β β , β β , β β) =
(hβ» , Ο , Ο) , Ο
where
ββ_ : β¨ L β© β Fam π¦ β¨ Lβ² β©
ββ x = β
h b β£ (b , _) βΆ Ξ£ b κ βͺ B β« , (Ξ· b β€[ poset-of L ] x) holds β
hβ» : β¨ L β© β β¨ Lβ² β©
hβ» x = β[ Lβ² ] ββ x
\end{code}
We first show that `hβ»` preserves the top element.
\begin{code}
Οβ : hβ» π[ L ] οΌ π[ Lβ² ]
Οβ = only-π-is-above-π Lβ² (hβ» π[ L ]) β
where
β₯β = prβ (prβ e)
β‘ = β[ Lβ² ]-upper _ (β€[ B ] , reflexivity+ (poset-of L) β₯β)
open PosetReasoning (poset-of Lβ²)
β : (π[ Lβ² ] β€[ poset-of Lβ² ] hβ» π[ L ]) holds
β = π[ Lβ² ] οΌβ¨ β β β»ΒΉ β©β
h β€[ B ] β€β¨ β‘ β©
hβ» π[ L ] β
Οβ : hβ» π[ L ] οΌ π[ Lβ² ]
Οβ = only-π-is-below-π Lβ² (hβ» π[ L ]) β
where
open PosetReasoning (poset-of Lβ²)
open Joins (Ξ» x y β x β€[ poset-of Lβ² ] y)
β : (hβ» π[ L ] β€[ poset-of Lβ² ] π[ Lβ² ]) holds
β = hβ» π[ L ] οΌβ¨ refl β©β
β[ Lβ² ] (ββ π[ L ]) β€β¨ β
β©
h β₯[ B ] οΌβ¨ β β β©β
π[ Lβ² ] β
where
β₯ : Ξ· β₯[ B ] οΌ π[ L ]
β₯ = prβ (prβ (prβ (prβ e)))
β» : (h β₯[ B ] is-an-upper-bound-of (ββ π[ L ])) holds
β» (b , q) = h b οΌβ¨ ap h (embeddings-lemma B L Ξ· e b q) β©β
h β₯[ B ] β
β
= β[ Lβ² ]-least (ββ π[ L ]) (h β₯[ B ] , β»)
\end{code}
The function `hβ»` also preserves meets.
\begin{code}
Οβ : (x y : β¨ L β©) β hβ» (x β§[ L ] y) οΌ hβ» x β§[ Lβ² ] hβ» y
Οβ x y = β€-is-antisymmetric (poset-of Lβ²) β β‘
where
β : (hβ» (x β§[ L ] y) β€[ poset-of Lβ² ] (hβ» x β§[ Lβ² ] hβ» y)) holds
β = β§[ Lβ² ]-greatest (hβ» x) (hβ» y) (hβ» (x β§[ L ] y)) I II
where
open PosetReasoning (poset-of L)
Ξ΄β : cofinal-in Lβ² (ββ (x β§[ L ] y)) (ββ x) holds
Ξ΄β (b , p) = β£ (b , (Ξ· b β€β¨ p β© x β§[ L ] y β€β¨ β§[ L ]-lowerβ x y β© x β ))
, β€-is-reflexive (poset-of Lβ²) (h b) β£
Ξ΄β : cofinal-in Lβ² (ββ (x β§[ L ] y)) (ββ y) holds
Ξ΄β (b , p) = β£ (b , (Ξ· b β€β¨ p β© x β§[ L ] y β€β¨ β§[ L ]-lowerβ x y β© y β ))
, β€-is-reflexive (poset-of Lβ²) (h b) β£
I : (hβ» (x β§[ L ] y) β€[ poset-of Lβ² ] hβ» x) holds
I = cofinal-implies-join-covered Lβ² _ _ Ξ΄β
II : (hβ» (x β§[ L ] y) β€[ poset-of Lβ² ] hβ» y) holds
II = cofinal-implies-join-covered Lβ² _ _ Ξ΄β
β± : Fam π¦ β¨ Lβ² β©
β± = β
(h bβ) β§[ Lβ² ] (h bβ)
β£ ((bβ , _) , (bβ , _))
βΆ (Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] x) holds)
Γ ((Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] y) holds)) β
β‘ : ((hβ» x β§[ Lβ² ] hβ» y) β€[ poset-of Lβ² ] hβ» (x β§[ L ] y)) holds
β‘ =
hβ» x β§[ Lβ² ] hβ» y οΌβ¨ refl β©β
(β[ Lβ² ] ββ x) β§[ Lβ² ] (β[ Lβ² ] ββ y) οΌβ¨ β
β©β
β[ Lβ² ] β± β€β¨ β
‘ β©
hβ» (x β§[ L ] y) β
where
open PosetReasoning (poset-of Lβ²)
open Joins (Ξ» x y β x β€[ poset-of Lβ² ] y)
β
= distributivity+ Lβ² (ββ x) (ββ y)
Ξ² : (hβ» (x β§[ L ] y) is-an-upper-bound-of β±) holds
Ξ² ((bβ , Οβ) , (bβ , Οβ)) = h bβ β§[ Lβ² ] h bβ οΌβ¨ β β bβ bβ β»ΒΉ β©β
h (bβ β[ B ] bβ) β€β¨ ΞΆ β©
hβ» (x β§[ L ] y) β
where
ΞΎ : (Ξ· (bβ β[ B ] bβ) β€[ poset-of L ] (x β§[ L ] y)) holds
ΞΎ = Ξ· (bβ β[ B ] bβ) οΌβ¨ prβ (prβ (prβ e)) bβ bβ β©L
Ξ· bβ β§[ L ] Ξ· bβ β€β¨ β§[ L ]-left-monotone Οβ β©L
x β§[ L ] Ξ· bβ β€β¨ β§[ L ]-right-monotone Οβ β©L
x β§[ L ] y β L
where
open PosetReasoning (poset-of L)
renaming (_β€β¨_β©_ to _β€β¨_β©L_; _β to _β L; _οΌβ¨_β©β_ to _οΌβ¨_β©L_)
ΞΆ : (h (bβ β[ B ] bβ) β€[ poset-of Lβ² ] (β[ Lβ² ] ββ (x β§[ L ] y))) holds
ΞΆ = β[ Lβ² ]-upper (ββ (x β§[ L ] y)) ((bβ β[ B ] bβ) , ΞΎ)
β
‘ = β[ Lβ² ]-least _ (hβ» (x β§[ L ] y) , Ξ²)
\end{code}
\begin{code}
hβ»-is-monotone : is-monotonic (poset-of L) (poset-of Lβ²) hβ» holds
hβ»-is-monotone = meet-preserving-implies-monotone L Lβ² hβ» Οβ
\end{code}
\begin{code}
open Joins (Ξ» x y β x β€[ poset-of Lβ² ] y)
Οβ : h βΌ hβ» β Ξ·
Οβ b = β€-is-antisymmetric (poset-of Lβ²) (Ο b) (Ο b)
where
open PosetReasoning (poset-of Lβ²)
Ο : (b : βͺ B β«) β (h b β€[ poset-of Lβ² ] hβ» (Ξ· b)) holds
Ο b = β[ Lβ² ]-upper (ββ (Ξ· b)) (b , β€-is-reflexive (poset-of L) (Ξ· b))
Ο : (b : βͺ B β«) β (hβ» (Ξ· b) β€[ poset-of Lβ² ] h b) holds
Ο b = β[ Lβ² ]-least (ββ (Ξ· b)) (h b , Οβ)
where
Οβ : (h b is-an-upper-bound-of (ββ Ξ· b)) holds
Οβ (bα΅’ , p) = lattice-homomorphisms-are-monotone B Lβ² h ΞΌ bα΅’ b Οβ
where
Οβ : (bα΅’ β€[ poset-of-ba B ] b) holds
Οβ = prβ (embedding-preserves-and-reflects-order B L Ξ· e bα΅’ b) p
Ο : h οΌ hβ» β Ξ·
Ο = dfunext fe Οβ
\end{code}
\begin{code}
ΞΆβ» : is-scott-continuous L Lβ² hβ» holds
ΞΆβ» S Ξ΄ = transport (Ξ» - β (- is-lub-of β
hβ» x β£ x Ξ΅ S β) holds) (β» β»ΒΉ) β£
where
β : (hβ» (β[ L ] S) β€[ poset-of Lβ² ] (β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β)) holds
β = β[ Lβ² ]-least (ββ (β[ L ] S)) ((β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β) , β β)
where
open PosetReasoning (poset-of Lβ²)
β β : ((β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β) is-an-upper-bound-of (ββ (β[ L ] S))) holds
β β (b , p) =
h b οΌβ¨ Οβ b β©β
hβ» (Ξ· b) β€β¨ β β β©
β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β β
where
β β : (Ξ£ k κ index S , ((Ξ· b β€[ poset-of L ] (S [ k ])) holds))
β (hβ» (Ξ· b) β€[ poset-of Lβ² ] (β[ Lβ² ] (β
hβ» x β£ x Ξ΅ S β))) holds
β β (k , q) =
hβ» (Ξ· b) β€β¨ hβ»-is-monotone (Ξ· b , S [ k ]) q β©
hβ» (S [ k ]) β€β¨ β[ Lβ² ]-upper β
hβ» x β£ x Ξ΅ S β k β©
β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β β
β β : (hβ» (Ξ· b) β€[ poset-of Lβ² ] (β[ Lβ² ] (β
hβ» x β£ x Ξ΅ S β))) holds
β β = β₯β₯-rec (holds-is-prop (_ β€[ poset-of Lβ² ] _)) β β (s b S Ξ΄ p)
β‘ : ((β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β) β€[ poset-of Lβ² ] hβ» (β[ L ] S)) holds
β‘ = β[ Lβ² ]-least β
hβ» x β£ x Ξ΅ S β (hβ» (β[ L ] S) , β‘β)
where
β‘β : (hβ» (β[ L ] S) is-an-upper-bound-of β
hβ» x β£ x Ξ΅ S β) holds
β‘β i = hβ»-is-monotone ((S [ i ]) , β[ L ] S) (β[ L ]-upper S i)
β» : hβ» (β[ L ] S) οΌ β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β
β» = β€-is-antisymmetric (poset-of Lβ²) β β‘
β£ : ((β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β) is-lub-of β
hβ» x β£ x Ξ΅ S β) holds
β£ = β[ Lβ² ]-upper β
hβ» x β£ x Ξ΅ S β , β[ Lβ² ]-least β
hβ» x β£ x Ξ΅ S β
hβ»-preserves-β¨ : (x y : β¨ L β©) β hβ» (x β¨[ L ] y) οΌ hβ» x β¨[ Lβ² ] hβ» y
hβ»-preserves-β¨ x y = β€-is-antisymmetric (poset-of Lβ²) β β‘
where
β»β : (hβ» x β€[ poset-of Lβ² ] hβ» (x β¨[ L ] y)) holds
β»β = hβ»-is-monotone (x , (x β¨[ L ] y)) (β¨[ L ]-upperβ x y)
β»β : (hβ» y β€[ poset-of Lβ² ] hβ» (x β¨[ L ] y)) holds
β»β = hβ»-is-monotone (y , (x β¨[ L ] y)) (β¨[ L ]-upperβ x y)
β : (hβ» (x β¨[ L ] y) β€[ poset-of Lβ² ] (hβ» x β¨[ Lβ² ] hβ» y)) holds
β = β[ Lβ² ]-least (ββ (x β¨[ L ] y)) ((hβ» x β¨[ Lβ² ] hβ» y) , β β)
where
β β : ((hβ» x β¨[ Lβ² ] hβ» y) is-an-upper-bound-of (ββ (x β¨[ L ] y))) holds
β β (b , p) = β₯β₯-rec
(holds-is-prop (h b β€[ poset-of Lβ² ] (hβ» x β¨[ Lβ² ] hβ» y)))
β β
ΰ₯
where
ΰ₯ : (Ζ (c , d) κ (β¨ L β© Γ β¨ L β©) ,
(is-compact-open L c holds)
Γ (is-compact-open L d holds)
Γ (Ξ· b β€[ poset-of L ] (c β¨[ L ] d)) holds
Γ (c β€[ poset-of L ] x) holds
Γ (d β€[ poset-of L ] y) holds)
holds
ΰ₯ = compact-join-lemma L Ο x y (Ξ· b) (s b) p
β β : Ξ£ (c , d) κ (β¨ L β© Γ β¨ L β©) ,
(is-compact-open L c holds)
Γ (is-compact-open L d holds)
Γ (Ξ· b β€[ poset-of L ] (c β¨[ L ] d)) holds
Γ (c β€[ poset-of L ] x) holds
Γ (d β€[ poset-of L ] y) holds
β (h b β€[ poset-of Lβ² ] (hβ» x β¨[ Lβ² ] hβ» y)) holds
β β ((c , d) , ΞΊc , ΞΊd , Ο , Ο , ΞΎ) =
h b οΌβ¨ Οβ b β©β
hβ» (Ξ· b) β€β¨ β
β©
hβ» (c β¨[ L ] d) β€β¨ β
‘ β©
hβ» c β¨[ Lβ² ] hβ» d β€β¨ β
€ β©
hβ» c β¨[ Lβ² ] hβ» y β€β¨ β
₯ β©
hβ» x β¨[ Lβ² ] hβ» y β
where
open PosetReasoning (poset-of Lβ²)
β
= hβ»-is-monotone (Ξ· b , (c β¨[ L ] d)) Ο
β
‘ : (hβ» (c β¨[ L ] d) β€[ poset-of Lβ² ] ((hβ» c) β¨[ Lβ² ] (hβ» d))) holds
β
‘ = hβ» (c β¨[ L ] d) β€β¨ β£ β© ππ½π οΌβ¨ β» β»ΒΉ β©β hβ» c β¨[ Lβ² ] hβ» d β
where
open PosetReasoning (poset-of L)
renaming (_β€β¨_β©_ to _β€β¨_β©β_; _β to _πππ; _οΌβ¨_β©β_ to _οΌβ¨_β©β_)
ππ½π =
β[ Lβ² ]
β
h bβ β¨[ Lβ² ] h bβ
β£ ((bβ , _) , (bβ , _))
βΆ (Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] c) holds)
Γ (Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] d) holds) β
β» : hβ» c β¨[ Lβ² ] hβ» d
οΌ β[ Lβ² ]
β
h bβ β¨[ Lβ² ] h bβ
β£ ((bβ , _) , (bβ , _))
βΆ (Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] c) holds)
Γ (Ξ£ bβ κ βͺ B β« , (Ξ· bβ β€[ poset-of L ] d) holds) β
β» = β¨[ Lβ² ]-iterated-join (ββ c) (ββ d) β£ iβ β£ β£ iβ β£
where
iβ : index (ββ c)
iβ = β₯[ B ] , (Ξ· β₯[ B ] οΌβ¨ β₯β β©β
π[ L ] β€β¨ π-is-bottom L c β©β
c πππ)
iβ : index (ββ d)
iβ = β₯[ B ] , (Ξ· β₯[ B ] οΌβ¨ β₯β β©β
π[ L ] β€β¨ π-is-bottom L d β©β
d πππ)
β£β : (ππ½π is-an-upper-bound-of (ββ (c β¨[ L ] d))) holds
β£β (b , q) =
β₯β₯-recβ (holds-is-prop (h b β€[ poset-of Lβ² ] ππ½π)) β£β (π c ΞΊc) (π d ΞΊd)
where
β£β : (Ξ£ bβ κ βͺ B β« , Ξ· bβ οΌ c)
β (Ξ£ bβ κ βͺ B β« , Ξ· bβ οΌ d)
β (h b β€[ poset-of Lβ² ] ππ½π) holds
β£β (bβ , rβ) (bβ , rβ) =
h b β€β¨ β
β β©
h (bβ β[ B ] bβ) οΌβ¨ β β bβ bβ β©β
(h bβ) β¨[ Lβ² ] (h bβ) β€β¨ α― β©
ππ½π β
where
α―β = reflexivity+ (poset-of L) rβ
α―β = reflexivity+ (poset-of L) rβ
α― = β[ Lβ² ]-upper _ ((bβ , α―β), (bβ , α―β))
Ξ½ : (Ξ· b β€[ poset-of L ] Ξ· (bβ β[ B ] bβ)) holds
Ξ½ = Ξ· b β€β¨ q β©β
c β¨[ L ] d οΌβ¨ Ο β©β
(Ξ· bβ) β¨[ L ] d οΌβ¨ Ο‘ β©β
(Ξ· bβ) β¨[ L ] (Ξ· bβ) οΌβ¨ Ν± β©β
Ξ· (bβ β[ B ] bβ) πππ
where
Ο = ap (Ξ» - β - β¨[ L ] d) (rβ β»ΒΉ)
Ο‘ = ap (Ξ» - β (Ξ· bβ) β¨[ L ] -) (rβ β»ΒΉ)
Ν± = β₯β bβ bβ β»ΒΉ
Ο
: (b β€[ poset-of-ba B ] (bβ β[ B ] bβ)) holds
Ο
= prβ (embedding-preserves-and-reflects-order B L Ξ· e b _) Ξ½
β
β = lattice-homomorphisms-are-monotone B Lβ² h ΞΌ b _ Ο
β£ = β[ Lβ² ]-least (ββ (c β¨[ L ] d)) (ππ½π , β£β)
β
€ = β¨[ Lβ² ]-right-monotone (hβ»-is-monotone (d , y) ΞΎ)
β
₯ = β¨[ Lβ² ]-left-monotone (hβ»-is-monotone (c , x) Ο)
β‘ : ((hβ» x β¨[ Lβ² ] hβ» y) β€[ poset-of Lβ² ] hβ» (x β¨[ L ] y)) holds
β‘ = β¨[ Lβ² ]-least β‘β β‘β
where
β‘β : (hβ» x β€[ poset-of Lβ² ] hβ» (x β¨[ L ] y)) holds
β‘β = β[ Lβ² ]-least (ββ x) (hβ» (x β¨[ L ] y) , β£β)
where
β£β : (hβ» (x β¨[ L ] y) is-an-upper-bound-of (ββ x)) holds
β£β (b , p) = h b β€β¨ β[ Lβ² ]-upper (ββ x) (b , p) β©
hβ» x β€β¨ β»β β©
hβ» (x β¨[ L ] y) β
where
open PosetReasoning (poset-of Lβ²)
β‘β : (hβ» y β€[ poset-of Lβ² ] hβ» (x β¨[ L ] y)) holds
β‘β = β[ Lβ² ]-least (ββ y) (hβ» (x β¨[ L ] y) , β£β)
where
β£β : (hβ» (x β¨[ L ] y) is-an-upper-bound-of (ββ y)) holds
β£β (b , p) = h b β€β¨ β[ Lβ² ]-upper (ββ y) (b , p) β©
β[ Lβ² ] (ββ y) β€β¨ β»β β©
hβ» (x β¨[ L ] y) β
where
open PosetReasoning (poset-of Lβ²)
Οβ : (S : Fam π¦ β¨ L β©) β (hβ» (β[ L ] S) is-lub-of β
hβ» x β£ x Ξ΅ S β) holds
Οβ S@(I , π) =
transport (Ξ» - β (- is-lub-of β
hβ» x β£ x Ξ΅ S β) holds) (β β»ΒΉ) β‘
where
β : hβ» (β[ L ] S) οΌ β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β
β = sc-and-β¨-preserving-β-β-preserving L Lβ² hβ» ΞΆβ» Οβ hβ»-preserves-β¨ S
β‘ : ((β[ Lβ² ] β
hβ» x β£ x Ξ΅ S β) is-lub-of β
hβ» x β£ x Ξ΅ S β) holds
β‘ = β[ Lβ² ]-upper β
hβ» x β£ x Ξ΅ S β , β[ Lβ² ]-least β
hβ» x β£ x Ξ΅ S β
\end{code}
\begin{code}
Ο : is-a-frame-homomorphism L Lβ² hβ» holds
Ο = Οβ , Οβ , Οβ
\end{code}
The map `hβ»` is the _unique_ map making the diagram commute.
\begin{code}
Ο : is-central
(Ξ£ hβ»β κ (β¨ L β© β β¨ Lβ² β©) ,
is-a-frame-homomorphism L Lβ² hβ»β holds Γ (h οΌ hβ»β β Ξ·) )
(hβ» , (Ο , Ο))
Ο (hβ»β , Οβ²@(Οβ²β , Οβ²β , Οβ²β) , Οβ²) = to-subtype-οΌ β (dfunext fe Οβ)
where
_β€L_ = Ξ» x y β (x β€[ poset-of L ] y) holds
β : (hβ² : β¨ L β© β β¨ Lβ² β©)
β is-prop (is-a-frame-homomorphism L Lβ² hβ² holds Γ (h οΌ hβ² β Ξ·))
β hβ² = Γ-is-prop
(holds-is-prop (is-a-frame-homomorphism L Lβ² hβ²))
(Ξ -is-set fe Ξ» _ β carrier-of-[ poset-of Lβ² ]-is-set)
Οβ : (x : β¨ L β©) β hβ» x οΌ hβ»β x
Οβ x =
hβ» x οΌβ¨ refl β©
β[ Lβ² ] (ββ x) οΌβ¨ refl β©
β[ Lβ² ] β
h b β£ (b , _) βΆ Ξ£ b κ βͺ B β« , Ξ· b β€L x β οΌβ¨ β
β©
β[ Lβ² ] β
hβ»β (Ξ· b) β£ (b , _) βΆ Ξ£ b κ βͺ B β« , Ξ· b β€L x β οΌβ¨ β
‘ β©
hβ»β (β[ L ] β
Ξ· b β£ (b , _) βΆ Ξ£ b κ βͺ B β« , Ξ· b β€L x β) οΌβ¨ β
’ β©
hβ»β x β
where
Οβ²β² : (b : βͺ B β«) β h b οΌ hβ»β (Ξ· b)
Οβ²β² b = ap (Ξ» - β - b) Οβ²
β
= ap
(Ξ» - β β[ Lβ² ] (index (ββ x) , -))
(dfunext fe Ξ» { (b , _) β Οβ²β² b})
β
‘ = β[ Lβ² ]-unique _ _ (Οβ²β β
Ξ· b β£ (b , _) βΆ Ξ£ b κ βͺ B β« , Ξ· b β€L x β) β»ΒΉ
β
’ = ap hβ»β (Ξ³ x β»ΒΉ )
\end{code}
\section{Transport}
Given a Boolean algebra `L` on some set `X : π€` that has a copy in universe `π₯`,
then `L` itself has a copy in universe `π₯`
\begin{code}
transport-ba-structure : (X : π€ Μ ) (Y : π€' Μ ) (f : X β Y)
β is-equiv f
β (b : ba-structure π₯ X)
β Ξ£ bβ² κ ba-structure π₯ Y ,
(is-ba-homomorphism (X , b) (Y , bβ²) f holds)
transport-ba-structure {π€} {π€'} {π₯} X Y f e b = (d , β ) , f-is-hom
where
Bβ : BooleanAlgebra π€ π₯
Bβ = X , b
Pβ : Poset π€ π₯
Pβ = poset-of-ba Bβ
open PosetNotation Pβ
g : Y β X
g = inverse f e
_βΌα΅’_ : Y β Y β Ξ© π₯
yβ βΌα΅’ yβ = g yβ β€[ Pβ ] g yβ
Ξ· : f β g βΌ id
Ξ· = inverses-are-sections f e
Ξ΅ : g β f βΌ id
Ξ΅ = inverses-are-retractions f e
f-reflects-order : {xβ xβ : X} β (f xβ βΌα΅’ f xβ β xβ β€ xβ) holds
f-reflects-order {xβ} {xβ} = transport _holds β
where
β : f xβ βΌα΅’ f xβ οΌ xβ β€ xβ
β = f xβ βΌα΅’ f xβ οΌβ¨ refl β©
g (f xβ) β€ g (f xβ) οΌβ¨ ap (Ξ» - β - β€ g (f xβ)) (Ξ΅ xβ) β©
xβ β€ g (f xβ) οΌβ¨ ap (Ξ» - β xβ β€ -) (Ξ΅ xβ) β©
xβ β€ xβ β
βΌα΅’-is-reflexive : is-reflexive _βΌα΅’_ holds
βΌα΅’-is-reflexive = β€-is-reflexive (poset-of-ba Bβ) β g
βΌα΅’-is-transitive : is-transitive _βΌα΅’_ holds
βΌα΅’-is-transitive x y z p q =
β€-is-transitive (poset-of-ba Bβ) (g x) (g y) (g z) β β‘
where
β : (g x β€ g y) holds
β = f-reflects-order
(transportβ (Ξ» a b β (a β€ b) holds) (ap g (Ξ· x) β»ΒΉ) (ap g (Ξ· y) β»ΒΉ) p)
β‘ : (g y β€ g z) holds
β‘ = f-reflects-order
(transportβ (Ξ» a b β (a β€ b) holds) (ap g (Ξ· y) β»ΒΉ) (ap g (Ξ· z) β»ΒΉ) q)
βΌα΅’-is-antisymmetric : is-antisymmetric _βΌα΅’_
βΌα΅’-is-antisymmetric {x} {y} p q =
x οΌβ¨ Ξ· x β»ΒΉ β© f (g x) οΌβ¨ ap f β β© f (g y) οΌβ¨ Ξ· y β© y β
where
β : g x οΌ g y
β = β€-is-antisymmetric (poset-of-ba Bβ) p q
πα΅’ : Y
πα΅’ = f β€[ Bβ ]
πα΅’ : Y
πα΅’ = f β₯[ Bβ ]
_βα΅’_ : Y β Y β Y
yβ βα΅’ yβ = f (g yβ β[ Bβ ] g yβ)
_βα΅’_ : Y β Y β Y
yβ βα΅’ yβ = f (g yβ β[ Bβ ] g yβ)
Β¬α΅’_ : Y β Y
Β¬α΅’ y = f (Β¬[ Bβ ] g y)
g-preserves-meets : {yβ yβ : Y} β g (yβ βα΅’ yβ) οΌ g yβ β[ Bβ ] g yβ
g-preserves-meets {yβ} {yβ} = Ξ΅ (g yβ β[ Bβ ] g yβ)
g-preserves-joins : {yβ yβ : Y} β g (yβ βα΅’ yβ) οΌ g yβ β[ Bβ ] g yβ
g-preserves-joins {yβ} {yβ} = Ξ΅ (g yβ β[ Bβ ] g yβ)
d : ba-data π₯ Y
d = _βΌα΅’_ , f β€[ Bβ ] , _βα΅’_ , f β₯[ Bβ ] , _βα΅’_ , Β¬α΅’_
open Meets (Ξ» x y β x βΌα΅’ y)
open Joins (Ξ» x y β x βΌα΅’ y)
Ο : is-partial-order Y _βΌα΅’_
Ο = (βΌα΅’-is-reflexive , βΌα΅’-is-transitive) , βΌα΅’-is-antisymmetric
Pβ : Poset π€' π₯
Pβ = Y , (_βΌα΅’_ , Ο)
πα΅’-is-top : (y : Y) β (y βΌα΅’ πα΅’) holds
πα΅’-is-top y = g y β€β¨ β€[ Bβ ]-is-top (g y) β©
β€[ Bβ ] οΌβ¨ Ξ΅ β€[ Bβ ] β»ΒΉ β©β
g (f β€[ Bβ ]) β
where
open PosetReasoning Pβ
πα΅’-is-bottom : (y : Y) β (πα΅’ βΌα΅’ y) holds
πα΅’-is-bottom y = g πα΅’ οΌβ¨ refl β©β
g (f β₯[ Bβ ]) οΌβ¨ Ξ΅ β₯[ Bβ ] β©β
β₯[ Bβ ] β€β¨ β₯[ Bβ ]-is-bottom (g y) β©
g y β
where
open PosetReasoning Pβ
βα΅’-is-glb : (yβ yβ : Y) β ((yβ βα΅’ yβ) is-glb-of (yβ , yβ)) holds
βα΅’-is-glb yβ yβ = β , β‘
where
open PosetReasoning Pβ
β β : ((yβ βα΅’ yβ) βΌα΅’ yβ) holds
β β = g (yβ βα΅’ yβ) οΌβ¨ g-preserves-meets β©β
g yβ β[ Bβ ] g yβ β€β¨ β[ Bβ ]-is-lowerβ (g yβ) (g yβ) β©
g yβ β
β β : ((yβ βα΅’ yβ) βΌα΅’ yβ) holds
β β = g (yβ βα΅’ yβ) οΌβ¨ g-preserves-meets β©β
g yβ β[ Bβ ] g yβ β€β¨ β[ Bβ ]-is-lowerβ (g yβ) (g yβ) β©
g yβ β
β : ((yβ βα΅’ yβ) is-a-lower-bound-of (yβ , yβ)) holds
β = β β , β β
β‘ : ((π , _) : lower-bound (yβ , yβ)) β (g π β€[ Pβ ] g (yβ βα΅’ yβ)) holds
β‘ (π , p , q) = g π β€β¨ β[ Bβ ]-is-greatest p q β©
g yβ β[ Bβ ] g yβ οΌβ¨ g-preserves-meets β»ΒΉ β©β
g (yβ βα΅’ yβ) β
βα΅’-is-lub : (yβ yβ : Y) β ((yβ βα΅’ yβ) is-lub-ofβ (yβ , yβ)) holds
βα΅’-is-lub yβ yβ = β , β‘
where
open PosetReasoning Pβ
β : ((yβ βα΅’ yβ) is-an-upper-bound-ofβ (yβ , yβ)) holds
β = β β , β β
where
β β : (yβ βΌα΅’ (yβ βα΅’ yβ)) holds
β β = g yβ β€β¨ β[ Bβ ]-is-upperβ (g yβ) (g yβ) β©
g yβ β[ Bβ ] g yβ οΌβ¨ g-preserves-joins β»ΒΉ β©β
g (yβ βα΅’ yβ) β
β β : (yβ βΌα΅’ (yβ βα΅’ yβ)) holds
β β = g yβ β€β¨ β[ Bβ ]-is-upperβ (g yβ) (g yβ) β©
g yβ β[ Bβ ] g yβ οΌβ¨ g-preserves-joins β»ΒΉ β©β
g (yβ βα΅’ yβ) β
β‘ : ((π , _) : upper-boundβ (yβ , yβ)) β (g (yβ βα΅’ yβ) β€[ Pβ ] g π) holds
β‘ (u , p , q) = g (yβ βα΅’ yβ) οΌβ¨ g-preserves-joins β©β
g yβ β[ Bβ ] g yβ β€β¨ β[ Bβ ]-is-least p q β©
g u β
distributivityα΅’ : (yβ yβ yβ : Y) β yβ βα΅’ (yβ βα΅’ yβ) οΌ (yβ βα΅’ yβ) βα΅’ (yβ βα΅’ yβ)
distributivityα΅’ yβ yβ yβ =
yβ βα΅’ (yβ βα΅’ yβ) οΌβ¨ refl β©
f (g yβ β[ Bβ ] g (yβ βα΅’ yβ)) οΌβ¨ β
β©
f (g yβ β[ Bβ ] (g yβ β[ Bβ ] g yβ)) οΌβ¨ β
‘ β©
f ((g yβ β[ Bβ ] g yβ) β[ Bβ ] (g yβ β[ Bβ ] g yβ)) οΌβ¨ β
’ β©
f (g (yβ βα΅’ yβ) β[ Bβ ] g (yβ βα΅’ yβ)) οΌβ¨ refl β©
(yβ βα΅’ yβ) βα΅’ (yβ βα΅’ yβ) β
where
β» = Ξ» x y β g-preserves-meets {x} {y} β»ΒΉ
β
= ap (Ξ» - β f (g yβ β[ Bβ ] -)) g-preserves-joins
β
‘ = ap f (β-distributes-over-β Bβ (g yβ) (g yβ) (g yβ))
β
’ = apβ (Ξ» a b β f (a β[ Bβ ] b)) (β» yβ yβ) (β» yβ yβ)
Ο = carrier-of-[ Pβ ]-is-set
open Complementation Ο πα΅’ πα΅’ _βα΅’_ _βα΅’_
Β¬α΅’-is-complement : (y : Y) β ((Β¬α΅’ y) complements y) holds
Β¬α΅’-is-complement y = β , β‘
where
β : f (g y β[ Bβ ] g (f (Β¬[ Bβ ] g y))) οΌ f β₯[ Bβ ]
β = f (g y β[ Bβ ] g (f (Β¬[ Bβ ] g y))) οΌβ¨ β
β©
f (g y β[ Bβ ] Β¬[ Bβ ] g y) οΌβ¨ β
‘ β©
f β₯[ Bβ ] β
where
β
= ap (Ξ» - β f (g y β[ Bβ ] -)) (Ξ΅ (Β¬[ Bβ ] g y))
β
‘ = ap f (prβ (Β¬[ Bβ ]-is-complement (g y)))
β‘ : f (g y β[ Bβ ] g (f (Β¬[ Bβ ] g y)) ) οΌ f β€[ Bβ ]
β‘ = f (g y β[ Bβ ] g (f (Β¬[ Bβ ] g y)) ) οΌβ¨ β
β©
f (g y β[ Bβ ] Β¬[ Bβ ] g y) οΌβ¨ β
‘ β©
f β€[ Bβ ] β
where
β
= ap (Ξ» - β f (g y β[ Bβ ] -)) (Ξ΅ (Β¬[ Bβ ] g y))
β
‘ = ap f (prβ (Β¬[ Bβ ]-is-complement (g y)))
β : satisfies-ba-laws d
β = Ο
, βα΅’-is-glb , πα΅’-is-top , βα΅’-is-lub , πα΅’-is-bottom
, distributivityα΅’ , Β¬α΅’-is-complement
f-is-hom : is-ba-homomorphism (X , b) (Y , d , β ) f holds
f-is-hom = refl , Ξ³ , refl , Ο΅
where
Ξ³ : (xβ xβ : X) β f (xβ β[ Bβ ] xβ) οΌ f xβ βα΅’ f xβ
Ξ³ xβ xβ = f (xβ β[ Bβ ] xβ) οΌβ¨ β
β©
f (g (f xβ) β[ Bβ ] xβ) οΌβ¨ β
‘ β©
f (g (f xβ) β[ Bβ ] g (f xβ)) οΌβ¨ β
’ β©
f (g (f xβ βα΅’ f xβ)) οΌβ¨ β
£ β©
f (g (f xβ) β[ Bβ ] g (f xβ)) οΌβ¨ refl β©
f xβ βα΅’ f xβ β
where
β
= ap (Ξ» - β f (- β[ Bβ ] xβ)) (Ξ΅ xβ β»ΒΉ)
β
‘ = ap (Ξ» - β f (g (f xβ) β[ Bβ ] -)) (Ξ΅ xβ β»ΒΉ)
β
’ = ap f g-preserves-meets β»ΒΉ
β
£ = Ξ· (f xβ βα΅’ f xβ)
Ο΅ : (xβ xβ : X) β f (xβ β[ Bβ ] xβ) οΌ f xβ βα΅’ f xβ
Ο΅ xβ xβ = f (xβ β[ Bβ ] xβ) οΌβ¨ β
β©
f (g (f xβ) β[ Bβ ] xβ) οΌβ¨ β
‘ β©
f (g (f xβ) β[ Bβ ] g (f xβ)) οΌβ¨ β
’ β©
f (g (f xβ βα΅’ f xβ)) οΌβ¨ β
£ β©
f xβ βα΅’ f xβ β
where
β
= ap (Ξ» - β f (- β[ Bβ ] xβ)) (Ξ΅ xβ β»ΒΉ)
β
‘ = ap (Ξ» - β f (g (f xβ) β[ Bβ ] -)) (Ξ΅ xβ β»ΒΉ)
β
’ = ap f (g-preserves-joins β»ΒΉ )
β
£ = Ξ· (f xβ βα΅’ f xβ)
\end{code}