Acknowledgements: This research began during the SERI MATS program, under the joint mentorship of John Wentworth, Nicholas Kees, and Janus. Thanks also to Davidad, Jack Sagar, and David Jaz Myers for discussion.
Abstract: I think that there is a uniform correspondence between flavours of uncertainty and monads taking state-spaces to belief-state-spaces, for different characterisation of belief. In this essay, I describe this correspondence explicitly and list 15 diverse and well-motivated examples. I explore some applications to model-building and agent foundations. Along the way, I characterise infrabayesianism uncertainty as the minimal way to encompass possibilistic uncertainty, probabilistic uncertainty, and reward.
No prerequisites are required beyond a high-school familiarity with sets, functions, real numbers, etc. Feedback welcome.
Introduction
Suppose I'm facing the following problem. There's an upcoming election between n candidates, and you're uncertain who will win. How can I model both your belief about the election and the election itself in a coherent way? By "belief" here, I mean your epistemic attitude, your internal model, your opinion, judgement, prediction, etc, etc. Think map-territory distinction: the election is the territory, your belief is the map, and I need to model both the map and the territory coherently despite the fact that the map and the territory are (typically speaking) two completely different types of thing.
Well, to model the election itself, I'll use a set S={s1,s2,s3,…sn} with an element for each electoral candidate. To represent your belief about the election, I must find another set B(S) with an element for each belief that you might have about the election. I'll call S the state space and B(S) the belief-state space. A solution to our problem is given by a mathematical operator B sending each state-space S to the matching belief-state space B(S).
One may feel prompted to ask: does any operator B suffice here? Can the belief-state space be anything whatsoever, or must it carry some extra structure, possibly satisfying some additional constraints? Or, stated more philosophically, can any territory serve as a map for any other? I say no. Roughly speaking, the operator B must be a so-called monad, which will be the central object of this essay. But more on that later.
The first thing to note is that the appropriate operator B will depend on how exactly I wish to characterise a "belief" about the election, and there are multiple options here. For example, I might choose to characterise your belief by the set of candidates that you think have a possibility of winning. In this case, B(S):=P+(S), denoting the set of non-empty subsets of S. Alternatively, I might choose to characterise your belief by the likelihood that you give each candidate. In this case, B(S):=Δ(S), denoting the set of finite-support probability distributions over S, i.e. functions p:S→[0,1] such that {s∈S:p(s)≠0} is finite and ∑s∈Sp(s)=1.
In the first option, I'm characterising your belief-state by your possibilistic uncertainty, often encountered in doxastic or epistemic logic. In the second option, I'm characterising your belief-state by your probabilistic uncertainty, which is a finer-grained characterisation of belief because it differentiates between e.g. thinking a coin is fair and thinking a coin is slightly biased.
The second option has its merits. Indeed, many readers will instinctively reach for Δ as soon as they hear the word "uncertainty", and this instinct would serve them well. There's been a fruitful enterprise (in philosophy, mathematics, computer science, linguistics, etc) of replacing possibilistic uncertainty with probabilistic uncertainty in any model or concept where one finds it. But I want to note that both P+ and Δ would count as a solution to the problem. I'll return to these two examples throughout this essay because they are the flavours of uncertainty which will be most familiar to the reader.
Flavour of uncertainty
Monad
Possibilistic
Nonempty-powerset monad P+
Probabilistic
Distribution monad Δ
As we will see, these two operators, P+ and Δ, are both monads. The central claim of this essay is that there is a uniform correspondence between flavours of uncertainty and monads. By "flavour of uncertainty" I mean a particular way of characterising someone's potentially uncertain belief about something. Possibilistic and probabilistic are paradigm cases, but in this essay we'll meet fifteen examples.
The forward-implication of this claim, that every flavour of uncertainty is a monad, is perhaps uncontroversial in some circles.[1] The backwards-implication, that every monad is a flavour of uncertainty, is worthy of more scepticism.
In this essay —
I will describe the correspondence explicitly.
I'll present a step-by-step method for formalising different flavours of uncertainty using monads.
I'll list fifteen examples of the correspondence, which I hope the reader finds well-motivated.
Finally, I'll discuss the relevance to agent foundations, with reference to infrabayesianism in particular.
Don't worry if you don't yet know what monads are. By the end of this essay you'll understand them as well as I do, which is enough to nod along when you hear "monad this" and "monad that".
The correspondence explicitly.
What's a flavour of uncertainty?
Recall from the introduction that I'm tasked with representing or modelling both the election itself and your belief about the election. The first step of this task is to settle on a particular flavour of uncertainty to characterise the belief-states — possibilistic, probabilistic, infrabayesian, etc. One might ask, of this flavour of uncertainty, the following four questions —
Count? What's counts as a distinct belief about the election? Concretely, if there are n electoral candidates then how many distinct belief-states are there?
Certainty? If you're certain that a particular candidate will win the election (and I know which candidate) then how should I determine yourbelief-state?
Collapse? Suppose a number of forecasters are speculating on the election. If I'm given the belief of each forecaster about the election, and I'm given your belief about the forecasters' beliefs, then how should I determine your belief about the election itself?
Combine? Suppose there are two completely unrelated elections happening somewhere. If I'm given your belief about the first election, and your belief about the second election, then how should I determine your belief about the pair of elections?
These four questions — Count? Certainty? Collapse? Combine? — are essentially epistemological questions, and they collectively pin down what I mean by a flavour of uncertainty.[2] As we will see, a monad corresponds to answers to the first three questions and a commutative monad corresponds to answers to all four questions.
Exercise 1: How would you answer these questions for possibilistic uncertainty? Or for probabilistic uncertainty?
Exercise 2: As I mentioned before, an answer to Count? is a set B(S) for each set S. What about for Certainty? Collapse? and Combine?
What's a (commutative) monad?
Monads were born of category theory — a field of mathematics which many regard as arcane, mystical, or downright kabbalistic — but monads can (I think) be understood by someone lacking any acquaintance with category theory whatsoever. Indeed, my claim in this essay is that monads correspond exactly to Map-Territory-like relations, and such relations will be familiar to anyone who's both got a brain and pondered this predicament.
I'll first write down the mathematical definition of a monad, and then I'll explain how this definition mirrors the four epistemological questions.
Definition: A monad(B,η,⊳) consists of three operators[3]:
The construct operatorB which assigns a set B(S) to each set S.
The return operatorη which assigns a function ηS:S→B(S) to each set S.
The bind operator⊳ which assigns a function ⊳WS:B(W)×(W→B(S))→B(S) to each pair of sets W,S.
Moreover, a commutative monad(B,η,⊳,⊗) is a monad (B,η,⊳) equipped with a fourth operator:
The product operator ⊗ which assigns a function ⊗AB:B(A)×B(B)→B(A×B) to each pair of sets A,B.
These operators must also satisfy some basic algebraic laws to qualify as a (commutative) monad. See here for details.
Notation: I'll use variables x,x′,x′′ for elements of X, and boldface variables x,x′,x′′ for elements of B(X). I may talk loosely of the monad B rather than (B,η,⊳) or of the commutative monad B rather than (B,η,⊳,⊗). I may write ηB, ⊳B, or ⊗B for clarification. I may write w⊳f instead of w⊳WSf, and a⊗b instead of a⊗ABb.
How do they correspond to each other?
In short, there is an exact correspondence between the operators of a (commutative) monad and the four epistemological questions. Let's go one-by-one.
1. Count? What's counts as a distinct belief about the election? Concretely, if there are n electoral candidates then how many distinct belief-states are there?
An answer to this question is the constructor operator, assigning a set B(S) to each set S. If S is the set of potential outcomes of an event then B(S) is the set of beliefs about the event.
As we discussed before, for possibilistic uncertainty B(S):=P+(S), and for probabilistic uncertainty B(S):=Δ(S).
2. Certainty? If you're certain that a particular candidate will win the election (and I know which candidate) then how should I determine yourbelief?
Here, an answer will be the return operator assigning a function ηS:S→B(S) to each set S. If you're certain that a state s∈S will occur, then ηS(s)∈B(S) is your belief-state.
For possibilistic uncertainty, ηS(s):={s}∈P+(S), the singleton set containing s. And for probabilistic uncertainty, ηS(s):=δs∈Δ(S), the dirac distribution at s given by δs:s′↦{1if s′=s0otherwise.
The function ηS:S→B(S) describes how the state-space embeds in the belief-state-space. This is related, I think, to the idea that each territory can serve as its own map. (See Borges' On Exactitude in Science for an exploration of this theme.) Or in the words of Norbert Wiener, “The best model of a cat is another, or preferably the same, cat.”
3. Collapse? Suppose a number of forecasters are speculating on the election. If I'm given the belief of each forecaster about the election, and I'm given your belief about the forecasters' beliefs, then how should I determine your belief about the election itself?
Here, an answer will be the bind operator assigning a function ⊳WS:B(W)×(W→B(S))→B(S) to each pair of sets W and S. You should think of the bind operator as collapsing your second-order beliefs to your first-order beliefs — i.e. if each forecaster w∈W has an first-order belief f(w)∈B(S), and w∈B(S) is your second-order belief about which forecaster is correct, then (w⊳WSf)∈B(S) should be your first-order belief about the election.
For possibilistic uncertainty, w⊳f∈P+(S) is the union ⋃w∈wf(w). And for probabilistic uncertainty, w⊳f∈Δ(S) is the summation/integral s′↦∑w∈ww(s)⋅f(w)(s′).
This is related to the idea that a map of a map of a territory is a map of that same territory; a depiction of a depiction of person is a depiction of that same person, a representation of a representation of an idea is a representation of that same idea; etc.
One might think of f:W→B(S) as some parameterisation of the belief-state B(S) using some parameters W. Then the bind operator gives us the function for finding your S-belief from you W-belief. Explicitly, this function is(−⊳WSf):B(W)→B(S),w↦w⊳WSf.
Moreover, the bind operator doesn't just flatten one level of "meta". Often we have an entire hierarchy of state-spaces S0,S1,S2,…,Sn where beliefs about Si are parameterised by some "higher" state-space Si+1 via a function fi:Si+1→B(Si). Here, the state-space S0 is the object-level system, the state-space S1 parametrises your first-order beliefs about S0, the state-space S2 parameterises your second-order beliefs about S1, and so on. Then the bind operator says that I can collapse your nth-order beliefs all the way to your first-order beliefs via the function (−⊳fn−1⊳⋯⊳f0):B(Sn)→B(S0).[4]
4. Combine? Suppose there are two completely unrelated elections happening somewhere. If I'm given your belief about the first election, and your belief about the second election, then how should I determine your belief about the pair of elections?
An answer will be the product operator ⊗ assigning a function ⊗AB:B(A)×B(B)→B(A×B) to each pair of sets A and B. If a∈B(A) is your belief about the first election and b∈B(B) is your belief about an unrelated second election, then a⊗ABb∈B(A×B) is your belief about the pair of elections.
For possibilistic uncertainty, a⊗b∈P+(A×B) is the cartesian product {(a,b)∈A×B:a∈a,b∈b}. And for probabilistic uncertainty, a⊗b∈Δ(A×B) is the joint distribution (a,b)↦a(a)⋅b(b).
Thinking of S1×⋯×Sn as a factorisation of the state-space S, the product operator implies that your beliefs about each Sicombine to yield your overall belief about S. That is, a commutative monad B corresponds to a flavour of uncertainty that you can have to parts of the world, whereas a non-commutative monad B corresponds to a flavour of uncertainty that you can only have to the world in its entirety.
Historical note: The central thesis of this essay is that there is a uniform correspondence between flavours of uncertainty and monads. I call this Myers' correspondence after David Jaz Myers, because I first encountered the idea in his book Categorical Systems Theory, where he devotes a chapter to using commutative monads to model various nondeterminism of automata. Nonetheless, he idea did not originate with him, he's never claimed it is true, and I don't know if he agrees with it.
Examples of Myers' correspondence
The correspondence between he operators of the (commutative) monad and the epistemological questions also serves as a practical recipe for formalising different flavours of uncertainty using monads. I've personally found it useful. First, think about the particular flavour of uncertainty, then answer the Four C's (Count? Certainty? Collapse? Combine?), convert those answers into mathematical operators, and voilà you've got yourself a monad.
I'll now zoom through fifteen examples, beginning (without commentary) with the paradigm examples of P+ and Δ.
1 - nonempty powerset monad
Flavour of uncertainty
Possibilistic
Monad
Nonempty powerset
Construct B(S)
P+(S)
Return ηS(s)
{s}
Bind w⊳WSf
⋃w∈wf(w)
Product a⊗ABb
a×b
Interpretation
x∈x if you consider the outcome x∈X to be possible.
2 - distribution monad
Flavour of uncertainty
Probabilistic
Monad
Distribution
Construct B(S)
Δ(S)
Return ηS(s)
δs:s′↦{1if s′=s0otherwise
Bind w⊳WSf
s:s′↦∑w∈ww(s)⋅f(w)(s′)
Product a⊗ABb
(a,b)↦a(a)⋅b(b)
Interpretation
x(x)∈[0,1] is your subjective credence in the outcome x∈X.
3 — reader monad from H
Okay, now let's deal with a flavour of uncertainty which is sometimes called "indeterminacy". An indeterminate belief is something like "Well, if h1 is true then x1, but if h2 is true then x2, but–", i.e. it's a belief which is uncertain because your best guess depends on some unknown variable. More formally, your belief-state is given by a particular function from H (the possible values of the unknown variable) to S (the state-space).
This is an ordinary usage of the word "uncertain" so, by Myers' correspondence, it must correspond to a monad, and we can discover which monad by answering the four Cs. If S is the state-space then the belief-state-space is given by SH, the set of functions s:H→S. So our construct operator is (−)H. If you're certain tha tthe outcome is s∈S then your belief-state is the constant function cs:h↦s. The intuitive answers to Collapse? and Combine? give us our bind and product operators.
x(h)=x if x∈X is your best guess about the outcome conditioned on the information h∈H.
4 — writer monad to [0,1]
Often, people will report their uncertain beliefs like "The coin will land heads (98%)" or "AI will disempower humanity (60%)". That is, their belief is a best guess paired with their confidence, which they offer as a lower-bound on the likelihood of that their guess is correct. A certain belief-state would be something like "The coin will land heads (100%)".
What monad corresponds to this flavour of uncertainty?
If S is the state-space then S×[0,1] is the belief-state-space, i.e. there's a distinct belief-state for each pair s=(s,q)∈S×[0,1]. If you're certain that the outcome is s∈S then your belief-state is (s,100%)∈S×[0,1]. Uncertainty is collapsed by multiplying the confidences. Uncertainty is combined also by multiplying the confidences.
x=(x,p) if p∈[0,1] is your confidence in the outcomex∈X, i.e. you think that the likelihood of x∈X is at least p.
Using the writer to [0,1] monad, we've characterised a belief-state as an outcome marked with some additional metadata, namely a confidence p∈[0,1]. What properties of the interval [0,1] did we appeal to in this definition? Well, firstly that we can multiply different elements (see bind and product operators). And secondly, that there's a fixed element such that multiplying with this element does nothing (see return operator).
Hence we can generalise: given any monoid (M,e,⊙) we have a monad B(S)=S×M called the writer-to-M monad.[5] By using different monoids, we can model different flavours of uncertainty, but note that this is only a commutative monad when (M,e,⊙) is a commutative monoid.
There's another ordinary usage of the word "uncertainty" where an uncertain belief would be something like "AGI arrives before 2040 unless there's a nuclear war" and a certain belief would be something like "AI will arrive before 2040." At least, with regards to teh binary question of whether AGI arrives before 2040. That is, an uncertain belief is one with an "unless..." clause.
Formalising this, we have a fixed set of events F, and a belief-state is a pair (s,E)∈S×F. Your belief-state is (s,E) when you commit to the state s∈S occurring unless the event E∈F occurs. This flavour of uncertainty corresponds to the writer monad B(S)=S×F, where F is a monoid when equipped with union ∪:F×F→F and the empty set ∅∈F.
One might use this flavour of uncertainty to models various kinds of defeasible reasoning, where a belief-state (s,E) is characterised by the precondition E under which the belief would be defeated or disavowed.
Flavour of uncertainty
Unless-claused guess
Monad
Writer monad to F
Construct B(S)
S×F
Return ηS(s)
(s,∅)
Bind w⊳WSf
(s,E1∪E2) where w=(w,E1) andf(w)=(s,E2)
Product a⊗ABb
((a,b),E1∪E2) where a=(a,E1) and b=(b,E2).
Interpretation
x=(x,E) if you think x will occur unless event E occurs.
Or maybe an uncertain belief is a one full of amendments, clarifications, conditions, disclaimers, excuses, hedges, limitations, qualification, refinements, reservations, restrictions, stipulations, temperings, etc. By contrast, a certain belief is made "with no ifs or buts", bare and direct.
Formalising this, we have a fixed set of clarifications C, and a belief-state is a pair (s,l)∈S×List(C). Here, List(C) is the free monoid over the set of clarifications C equipped with concatenation +:List(C)×List(C)→List(C) and the empty list []∈List(C).
Flavour of uncertainty
Clarified guess
Monad
Writer to List(C) monad
Construct B(S)
S×List(C)
Return ηS(s)
(s,[])
Bind w⊳WSf
(s,l1+l2) where w=(w,l1) andf(w)=(s,l1+l2)
Product a⊗ABb
N/A (See below.)
Interpretation
x=(x,l) if you think x will occur and l is a list of your clarifications.
Now, the writer to List(C) monad isn't a commutative monad. Or interpreted philosophically, a clarified guess isn't the kind of uncertainty you can have to parts of the world. Suppose "I think Alice is happy but I don't know her very well" is my belief-state about Alice, and "I think Bob is happy but he's difficult to read" is my belief-state about Bob. What's my belief-state about both Alice and Bob? Is it (1) "Alice and Bob are both happy, but I don't know Alice very well and Bob is difficult to read" or (2) "Alice and Bob are both happy, but Bob is difficult to read and I don't know Alice very well". That is, in which order should we combine the clarifications?
The instinctive trick is to declare that two belief-states are equal if the lists of clarifications are equalup-to-permutation — this implies that (1) and (2) are the same belief-state, which does seem intuitive to me. If we play this trick, then the resulting flavour of uncertainty is captured by the writer-to-N[C] monad, where N[C] is the free commutative monoid. This does indeed give a commutative monad!
Flavour of uncertainty
Unordered clarified guess
Monad
Writer monad to N[C]
Construct B(S)
S×N[C]
Return ηS(s)
(s,0)
Bind w⊳WSf
(s,l1+l2) where w=(w,l1) andf(w)=(s,l1+l2)
Product a⊗ABb
((a,b),l1+l2) where a=(a,l1) and b=(b,l2).
Interpretation
x=(x,l) if you think x will occur and l is an unordered list of your clarifications.
5 — identity monad
If we've anticipating an election between n candidates, then the simplest way to characterise your belief about the election by your best guess with no additional information about how unsure you are. If S is the state-space then S is also the belief-state-space, i.e. there's a distinct belief-state for each s∈S. The set of belief-states is therefore equal (up to bijection) to the set of outcomes itself.
I'll admit that this flavour of uncertainty is somewhat degenerate — e.g. every belief-state is a certainty in some particular state — but it's worth including nonetheless. On some readings of Wittgenstein's Tractatus, this is his model of how language represents the world, our utterances stand in direct isomorphism with the state-of-affairs.
Anyway, answering the four Cs would give the identity monad!
Flavour of uncertainty
Best guess
Monad
identity monad
Construct B(S)
S
Return ηS(s)
s
Bind w⊳WSf
f(w)
Product a⊗ABb
(a,b)
Interpretation
x=x if x∈X is your best guess about the outcome
6 — maybe monad
The last example was a bit silly, so how about this instead..?
If we've anticipating an election between n candidates, then I'll characterise your belief about the election either by your best guess (with no additional information) or an "I don't know" response. This is an very coarse-grained flavour of uncertainty — the only belief-state about the election (other than certainty in a particular candidate) is the belief-state of utter cluelessness, or shrugging one's shoulders!
Despite the coarse-grained-ness, it's pretty commonly encountered in the wild. For example, it's the typical flavour of uncertainty encountered in surveys/questionnaires, where ⊥ is read as "no opinion/don't know". It's also encountered in voting, where ⊥ is read as "abstention".
Formally speaking, if S is the state-space then there's a distinct belief-state for each state s∈S plus an additional option denoted ⊥. The belief-state-space is therefore S+1, denoting the disjoint union of S with the singleton set {⊥}. If you're certain that the outcome is s∈S then your belief-state is s∈S. This flavour of uncertainty corresponds to the famous maybe monad.
Flavour of uncertainty
guess-or-shrug
Monad
maybe monad
Construct B(S)
S+1
Return ηS(s)
s
Bind w⊳WSf
{⊥if w=⊥f(w)otherwise
Product a⊗ABb
{⊥if a=⊥ or b=⊥(a,b)otherwise
Interpretation
x=x if x∈X is your best guess for the outcome, and x=⊥ if you offer no best guess.
7 — K-distribution monad
You might, at this point, feel short-changed. I've discussed so far a range of flavours of uncertainty which are all coarser-grained than probabilistic knowledge, so why not stick to Δ? Let's consider then a more fined-grained characterisation of belief-state, one that tracks infinitesimal differences between probability assignments.
The Levi-Civita Field is an extension of the real numbers which contains infinitesimal values like ϵ,ϵ2,2ϵ+ϵ2,π2√ϵ and infinite values like
Acknowledgements:
This research began during the SERI MATS program, under the joint mentorship of John Wentworth, Nicholas Kees, and Janus. Thanks also to Davidad, Jack Sagar, and David Jaz Myers for discussion.
Abstract:
I think that there is a uniform correspondence between flavours of uncertainty and monads taking state-spaces to belief-state-spaces, for different characterisation of belief. In this essay, I describe this correspondence explicitly and list 15 diverse and well-motivated examples. I explore some applications to model-building and agent foundations. Along the way, I characterise infrabayesianism uncertainty as the minimal way to encompass possibilistic uncertainty, probabilistic uncertainty, and reward.
No prerequisites are required beyond a high-school familiarity with sets, functions, real numbers, etc. Feedback welcome.
Introduction
Suppose I'm facing the following problem. There's an upcoming election between n candidates, and you're uncertain who will win. How can I model both your belief about the election and the election itself in a coherent way? By "belief" here, I mean your epistemic attitude, your internal model, your opinion, judgement, prediction, etc, etc. Think map-territory distinction: the election is the territory, your belief is the map, and I need to model both the map and the territory coherently despite the fact that the map and the territory are (typically speaking) two completely different types of thing.
Well, to model the election itself, I'll use a set S={s1,s2,s3,…sn} with an element for each electoral candidate. To represent your belief about the election, I must find another set B(S) with an element for each belief that you might have about the election. I'll call S the state space and B(S) the belief-state space. A solution to our problem is given by a mathematical operator B sending each state-space S to the matching belief-state space B(S).
One may feel prompted to ask: does any operator B suffice here? Can the belief-state space be anything whatsoever, or must it carry some extra structure, possibly satisfying some additional constraints? Or, stated more philosophically, can any territory serve as a map for any other? I say no. Roughly speaking, the operator B must be a so-called monad, which will be the central object of this essay. But more on that later.
The first thing to note is that the appropriate operator B will depend on how exactly I wish to characterise a "belief" about the election, and there are multiple options here. For example, I might choose to characterise your belief by the set of candidates that you think have a possibility of winning. In this case, B(S):=P+(S), denoting the set of non-empty subsets of S. Alternatively, I might choose to characterise your belief by the likelihood that you give each candidate. In this case, B(S):=Δ(S), denoting the set of finite-support probability distributions over S, i.e. functions p:S→[0,1] such that {s∈S:p(s)≠0} is finite and ∑s∈Sp(s)=1.
In the first option, I'm characterising your belief-state by your possibilistic uncertainty, often encountered in doxastic or epistemic logic. In the second option, I'm characterising your belief-state by your probabilistic uncertainty, which is a finer-grained characterisation of belief because it differentiates between e.g. thinking a coin is fair and thinking a coin is slightly biased.
The second option has its merits. Indeed, many readers will instinctively reach for Δ as soon as they hear the word "uncertainty", and this instinct would serve them well. There's been a fruitful enterprise (in philosophy, mathematics, computer science, linguistics, etc) of replacing possibilistic uncertainty with probabilistic uncertainty in any model or concept where one finds it. But I want to note that both P+ and Δ would count as a solution to the problem. I'll return to these two examples throughout this essay because they are the flavours of uncertainty which will be most familiar to the reader.
As we will see, these two operators, P+ and Δ, are both monads. The central claim of this essay is that there is a uniform correspondence between flavours of uncertainty and monads. By "flavour of uncertainty" I mean a particular way of characterising someone's potentially uncertain belief about something. Possibilistic and probabilistic are paradigm cases, but in this essay we'll meet fifteen examples.
The forward-implication of this claim, that every flavour of uncertainty is a monad, is perhaps uncontroversial in some circles.[1] The backwards-implication, that every monad is a flavour of uncertainty, is worthy of more scepticism.
In this essay —
Don't worry if you don't yet know what monads are. By the end of this essay you'll understand them as well as I do, which is enough to nod along when you hear "monad this" and "monad that".
The correspondence explicitly.
What's a flavour of uncertainty?
Recall from the introduction that I'm tasked with representing or modelling both the election itself and your belief about the election. The first step of this task is to settle on a particular flavour of uncertainty to characterise the belief-states — possibilistic, probabilistic, infrabayesian, etc. One might ask, of this flavour of uncertainty, the following four questions —
What's counts as a distinct belief about the election? Concretely, if there are n electoral candidates then how many distinct belief-states are there?
If you're certain that a particular candidate will win the election (and I know which candidate) then how should I determine your belief-state?
Suppose a number of forecasters are speculating on the election. If I'm given the belief of each forecaster about the election, and I'm given your belief about the forecasters' beliefs, then how should I determine your belief about the election itself?
Suppose there are two completely unrelated elections happening somewhere. If I'm given your belief about the first election, and your belief about the second election, then how should I determine your belief about the pair of elections?
These four questions — Count? Certainty? Collapse? Combine? — are essentially epistemological questions, and they collectively pin down what I mean by a flavour of uncertainty.[2] As we will see, a monad corresponds to answers to the first three questions and a commutative monad corresponds to answers to all four questions.
Exercise 1: How would you answer these questions for possibilistic uncertainty? Or for probabilistic uncertainty?
Exercise 2: As I mentioned before, an answer to Count? is a set B(S) for each set S. What about for Certainty? Collapse? and Combine?
What's a (commutative) monad?
Monads were born of category theory — a field of mathematics which many regard as arcane, mystical, or downright kabbalistic — but monads can (I think) be understood by someone lacking any acquaintance with category theory whatsoever. Indeed, my claim in this essay is that monads correspond exactly to Map-Territory-like relations, and such relations will be familiar to anyone who's both got a brain and pondered this predicament.
I'll first write down the mathematical definition of a monad, and then I'll explain how this definition mirrors the four epistemological questions.
How do they correspond to each other?
In short, there is an exact correspondence between the operators of a (commutative) monad and the four epistemological questions. Let's go one-by-one.
An answer to this question is the constructor operator, assigning a set B(S) to each set S. If S is the set of potential outcomes of an event then B(S) is the set of beliefs about the event.
As we discussed before, for possibilistic uncertainty B(S):=P+(S), and for probabilistic uncertainty B(S):=Δ(S).
Here, an answer will be the return operator assigning a function ηS:S→B(S) to each set S. If you're certain that a state s∈S will occur, then ηS(s)∈B(S) is your belief-state.
For possibilistic uncertainty, ηS(s):={s}∈P+(S), the singleton set containing s. And for probabilistic uncertainty, ηS(s):=δs∈Δ(S), the dirac distribution at s given by δs:s′↦{1if s′=s0otherwise.
The function ηS:S→B(S) describes how the state-space embeds in the belief-state-space. This is related, I think, to the idea that each territory can serve as its own map. (See Borges' On Exactitude in Science for an exploration of this theme.) Or in the words of Norbert Wiener, “The best model of a cat is another, or preferably the same, cat.”
Here, an answer will be the bind operator assigning a function ⊳WS:B(W)×(W→B(S))→B(S) to each pair of sets W and S. You should think of the bind operator as collapsing your second-order beliefs to your first-order beliefs — i.e. if each forecaster w∈W has an first-order belief f(w)∈B(S), and w∈B(S) is your second-order belief about which forecaster is correct, then (w⊳WSf)∈B(S) should be your first-order belief about the election.
For possibilistic uncertainty, w⊳f∈P+(S) is the union ⋃w∈wf(w). And for probabilistic uncertainty, w⊳f∈Δ(S) is the summation/integral s′↦∑w∈ww(s)⋅f(w)(s′).
This is related to the idea that a map of a map of a territory is a map of that same territory; a depiction of a depiction of person is a depiction of that same person, a representation of a representation of an idea is a representation of that same idea; etc.
One might think of f:W→B(S) as some parameterisation of the belief-state B(S) using some parameters W. Then the bind operator gives us the function for finding your S-belief from you W-belief. Explicitly, this function is(−⊳WSf):B(W)→B(S),w↦w⊳WSf.
Moreover, the bind operator doesn't just flatten one level of "meta". Often we have an entire hierarchy of state-spaces S0,S1,S2,…,Sn where beliefs about Si are parameterised by some "higher" state-space Si+1 via a function fi:Si+1→B(Si). Here, the state-space S0 is the object-level system, the state-space S1 parametrises your first-order beliefs about S0, the state-space S2 parameterises your second-order beliefs about S1, and so on. Then the bind operator says that I can collapse your nth-order beliefs all the way to your first-order beliefs via the function (−⊳fn−1⊳⋯⊳f0):B(Sn)→B(S0).[4]
An answer will be the product operator ⊗ assigning a function ⊗AB:B(A)×B(B)→B(A×B) to each pair of sets A and B. If a∈B(A) is your belief about the first election and b∈B(B) is your belief about an unrelated second election, then a⊗ABb∈B(A×B) is your belief about the pair of elections.
For possibilistic uncertainty, a⊗b∈P+(A×B) is the cartesian product {(a,b)∈A×B:a∈a,b∈b}. And for probabilistic uncertainty, a⊗b∈Δ(A×B) is the joint distribution (a,b)↦a(a)⋅b(b).
Thinking of S1×⋯×Sn as a factorisation of the state-space S, the product operator implies that your beliefs about each Si combine to yield your overall belief about S. That is, a commutative monad B corresponds to a flavour of uncertainty that you can have to parts of the world, whereas a non-commutative monad B corresponds to a flavour of uncertainty that you can only have to the world in its entirety.
Historical note: The central thesis of this essay is that there is a uniform correspondence between flavours of uncertainty and monads. I call this Myers' correspondence after David Jaz Myers, because I first encountered the idea in his book Categorical Systems Theory, where he devotes a chapter to using commutative monads to model various nondeterminism of automata. Nonetheless, he idea did not originate with him, he's never claimed it is true, and I don't know if he agrees with it.
Examples of Myers' correspondence
The correspondence between he operators of the (commutative) monad and the epistemological questions also serves as a practical recipe for formalising different flavours of uncertainty using monads. I've personally found it useful. First, think about the particular flavour of uncertainty, then answer the Four C's (Count? Certainty? Collapse? Combine?), convert those answers into mathematical operators, and voilà you've got yourself a monad.
I'll now zoom through fifteen examples, beginning (without commentary) with the paradigm examples of P+ and Δ.
1 - nonempty powerset monad
2 - distribution monad
3 — reader monad from H
Okay, now let's deal with a flavour of uncertainty which is sometimes called "indeterminacy". An indeterminate belief is something like "Well, if h1 is true then x1, but if h2 is true then x2, but–", i.e. it's a belief which is uncertain because your best guess depends on some unknown variable. More formally, your belief-state is given by a particular function from H (the possible values of the unknown variable) to S (the state-space).
This is an ordinary usage of the word "uncertain" so, by Myers' correspondence, it must correspond to a monad, and we can discover which monad by answering the four Cs. If S is the state-space then the belief-state-space is given by SH, the set of functions s:H→S. So our construct operator is (−)H. If you're certain tha tthe outcome is s∈S then your belief-state is the constant function cs:h↦s. The intuitive answers to Collapse? and Combine? give us our bind and product operators.
Overall, we get what's called the reader monad from H.
4 — writer monad to [0,1]
Often, people will report their uncertain beliefs like "The coin will land heads (98%)" or "AI will disempower humanity (60%)". That is, their belief is a best guess paired with their confidence, which they offer as a lower-bound on the likelihood of that their guess is correct. A certain belief-state would be something like "The coin will land heads (100%)".
What monad corresponds to this flavour of uncertainty?
If S is the state-space then S×[0,1] is the belief-state-space, i.e. there's a distinct belief-state for each pair s=(s,q)∈S×[0,1]. If you're certain that the outcome is s∈S then your belief-state is (s,100%)∈S×[0,1]. Uncertainty is collapsed by multiplying the confidences. Uncertainty is combined also by multiplying the confidences.
Ta-da! The writer to [0,1] monad..
Using the writer to [0,1] monad, we've characterised a belief-state as an outcome marked with some additional metadata, namely a confidence p∈[0,1]. What properties of the interval [0,1] did we appeal to in this definition? Well, firstly that we can multiply different elements (see bind and product operators). And secondly, that there's a fixed element such that multiplying with this element does nothing (see return operator).
Hence we can generalise: given any monoid (M,e,⊙) we have a monad B(S)=S×M called the writer-to-M monad.[5] By using different monoids, we can model different flavours of uncertainty, but note that this is only a commutative monad when (M,e,⊙) is a commutative monoid.
There's another ordinary usage of the word "uncertainty" where an uncertain belief would be something like "AGI arrives before 2040 unless there's a nuclear war" and a certain belief would be something like "AI will arrive before 2040." At least, with regards to teh binary question of whether AGI arrives before 2040. That is, an uncertain belief is one with an "unless..." clause.
Formalising this, we have a fixed set of events F, and a belief-state is a pair (s,E)∈S×F. Your belief-state is (s,E) when you commit to the state s∈S occurring unless the event E∈F occurs. This flavour of uncertainty corresponds to the writer monad B(S)=S×F, where F is a monoid when equipped with union ∪:F×F→F and the empty set ∅∈F.
One might use this flavour of uncertainty to models various kinds of defeasible reasoning, where a belief-state (s,E) is characterised by the precondition E under which the belief would be defeated or disavowed.
Or maybe an uncertain belief is a one full of amendments, clarifications, conditions, disclaimers, excuses, hedges, limitations, qualification, refinements, reservations, restrictions, stipulations, temperings, etc. By contrast, a certain belief is made "with no ifs or buts", bare and direct.
Formalising this, we have a fixed set of clarifications C, and a belief-state is a pair (s,l)∈S×List(C). Here, List(C) is the free monoid over the set of clarifications C equipped with concatenation +:List(C)×List(C)→List(C) and the empty list []∈List(C).
Now, the writer to List(C) monad isn't a commutative monad. Or interpreted philosophically, a clarified guess isn't the kind of uncertainty you can have to parts of the world. Suppose "I think Alice is happy but I don't know her very well" is my belief-state about Alice, and "I think Bob is happy but he's difficult to read" is my belief-state about Bob. What's my belief-state about both Alice and Bob? Is it (1) "Alice and Bob are both happy, but I don't know Alice very well and Bob is difficult to read" or (2) "Alice and Bob are both happy, but Bob is difficult to read and I don't know Alice very well". That is, in which order should we combine the clarifications?
The instinctive trick is to declare that two belief-states are equal if the lists of clarifications are equal up-to-permutation — this implies that (1) and (2) are the same belief-state, which does seem intuitive to me. If we play this trick, then the resulting flavour of uncertainty is captured by the writer-to-N[C] monad, where N[C] is the free commutative monoid. This does indeed give a commutative monad!
5 — identity monad
If we've anticipating an election between n candidates, then the simplest way to characterise your belief about the election by your best guess with no additional information about how unsure you are. If S is the state-space then S is also the belief-state-space, i.e. there's a distinct belief-state for each s∈S. The set of belief-states is therefore equal (up to bijection) to the set of outcomes itself.
I'll admit that this flavour of uncertainty is somewhat degenerate — e.g. every belief-state is a certainty in some particular state — but it's worth including nonetheless. On some readings of Wittgenstein's Tractatus, this is his model of how language represents the world, our utterances stand in direct isomorphism with the state-of-affairs.
Anyway, answering the four Cs would give the identity monad!
6 — maybe monad
The last example was a bit silly, so how about this instead..?
If we've anticipating an election between n candidates, then I'll characterise your belief about the election either by your best guess (with no additional information) or an "I don't know" response. This is an very coarse-grained flavour of uncertainty — the only belief-state about the election (other than certainty in a particular candidate) is the belief-state of utter cluelessness, or shrugging one's shoulders!
Despite the coarse-grained-ness, it's pretty commonly encountered in the wild. For example, it's the typical flavour of uncertainty encountered in surveys/questionnaires, where ⊥ is read as "no opinion/don't know". It's also encountered in voting, where ⊥ is read as "abstention".
Formally speaking, if S is the state-space then there's a distinct belief-state for each state s∈S plus an additional option denoted ⊥. The belief-state-space is therefore S+1, denoting the disjoint union of S with the singleton set {⊥}. If you're certain that the outcome is s∈S then your belief-state is s∈S. This flavour of uncertainty corresponds to the famous maybe monad.
7 — K-distribution monad
You might, at this point, feel short-changed. I've discussed so far a range of flavours of uncertainty which are all coarser-grained than probabilistic knowledge, so why not stick to Δ? Let's consider then a more fined-grained characterisation of belief-state, one that tracks infinitesimal differences between probability assignments.
The Levi-Civita Field is an extension of the real numbers which contains infinitesimal values like ϵ,ϵ2,2ϵ+ϵ2,π2√ϵ and infinite values like