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.arrowsAreSets isPreCategory = {!!}
Rel : PreCategory _ _
PreCategory.raw Rel = RawRel
Rel : PreCategory RawRel
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
postulate from[Contr] : Univalent[Contr] Univalent
-- | The mere proposition of being a category.
--
-- 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
module _ {a b : Level} ( : RawCategory a b) where
record IsPreCategory : Set (lsuc (a b)) where
open RawCategory public
field
isAssociative : IsAssociative
@ -281,23 +273,22 @@ record IsPreCategory {a b : Level} ( : RawCategory a b) : Set (ls
preorder≅ : Preorder _ _ _
preorder≅ = record { Carrier = Object ; _≈_ = _≡_ ; __ = _≅_ ; isPreorder = isPreorder }
record PreCategory (a b : Level) : Set (lsuc (a b)) where
record PreCategory : Set (lsuc (a b)) where
field
raw : RawCategory a b
isPreCategory : IsPreCategory raw
isPreCategory : IsPreCategory
open IsPreCategory isPreCategory public
-- Definition 9.6.1 in [HoTT]
record StrictCategory (a b : Level) : Set (lsuc (a b)) where
record StrictCategory : Set (lsuc (a b)) where
field
preCategory : PreCategory a b
preCategory : PreCategory
open PreCategory preCategory
field
objectsAreSets : isSet Object
record IsCategory {a b : Level} ( : RawCategory a b) : Set (lsuc (a b)) where
record IsCategory : Set (lsuc (a b)) where
field
isPreCategory : IsPreCategory
isPreCategory : IsPreCategory
open IsPreCategory isPreCategory public
field
univalent : Univalent
@ -387,7 +378,6 @@ record IsCategory {a b : Level} ( : RawCategory a b) : Set (lsuc
res : Xi Yi
res i = p0 i , p1 i
-- | Propositionality of being a category
module _ {a b : Level} ( : RawCategory a b) where
open RawCategory
open Univalence
@ -442,10 +432,6 @@ module _ {a b : Level} ( : RawCategory a b) where
IsCategory.isPreCategory (done i)
= propIsPreCategory X.isPreCategory Y.isPreCategory 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 = done