cat/src/Cat/Categories/Fam.agda

64 lines
2.2 KiB
Agda
Raw Normal View History

2018-01-31 14:15:00 +00:00
{-# OPTIONS --allow-unsolved-metas #-}
module Cat.Categories.Fam where
2018-03-21 13:47:01 +00:00
open import Cat.Prelude
2018-01-31 14:15:00 +00:00
import Function
open import Cat.Category
module _ (a b : Level) where
2018-01-31 14:15:00 +00:00
private
Object = Σ[ hA hSet a ] (proj₁ hA hSet b)
2018-02-23 12:36:54 +00:00
Arr : Object Object Set (a b)
Arr ((A , _) , B) ((A' , _) , B') = Σ[ f (A A') ] ({x : A} proj₁ (B x) proj₁ (B' (f x)))
identity : {A : Object} Arr A A
proj₁ identity = λ x x
proj₂ identity = λ b b
2018-02-23 12:36:54 +00:00
_∘_ : {a b c : Object} Arr b c Arr a b Arr a c
2018-01-31 14:15:00 +00:00
(g , g') (f , f') = g Function.∘ f , g' Function.∘ f'
RawFam : RawCategory (lsuc (a b)) (a b)
RawFam = record
2018-02-23 12:36:54 +00:00
{ Object = Object
; Arrow = Arr
; identity = λ { {A} identity {A = A}}
; _∘_ = λ {a b c} _∘_ {a} {b} {c}
}
open RawCategory RawFam hiding (Object ; identity)
2018-02-23 12:36:54 +00:00
isAssociative : IsAssociative
isAssociative = Σ≡ refl refl
isIdentity : IsIdentity λ { {A} identity {A} }
2018-02-23 12:36:54 +00:00
isIdentity = (Σ≡ refl refl) , Σ≡ refl refl
open import Cubical.NType.Properties
open import Cubical.Sigma
2018-01-31 14:15:00 +00:00
instance
isCategory : IsCategory RawFam
2018-01-31 14:15:00 +00:00
isCategory = record
2018-02-23 12:36:54 +00:00
{ isAssociative = λ {A} {B} {C} {D} {f} {g} {h} isAssociative {A} {B} {C} {D} {f} {g} {h}
2018-02-23 11:49:41 +00:00
; isIdentity = λ {A} {B} {f} isIdentity {A} {B} {f = f}
; arrowsAreSets = λ {
{((A , hA) , famA)}
{((B , hB) , famB)}
setSig
{sA = setPi λ _ hB}
{sB = λ f
let
helpr : isSet ((a : A) proj₁ (famA a) proj₁ (famB (f a)))
helpr = setPi λ a setPi λ _ proj₂ (famB (f a))
-- It's almost like above, but where the first argument is
-- implicit.
res : isSet ({a : A} proj₁ (famA a) proj₁ (famB (f a)))
res = {!!}
in res
}
}
2018-02-05 13:47:15 +00:00
; univalent = {!!}
2018-01-31 14:15:00 +00:00
}
Fam : Category (lsuc (a b)) (a b)
2018-02-05 13:47:15 +00:00
Category.raw Fam = RawFam