Skip to content

Instantly share code, notes, and snippets.

@MarcelineVQ
Last active January 23, 2020 21:57
Show Gist options
  • Save MarcelineVQ/f1ad13e9c3f8cc314b0a259128ad5204 to your computer and use it in GitHub Desktop.
Save MarcelineVQ/f1ad13e9c3f8cc314b0a259128ad5204 to your computer and use it in GitHub Desktop.
record Category (k : Set → Set → Set) : Set₁ where
infixr 8 _⇝_
_⇝_ : Set → Set → Set
_⇝_ = k
field
id : ∀ {x} → x ⇝ x
_∘_ : ∀ {a b c : Set} → (b ⇝ c) → (a ⇝ b) → (a ⇝ c)
unitalityˡ : ∀ {X Y} {f : X ⇝ Y} → id ∘ f ≡ f
unitalityʳ : ∀ {X Y} {f : X ⇝ Y} → f ∘ id ≡ f
associativity : ∀ {X Y Z W} {f : X ⇝ Y} {g : Y ⇝ Z} {h : Z ⇝ W}
→ h ∘ (g ∘ f) ≡ (h ∘ g) ∘ f
module _ (_⇝_ : Set → Set → Set) (let infixl 5 _⇝_; _⇝_ = _⇝_) where
record Category : Set₁ where
field
id : ∀ {x} → x ⇝ x
_∘_ : ∀ {a b c : Set} → (b ⇝ c) → (a ⇝ b) → (a ⇝ c)
unitalityˡ : ∀ {X Y} {f : X ⇝ Y} → id ∘ f ≡ f
unitalityʳ : ∀ {X Y} {f : X ⇝ Y} → f ∘ id ≡ f
associativity : ∀ {X Y Z W} {f : X ⇝ Y} {g : Y ⇝ Z} {h : Z ⇝ W}
→ h ∘ (g ∘ f) ≡ (h ∘ g) ∘ f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment