Unreasonable Effectiveness of Compositional Thinking

things to do

LATER figure out a good example to work through the category theory intro (cracking eggs into an omelette?)

functor is make it plant based?

LATER llm semantic triples, neural networks?

LATER map and territory in intro

LATER forward email

DONE email

subject

5/5 a convivial convening on composition

email

Some of you have heard about category theory, maybe from me, maybe from Gioele Zardini’s talks on co-design, or maybe from the person at INCOSE who said that “all systems engineering is a footnote on category theory” (or something like that, I wasn’t there).

For anyone who is interested, a few of us are dedicating an hour next Monday, May 5th, to discussing this. I will bring some material to talk through, but it will mostly be an open discussion with the following light agenda:

conception (immaculate) -> philosophical intuitions behind why composition may be a foundational concept

construction (formal) -> a visual, not-at-all-mathy introduction to category theory

conversation (dangling) -> is this a universal language of system dynamics, co-design, language, and logic? if so, so what?

If interested, join us on Monday, May 5th at 5pm in 1-379. I’ll bring snacks so please RSVP here if you intend to join.

Best,

Deniz

goals

to communicate some of the intuitions why some people find category theory compelling

to show why

other name ideas

unreasonable effectiveness of composition in human systems

Composing and comparing: a convivial collaborative convention on (mathematical) categories and their (practical) consequences

structure

(immaculate) conception: an exploration of intuitions behind systems and thoughts

(de)composition

on intuition of composition

some simple examples

movement

cooking

any set of actions that can be tied together

eg open the door, then walk into the room

but if the door is open i dont need to open the door, so maybe it’s

check if the door is open

if it’s open, walk in the room

if it’s not open, open the door, then walk in the room

what i’m trying to do is to communicate some of the reason why i’m attracted to some of these ideas

physics of systems?

What is a system?

a process that takes some inputs and produces some outputs

transformer

system dynamics example?

A system is composed of components. A component is something you understand.

functional and formal decomp

physics of thought?

let’s say thoughts and language are interchangeable for now

semantic triples, resource description framework

thoughts are essentially references to other thoughts

why is a raven like a writing desk

physics of logic?

physics of causality?

Space time requires us to think about movement as something that traverses both space and time and because of that that’s where composition comes from the idea that transformation happens and something stays invariant

(formal) construction: intro to category theory

what is a category?

dots and arrows

identity

composition

associativity

what emerges from this structure?

diagrams commute

isomorphism

universal properties

terminal, initial objects

“bestness” and uniqueness

limits, products

enriched categories

morphisms with structure

$\infty$-categories

morphisms between morphisms (and beyond)

(can anyone see the punchline?)

categories of categories

Cat: a category whose objects are categories

functors

maps between categories

morphisms in Cat

natural transformations

morphisms between functors

“translations between translations”

some sketches: examples like logic, co-design, system dynamics, etc

conversation

concerns

consequences

examples

meta-reflexivity and levels of abstraction

Why Category Theory is Uniquely Meta-Reflective

Category theory allows you to walk up and down abstraction levels using the same constructions.

It’s self-similar:

Categories have morphisms

Categories themselves are objects in Cat

Functors are morphisms in Cat

Natural transformations are morphisms between functors

This continues into 2-Cat, n-Cat, ∞-categories

You can model structure about structure without leaving the language of categories.

How other fields compare

Set theory

Foundational, but not self-reflective

Can’t form the set of all sets → paradoxes

Algebra

Powerful, but “algebras of algebras” are not coherent as a general notion

Analysis

Doesn’t scale to describing itself

Logic / Type theory

Some self-reflection (e.g., universe levels), but often needs a meta-system

Related to category theory via Curry–Howard–Lambek

Conclusion

Category theory is rare in that it uses its own tools to describe itself

This makes it uniquely powerful as a mathematics of mathematics

category, functor, natural transformation

Category Theory Example: Applied to a Database

Category = Schema

Objects:

Person

City

Morphism:

$lives_in: \text{Person} \to \text{City}$ (a foreign key relation)

This forms a category: objects and structure-preserving relationships.

Functor = Dataset

A functor $F: \mathcal{C} \to \mathbf{Set}$ assigns:

$F(\text{Person}) = {\text{Alice},\ \text{Bob}}$

$F(\text{City}) = {\text{Boston},\ \text{LA}}$

$F(\text{lives_in}) = {(\text{Alice},\ \text{Boston}),\ (\text{Bob},\ \text{LA})}$

This is one instance of data fitting the schema’s shape.

Another Functor = Updated Dataset

A second functor $G$ assigns:

$G(\text{Person}) = {\text{Alice},\ \text{Bob}}$

$G(\text{City}) = {\text{Boston},\ \text{LA}}$

$G(\text{lives_in}) = {(\text{Alice},\ \text{LA}),\ (\text{Bob},\ \text{LA})}$

Same schema, different data (e.g., Alice moved to LA).

Natural Transformation = Data Migration

A natural transformation $\eta: F \Rightarrow G$ maps data:

$\eta_{\text{Person}}$: identity on people

$\eta_{\text{City}}$: identity on cities

But updates how $lives_in$ points

This satisfies the naturality condition:

$G(lives_in) \circ \eta_{\text{Person}} = \eta_{\text{City}} \circ F(lives_in)$

So the structure (foreign key logic) is preserved even after the data update.

just start writing

composition is a consequence of causality

i’d like to reference some dead white men (DWMs)

i’d also like to reference some dead not-only-white not-only-men (DNNs)

what are we asking

in the original essay, wigner tries to answer the question of why mathematics seems to be the right, or best, language for physics

here, we will try to answer a question that either assumes mathematics is the right, or best, language for physics, or if it does not assume it, it at least feels like a question that sibling trajectory

why are composable steps at the core of every system we conceive of?

it’s not obvious that processes must be made up of composable steps

why is causality a chain? why is logic made up of steps?

causality as a chain

hume questioned the necessity of causal connection, saw it as a habit of mind

x causes y if, had x not happened, y wouldn’t have happened

rooted in possible worlds logic

judea pearl uses directed acyclic graphs explicitly

logic made up of steps

frege / bertrand russell / Whitehead, formal logic as stepwise derivation

ludwig wittgenstein logical form as mirrored in the structure of reality, atomic facts compose into more complex facts

brouwer in intuitionism, logic is a constructive mental activity, the steps come from the “mind’s unfolding”

under the hood

why is logic made up of steps

identifying invariance across time makes it so that if we can get from a to b, and we know we can get from b to c, then we know that we can get from a to c. but sometimes things come up on our way from a to b. that’s fine, but that lies outside of the boundary we draw of what we are going to consider. when we draw a boundary, we decide what compositions we care about, and what invariances we will trust.

this “invariance” is a lot like reducing side effects in functional programming

a fundamental question

is this “composition” something that we are discovering in the world, or something we’ve invented?

much like the question of whether mathematics is discovered or invented

what would it look like to have a language for this universal phenomenon we call composition

things

transformations

to be

first, this language must be able to state that things exist

dot with an arrow pointing to itself

to transform

in order for the language to represent more than a universe in complete stasis, we must support transformations

two dots with an arrow going from one dot to the other

examples

mixing paints

deniz is alive

two eggs becomes an omelette

but there might be many paths here

two transformations, one after the other

composition

three transformations, done in any order

associativity

what are some interesting findings in this language

isomorphism