Skip to content

Lesson 02 · Structure

Operads: The Algebra of Multi-ary Composition

Define an operad (operations, composition, unit, equivariance) and compose operations along a tree.

~16 min Operads as Composition Laws
operadn-ary-operationoperadic-compositionunit-operationsymmetric-action

Beyond binary composition

Ordinary categories compose morphisms two at a time. Many designs need n-ary slots: a circuit with three subcircuits, a pipeline stage that fans in four streams, a UI layout with a variable number of children. An operad packages those multi-ary operations and how they nest.

Compose operations along a tree

Operad composition tree

Operad tree: α ∘ (β, γ) has arity 4α ∈ P(2)β ∈ P(3)γ ∈ P(1)x1x2x3x4

Nested form: α ∘ (β, γ) lives in P(3+1)=P(4). Tree shape encodes substitution.

Reading an operad operation

Read arity

P(n) means n input slots, one output slot.

The composition cycle

P

Operad structure

Ops

Families P(n)

Why the axioms matter for engineers

Associativity of operadic composition means hierarchical nesting is unambiguous: regrouping subassemblies does not change the composite operation. The unit means “do nothing” is a first-class 1-ary operation — identity adapters, pass-through wires, no-op stages. Equivariance means renaming or reordering ports is coherent with composition, not a special case that breaks glue.

Build a composition tree by hand

  1. 01Choose a root operation and write its arity n.
  2. 02For each of the n inputs, either leave a leaf (contributes 1 to total arity) or attach a child operation.
  3. 03Sum the leaf counts — that is the arity of the composite.
  4. 04Check the unit law mentally: inserting a pass-through 1 on any edge must not change the operation.
  5. 05Check associativity: regroup a subtree; the flat list of leaves and the root decorations must match.

Check yourself

Retrieval practice — feedback explains why.

Q1If θ ∈ P(2), φ ∈ P(3), ψ ∈ P(1), the composite θ ∘ (φ, ψ) has arity:
Q2The unit 1 ∈ P(1) satisfies:
Q3The term “operad” was coined by:

Explain it back

Pick a multi-input operation from your domain (merge, reduce, layout, orchestrate). What would its operadic arities and composition tree look like?

Sources · claim ledger

  • An operad encodes families of n-ary operations together with composition along trees, a unit 1-ary operation, and (for symmetric operads) permutation actions compatible with composition.

    Operad — Wikipedia (Boardman–Vogt 1968; May 1972) · verified 2026-07-28

  • J. Peter May coined the term operad (operations + monad) in The Geometry of Iterated Loop Spaces (1972); Boardman and Vogt introduced equivalent structure earlier as categories of operators in standard form (1968–1973).

    Operad — Wikipedia · verified 2026-07-28

  • Operadic composition is associative (parenthesization does not matter) and unital: θ ∘ (1,…,1) = θ = 1 ∘ θ.

    Operad — Wikipedia · verified 2026-07-28