-
Notifications
You must be signed in to change notification settings - Fork 134
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
Dl sheaves properly ordered #788
Merged
Merged
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
7d4cdfa
use improved ringsolver
mzeuner e4d5d8d
delete one more line
mzeuner 302c25a
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 5fe247f
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 3f2e7f8
Merge branch 'master' of https://github.com/agda/cubical
mzeuner c29f845
Merge branch 'master' of https://github.com/agda/cubical
mzeuner d83b855
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 63c770b
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 2ed6538
Merge branch 'master' of https://github.com/agda/cubical
mzeuner c35bc4d
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 808e042
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 18d797c
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 591c1b7
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 0e1bd40
Merge branch 'master' of https://github.com/agda/cubical
mzeuner 0b8f3c0
Merge branch 'master' of github.com:agda/cubical
mzeuner 4a91d86
Merge branch 'master' of github.com:agda/cubical
mzeuner 30cfe2f
Merge branch 'master' of github.com:mzeuner/cubical
mzeuner ea3c8a2
getting started
mzeuner 266135f
Merge branch 'master' of github.com:mzeuner/cubical into DLSheaves_Pr…
mzeuner ff97923
new def for diagrams
mzeuner 9ddbbe6
DL example
mzeuner 3666b33
an idea
mzeuner ea5d32f
proof of hom sets
mzeuner b31ecf3
remove test
mzeuner 2ba8051
Pullbacks as an instance
mzeuner 07d9d85
remove J
mzeuner f095715
worth pursuing
mzeuner 6fe6bb3
comment from discussion
mzeuner 1a6a997
give up for pairs
mzeuner bf90167
get everything to work with ordered pairs
mzeuner 597eebd
got it right
mzeuner ff14883
finish equiv with pbs
mzeuner 2f91937
right defintion of sheaf
mzeuner 030b3b2
comments
mzeuner 555d968
Merge branch 'master' of https://github.com/agda/cubical into DLSheav…
mzeuner 96340be
fix after merge
mzeuner 3df9242
remove unnecessary parentheses
mzeuner 8e43123
fixity of meet and join
mzeuner 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{-# OPTIONS --safe --experimental-lossy-unification #-} | ||
module Cubical.Categories.DistLatticeSheaf where | ||
module Cubical.Categories.DistLatticeSheaf.Base where | ||
|
||
open import Cubical.Foundations.Prelude | ||
open import Cubical.Foundations.Structure | ||
open import Cubical.Foundations.HLevels | ||
open import Cubical.Foundations.Powerset | ||
open import Cubical.Data.Sigma | ||
open import Cubical.Data.Nat using (ℕ) | ||
open import Cubical.Data.Nat.Order | ||
open import Cubical.Data.FinData | ||
open import Cubical.Data.FinData.Order | ||
|
||
open import Cubical.Relation.Binary.Poset | ||
|
||
|
@@ -15,6 +19,7 @@ open import Cubical.Algebra.Semilattice | |
open import Cubical.Algebra.Lattice | ||
open import Cubical.Algebra.DistLattice | ||
open import Cubical.Algebra.DistLattice.Basis | ||
open import Cubical.Algebra.DistLattice.BigOps | ||
|
||
open import Cubical.Categories.Category | ||
open import Cubical.Categories.Functor | ||
|
@@ -30,6 +35,9 @@ open import Cubical.Categories.Instances.Semilattice | |
open import Cubical.Categories.Instances.Lattice | ||
open import Cubical.Categories.Instances.DistLattice | ||
|
||
|
||
open import Cubical.Categories.DistLatticeSheaf.Diagram | ||
|
||
private | ||
variable | ||
ℓ ℓ' ℓ'' : Level | ||
|
@@ -80,49 +88,57 @@ module _ (L : DistLattice ℓ) (C : Category ℓ' ℓ'') (T : Terminal C) where | |
DLPreSheaf : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
DLPreSheaf = Functor (DLCat ^op) C | ||
|
||
hom-∨₁ : (x y : L .fst) → DLCat [ x , x ∨l y ] | ||
hom-∨₁ = ∨≤RCancel | ||
-- TODO: isn't the fixity of the operators a bit weird? | ||
|
||
hom-∨₂ : (x y : L .fst) → DLCat [ y , x ∨l y ] | ||
hom-∨₂ = ∨≤LCancel | ||
|
||
hom-∧₁ : (x y : L .fst) → DLCat [ x ∧l y , x ] | ||
hom-∧₁ _ _ = (≤m→≤j _ _ (∧≤RCancel _ _)) | ||
|
||
hom-∧₂ : (x y : L .fst) → DLCat [ x ∧l y , y ] | ||
hom-∧₂ _ _ = (≤m→≤j _ _ (∧≤LCancel _ _)) | ||
|
||
|
||
{- | ||
x ∧ y ----→ x | ||
| | | ||
| sq | | ||
V V | ||
y ----→ x ∨ y | ||
-} | ||
sq : (x y : L .fst) → hom-∧₂ x y ⋆ hom-∨₂ x y ≡ hom-∧₁ x y ⋆ hom-∨₁ x y | ||
sq x y = is-prop-valued (x ∧l y) (x ∨l y) (hom-∧₂ x y ⋆ hom-∨₂ x y) (hom-∧₁ x y ⋆ hom-∨₁ x y) | ||
module _ (x y : L .fst)where | ||
hom-∨₁ : DLCat [ x , x ∨l y ] | ||
hom-∨₁ = ∨≤RCancel _ _ | ||
-- TODO: isn't the fixity of the operators a bit weird? | ||
|
||
hom-∨₂ : DLCat [ y , x ∨l y ] | ||
hom-∨₂ = ∨≤LCancel _ _ | ||
|
||
hom-∧₁ : DLCat [ x ∧l y , x ] | ||
hom-∧₁ = (≤m→≤j _ _ (∧≤RCancel _ _)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for parenthesis in definition |
||
|
||
hom-∧₂ : DLCat [ x ∧l y , y ] | ||
hom-∧₂ = (≤m→≤j _ _ (∧≤LCancel _ _)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for parenthesis in definition |
||
|
||
|
||
{- | ||
x ∧ y ----→ x | ||
| | | ||
| sq | | ||
V V | ||
y ----→ x ∨ y | ||
-} | ||
sq : hom-∧₂ ⋆ hom-∨₂ ≡ hom-∧₁ ⋆ hom-∨₁ | ||
sq = is-prop-valued (x ∧l y) (x ∨l y) (hom-∧₂ ⋆ hom-∨₂) (hom-∧₁ ⋆ hom-∨₁) | ||
|
||
{- | ||
F(x ∨ y) ----→ F(x) | ||
| | | ||
| Fsq | | ||
V V | ||
F(y) ------→ F(x ∧ y) | ||
-} | ||
Fsq : (F : DLPreSheaf) | ||
→ F .F-hom hom-∨₂ ⋆⟨ C ⟩ F .F-hom hom-∧₂ ≡ | ||
F .F-hom hom-∨₁ ⋆⟨ C ⟩ F .F-hom hom-∧₁ | ||
Fsq F = F-square F sq | ||
|
||
isDLSheafPullback : (F : DLPreSheaf) → Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
isDLSheafPullback F = (F-ob F 0l ≡ 𝟙) | ||
× ((x y : L .fst) → isPullback C _ _ _ (Fsq x y F)) | ||
|
||
{- | ||
F(x ∨ y) ----→ F(x) | ||
| | | ||
| Fsq | | ||
V V | ||
F(y) ------→ F(x ∧ y) | ||
-} | ||
Fsq : (F : DLPreSheaf) (x y : L .fst) | ||
→ F .F-hom (hom-∨₂ x y) ⋆⟨ C ⟩ F .F-hom (hom-∧₂ x y) ≡ | ||
F .F-hom (hom-∨₁ x y) ⋆⟨ C ⟩ F .F-hom (hom-∧₁ x y) | ||
Fsq F x y = F-square F (sq x y) | ||
-- TODO: might be better to define this as a record | ||
DLSheafPullback : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
DLSheafPullback = Σ[ F ∈ DLPreSheaf ] isDLSheafPullback F | ||
|
||
isDLSheaf : (F : DLPreSheaf) → Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
isDLSheaf F = (F-ob F 0l ≡ 𝟙) | ||
× ((x y : L .fst) → isPullback C _ _ _ (Fsq F x y)) | ||
|
||
-- TODO: might be better to define this as a record | ||
DLSheaf : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
DLSheaf = Σ[ F ∈ DLPreSheaf ] isDLSheaf F | ||
-- Now for the proper version using limits of the right kind: | ||
open Join L | ||
isDLSheaf : (F : DLPreSheaf) → Type _ | ||
isDLSheaf F = ∀ (n : ℕ) (α : FinVec (fst L) n) → isLimCone _ _ (F-cone F (⋁Cone L α)) | ||
--TODO: Equivalence of isDLSheaf and isDLSheafPullback | ||
|
||
|
||
|
||
|
@@ -190,17 +206,54 @@ module SheafOnBasis (L : DistLattice ℓ) (C : Category ℓ' ℓ'') (T : Termina | |
BFsq F = F-square F Bsq | ||
|
||
|
||
-- TODO: check that this is equivalent to the functor | ||
-- preserving terminal objects and pullbacks | ||
isDLBasisSheaf : DLBasisPreSheaf → Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
isDLBasisSheaf F = ((0∈L' : 0l ∈ L') → F .F-ob (0l , 0∈L') ≡ 1c) | ||
× ((x y : ob BasisCat) (x∨y∈L' : fst x ∨l fst y ∈ L') | ||
→ isPullback C _ _ _ (BFsq x y x∨y∈L' F)) | ||
where | ||
open condSquare | ||
-- On a basis this is weaker than the definition below! | ||
isDLBasisSheafPullback : DLBasisPreSheaf → Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
isDLBasisSheafPullback F = ((0∈L' : 0l ∈ L') → F .F-ob (0l , 0∈L') ≡ 1c) | ||
× ((x y : ob BasisCat) (x∨y∈L' : fst x ∨l fst y ∈ L') | ||
→ isPullback C _ _ _ (BFsq x y x∨y∈L' F)) | ||
where open condSquare | ||
|
||
DLBasisSheafPullback : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
DLBasisSheafPullback = Σ[ F ∈ DLBasisPreSheaf ] isDLBasisSheafPullback F | ||
|
||
|
||
-- the correct defintion | ||
open Join L | ||
module condCone {n : ℕ} (α : FinVec (ob BasisCat) n) (⋁α∈L' : ⋁ (λ i → α i .fst) ∈ L') where | ||
open JoinSemilattice (Lattice→JoinSemilattice (DistLattice→Lattice L)) | ||
open PosetStr (IndPoset .snd) hiding (_≤_) | ||
open MeetSemilattice (Lattice→MeetSemilattice (DistLattice→Lattice L)) | ||
using (∧≤RCancel ; ∧≤LCancel) | ||
open Order (DistLattice→Lattice L) | ||
open Cone | ||
private | ||
α' : FinVec (fst L) n | ||
α' i = α i .fst | ||
⋁α : ob BasisCat | ||
⋁α = ⋁ α' , ⋁α∈L' | ||
|
||
BDiag : Functor (DLShfDiag n) (BasisCat ^op) | ||
F-ob BDiag (sing i) = α i | ||
F-ob BDiag (pair i j _) = α i · α j -- α i ∧ α j + basis is closed under ∧ | ||
F-hom BDiag idAr = is-refl _ | ||
F-hom BDiag singPairL = ≤m→≤j _ _ (∧≤RCancel _ _) | ||
F-hom BDiag singPairR = ≤m→≤j _ _ (∧≤LCancel _ _) | ||
F-id BDiag = is-prop-valued _ _ _ _ | ||
F-seq BDiag _ _ = is-prop-valued _ _ _ _ | ||
|
||
B⋁Cone : Cone BDiag ⋁α | ||
coneOut B⋁Cone (sing i) = ind≤⋁ α' i | ||
coneOut B⋁Cone (pair i _ _) = is-trans _ (α' i) _ (≤m→≤j _ _ (∧≤RCancel _ _)) (ind≤⋁ α' i) | ||
coneOutCommutes B⋁Cone _ = is-prop-valued _ _ _ _ | ||
|
||
isDLBasisSheaf : DLBasisPreSheaf → Type _ | ||
isDLBasisSheaf F = ∀ {n : ℕ} (α : FinVec (ob BasisCat) n) (⋁α∈L' : ⋁ (λ i → α i .fst) ∈ L') | ||
→ isLimCone _ _ (F-cone F (B⋁Cone α ⋁α∈L')) | ||
where open condCone | ||
|
||
|
||
|
||
|
||
DLBasisSheaf : Type (ℓ-max (ℓ-max ℓ ℓ') ℓ'') | ||
DLBasisSheaf = Σ[ F ∈ DLBasisPreSheaf ] isDLBasisSheaf F | ||
|
||
-- To prove the statement we probably need that C is: | ||
-- 1. univalent | ||
|
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.
It's not clear to me what this comment is about?
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 gave meet and join the same fixity as both distribute over each other