diff --git a/source/DomainTheory/Basics/Exponential.lagda b/source/DomainTheory/Basics/Exponential.lagda index 89f664e3c..2aea8e020 100644 --- a/source/DomainTheory/Basics/Exponential.lagda +++ b/source/DomainTheory/Basics/Exponential.lagda @@ -197,7 +197,7 @@ DCPO-∘-is-continuous₁ 𝓓 𝓔 𝓔' f I Ξ± Ξ΄ = Ξ² : I β†’ ⟨ 𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔' ⟩ Ξ² i = DCPO-∘ 𝓓 𝓔 𝓔' f (Ξ± i) Ξ΅ : is-Directed (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') Ξ² - Ξ΅ = image-is-directed (𝓔 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {DCPO-∘ 𝓓 𝓔 𝓔' f} + Ξ΅ = image-is-Directed (𝓔 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {DCPO-∘ 𝓓 𝓔 𝓔' f} (DCPO-∘-is-monotone₁ 𝓓 𝓔 𝓔' f) {I} {Ξ±} Ξ΄ Ξ³ : DCPO-∘ 𝓓 𝓔 𝓔' f (∐ (𝓔 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {I} {Ξ±} Ξ΄) = ∐ (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {I} {Ξ²} Ξ΅ Ξ³ = to-continuous-function-= 𝓓 𝓔' ψ @@ -229,7 +229,7 @@ DCPO-∘-is-continuousβ‚‚ 𝓓 𝓔 𝓔' g I Ξ± Ξ΄ = Ξ² : I β†’ ⟨ 𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔' ⟩ Ξ² i = DCPO-∘ 𝓓 𝓔 𝓔' (Ξ± i) g Ξ΅ : is-Directed (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') Ξ² - Ξ΅ = image-is-directed (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔) (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {Ξ» f β†’ DCPO-∘ 𝓓 𝓔 𝓔' f g} + Ξ΅ = image-is-Directed (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔) (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {Ξ» f β†’ DCPO-∘ 𝓓 𝓔 𝓔' f g} (DCPO-∘-is-monotoneβ‚‚ 𝓓 𝓔 𝓔' g) {I} {Ξ±} Ξ΄ Ξ³ : DCPO-∘ 𝓓 𝓔 𝓔' (∐ (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔) {I} {Ξ±} Ξ΄) g = ∐ (𝓓 βŸΉα΅ˆαΆœα΅–α΅’ 𝓔') {I} {Ξ²} Ξ΅ Ξ³ = to-continuous-function-= 𝓓 𝓔' ψ diff --git a/source/DomainTheory/Basics/Miscelanea.lagda b/source/DomainTheory/Basics/Miscelanea.lagda index 21aead04b..92af33865 100644 --- a/source/DomainTheory/Basics/Miscelanea.lagda +++ b/source/DomainTheory/Basics/Miscelanea.lagda @@ -98,19 +98,28 @@ Lemmas for establishing Scott continuity of maps between dcpos. \begin{code} -image-is-directed : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) +image-is-directed : {D : 𝓀 Μ‡} {E : 𝓀' Μ‡} + β†’ (_βŠ‘_ : D β†’ D β†’ 𝓣 Μ‡ ) (_≀_ : E β†’ E β†’ 𝓣' Μ‡ ) + β†’ {f : D β†’ E} β†’ ((x y : D) β†’ x βŠ‘ y β†’ f x ≀ f y) + β†’ {I : π“₯ Μ‡ } β†’ {Ξ± : I β†’ D} + β†’ is-directed _βŠ‘_ Ξ± + β†’ is-directed _≀_ (f ∘ Ξ±) +image-is-directed _βŠ‘_ _≀_ {f} m {I} {Ξ±} Ξ΄ = + inhabited-if-directed _βŠ‘_ Ξ± Ξ΄ , Ξ³ + where + Ξ³ : is-semidirected _≀_ (f ∘ Ξ±) + Ξ³ i j = βˆ₯βˆ₯-functor (Ξ» (k , u , v) β†’ k , m (Ξ± i) (Ξ± k) u , m (Ξ± j) (Ξ± k) v) + (semidirected-if-directed _βŠ‘_ Ξ± Ξ΄ i j) + +image-is-Directed : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) {f : ⟨ 𝓓 ⟩ β†’ ⟨ 𝓔 ⟩} β†’ is-monotone 𝓓 𝓔 f β†’ {I : π“₯ Μ‡ } β†’ {Ξ± : I β†’ ⟨ 𝓓 ⟩} β†’ is-Directed 𝓓 Ξ± β†’ is-Directed 𝓔 (f ∘ Ξ±) -image-is-directed 𝓓 𝓔 {f} m {I} {Ξ±} Ξ΄ = - inhabited-if-Directed 𝓓 Ξ± Ξ΄ , Ξ³ - where - Ξ³ : is-semidirected (underlying-order 𝓔) (f ∘ Ξ±) - Ξ³ i j = βˆ₯βˆ₯-functor (Ξ» (k , u , v) β†’ k , m (Ξ± i) (Ξ± k) u , m (Ξ± j) (Ξ± k) v) - (semidirected-if-Directed 𝓓 Ξ± Ξ΄ i j) +image-is-Directed 𝓓 𝓔 m Ξ΄ = + image-is-directed (underlying-order 𝓓) (underlying-order 𝓔) m Ξ΄ continuity-criterion : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) (f : ⟨ 𝓓 ⟩ β†’ ⟨ 𝓔 ⟩) @@ -118,14 +127,14 @@ continuity-criterion : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) β†’ ((I : π“₯ Μ‡ ) (Ξ± : I β†’ ⟨ 𝓓 ⟩) (Ξ΄ : is-Directed 𝓓 Ξ±) - β†’ f (∐ 𝓓 Ξ΄) βŠ‘βŸ¨ 𝓔 ⟩ ∐ 𝓔 (image-is-directed 𝓓 𝓔 m Ξ΄)) + β†’ f (∐ 𝓓 Ξ΄) βŠ‘βŸ¨ 𝓔 ⟩ ∐ 𝓔 (image-is-Directed 𝓓 𝓔 m Ξ΄)) β†’ is-continuous 𝓓 𝓔 f continuity-criterion 𝓓 𝓔 f m e I Ξ± Ξ΄ = ub , lb-of-ubs where ub : (i : I) β†’ f (Ξ± i) βŠ‘βŸ¨ 𝓔 ⟩ f (∐ 𝓓 Ξ΄) ub i = m (Ξ± i) (∐ 𝓓 Ξ΄) (∐-is-upperbound 𝓓 Ξ΄ i) Ξ΅ : is-Directed 𝓔 (f ∘ Ξ±) - Ξ΅ = image-is-directed 𝓓 𝓔 m Ξ΄ + Ξ΅ = image-is-Directed 𝓓 𝓔 m Ξ΄ lb-of-ubs : is-lowerbound-of-upperbounds (underlying-order 𝓔) (f (∐ 𝓓 Ξ΄)) (f ∘ Ξ±) lb-of-ubs y u = f (∐ 𝓓 Ξ΄) βŠ‘βŸ¨ 𝓔 ⟩[ e I Ξ± Ξ΄ ] @@ -180,7 +189,7 @@ image-is-directed' : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) (f : DCPO[ 𝓓 , 𝓔 ]) {I : π“₯ Μ‡ } {Ξ± : I β†’ ⟨ 𝓓 ⟩} β†’ is-Directed 𝓓 Ξ± β†’ is-Directed 𝓔 ([ 𝓓 , 𝓔 ]⟨ f ⟩ ∘ Ξ±) -image-is-directed' 𝓓 𝓔 f {I} {Ξ±} Ξ΄ = image-is-directed 𝓓 𝓔 m Ξ΄ +image-is-directed' 𝓓 𝓔 f {I} {Ξ±} Ξ΄ = image-is-Directed 𝓓 𝓔 m Ξ΄ where m : is-monotone 𝓓 𝓔 [ 𝓓 , 𝓔 ]⟨ f ⟩ m = monotone-if-continuous 𝓓 𝓔 f @@ -244,10 +253,10 @@ id-is-monotone 𝓓 x y l = l id-is-continuous : (𝓓 : DCPO {𝓀} {𝓣}) β†’ is-continuous 𝓓 𝓓 id id-is-continuous 𝓓 = continuity-criterion 𝓓 𝓓 id (id-is-monotone 𝓓) Ξ³ where - Ξ³ : (I : π“₯ Μ‡ )(Ξ± : I β†’ ⟨ 𝓓 ⟩) (Ξ΄ : is-Directed 𝓓 Ξ±) - β†’ ∐ 𝓓 Ξ΄ βŠ‘βŸ¨ 𝓓 ⟩ ∐ 𝓓 (image-is-directed 𝓓 𝓓 (Ξ» x y l β†’ l) Ξ΄) + Ξ³ : (I : π“₯ Μ‡ ) (Ξ± : I β†’ ⟨ 𝓓 ⟩) (Ξ΄ : is-Directed 𝓓 Ξ±) + β†’ ∐ 𝓓 Ξ΄ βŠ‘βŸ¨ 𝓓 ⟩ ∐ 𝓓 (image-is-Directed 𝓓 𝓓 (Ξ» x y l β†’ l) Ξ΄) Ξ³ I Ξ± Ξ΄ = =-to-βŠ‘ 𝓓 (∐-independent-of-directedness-witness 𝓓 - Ξ΄ (image-is-directed 𝓓 𝓓 (Ξ» x y l β†’ l) Ξ΄)) + Ξ΄ (image-is-Directed 𝓓 𝓓 (Ξ» x y l β†’ l) Ξ΄)) ∘-is-continuous : (𝓓 : DCPO {𝓀} {𝓣}) (𝓔 : DCPO {𝓀'} {𝓣'}) (𝓔' : DCPO {𝓦} {𝓦'}) (f : ⟨ 𝓓 ⟩ β†’ ⟨ 𝓔 ⟩) (g : ⟨ 𝓔 ⟩ β†’ ⟨ 𝓔' ⟩) @@ -262,15 +271,15 @@ id-is-continuous 𝓓 = continuity-criterion 𝓓 𝓓 id (id-is-monotone 𝓓) mg = monotone-if-continuous 𝓔 𝓔' (g , cg) m : is-monotone 𝓓 𝓔' (g ∘ f) m x y l = mg (f x) (f y) (mf x y l) - ψ : (I : π“₯ Μ‡ )(Ξ± : I β†’ ⟨ 𝓓 ⟩) (Ξ΄ : is-Directed 𝓓 Ξ±) - β†’ g (f (∐ 𝓓 Ξ΄)) βŠ‘βŸ¨ 𝓔' ⟩ ∐ 𝓔' (image-is-directed 𝓓 𝓔' m Ξ΄) + ψ : (I : π“₯ Μ‡ ) (Ξ± : I β†’ ⟨ 𝓓 ⟩) (Ξ΄ : is-Directed 𝓓 Ξ±) + β†’ g (f (∐ 𝓓 Ξ΄)) βŠ‘βŸ¨ 𝓔' ⟩ ∐ 𝓔' (image-is-Directed 𝓓 𝓔' m Ξ΄) ψ I Ξ± Ξ΄ = g (f (∐ 𝓓 Ξ΄)) βŠ‘βŸ¨ 𝓔' ⟩[ l₁ ] g (∐ 𝓔 Ξ΅f) βŠ‘βŸ¨ 𝓔' ⟩[ lβ‚‚ ] ∐ 𝓔' Ξ΅g βŠ‘βŸ¨ 𝓔' ⟩[ l₃ ] ∐ 𝓔' Ξ΅ ∎⟨ 𝓔' ⟩ where Ξ΅ : is-Directed 𝓔' (g ∘ f ∘ Ξ±) - Ξ΅ = image-is-directed 𝓓 𝓔' m Ξ΄ + Ξ΅ = image-is-Directed 𝓓 𝓔' m Ξ΄ Ξ΅f : is-Directed 𝓔 (f ∘ Ξ±) Ξ΅f = image-is-directed' 𝓓 𝓔 (f , cf) Ξ΄ Ξ΅g : is-Directed 𝓔' (g ∘ f ∘ Ξ±) diff --git a/source/DomainTheory/Lifting/LiftingDcpo.lagda b/source/DomainTheory/Lifting/LiftingDcpo.lagda index 0bb0fd711..baa6e11a3 100644 --- a/source/DomainTheory/Lifting/LiftingDcpo.lagda +++ b/source/DomainTheory/Lifting/LiftingDcpo.lagda @@ -240,14 +240,14 @@ dcpo. where Ξ³ : (I : π“₯ Μ‡ )(Ξ± : I β†’ ⟨ 𝓛-DCPO ⟩) (Ξ΄ : is-Directed 𝓛-DCPO Ξ±) β†’ fΜƒ (∐ 𝓛-DCPO {I} {Ξ±} Ξ΄) βŠ‘βŸͺ 𝓔 ⟫ - ∐ (𝓔 ⁻) (image-is-directed 𝓛-DCPO (𝓔 ⁻) fΜƒ-is-monotone {I} {Ξ±} Ξ΄) + ∐ (𝓔 ⁻) (image-is-Directed 𝓛-DCPO (𝓔 ⁻) fΜƒ-is-monotone {I} {Ξ±} Ξ΄) Ξ³ I Ξ± Ξ΄ = ∐˒˒-is-lowerbound-of-upperbounds 𝓔 (f ∘ value s) (being-defined-is-prop s) (∐ (𝓔 ⁻) Ξ΅) lem where s : ⟨ 𝓛-DCPO ⟩ s = ∐ 𝓛-DCPO {I} {Ξ±} Ξ΄ Ξ΅ : is-Directed (𝓔 ⁻) (fΜƒ ∘ Ξ±) - Ξ΅ = image-is-directed 𝓛-DCPO (𝓔 ⁻) fΜƒ-is-monotone {I} {Ξ±} Ξ΄ + Ξ΅ = image-is-Directed 𝓛-DCPO (𝓔 ⁻) fΜƒ-is-monotone {I} {Ξ±} Ξ΄ lem : (q : is-defined s) β†’ f (value s q) βŠ‘βŸͺ 𝓔 ⟫ ∐ (𝓔 ⁻) Ξ΅ lem q = f (value s q) βŠ‘βŸͺ 𝓔 ⟫[ β¦…1⦆ ] f (∐ 𝓓 Ξ΄') βŠ‘βŸͺ 𝓔 ⟫[ β¦…2⦆ ] diff --git a/source/DomainTheory/Presentation/C-Ideal.lagda b/source/DomainTheory/Presentation/C-Ideal.lagda new file mode 100644 index 000000000..d550cae9e --- /dev/null +++ b/source/DomainTheory/Presentation/C-Ideal.lagda @@ -0,0 +1,174 @@ + + +\begin{code} +{-# OPTIONS --without-K --exact-split --safe --auto-inline #-} +open import MLTT.Spartan hiding (J) + +open import UF.Base +open import UF.FunExt +open import UF.PropTrunc +open import UF.Subsingletons +open import UF.Subsingletons-FunExt + +module DomainTheory.Presentation.C-Ideal + (pt : propositional-truncations-exist) + (fe : Fun-Ext) + (pe : Prop-Ext) + {𝓀 𝓣 π“₯ 𝓦 : Universe} + where + +open import UF.Retracts +open import UF.Powerset +open PropositionalTruncation pt +open import UF.ImageAndSurjection pt +open import Posets.Poset fe +open PosetAxioms +open import Posets.FreeSupLattice pt using (SupLattice) + +open import DomainTheory.Basics.Dcpo pt fe π“₯ +open import DomainTheory.Basics.Miscelanea pt fe π“₯ +open import DomainTheory.Presentation.Type pt fe {𝓀} {𝓣} {π“₯} {𝓦} + + +-- TODO put this at the right place +Conjunction : (I : 𝓀' Μ‡) β†’ (I β†’ Ξ© π“₯') β†’ Ξ© (𝓀' βŠ” π“₯') +pr₁ (Conjunction I ps) = βˆ€ i β†’ ps i holds +prβ‚‚ (Conjunction I ps) = Ξ -is-prop fe Ξ» _ β†’ holds-is-prop (ps _) + +syntax Conjunction I (Ξ» i β†’ p) = β‹€ i κž‰ I , p + +module C-Ideal + (G : 𝓀 Μ‡) + (_≲_ : G β†’ G β†’ 𝓣 Μ‡) + (_β—ƒ_ : Cover-set G _≲_) + where + + is-C-ideal : (G β†’ Ξ© 𝓣') β†’ 𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 βŠ” 𝓣 βŠ” 𝓣' Μ‡ + is-C-ideal β„‘ = downward-closed Γ— cover-closed + where + downward-closed = βˆ€ x y β†’ x ≲ y + β†’ y ∈ β„‘ β†’ x ∈ β„‘ + cover-closed = βˆ€ I x (U : I β†’ G) β†’ (x β—ƒ U) holds + β†’ (βˆ€ y β†’ y ∈image U β†’ y ∈ β„‘) + β†’ x ∈ β„‘ + + being-C-ideal-is-prop : (β„‘ : G β†’ Ξ© 𝓣') β†’ is-prop (is-C-ideal β„‘) + being-C-ideal-is-prop β„‘ = + Γ—-is-prop + (Ξ β‚„-is-prop fe Ξ» _ _ _ _ β†’ ∈-is-prop β„‘ _) + (Ξ β‚…-is-prop fe Ξ» _ _ _ _ _ β†’ ∈-is-prop β„‘ _) + + intersection-is-C-ideal + : {I : π“₯' Μ‡} (β„‘s : I β†’ G β†’ Ξ© 𝓣') + β†’ (βˆ€ i β†’ is-C-ideal (β„‘s i)) + β†’ is-C-ideal Ξ» g β†’ β‹€ i κž‰ _ , β„‘s i g + intersection-is-C-ideal β„‘s ΞΉs = dc , cc + where + dc = Ξ» x y x≲y xβˆˆβ„‘s i β†’ pr₁ (ΞΉs i) x y x≲y (xβˆˆβ„‘s i) + cc = Ξ» J g U gβ—ƒU c i β†’ prβ‚‚ (ΞΉs i) J g U gβ—ƒU Ξ» g' g'∈U β†’ c g' g'∈U i + + C-Idl : βˆ€ 𝓣' β†’ 𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 βŠ” 𝓣 βŠ” 𝓣' ⁺ Μ‡ + C-Idl 𝓣' = Ξ£ (is-C-ideal {𝓣' = 𝓣'}) + + module _ {𝓣' : Universe} where + carrier : C-Idl 𝓣' β†’ G β†’ Ξ© 𝓣' + carrier (β„‘ , _) = β„‘ + + C-ideality : (π“˜ : C-Idl 𝓣') β†’ is-C-ideal (carrier π“˜) + C-ideality (_ , ΞΉ) = ΞΉ + + _βŠ‘_ : C-Idl 𝓣' β†’ C-Idl 𝓣' β†’ 𝓀 βŠ” 𝓣' Μ‡ + (β„‘ , _) βŠ‘ (𝔍 , _) = β„‘ βŠ† 𝔍 + + -- Characterize the equality of C-ideals + to-C-ideal-= : (I J : C-Idl 𝓣') β†’ carrier I = carrier J β†’ I = J + to-C-ideal-= (β„‘ , _) (𝔍 , Ο…) p = to-Ξ£-= + (p , being-C-ideal-is-prop 𝔍 _ _) + + -- The impredicatively generated C-ideal from a set + Generated : βˆ€ 𝓣' β†’ (G β†’ Ξ© π“₯') β†’ C-Idl (𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 βŠ” 𝓣 βŠ” π“₯' βŠ” 𝓣' ⁺) + Generated 𝓣' S = (Ξ» g β†’ β‹€ ((β„‘ , _) , _) κž‰ -- Too messy + (Ξ£ (β„‘ , _) κž‰ C-Idl 𝓣' , S βŠ† β„‘), β„‘ g) , + intersection-is-C-ideal (pr₁ ∘ pr₁) (prβ‚‚ ∘ pr₁) + + Generated-contains : (S : G β†’ Ξ© π“₯') β†’ S βŠ† carrier (Generated 𝓣' S) + Generated-contains S g g∈S ((β„‘ , ΞΉ), SβŠ†β„‘) = SβŠ†β„‘ g g∈S + + -- Universal property + private module SL = SupLattice + + -- C-Ideals form a suplattice + -- TODO clean up fe and pe assumptions + C-Idl-SupLattice : βˆ€ 𝓣' 𝓦' β†’ SupLattice 𝓦' _ _ + SL.L (C-Idl-SupLattice 𝓣' 𝓦') = + C-Idl (𝓀 βŠ” 𝓣 βŠ” (π“₯ ⁺) βŠ” 𝓦 βŠ” (𝓣' ⁺) βŠ” 𝓦') + + SL.L-is-set (C-Idl-SupLattice 𝓣' 𝓦') = + Ξ£-is-set (Ξ -is-set fe Ξ» _ β†’ Ξ©-is-set fe pe) Ξ» β„‘ β†’ + props-are-sets (being-C-ideal-is-prop β„‘) + + SL._βŠ‘_ (C-Idl-SupLattice 𝓣' 𝓦') (β„‘ , ΞΉ) (𝔍 , Ο…) = + β„‘ βŠ† 𝔍 + + SL.βŠ‘-is-prop-valued (C-Idl-SupLattice 𝓣' 𝓦') _ 𝔍 = + Ξ β‚‚-is-prop fe Ξ» g _ β†’ holds-is-prop (carrier 𝔍 g) + + SL.βŠ‘-is-reflexive (C-Idl-SupLattice 𝓣' 𝓦') _ _ = + id + + SL.βŠ‘-is-transitive (C-Idl-SupLattice 𝓣' 𝓦') _ _ _ β„‘βŠ†π” π”βŠ†π”Ž u iβˆˆβ„‘ = + π”βŠ†π”Ž u (β„‘βŠ†π” u iβˆˆβ„‘) + + SL.βŠ‘-is-antisymmetric (C-Idl-SupLattice 𝓣' 𝓦') (β„‘ , ΞΉ) (𝔍 , Ο…) β„‘βŠ†π” π”βŠ†β„‘ = + to-C-ideal-= _ _ (dfunext fe (Ξ» g β†’ to-Ξ£-= + (pe (prβ‚‚ (β„‘ g)) (prβ‚‚ (𝔍 g)) (β„‘βŠ†π” g) (π”βŠ†β„‘ g) , + being-prop-is-prop fe _ _))) + -- This needs to-Ξ©-= somewhere in the library + + SL.⋁ (C-Idl-SupLattice 𝓣' 𝓦') β„‘s = + Generated 𝓣' Ξ» g β†’ + (βˆƒ i κž‰ _ , g ∈ carrier (β„‘s i)) , βˆƒ-is-prop + + SL.⋁-is-upperbound (C-Idl-SupLattice 𝓣' 𝓦') I i g g∈Ii ((𝔍 , _ , _) , β„‘βŠ†π”) = + β„‘βŠ†π” g ∣ i , g∈Ii ∣ + + SL.⋁-is-lowerbound-of-upperbounds (C-Idl-SupLattice 𝓣' 𝓦') + I (𝔍 , Ο…) IiβŠ†π” g g∈SupI = 𝔍'→𝔍 g (g∈SupI ((𝔍' , Ο…') , + Ξ» g β†’ βˆ₯βˆ₯-rec (holds-is-prop (𝔍' g)) Ξ» (i , e) β†’ 𝔍→𝔍' g (IiβŠ†π” i g e))) + where + 𝔍' : G β†’ Ξ© 𝓣' + 𝔍' = {! !} -- requires resizing + + 𝔍'→𝔍 : βˆ€ g β†’ 𝔍' g holds β†’ 𝔍 g holds + 𝔍'→𝔍 = {! !} + + 𝔍→𝔍' : βˆ€ g β†’ 𝔍 g holds β†’ 𝔍' g holds + 𝔍→𝔍' = {! !} + + Ο…' : is-C-ideal 𝔍' + Ο…' = {! !} -- deducible from propositional equivalence + + module _ (G-is-set : is-set G) where + -- The map from G to C-Idl + Ξ· : βˆ€ 𝓣' β†’ G β†’ C-Idl (𝓀 βŠ” 𝓣 βŠ” (π“₯ ⁺) βŠ” 𝓦 βŠ” (𝓣' ⁺)) + Ξ· 𝓣' g = Generated 𝓣' Ξ» g' β†’ (g = g') , G-is-set + + -- it is monotone + Ξ·-is-monotone : βˆ€ g g' β†’ g ≲ g' + β†’ carrier (Ξ· 𝓣' g) βŠ† carrier (Ξ· 𝓣' g') + Ξ·-is-monotone {𝓣' = 𝓣'} g g' g≲g' h h∈ηg ((𝔍 , Ο…) , ⟨g'βŸ©βŠ†π”) + = h∈ηg ((𝔍 , Ο…) , Ξ» { .g refl β†’ gβˆˆπ” }) + where + g'βˆˆπ” : g' ∈ 𝔍 + g'βˆˆπ” = ⟨g'βŸ©βŠ†π” g' refl + + gβˆˆπ” : g ∈ 𝔍 + gβˆˆπ” = Ο… .pr₁ g g' g≲g' g'βˆˆπ” + + -- it preserves covers + open Interpretation + + -- Every monotone map from G to a suplattice S preserving covers + -- factors uniquely through Ξ· + +\end{code} diff --git a/source/DomainTheory/Presentation/Type.lagda b/source/DomainTheory/Presentation/Type.lagda new file mode 100644 index 000000000..9ad0ab2bb --- /dev/null +++ b/source/DomainTheory/Presentation/Type.lagda @@ -0,0 +1,77 @@ +(...) + +\begin{code} +{-# OPTIONS --without-K --exact-split --safe --auto-inline #-} +open import MLTT.Spartan hiding (J) + +open import UF.FunExt +open import UF.PropTrunc +open import UF.Subsingletons + +module DomainTheory.Presentation.Type + (pt : propositional-truncations-exist) + (fe : Fun-Ext) + {𝓀 𝓣 π“₯ 𝓦 : Universe} + -- 𝓀 : the universe of the underlying set + -- 𝓣 : the universe of the preorder + -- π“₯ : the universe of the indices of directed sets + -- 𝓦 : the universe of covering sets + where + +open import UF.Powerset +open import Posets.Poset fe +open PosetAxioms + +open import DomainTheory.Basics.Dcpo pt fe π“₯ +open import DomainTheory.Basics.Miscelanea pt fe π“₯ + +module _ + (G : 𝓀 Μ‡) -- Generators + (_≲_ : G β†’ G β†’ 𝓣 Μ‡) + where + + Cover-set : 𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 ⁺ Μ‡ -- This one has spurious assumptions + Cover-set = G β†’ {I : π“₯ Μ‡} β†’ (I β†’ G) β†’ Ξ© 𝓦 + + is-dcpo-presentation : Cover-set β†’ 𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 βŠ” 𝓣 Μ‡ + is-dcpo-presentation _β—ƒ_ = (≲-prop-valued Γ— ≲-reflexive Γ— ≲-transitive) Γ— Cover-directed + where + ≲-prop-valued = {x y : G} β†’ is-prop (x ≲ y) + ≲-reflexive = {x : G} β†’ x ≲ x + ≲-transitive = {x y z : G} β†’ x ≲ y β†’ y ≲ z β†’ x ≲ z + Cover-directed = {x : G} {I : π“₯ Μ‡} {U : I β†’ G} β†’ (x β—ƒ U) holds β†’ is-directed _≲_ U + +DCPO-Presentation : (𝓀 βŠ” π“₯ βŠ” 𝓦 βŠ” 𝓣)⁺ Μ‡ +DCPO-Presentation = + Ξ£ G κž‰ 𝓀 Μ‡ , + Ξ£ _βŠ‘_ κž‰ (G β†’ G β†’ 𝓣 Μ‡) , + Ξ£ _β—ƒ_ κž‰ (Cover-set G _βŠ‘_) , + (is-dcpo-presentation G _βŠ‘_ _β—ƒ_) + +module _ (𝓖 : DCPO-Presentation) where + ⟨_βŸ©β‚š : 𝓀 Μ‡ -- We need a uniform way to refer to underlying sets + ⟨_βŸ©β‚š = 𝓖 .pr₁ + + underlying-preorder = 𝓖 .prβ‚‚ .pr₁ + + cover-set = 𝓖 .prβ‚‚ .prβ‚‚ .pr₁ -- better syntax? + + cover-directed = 𝓖 .prβ‚‚ .prβ‚‚ .prβ‚‚ .prβ‚‚ + +-- Defines maps from a presentation into dcpos +module Interpretation (𝓖 : DCPO-Presentation) (𝓓 : DCPO {𝓀} {𝓣}) where + private + _≀_ = underlying-order 𝓓 + _≲_ = underlying-preorder 𝓖 + _β—ƒ_ = cover-set 𝓖 + + preserves-covers + : (f : ⟨ 𝓖 βŸ©β‚š β†’ ⟨ 𝓓 ⟩) + β†’ ((x y : ⟨ 𝓖 βŸ©β‚š) β†’ x ≲ y β†’ f x ≀ f y) + β†’ 𝓀 βŠ” π“₯ ⁺ βŠ” 𝓦 βŠ” 𝓣 Μ‡ + preserves-covers f m = + {x : ⟨ 𝓖 βŸ©β‚š} {I : π“₯ Μ‡} {U : I β†’ ⟨ 𝓖 βŸ©β‚š} + β†’ (c : (x β—ƒ U) holds) + β†’ f x ≀ ∐ 𝓓 (image-is-directed _≲_ _≀_ m (cover-directed 𝓖 c)) + +\end{code} diff --git a/source/Posets/Closure.lagda b/source/Posets/Closure.lagda new file mode 100644 index 000000000..534afcaf1 --- /dev/null +++ b/source/Posets/Closure.lagda @@ -0,0 +1,60 @@ +We define closure operators on a poset as a monotone increasing function 𝑓 +such that 𝑓(π‘₯) β‰₯ π‘₯ and 𝑓(𝑓(π‘₯)) = 𝑓(π‘₯). + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe --auto-inline #-} + +open import MLTT.Spartan +open import UF.FunExt +open import UF.PropTrunc +open import UF.Subsingletons +open import UF.Subsingletons-FunExt + +module Posets.Closure + (fe : Fun-Ext) + (pt : propositional-truncations-exist) + where +open import Posets.Poset fe + +module Closure + {D : 𝓀 Μ‡ } + (_βŠ‘_ : D β†’ D β†’ 𝓣 Μ‡ ) + (f : D β†’ D) + where + closure-Ξ· = βˆ€ x β†’ x βŠ‘ f x + closure-ΞΌ = βˆ€ x β†’ f (f x) βŠ‘ f x + + open PosetAxioms _βŠ‘_ -- TODO bundle more things + + idempotent + : closure-Ξ· + β†’ closure-ΞΌ + β†’ is-antisymmetric + β†’ βˆ€ x β†’ f (f x) = f x + idempotent Ξ· ΞΌ a x = a _ _ (ΞΌ _) (Ξ· _) +\end{code} + + +If we have a closure operator on a suplattice, then the image is +also a suplattice. + +\begin{code} +open import Posets.FreeSupLattice pt +-- TODO we don't want the "free" part, factor the definition out +module _ (𝕃 : SupLattice 𝓀 π“₯ 𝓦) where + private module 𝕃 = SupLattice 𝕃 + open Closure 𝕃._βŠ‘_ + + module SupLattice-Closure + {D : 𝓀 Μ‡ } + (_βŠ‘_ : D β†’ D β†’ 𝓣 Μ‡ ) + (f : 𝕃.L β†’ D) + (f-is-monotone : βˆ€ x y β†’ x 𝕃.βŠ‘ y β†’ f x βŠ‘ f y) + (ΞΉ : D β†’ 𝕃.L) + (ΞΉ-is-monotome : βˆ€ x y β†’ x βŠ‘ y β†’ ΞΉ x 𝕃.βŠ‘ ΞΉ y) + (ι∘f-closure-Ξ· : closure-Ξ· (ΞΉ ∘ f)) + (ι∘f-closure-ΞΌ : closure-ΞΌ (ΞΉ ∘ f)) where + + +\end{code} diff --git a/source/Posets/FreeSupLattice.lagda b/source/Posets/FreeSupLattice.lagda index 57d6bb6c3..d6a38faf1 100644 --- a/source/Posets/FreeSupLattice.lagda +++ b/source/Posets/FreeSupLattice.lagda @@ -28,7 +28,7 @@ and syntax for reasoning about the order βŠ‘. \begin{code} -record SupLattice (π“₯ 𝓀 𝓣 : Universe) : 𝓀ω where +record SupLattice (π“₯ 𝓀 𝓣 : Universe) : π“₯ ⁺ βŠ” 𝓀 ⁺ βŠ” 𝓣 ⁺ Μ‡ where constructor lattice field diff --git a/source/Posets/JoinSemiLattices.lagda b/source/Posets/JoinSemiLattices.lagda index ed3f373e6..6164c6b4f 100644 --- a/source/Posets/JoinSemiLattices.lagda +++ b/source/Posets/JoinSemiLattices.lagda @@ -16,7 +16,7 @@ open import Fin.Type open import UF.Subsingletons -record JoinSemiLattice (π“₯ 𝓣 : Universe) : 𝓀ω where +record JoinSemiLattice (π“₯ 𝓣 : Universe) : 𝓣 ⁺ βŠ” π“₯ ⁺ Μ‡ where field L : π“₯ Μ‡ L-is-set : is-set L diff --git a/source/Posets/KuratowskiClosure.lagda b/source/Posets/KuratowskiClosure.lagda new file mode 100644 index 000000000..657ff33ce --- /dev/null +++ b/source/Posets/KuratowskiClosure.lagda @@ -0,0 +1,36 @@ +A Kuratowski closure operator is a closure operator that preserves joins. + +\begin{code} + +{-# OPTIONS --without-K --exact-split --safe --auto-inline #-} + +open import MLTT.Spartan +open import UF.FunExt +open import UF.PropTrunc +open import UF.Subsingletons +open import UF.Subsingletons-FunExt + +open import Posets.JoinSemiLattices + +module Posets.KuratowskiClosure + (fe : Fun-Ext) + (pt : propositional-truncations-exist) + where +open import Posets.Poset fe +open import Posets.Closure fe pt + +module _ (D : JoinSemiLattice π“₯ 𝓣) where + open JoinSemiLattice D + open MonotoneAxioms _βŠ‘_ _βŠ‘_ + open Closure _βŠ‘_ + + kuratowski-closure-axioms : (L β†’ L) β†’ _ + kuratowski-closure-axioms f + = is-monotone f + Γ— (closure-Ξ· f Γ— closure-ΞΌ f) + Γ— (preserves-βŠ₯ Γ— preserves-∨) + where + preserves-βŠ₯ = f βŠ₯ = βŠ₯ + preserves-∨ = βˆ€ x y β†’ f (x ∨ y) = f x ∨ f y + +\end{code} diff --git a/source/Posets/Poset.lagda b/source/Posets/Poset.lagda index 847bad27f..3cecf20d2 100644 --- a/source/Posets/Poset.lagda +++ b/source/Posets/Poset.lagda @@ -69,3 +69,24 @@ Added 25 August 2022, but added elsewhere in TypeTopology much earlier (June posets-are-sets = type-with-prop-valued-refl-antisym-rel-is-set _βŠ‘_ \end{code} + +Defines monotone functions. + +\begin{code} + + module MonotoneAxioms -- TODO find occurences of monotonicity and refactor + {D : 𝓀 Μ‡ } + (_βŠ‘_ : D β†’ D β†’ 𝓣 Μ‡ ) + {E : 𝓀' Μ‡ } + (_β‰Ό_ : E β†’ E β†’ 𝓣' Μ‡ ) + (f : D β†’ E) + where + + is-monotone = βˆ€ x y β†’ x βŠ‘ y β†’ f x β‰Ό f y + + open PosetAxioms _β‰Ό_ + + being-monotone-is-prop : is-prop-valued β†’ is-prop is-monotone + being-monotone-is-prop p = Π₃-is-prop fe Ξ» _ _ _ β†’ p _ _ + +\end{code}