Ayberk Tosun, 15 October 2021 Based on `ayberkt/formal-topology-in-UF`. \begin{code}[hide] {-# OPTIONS --safe --without-K #-} open import MLTT.Spartan open import UF.FunExt open import UF.PropTrunc module Locales.Nucleus (pt : propositional-truncations-exist) (fe : Fun-Ext) where 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 import UF.SubtypeClassifier open AllCombinators pt fe open FrameHomomorphismProperties open FrameHomomorphisms open Locale \end{code} \begin{code} is-inflationary : (L : Frame π€ π₯ π¦) β (β¨ L β© β β¨ L β©) β Ξ© (π€ β π₯) is-inflationary L j = β±― x κ β¨ L β© , x β€[ poset-of L ] j x is-idempotent : (L : Frame π€ π₯ π¦) β (β¨ L β© β β¨ L β©) β Ξ© (π€ β π₯) is-idempotent L j = β±― x κ β¨ L β© , j (j x) β€[ poset-of L ] j x is-nucleus : (L : Frame π€ π₯ π¦) β (β¨ L β© β β¨ L β©) β Ξ© (π€ β π₯) is-nucleus {π€ = π€} {π₯} {π¦} F j = πβ β§ πβ β§ πβ where open PosetNotation (poset-of F) πβ : Ξ© (π€ β π₯) πβ = is-inflationary F j πβ : Ξ© (π€ β π₯) πβ = is-idempotent F j πβ : Ξ© π€ πβ = preserves-binary-meets F F j \end{code} The type of nuclei on a given frame. \begin{code} Nucleus : Frame π€ π₯ π¦ β π€ β π₯ Μ Nucleus F = Ξ£ j κ (β¨ F β© β β¨ F β©) , is-nucleus F j holds πβ : (L : Frame π€ π₯ π¦) ((j , _) : Nucleus L) β (x : β¨ L β©) β (x β€[ poset-of L ] j x) holds πβ F (j , πβ , _ , _)= πβ πβ : (L : Frame π€ π₯ π¦) ((j , _) : Nucleus L) β (U : β¨ L β©) β (j (j U) β€[ poset-of L ] j U) holds πβ F (j , _ , πβ , _) = πβ πβ : (L : Frame π€ π₯ π¦) ((j , _) : Nucleus L) β (U V : β¨ L β©) β j (U β§[ L ] V) οΌ j U β§[ L ] j V πβ F (j , _ , _ , πβ) = πβ \end{code} \begin{code} identity-nucleus : (L : Frame π€ π₯ π¦) β Nucleus L identity-nucleus L = id , nβ , nβ , nβ where nβ : is-inflationary L id holds nβ = β€-is-reflexive (poset-of L) nβ : is-idempotent L id holds nβ = β€-is-reflexive (poset-of L) nβ : preserves-binary-meets L L id holds nβ x y = refl {x = x β§[ L ] y} \end{code} In this development, it will be useful to define and work with the notion of a prenucleus: a meet-preserving inflationary endomap (that is not necessary idempotent): \begin{code} is-prenucleus : (L : Frame π€ π₯ π¦) (j : β¨ L β© β β¨ L β©) β Ξ© (π€ β π₯) is-prenucleus L j = is-inflationary L j β§ preserves-binary-meets L L j Prenucleus : Frame π€ π₯ π¦ β (π€ β π₯) Μ Prenucleus L = Ξ£ j κ (β¨ L β© β β¨ L β©) , is-prenucleus L j holds prenucleus-eq : (F : Frame π€ π₯ π¦) (πΏ π : Prenucleus F) β ((x : β¨ F β©) β πΏ .prβ x οΌ π .prβ x) β πΏ οΌ π prenucleus-eq F πΏ π Ο = to-subtype-οΌ (Ξ» - β holds-is-prop (is-prenucleus F -)) (dfunext fe Ο) module PrenucleusApplicationSyntax (L : Frame π€ π₯ π¦) where _$β_ : Prenucleus L β β¨ L β© β β¨ L β© _$β_ = prβ infixr 2 _$β_ \end{code} Inclusion of nuclei into the type of prenuclei: \begin{code} nucleus-pre : (L : Frame π€ π₯ π¦) β Nucleus L β Prenucleus L nucleus-pre L πΏ@(j , _) = j , πβ L πΏ , πβ L πΏ \end{code} Prenuclei are monotone: \begin{code} prenuclei-are-monotone : (L : Frame π€ π₯ π¦) β ((j , _) : Prenucleus L) β is-monotonic (poset-of L) (poset-of L) j holds prenuclei-are-monotone L (j , _ , ΞΌ) = meet-preserving-implies-monotone L L j ΞΌ \end{code} As a corollary, nuclei are monotone: \begin{code} nuclei-are-monotone : (L : Frame π€ π₯ π¦) ((j , _) : Nucleus L) β is-monotonic (poset-of L) (poset-of L) j holds nuclei-are-monotone L πΏ = prenuclei-are-monotone L (nucleus-pre L πΏ) nuclei-are-idempotent : (L : Frame π€ π₯ π¦) ((j , _) : Nucleus L) β (x : β¨ L β©) β j (j x) οΌ j x nuclei-are-idempotent L πΏ@(j , _) x = β€-is-antisymmetric (poset-of L) Ξ² Ξ³ where Ξ² : (j (j x) β€[ poset-of L ] j x) holds Ξ² = πβ L πΏ x Ξ³ : (j x β€[ poset-of L ] j (j x)) holds Ξ³ = πβ L πΏ (j x) \end{code} \begin{code} prenucleus-propertyβ : (L : Frame π€ π₯ π¦) β ((j , _) (k , _) : Prenucleus L) β (β±― x κ β¨ L β© , j x β€[ poset-of L ] (j β k) x) holds prenucleus-propertyβ L (j , _ , ΞΌj) (k , ΞΆ , _) x = meet-preserving-implies-monotone L L j ΞΌj (x , k x) (ΞΆ x) prenucleus-propertyβ : (L : Frame π€ π₯ π¦) β ((j , _) (k , _) : Prenucleus L) β (β±― x κ β¨ L β© , k x β€[ poset-of L ] (j β k) x) holds prenucleus-propertyβ L (j , ΞΆj , _) (k , _) x = ΞΆj (k x) \end{code} \section{Closed nucleus} \begin{code} β¨-is-inflationary : (L : Frame π€ π₯ π¦) β (x : β¨ L β©) β is-inflationary L (binary-join L x) holds β¨-is-inflationary L = β¨[ L ]-upperβ β¨-is-idempotent : (L : Frame π€ π₯ π¦) β (x : β¨ L β©) β is-idempotent L (binary-join L x) holds β¨-is-idempotent L x y = β¨[ L ]-least (β¨[ L ]-upperβ x y) (β€-is-reflexive (poset-of L) (x β¨[ L ] y) ) β¨-preserves-binary-meets : (L : Frame π€ π₯ π¦) (x : β¨ L β©) β preserves-binary-meets L L (binary-join L x) holds β¨-preserves-binary-meets L x yβ yβ = x β¨[ L ] (yβ β§[ L ] yβ) οΌβ¨ binary-distributivity-op L x yβ yβ β© (x β¨[ L ] yβ) β§[ L ] (x β¨[ L ] yβ) β β¨-is-nucleus : (L : Frame π€ π₯ π¦) β (x : β¨ L β©) β is-nucleus L (binary-join L x) holds β¨-is-nucleus L x = β¨-is-inflationary L x , β¨-is-idempotent L x , β¨-preserves-binary-meets L x closed-nucleus : (X : Locale π€ π₯ π¦) (U : β¨ πͺ X β©) β Nucleus (πͺ X) closed-nucleus X U = (Ξ» - β U β¨[ πͺ X ] -) , β¨-is-nucleus (πͺ X) U \end{code} \begin{code} open import Locales.HeytingImplication pt fe open Locale module NucleusHeytingImplicationLaw (X : Locale π€ π₯ π₯) (π· : has-basis (πͺ X) holds) (πΏ : Nucleus (πͺ X)) where open HeytingImplicationConstruction X π· private j = prβ πΏ nucleus-heyting-implication-law : (U V : β¨ πͺ X β©) β (U ==> j V) οΌ j U ==> j V nucleus-heyting-implication-law U V = β€-is-antisymmetric (poset-of (πͺ X)) β β‘ where open PosetReasoning (poset-of (πͺ X)) β£ : (((U ==> j V) β§[ πͺ X ] j U) β€[ poset-of (πͺ X) ] j V) holds β£ = (U ==> j V) β§[ πͺ X ] j U β€β¨ β β© j (U ==> j V) β§[ πͺ X ] j U οΌβ¨ β ‘ β©β j ((U ==> j V) β§[ πͺ X ] U) β€β¨ β ’ β© j (j V) β€β¨ β £ β© j V β where β = β§[ πͺ X ]-left-monotone (πβ (πͺ X) πΏ (U ==> j V)) β ‘ = πβ (πͺ X) πΏ (U ==> j V) U β»ΒΉ β ’ = nuclei-are-monotone (πͺ X) πΏ (_ , _) (mp-right U (j V)) β £ = πβ (πͺ X) πΏ V β₯ = (j U ==> j V) β§[ πͺ X ] U β€β¨ β β© (j U ==> j V) β§[ πͺ X ] j U β€β¨ β ‘ β© j V β where β = β§[ πͺ X ]-right-monotone (πβ (πͺ X) πΏ U) β ‘ = mp-right (j U) (j V) β : ((U ==> j V) β€[ poset-of (πͺ X) ] (j U ==> j V)) holds β = heyting-implicationβ (j U) (j V) (U ==> j V) β£ β‘ : ((j U ==> j V) β€[ poset-of (πͺ X) ] (U ==> j V)) holds β‘ = heyting-implicationβ U (j V) (j U ==> j V) β₯ \end{code}