-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] working on dcpo presentations #120
Draft
jonsterling
wants to merge
28
commits into
martinescardo:master
Choose a base branch
from
jonsterling:dcpo-presentations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
15bcc35
Preliminary definition of dcpo presentations
Trebor-Huang 1e194b9
Interpretation
Trebor-Huang 89788c5
Refactor `image-is-directed`
Trebor-Huang 8942871
Define cover preserving map
Trebor-Huang 0d84848
Projections
Trebor-Huang da91feb
C-Ideals
Trebor-Huang 49d9265
Use ∈
Trebor-Huang 3b323cc
Start to define C-Idl
Trebor-Huang 30934f3
Impredicative ideal generation
Trebor-Huang cb5d45c
Sort out universe levels
Trebor-Huang 1b00954
WIP Suplattics of C-Ideals
Trebor-Huang 5137639
formatting: DomainTheory.Basics.Miscelanea
jonsterling b0e5f90
formatting: DomainTheory.Presentation.C-Ideal
jonsterling 1962bfc
formatting: DomainTheory.Presentation.Presentation
jonsterling dfe0d79
rename DomainTheory.Presentation.Presentation => DomainTheory.Present…
jonsterling 5bc5996
fix my mistake (unfinished rename)
jonsterling 5065a2e
Define monotonicity
Trebor-Huang d43a6b5
Closure
Trebor-Huang 9eedad1
Kuratowski closure
Trebor-Huang 8d22030
WIP suplattice closure
Trebor-Huang 605b316
WIP suplattice closure
Trebor-Huang ed9c6f7
Fix
Trebor-Huang ada0ae3
We don't need set assumptions!
Trebor-Huang 4673b63
Fill in some holes
Trebor-Huang d0989b7
Expose the resizing
Trebor-Huang c074d29
Bump to master
Trebor-Huang 40f2df1
Singleton map
Trebor-Huang c4f3494
eta is monotone
Trebor-Huang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering whether this is a workable way to formulate the set of covers in a univalent setting. In particular, I think we would need it to be a family of types rather than a family of propositions. But maybe there is some better formulation anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two powersets in the original definition. I changed the inner one but not the outer one, because I was not so sure about how the outer one is used.