From 811a6bf58e64168b545718448e8c955fac4d5bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Hangh=C3=B8j=20Iversen?= Date: Tue, 20 Mar 2018 15:19:28 +0100 Subject: [PATCH] Make univalence a submodule of RawCategory --- src/Cat/Categories/Cat.agda | 3 ++- src/Cat/Categories/Free.agda | 9 +++++---- src/Cat/Categories/Fun.agda | 7 ++++--- src/Cat/Categories/Sets.agda | 5 +++-- src/Cat/Category.agda | 26 ++++++++++++-------------- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/Cat/Categories/Cat.agda b/src/Cat/Categories/Cat.agda index f013c82..f429985 100644 --- a/src/Cat/Categories/Cat.agda +++ b/src/Cat/Categories/Cat.agda @@ -97,7 +97,8 @@ module CatProduct {β„“ β„“' : Level} (β„‚ 𝔻 : Category β„“ β„“') where isIdentity = Σ≑ (fst β„‚.isIdentity) (fst 𝔻.isIdentity) , Σ≑ (snd β„‚.isIdentity) (snd 𝔻.isIdentity) - postulate univalent : Univalence.Univalent rawProduct isIdentity + + postulate univalent : Univalence.Univalent isIdentity instance isCategory : IsCategory rawProduct IsCategory.isAssociative isCategory = Σ≑ β„‚.isAssociative 𝔻.isAssociative diff --git a/src/Cat/Categories/Free.agda b/src/Cat/Categories/Free.agda index b227c5d..9d8d3d4 100644 --- a/src/Cat/Categories/Free.agda +++ b/src/Cat/Categories/Free.agda @@ -35,8 +35,6 @@ module _ {β„“a β„“b : Level} (β„‚ : Category β„“a β„“b) where RawCategory._∘_ RawFree = concatenate open RawCategory RawFree - open Univalence RawFree - isAssociative : {A B C D : β„‚.Object} {r : Path β„‚.Arrow A B} {q : Path β„‚.Arrow B C} {p : Path β„‚.Arrow C D} β†’ p ++ (q ++ r) ≑ (p ++ q) ++ r @@ -59,13 +57,16 @@ module _ {β„“a β„“b : Level} (β„‚ : Category β„“a β„“b) where isIdentity : IsIdentity πŸ™ isIdentity = ident-r , ident-l + open Univalence isIdentity + module _ {A B : β„‚.Object} where arrowsAreSets : Cubical.isSet (Path β„‚.Arrow A B) arrowsAreSets a b p q = {!!} - eqv : isEquiv (A ≑ B) (A β‰… B) (id-to-iso isIdentity A B) + eqv : isEquiv (A ≑ B) (A β‰… B) (Univalence.id-to-iso isIdentity A B) eqv = {!!} - univalent : Univalent isIdentity + + univalent : Univalent univalent = eqv isCategory : IsCategory RawFree diff --git a/src/Cat/Categories/Fun.agda b/src/Cat/Categories/Fun.agda index 019e8b6..4c020cb 100644 --- a/src/Cat/Categories/Fun.agda +++ b/src/Cat/Categories/Fun.agda @@ -67,7 +67,8 @@ module Fun {β„“c β„“c' β„“d β„“d' : Level} (β„‚ : Category β„“c β„“c') (𝔻 : C } open RawCategory RawFun - open Univalence RawFun + open Univalence (Ξ» {A} {B} {f} β†’ isIdentity {A} {B} {f}) + module _ {A B : Functor β„‚ 𝔻} where module A = Functor A module B = Functor B @@ -145,10 +146,10 @@ module Fun {β„“c β„“c' β„“d β„“d' : Level} (β„‚ : Category β„“c β„“c') (𝔻 : C re-ve : (x : A ≑ B) β†’ reverse (obverse x) ≑ x re-ve = {!!} - done : isEquiv (A ≑ B) (A β‰… B) (id-to-iso (Ξ» { {A} {B} β†’ isIdentity {A} {B}}) A B) + done : isEquiv (A ≑ B) (A β‰… B) (Univalence.id-to-iso (Ξ» { {A} {B} β†’ isIdentity {A} {B}}) A B) done = {!gradLemma obverse reverse ve-re re-ve!} - univalent : Univalent (Ξ»{ {A} {B} β†’ isIdentity {A} {B}}) + univalent : Univalent univalent = done instance diff --git a/src/Cat/Categories/Sets.agda b/src/Cat/Categories/Sets.agda index 54050d8..e7e2024 100644 --- a/src/Cat/Categories/Sets.agda +++ b/src/Cat/Categories/Sets.agda @@ -69,12 +69,13 @@ module _ (β„“ : Level) where RawCategory._∘_ SetsRaw = Function._βˆ˜β€²_ open RawCategory SetsRaw hiding (_∘_) - open Univalence SetsRaw isIdentity : IsIdentity Function.id proj₁ isIdentity = funExt Ξ» _ β†’ refl projβ‚‚ isIdentity = funExt Ξ» _ β†’ refl + open Univalence (Ξ» {A} {B} {f} β†’ isIdentity {A} {B} {f}) + arrowsAreSets : ArrowsAreSets arrowsAreSets {B = (_ , s)} = setPi Ξ» _ β†’ s @@ -266,7 +267,7 @@ module _ (β„“ : Level) where res : isEquiv (hA ≑ hB) (hA β‰… hB) (_≃_.eqv t) res = _≃_.isEqv t module _ {hA hB : hSet {β„“}} where - univalent : isEquiv (hA ≑ hB) (hA β‰… hB) (id-to-iso (Ξ» {A} {B} β†’ isIdentity {A} {B}) hA hB) + univalent : isEquiv (hA ≑ hB) (hA β‰… hB) (Univalence.id-to-iso (Ξ» {A} {B} β†’ isIdentity {A} {B}) hA hB) univalent = let k = _≃_.isEqv (sym≃ conclusion) in {!k!} SetsIsCategory : IsCategory SetsRaw diff --git a/src/Cat/Category.agda b/src/Cat/Category.agda index 5b84a79..834ff47 100644 --- a/src/Cat/Category.agda +++ b/src/Cat/Category.agda @@ -129,12 +129,8 @@ record RawCategory (β„“a β„“b : Level) : Set (lsuc (β„“a βŠ” β„“b)) where Terminal : Set (β„“a βŠ” β„“b) Terminal = Ξ£ Object IsTerminal --- | Univalence is indexed by a raw category as well as an identity proof. --- --- FIXME Put this in `RawCategory` and index it on the witness to `isIdentity`. -module Univalence {β„“a β„“b : Level} (β„‚ : RawCategory β„“a β„“b) where - open RawCategory β„‚ - module _ (isIdentity : IsIdentity πŸ™) where + -- | Univalence is indexed by a raw category as well as an identity proof. + module Univalence (isIdentity : IsIdentity πŸ™) where idIso : (A : Object) β†’ A β‰… A idIso A = πŸ™ , (πŸ™ , isIdentity) @@ -162,12 +158,13 @@ module Univalence {β„“a β„“b : Level} (β„‚ : RawCategory β„“a β„“b) where -- [HoTT]. record IsCategory {β„“a β„“b : Level} (β„‚ : RawCategory β„“a β„“b) : Set (lsuc (β„“a βŠ” β„“b)) where open RawCategory β„‚ public - open Univalence β„‚ public field isAssociative : IsAssociative isIdentity : IsIdentity πŸ™ arrowsAreSets : ArrowsAreSets - univalent : Univalent isIdentity + open Univalence isIdentity public + field + univalent : Univalent -- Some common lemmas about categories. module _ {A B : Object} {X : Object} (f : Arrow A B) where @@ -243,7 +240,7 @@ module Propositionality {β„“a β„“b : Level} (β„‚ : RawCategory β„“a β„“b) where πŸ™ ∘ g' β‰‘βŸ¨ snd isIdentity ⟩ g' ∎ - propUnivalent : isProp (Univalent isIdentity) + propUnivalent : isProp Univalent propUnivalent a b i = propPi (Ξ» iso β†’ propHasLevel ⟨-2⟩) a b i private @@ -251,7 +248,7 @@ module Propositionality {β„“a β„“b : Level} (β„‚ : RawCategory β„“a β„“b) where module IC = IsCategory module X = IsCategory x module Y = IsCategory y - open Univalence β„‚ + open Univalence -- In a few places I use the result of propositionality of the various -- projections of `IsCategory` - I've arbitrarily chosed to use this -- result from `x : IsCategory C`. I don't know which (if any) possibly @@ -336,21 +333,22 @@ module Opposite {β„“a β„“b : Level} where RawCategory._∘_ opRaw = Function.flip β„‚._∘_ open RawCategory opRaw - open Univalence opRaw isIdentity : IsIdentity πŸ™ isIdentity = swap β„‚.isIdentity + open Univalence isIdentity + module _ {A B : β„‚.Object} where univalent : isEquiv (A ≑ B) (A β‰… B) - (id-to-iso (swap β„‚.isIdentity) A B) + (Univalence.id-to-iso (swap β„‚.isIdentity) A B) fst (univalent iso) = flipFiber (fst (β„‚.univalent (flipIso iso))) where flipIso : A β‰… B β†’ B β„‚.β‰… A flipIso (f , f~ , iso) = f , f~ , swap iso flipFiber - : fiber (β„‚.id-to-iso β„‚.isIdentity B A) (flipIso iso) - β†’ fiber ( id-to-iso isIdentity A B) iso + : fiber (β„‚.id-to-iso B A) (flipIso iso) + β†’ fiber ( id-to-iso A B) iso flipFiber (eq , eqIso) = sym eq , {!!} snd (univalent iso) = {!!}