Category Theory

Table of Contents

1. Category Theory

1.2. Learn category theory   learn

1.3. Category theory apply to everything

1.3.1. Why I am learning category theory | the scapegoat dev

As described in the previous paragraph, I build software by drawing boxes and arrows first and refining them until I can encode them as software.

This structural approach encompasses much more than just code and data structures. I apply it to:

  • product thinking
  • communication structures
  • schema design and evolution (database design, data schema evolution)
  • logging and debugging (events, logging schema)
  • runtime behavior (event loops, state machines, sequence diagrams)
  • module and codebase decoupling
  • software engineering workflow (git workflow, issues, and project management)

1.4. Applied Category Theory

https://arxiv.org/pdf/1609.05382.pdf
Table 6.1: Analogies between variables in various physical settings
(Es como lo que vi en termodinámica del no equilibrio)
También habla de sistemas abiertos vs sistemas cerrados

1.11. Category Theory for Programmers: The Preface |   Bartosz Milewski’s Programming Cafe

1.13. Ordering and graphs

Order Graph
Preorder Direct cyclic graph
Partial order Direct acyclyc graph
Total order Sequence
Preorder
reflexive (\[a \le a \forall a \in P\]), transitive (\[\text{if } a \le b \text{ and } b \le c \text{ then } a \le \forall a,b,c \in P \])
an antisymmetric preorder is a partial order, and a symmetric preorder is an equivalence relation
Partial order
reflexive, transitive, and antisymmetric (\[\text{ if } a \le b \text{ and } b \le a \text { then } a = b\])
No two distinct elements precede each other. Some pairs are incomparable, with neither being greater/lesser
Lamport timestamps for example are partial orders
Total order
reflexive, transitive, antisymmetric and strongly connected (\[a < b \text{ if not } a \ge b\])
Strictness
All definitions become strict if equality is not allowed

1.14. Examples of Functors

  • Async/Lazy functor
    • a → a | Promise/Future
    • function composition becomes callbacks
  • A Group representation
  • The transpose operator on vector spaces, the adjoint/hermitian transpose on Hilbert spaces
  • The Laplace transform
  • Every Homomorphism is a Functor
    The Functor is an extension of the Homomorphism to many other structures that either do not have an underlying set, or are not algebraic (for examples partial order, or relationships of inclusion in a set)
  • Canonical (Legendre) transformations
    Between Lagrangian and Hamiltonian
  • Functor, Applicative and Monad instances for Reader Full implementation

1.14.1. Examples of bifunctors

1.15. Examples of Monoids and Groups

1.16. Examples of Monads

1.16.2. Free Monoid & Free Applicative

1.17. Anamorphism and Catamorphism

Producer-consumer problem
Catamorphism → fold (consumers)
Anamorphism → unfold (generators, producers)
https://thealmarty.com/2022/09/06/anamorphisms-aka-unfolds-explained/
https://bartoszmilewski.com/2022/04/05/teaching-optics-through-conspiracy-theories/
Producers and consumers correspond to covariant and contravariant functors

1.18. Derivadas, árboles, negativos y fraccionales de tipos

https://news.ycombinator.com/item?id=5196708
Derivadas → permite añadir un subárbol a un árbol existente
Árboles
Negativos y fraccionales
Un logaritmo es una llamada a una función? Tiene que estar en la misma base en la que está para que coincidan sus tipos

1.19. Thin Category

https://en.wikipedia.org/wiki/Posetal_category

a posetal category, or thin category is a category whose homsets each contain at most one morphism. As such, a posetal category amounts to a preordered class (or a preordered set, if its objects form a set).

1.20. Random

1.23. https://bartoszmilewski.com/2014/12/23/kleisli-categories/

Composition of Logs is the Writer Monad

1.24. John Baez

Author: Julian Lopez Carballal

Created: 2024-10-21 Mon 08:23