bsc-leon-vatthauer/agda/src/FreeObject.lagda.md

56 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
```agda
open import Level
open import Categories.Category
open import Categories.Functor
```
-->
```agda
module FreeObject where
private
variable
o e o' ' e' : Level
```
# Free objects
The notion of free object has been formalized in agda-categories:
```agda
open import Categories.FreeObjects.Free
```
but we need a predicate expressing that an object 'is free':
```agda
record IsFreeObject {C : Category o e} {D : Category o' ' e'} (U : Functor D C) (X : Category.Obj C) (FX : Category.Obj D) : Set (suc (e e' o o' ')) where
private
module C = Category C using (Obj; id; identityʳ; identityˡ; _⇒_; _∘_; equiv; module Equiv)
module D = Category D using (Obj; _⇒_; _∘_; equiv)
module U = Functor U using (₀; )
field
η : C [ X , U.₀ FX ]
_* : {A : D.Obj} C [ X , U.₀ A ] D [ FX , A ]
*-lift : {A : D.Obj} (f : C [ X , U.₀ A ]) C [ (U.₁ (f *) C.∘ η) f ]
*-uniq : {A : D.Obj} (f : C [ X , U.₀ A ]) (g : D [ FX , A ]) C [ (U.₁ g) C.∘ η f ] D [ g f * ]
```
and some way to convert between these notions:
```agda
IsFreeObject⇒FreeObject : {C : Category o e} {D : Category o' ' e'} (U : Functor D C) (X : Category.Obj C) (FX : Category.Obj D) IsFreeObject U X FX FreeObject U X
IsFreeObject⇒FreeObject U X FX isFO = record
{ FX = FX
; η = η
; _* = _*
; *-lift = *-lift
; *-uniq = *-uniq
}
where open IsFreeObject isFO
-- TODO FreeObject⇒IsFreeObject
```