-
Notifications
You must be signed in to change notification settings - Fork 144
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
Univalent Category of SETOIDs , Setoids are not LCCC #1152
Draft
marcinjangrzybowski
wants to merge
22
commits into
agda:master
Choose a base branch
from
marcinjangrzybowski:setoid-slice
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.
+1,372
−77
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
92ccbff
new modules:
marcinjangrzybowski 8cd6eeb
simplified transport-filler-ua, as sugested by Tom Jack on Univalent …
marcinjangrzybowski d48cf4b
formatting fix
marcinjangrzybowski 7ebe15d
setoids are not LCCC, Sets are
marcinjangrzybowski aab1d5e
sliced adjoints
marcinjangrzybowski b79c431
wip
marcinjangrzybowski f68e19d
Merge branch 'master' of https://github.com/agda/cubical into setoid-…
marcinjangrzybowski 0c5c7cb
sliced adjoints
marcinjangrzybowski 6d319cb
wip
marcinjangrzybowski 69904be
Merge remote-tracking branch 'origin2/master' into sliced-adjoints
marcinjangrzybowski c42e230
cleanup
marcinjangrzybowski 53650c6
Merge branch 'sliced-adjoints' into setoid-slice
marcinjangrzybowski 46a83f8
wip
marcinjangrzybowski 03244d0
small fix
marcinjangrzybowski b9e9394
cleanup
marcinjangrzybowski cfeffb0
Merge branch 'master' into sliced-adjoints
marcinjangrzybowski 72cf4ba
small fixes
marcinjangrzybowski cc3264c
removed unviPropEq, replaced its occurence with existing helper
marcinjangrzybowski 96ca966
added requested comment
marcinjangrzybowski 68c3a44
sync
marcinjangrzybowski ac23253
Update Cat.agda
marcinjangrzybowski d0431e7
Update Setoids.agda
marcinjangrzybowski 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
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,193 @@ | ||
{-# OPTIONS --safe #-} | ||
|
||
module Cubical.Categories.Constructions.Slice.Functor where | ||
|
||
open import Cubical.Foundations.Prelude | ||
open import Cubical.Foundations.Function | ||
open import Cubical.Foundations.Isomorphism | ||
|
||
open import Cubical.Categories.Category | ||
open import Cubical.Categories.Category.Properties | ||
|
||
open import Cubical.Categories.Constructions.Slice.Base | ||
|
||
open import Cubical.Categories.Limits.Pullback | ||
open import Cubical.Categories.Functor | ||
open import Cubical.Categories.NaturalTransformation | ||
open import Cubical.Categories.Adjoint | ||
|
||
open import Cubical.Tactics.FunctorSolver.Reflection | ||
|
||
|
||
open Category hiding (_∘_) | ||
open Functor | ||
open NatTrans | ||
|
||
private | ||
variable | ||
ℓ ℓ' : Level | ||
C D : Category ℓ ℓ' | ||
c d : C .ob | ||
|
||
infix 39 _F/_ | ||
infix 40 ∑_ | ||
|
||
_F/_ : ∀ (F : Functor C D) c → Functor (SliceCat C c) (SliceCat D (F ⟅ c ⟆)) | ||
F-ob (F F/ c) = sliceob ∘ F ⟪_⟫ ∘ S-arr | ||
F-hom (F F/ c) h = slicehom _ | ||
$ sym ( F-seq F _ _) ∙ cong (F ⟪_⟫) (S-comm h) | ||
F-id (F F/ c) = SliceHom-≡-intro' _ _ $ F-id F | ||
F-seq (F F/ c) _ _ = SliceHom-≡-intro' _ _ $ F-seq F _ _ | ||
|
||
|
||
∑_ : ∀ {c d} f → Functor (SliceCat C c) (SliceCat C d) | ||
F-ob (∑_ {C = C} f) (sliceob x) = sliceob (x ⋆⟨ C ⟩ f) | ||
F-hom (∑_ {C = C} f) (slicehom h p) = slicehom _ $ | ||
sym (C .⋆Assoc _ _ _) ∙ cong (comp' C f) p | ||
F-id (∑ f) = SliceHom-≡-intro' _ _ refl | ||
F-seq (∑ f) _ _ = SliceHom-≡-intro' _ _ refl | ||
|
||
module _ (Pbs : Pullbacks C) where | ||
|
||
open Category C using () renaming (_⋆_ to _⋆ᶜ_) | ||
|
||
module BaseChange {c d} (𝑓 : C [ c , d ]) where | ||
infix 40 _* | ||
|
||
module _ {x@(sliceob arr) : SliceOb C d} where | ||
open Pullback (Pbs (cospan _ _ _ 𝑓 arr)) public | ||
|
||
module _ {x} {y} ((slicehom h h-comm) : SliceCat C d [ y , x ]) where | ||
|
||
pbU = univProp (pbPr₁ {x = y}) (pbPr₂ ⋆ᶜ h) | ||
(pbCommutes {x = y} ∙∙ cong (pbPr₂ ⋆ᶜ_) (sym (h-comm)) ∙∙ sym (C .⋆Assoc _ _ _)) | ||
.fst .snd | ||
|
||
_* : Functor (SliceCat C d) (SliceCat C c) | ||
F-ob _* x = sliceob (pbPr₁ {x = x}) | ||
F-hom _* f = slicehom _ (sym (fst (pbU f))) | ||
F-id _* = SliceHom-≡-intro' _ _ $ pullbackArrowUnique (sym (C .⋆IdL _)) (C .⋆IdR _ ∙ sym (C .⋆IdL _)) | ||
|
||
F-seq _* _ _ = | ||
let (u₁ , v₁) = pbU _ ; (u₂ , v₂) = pbU _ | ||
in SliceHom-≡-intro' _ _ $ pullbackArrowUnique | ||
(u₂ ∙∙ cong (C ⋆ _) u₁ ∙∙ sym (C .⋆Assoc _ _ _)) | ||
(sym (C .⋆Assoc _ _ _) ∙∙ cong (comp' C _) v₂ ∙∙ AssocCong₂⋆R C v₁) | ||
|
||
open BaseChange using (_*) | ||
open NaturalBijection renaming (_⊣_ to _⊣₂_) | ||
open Iso | ||
open _⊣₂_ | ||
|
||
|
||
module _ (𝑓 : C [ c , d ]) where | ||
|
||
open BaseChange 𝑓 hiding (_*) | ||
|
||
∑𝑓⊣𝑓* : ∑ 𝑓 ⊣₂ 𝑓 * | ||
fun (adjIso ∑𝑓⊣𝑓*) (slicehom h o) = | ||
let ((_ , (p , _)) , _) = univProp _ _ (sym o) | ||
in slicehom _ (sym p) | ||
inv (adjIso ∑𝑓⊣𝑓*) (slicehom h o) = slicehom _ $ | ||
AssocCong₂⋆R C (sym (pbCommutes)) ∙ cong (_⋆ᶜ 𝑓) o | ||
rightInv (adjIso ∑𝑓⊣𝑓*) (slicehom h o) = | ||
SliceHom-≡-intro' _ _ (pullbackArrowUnique (sym o) refl) | ||
leftInv (adjIso ∑𝑓⊣𝑓*) (slicehom h o) = | ||
let ((_ , (_ , q)) , _) = univProp _ _ _ | ||
in SliceHom-≡-intro' _ _ (sym q) | ||
adjNatInD ∑𝑓⊣𝑓* f k = SliceHom-≡-intro' _ _ $ | ||
let ((h' , (v' , u')) , _) = univProp _ _ _ | ||
((_ , (v'' , u'')) , _) = univProp _ _ _ | ||
in pullbackArrowUnique (v' ∙∙ cong (h' ⋆ᶜ_) v'' ∙∙ sym (C .⋆Assoc _ _ _)) | ||
(cong (_⋆ᶜ _) u' ∙ AssocCong₂⋆R C u'') | ||
|
||
adjNatInC ∑𝑓⊣𝑓* g h = SliceHom-≡-intro' _ _ $ C .⋆Assoc _ _ _ | ||
|
||
|
||
open UnitCounit | ||
|
||
module SlicedAdjoint {L : Functor C D} {R} (L⊣R : L ⊣ R) where | ||
|
||
open Category D using () renaming (_⋆_ to _⋆ᵈ_) | ||
|
||
open _⊣_ L⊣R | ||
|
||
module _ {c} {d} where | ||
module aI = Iso (adjIso (adj→adj' _ _ L⊣R) {c} {d}) | ||
|
||
module Left (b : D .ob) where | ||
|
||
⊣F/ : Functor (SliceCat C (R ⟅ b ⟆)) (SliceCat D b) | ||
⊣F/ = ∑ (ε ⟦ b ⟧) ∘F L F/ (R ⟅ b ⟆) | ||
|
||
L/b⊣R/b : ⊣F/ ⊣₂ (R F/ b) | ||
fun (adjIso L/b⊣R/b) (slicehom _ p) = slicehom _ $ | ||
C .⋆Assoc _ _ _ | ||
∙∙ cong (_ ⋆ᶜ_) (sym (F-seq R _ _) ∙∙ cong (R ⟪_⟫) p ∙∙ F-seq R _ _) | ||
∙∙ AssocCong₂⋆L C (sym (N-hom η _)) | ||
∙∙ cong (_ ⋆ᶜ_) (Δ₂ _) | ||
∙∙ C .⋆IdR _ | ||
|
||
inv (adjIso L/b⊣R/b) (slicehom _ p) = | ||
slicehom _ $ AssocCong₂⋆R D (sym (N-hom ε _)) | ||
∙ cong (_⋆ᵈ _) (sym (F-seq L _ _) ∙ cong (L ⟪_⟫) p) | ||
rightInv (adjIso L/b⊣R/b) _ = SliceHom-≡-intro' _ _ $ aI.rightInv _ | ||
leftInv (adjIso L/b⊣R/b) _ = SliceHom-≡-intro' _ _ $ aI.leftInv _ | ||
adjNatInD L/b⊣R/b _ _ = SliceHom-≡-intro' _ _ $ | ||
cong (_ ⋆ᶜ_) (F-seq R _ _) ∙ sym (C .⋆Assoc _ _ _) | ||
adjNatInC L/b⊣R/b _ _ = SliceHom-≡-intro' _ _ $ | ||
cong (_⋆ᵈ _) (F-seq L _ _) ∙ (D .⋆Assoc _ _ _) | ||
|
||
|
||
module Right (b : C .ob) where | ||
|
||
F/⊣ : Functor (SliceCat D (L ⟅ b ⟆)) (SliceCat C b) | ||
F/⊣ = (η ⟦ b ⟧) * ∘F R F/ (L ⟅ b ⟆) | ||
|
||
open BaseChange (η ⟦ b ⟧) hiding (_*) | ||
|
||
L/b⊣R/b : L F/ b ⊣₂ F/⊣ | ||
fun (adjIso L/b⊣R/b) (slicehom f s) = slicehom _ $ | ||
sym $ univProp _ _ (N-hom η _ ∙∙ | ||
cong (_ ⋆ᶜ_) (cong (R ⟪_⟫) (sym s) ∙ F-seq R _ _) | ||
∙∙ sym (C .⋆Assoc _ _ _)) .fst .snd .fst | ||
inv (adjIso L/b⊣R/b) (slicehom f s) = slicehom _ | ||
(D .⋆Assoc _ _ _ | ||
∙∙ congS (_⋆ᵈ (ε ⟦ _ ⟧ ⋆⟨ D ⟩ _)) (F-seq L _ _) | ||
∙∙ D .⋆Assoc _ _ _ ∙ cong (L ⟪ f ⟫ ⋆ᵈ_) | ||
(cong (L ⟪ pbPr₂ ⟫ ⋆ᵈ_) (sym (N-hom ε _)) | ||
∙∙ sym (D .⋆Assoc _ _ _) | ||
∙∙ cong (_⋆ᵈ ε ⟦ F-ob L b ⟧) | ||
(preserveCommF L $ sym pbCommutes) | ||
∙∙ D .⋆Assoc _ _ _ | ||
∙∙ cong (L ⟪ pbPr₁ ⟫ ⋆ᵈ_) (Δ₁ b) | ||
∙ D .⋆IdR _) | ||
∙∙ sym (F-seq L _ _) | ||
∙∙ cong (L ⟪_⟫) s) | ||
|
||
rightInv (adjIso L/b⊣R/b) h = SliceHom-≡-intro' _ _ $ | ||
let p₂ : ∀ {x} → η ⟦ _ ⟧ ⋆ᶜ R ⟪ L ⟪ x ⟫ ⋆⟨ D ⟩ ε ⟦ _ ⟧ ⟫ ≡ x | ||
p₂ = cong (_ ⋆ᶜ_) (F-seq R _ _) ∙ | ||
AssocCong₂⋆L C (sym (N-hom η _)) | ||
∙∙ cong (_ ⋆ᶜ_) (Δ₂ _) ∙∙ C .⋆IdR _ | ||
|
||
|
||
in pullbackArrowUnique (sym (S-comm h)) p₂ | ||
|
||
leftInv (adjIso L/b⊣R/b) _ = SliceHom-≡-intro' _ _ $ | ||
cong ((_⋆ᵈ _) ∘ L ⟪_⟫) (sym (snd (snd (fst (univProp _ _ _))))) | ||
∙ aI.leftInv _ | ||
adjNatInD L/b⊣R/b _ _ = SliceHom-≡-intro' _ _ $ | ||
let (h , (u , v)) = univProp _ _ _ .fst | ||
(u' , v') = pbU _ | ||
|
||
in pullbackArrowUnique | ||
(u ∙∙ cong (h ⋆ᶜ_) u' ∙∙ sym (C .⋆Assoc h _ _)) | ||
(cong (_ ⋆ᶜ_) (F-seq R _ _) | ||
∙∙ sym (C .⋆Assoc _ _ _) ∙∙ | ||
(cong (_⋆ᶜ _) v ∙ AssocCong₂⋆R C v')) | ||
|
||
adjNatInC L/b⊣R/b g h = let w = _ in SliceHom-≡-intro' _ _ $ | ||
cong (_⋆ᵈ _) (cong (L ⟪_⟫) (C .⋆Assoc _ _ w) ∙ F-seq L _ (_ ⋆ᶜ w)) | ||
∙ D .⋆Assoc _ _ _ | ||
|
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 don't think
isSmall
is a good name; These categories are conventionally called 'strict' categories, and calling them 'small' gives the impression that this is about universe level, which it's not.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.
how about
isStrict
? I do not have anything more descriptive in mindThere 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.
yes, that's also what the 1lab calls it.