← Projects · Foundation

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
Adjunction.md #definition #example #theorem #proof

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

A note, shortened: definition, diagram, sources, code, and where it leads

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.

Try it

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.

Goal
0 / 22 known
Category Functor Naturaltransformation Adjunction Monad Kleislicategory Monoidalcategory Stringdiagram Copy-discardcategory Markovcategory Bayesianinversion Lens Parametriclens Bayesianlens Statisticalgame C-set Datamigration Conjunctivequery Least fixedpoint Initialalgebra Congruence E-graph Lenticulum.jl Sophia

Sources
Code
Julia · Lean · Haskell
Linked from
Needs
Opens
Read the note →

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.

In the vault today

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.

One format

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 noteWhat it holds
#definition #theorema tag line: what kind of note this is
the definitionin the notation of the vault, with links to what it uses
the bulletswhat each source adds, reconciled in one place
> Sources:section, definition and exercise numbers in each book or paper
```tikza commutative diagram, compiled when the site is built
````tabsJulia, Lean 4 and Haskell; a Builds on: line names the notes whose code must run first
THE WIKI concepts PROJECT VAULTS design, decisions CODE in Sophia, planned Bayesian lens Statistical game E-graph Lenticulum note Lenticulum note Sophia spec Julia function a test Rust module
Solid: linked today · dashed: planned, through Sophia’s content ids and Moonkale’s graph
Where it stands

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 05

    Beyond category theory

    Machine learning, databases and compiler engineering in the same format: one note per concept, sources cited, code that runs.

  6. 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.

Get involved

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.