Knowledge
you can run.
The Category Theory & ML Wiki is where MathStruct keeps what it knows: one note per concept, its sources cited to the exercise, a diagram where one helps, and code in Julia, Lean 4 and Haskell. Lenticulum.jl and Sophia document themselves in the same format and link here for the theory, so the notes of every project form one graph of knowledge and code.
- 347 concepts
- ~490 exercises, solved
- 67 papers
- Obsidian vault
- First draft
Functors L : 𝒞 → 𝒟 and R : 𝒟 → 𝒞 are adjoint, L ⊣ R, if there is a bijection
𝒞(c, R d) ≅ 𝒟(L c, d)
natural in c and d.
Sources 7 Sketches §3.4.2, Def. 3.70 · DaoFP Ch. 10 · CTfS §5.1
#check CategoryTheory.Adjunction
#check CategoryTheory.Adjunction.toMonad
#check CategoryTheory.exp.adjunction Opens Monad · Kleisli category · Data migration
First draft The notes were drafted with an AI from four books and lecture series and some seventy papers, and are being checked against them. This page shows the vault as it is, and the knowledge graph it is being turned into.
Pick a goal, light the way.
Twenty-two notes of the wiki and the two projects that rest on them, drawn as a prerequisite graph. Click a note to read about it and mark it as known: whatever you can read next lights up. Choose a goal and the route to it is drawn, shortest first.
The notes, their sources, their first Lean lines and the link counts are the vault’s; the prerequisites follow Start Here’s order of study and are drawn by hand. Your progress stays in this browser. In the wiki itself, links do not yet say which note comes first: that is the first item of the plan below.
Several hundred notes, linked.
An Obsidian vault, published at mathstruct.org/CategoryTheory-ML-Wiki with the same Quartz as every MathStruct site. Read it in the browser, or clone it and open it in Obsidian or Moonkale.
- Concepts
347 concept notes
One per definition, theorem or construction, from sets and preorders to Kan extensions, Markov categories and e-graphs.
- Sources
Four books, 67 papers
Seven Sketches, Category Theory for Scientists, The Dao of Functional Programming and the Kittenlab.jl lectures; each paper has its own note.
- Reconciled
Exact references
Every note ends its definition with a Sources line: section, definition and exercise numbers, book by book.
- Exercises
About 490, with solutions
Thirty chapter notes, one heading per exercise, each linked to a worked solution and back.
- Code
Julia, Lean 4, Haskell
Tabs in nearly 300 notes. The Julia was run against Catlab 0.16; Lean gives the Mathlib names; Haskell the idiom.
- Diagrams
Commutative diagrams
tikz-cd in 52 notes, compiled to SVG when the site is built, with a dark variant of each.
- Order
A study plan
Stages 0–4 for the core, then six tracks: applied, programming, dependent types, advanced, machine learning, compilers and databases.
- Linked
188 project notes link here
121 notes of Lenticulum.jl’s vault and 67 of Sophia’s cite these notes for the theory and keep only what is their own.
Every project writes this way.
A concept note in the wiki, a design note in Lenticulum.jl’s vault and a specification in Sophia’s share one shape. A project note keeps what is its own and links to the wiki for the general concept, so the theory is written once and every project can find it.
| In the note | What it holds |
|---|---|
| #definition #theorem | a tag line: what kind of note this is |
| the definition | in the notation of the vault, with links to what it uses |
| the bullets | what each source adds, reconciled in one place |
| > Sources: | section, definition and exercise numbers in each book or paper |
| ```tikz | a commutative diagram, compiled when the site is built |
| ````tabs | Julia, Lean 4 and Haskell; a Builds on: line names the notes whose code must run first |
A first draft, being rebuilt.
The vault already works as a reference and is linked from the projects. It is not yet the knowledge graph it is meant to be, and not yet a good place to learn from on your own.
Solid today
- One note per concept, with the sources reconciled and cited to the exercise
- Exercises and worked solutions, linked both ways
- Julia tabs run against Catlab 0.16; Lean tabs name Mathlib declarations
- A study order: Stages 0–4, then Tracks A–F towards Lenticulum.jl and Sophia
- Published with TikZ, tabs and KaTeX; the project vaults link into it
Known limits
- A first draft: the notes were written with an AI from the sources, and not every claim has been checked against the books and papers yet
- Links say that two notes are related, not how: prerequisite, generalisation, example and implementation look the same
- The code is not run by CI; Lean tabs are mostly #check lines, not proofs
- One flat folder of notes, in one subject; ML, databases and compilers appear only through category theory
Where it goes
- 01
Typed links
Front matter that says why two notes are linked: needs, generalises, example of, implemented by, tested by. The learning map above is drawn from such links, here by hand.
- 02
Code that is checked
Every Julia tab run in CI against a pinned Catlab, every Lean tab compiled against Mathlib, every Haskell tab with GHC. A note whose code breaks says so.
- 03
One graph in Moonkale
The wiki, the project vaults and the projects’ code opened as one graph: a concept, the design note that uses it and the function that implements it, side by side.
- 04
Learning paths
Routes through the prerequisite graph to a goal, exercises as review cards, and progress kept as a map: what you know, what you can read next.
- 05
Beyond category theory
Machine learning, databases and compiler engineering in the same format: one note per concept, sources cited, code that runs.
- 06
Learning software
Small tools built on the graph: exercises with checked answers, diagrams to complete, the code of a note to run and change in the browser.
Six ways in, one vault.
Start Here explains the conventions and proposes an order of study; the Map of Content lists every note by topic. Or begin from where you come from.
- Coming from programming Category, Functor, Natural Transformation, then Track B with the Haskell tabs
- Coming from mathematics Stages 1–4 in order, then Track A; the Lean tabs name what to formalise
- Coming from the sciences Stage 0, then database schemas, C-sets, data migration, sheaves and Markov chains
- Coming from machine learning Stage 2 quickly, then Track E: lenses, Markov categories, statistical games
- Coming from compilers or databases Stage 2, Track B, then Track F: e-graphs, conjunctive queries, Datalog
- Wanting to compute Install Catlab 0.16, then the Julia tabs of C-Set, Data Migration and Colimit
Learn with us, or correct us.
Found a definition that does not match its source, a Julia tab that no longer runs, or a concept that is missing? Open an issue or a pull request. If you want to learn category theory for machine learning, databases or compilers, tell us where the vault lost you: that is the part we rebuild first.