Factor out objects

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-08 10:28:05 +01:00
parent 181bd1af53
commit 4e7b350188
3 changed files with 23 additions and 22 deletions

View file

@ -156,7 +156,7 @@ module _ { ' : Level} (unprovable : IsCategory (RawCat ')) where
RawProduct.proj₁ rawProduct = P.proj₁ RawProduct.proj₁ rawProduct = P.proj₁
RawProduct.proj₂ rawProduct = P.proj₂ RawProduct.proj₂ rawProduct = P.proj₂
isProduct : IsProduct Cat rawProduct isProduct : IsProduct Cat _ _ rawProduct
IsProduct.isProduct isProduct = P.isProduct IsProduct.isProduct isProduct = P.isProduct
product : Product Cat 𝔻 product : Product Cat 𝔻

View file

@ -70,7 +70,7 @@ module _ { : Level} where
RawProduct.proj₁ rawProduct = Data.Product.proj₁ RawProduct.proj₁ rawProduct = Data.Product.proj₁
RawProduct.proj₂ rawProduct = Data.Product.proj₂ RawProduct.proj₂ rawProduct = Data.Product.proj₂
isProduct : IsProduct 𝓢 rawProduct isProduct : IsProduct 𝓢 _ _ rawProduct
IsProduct.isProduct isProduct {X = X} f g IsProduct.isProduct isProduct {X = X} f g
= (f &&& g) , lem {0X = X} f g = (f &&& g) , lem {0X = X} f g

View file

@ -10,14 +10,15 @@ module _ {a b : Level} ( : Category a b) where
open Category open Category
record RawProduct (A B : Object) : Set (a b) where module _ (A B : Object) where
record RawProduct : Set (a b) where
no-eta-equality no-eta-equality
field field
obj : Object obj : Object
proj₁ : [ obj , A ] proj₁ : [ obj , A ]
proj₂ : [ obj , B ] proj₂ : [ obj , B ]
record IsProduct {A B : Object} (raw : RawProduct A B) : Set (a b) where record IsProduct (raw : RawProduct) : Set (a b) where
open RawProduct raw public open RawProduct raw public
field field
isProduct : {X : Object} (x₁ : [ X , A ]) (x₂ : [ X , B ]) isProduct : {X : Object} (x₁ : [ X , A ]) (x₂ : [ X , B ])
@ -28,10 +29,10 @@ module _ {a b : Level} ( : Category a b) where
[ X , obj ] [ X , obj ]
_P[_×_] π₁ π₂ = P.proj₁ (isProduct π₁ π₂) _P[_×_] π₁ π₂ = P.proj₁ (isProduct π₁ π₂)
record Product (A B : Object) : Set (a b) where record Product : Set (a b) where
field field
raw : RawProduct A B raw : RawProduct
isProduct : IsProduct {A} {B} raw isProduct : IsProduct raw
open IsProduct isProduct public open IsProduct isProduct public