---
date: '2024-12-30'
description: general theory of mathematical structures and its relations.
id: category theory
modified: 2026-06-05 15:08:23 GMT-04:00
tags:
  - math
title: category theory
created: '2024-12-30'
published: '2024-12-30'
pageLayout: default
slug: thoughts/category-theory
permalink: https://aarnphm.xyz/thoughts/category-theory.md
generator:
  quartz: v4.6.0
  hostedProvider: Cloudflare
  baseUrl: aarnphm.xyz
full: https://aarnphm.xyz/llms-full.txt
---
see also: [Category Theory Illustrated](https://abuseofnotation.github.io/category-theory-illustrated/11_natural_transformations/)

depends on two sorts of _objects_:

- objects of the theory
- [[thoughts/homeomorphism|morphism]] of the category
  - tl/dr: think of arrow to connect relations between two mathematical objects

> \[!definition\] Definition 1.
>
> a category $\mathcal{C}$ consists of the following entities:
>
> - a class $\text{ob}(\mathcal{C})$ whose elements are called _objects_
> - a class $\text{hom}(\mathcal{C})$
>   - a morphism $f : a \mapsto b$
>   - $\text{hom}(a,b)$, or $\text{hom}_{\mathcal{C}}(a,b), \text{mor}(a,b), \mathcal{C}(a,b)$ denotes _hom-class_ of all morphism from $a$ to $b$
> - a binary operator $\circ$, or _composition of morphisms_ such that we have:
>
>   $$
>   \circ : \text{hom}(b,c) \times \text{hom}(a,b) \mapsto \text{hom}(a,c)
>   $$
>
>   - associativity: if $f: a \to b, g: b \to c$ and $h: c \to d$ then we have
>
>     $$
>     h \circ (g \circ f) = (h \circ g) \circ f
>     $$
>
>   - identity: For every object $x$ there exists a _identity morphism_ $1_{x}: x \to x$ for x such that for every $f: a \to b$ we have
>
>     $$
>     1_b \circ f = f = f \circ 1_a
>     $$

## functors

_structure preserving maps between categories_

- **covariant** functor $F: C \to D$ (functor $F$ from category $C$ to $D$) [^item] such that the following holds:
  - For every _object_ x in $C$ then $F(1_x) = 1_{F(x)}$
  - for all morphism $f: x\to y$ and $g: y \to z$ $F(g \circ f) = F(g) \circ F(f)$

[^item]: * $\forall x \in C \space \exists \space \text{ob}(F(x)) \mid F(x) \in D$
    * $\forall f: x \to y, f \in C \space \exists \space \text{mor}(F(f)): F(x) \to F(y) \mid  F(f) \in D$

- **contravariant** functor acts as _covariant_ functors from _opposite category_ $C^{\text{op}}$ to $D$

## isomorphism invariance

> All categorical constructions that we covered (products/coproducts, initial/terminal objects, functional objects in logic) are isomorphism-invariant. Or, equivalently, they define an objects up to an isomorphism.

> \[!tip\] Important
>
> In short, in category theory **isomorphism = equality**

