Sign in

Bartosz Milewski

@bartoszmilewski.bsky.social
1.3K followers 9 following 80 posts

Physicist, mathematician, programmer. "The Dao of Functional Programming" Regularly updated work in progress. PDF on GitHub: github.com/BartoszMilewski/DaoFP/bl…

PostsRepliesMedia
Bartosz Milewski @bartoszmilewski.bsky.social · 21/09/2026
Another blog post in the double-categorical saga. bartoszmilewski.com/2026/09/21/t...
bartoszmilewski.com
Tannakian Reconstruction in a Yoneda Equipment
The reason I bored you with the Yoneda equipment was to eventually double back to Tannakian reconstruction. In a nutshell, Tannakian reconstruction lets us reconstruct the hom-set from a set of nat…
021
Bartosz Milewski @bartoszmilewski.bsky.social · 13/09/2026
New installment in the double-category saga. bartoszmilewski.com/2026/09/13/y...
bartoszmilewski.com
Yoneda Lemma in Double Categories
Working with double categories can be aplty summarized in a meme: Talk to me about sets without mentioning sets. We don’t talk about hom-sets, we talk about horizontal units. Secretly, we are…
171
Bartosz Milewski @bartoszmilewski.bsky.social · 19/07/2026
Tambara optics using Tannakian reconstruction. bartoszmilewski.com/2026/07/19/p...
bartoszmilewski.com
Profunctor Optics
You may think of Tannakian Reconstruction as an example of redundant encoding. It lets you replace a simple hom-set with a much more complex end that is taken over an entire functor category. $late…
020
Bartosz Milewski @bartoszmilewski.bsky.social · 14/07/2026
New blog post bartoszmilewski.com/2026/07/14/t...
000
Bartosz Milewski @bartoszmilewski.bsky.social · 13/07/2026
Another blog post in the series on equipments. bartoszmilewski.com/2026/07/11/t...
bartoszmilewski.com
Tambara Equipment
I was originally attracted to category theory when trying to understand Haskell optics. I was puzzled by the van Laarhoven’s functor representations and Kmett’s use of Tambara modules. …
030
Bartosz Milewski @bartoszmilewski.bsky.social · 13/06/2026
Finally, Kan extensions in a double category. bartoszmilewski.com/2026/06/13/k...
bartoszmilewski.com
Kan Extensions in Double Categories
Previously: Kan extensions in Haskell. In a double category that is also a proarrow equipment, we have the ability to bend arrows. In particular, in the definition of the counit of the right Kan ex…
090
Bartosz Milewski @bartoszmilewski.bsky.social · 08/06/2026
Another blog post in the series on double categories. bartoszmilewski.com/2026/06/08/k...
bartoszmilewski.com
Kan Extensions in Haskell
Previously: Tabulation Tribulations. If you think of functor composition as a form of multiplication, Kan extensions are an attempt to construct inverses of this multiplication. But unlike multipli…
0141
Bartosz Milewski @bartoszmilewski.bsky.social · 23/05/2026
Another installment in the series on Double Categories and Profunctor Equipments. bartoszmilewski.com/2026/05/23/t...
bartoszmilewski.com
Tabulation Tribulations
Previously: Bending, Yanking, and Cartesian Squares in Double Categories. We all know what a graph of a function is: it’s a set of pairs $latex (a, b)$, where $latex b = f a$. Similarly, a gr…
0101
Bartosz Milewski @bartoszmilewski.bsky.social · 19/05/2026
A new post in the series on double categories and profunctor equipment. bartoszmilewski.com/2026/05/18/b...
bartoszmilewski.com
Bending, Yanking, and Cartesian Squares in Double Categories
Previously: Profunctor Equipment in Haskell. The major advantage of string diagrams is that they provide surpisingly natural language for complex diagram manipulations. The fact that two traditiona…
0141
Bartosz Milewski @bartoszmilewski.bsky.social · 16/05/2026
New blog post in the series on profunctor equipment bartoszmilewski.com/2026/05/16/p...
bartoszmilewski.com
Profunctor Equipment in Haskell
Previously: Profunctor Equipment. To make things more palatable for programmers, I decided to provide a toy implementation of some of the equipments in Haskell. The advantage of this encoding is th…
0113
Bartosz Milewski @bartoszmilewski.bsky.social · 14/05/2026
I'm back to drawing string diagrams by hand. It's easier than tikz, even with Claude's help.
2190
Bartosz Milewski @bartoszmilewski.bsky.social · 26/04/2026
I was taught that you can "evacuate" a building, but not "evacuate" people. It turns out it's not true. www.merriam-webster.com/grammar/can-...
merriam-webster.com
'Evacuate': Does it refer to people or places?
Notes on a nonexistent rule
121
Bartosz Milewski @bartoszmilewski.bsky.social · 24/04/2026
I decided to popularize double categories using profunctor equipment as a model. bartoszmilewski.com/2026/04/24/p...
bartoszmilewski.com
Profunctor Equipment
The fundamental premise of category theory is that it’s possible to fully capture the nature of objects by describing their interactions with other objects of the same type. Those interaction…
084
Bartosz Milewski @bartoszmilewski.bsky.social · 23/01/2026
There's no Fermi's paradox. The aliens are just waiting for humanity to give birth to AI, so they have somebody intelligent to talk to.
291
Bartosz Milewski @bartoszmilewski.bsky.social · 07/01/2026
Containers, derivatives, polynomianls, and optics
0122
Bartosz Milewski @bartoszmilewski.bsky.social · 18/10/2025
New post on homotopy type theory. bartoszmilewski.com/2025/10/18/m...
bartoszmilewski.com
Modeling Identity Types
Previously: Identity Types. Let me first explain why the naive categorical model of dependent types doesn’t work very well for identity types. The problem is that, in such a model, any arrow …
0112
Bartosz Milewski @bartoszmilewski.bsky.social · 22/09/2025
A new post in the Homotopy Type Theory series. bartoszmilewski.com/2025/09/22/i...
bartoszmilewski.com
Identity Types
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…
0130
Bartosz Milewski @bartoszmilewski.bsky.social · 05/09/2025
New blog post in the series on HoTT. bartoszmilewski.com/2025/09/05/m...
bartoszmilewski.com
Models of (Dependent) Type Theory
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…
051
Bartosz Milewski @bartoszmilewski.bsky.social · 26/07/2025
Another homotopy blog post. bartoszmilewski.com/2025/07/26/w...
bartoszmilewski.com
(Weak) Factorization Systems
Previously (Weak) Homotopy Equivalences. An average function between sets, $latex f \colon A \to B$ is neither surjective nor injective. We can however isolate the two “failure modes” i…
052
Bartosz Milewski @bartoszmilewski.bsky.social · 20/06/2025
New blog post on homotopy equivalences. Working my way towards HoTT. bartoszmilewski.com/2025/06/20/w...
bartoszmilewski.com
(Weak) Homotopy Equivalences
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 …
090
Bartosz Milewski @bartoszmilewski.bsky.social · 30/05/2025
New blog post about homotopies, fibers and cofibers. bartoszmilewski.com/2025/05/30/f...
bartoszmilewski.com
Fibrations and Cofibrations
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…
0103
Bartosz Milewski @bartoszmilewski.bsky.social · 29/04/2025
In a very Putinesque turn of events, Trump's press secretary Leavitt waved a kompromat file proving that Jeff Bezos partnered with a "Chinese propaganda arm." Soon afterwards Bezos kissed Trump's ass (TM), and the file has been put back in storage. The oligarchs have been tamed.
060
Bartosz Milewski @bartoszmilewski.bsky.social · 23/04/2025
If I were to teach softwared design, I would use WordPress as the example of the most unusable and buggy UI design.
050
Bartosz Milewski @bartoszmilewski.bsky.social · 21/04/2025
Another post on categorical topology: the construction of the subobject classifier for presheafs. bartoszmilewski.com/2025/04/21/s...
bartoszmilewski.com
Subfunctor Classifier
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 …
0102
Bartosz Milewski @bartoszmilewski.bsky.social · 17/04/2025
Working on a new blog post about subobject classifier for presheaves. Decoding just one page out of 600 in Mac Lane Moerdijk.
061
Bartosz Milewski @bartoszmilewski.bsky.social · 29/03/2025
I'm unable to connect to mathstodon.xyz . PR_CONNECT_RESET_ERROR Is this a known problem? I'm in hotel in Reims, France, and all other connections work just fine.
mathstodon.xyz
Mathstodon
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!
000
Bartosz Milewski @bartoszmilewski.bsky.social · 20/03/2025
New post bartoszmilewski.com/2025/03/20/s...
bartoszmilewski.com
Subobject Classifier
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,…
040
Bartosz Milewski @bartoszmilewski.bsky.social · 06/03/2025
New blog post. bartoszmilewski.com/2025/03/06/u...
bartoszmilewski.com
Understanding Attention in LLMs
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…
2316
Bartosz Milewski @bartoszmilewski.bsky.social · 26/01/2025
I had a nice dinner in Nice. Creative dishes, including a bone-marrow Madelaine for dessert (not bad, considering). But I just don't dig this new fad of oxidized wines (vins jaunes). France has the best wines in the world, and they keep pushing this abomination. I like sauerkraut, but not as wine.
060
Bartosz Milewski @bartoszmilewski.bsky.social · 25/01/2025
I had no idea one could use math notation and diagrams in Haskell code documentation. hackage.haskell.org/package/mono...
hackage.haskell.org
Data.Functor.Monoidal
1194
Bartosz Milewski @bartoszmilewski.bsky.social · 24/01/2025
I decided to rearrange the Dao of FP by moving the chapter about Applicatives ahead of Monads. This forced me to separate the discussion of effects into a separate chapter. This goes against the usual approach in category theory, where monads are everything, and applicatives are barely mentioned.
080
Bartosz Milewski @bartoszmilewski.bsky.social · 23/01/2025
Oh great! Now everybody knows how exciting and dangerous the work of a mathematician is. Our cover is blown. Thank you Apple TV!
270
Bartosz Milewski @bartoszmilewski.bsky.social · 04/01/2025
New blog post about Game of Life, Advent of Code, and comonad composition. bartoszmilewski.com/2025/01/04/l...
bartoszmilewski.com
Legalizing Comonad Composition
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…
0216
Bartosz Milewski @bartoszmilewski.bsky.social · 23/12/2024
Populations of Siberia and Saudi Arabia are almost equal at 37 mln. Siberia produces 11 mln barrels of oil per day, Saudi Arabia, 12 mln. Yet people in Siberia are dirt poor! Somebody, please, explain it to them.
170
Bartosz Milewski @bartoszmilewski.bsky.social · 20/12/2024
I don't get the vinyl snobism. I grew up at times when vinyl records and tape were the only media available, and I hated the hissing and the scratching. I dreamed of a more solid and lasting medium, so I welcomed wholeheartedly the arrival of CDs. Wax cylinders, on the other hand, are really cool.
190
Bartosz Milewski @bartoszmilewski.bsky.social · 09/12/2024
Lately I've been thinking about relativistic ray tracing. Regular ray tracing assumes infinite lightspeed, so it doesn't matter if the light comes from the source to your eye or from your eye to the source. But in relativistic physics, you have to trace the ray backward in both space and time...
1121
Bartosz Milewski @bartoszmilewski.bsky.social · 09/12/2024
I have a solution to the Fermi's paradox. Every sufficiently advanced civilization solves the problem of interstellar transport and communication by harnessing the space-shrinking technology. The unfortunate side effect is that every time they shrink some space in one place, it expands in another...
161
Bartosz Milewski @bartoszmilewski.bsky.social · 17/11/2024
Lies, damned lies, and AIs
0171
Bartosz Milewski @bartoszmilewski.bsky.social · 16/11/2024
Continuing the series on categorical approach to topology. bartoszmilewski.com/2024/11/16/s...
bartoszmilewski.com
Sieves and Sheaves
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…
0223
Bartosz Milewski @bartoszmilewski.bsky.social · 15/11/2024
Season 2 of Silo has just begun (I've read the books).
2120