Blog Archive

Friday, August 21, 2026

An Operadic View of the Law of Total Probability

 

An Operadic View of the Law of Total Probability

The standard simplex

Δn1={(p1,,pn)R0n|i=1npi=1}

may be identified with the space of probability measures on an n-element set. Under this interpretation, the standard simplices carry a natural operadic structure: operadic composition corresponds to refining one branch of a probability tree.

This simple observation leads to an operadic interpretation of the law of total probability.

The basic notions of symmetric colored operads, their morphisms, algebras, and algebra morphisms are recalled in the appendix. We use the terms symmetric colored operad and symmetric multicategory interchangeably; see Leinster [Lei04].


1. The Operad of Probability Simplices

For n1, define

P(n):=Δn1.

Thus an element

p=(p1,,pn)P(n)

is an n-tuple of nonnegative numbers satisfying

i=1npi=1.

We may regard p either as a point of the standard simplex or as a probability distribution on the finite set

{1,,n}.

The operadic structure is most transparent in terms of partial composition.

Let

p=(p1,,pn)P(n)

and

q=(q1,,qm)P(m).

For 1in, define

piq=(p1,,pi1,piq1,,piqm,pi+1,,pn).

Thus the i-th probability mass pi is replaced by m smaller masses

piq1,,piqm.

Since

kipk+pij=1mqj=kipk+pi=1,

we indeed obtain an element of

P(n+m1).

The unit is

(1)P(1)=Δ0,

and the symmetric group acts by permuting coordinates.


2. What Does the Composition Mean?

Consider

p=(12,13,16)P(3).

Interpret this as a random choice among three alternatives

A1,A2,A3

with probabilities

P(A1)=12,P(A2)=13,P(A3)=16.

Suppose that we now refine only the second alternative. Conditional on being in A2, let there be two further alternatives

B1,B2

with conditional distribution

q=(14,34)P(2).

Then

p2q=(12,1314,1334,16),

hence

p2q=(12,112,14,16).

The four final branches have probabilities

12,112,14,16.

Thus the meaning of i is:

piq=refine the i-th branch according to the conditional distribution q.

3. Measurable Partitions as a Colored Operad

Now fix a probability space

(Ω,Σ,P).

For the moment, we restrict to measurable events A satisfying

P(A)>0,

and to partitions whose pieces also have positive probability. This avoids the ambiguity of conditioning on null events.

Define a colored operad DP as follows.

Its colors are the positive-probability measurable events

AΣ.

There is an operation

(A1,,An)A

precisely when

A=A1An.

Thus an operation is a finite ordered measurable partition of A.

The colored structure records exactly which event is being refined. If

A=A1An

and

Ai=B1Bm,

then the second decomposition may be inserted only into the i-th input slot of the first.

Their partial composition is the refined partition

(A1,,An)i(B1,,Bm)=(A1,,Ai1,B1,,Bm,Ai+1,,An).

The output color remains A.

Thus

operadic composition in DP=refinement of measurable partitions.

Associativity says that successive refinements may be grouped in any order without changing the final partition.


4. Probability as an Operad Morphism

The probability measure now gives a natural map from the partition colored operad to the simplex operad.

Since P is an ordinary operad, we regard it as a one-colored operad. On colors there is therefore only one possible map:

A.

For an operation

A=A1An,

define

ΦP(A1,,An;A)=(P(A1A),,P(AnA))Δn1.

We claim that

ΦP:DPP

is a morphism of colored operads.

The essential point is compatibility with partial composition.

Suppose

A=A1An

and the i-th piece is further decomposed as

Ai=B1Bm.

Write

pk=P(AkA)

and

qj=P(BjAi).

The partial composite in the simplex operad is

ΦP(A1,,An;A)iΦP(B1,,Bm;Ai),

whose new coordinates in the i-th slot are

piqj=P(AiA)P(BjAi).

Since BjAiA,

P(AiA)P(BjAi)=P(Ai)P(A)P(Bj)P(Ai)=P(Bj)P(A)=P(BjA).

Hence

ΦP(θiϕ)=ΦP(θ)iΦP(ϕ).

So the elementary identity

P(BjA)=P(AiA)P(BjAi)

is exactly the condition that probability preserve operadic composition.

This gives a structural interpretation of conditional probability:

measurable refinementΦPprobability-tree refinement.

5. The Simplex Operad Acts on [0,1]

The interval [0,1] is convex. Hence every

p=(p1,,pn)P(n)

determines an n-ary operation

βp:[0,1]n[0,1]

given by

βp(r1,,rn)=i=1npiri.

These operations are compatible with operadic composition. Indeed,

βp(r1,,βq(s1,,sm),,rn)=kipkrk+pijqjsj=kipkrk+jpiqjsj,

which is precisely the operation corresponding to

piq.

Thus [0,1] is naturally a P-algebra.

Equivalently, in Set,

α:PEnd[0,1]

is an operad morphism.

Combining this with ΦP, we obtain

DPΦPPαEnd[0,1].

Consequently, every measurable partition

A=A1An

acts on [0,1]n by

(r1,,rn)iP(AiA)ri.

6. The Law of Total Probability

Fix an event

BΣ.

For each positive-probability event A, define

sB(A):=P(BA)[0,1].

Now let

A=A1An.

The operation associated to this partition is

(r1,,rn)iP(AiA)ri.

Substituting

ri=P(BAi)

gives

iP(AiA)P(BAi).

The law of total probability states that this is exactly

P(BA).

Hence

sB(A)=βΦP(A1,,An;A)(sB(A1),,sB(An)).

Equivalently,

P(BA)=iP(AiA)P(BAi).

Thus the law of total probability says that the family

AP(BA)

is compatible with the operations of the partition colored operad.

When A=Ω, this reduces to the usual formula

P(B)=iP(Ai)P(BAi).

7. The Law of Total Probability as a Morphism of Algebras

The preceding interpretation can be sharpened further.

Recall that the composite

DPΦPPαEnd[0,1]

defines a DP-algebra X by assigning

XA=[0,1]

to every color A.

For each measurable partition

θ:(A1,,An)A,A=i=1nAi,

the corresponding algebra operation is

μθ:XA1××XAnXA,

given explicitly by

μθ(r1,,rn)=i=1nP(AiA)ri.

Thus the colored operad DP acts on the family of intervals

(XA)A

through conditional-probability-weighted barycentric combinations.

The law of total probability can now be expressed as a morphism into this algebra.


7.1 The Terminal Algebra

For every color A, let

1A={}

be the one-point set.

These one-point sets form a DP-algebra 1.

Indeed, for every operation

θ:(A1,,An)A,

there is exactly one possible map

1A1××1An1A.

Explicitly,

(,,).

All operadic compatibility conditions are automatic, since every relevant map between singleton sets is unique.

Moreover, 1 is the terminal object in the category of DP-algebras: for every DP-algebra Y, there is a unique algebra morphism

Y1.

7.2 A Fixed Event Determines a Family of Elements

Now fix an event

BΣ.

For every positive-probability event A, we have an element

P(BA)XA=[0,1].

Equivalently, an element of XA may be regarded as a map from a singleton:

sB,A:1AXA,

defined by

sB,A()=P(BA).

Thus a fixed event B determines a family of maps

sB=(sB,A)A:1X.

At this point, however, sB is merely a family of maps indexed by the colors.

The question is:

When is this family a morphism of DP-algebras?

The answer is precisely: when the law of total probability holds.


7.3 The Algebra-Morphism Condition

By definition, sB:1X is a morphism of DP-algebras if, for every operation

θ:(A1,,An)A,

the diagram

1A1××1Anμθ11AsB,A1××sB,AnsB,AXA1××XAnμθXXA

commutes.

Since the upper row is the unique map between singleton sets, there is only one input to check:

(,,).

Going first across the top and then down the right gives

P(BA).

Going first down the left and then across the bottom gives

(,,)(P(BA1),,P(BAn))

and then

μθX(P(BA1),,P(BAn))=iP(AiA)P(BAi).

Therefore the diagram commutes if and only if

P(BA)=iP(AiA)P(BAi).

But this is exactly the conditional form of the law of total probability.

Hence:

sB:1X is a DP-algebra morphism

if and only if

P(BA)=iP(AiA)P(BAi)

for every admissible measurable partition

A=iAi.

Thus the law of total probability can be reformulated as the statement

For every fixed event B, the family AP(BA) is a compatible point of the DP-algebra X.

Equivalently, this compatible point is the algebra morphism

sB:1X.

7.4 What Does This Reformulation Add?

At first sight, this may appear to be only a categorical rewriting of the familiar identity

P(BA)=iP(AiA)P(BAi).

However, the algebra-morphism formulation packages a stronger structural statement.

The law of total probability is not attached to a single partition. For fixed B, it holds simultaneously for every operation of the colored operad DP:

(A1,,An)A.

Thus the family

{P(BA)}A

is compatible with the entire system of measurable refinements.

In particular, if

A=iAi

and each Ai is further refined as

Ai=jAij,

then the algebra-morphism condition may be applied first to each Ai and then to A, giving

P(BA)=iP(AiA)(jP(AijAi)P(BAij)).

Because ΦP preserves operadic composition,

P(AiA)P(AijAi)=P(AijA),

and therefore

P(BA)=i,jP(AijA)P(BAij).

Hence the compatibility encoded by sB is automatically stable under arbitrary operadic refinement.

We may therefore separate the structure into three levels:

DP:how measurable events are refined,ΦP:DPP:how probability weights behave under refinement,X:how those weights act by barycentric combination.

For a fixed event B, the morphism

sB:1X

then says that the conditional probabilities

P(BA)

respect this entire compositional structure.

This gives a concise operadic interpretation of the law of total probability:

the law of total probability is the compatibility of conditional probability with measurable refinement.

Or, in purely operadic language,

the law of total probability is an algebra-morphism condition.

8. Further Refinement

Suppose

A=iAi,Ai=jAij.

Applying the law of total probability first inside each Ai gives

P(BAi)=jP(AijAi)P(BAij).

Applying it again at the outer level gives

P(BA)=iP(AiA)(jP(AijAi)P(BAij)).

Using

P(AiA)P(AijAi)=P(AijA),

we obtain

P(BA)=i,jP(AijA)P(BAij).

This familiar refinement invariance is the combined effect of:

  1. associativity in the partition colored operad;

  2. the fact that ΦP preserves operadic composition;

  3. the compatibility of the simplex-operad action on [0,1].

In other words, a probability tree may be evaluated level by level or flattened first. The result is the same.


9. The Basic Diagram

The whole construction may be summarized by

DPΦPPαEnd[0,1].

The three terms have distinct meanings:

DP=measurable partitions and their refinements,
P(n)=Δn1=finite probability distributions,

and

α(p1,,pn)=[(r1,,rn)ipiri].

Thus

partitionconditional probability weightsweighted average.

From this point of view, the law of total probability is not an isolated summation identity. It expresses the compatibility between these three compositional structures.


Appendix A. Colored Operads

We recall only the conventions used above. For a systematic treatment in the language of multicategories, see Leinster [Lei04].

Let C be a set of colors.

A symmetric C-colored operad O consists of sets

O(c1,,cn;c)

for colors c1,,cn,cC, together with units, symmetric group actions, and composition maps.

An element

θO(c1,,cn;c)

is thought of as an operation

(c1,,cn)c.

If

θO(c1,,cn;c)

and

ϕO(d1,,dm;ci),

then the partial composite

θiϕ

is obtained by inserting ϕ into the i-th input of θ.

The associativity axioms express the independence of iterated substitution from the order in which a rooted operation tree is composed.

An ordinary operad is precisely a one-colored colored operad.

A category may be regarded as a colored operad in which all non-unary operation sets are empty.


Appendix B. Morphisms of Colored Operads

Let O and Q have color sets C and D.

A morphism

F:OQ

consists of a map of colors

F0:CD

and maps

O(c1,,cn;c)Q(F0c1,,F0cn;F0c)

compatible with units, permutations, and operadic composition.

In particular,

F(θiϕ)=F(θ)iF(ϕ).

The source and target operads need not have the same set of colors.


Appendix C. Algebras and Algebra Morphisms

Let O be a colored operad in a symmetric monoidal category

(V,,1).

An O-algebra assigns an object XcV to every color c and provides compatible action maps

O(c1,,cn;c)Xc1XcnXc.

No closedness assumption on V is required for this definition.

If V is closed symmetric monoidal, one may equivalently package the structure using the internal endomorphism operad

EndX(c1,,cn;c)=[Xc1Xcn,Xc]

and a morphism

OEndX.

A morphism f:XY of O-algebras is a family

fc:XcYc

such that every operadic operation is preserved:

fc(θX(x1,,xn))=θY(fc1(x1),,fcn(xn)).

References

[Lei04] Tom Leinster, Higher Operads, Higher Categories, London Mathematical Society Lecture Note Series 298, Cambridge University Press, 2004.

Collaboration Report

This note grew out of a sequence of discussions between Marco and ChatGPT concerning operadic structures in probability theory.

Marco's contribution. Marco initiated the main conceptual direction of the note. In particular, he observed that the standard simplex Δn1 can be viewed as the space of probability measures on an n-element set and proposed interpreting its operadic composition in terms of refinement of probability distributions. He further proposed organizing measurable partitions of a probability space as a colored operad and investigated how the law of total probability should be understood through operad morphisms and operad algebras. The overall mathematical motivation, the connection between refinement and conditional probability, and the decision to formulate the construction using partial compositions i were driven by Marco.

ChatGPT's contribution. ChatGPT assisted in formalizing and checking these ideas. This included making the colored-operad structure on measurable partitions precise, formulating the morphism

ΦP:DPP,

verifying that its compatibility with partial composition is exactly the identity

P(BjA)=P(AiA)P(BjAi),

and identifying the natural action of the simplex operad on [0,1] by barycentric combinations. ChatGPT also helped formulate the stronger observation that, for fixed B, the law of total probability can be expressed as the condition that

sB:1X

is a morphism of DP-algebras. It additionally assisted with exposition, notation, references, and consistency checks.

The resulting note is therefore based on Marco's mathematical questions and structural insights, with ChatGPT serving primarily as a tool for formalization, verification, and exposition.

Popular Posts