Make the category an index of PreCategory

This commit is contained in:
Frederik Hanghøj Iversen 2018-04-06 17:09:15 +02:00
parent 23b562a873
commit 36d92c7ceb
2 changed files with 222 additions and 237 deletions

View file

@ -163,6 +163,5 @@ IsPreCategory.isAssociative isPreCategory = funExt is-isAssociative
IsPreCategory.isIdentity isPreCategory = funExt ident-l , funExt ident-r IsPreCategory.isIdentity isPreCategory = funExt ident-l , funExt ident-r
IsPreCategory.arrowsAreSets isPreCategory = {!!} IsPreCategory.arrowsAreSets isPreCategory = {!!}
Rel : PreCategory _ _ Rel : PreCategory RawRel
PreCategory.raw Rel = RawRel
PreCategory.isPreCategory Rel = isPreCategory PreCategory.isPreCategory Rel = isPreCategory

View file

@ -142,16 +142,8 @@ record RawCategory (a b : Level) : Set (lsuc (a ⊔ b)) where
-- This is not so straight-forward so you can assume it -- This is not so straight-forward so you can assume it
postulate from[Contr] : Univalent[Contr] Univalent postulate from[Contr] : Univalent[Contr] Univalent
-- | The mere proposition of being a category. module _ {a b : Level} ( : RawCategory a b) where
-- record IsPreCategory : Set (lsuc (a b)) where
-- Also defines a few lemmas:
--
-- iso-is-epi : Isomorphism f → Epimorphism {X = X} f
-- iso-is-mono : Isomorphism f → Monomorphism {X = X} f
--
-- Sans `univalent` this would be what is referred to as a pre-category in
-- [HoTT].
record IsPreCategory {a b : Level} ( : RawCategory a b) : Set (lsuc (a b)) where
open RawCategory public open RawCategory public
field field
isAssociative : IsAssociative isAssociative : IsAssociative
@ -281,23 +273,22 @@ record IsPreCategory {a b : Level} ( : RawCategory a b) : Set (ls
preorder≅ : Preorder _ _ _ preorder≅ : Preorder _ _ _
preorder≅ = record { Carrier = Object ; _≈_ = _≡_ ; __ = _≅_ ; isPreorder = isPreorder } preorder≅ = record { Carrier = Object ; _≈_ = _≡_ ; __ = _≅_ ; isPreorder = isPreorder }
record PreCategory (a b : Level) : Set (lsuc (a b)) where record PreCategory : Set (lsuc (a b)) where
field field
raw : RawCategory a b isPreCategory : IsPreCategory
isPreCategory : IsPreCategory raw
open IsPreCategory isPreCategory public open IsPreCategory isPreCategory public
-- Definition 9.6.1 in [HoTT] -- Definition 9.6.1 in [HoTT]
record StrictCategory (a b : Level) : Set (lsuc (a b)) where record StrictCategory : Set (lsuc (a b)) where
field field
preCategory : PreCategory a b preCategory : PreCategory
open PreCategory preCategory open PreCategory preCategory
field field
objectsAreSets : isSet Object objectsAreSets : isSet Object
record IsCategory {a b : Level} ( : RawCategory a b) : Set (lsuc (a b)) where record IsCategory : Set (lsuc (a b)) where
field field
isPreCategory : IsPreCategory isPreCategory : IsPreCategory
open IsPreCategory isPreCategory public open IsPreCategory isPreCategory public
field field
univalent : Univalent univalent : Univalent
@ -387,7 +378,6 @@ record IsCategory {a b : Level} ( : RawCategory a b) : Set (lsuc
res : Xi Yi res : Xi Yi
res i = p0 i , p1 i res i = p0 i , p1 i
-- | Propositionality of being a category
module _ {a b : Level} ( : RawCategory a b) where module _ {a b : Level} ( : RawCategory a b) where
open RawCategory open RawCategory
open Univalence open Univalence
@ -442,10 +432,6 @@ module _ {a b : Level} ( : RawCategory a b) where
IsCategory.isPreCategory (done i) IsCategory.isPreCategory (done i)
= propIsPreCategory X.isPreCategory Y.isPreCategory i = propIsPreCategory X.isPreCategory Y.isPreCategory i
IsCategory.univalent (done i) = eqUni i IsCategory.univalent (done i) = eqUni i
-- IsCategory.isAssociative (done i) = Prop.propIsAssociative X.isAssociative Y.isAssociative i
-- IsCategory.isIdentity (done i) = isIdentity i
-- IsCategory.arrowsAreSets (done i) = Prop.propArrowIsSet X.arrowsAreSets Y.arrowsAreSets i
-- IsCategory.univalent (done i) = eqUni i
propIsCategory : isProp (IsCategory ) propIsCategory : isProp (IsCategory )
propIsCategory = done propIsCategory = done