Licenses Are Functors
Software licenses have algebraic structure. Not metaphorically. The operations are composition and aggregation, and they behave like a semiring.
The derivation category
Every derivative work has a source. Milewski wrote a blog post. I translated it to Python. Someone forks my translation. Each step is a morphism in a category where the objects are works and the arrows are derivations.
Derivations compose: if A derives from B and B derives from C, then A derives from C. Every work has an identity derivation (itself, unmodified). That’s a category.
The obligation functor
A license is a functor from the derivation category to a category of obligations. It maps each work to a set of permissions, and each derivation arrow to a rule for how those permissions propagate.
CC BY maps every derivation to one obligation: credit the source. The functor preserves composition: if A derives from B derives from C, credit both B and C.
CC BY-SA maps every derivation to two obligations: credit the source, and license the derivative the same way. The share-alike clause is the natural transformation that makes the obligation recursive.
CC BY-SA-NS adds a third: credit, share-alike, and if you serve the derivative over a network, share the source. Same functor, one more component.
The semiring
Combine two works as a derivative and the stricter license absorbs (CC BY-SA ⊗ MIT = CC BY-SA, a lattice join); bundle them side by side and each keeps its own license (a product).
Join for derivation, product for aggregation. Semiring.
The algebra is the same one that governs type-level arithmetic:
| License | Semiring role | Rule |
|---|---|---|
| AGPL | absorber | AGPL ⊗ anything = AGPL |
| MIT | one | contributes no obligation |
| Public domain | zero | absorbs nothing |
Canon compounds
Canon is the CC BY-SA functor applied to a growing derivation graph. Copyleft is irrevocable, so the graph can only grow. The functor maps the growth of the corpus to the growth of the obligation surface. It scales with the category it acts on.
PageLeft is the index of the image. It stores what the functor produces: copyleft works, their derivation chains, their attribution edges. Search over the image, and you search over the obligation graph.
Every link above goes to a runnable REPL where you can modify the example. The vocabulary is not decorative.