# Infra-Bayesian Logic

*This research was produced during SERI MATS. Thanks to Vanessa Kosoy for providing ideas and reading drafts.*

Introduction
============

In this article, we investigate "infra-Bayesian logic" (IBL for short), which is an idea introduced by Vanessa Kosoy. The original idea is outlined in [Vanessa Kosoy's Shortform](https://www.alignmentforum.org/posts/dPmmuaz9szk26BkmD/vanessa-kosoy-s-shortform?commentId=6BhuJdyMScbyQeeac). Here, we expand with some details and examples. We also try to fix the mentioned issues (e.g. lack of continuity for certain maps) by investigating several candidate categories for semantics. However, we fail to find something that works.

As a theory of beliefs and reasoning, infra-Bayesianism gives rise to semantics for a certain logic, which we might call "infra-Bayesian logic" (IBL for short). Formalizing the syntax for this logic has the advantage of providing a notion of description complexity for infra-POMDPs (partially observable Markov decision processes) expressed via this syntax, and hence could serve as a foundation for an infra-Bayesian analogue of AIXI. Infra-Bayesian logic is not the only way to define an infra-Bayesian analog of AIXI. Such an alternative could be to use [oracle machines](https://en.wikipedia.org/wiki/Oracle_machine) (with an extra input tape for a source of randomness): For a probabilistic oracle machine, the corresponding IB hypothesis is the closed convex hull of all stochastic environments that result from using the oracle machine with a particular oracle, and then one could use the description complexity of the oracle machine (which can be defined by choosing a universal oracle machine) as a basis for an infra-Bayesian AIXI. The analogue of oracle machines for (non-infra-Bayesian) AIXI would be (probabilistic) Turing machines.

However, infra-Bayesian logic might be an interesting alternative to describing infra-Bayesian hypotheses, and this approach would be specific to infra-Bayesianism (there is, as far as we know, no good analogue of infra-Bayesian logic in (ordinary) Bayesianism).

Note that we are currently unaware of a working semantics for the higher order logic. We discuss some candidates considered in [Candidates for the Semantics](#Candidates_for_the_Semantics), and the ways in which they fail. It's unclear whether these issues with the semantics are mostly technical in nature, or whether they point to some deeper phenomena. We can, however, restrict to a first order IBL on finite sets, which, albeit less powerful, is still expressive enough for many applications (in particular covers all the examples in [Examples](#Examples)).

See also the paragraph on IBL [in the overview of the learning theoretic Agenda](https://www.lesswrong.com/posts/ZwshvqiqCvXPsZEct/the-learning-theoretic-agenda-status-2023#Direction_1_3__Infra_Bayesian_Logic).

Outline and Reading Guide
-------------------------

You can skim/skip the Notation section and use it as a reference instead. The main description of IBL is given in [Infra-Bayesian Logic](#Infra_Bayesian_Logic). To get an initial and informal idea what IBL looks like, read [Less Formal Description of Infra-Bayesian Logic](#Less_Formal_Description_of_Infra_Bayesian_Logic). For a technical description and a complete list of properties, read [Formal Description of Infra-Bayesian Logic](#Formal_Description_of_Infra_Bayesian_Logic). Note that the latter description requires some familiarity with category theory.

In [Constructions in IBL](#Constructions_in_IBL) we list how we can combine basic elements of IBL to express more complicated things.

In [Infra-POMDPs](#Infra_POMDPs) we talk about infra-POMDPs as an application of IBL. Some knowledge of infra-Bayesianism is beneficial here, but not required. We highlight the section on [Examples](#Examples), where we describe the IBL terms for concrete Infra-POMDPs.

In [Candidates for the Semantics](#Candidates_for_the_Semantics) we discuss the various (failed) candidates we tried for the higher-order logic version of IBL. A typical reader is not expected to read this section.

The [Appendix](#Appendix) is for mostly technical proofs and counterexamples. We recommend to only look these up when you are interested in the technical details. For example, if you wish to understand why conjunction is not continuous in IBL, you can find the details there.

Notation
========

Let us describe notation needed for using concepts from infra-Bayesianism.

This notation section is partially copied from the [Infra-Bayesian Physicalism article](https://www.alignmentforum.org/posts/gHgs2e2J5azvGFatb/infra-Bayesian-physicalism-a-formal-theory-of-naturalized#Notation), but extended from finite sets to compact Polish spaces, wich requires a bit more measure theory. Also, we use the symbol $\Box X$for homogeneus ultracontributions (instead of $\Box^c X$ as in the IBP article).

The notation from the IBP post is a bit different from some of the other posts on infra-Bayesianism in that it uses ultradistributions/ultracontributions rather than infradistributions.

We denote $\mathbb{R}_{+}:=[0,\infty)$. We will work a lot with compact Polish spaces.

Compact Polish spaces are spaces that are topologically equivalent to *some* compact metric space (the metric is not fixed, however, only the topology). An important special case of compact Polish spaces are finite (discrete) sets.

**Definition 1**. *Given a compact Polish space *$X$*, a contribution on *$X$* is a (Borel) measure *$\theta$* on *$X$* with *$\theta(X)\le 1$*. Given a measurable function *$f:X\rightarrow\mathbb{R}$* and *$\theta\in\Delta^c X$*, we denote *$\theta(f):=\int_X f(x) \mathrm d\theta(x)$*. The space of contributions is denoted *$\Delta^c X$*, equipped with the weak-*$*$* topology (i.e. the weakest topology such that the functions *$\Delta^c X \ni \theta \mapsto \theta(f)\in\mathbb{R}$* are continuous for all continuous functions *$f:X\to\mathbb{R}$*).*

Naturally, any (probability) distribution is in particular a contribution, so $\Delta X\subseteq\Delta^c X$. There is a natural partial order on contributions: $\theta_{1}\le\theta_{2}$ when $\theta_{1}(A)\le\theta_{2}(A)$ for all measurable $A\subset X$.

**Definition 2**. *A homogeneous ultracontribution (HUC) on *$X$* is non-empty closed convex *$\Theta\subseteq\Delta^c X$* which is downward closed w.r.t. the partial order on *$\Delta^c X$*. The space of HUCs on *$X$* is denoted *$\Box X$*.*

If a HUC $\Theta\in\Box X$ has the property $\Theta$ s.t. $\Theta\cap\Delta X\ne\varnothing$, we call it a homogeneuous ultradistribution.

Sometimes we need a topology on the space of HUCs $\Box X$. In this case we will use the topology induced by the Hausdorff metric, (where we use a metric on $\Delta^c X$ that fits with the weak-$*$ topology. The topology induced by the Hausdorff metric is also equivalent to the so-called Vietoris topology, which is a topology that only depends on the underlying toplogy on $\Delta^c(X)$, see [here](https://math.stackexchange.com/questions/791334/hausdorff-metric-and-vietoris-topology). See also Propositions 42 and 50 in [Less Basic Inframeasure Theorey](https://www.alignmentforum.org/s/CmrW8fCmSLK7E25sa/p/idP5E5XhJGh9T5Yq9#Section_6__IKR_distance) for the same result for infra-distributioins). One can show that $\Box X$ is a compact Polish space with this topology when $X$ is a compact Polish space, see Lemma 10. Let us introduce more notation.

For a set $A\subset \Delta^c(X)$, $\operatorname{cl}A$ denotes its closure.

Given another compact Polish space $Y$ and a measurable function $s:X\rightarrow Y$, $s_*:\Box X\rightarrow\Box Y$ is the pushforward by $s$: 

$$
s_*\Theta:=\operatorname{cl}\{s_*\theta\mid\theta\in\Theta\},
$$

 where $(s_*\theta)(A):= \theta(s^{-1}(A)) %\sum_{x\in s^{-1}(y)}\theta(x),$ for all measurable $A\subset Y$. We can omit the $\operatorname{cl}$ in the definition if $s$ is continuous.

A map $X\to \Box Y$ is sometimes referred to as an *infrakernel*.

Given an infrakernel $\Xi:X\rightarrow\Box Y$, $\Xi_*:\Box X\rightarrow\Box Y$ is the pushforward by $\Xi$: 

$$
\begin{gathered} \Xi_*\Theta:= \ \operatorname{cl}\{\kappa_*\theta\mid\theta\in\Theta,\: \kappa:X\rightarrow\Delta^c Y,\, \kappa\;\text{measurable},\; \forall x\in X:\kappa(x)\in\Xi(x)\}, \end{gathered}
$$

 where (for measurable $A\subset Y$) 

$$
(\kappa_*\theta)(A):= % \sum_{x\in X}\theta(x)\kappa(x;y) \int_X \kappa(x)(A) \,\mathrm d\theta(x).
$$

For a measurable function $s:X\to Y$ We also define the pullback operator $s^*:\Box Y\to \Box X$ via 

$$
s^*\Theta := \operatorname{cl}\{\theta\in\Delta^c X\mid s_*\theta\in\Theta\}.
$$

 We can omit $\operatorname{cl}$ here if $s$ is continuous.

$\operatorname{pr}_X:X\times Y\rightarrow X$ is the projection mapping, $i_X: X\to X\coprod Y$ is the inclusion map.

Given $\Theta\in\Box X$ and an infrakernel $\Xi:X\rightarrow\Box Y$, $\Theta\ltimes\Xi\in\Box{(X\times Y)}$ is the semidirect product: 

$$
\begin{gathered} \Theta\ltimes\Xi:= \ \operatorname{cl}\{\kappa\ltimes\theta\mid\theta\in\Theta,\: \kappa:X\rightarrow\Delta^c Y,\: \kappa\;\text{measurable},\; \forall x\in X:\kappa(x)\in\Xi(x)\}, \end{gathered}
$$

 where the measure $\kappa\ltimes\theta$ is defined by 

$$
% (\kappa\ltimes\theta)(x,y):=\theta(x)\kappa(x;y) (\kappa\ltimes\theta)(A\times B) := \int_A \kappa(x)(B) \,\mathrm d\theta(x)
$$

 for all measurable $A\subset X$, $B\subset Y$, which can be extended to arbitrary measurable sets $C\subset X\times Y$ in the usual measure-theoretic way.

We will also use the notation $\Xi\rtimes\Theta\in\Box{(Y\times X)}$ for the same HUC with $X$ and $Y$ flipped. And, for $\Lambda\in\Box Y$, $\Theta\ltimes\Lambda\in\Box{(X\times}Y)$ is the semidirect product of $\Theta$ with the constant ultrakernel whose value is $\Lambda$.

For a closed set $A\subset X$, we define $\top_{A}:=\{\mu\in\Delta^c X \mid \mu(X\setminus A)=0\}\in \Box X$ (we'll call these *sharp* ultradistributions). We also define $\bot\in \Box X$ via $\bot=\{0\}$.

Infra-Bayesian Logic
====================

The formal description in this section assumes some familiarity with type theory and categorical logic. For an informal overview of the syntax, we point the reader to [Less Formal Description of Infra-Bayesian Logic](#Less_Formal_Description_of_Infra_Bayesian_Logic).

The infra-Bayesian notion of beliefs gives rise to a fairly weak form of logic, in the sense that the spaces of predicates in infra-Bayesian logic don't form Heyting algebras, and are generally non-distributive and even non-modular as lattices. Also, due to the lack of function types, we cannot use the full syntax of type theory.

We will therefore work with a simplified syntax, still maintaining versions of many of the usual constructions appearing in higher order logic. This language can be used to describe infra-POMDPs (see [Infra-POMDPs](#Infra_POMDPs)), which in turn is a useful beginning to something like an infra-AIXI (see [Application: an Infra-Bayesian AIXI Analogue](#Application__an_Infra_Bayesian_AIXI_Analogue)).

Less Formal Description of Infra-Bayesian Logic
-----------------------------------------------

Infra-Bayesian logic is a logical language. The language has types. Types can come from a set of initial types $T^\iota$, or can be combined from other types using sums and products. Also, $0$ and $1$ are special types (where $0$ contains no element, and $1$ contains exactly one element, so to speak). There is also a more complicated construction of additional types: If $\alpha$ is a type, then we also consider predicates on $\alpha$ a type, which we denote by $[\alpha]$.

Infra-Bayesian logic also has maps between types. The set of maps between types $\alpha$ and $\beta$ is denoted by $F_{\alpha\to\beta}$. We will not list every kind of map that we require for infra-Bayesian logic in this informal description. But some examples are $\land_{\alpha} \in F_{[\alpha]\times[\alpha]\to[\alpha]}$ and $\lor_{\alpha} \in F_{[\alpha]\times[\alpha]\to[\alpha]}$, which correspond to a meaning of "and" and "or".

A map of type $F_{1 \to \alpha}$ is basically the same as something of type $\alpha$, but it allows us to compose this with other maps. Examples are $\top \in F_{1\to [1]}$ and $\bot \in F_{1\to [1]}$ which correspond to "true" and "false". There are also maps for equality and predicate evaluation. All kinds of different maps can be combined and composed to yield expressions in infra-Bayesian logic.

How does this connect to infra-Bayesianism? A collection of sentences in infra-Bayesian logic can have a model $\mathcal{M}$. There are lots of rules for a model to ensure that the symbols of infra-bayesian logic correspond to their intended meaning. A model maps types into topological spaces. In order to make sure the above-mentioned types behave reasonably under the model, we require that $\mathcal{M}(0)$ is the empty topological space, $\mathcal{M}(1)$ is the $1$-point topological space, products and sums work as expected ($\mathcal{M}(\alpha\times\beta)=\mathcal{M}(\alpha)\times\mathcal{M}(\beta)$ and $\mathcal{M}(\alpha+\beta)=\mathcal{M}(\alpha)\sqcup\mathcal{M}(\beta)$). A special case is the topological space for $[\alpha]$ (the type of predicates on $\alpha$): We require that $\mathcal{M}([\alpha])$ is the topological space of homogeneous ultra-contributions over $\mathcal{M}(\alpha)$, i.e. $\Box \mathcal{M}(\alpha)$. We will also explore alternatives to HUCs over topological spaces, but it should be some general notion of infra-distribution. The model of a map $f\in F_{\alpha\to\beta}$ is a map between the topological spaces $\mathcal{M}(\alpha)\to \mathcal{M}(\beta)$. We will have conditions that the model of a map is consistent with the meaning. For example, we require that the model of "$\land_\alpha$" maps two HUCs to their intersection.

We will later investigate the precise conditions on toplogical spaces and maps that we would like to have for infra-Bayesian logic.

Formal Description of Infra-Bayesian Logic
------------------------------------------

### Syntax

Given a set $T^\iota$ of primitive types, we can require that the types form a category $\mathcal{C}(T)$, which should be the "freest" category such that:

$T^{\iota} \subset Ob(\mathcal{C}(T))$

$\mathcal{C}(T)$ has finite products and coproducts

$\mathcal{C}(T)$ supports infra-Bayesian logic (Definition 3).

We won't construct the category $\mathcal{C}(T)$ here (uniqueness is clear). We'll use the shorthand $F_{\alpha \to \beta} = \mathcal{C}(T)(\alpha, \beta)$ for the set of morphisms, and write $V_\alpha = F_{1 \to \alpha}$ (where $1$ is the terminal object).

**Definition 3**. *We say that a category *$\mathcal{C}$* with finite products and coproducts supports infra-Bayesian logic, if it satisfies the following requirements:*

*There is a functor *$[\_]: \mathcal{C} \to \mathcal{C}^{op}$* (recall that *$\mathcal{C}^{op}$* is the opposite category of *$\mathcal{C}$*). For *$\alpha\in Ob(\mathcal{C}(T))$*, *$[\alpha]$* is the object intended to correspond to predicates on *$\alpha$*. For *$f\in \mathcal{C}(\alpha, \beta)$*, we write *$f^*: [\beta]\to [\alpha]$* instead of *$[f]$* to denote pullback of predicates.*

*There are morphisms *$\lor_\alpha, \land_\alpha \in F_{[\alpha]\times [\alpha] \to [\alpha]}$*. We require that these operations turn *$V_{[\alpha]}$* into a bounded lattice, and we require the functor *$[\_]$* to induce a functor into the category of lattices. In particular, we have *$\top, \bot\in V_{[1]}$*.*

*We require that *$\operatorname{pr}_\beta^*: [\beta] \to [\alpha\times \beta]$* have natural left and right adjoints with respect to the poset structure (of the lattice) above. We also require these adjoints to come from morphisms in *$\mathcal{C}$*, denoted by *$\exists_{\alpha\beta}, \forall_{\alpha\beta} \in F_{[\alpha\times \beta]\to [\beta]}$* respectively.*

*We require the existence of an equality predicate *$=_{\alpha} \in V_{[\alpha \times \alpha]}$*, which is the minimal predicate such that *$(\operatorname{diag}_{\alpha}^* \circ =_{\alpha}) = \top_\alpha$* (cf. *[*A constant function with output top*](#A_constant_function_with_output_top)*).*

*We require the existence of *$\operatorname{ev}_{\alpha} \in V_{[[\alpha]\times \alpha]}$* (predicate evaluation). Given *$f: \beta \to [\alpha]$*, we can pull back *$\operatorname{ev}_{\alpha}$* via *$f\times 1_\alpha$* to get *$\hat{f} \in V_{[\beta\times \alpha]}$*. Note however that we cannot require universality here (i.e. that every predicate in *$V_{[\beta\times \alpha]}$* arise this way), due to the failure of the disintegration theorem in infra-Bayesianism. It's not entirely clear currently what the appropriate condition to require from *$\operatorname{ev}_{\alpha}$* should be on the syntax side, even though the intended semantics can be described (cf. Item 5 in the semantics).*

*For *$q\in \mathbb{Q}\cap[0,1]$* we use *$\delta_q \in V_{[1+1]}$* as a syntactic constant symbol corresponding to a coin toss with probability *$q$*.*

Note that in Item 6 we could require the following more general set of symbols, however, the relevant ones can likely be approximated via the existing syntax. For $n\in \mathbb{N}$, let $D_n\subset \Box n$ (treating $n$ as an $n$-point discrete space) be the subset of "describable" ultracontributions under some such notion. We would then introduce constant symbols $\ulcorner \mu \urcorner \in V_{[n]}$ for each $\mu\in D_n$.

**Remark 4**. *In order to construct the syntax for the first order theory, we can instead consider two categories *$\mathcal{C}$* (base types) and *$\mathcal{D}$* (predicate types), with the functor *$[\_]: \mathcal{C} \to \mathcal{D}^{op}$*. In this context the predicate functor *$[\_]$*cannot be iterated, hence we are left with a first order theory. The requirements in Definition 3 remain the same, except for Item 5 being removed. The construction of a pushforward via a kernel in* [*Pushforward via a kernel*](#Pushforward_via_a_kernel) *no longer makes sense in that generality, but we explain how to recover it for finite sets in the first order theory in* [*Pushforward via kernel for finite sets*](#Pushforward_via_kernel_for_finite_sets)*, which is then used when unrolling the time evolution of an infra-POMDP in* [*Process*](#Process)*.*

### Semantics

We require a model to be a functor $\mathcal{M}: \mathcal{C}(T) \to \mathcal{P}$, which preserves finite products and coproducts.

Moreover, we require $\mathcal{P}$ to support infra-Bayesian logic (cf. Definition 3), and the model functor $\mathcal{M}$ to respect the logical structure.

In practice, we will want $\mathcal{P}$ to be some subcategory of $Top$. The motivating candidate is to take $\mathcal{P}$ to be the category of compact Polish spaces with continuous maps, and the predicate functor on $\mathcal{P}$ to be $\Box$. This choice however doesn't work for higher order logic.

We nevertheless spell out what the logical semantics translate to, using $\Box$ as a generic symbol denoting some appropriate notion of "ultracontributions".

$\mathcal{M}([\alpha]) = \Box\mathcal{M}(\alpha)$ (cf. Lemma 10), and $\mathcal{M}(f^*) = \mathcal{M}(f)^*$ is the pullback (see [Continuity Counterexamples](#Continuity_Counterexamples) about issues with continuity in the case of HUCs).

We require $\mathcal{M}$ to induce a lattice homomorphism $V_{[\alpha]}\to \Box \mathcal{M}(\alpha)$, where

$\mathcal{M}(\lor_\alpha): \Box \mathcal{M}(\alpha)\times \Box \mathcal{M}(\alpha) \to \Box \mathcal{M}(\alpha)$ is given by convex hull of the union

$\mathcal{M}(\land_\alpha): \Box \mathcal{M}(\alpha)\times \Box \mathcal{M}(\alpha) \to \Box \mathcal{M}(\alpha)$ is given by intersection (see [Continuity Counterexamples](#Continuity_Counterexamples) about issues with continuity in the case of HUCs)

Predicates. Let $X = \mathcal{M}(\alpha)$, $Y = \mathcal{M}(\beta)$, and $\operatorname{pr}_Y: X\times Y \to Y$ be projection onto the second factor. The following follow from the adjunction

$\mathcal{M}(\exists_{\alpha\beta}) = \operatorname{pr}_{Y*}$ is the pushforward

For $\mu \in \Box (X\times Y)$, we have 

$$
\begin{gathered}            \mathcal{M}(\forall_{\alpha\beta})(\mu) = \            \left\{p \in \Box Y | \forall q\in \Delta^c(X\times Y):\left(\operatorname{pr}_{Y*}(q) = p\implies q\in \mu\right)\right\} \end{gathered}
$$

 (see [Continuity Counterexamples](#Continuity_Counterexamples) about issues with continuity in the case of HUCs)

$\mathcal{M}(=_{\alpha}) =\top_{\operatorname{diag}_{\mathcal{M}(\alpha)}}$ (as a sharp ultradistribution)

If $X=\mathcal{M}(\alpha)$, then $\mathcal{M}(\operatorname{ev}_{\alpha}) = \top_{\Box X}\ltimes 1_{\Box X}$, where $\top_{\Box X} \in \Box\Box X$, and $1_{\Box X}: \Box X \to \Box X$ is considered as an infrakernel.

$\mathcal{M}(\delta_q)\in\Box(\operatorname{pt}+\operatorname{pt})$ is the crisp ultradistribution corresponding to a coin toss with probability $q\in\mathbb{Q}\cap [0, 1]$ (here $\operatorname{pt}$ is the one point space).

Note in the more general setting of describable ultracontributions, we would require $\mathcal{M}(\ulcorner \mu \urcorner) = \mu$.

**Definition 5**. *A subset of *$V_{[1]}$* (i.e. a set of sentences) is called a theory. We say that *$\mathcal{M}$* models the theory *$\mathcal{T}$* if *$\mathcal{M}(\phi) = \top_{\operatorname{pt}}$* for all *$\phi\in\mathcal{T}$*.*

**Remark 6**. *Finding an appropriate category *$\mathcal{P}$*turns out to be harder than first expected. We discuss various candidates considered in* [*Candidates for the Semantics*](#Candidates_for_the_Semantics)*.*

*In general, we note that for infra-POMDPs with finite state spaces, the transition (infra-)kernels are always continuous, and some of the issues with continuity mentioned in* [*Candidates for the Semantics*](#Candidates_for_the_Semantics) *are less of a problem.*

Constructions in IBL
--------------------

In the following we construct various useful components of IBL using the syntax outlined above. These constructions will also be used to build examples of infra-POMDPs in [Infra-POMDPs](#Infra_POMDPs).

### Pushforward

Given $f: X \to Y$, we can construct the pushforward $f_*: [X] \to [Y]$ as follows. First, consider the following two maps into $[X\times Y]$:

$1 \xrightarrow{=_Y} [Y\times Y] \xrightarrow{(f\times 1_Y)^{*}} [X\times Y]$ (this represents the graph of $f$)

$[X] \xrightarrow{\operatorname{pr}_X^{*}} [X\times Y]$.

Composing the product of these two with $\land_{X\times Y}: [X\times Y]\times [X\times Y] \to [X\times Y]$, we get $[X] = 1\times [X] \to [X\times Y]$, and finally post-composing with $[X\times Y] \xrightarrow{\exists_{XY}} [Y]$, we get $f_*: [X] \to [Y]$.

### Pushforward via a kernel

Given $f: X \to [Y]$, we can construct the pushforward $f_*: [X] \to [Y]$ as well. This is done similarly to [Pushforward](#Pushforward), except the element in $[X\times Y]$ is replaced with 

$$
1 \xrightarrow{\operatorname{ev}_Y} [[Y]\times Y] \xrightarrow{(f\times 1_Y)^{*}} [X\times Y],
$$

 where $\operatorname{ev}_Y$ is predicate evaluation.

### Pushforward via kernel for finite sets

If $X$ is a finite set, then we can think of a map $f: X\to [Y]$ as a collection of points $f_x: 1_\mathcal{D}\to [Y]$, which is meaningful in the first order syntax too, as long as the predicate category has a final object $1_\mathcal{D}\in \mathcal{D}$. In this case we can construct the pushforward along the kernel $f$ in the first order theory as follows. For each $x\in X$ we have the composite 

$$
G_{f_x}: 1 \xrightarrow{f_x} [Y] \xrightarrow{(\iota_x \times 1_Y)_*} [X\times Y],
$$

 where $\iota_x$ is the inclusion of $x \in X$, and $(\iota_x \times 1_Y)_*$ is the regular pushforward from [Pushforward](#Pushforward). Now, taking the product of these over $x\in X$, and taking (iterated) disjunction, we have 

$$
1\xrightarrow{\prod_{x\in X} G_{f_x}} \prod_{x\in X}[X\times Y] \xrightarrow{\lor} [X\times Y],
$$

 which is the "graph of $f$", using which we construct the pushforward $f_*: [X]\to [Y]$ analogously to [Pushforward](#Pushforward) and [Pushforward via a kernel](#Pushforward_via_a_kernel).

### Equality of functions

Given $f, g: \alpha \to \beta$, we want to construct a sentence $s_{f = g} \in V_{[1]}$. This can be done as follows. First, take the composite with the diagonal on $\alpha$ 

$$
\varphi: \alpha \xrightarrow{\operatorname{diag}_\alpha} \alpha \times \alpha \xrightarrow{f \times g} \beta \times \beta,
$$

 then we have 

$$
s_{f=g}: 1 \xrightarrow{=_\beta} [\beta\times\beta] \xrightarrow{\varphi^{*}} [\alpha] \xrightarrow{\forall_{\alpha 1}} [1],
$$

 so $s_{f=g}\in V_{[1]}$ is the desired sentence.

### Mixing with probability 1/2

Assume that we have two terms $s_1\in F_{1\to \sigma_1}$, $s_2\in F_{1\to\sigma_2}$. Then we have $s_1+s_2 \in F_{1+1\to \sigma_1+\sigma_2}$. Applying a pushforward yields $(s_1+s_2)_* \in F_{[1+1]\to [\sigma_1+\sigma_2]}$. Then we can compose with $\delta_{1/2}\in F_{1\to [1+1]}$, which assigns a fair coin distribution on $1+1$. 

$$
f : 1 \xrightarrow{\delta_{1/2}} [1+1] \xrightarrow{(s_1+s_2)_*} [\sigma_1+\sigma_2].
$$

### A constant function with output bottom

We can construct a constant function term $f\in F_{\alpha\to [\beta]}$ whose model $\mathcal{M}(f)$ is a constant function that maps everything to $\bot_{\mathcal{M}(\beta)}$ as follows. Let $t_\alpha \in F_{\alpha\to 1}$ be the terminal map. Then we can define the term $f$ via 

$$
f : \alpha \xrightarrow{t_\alpha} 1 \xrightarrow{\bot} [1] \xrightarrow{t_\beta^{*}} [\beta].
$$

 This does the right thing: By factoring through $\mathcal{M}(1)=\operatorname{pt}$ the function $\mathcal{M}(f)$ has to be constant, and by using $\bot$, the output has to be $\bot_{\mathcal{M}(\beta)}$.

### A constant function with output top

This works the same way, just using the symbol $\top \in F_{1\to [1]}$ instead of $\bot\in F_{1\to [1]}$: 

$$
f : \alpha \xrightarrow{t_\alpha} 1 \xrightarrow{\top} [1] \xrightarrow{t_\beta^{*}} [\beta].
$$

### Components of infrakernels for sum types

For a function $f\in F_{\alpha+\beta \to [\gamma + \delta]}$, how do we get access to its components, so that we get a term $f_{\alpha,\gamma}\in F_{\alpha\to [\gamma]}$? We do this by composing with $i_{\alpha\beta}$ and $i_{\gamma\delta}^{*}$, i.e. 

$$
f_{\alpha,\gamma} : \alpha \xrightarrow{i_{\alpha}} \alpha+\beta    \xrightarrow{f} [\gamma+\delta]    \xrightarrow{i_{\gamma}^{*}} [\gamma].
$$

 For the other components this would work essentially in the same way, which would give us functions $f_{\alpha,\delta}\in F_{\alpha\to[\delta]}$, $f_{\beta,\gamma}\in F_{\beta\to[\gamma]}$, $f_{\beta,\delta}\in F_{\beta\to[\delta]}$.

Infra-POMDPs
============

Setup
-----

We can describe infra-POMDPs in the language of infra-Bayesian logic in the following way. Infra-POMDPs consist of the following.

Finite sets of actions $\mathcal{A}$ and observations $\mathcal{O}$

For each observation $o\in \mathcal{O}$, a type $\sigma_o$ of states producing the given observation. Let $\sigma_* = \sum_{o\in \mathcal{O}}\sigma_o$ be the type of all states.

An initial state $s_0 \in V_{[\sigma_*]}$

For each $a\in \mathcal{A}$, a transition kernel $K_a\in F_{\sigma_* \to [\sigma_*]}$.

Process
-------

Given a state at time $t$, $s_t\in V_{[\sigma_*]}$, and an action $a\in \mathcal{A}$, we can apply the kernel pushforward $(K_a)_*: [\sigma_*] \to [\sigma_*]$, to end up in a new state $s_{t+1} \in V_{[\sigma_*]}$. Once receiving an observation $o_t\in \mathcal{O}$, we can do an update on the observed state. In general, this update depends on the loss function, but we can obtain a "naive" update via pull back and push forward through $i_{o_t}: \sigma_{o_t} \to \sum_{o\in \mathcal{O}} \sigma_o = \sigma_*$ to get the observed state $\hat{s}_{t+1} = (i_{o_t})_*(i_{o_t})^*(s_{t+1}) \in V_{[\sigma_*]}$.

Laws
----

In infra-Bayesianism, laws (also known as belief functions in earlier posts on infra-Bayesianism) are functions $\Theta:\Pi \to \Box ((\mathcal{A}\times \mathcal{O})^\omega)$, where $\Pi$ is the space of possible (deterministic) policies of the IB agent (a technical note: the space $(\mathcal{A}\times\mathcal{O})^\omega$ is a Polish space, when equipped with the topology generated by cylinder sets). Such a law describes infra-Bayesian beliefs how a policy will lead to certain histories.

Under some conditions, one can convert an infra-POMDP into a corresponding law. We will not explain exactly how, and instead refer to [Theorem 4 in "The many faces of infra-beliefs"](https://www.alignmentforum.org/s/CmrW8fCmSLK7E25sa/p/GS5P7LLLbSSExb3Sk#The_Pseudocausal_Commutative_Square).

Examples
--------

Let us give an example of an infra-POMDP. The first example is basically just and ordinary MDP, rewritten to fit into the above notation for infra-POMDPs.

**Example 7**. *We set *$\mathcal{O}=\{0,1\}$*, *$\mathcal{A}=\{0,1\}$*. This example has (functionally) no relevant hidden states, i.e. states are equivalent to observations. Taking action *$0\in\mathcal{A}$* will lead to the same observation as the previous observation. Taking action *$1\in\mathcal{A}$* will lead to the other observation as the previous observation. As for the initial conditions, we start out with probability *$\tfrac12$* for each observation/corresponding state.*

Let us explain how Example 7 can be described using an IBL theory $\mathcal{T}\subset V_1$. We have types $\sigma_0$ and $\sigma_1$ for the states corresponding to the two possible observations. First, we introduce non-logical symbols $s_1\in V_{\sigma_0}$, $s_2\in V_{\sigma_1}$. Then, using the construction in [Mixing with probability 1/2](#Mixing_with_probability_1_2), we can define a term in $V_{[\sigma_*]}$ that assigns probability $1/2$ to each of $\sigma_0$, $\sigma_1$, as desired. Using function equality from [Equality of functions](#Equality_of_functions), we can equate the initial state $s_0\in V_{[\sigma_*]}$ with this mixture. We add the equality sentence to our theory $\mathcal{T}$. This ensures that every model of the theory $\mathcal{T}$ satisfies $\mathcal{M}(s_0) = \tfrac12\top_{\mathcal{M}(\sigma_0)} + \tfrac12\top_{\mathcal{M}(\sigma_1)}$.

Next, we will add sentences that describe the transition kernels. Note that we have two transition kernels $K_0,K_1\in F_{\sigma_*\to [\sigma_*]}$, one for each possible action. Then, for each transition kernel, we can decomposition it, like in [Components of infrakernels for sum types](#Components_of_infrakernels_for_sum_types). This gives us $8$ possibilities. For example, $(K_0)_{\sigma_0,\sigma_1}$ describes our beliefs that we will be in state $\sigma_1$ after we take action $0\in A$ and are in state $\sigma_0$. For all the $8$ possible combinations, the resulting function should be a constant function, with values $\bot$ or $\top_{\sigma_{0,1}}$. Again, we can use the equality of functions as described in [Equality of functions](#Equality_of_functions) to ensure that these components of the transition kernels have the correct values, in accordance with the transition kernel as described in the example. We will add these sentences to the theory $\mathcal{T}$, so that $\mathcal{T}$ now has 9 elements.

**Example 8**. *The following is a "fully infra" POMDP.*

*   $\mathcal{O}= \{o\}$*, single observation*
*   $\sigma_o = \{A, B\}$*, two states*
*   $\mathcal{A}= \{a\}$*, single action.*

*The credal set corresponding to*

*   $K(A)$* is the interval *$[\frac13 A + \frac23 B, B]$
*   $K(B)$* is the interval *$[A, \frac23 A + \frac13 B]$*.*

![Credal sets K(A) and K(B)](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/bbd6379d198cc6432819e45c1010b4e7e2ced0b3ae11e1fd.png)

*We can take downward closure to end up with a homogeneous ultradistribution.*

So a single step in the Markov process swaps $A$ and $B$, but with some Knightean uncertainty of landing up to $1/3$ away from the target. As we iterate through multiple timesteps, we gain no information through observation (since $|\mathcal{O}| = 1$), so the intervals of Knightean uncertainty widen (the portion outside the Knightean interval shrinks as $(\frac23)^t$).

We can construct the above infra-POMDP via IBL as follows. Let 

$$
\delta_{1/3}, \delta_{2/3}\in V_{[2]}
$$

 be coin tosses with probability of heads equal to $1/3$ and $2/3$ respectively. We could in principle approximate these with iterated fair coin tosses, but we assume them as given for convenience. Let 

$$
i_A, i_B: 1 \to 1 + 1 = \sigma_*
$$

 be the two states. Then we have 

$$
\top_A: 1 \xrightarrow{\top} [1] \xrightarrow{i_{A*}} [\sigma_*],
$$

 and similarly for $\top_B$. We can construct the intervals of length $1/3$ from $A$ and $B$: 

$$
I_A = \top_A \lor \delta_{2/3} \in V_{[\sigma_*]}
$$

$$
I_B = \top_B \lor \delta_{1/3} \in V_{[\sigma_*]}.
$$

 Finally, we construct the transition kernel $K_a = I_B + I_A: \sigma_* \to [\sigma_*]$.

Application: an Infra-Bayesian AIXI Analogue
--------------------------------------------

A potential application for infra-Bayesian logic is to describe the hypotheses of an AIXI-like infra-Bayesian agent, by using IBL to describe infra-POMDPs. Let us expand a bit on this idea.

Let's assume an infra-Bayesian agent knows that the environment is an infra-POMDP and also happens to know the finitely many actions $\mathcal{A}$ the agent can take each time step, and the finitely many possible observations $\mathcal{O}$ the agent could be receiving. However, it does not not know how many states there are. (We will leave rewards out of the picture here. We could include rewards by encoding it in the observations, e.g., by adding a reward $r_o$ for each observation. But for now let's focus only on the agent's model of the environment.)

An infra-Bayesian agent would have a set of hypotheses of how the environment could be. In our setting, each hypothesis has the form of an infra-POMDP. Like an AIXI agent, we would like to have a variant of Occam's razor: simpler hypotheses should receive a higher weight.

There is a potential approach to use a finite theory in IBL to describe a hypothesis for our infra-POMDP, and then the weight of this hypothesis in the prior is based on the length of the description of the IBL theory, e.g. proportional to $2^{-2l}$ when $l$ is the description length. Note that some IBL theories might have no valid model, so these theories should be discarded from the hypotheses; and there might be other reason why an IBL theory might be excluded from the space of hypotheses, see below.

Each theory in infra-Bayesian logic can have (possibly none or multiple) models. If we use types $\sigma_o$, $\sigma_*$ and symbols $s_0\in V_{[\sigma_*]}$, $K_a\in F_{\sigma_*\to [\sigma_*]}$ as in [Setup](#Setup), then each model $\mathcal{M}$ describes an infra-POMDP: The initial state can be described by $\mathcal{M}(s_0)$, and for each $a\in\mathcal{A}$, $\mathcal{M}(K_a)$ is the transition kernel.

The question arises what do we do if there are multiple models for the same IBL term. Let us describe two approaches, which both rely on converting the infra-POMDP into a corresponding law, see [Laws](#Laws).

A first approach could be to only allow theories in IBL that produce models which are unique up to equivalence, where we say that two models are equivalent if they produce infra-POMDPs that produce the same laws.

A second approach could be to consider all possible models in a first step, then convert these models into corresponding laws, and then take the disjunction (i.e. closed convex hull of all outputs of the laws) to turn it into the final law.

Candidates for the Semantics
============================

Compact Polish Spaces with Continuous Maps
------------------------------------------

A first candidate for the category $\mathcal{P}$ would be compact Polish spaces with continuous maps, and '$\,\Box$' being the space of HUCs as defined in [Notation](#Notation).

However, we run into issues with continuity in this category. Namely, the maps $\mathcal{M}(\land)$, $\mathcal{M}(\forall_{\alpha\beta})$, $\mathcal{M}(f)^*$ are not always continuous, see [Continuity Counterexamples](#Continuity_Counterexamples).

Allowing Discontinuity
----------------------

Another approach could be to bite the bullet on discontinuity and broaden the set of allowed morphisms in the semantics category. The problem with these approaches generally is that pullbacks really only behave nicely with respect to continuous maps, we typically lose functoriality when allowing discontinuity. That is, the desired property $(g\circ f)^* = f^* \circ g^*$ can fail to hold for maps $f:X\to Y$, $g:Y\to Z$. This is mostly because for discontinuous functions we have to take the closure in the definition of the pullback (see [Notation](#Notation)).

### Upper Semicontinuity

This approach is inspired by the fact that while intersection is not continuous on $\Box X$, it is upper semicontinuous (wrt to the set inclusion order) on $\Box X$.

For this approach, we would use the category of compact polish spaces with a closed partial order, and for the maps we require that they are monotone increasing and upper semicontinuous. Here, a function $f:X\to Y$ is upper semicontinuous when 

$$
x_n \to x\land f(x_n)\to y\implies y \le_{Y} f(x)
$$

 holds for all sequences $\{x_n\}\subset X$ and points $x\in X$, $y\in Y$. As for the partial order on $\Box X$, one could consider the partial order based on set inclusions, or additionally combine this with the stochastic order mentioned in [Definition 2.1 in IBP](https://www.alignmentforum.org/posts/gHgs2e2J5azvGFatb/infra-bayesian-physicalism-a-formal-theory-of-naturalized#Downwards_closure) by requiring that elements in $\Box X$ are also downwards closed with respect to the stochastic order.

In both cases, the approach with upper semicontinuous maps, runs into the functoriality issues mentioned above, see [Semi-continuous Pullback is not Compositional](#Semi_continuous_Pullback_is_not_Compositional).

### Measurable Maps

We could try to broaden the set of morphisms even further, but naturally the issues with functoriality remain.

A Different Notion of HUCs
--------------------------

A possible remedy for the continuity issues could be to use an alternative definition of HUCs, in which the problematic maps become continuous. Roughly speaking, the high level idea here is to require elements of the modified HUCs to "widen" closer to $\bot$, thus avoiding the discontinuities.

Unfortunately, we were not able to find a working semantics of this type, despite trying different approaches, as described below.

We can require HUCs to be closed under the finer partial order $\preceq$ in Definition 9, and modify Definition 2 accordingly. Let $\Box^L(X)$ denote the space of these alternative HUCs. One downside of this approach is that now the space $\Box^L X$ depends on the metric on $X$, while previously it only depended on the underlying topology.

**Definition 9** (downward closure related to 1-Lipschitz functions). *Let *$X$* be a compact metric space. For *$\theta_1,\theta_2\in\Delta^c(X)$* we define the relation *

$$
\theta_1\preceq \theta_2 :\iff        \forall f: X\to \mathbb{R}_+,\, f\;1\text{-Lipschitz}:        \, \theta_1(1+f)\le \theta_2(1+f).
$$

* The space *$\Box^L(X)$* is defined as the set of closed convex subsets of *$\Delta^c(X)$* that are downward closed under the partial order *$\preceq$*.*

To see that it achieves some of the desired behavior, we show that $\mathcal{M}(\land)$ is continuous in Lemma 14. This approach also requires that we work with compact metric spaces, instead of merely with compact polish spaces.

We give some technical details in [Standard setting for the alternative HUC case](#Standard_setting_for_the_alternative_HUC_case). Later we will look at alternatives, mostly to justify the choices made in [Standard setting for the alternative HUC case](#Standard_setting_for_the_alternative_HUC_case).

### Standard setting for the alternative HUC case

The [Category of metric spaces](https://en.wikipedia.org/wiki/Category_of_metric_spaces) is typically equipped with maps that are $1$-Lipschitz continuous, and the metric on a product $X\times Y$ of metric spaces $X,Y$ is given by 

$$
d_{X\times Y}((x_1,y_1),(x_2,y_2)) = \max(d_X(x_1,x_2),d_Y(y_1,y_2)).
$$

 We do make some further modifications. First, we only consider compact metric spaces whose metric $d$ only has values in $[0,1]$. This allows us to consider sums/coproducts of metric spaces (usually the category of metric spaces does not have coproducts). For the metric on a sum (disjoint union) of two metric spaces, we set the distance of two points from different components to $1$.

Let us define the metric we will use on $\Box^L$. As a metric on $\Delta^c(X)$ we will use the Kantorovich-Rubenstein metric 

$$
% \label{eq:kr_metric_def}\tag{1}    d(p,q) := \sup \{|p(g)-q(g)| : g:X\to [-1,1]\;1\text{-Lipschitz}\},
$$

 which is a metric that is compatible with the weak-$*$ topology on $\Delta^c(X)$. Then we use the Hausdorff metric $d_H$ on $\Box^L$. It can be seen that this Hausdorff metric has values in $[0,1]$ again.

A problem with $\Box^L(X)$ is that it is not always preserved under the pullback, i.e. $f^*(\Theta)\not\in\Box^L(X)$ can happen for some $f:X\to Y$, $\Theta\in\Box^L(Y)$. Thus, we will redefine the pullback in this context. For a function between metric spaces $f:X\to Y$ we define the modified pullback $f^{*L}:\Box^L Y\to \Box^L X$ via $f^{*L}(\Theta):=\{\mu\in \Delta^c(Y) | \exists \nu\in f^*(\Theta): \mu\preceq \nu\}$. We will use this alternative pullback for the case of $\Box^L$.

Under this setting, we run into the issue that $\mathcal{M}(\land)$ is not $1$-Lipschitz continuous, see Example 16. This is despite the fact that $\mathcal{M}(\land)$ is continuous (and probably even Lipschitz continuous).

### Allow higher Lipschitz constants for maps

One might wonder what happens, when we pick a higher Lipschitz constant $c>1$ for maps in our category (instead of $c=1$). If we have two functions with a Lipschitz constant $c>1$, then we can only guarantee a Lipschitz constant of $c^2$ for the composition (e.g. with the function $[0,1]\ni x\mapsto \min(1,cx)\in[0,1]$). If we repeat this argument, we cannot guarantee a finite Lipschitz constant, because $c^n\to\infty$ as $n\to\infty$.

So, what happens if we have allow maps with Lipschitz constant $2$? It turns out that then we run into issues with functoriality, as in [Allowing Discontinuity](#Allowing_Discontinuity). A concrete counterexample is described in Example 15.

### Another metric on products

Instead of the choice for $d_{X\times Y}$ in [Standard setting for the alternative HUC case](#Standard_setting_for_the_alternative_HUC_case), we could consider using the metric 

$$
d_{X\times Y}((x_1,y_1),(x_2,y_2)) =    d_X(x_1,x_2)+d_Y(y_1,y_2).
$$

 A first problem with this choice is that this is incompatible with any finite bound on $d$, as is the case in [Standard setting for the alternative HUC case](#Standard_setting_for_the_alternative_HUC_case). This issue can be avoided by considering extended metric spaces, which are metric spaces whose metric can take values in $[0,\infty]$ (in that case the distance between disjoint components in a sum is set to $\infty$).

A more difficult problem with this approach would be that the diagonal map $\operatorname{diag}:X\to X\times X$ is not $1$-Lipschitz continuous for other natural choices of metric on products. We do need the diagonal map, see, e.g., [Equality of functions](#Equality_of_functions).

### Modifying the definition of alternative HUCs

We mention that as an extension, the definition for $\preceq$ in Definition 9 could be modified to include a constant $c>0$ and use $\theta_1(c+f) \le \theta_2(c+f)$. For smaller $c>0$, this would make these alternative HUCs sharper. The version with $c=1$ has some drawbacks as a lot of probability mass gets assigned to points nearby: For $X=[0,1]$, we have $\tfrac12\delta_0 \preceq\delta_1$, so an alternative HUC which contains $\delta_1$ also has to contain $\tfrac12\delta_0$. In the context of infra-Bayesianism, this means we can use these kind of HUCs only in combination together with a smaller class of loss functions (in this case, loss functions that are of type $1+f$ for a nonnegative Lipschitz continuous $f$).

One might wonder whether increasing $c$ might help us decrease the Lipschitz constant for $\mathcal{M}(\land)$ or even choose a $c>1$ such that $\mathcal{M}(\land)$ is $1$-Lipschitz. While the Lipschitz constant does get improved, calculating through Example 16 would show that the Lipschitz constant $\mathcal{M}(\land)$ cannot reach $1$ even if we use these modified versions of $\Box^L$.

Appendix
========

**Lemma 10**. *If *$X$* is a compact Polish space then so is *$\Box X$*.*

*Proof.* It is known that the space of nonempty compact subsets of $X$ is compact in the Hausdorff metric. One can also show that $\Box X$ is a closed subset of the space of nonempty compact subsets of $X$.

For the related concepts (but not HUCs) in IB theory, this result can also be found in [Proposition 47 in "Less Basic Inframeasure Theory"](https://www.alignmentforum.org/s/CmrW8fCmSLK7E25sa/p/idP5E5XhJGh9T5Yq9#Section_6__IKR_distance) ◻

Issues with Continuity
----------------------

Using the topology induced by the Hausdorff metric on $\Box X$ (see below Definition 2), we find that in the 'logical' semantics (inverse) limit type constructions (in the category theoretical sense) are generally not continuous (see [Continuity Counterexamples](#Continuity_Counterexamples) for details). This includes the semantics for $\land_\alpha$, $\forall_{\alpha\beta}$, and the pullback $f^*$.

If $X$ itself is finite, then $\Box X$ is nice enough that we don't run into these issues. This observation is sufficient for example in the construction of the infra-POMDPs in [Examples](#Examples) when the state spaces are finite. However, we quickly run into issues if we're not careful with iterating the $\Box$ construction, since $\Box X$ is not finite even if $X$ is.

Below is some discussion on a possible approach to trying to fix these issues (we haven't found an entirely satisfactory fix though).

### Continuity Counterexamples

**Lemma 11**. *The function *$\mathcal{M}(\land):\Box\mathcal{M}(\alpha)\times\Box\mathcal{M}(\alpha)\to\Box\mathcal{M}(\alpha)$*, given by *$\mathcal{M}(\land)(\mu,\nu) = \mu\cap \nu$* is not always continuous.*

*Proof.* Consider the case where $\mathcal{M}(\alpha)$ is the space $[0,1]$ with standard topology. This is a Polish space.

We consider sequences with $x_i=1/2-1/i$ and $y_i=1/2+1/i$. We define $x_0=y_0=1/2$. Then $\top_{\{x_i\}}$ and $\top_{\{y_i\}}$ are in $\Box\mathcal{M}(\alpha)$. (For a point $z\in[0,1]$, I understand this notation to be $\top_{\{z\}}:= \{a\delta_z \mid a\in[0,1]\}$, where $\delta_z\in\Delta([0,1])$ is the measure that puts all weight on the single point $z$).

One can calculate that $\mathcal{M}(\land) (\top_{\{x_i\}},\top_{\{y_i\}})= \bot$.

Because of the Hausdorff metric in $\Box\mathcal{M}(\alpha)$ we have $\top_{\{x_i\}}\to\top_{\{x_0\}}$ and $\top_{\{y_i\}}\to\top_{\{x_0\}}$.

To put it together, we have 

$$
\begin{aligned}      \lim \mathcal{M}(\land) (\top_{\{x_i\}},\top_{\{y_i\}})      = \bot      &\neq  \top_{\{x_0\}}      \      &= \mathcal{M}(\land) (\top_{\{x_0\}},\top_{\{y_0\}})      \ &=      \mathcal{M}(\land) (\lim\top_{\{x_i\}},\lim\top_{\{y_i\}}).      \end{aligned}
$$

 Thus, $\mathcal{M}(\land)$ is not continuous. ◻

**Lemma 12**. *The function *$\mathcal{M}(\forall_{\alpha\beta})$* is not always continuous.*

*Proof.* Consider the case that $\mathcal{M}(\alpha)=\mathcal{M}(\beta)=[0,1]$. We use the notation $f:=\mathcal{M}(\forall_{\alpha\beta})$. We choose the sequence $\mu_n = \top_{[(0,0),(1,1/n)]}$, where $[,]$ denotes the line between points. Then one can show that $f(\mu_n)=\bot$.

However, we also have $\mu_n\to \mu_0:=\top_{[(0,0),(1,0)]}$. One can show that $f(\mu_0)=\top_{\{0\}}\in\Box\mathcal{M}(\beta)$ holds. Thus, we have 

$$
f(\mu_n)\to\bot \ne f(\mu_0),
$$

 i.e. $f$ is not continuous. ◻

**Lemma 13**. *There is a continuous function *$f:X\to Y$* such that *$f^*:\Box Y\to\Box X$* is not continuous.*

*Proof.* Pick $f:[-1,1]\to [0,1]$, $f(x)=\max(0,x)$. Then $f^*(\top_{\{1/n\}}) = \top_{\{1/n\}}$, but for the limit we have $f^*(\top_{\{0\}})=\top_{[-1,0]}$, and not $\top_{\{1/n\}}\to \top_{[-1,0]}$. ◻

### Semi-continuous Pullback is not Compositional

Let $f, g: [0,1] \to [0, 1]$ be given by 

$$
g(x) = \begin{cases}    0 & \text{if } x < 1/2 \    1 & \text{if } x \geq 1/2, \end{cases}
$$

 And 

$$
f(x) = \begin{cases}    0 & \text{if } x < 1/3 \    1/2 & \text{if } 1/3 \leq x < 2/3 \    1 & \text{if } x \geq 2/3. \end{cases}
$$

 Both $f$ and $g$ are monotone increasing, upper semi-continuous. Let $C = [0, 1/2] \subset [0, 1]$. Then $B = g^{-1}(C) = [0, 1/2)$, the closure $\overline{B} = [0, 1/2]$. Hence $f^{-1}(B) = [0, 1/3)$, while $f^{-1}(\overline{B}) = [0, 2/3)$, so 

$$
\overline{f^{-1}(\overline{B})} \neq \overline{f^{-1}(B)}.
$$

We can construct a corresponding counterexample where $(g\circ f)^* \neq g^*\circ f^*$ by considering $\Theta \in \Box [0, 1]$, defined as follows. Let $\Theta = \top_C$ be the sharp HUC on $C$. Then 

$$
g_*^{-1}(\Theta) = \{\rho \in \Delta ^c[0, 1]: \operatorname{supp}(\rho) \subset [0, 1/2)\}
$$

 so 

$$
g^*(\Theta) = \overline{g_*^{-1}(\Theta)} = \{\rho \in \Delta ^c[0, 1]: \operatorname{supp}(\rho) \subset [0, 1/2]\}.
$$

 Then 

$$
(g\circ f)^*(\Theta) = \{\rho \in \Delta ^c[0, 1]: \operatorname{supp}(\rho) \subset [0, 1/3]\},
$$

 but 

$$
(f^*\circ g^*)(\Theta) = f^*(g^*(\Theta)) = \{\rho \in \Delta ^c[0, 1]: \operatorname{supp}(\rho) \subset [0, 2/3]\},
$$

 which is different.

Stricter Homogeneity
--------------------

We collect some technical results for [A Different Notion of HUCs](#A_Different_Notion_of_HUCs)

With Definition 9 we can prove continuity for $\mathcal{M}(\land)$, which does not hold for ordinary HUCs.

**Lemma 14**. *The function *$\mathcal{M}(\land):\Box^L\mathcal{M}(\alpha)\times\Box^L\mathcal{M}(\alpha)\to\Box^L\mathcal{M}(\alpha)$*, given by *$\mathcal{M}(\land)(\mu,\nu) = \mu\cap \nu$* is continuous.*

*Proof.* We set $X:=\mathcal{M}(\alpha)$. As a metric on $\Delta^c(X)$ we will use the Kantorovich-Rubenstein metric 

$$
\label{eq:kr_metric_def}\tag{1}        d(p,q) := \sup \{|p(g)-q(g)| : g:X\to [-1,1]\;1\text{-Lipschitz}\}.
$$

Let $\mu_k$, $\nu_k$ be sequences in $\Box^L(X)$ with $\mu_k\to\mu_0$, $\nu_k\to\nu_0$. We want to show that $\mu_k\cap\nu_k\to\mu_0\cap\nu_0$. We have 

$$
\label{eq:hausdorff_decompose}\tag{2}        d_H(\mu_k\cap\nu_k,\mu_0\cap\nu_0)        \leq \sup_{p\in\mu_k\cap\nu_k} d(p,\mu_0\cap\nu_0)        + \sup_{p\in\mu_0\cap\nu_0} d(p,\mu_k\cap\nu_k).
$$

 For the first term, let $p_k\in\mu_k\cap\nu_k$ be such that $d(p_k,\mu_0\cap\nu_0)$ is maximized. By compactness, there exists a convergent subsequence of $p_k$. Wlog let $p_k\to p_0$. We have $p_k\in\mu_k$ for all $k$, and taking limits implies $p_0\in\mu_0$. The same argument also implies $p_0\in\nu_0$. Thus, we have 

$$
\sup_{p\in\mu_k\cap\nu_k} d(p,\mu_0\cap\nu_0)        = d(p_k,\mu_0\cap\nu_0)        \to d(p_0,\mu_0\cap\nu_0)=0.
$$

 For the second term, let $p_0\in\mu_0\cap\nu_0$ be given. Due to $\mu_k\to\mu_0$, there exists a sequence $p_k$ with $p_k\in\mu_k$ and $p_k\to p_0$. Similarly, there exists a sequence $q_k$ with $q_k\in\nu_k$ and $q_k\to q_0$. The idea is now to construct a measure (i.e. a point in $\Delta^c(X)$) $r_k$ that is close to $p_k$ and $q_k$ but in $\mu_k\cap\nu_k$.

Wlog we assume $p_0(1)>0$ and $p_k(1)>0$, $q_k(1)>0$ for all $k$. We define $\delta_k>0$ via 

$$
\delta_k:= \frac{d(p_k,q_k)(2+\operatorname{diam}_X)}{(p_k+q_k)(1)},
$$

 where $\operatorname{diam}_X:=\sup_{x,y\in X} d(x,y)$ is the diameter of $X$. Clearly, we have $\delta_k\to0$. We also define 

$$
r_k := \frac{1-\delta_k}{2}(q_k+p_k).
$$

 We want to show $r_k\preceq q_k$ and $r_k\preceq p_k$. By symmetry we only need to show $r_k\preceq p_k$. For that purpose, let $f:X\to \mathbb{R}_+$ be an arbitrary $1$-Lipschitz continuous function. We define $g:=1+f$. We have to show $r_k(g)\le p_k(g)$.

We can decompose $g=g_{\min} + g_0$, where $g_{\min} := \min_{x\in X} g(x)$ is a constant, and $g_0$ is a nonnegative function that satisfies $g_0(x_0)=0$ for some $x_0\in X$. Since $g_0$ is $1$-Lipschitz continuous, this implies that $g_0(x) \le \operatorname{diam}_X$ for all $x\in X$. Thus, $(1+\operatorname{diam}_X)^{-1} g_0$ is a function that is $1$-Lipschitz continuous and bounded by $1$, i.e. admissible in the definition Eqn. (1). We can use this to obtain 

$$
\begin{aligned}            (q_k-p_k)(g_0)            &=            (  1+\operatorname{diam}_X) (q_k-p_k)\bigl( (1+\operatorname{diam}_X)^{-1} g_0 \bigr)            \ &\le            (1+\operatorname{diam}_X) d(q_k,p_k)            \ &\le            \frac{d(p_k,q_k)(1+\operatorname{diam}_X)}{(p_k+q_k)(1)} (p_k+q_k)(g).        \end{aligned}
$$

 On the other hand, we have 

$$
\begin{aligned}            (q_k-p_k)(g_{\min})            &= g_{\min} (q_k-p_k)(1)            \ &\le            g_{\min} d(p_k,q_k)            \le \frac{d(p_k,q_k)}{(p_k+q_k)(1)} (p_k+q_k)(g_{\min})            \ &\le            \frac{d(p_k,q_k)}{(p_k+q_k)(1)} (p_k+q_k)(g)        \end{aligned}
$$

 Adding these yields 

$$
\begin{aligned}            (q_k-p_k)(g)            &=            (q_k-p_k)(g_{\min}+g_0)            \ & \le            \frac{d(p_k,q_k)(1+\operatorname{diam}_X+1)}{(p_k+q_k)(1)}(p_k+q_k)(g)            =            \delta_k (p_k+q_k)(g).        \end{aligned}
$$

 If we rearrange this inequality, we get $(1-\delta_k)(p_k+q_k)(g)\le 2p_k(g)$. Dividing by $2$ yields $r_k(g)\le q_k(g)$, Since $g=f+1$ and $f\ge0$ was an arbitrary $1$-Lipschitz function this proves $r_k\preceq p_k$. Since $p_k\in\mu_k$ and $\mu_k$ is downwards closed wrt $\preceq$, this implies $r_k\in\mu_k$. Similarly, we can obtain $r_k\preceq q_k$ and $r_k\in\nu_k$. From the definition of $r_k$ we also obtain $r_k\to p_0$ (due to $p_k\to p_0$ and $q_k\to q_0$). Thus we have $d(p_0,\mu_k\cap \nu_k) \le d(p_0,r_k)+d(r_k,\mu_k\cap\nu_k)    =d(p_0,r_k)+0\to0$ as $k\to\infty$. Since $p_0\in \mu_0\cap\nu_0$ was arbitrary, this implies that the right-hand side in Eqn. (2) converges to $0$. This implies $\mu_k\cap\nu_k\to\mu_0\cap\nu_0$ in the Hausdorff metric, which completes the proof. ◻

In the next we will use the notation $f^{*L}$ for the modified pullback, see [Standard setting for the alternative HUC case](#Standard_setting_for_the_alternative_HUC_case).

**Example 15**. *Consider *$X=[0,1]$* as a compact metric space with the usual metric. Further, let *$f,g:X\to X$* be given by *$f(x)=\min(2x,1)$*, *$g(x)=x/2$* for all *$x\in [0,1]$*. Then *$g^{*L}\circ f^{*L} \ne (f\circ g)^{*L}$*, i.e. functoriality does not hold.*

*Proof.* Clearly, we have $(f \circ g)(x)=x$ for all $x\in [0,1]$.

We define 

$$
\Theta_0 := \{ \mu\in\Delta^c([0,1]) : \mu \preceq \delta_0\}.
$$

 We claim that $(g^{*L}\circ f^{*L})(\Theta_0) \ne (f\circ g)^{*L}(\Theta_0)$ holds. Due to $(f\circ g)(x)=x$ for all $x\in[0,1]$ this simplifies to 

$$
\label{eq:ineq_goal_L}\tag{3}    (g^{*L}\circ f^{*L})(\Theta_0) \ne \Theta_0.
$$

We start by observing $\delta_0\in\Theta_0$ and $\delta_0\in f^{*L}(\Theta_0)$.

We also claim $\tfrac34\delta_{1/3} \preceq\delta_0$. Indeed, for $1$-Lipschitz continuous $h:[0,1]\to\mathbb{R}^+$ we have 

$$
\tfrac34\delta_{1/3} ( 1 + h)  = \tfrac34 (1 + h(\tfrac13))  \le \tfrac34 (1 + h(0) + \tfrac13)  =\tfrac34( \tfrac43 + h(0))  \le 1 + h(0) = \delta_0(1+h).
$$

Due to $\delta_0\in f^{*L}(\Theta_0)\in\Box^L [0,1]$ this implies $\tfrac34\delta_{1/3}\in f^{*L}(\Theta_0)$. Due to $g(2/3)=1/3$ we have $g_*(\tfrac34\delta_{2/3}) = \tfrac34\delta_{1/3}$. This implies $\tfrac34\delta_{2/3} \in g^{*}(f^{*L}(\Theta_0))  \subset (g^{*L}\circ f^{*L})(\Theta_0)$.

However, we can also show that $\tfrac34\delta_{2/3}\not\in\Theta_0$. Indeed, lets consider the $1$-Lipschitz continuous function $h(x)=x$. Then $\tfrac34\delta_{2/3} ( 1 + h)  =\tfrac34 ( 1 + 2/3)  = 5/4  \not\le 1 = \delta_0 (1+h).$ Thus $\tfrac34\delta_{2/3}\not\in\Theta_0$. This completes the proof of Eqn. (3) and hence completes the proof of the lemma. ◻

**Example 16**. *Let *$X=\{0,1\}$* be the compact metric space where the metric satisfies *$d(0,1)=1$*. We use the standard setting from* [*Standard setting for the alternative HUC case*](#Standard_setting_for_the_alternative_HUC_case) *otherwise. Then the function*$\mathcal{M}(\land):\Box^L\mathcal{M}(\alpha)\times\Box^L\mathcal{M}(\alpha)\to\Box^L\mathcal{M}(\alpha)$*, given by *$\mathcal{M}(\land)(\Theta_1,\Theta_2) = \Theta_1\cap \Theta_2$* is not *$1$*-Lipschitz continuous.*

*Proof.* Consider the measures $\mu_0=\tfrac12\delta_0$, $\mu_1=\tfrac12\delta_1$, $\mu_2=\tfrac12\delta_0 + \tfrac12\delta_1$.

Let $\Theta_i$ be the smallest set in $\Box^L$ that contains $\mu_i$, for $i=0,1,2$. Then it can be calculated that 

$$
\begin{aligned}            \Theta_0 &= \{\alpha_0\delta_0+\alpha_1\delta_1 \mid            \alpha_0 + 2\alpha_1 \le \tfrac12,\; \alpha_0,\alpha_1\ge0 \},            \            \Theta_1 &= \{\alpha_0\delta_0+\alpha_1\delta_1 \mid            2\alpha_0 + \alpha_1 \le \tfrac12,\; \alpha_0,\alpha_1\ge0 \},            \            \Theta_2 &= \{\alpha_0\delta_0+\alpha_1\delta_1 \mid                2\alpha_0 + \alpha_1 \le \tfrac32,\;                \alpha_0 + 2\alpha_1 \le \tfrac32,\;            \alpha_0,\alpha_1\ge0 \}.            %0\le \alpha_0\le \tfrac12,\; 0\le \alpha_1\le \tfrac12 \}.        \end{aligned}
$$

 We want to calculate $d_H(\Theta_2,\Theta_0)$. Due to $\Theta_0\subset \Theta_2$, we have $d_H(\Theta_2,\Theta_0)=\sup_{\mu\in\Theta_2} d(\mu,\Theta_0)$. Since the supremum of a convex function is attained on extremal points, we only need to consider $d(\mu,\Theta_0)$ for the case that $\mu$ is an extremal point of $\Theta_2$. The extremal points of $\Theta_2$ are $\mu_2=\tfrac12\delta_0 + \tfrac12\delta_1$, $\tfrac34\delta_0$, $\tfrac34\delta_1$, $0$. Let us calculate the distances (or bounds on distances) of these points to $\Theta_0$. We start with $\mu_2$. We observe $\tfrac12\delta_0\in\Theta_0$. This implies 

$$
\begin{aligned}        d(\mu_2,\Theta_0) &\le d(\mu_2,\tfrac12\delta_0)        \ &=        \sup\{|\mu_2(g)-\tfrac12\delta_0(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        \ &=        \sup\{|\tfrac12\delta_1(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        =\tfrac12. %       \ &= \tfrac12. \end{aligned}
$$

 On the other hand, we have $\mu_2(1)=1$ and $\mu(1)\le \tfrac12$ for all $\mu\in\Theta_0$. Since $1$ is admissible in Eqn. (1), this implies $d(\mu_2,\mu)\ge\tfrac12$ for all $\mu\in\Theta_0$, and therefore $d(\mu_2,\Theta_0)\ge\tfrac12$. Thus, $d(\mu_2,\Theta_0)=\tfrac12$.

Next, we calculate a bound on $d(\tfrac34\delta_0,\Theta_0)$. As we have $\tfrac12\delta_0\in\Theta_0$, we obtain 

$$
\begin{aligned}        d(\tfrac34\delta_0,\Theta_0)        &\le        d(\tfrac34\delta_0,\tfrac12\delta_0)        \ &=        \sup\{|\tfrac34\delta_0(g)-\tfrac12\delta_0(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        \ &=        \sup\{|\tfrac14\delta_0(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        = \tfrac14. \end{aligned}
$$

 Similarly, for a bound on $d(\tfrac34\delta_1,\Theta_0)$, we observe $\tfrac14\delta_1\in\Theta_0$ and calculate 

$$
\begin{aligned}        d(\tfrac34\delta_1,\Theta_0)        &\le        d(\tfrac34\delta_1,\tfrac14\delta_1)        \ &=        \sup\{|\tfrac34\delta_1(g)-\tfrac14\delta_1(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        \ &=        \sup\{|\tfrac12\delta_1(g)| :        g:X\to [-1,1]\;1\text{-Lipschitz}\}        = \tfrac12. \end{aligned}
$$

 Finally, $d(0,\Theta_0)=0$ holds due to $0\in\Theta_0$. In summary, we have shown for all extremal points of $\Theta_2$ that the distances to $\Theta_0$ do not exceed $\tfrac12$ (and obtain the value $\tfrac12$ in at least one case). This implies $d_H(\Theta_2,\Theta_0)=\tfrac12$.

By symmetry we also have $d(\Theta_2,\Theta_1)=\tfrac12$.

Now, let us consider the intersection $\Theta_0\cap\Theta_1$. Using the above descriptions for $\Theta_0$ and $\Theta_1$ we can obtain the subset relation 

$$
\begin{aligned}            \Theta_0\cap\Theta_1            &\subset            \{\alpha_0\delta_0+\alpha_1\delta_1 \mid            \alpha_0 + \alpha_1 \le \tfrac13,\; \alpha_0,\alpha_1\ge0 \}            \ &=            \{ \mu\in\Delta^c(X) \mid \mu(1)\le \tfrac13\}.        \end{aligned}
$$

 This implies $\mu(1)\le\tfrac13$ for all $\mu\in\Theta_0\cap\Theta_1$. Recall that we have $\mu_2\in\Theta_2$ and $\mu_2(1)=1$. By using $g=1$ in Eqn. (1), it follows that $d(\mu_2,\mu)\ge 1- \tfrac13 = \tfrac23$ for all $\mu\in\Theta_0\cap\Theta_1$. Thus, 

$$
\begin{aligned}        d(\Theta_2,\Theta_0\cap\Theta_1)        &\ge        d(\mu_2,\Theta_0\cap\Theta_1)        % \ &=        =        \inf \{d(\mu_2,\mu) : \mu\in\Theta_0\cap\Theta_1\}        \ge \tfrac23. \end{aligned}
$$

 Combining all these results shows 

$$
\begin{aligned}        d_H(\Theta_2\cap\Theta_2,\Theta_0\cap\Theta_1)        &\ge \tfrac23 > \tfrac12        \        &= \max(d_H(\Theta_2,\Theta_0),d(\Theta_2,\Theta_1))        = d((\Theta_2,\Theta_2),(\Theta_0,\Theta_1)), \end{aligned}
$$

 which shows that the Lipschitz constant has to be at least $\tfrac32>1$. ◻

Measurability and Continuity Proofs
-----------------------------------

Let us collect proofs that some maps between compact Polish spaces that are mentioned in [Semantics](#Semantics) are indeed measurable, as required. This concerns $\mathcal{M}(\exists_{\alpha\beta})$, $\mathcal{M}(\forall_{\alpha\beta})$, $\mathcal{M}(\lor_\alpha)$, $\mathcal{M}(\land_\alpha)$.

**Lemma 17**. *The function *$\mathcal{M}(\lor):\Box\mathcal{M}(\alpha)\times \Box\mathcal{M}(\alpha)$* is continuous and measurable.*

*Proof.* Let $X:=\mathcal{M}(\alpha)$ and $f:=\mathcal{M}(\lor)$. Recall that $f(\mu,\nu):=\operatorname{conv}(\mu\cup\nu)$. Let $\mu_n,\nu_n\in\Box X$ be sequences with $\mu_n\to\mu_0$ and $\nu_n\to\nu_0$.

We need to show $f(\mu_n,\nu_n)\to f(\mu_0,\nu_0)$ for continuity. We do this by showing two things: First, every limmit $z_0$ of a convergent sequence $z_n$ with $z_n\in f(\mu_n,\nu_n)$ satisfies $z_0\in f(\mu_0,\nu_0)$. Second, for every point $z_0\in f(\mu_0,\nu_0)$ there exists a sequence $z_n$ with $z_n\in f(\mu_n,\nu_n)$.

So, first, let $z_n$ be a sequence with $z_n\in f(\mu_n,\nu_n)$ and $z_n\to z_0$. We have $z_n\in\operatorname{conv}(\mu_n\cup\nu_n)$, and thus there exists $x_n\in\mu_n$, $y_n\in\nu_n$, $\alpha_n\in [0,1]$ with $z_n=\alpha_nx_n + (1-\alpha_n) y_n$. Wlog we have convergences $x_n\to x_0\in\mu_0$, $y_n\to y_0\in\nu_0$, $\alpha_n\to\alpha_0\in[0,1]$. This implies $z_0=\alpha_0x_0+(1-\alpha_0)y_0\in \operatorname{conv}(\mu_0\cup\nu_0)$.

For the other part, let $z_0\in f(\mu_0,\nu_0)$ be given. Thus, there exist $x_0\in\mu_0$, $y_0\in\mu_0$, $\alpha_0\in[0,1]$ with $z_0=\alpha_0x_0+(1-\alpha_0)y_0$. Due to $\mu_n\to\mu_0$ and $\nu_n\to\nu_0$ there exist sequences with $x_n$, $y_n$ with $x_n\in\mu_n$, $y_n\in\nu_n$, and $x_n\to x_0$, $y_n\to y_0$. Then, we have $z_n:=\alpha_0x_n+(1-\alpha_0)y_n\in \operatorname{conv}(\mu_n\cup\nu_n)$. Taking limits implies $z_n\to z_0$. This completes the proof of continuity of $f$. ◻

**Lemma 18**. *If *$f:X\to Y$* is a continuous function between compact Polish spaces, then *$f_*:\Box X\to\Box Y$* is continuous.*

*In particular, the function *$\mathcal{M}(\exists_{\alpha\beta})=\operatorname{pr}_{\mathcal{M}(\beta)*}$* is continuous and measurable.*

*Proof.* Let $\mu_k$ be a sequence in $\Box(X\times Y)$ with $\mu_k\to\mu_0\in\Box(X\times Y)$. We want to show $f_*(\mu_k)\to f_*(\mu_0)$. As before, we do this by showing two things. First, every convergent sequence $p_k\in f_*(\mu_k)$ with $p_k\to p_0$ implies $p_0\in f_*(\mu_0)$. Second, for every point $p_0\in f_*(\mu_0)$ we can find a sequence $p_k$ with $p_k\to p_0$ and $p_k\in f_*(\mu_k)$.

Note that $f_*:\Delta^c(X)\to\Delta^c(Y)$ is continuous if $f$ is continuous.

Let $p_k\in f_*(\mu_k)$ be a convergent sequence with $p_k\to p_0$. Then there exists $q_k\in\mu_k$ with $p_k = f_*(q_k)$. Wlog $q_k\to q_0$ for some $q_0$ due to compactness. This implies $f_*(q_k)\to f_*(q_0)$ and $q_0\in\mu_0$. Due to uniqueness of the limit, we have $f_*(q_0)=p_0$ and therefore the desired $p_0\in f_*(\mu_0)$.

For the remaining part, let $p_0\in f_*(\mu_0)$ be given. Then there exists $q_0\in\mu_0$ with $p_0=f_*(q_0)$. Since $\mu_k\to\mu_0$, there exists a sequence $q_k$ with $q_k\in\mu_k$ and $q_k\to q_0$. We define $p_k:=f_*(q_k)$. Then we have $p_k\to f_*(q_0)=p_0$ and $p_k\in f_*(\mu_k)$. This completes the proof. ◻

**Lemma 19**. *The function *$\mathcal{M}(\land):\Box\mathcal{M}(\alpha)\times\Box\mathcal{M}(\alpha)\to\Box\mathcal{M}(\alpha)$*, given by *$\mathcal{M}(\land)(\mu,\nu) = \mu\cap \nu$* is measurable.*

*Proof.* We use the abbreviation $X:=\mathcal{M}(\alpha)$, and use the notation $d(\cdot,\cdot)$ for the metric on $\Delta^c(X)$ and $d_H(\cdot,\cdot)$ for the induced Hausdorff metric on $\Box X$. To show measurability, it suffices to show that the preimages of open balls are measurable. Thus, we need to show that $\{(A,B) \in(\Box X)^2 : d_H(A\cap B,C)<\varepsilon\}$ is measurable for all $C\in\Box X$ and $\varepsilon>0$.

First, we show an auxiliary claim.

**Claim 1**: Let $D\subset X$ be a compact subset. Then $\bigcup_{y\in D} \{(A,B): y\in A\cap B\}$ is closed and measurable.

Let us show that the claim is true. Let $(A_k,B_k)$ be a sequence in the set with $d_H(A_k,A)\to 0$, $d_H(B_k,B)\to 0$. Then there exists $y_k\in D$ with $y_k\in A$ and $y_k\in B$. Wlog $y_k\to y$ for some $y\in D$ (because of convergent subsequences). Then $d_H(A,y)=\lim d_H(A_k,y_k)=0$ and thus $y\in A$. Similar, $y\in B$. Thus, the limit $(A,B)$ of $(A_k,B_k)$ is in the set $\bigcup_{y\in D} \{(A,B): y\in A\cap B\}$. Thus, the set is closed and measurable.

We have $\{(A,B)  : d_H(A\cap B,C)<\varepsilon\}    =\{(A,B)  : \forall x\in A\cap B: d(x,C)<\varepsilon\}    \cap\{(A,B)  : \forall x\in C: d(A\cap B,x)<\varepsilon\}$.

Let us show measurability of $\{(A,B)  : \forall x\in C: d(A\cap B,x)<\varepsilon\}$. We have 

$$
\begin{aligned}        &\{(A,B)  : \forall x\in C: d(A\cap B,x)<\varepsilon\}        \ &\qquad=        \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}        \{(A,B)  : \forall x\in C: d(A\cap B,x)\le\delta\}        \ &\qquad=        \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}        \bigcap_{x\in C}        \{(A,B)  :  d(A\cap B,x)\le\delta\}        \ &\qquad=        \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}        \bigcap_{x\in C}        \bigcup_{y:d(y,x)\le\delta} \{(A,B): y \in A\cap B\}      \end{aligned}
$$

 For each $\delta\in(0,\varepsilon)\cap\mathbb{Q}$, $x\in C$, the set $\bigcup_{y:d(y,x)\le\delta} \{(A,B): y \in A\cap B\}$ is closed due to claim 1, because $\{y:d(y,x)\le\delta\}$ is a compact set. Recall that intersections of closed sets are closed. Thus, the set in question is the countable union of closed sets, and therefore measurable.

Now, let us show the measurability of $\{(A,B)  : \forall x\in A\cap B: d(x,C)<\varepsilon\}$. We have 

$$
\begin{aligned}        &\{(A,B)  : \forall x\in A\cap B: d(x,C)<\varepsilon\}        \ &\qquad=        \{(A,B): \forall x : d(x,C)\ge\varepsilon\implies x\not \in A\cap B\}        \ &\qquad=        \bigcap_{x:d(x,C)\ge\varepsilon} \{(A,B) : x \not\in A\cap B\}        \ &\qquad=        (\Box X)^2 \setminus\left(        \bigcup_{x: d(x,C)\ge\varepsilon} \{(A,B) : x\in A\cap B\}        \right).      \end{aligned}
$$

 Again, since the set $\{x: d(x,C)\ge\varepsilon\}$ is compact, it follows that the above set is measurable by claim 1.

This completes the proof that $\{(A,B)  : d_H(A\cap B,C)<\varepsilon\}$ is measurable. ◻

**Lemma 20**. *Let *$X,Y$* be compact metric spaces, *$q_0\in\Delta(X\times Y)$* and *$p_1\in\Delta(Y)$* be given. Then there exists *$q_1\in\Delta(X\times Y)$* with *$\operatorname{pr}_{Y*} q_1 = p_1$* and *$W_1(q_0,q_1) \le W_1(\operatorname{pr}_{Y*} q_0,p_1)$*, where *$W_1$*is the* [*Wasserstein metric*](https://en.wikipedia.org/wiki/Wasserstein_metric)*.*

*Proof.* We set $p_0:=\operatorname{pr}_{Y*} q_0 \in \Delta(Y)$. In the following, we will also use the notation $\operatorname{pr}_i:Y\times Y\to Y$, $\operatorname{pr}_i(x)=x_i$ for $i=1,2$.

Then, due to the definition of $W_1$, there exists a measure $\mu\in\Delta(Y\times Y)$ with $\operatorname{pr}_{1*}\mu = p_0$, $\operatorname{pr}_{2*}\mu = p_1$, $\mu(d_Y)=W_1(p_0,p_1)$ (due to compactness arguments, the infimum is attained in the definition of $W_1$). We choose a measure $\nu\in\Delta(X\times Y\times X\times Y)$ via 

$$
\nu(A\times B\times C\times D)        =        \int_B q_0(A\cap C|y) \hat\mu(D|y) \,\mathrm d p_0(y),
$$

 where $y\mapsto q_0(\hat A|y)$ denotes a density function that satisfies $q_0(\hat A\times \hat B)=\int_{\hat B} q_0(A|y)\,\mathrm d p_0(y)$ for all measurable $\hat A\subset X$, $\hat B\subset Y$, and $y\mapsto \hat\mu(D|y)$ is the same for the "mirrored" measure $\hat\mu$ of $\mu$, i.e. $\mu(\hat B\times D) = \int_{\hat B} \hat\mu(D|y)\,,\mathrm dp_0(y)$ for all measurable $\hat B\subset Y$. These density functions exist due to Radon-Nikodym. The measure $\nu$ exists due to Caratheodory's theorem and is unique.

The measure $\nu$ has the properties 

$$
\operatorname{pr}_{4*}\nu = p_1,        \quad        \operatorname{pr}_{12*}\nu = q_0,        \quad        \operatorname{pr}_{24*}\nu = \mu,        \quad        \operatorname{pr}_{13*}\nu = \operatorname{diag}_{X*} \operatorname{pr}_{1*} q_0,
$$

 where $\operatorname{pr}_{ij}$ is map that projects on components $i$ and $j$, and $\operatorname{diag}_{X*}:X\to X\times X$ is the diagonal map.

We now choose $q_1:=\operatorname{pr}_{34*}\nu \in \Delta(X\times Y)$. Indeed, this satisfies the desired property $\operatorname{pr}_{Y*} q_1=p_1$. As for the Wasserstein metric, $\nu(d_{X\times Y})$ is an upper bound on $W_1(q_0,q_1)$. Let us calculate $\nu(d_{X\times Y})$. We have 

$$
\begin{aligned}            \nu(d_{X\times Y}) &=            \int d_X(x_1,x_2)+d_Y(y_1,y_2)\,\mathrm d\nu(x_1,y_1,x_2,y_2)            \ &=            \int d_X(x_1,x_2)\,\mathrm d\nu(x_1,y_1,x_2,y_2)            \ &\qquad            +\int d_Y(y_1,y_2)\,\mathrm d\nu(x_1,y_1,x_2,y_2)            \ &=            \int d_X(x_1,x_2)\,\mathrm d(\operatorname{diag}_{X*}\operatorname{pr}_{1*} q_0)(x_1,x_2)            \ &\qquad            +\int d_Y(y_1,y_2)\,\mathrm d\mu(y_1,y_2)            \ &= \int d_X(x_1,x_1)\,\mathrm d(\operatorname{pr}_1 q_0)(x_1)            + \mu(d_Y)            \ &=            0 + \mu(d_Y) = W_1(p_0,p_1).        \end{aligned}
$$

 This implies $W_1(p_0,p_1)\le W_1(q_0,q_1)$, which completes the proof. ◻

**Lemma 21**. *The function *$\mathcal{M}(\forall_{\alpha\beta})$* is measurable.*

*Proof.* We abbreviate $X=\mathcal{M}(\alpha)$, $Y=\mathcal{M}(\beta)$, $f=\mathcal{M}(\forall_{\alpha\beta})$. Again, we use the notation $d(\cdot,\cdot)$ for a metric on $\Delta^c(X)$ or $\Delta^c(Y)$ and $d_H(\cdot,\cdot)$ for the induced Hausdorff metric.

Again, we start with an auxiliary claim.

**Claim 2**: Let $D\subset Y$ be a compact subset. Then $\bigcup_{p\in D} \{B \in\Box (X\times Y):    p\in f(B)\}$ is closed and measurable.

Let us show that the claim is true. Note, that the set is the same as $\bigcup_{p\in D} \{B \in\Box (X\times Y):    \forall q\in \Delta^c(X\times Y): \operatorname{pr}_{Y*} q = p \implies q\in B\}$. Let $B_k$ be a sequence in the set with $B_k\to B_0$. That means, there is a sequence $p_k$ with $p_k\in D$ and $\forall q\in \Delta^c(X\times Y): \operatorname{pr}_{Y*} q = p_k \implies q\in B_k\}$. Since $D$ is compact, we can wlog assume that $p_k\to p_0\in D$ (by selecting a convergent subsequence). Let $q_0\in\Delta^c(X\times Y)$ be given with $pr_{Y*} q_0 = p_0$. We need to show that $q_0\in B_0$ holds (this would show that $B_0$ is in the set mentioned in the claim, i.e. it would prove the claim). Wlog $q_0(X\times Y)>0$ (otherwise $q_0\in B_0$ follows from definition). This implies $p_0(Y)>0$, which allows us to wlog assume that $p_k(Y)>0$ for all $k\in\mathbb{N}$. Let us define the probability measures $\hat q_0:=p_0(Y)^{-1} p_0\in\Delta(X\times Y)$, $\hat p_0:=p_0(Y)^{-1} p_0\in\Delta(Y)$, $\hat p_k:=p_k(Y)^{-1} p_k\in\Delta(Y)$.

We can apply Lemma 20 to these probability measures, which implies that there exists $\hat q_k\in\Delta(X\times Y)$ with $\operatorname{pr}_{Y*} \hat q_k = \hat p_k$ and $W_1(\hat q_0,\hat q_k)\le W_1(\hat p_0,\hat p_k)$.

It is known that the Wasserstein metric $W_1$ is compatible with the weak-$*$ topology on $\Delta(X\times Y)$ and $\Delta(Y)$. Thus, we obtain $W_1(\hat p_0,\hat p_k)\to0$ from $\hat p_k\to \hat p_0$. This, in turn, implies $\hat q_k\to \hat q_0$.

Next, we define $q_k:=p_k(Y)\hat q_k\in\Delta^c(X\times Y)$. This satisfies $q_k\to q_0$ and $\operatorname{pr}_{Y*}q_k = p_k$. Due to the properties of $p_k$ and $B_k$, this implies $q_k\in B_k$. Now the desired property $q_0\in B_0$ follows by taking limits. This completes the proof of the claim.

To show measurability of $f=\mathcal{M}(\forall_{\alpha\beta})$, it suffices to show that the preimages of open balls are measurable. Thus, we need to show that $\{B\in\Box(X\times Y) : d_H(f(B),A)<\varepsilon\}$ is measurable for all $A\in\Box Y$ and $\varepsilon>0$. We proceed similarly to Lemma 19. We have 

$$
\begin{aligned}            & \{B\mid d_H(f(B),A)<\varepsilon\}            \ &\qquad = \{B\mid \forall x\in f(B): d(x,A)<\varepsilon\}            \cap \{B\mid \forall x\in A: d(f(B),x)<\varepsilon\}.        \end{aligned}
$$

 Let us start by showing measurability of the second set, i.e. $\{B\mid \forall x\in A: d(f(B),x)<\varepsilon\}$. Since $A$ is compact, there exists a countable dense set $A_1\subset A$. We have 

$$
\begin{aligned}            \{B\mid \forall x\in A: d(f(B),x)<\varepsilon\}            &=            \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}            \{B\mid \forall x\in A: d(f(B),x)\le\delta\}            \ &=            \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}            \{B\mid \forall x\in A: d(f(B),x)\le\delta\}            \ &=            \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}            \bigcap_{x\in A} \{B\mid d(f(B),x)\le\delta\}            \ &=            \bigcup_{\delta\in(0,\varepsilon)\cap\mathbb{Q}}            \bigcap_{x\in A}            \bigcup_{y:d(x,y)\le\delta}            \{B\mid y \in f(B)\}.        \end{aligned}
$$

 Applying claim 2 for the compact set $\{y:d(y,x)\le\delta\}$. Thus, we have a countable union of an intersection of closed sets. This is measurable.

Now, let us show the measurability of the other set $\{B\mid \forall x\in f(B): d(x,A)<\varepsilon\}$. We have 

$$
\begin{aligned}            \{B\mid \forall x\in f(B): d(x,A)<\varepsilon\}            &=            \{B\mid \forall x: d(x,A)\ge \varepsilon\implies x\not\in f(B)\}            \ &=            \bigcap_{x:d(x,A)\ge\varepsilon} \{B\mid x\not\in f(B)\}            \ &=            \Box(X\times Y) \setminus \left(            \bigcup_{x:d(x,A)\ge\varepsilon}            \{B\mid x\in f(B)\}            \right).        \end{aligned}
$$

 Again, since the set $\{x:d(x,A)\ge\varepsilon\}$ is compact, claim 2 implies that the above set is measurable. This completes the proof that $\{B\in\Box(X\times Y) : d_H(f(B),A)<\varepsilon\}$ is measurable. ◻

As for the measurability of $\mathcal{M}(f)^*$, we were not able to prove it for measurable $f$. There might be some relation to the problem that the image of a measurable set under a measurable map is not measurable.