2018-01-17 22:00:27 +00:00
|
|
|
|
module Cat.Category.Free where
|
2017-11-10 15:00:00 +00:00
|
|
|
|
|
|
|
|
|
open import Agda.Primitive
|
|
|
|
|
open import Cubical.PathPrelude hiding (Path)
|
2018-01-17 22:00:27 +00:00
|
|
|
|
open import Data.Product
|
2017-11-10 15:00:00 +00:00
|
|
|
|
|
2018-01-17 22:00:27 +00:00
|
|
|
|
open import Cat.Category as C
|
2017-11-10 15:00:00 +00:00
|
|
|
|
|
2018-01-21 00:11:08 +00:00
|
|
|
|
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
2017-11-10 15:00:00 +00:00
|
|
|
|
private
|
|
|
|
|
open module ℂ = Category ℂ
|
|
|
|
|
Obj = ℂ.Object
|
|
|
|
|
|
2018-01-21 14:03:00 +00:00
|
|
|
|
postulate
|
|
|
|
|
Path : ( a b : Obj ) → Set ℓ'
|
|
|
|
|
emptyPath : (o : Obj) → Path o o
|
|
|
|
|
concatenate : {a b c : Obj} → Path b c → Path a b → Path a c
|
2017-11-10 15:00:00 +00:00
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
module _ {A B C D : Obj} {r : Path A B} {q : Path B C} {p : Path C D} where
|
|
|
|
|
postulate
|
|
|
|
|
p-assoc : concatenate {A} {C} {D} p (concatenate {A} {B} {C} q r)
|
|
|
|
|
≡ concatenate {A} {B} {D} (concatenate {B} {C} {D} p q) r
|
|
|
|
|
module _ {A B : Obj} {p : Path A B} where
|
|
|
|
|
postulate
|
|
|
|
|
ident-r : concatenate {A} {A} {B} p (emptyPath A) ≡ p
|
|
|
|
|
ident-l : concatenate {A} {B} {B} (emptyPath B) p ≡ p
|
|
|
|
|
|
2018-01-21 00:11:08 +00:00
|
|
|
|
Free : Category ℓ ℓ'
|
2017-11-10 15:00:00 +00:00
|
|
|
|
Free = record
|
|
|
|
|
{ Object = Obj
|
|
|
|
|
; Arrow = Path
|
|
|
|
|
; 𝟙 = λ {o} → emptyPath o
|
|
|
|
|
; _⊕_ = λ {a b c} → concatenate {a} {b} {c}
|
2018-01-21 13:31:37 +00:00
|
|
|
|
; isCategory = record { assoc = p-assoc ; ident = ident-r , ident-l }
|
2017-11-10 15:00:00 +00:00
|
|
|
|
}
|