Previously: Coverages and Sites The definition of a sheaf is rather complex and involves several layers of abstraction. To help us navigate this maze we can use some useful intuitions. One such int…| Bartosz Milewski's Programming Cafe
Previously: Models of (Dependent) Type Theory. There is a deep connection between mathematics and programming. Computer programs deal with such mathematical objects as numbers, vectors, monoids, fu…| Bartosz Milewski's Programming Cafe
1 post published by Bartosz Milewski during September 2025| Bartosz Milewski's Programming Cafe
Previously: (Weak) Factorization Systems. It’s been known since Lambek that typed lambda calculus can be modeled in a cartesian closed category, CCC. Cartesian means that you can form product…| Bartosz Milewski's Programming Cafe
3 posts published by Bartosz Milewski during October 2024| Bartosz Milewski's Programming Cafe
Previously (Weak) Homotopy Equivalences. An average function between sets, is neither surjective nor injective. We can however isolate the two “failure modes” if we insert a third set in between. We can, for instance, pick this set to be the subset of that is the image of under . We then define to be the […]| Bartosz Milewski's Programming Cafe
Previously: Fibrations and Cofibrations. In topology, we say that two shapes are the same if there is a homeomorphism– an invertible continuous map– between them. Continuity means that …| Bartosz Milewski's Programming Cafe
We are used to thinking of a mapping as either being invertible or not. It’s a yes or no question. A mapping between sets is invertible if it’s both injective and surjective. It means t…| Bartosz Milewski's Programming Cafe
Previously: Subobject Classifier. In category theory, objects are devoid of internal structure. We’ve seen however that in certain categories we can define relationships between objects that …| Bartosz Milewski's Programming Cafe
Proviously Sieves and Sheaves. We have seen how topology can be defined by working with sets of continuous functions over coverages. Categorically speaking, a coverage is a special case of a sieve,…| Bartosz Milewski's Programming Cafe
There are many excellent AI papers and tutorials that explain the attention pattern in Large Language Models. But this essentially simple pattern is often obscured by implementation details and opt…| Bartosz Milewski's Programming Cafe
The yearly Advent of Code is always a source of interesting coding challenges. You can often solve them the easy way, or spend days trying to solve them “the right way.” I personally pr…| Bartosz Milewski's Programming Cafe
Previously: Covering Sieves. We’ve seen an intuitive description of presheaves as virtual objects. We can use the same trick to visualize natural transformations. A natural transformation can be drawn as a virtual arrow between two virtual objects corresponding to two presheaves and . Indeed, for every , seen as an arrow , we get an […]| Bartosz Milewski's Programming Cafe
Previously: Sheaves as Virtual Objects. In order to define a sheaf, we have to start with coverage. A coverage defines, for every object $latex u$, a family of covers that satisfy the sub-coverage …| Bartosz Milewski's Programming Cafe
Previously: Sheaves and Topology. In our quest to rewrite topology using the language of category theory we introduced the category of open sets with set inclusions as morphisms. But when we needed…| Bartosz Milewski's Programming Cafe
Previously: Presheaves and Topology. In all branches of science we sooner or later encounter the global vs. local duality. Topology is no different. In topology we have the global definition of con…| Bartosz Milewski's Programming Cafe
Previously: Topology as a Dietary Choice. Category theory lets us change the focus from individual objects to relationships between them. Since topology is defined using open sets, we’d start…| Bartosz Milewski's Programming Cafe
What is Topology? When talking about topology, people draw cups with handles turning into donuts. When I think of topology, I see nutritious food. In mathematics, topology is defined as a family of…| Bartosz Milewski's Programming Cafe
This is part 15 of Categories for Programmers. Previously: Representable Functors. See the Table of Contents. Most constructions in category theory are generalizations of results from other more sp…| Bartosz Milewski's Programming Cafe
This is part 14 of Categories for Programmers. Previously: Free Monoids. See the Table of Contents. It’s about time we had a little talk about sets. Mathematicians have a love/hate relationsh…| Bartosz Milewski's Programming Cafe
A PDF of this post is available on github Motivation Lenses seem to pop up in most unexpected places. Recently a new type of lens showed up as a set of morphisms between polynomial functors. This l…| Bartosz Milewski's Programming Cafe
Table of Contents Part One Category: The Essence of Composition Types and Functions Categories Great and Small Kleisli Categories Products and Coproducts Simple Algebraic Data Types Functors Functo…| Bartosz Milewski's Programming Cafe