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₂
isProduct : IsProduct Cat rawProduct
isProduct : IsProduct Cat _ _ rawProduct
IsProduct.isProduct isProduct = P.isProduct
product : Product Cat 𝔻

View File

@ -70,7 +70,7 @@ module _ { : Level} where
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
= (f &&& g) , lem {0X = X} f g

View File

@ -10,30 +10,31 @@ module _ {a b : Level} ( : Category a b) where
open Category
record RawProduct (A B : Object) : Set (a b) where
no-eta-equality
field
obj : Object
proj₁ : [ obj , A ]
proj₂ : [ obj , B ]
module _ (A B : Object) where
record RawProduct : Set (a b) where
no-eta-equality
field
obj : Object
proj₁ : [ obj , A ]
proj₂ : [ obj , B ]
record IsProduct {A B : Object} (raw : RawProduct A B) : Set (a b) where
open RawProduct raw public
field
isProduct : {X : Object} (x₁ : [ X , A ]) (x₂ : [ X , B ])
∃![ x ] ( [ proj₁ x ] x₁ P.× [ proj₂ x ] x₂)
record IsProduct (raw : RawProduct) : Set (a b) where
open RawProduct raw public
field
isProduct : {X : Object} (x₁ : [ X , A ]) (x₂ : [ X , B ])
∃![ x ] ( [ proj₁ x ] x₁ P.× [ proj₂ x ] x₂)
-- | Arrow product
_P[_×_] : {X} (π₁ : [ X , A ]) (π₂ : [ X , B ])
[ X , obj ]
_P[_×_] π₁ π₂ = P.proj₁ (isProduct π₁ π₂)
-- | Arrow product
_P[_×_] : {X} (π₁ : [ X , A ]) (π₂ : [ X , B ])
[ X , obj ]
_P[_×_] π₁ π₂ = P.proj₁ (isProduct π₁ π₂)
record Product (A B : Object) : Set (a b) where
field
raw : RawProduct A B
isProduct : IsProduct {A} {B} raw
record Product : Set (a b) where
field
raw : RawProduct
isProduct : IsProduct raw
open IsProduct isProduct public
open IsProduct isProduct public
record HasProducts : Set (a b) where
field