%!TEX root = da2020-09.tex

\Chapter{9}{Round Elimination}

\noindent
In this chapter we introduce the basic idea of a proof technique, called \emph{round elimination}.
Round elimination is based on the following idea. Assume that there exists a distributed algorithm $S_0$ with complexity $T$ solving a problem $\Pi_0$. Then there exists a distributed algorithm $S_1$ with complexity $T-1$ for solving another problem $\Pi_1$. That is, if we can solve problem $\Pi_0$ in $T$ communication rounds, then we can solve a related problem $\Pi_1$ exactly one round faster\mydash we can ``eliminate one round''. If this operation is repeated $T$ times, we end up with some algorithm $S_T$ with round complexity $0$ for some problem $\Pi_T$. If $\Pi_T$ is not a \emph{trivial} problem, that is, cannot be solved in $0$ rounds, we have reached a contradiction: therefore the assumption that $\Pi_0$ can be solved in $T$ rounds has to be wrong. This is a very useful approach, as it is much easier to reason about $0$-round algorithms than about algorithms in general.

\section{Bipartite Model and Biregular Trees}

When dealing with round elimination, we will consider a model that is a variant of the $\PN$ model from Chapter~\chapterref{3}. We will restrict our attention to specific families of graphs (see Figure~\ref{fig:biregular}):
\begin{enumerate}
	\item \textbf{Bipartite.} The set of nodes $V$ is partitioned into two sets: the \emph{active} nodes $V_A$ and the \emph{passive} nodes $V_P$. The partitioning forms a proper $2$-coloring of the graph, i.e., each edge connects an active node with a passive node. The role of a node\mydash active or passive\mydash is part of the local input.
	\item \textbf{Biregular trees.} We will assume that the input graphs are \emph{biregular} trees: the graph is connected, there are no cycles, each node in $V_A$ has degree $d$ or 1, and each node in $V_P$ has degree $\delta$ or 1. We say that such a tree is $(d,\delta)$-biregular. See Figure~\ref{fig:biregular} for an illustration.
\end{enumerate}

\begin{figure}
	\centering
	\includegraphics[page=\PBipartiteModel,scale=0.33]{figs.pdf}
	\caption{The bipartite model; black nodes are active and white nodes are passive. (a)~A $(3,3)$-biregular tree. (b)~A $(3,2)$-biregular tree.} \label{fig:biregular}
\end{figure}

\subsection{Bipartite Locally Verifiable Problem}

We consider a specific family of problems, called \emph{bipartite locally verifiable} problems. Such a problem is defined as a 3-tuple $\Pi = (\Sigma, \collA, \collP)$, where:
\begin{itemize}
	\item $\Sigma$ is a finite alphabet.
	\item $\collA$ and $\collP$ are finite collections of multisets, where each multiset $A \in \collA$ and $P \in \collP$ consists of a finite number of elements from $\Sigma$. These are called the \emph{active} and \emph{passive configurations}.
\end{itemize}
Recall that multisets are sets that allow elements to be repeated. We use the notation $[x_1, x_2, \dotsc, x_k]$ for a multiset that contains $k$ elements; for example, $[1,1,2,2,2]$ is a multiset with two $1$s and three $2$s. Note that the order of elements does not matter, for example, $[1,1,2] = [1,2,1] = [2,1,1]$.

In problem $\Pi$, each active node $v \in V_A$ must label its incident $\deg(v)$ edges with elements of $\Sigma$ such that the labels of the incident edges, considered as a multiset, form an element of $\collA$. The order of the labels does not matter. The passive nodes do not have outputs. Instead, we require that for each passive node the labels of its incident edges, again considered as a multiset, form an element of $\collP$. A labeling $\varphi\colon E \to \Sigma$ is a solution to $\Pi$ if and only if the incident edges of all active and passive nodes are labeled according to some configuration.

In this chapter we will only consider labelings such that all nodes of degree 1 accept any configuration: these will not be explicitly mentioned in what follows. Since we only consider problems in $(d,\delta)$-biregular trees, each active configuration will have $d$ elements and each passive configuration $\delta$ elements.

\subsection{Examples} \label{ssec:bipartite-examples}

To illustrate the definition of bipartite locally verifiable labelings, we consider some examples (see Figure~\ref{fig:bipartite-problem-examples}).

\begin{figure}
	\centering
	\includegraphics[page=\PBipartiteModelExamples,scale=0.3]{figs.pdf}
	\caption{Bipartite locally verifiable labeling problems. (a)~$5$-edge coloring in a $(3,3)$-biregular tree. (b)~Maximal matching in a $(3,3)$-biregular tree. (c)~Sinkless orientation in a $(3,3)$-biregular tree. (d)~Weak 3-labeling in a $(3,2)$-biregular tree.} \label{fig:bipartite-problem-examples}
\end{figure}

\paragraph{Edge Coloring.} A $c$-edge coloring is an assignment of labels from $\{1,2,\dotsc,c\}$ to the edges such that no node has two incident edges with the same label.

Consider the problem of $5$-edge coloring $(3,3)$-biregular trees. The alphabet $\Sigma$ consists of the five edge colors $\{ 1, 2, 3, 4, 5 \}$. The active configurations consist of all multisets of three elements $[x,y,z]$, such that all elements are distinct and come from $\Sigma$. The problem is symmetric, and the passive configurations consist of the same multisets:
\[
\begin{split}
	\collA = \collP = \bigl\{\,
		&[1,2,3],\,
		[1,2,4],\,
		[1,2,5],\,
		[1,3,4],\,
		[1,3,5], \\
		&[1,4,5],\,
		[2,3,4],\,
		[2,3,5],\,
		[2,4,5],\,
		[3,4,5]
	\,\bigr\}.
\end{split}
\]

\paragraph{Maximal Matching.} A maximal matching $M$ is a subset of the edges such that no two incident edges are in $M$ and no edge can be added to~$M$.

Consider maximal matching on $(3,3)$-biregular trees. To encode a matching, we could use just two labels: $\mM$ for matched and $\mU$ for unmatched. Such a labeling, however, has no way of guaranteeing maximality. We use a third label $\mP$, called a pointer:
\[
	\Sigma = \{ \mM, \mP, \mU \}.
\]
The active nodes either output $[ \mM, \mU, \mU ]$, denoting that the edge marked $\mM$ is in  the matching, or they output $[\mP, \mP, \mP]$, denoting that they are unmatched, and thus all passive neighbors \emph{must} be matched with another active node:
\[
	\collA = \bigl\{\, [ \mM, \mU, \mU ], \, [\mP, \mP, \mP] \, \bigr\}.
\]
Passive nodes must verify that they are matched with at most one node, and that if they have an incident label $\mP$, then they also have an incident label $\mM$ (to ensure maximality). Hence the passive configurations are
\[
	\collP = \bigl\{\,
		[ \mM, \mP, \mP ],\,
		[ \mM, \mP, \mU ],\,
		[ \mM, \mU, \mU ],\,
		[ \mU, \mU, \mU ]
	\,\bigr\}.
\]

\paragraph{Sinkless Orientation.} A \emph{sinkless orientation} is an orientation of the edges such that each node has an edge oriented away from it. That is, no node is a \emph{sink}. We will consider here sinkless orientation in (3,3)-biregular trees; leaf nodes can be sinks, but nodes of degree $3$ must have at least one outgoing edge.

To encode sinkless orientation, each active node chooses an orientation of its incident edges: outgoing edges are labeled $\mO$ and incoming edges $\mI$. Thus the alphabet is $\Sigma = \{ \mO, \mI \}$. Each node must have an outgoing edge, so the active configurations are all multisets that contain at least one $\mO$:
\[
	\collA = \bigl\{ [\mO, x, y] \bigm| x, y \in \Sigma \bigr\}.
\]
The passive configurations are similar, but the roles of the labels are reversed: an outgoing edge for an active node is an incoming edge for a passive node. Therefore each passive node requires that at least one of its incident edges is labeled $\mI$, and the passive configurations are
\[
	\collP = \bigl\{ [\mI, x, y] \bigm| x, y \in \Sigma \bigr\}.
\]

\paragraph{Weak Labeling.} We will use the following problem as the example in the remainder of this chapter. Consider $(3,2)$-biregular trees. A \emph{weak $3$-labeling} is an assignment of labels from the set $\{1,2,3\}$ to the edges such that each active node has at least two incident edges labeled with different labels. Each passive node must have its incident edges labeled with the same label. The problem can be formalized as
\begin{align*}
	\Sigma &= \{1,2,3\}, \\
	\collA &= \bigl\{\,
		[ 1, 1, 2 ],\,
		[ 1, 1, 3 ],\,
		[ 1, 2, 2 ],\,
		[ 1, 2, 3 ],\,
		[ 1, 3, 3 ],\,
		[ 2, 2, 3 ],\,
		[ 2, 3, 3 ]
	\,\bigr\}, \\
	\collP &= \bigl\{\,
		[ 1, 1 ],\,
		[ 2, 2 ],\,
		[ 3, 3 ]
	\,\bigr\}.
\end{align*}

\section{Introducing Round Elimination}

Round elimination is based on the following basic idea. Assume that we can solve some bipartite locally verifiable problem $\Pi_0$ in $T$ communication rounds on $(d,\delta)$-biregular trees. Then there exists a bipartite locally verifiable problem $\Pi_1$, called the \emph{output problem} of $\Pi_0$, that can be solved in $T-1$ rounds on $(\delta,d)$-biregular trees. The output problem is uniquely defined, and we refer to the output problem of $\Pi$ as $\re(\Pi)$. The definition of output problem will be given in Section~\ref{ssec:output-problems}.

A single round elimination step is formalized in the following lemma.

\begin{lemma}[Round elimination lemma] \label{lem:round-elimination}
	Let $\Pi$ be bipartite locally verifiable problem that can be solved in $T$ rounds in $(d,\delta)$-biregular trees. Then the output problem $\re(\Pi)$ of $\Pi$ can be solved in $T-1$ rounds in $(\delta,d)$-biregular trees.
\end{lemma}

\subsection{Impossibility Using Iterated Round Elimination}
Lemma~\ref{lem:round-elimination} can be iterated, applying it to the output problem of the previous step. This will yield a sequence of $T+1$ problems
\[
	\Pi_0 \rightarrow \Pi_1 \rightarrow \cdots \rightarrow \Pi_{T},
\]
where $\Pi_{i+1} = \re(\Pi_i)$ for each $i = 0, 1, \dotsc, T-1$.

If we assume that there is a $T$-round algorithm for $\Pi_0$, then by an iterated application of Lemma~\ref{lem:round-elimination}, there is a $(T-1)$-round algorithm for $\Pi_1$, a $(T-2)$-round algorithm for $\Pi_2$, and so on. In particular, there is a $0$-round algorithm for $\Pi_T$.

Algorithms that run in $0$ rounds are much easier to reason about than algorithms in general. Since there is no communication, each active node must simply map its input, essentially its degree, to some output. In particular, we can try to show that there is no 0-round algorithm for $\Pi_T$. If this is the case, we have a contradiction with our original assumption: there is no $T$-round algorithm for $\Pi_0$.

We will now proceed to formally define output problems.

\subsection{Output Problems} \label{ssec:output-problems}

For each locally verifiable problem $\Pi$ we will define a unique \emph{output problem} $\re(\Pi)$.

Let $\Pi_0 = (\Sigma_0, \collA_0, \collP_0)$ be a bipartite locally verifiable problem on $(d,\delta)$-biregular trees. We define the output problem $\Pi_1 = \re(\Pi_0) = (\Sigma_1, \collA_1, \collP_1)$ of $\Pi_0$ on $(\delta,d)$-biregular trees as follows\mydash note that we swapped the degrees of active vs.\ passive nodes here.

The alphabet $\Sigma_1$ consists of all possible non-empty subsets of $\Sigma_0$. The roles of the active and passive nodes are inverted, and new configurations are computed as follows.
\begin{enumerate}
	\item The active configurations $\collA_1$ consist of all multisets
	\[
	[ X_1, X_2, \dotsc, X_{\delta} ], \text{ where } X_i \in \Sigma_1 \text{ for all } i = 1,\dotsc,\delta,
	\]
	such that for \textbf{\emph{every}} choice of $x_1 \in X_1$, $x_2 \in X_2$, \ldots, $x_{\delta} \in X_{\delta}$ we have $[x_1, x_2, \dotsc, x_{\delta}] \in \collP_0$, i.e., it is a passive configuration of $\Pi_0$.
	\item The passive configurations $\collP_1$ consist of all multisets
	\[
	[ Y_1,  Y_2, \dotsc, Y_d ], \text{ where } Y_i \in \Sigma_1 \text{ for all } i = 1,\dotsc,d,
	\]
	for which \textbf{\emph{there exists}} a choice $y_1 \in Y_1$, $y_2 \in Y_2$, \ldots, $y_d \in Y_d$ with $[ y_1, y_2, \dotsc, y_d] \in \collA_0$, i.e., it is an active configuration of $\Pi_0$.
\end{enumerate}

\subsection{Example: Weak 3-labeling} \label{ssec:example-w3ec}

To illustrate the definition, let us construct the output problem $\re(\Pi_0) = (\Sigma_1, \collA_1, \collP_1)$ of weak 3-labeling problem $\Pi_0 = (\Sigma_0, \collA_0, \collP_0)$. Recall that
\begin{align*}
	\Sigma_0 &= \{ 1,2,3 \}, \\
	\collA_0 &= \bigl\{\,
		[ 1, 1, 2 ],\,
		[ 1, 1, 3 ],\,
		[ 1, 2, 2 ],\,
		[ 1, 2, 3 ],\,
		[ 1, 3, 3 ],\,
		[ 2, 2, 3 ],\,
		[ 2, 3, 3 ]
	\,\bigr\}, \\
	\collP_0 &= \bigl\{\,
		[ 1, 1 ],\,
		[ 2, 2 ],\,
		[ 3, 3 ]
	\,\bigr\}.
\end{align*}
The alphabet $\Sigma_1$ consists of all possible (non-empty) subsets of $\Sigma_0$:
\[
	\Sigma_1 = \bigl\{ \{ 1 \}, \{ 2 \}, \{ 3 \}, \{ 1, 2 \}, \{ 1, 3 \}, \{ 2, 3 \}, \{ 1, 2, 3 \} \bigr\}.
\]
The active configurations $\collA_1$ are all multisets $[ X,Y ]$ with $X, Y \in \Sigma_1$ such that \emph{all} choices of elements $x \in X$ and $y \in Y$ result in a multiset $[x,y] \in \collP_0$. For example $X = \{1\}$ and $Y = \{1,2\}$ is \emph{not} a valid choice: we could choose $x = 1$ and $y = 2$ to construct $[1,2] \notin \collP_0$. In general, whenever $|X| > 1$ or $|Y| > 1$, we can find $x \in X$, $y \in Y$ with $x \ne y$, and then $[x,y] \notin \collP_0$. Therefore the only possibilities are $|X| = |Y| = 1$, and then we must also have $X = Y$. We obtain
\[
\collA_1 = \Bigl\{\, \bigl[\{ 1 \}, \{1 \}\bigr],\, \bigl[\{ 2 \}, \{2 \}\bigr],\, \bigl[\{ 3 \}, \{3 \}\bigr] \,\Bigr\}.
\]
But since the active configurations only allow singleton sets, we can restrict ourselves to them when listing the possible passive configurations; we obtain simply
\[
\begin{split}
	\collP_1 = \Bigl\{\,
		&\bigl[ \{1\}, \{1\}, \{2\} \bigr],\,
		\bigl[ \{1\}, \{1\}, \{3\} \bigr],\,
		\bigl[ \{1\}, \{2\}, \{2\} \bigr],\,
		\bigl[ \{1\}, \{2\}, \{3\} \bigr],\\[-2pt]
		&\bigl[ \{1\}, \{3\}, \{3\} \bigr],\,
		\bigl[ \{2\}, \{2\}, \{3\} \bigr],\,
		\bigl[ \{2\}, \{3\}, \{3\} \bigr]
	\,\Bigr\}.
\end{split}
\]

\subsection{Complexity of Output Problems}

In this section we prove Lemma~\ref{lem:round-elimination} that states that the output problem $\re(\Pi)$ of $\Pi$ can be solved one round faster than $\Pi$.

The proof is by showing that we can truncate the execution of a $T$-round algorithm and output the set of \emph{possible outputs}. As we will see, this is a solution to the output problem.

\begin{proof}[Proof of Lemma~\ref{lem:round-elimination}]
	Assume that we can solve some problem $\Pi_0 = (\Sigma_0, \collA_0, \collP_0)$ on $(d,\delta)$-biregular trees in $T$ rounds using some deterministic $\PN$-algorithm $S$. We want to design an algorithm that works in $(\delta,d)$-biregular trees and solves $\Pi_1 = \re(\Pi_0)$ in $T-1$ rounds.

	Note that we are considering the same family of networks, but we are only switching the sides that are marked as active and passive. We will call these \emph{$\Pi_0$-active} and \emph{$\Pi_1$-active} sides, respectively.

	The algorithm for solving $\Pi_1$ works as follows. Let $N = (V,P,p)$ be any port-numbered network with a $(\delta,d)$-biregular tree as the underlying graph. Each $\Pi_1$-active node $u$, in $T-1$ rounds, gathers its full $(T-1)$-neighborhood $\ball_N(u, T-1)$. Now it considers all \emph{possible} outputs of its $\Pi_0$-active neighbors under the algorithm $S$, and outputs these.

	Formally, this is done as follows. When $N$ is a port-numbered network, we use $\ball_{N}(u,r)$ to refer to the information within distance $r$ from node $u$, including the local inputs of the nodes in this region, as well as the port numbers of the edges connecting nodes within this region. We say that a port-numbered network $H$ is \emph{compatible} with $\ball_{N}(u,r)$ if there is a node $v \in H$ such that $\ball_{H}(v,r)$ is isomorphic to $\ball_{N}(u,r)$.

	For each neighbor $v$ of $u$, node $u$ constructs all possible fragments $\ball_{H}(v, T)$ such that $H$ is compatible with $\ball_N(u,T-1)$ and has a $(\delta,d)$-biregular tree as its underlying graph. Then $u$ simulates the $\Pi_0$-algorithm $S$ on $\ball_{H}(v,T)$. The algorithm outputs some label $x \in \Sigma_0$ on the edge $\{u,v\}$. Node $u$ adds each such label $x$ to set $S(u,v)$; finally node $u$ will label edge $\{u,v\}$ with $S(u,v)$.

	\begin{figure}
		\centering
		\includegraphics[page=\PRoundElimination,scale=0.3]{figs.pdf}
		\caption{Illustration of the round elimination step. A fragment of a $(2,3)$-biregular tree. The 3-neighborhood of node $u$ consists of the gray area. The 4-neighborhoods of nodes $v$ and $w$ consist of the blue and orange areas, respectively. Since the input is a tree, these intersect exactly in the 3-neighborhood of $u$.} \label{fig:round-elimination}
	\end{figure}

	By construction, $S(u,v)$ is a nonempty set of labels from $\Sigma_0$, i.e., $S(u,v) \in \Sigma_1$. We now prove that the sets $S(u,v)$ form a solution to $\Pi_1$. We use the assumption that the underlying graph $G$ is a tree. Let $H$ be any port-numbered network compatible with $\ball_{N}(u,T-1)$. Consider any two neighbors $v$ and $w$ of $u$: since there are no cycles, we have
	\[\ball_{H}(v,T) \cap \ball_{H}(w,T) = \ball_{H}(u,T-1) = \ball_{N}(u,T-1).\]
	In particular, once $\ball_{H}(u,T-1)$ is fixed, the outputs of $v$ and $w$, respectively, depend on the structures of $\ball_{H}(v,T) \setminus \ball_{H}(u,T-1)$ and $\ball_{H}(w,T) \setminus \ball_{H}(u,T-1)$, which are completely distinct. See Figure~\ref{fig:round-elimination} for an illustration. Therefore, if there exist $x \in S(u,v)$ and $y \in S(u,w)$, then there exists a port-numbered network $H$ such that running $S$, node $v$ outputs $x$ on $\{v,u\}$ and node $w$ outputs $y$ on $\{ w,u \}$. This further implies that since $S$ is assumed to work correctly on all port-numbered networks, for any combination of $x_1 \in S(u,v_1)$, $x_2 \in S(u,v_2)$, \ldots, $x_{\delta} \in S(u,v_{\delta})$, we must have that \[[x_1, x_2, \dots, x_{\delta}] \in \collP_0.\] This implies that
	\[
		[S(u,v_1),\, S(u,v_2),\, \dotsc,\, S(u, v_{\delta})] \in \collA_1.
	\]

	It remains to show that for each $\Pi_0$-active node $v$, it holds that the sets $S(u_1, v)$, $S(u_2, v)$, \ldots, $S(u_d, v)$, where $u_i$ are neighbors of $v$, form a configuration in $\collP_1$. To see this, note that the $\Pi_1$-active nodes $u_i$ simulate $S$ on every port-numbered fragment, including the true neighborhood $\ball_{N}(v,T)$ of $v$. This implies that the output of $v$ on $\{v,u_i\}$ running $S$ in network $N$ is included in $S(u_i, v)$. Since $S$ is assumed to be a correct algorithm, these true outputs $x_1 \in S(u_1, v)$, $x_2 \in S(u_2, v)$, \ldots, $x_{d} \in S(u_d,v)$ form a configuration \[[x_1, x_2, \dots, x_d] \in \collA_0,\] which implies that
	\[
		[S(u_1, v),\, S(u_2, v),\, \dots,\, S(u_d,v)] \in \collP_1,
	\] as required.
\end{proof}

\subsection{Example: Complexity of Weak 3-labeling} \label{ssec:output-weak3}

Now we will apply the round elimination technique to show that the weak 3-labeling problem is not solvable in 1 round. To do this, we show that the output problem of weak 3-labeling is not solvable in 0 rounds.

\begin{lemma}
	Weak 3-labeling is not solvable in 1 round in the \PN-model on $(3,2)$-biregular trees.
\end{lemma}

\begin{proof}
	In Section~\ref{ssec:example-w3ec} we saw the output problem of weak 3-labeling. We will now show that this problem is not solvable in 0 rounds on $(2,3)$-biregular trees. By Lemma~\ref{lem:round-elimination}, weak 3-labeling is then not solvable in 1 round on $(3,2)$-biregular trees. Let $\Pi_1 = (\Sigma_1, \collA_1, \collP_1)$ denote the output problem of weak 3-labeling.

	In a 0-round algorithm an active node $v$ sees only its own side (active or passive) and its own port numbers. Since
	\[
	\collA_1 = \Bigl\{\, \bigl[\{ 1 \}, \{1 \}\bigr],\, \bigl[\{ 2 \}, \{2 \}\bigr],\, \bigl[\{ 3 \}, \{3 \}\bigr] \,\Bigr\},
	\]
	each active node $v$ must output the same label $X \in \bigl\{ \{1\}, \{2\}, \{3\} \bigr\}$ on both of its incident edges.

	Since all active nodes look the same, they all label their incident edges with exactly one label $X$. Since $[X, X, X]$ is not in $\collP_1$ for any $X \in \Sigma_1$, we have proven the claim.
\end{proof}

\subsection{Example: Iterated Round Elimination} \label{ssec:repeated}

We will finish this chapter by applying round elimination \emph{twice} to weak 3-labeling. We will see that the problem
\[
	\Pi_2 = \re(\Pi_1) = \re(\re(\Pi_0))
\]
obtained this way \emph{is} $0$-round solvable.

Let us first construct $\Pi_2$. Note that this is again a problem on $(3,2)$-biregular trees. We first \emph{simplify} notation slightly; the labels of $\Pi_1$ are sets and labels of $\Pi_2$ would be sets of sets, which gets awkward to write down. But the configurations in $\Pi_1$ only used \emph{singleton} sets. Therefore we can \emph{leave out} all non-singleton sets without changing the problem, and then we can \emph{rename} each singleton set $\{ x \}$ to $x$. After these simplifications, we have got
\begin{align*}
	\Sigma_1 &= \{ 1,2,3 \}, \\
	\collA_1 &= \bigl\{\,
		[ 1, 1 ],\,
		[ 2, 2 ],\,
		[ 3, 3 ]
	\,\bigr\}, \\
	\collP_1 &= \bigl\{\,
		[ 1, 1, 2 ],\,
		[ 1, 1, 3 ],\,
		[ 1, 2, 2 ],\,
		[ 1, 2, 3 ],\,
		[ 1, 3, 3 ],\,
		[ 2, 2, 3 ],\,
		[ 2, 3, 3 ]
	\,\bigr\}.
\end{align*}
Alphabet $\Sigma_2$ consists of all non-empty subsets of $\Sigma_1$, that is
\[
	\Sigma_2 = \bigl\{ \{ 1 \}, \{ 2 \}, \{ 3 \}, \{ 1, 2 \}, \{ 1, 3 \}, \{ 2, 3 \}, \{ 1, 2, 3 \} \bigr\}.
\]
The active configurations are all multisets $[X_1, X_2, X_3]$ where $X_1,X_2,X_3 \in \Sigma_2$ such that \emph{any} way of choosing $x_1 \in X_1$, $x_2 \in X_2$, and $x_3 \in X_3$ is a configuration in $\collP_1$. There are many cases to check, the following observation will help here (the proof is left as Exercise~\ref{ex:pi2}):
\begin{itemize}
	\item $\collP_1$ consists of all $3$-element multisets over $\Sigma_1$ where at least one of the elements is not $1$, at least one of the elements is not $2$, and at least one of the elements is not $3$.
	\item It follows that $\collA_2$ consists of all $3$-element multisets over $\Sigma_2$ where at least one of the elements does not contain $1$, at least one of the elements does not contain $2$, and at least one of the elements does not contain $3$.
\end{itemize}
It follows that we can enumerate all possible configurations e.g.\ as follows (here $X,Y,Z \in \Sigma_2$):
\begin{equation}\label{eq:pi2}
\begin{split}
	\collA_2
	      = {} &\Bigl\{ \, \bigl[ X, Y, Z \bigr] \bigm| X \subseteq \{1, 2\}, Y \subseteq \{ 1, 3 \}, Z \subseteq \{ 2, 3 \} \,\Bigr\} \\
	{} \cup {} &\Bigl\{ \, \bigl[ X, Y, Z \bigr] \bigm| X \subseteq \{1\}, Y \subseteq \{ 2, 3 \}, Z \subseteq \{ 1, 2, 3 \} \,\Bigr\} \\
	{} \cup {} &\Bigl\{ \, \bigl[ X, Y, Z \bigr] \bigm| X \subseteq \{2\}, Y \subseteq \{ 1, 3 \}, Z \subseteq \{ 1, 2, 3 \} \,\Bigr\} \\
	{} \cup {} &\Bigl\{ \, \bigl[ X, Y, Z \bigr] \bigm| X \subseteq \{3\}, Y \subseteq \{ 1, 2 \}, Z \subseteq \{ 1, 2, 3 \} \,\Bigr\}.
\end{split}
\end{equation}
On the passive side, $\collP_2$ consists of all multisets $[X,Y]$ where we can choose $x \in X$ and $y \in Y$ with $[x,y] \in \collA_1$. But $[x,y] \in \collA_1$ is equivalent to $x = y$, and hence $\collP_2$ consists of all multisets $[X,Y]$ where we can choose some $x \in X$ and choose the same value $x \in Y$. Put otherwise,
\[
\collP_2 = \Bigl\{ \, \bigl[ X, Y \bigr] \bigm| X \in \Sigma_2,\, Y \in \Sigma_2,\, X \cap Y \ne \emptyset \,\Bigr\}.
\]

\begin{lemma}
	Let $\Pi_0$ denote the weak 3-labeling problem. The problem $\Pi_2 = \re(\re(\Pi_0)) = (\Sigma_2, \collA_2, \collP_2)$ is solvable in $0$ rounds.
\end{lemma}

\begin{proof}
	The active nodes always choose the configuration
	\[
	\bigl[\{ 1, 2 \}, \{ 1, 3 \}, \{ 2, 3 \} \bigr] \in \collA_2
	\]
	and assign the sets in some way using the port numbers, e.g., the edge incident to port $1$ is labeled with $\{2,3\}$, the edge incident to port $2$ is labeled with $\{1,3\}$, and the edge incident to port $3$ is labeled with $\{1,2\}$.

	Since each pair of these sets has a non-empty intersection, no matter which sets are assigned to the incident edges of passive nodes, these form a valid passive configuration in $\collP_2$.
\end{proof}

\section{Quiz}

Consider the following bipartite locally verifiable labeling problem $\Pi = (\Sigma, \collA, \collP)$ on $(2,2)$-biregular trees:
\begin{align*}
	\Sigma ={}& \{ 1, 2, 3, 4, 5, 6 \}, \\
	\collA ={}& \bigl\{\, [1, 6],\, [2, 5],\,[3, 4] \bigr\}, \text{ and} \\
	\collP ={}& \bigl\{\, [x, y] \bigm| x \in \{ 3, 5, 6 \}, y \in \{ 1, 2, 3, 4, 5, 6 \} \,\bigr\} \\
	  {}\cup{}& \bigl\{\, [x, y] \bigm| x \in \{4,5,6\}, y \in \{ 2, 3, 4, 5, 6 \} \,\bigr\}.
\end{align*}
Give a $0$-round algorithm for solving $\Pi$.

\section{Exercises}

\begin{ex}[encoding graph problems]\label{ex:encode-bipartite}
Even if a graph problem is defined for general (not bipartite) graphs, we can often represent it in the bipartite formalism. If we take a $d$-regular tree $G$ and subdivide each edge, we arrive at a $(d,2)$-biregular tree $H$, where the active nodes represent the nodes of $G$ and passive nodes represent the edges of $G$.

Use this idea to encode the following graph problems as bipartite locally verifiable labelings in $(d,2)$-biregular trees. Give a brief explanation of why your encoding is equivalent to the original problem. You can ignore the leaf nodes and their constraints; it is sufficient to specify constraints for the active nodes of degree $d$ and passive nodes of degree~$2$.
\begin{subex}[noitemsep]
	\item Vertex coloring with $d+1$ colors.
	\item Maximal matching.
	\item Dominating set.
	\item Minimal dominating set.
\end{subex}
\end{ex}

\begin{ex}[algorithms in the bipartite model]
	The bipartite model can be used to run algorithms from the standard $\PN$ and $\LOCAL$ models. Using the idea of Exercise~\ref{ex:encode-bipartite}, we encode the \emph{maximal independent set} problem in $3$-regular trees as the following bipartite locally verifiable problem $\Pi = (\Sigma, \collA, \collP)$ in $(3,2)$-biregular trees:
	\begin{align*}
		\Sigma &= \{ \mI, \mO, \mP \}, \\
		\collA &= \bigl\{ \, [\mI, \mI, \mI],\, [\mP, \mO, \mO] \, \bigr\}, \\
		\collP &= \bigl\{ \, [\mI, \mP],\, [\mI, \mO],\, [\mO, \mO] \, \bigr\}.
	\end{align*}
	In $\collA$, the first configuration corresponds to a node in the independent set $X$, and the second configuration to a node not in $X$. A node not in $X$ points to a neighboring active node with the label $\mP$: the node pointed to has to be in $X$. The passive configurations ensure that two active nodes connected by a passive node are not both in $X$, and that the pointer $\mP$ always points to a node in~$X$.

	Assume that the active nodes are given a 4-coloring $c$ as input. That is, $c\colon V_A \to \{1,2,3,4\}$ satisfies $c(v) \ne c(u)$ whenever the active nodes $v,u \in V_A$ share a passive neighbor $w \in V_P$. The nodes also know whether they are active or passive, but the nodes do not have any other information.

	Present a $\PN$-algorithm in the state machine formalism for solving~$\Pi$. Prove that your algorithm is correct. What is its running time? How does it compare to the complexity of solving maximal independent set in the $\PN$ model, given a $4$-coloring?
\end{ex}

\begin{ex}[Round Eliminator]
	There is a computer program, called Round Eliminator, that implements the round elimination technique and that you can try out in a web browser:
	\begin{center}
		\url{https://github.com/olidennis/round-eliminator}
	\end{center}
	Let $\Pi_0$ be the weak 3-labeling problem defined in Section~\ref{ssec:bipartite-examples}. Use the Round Eliminator to find out what are $\Pi_1 = \re(\Pi_0)$ and $\Pi_2 = \re(\Pi_1)$. In your answer you need to show how to encode $\Pi_0$ in a format that is suitable for the Round Eliminator, what were the answers you got from the Round Eliminator, and how to turn the answers back into our usual mathematical formalism.
\end{ex}

\begin{ex}[iterated round elimination]\label{ex:pi2}
	Fill in the missing details in Section~\ref{ssec:repeated} to show that formula \eqref{eq:pi2} is a correct definition of the active configurations for problem $\Pi_2$ (i.e., it contains all possible configurations and only them).
\end{ex}

\begin{ex}[solving weak 3-labeling]
	Present a 2-round deterministic $\PN$-algorithm for solving weak 3-labeling in $(3,2)$-biregular trees.
\end{ex}

\begin{ex}[sinkless orientation]
	Consider the sinkless orientation problem, denoted by $\Pi$, on $(3,3)$-biregular trees from Section~\ref{ssec:bipartite-examples}. Compute the output problems $\re(\Pi)$ and $\re(\re(\Pi))$; include a justification for your results.
\end{ex}

\section{Bibliographic Notes}

Linial's \cite{linial92locality} lower bound for vertex coloring in cycles already used a proof technique that is similar to round elimination. However, for a long time it was thought that this is an ad-hoc technique that is only applicable to this specific problem. This started to change in 2016, when the same idea found another very different application \cite{brandt16lll}. Round elimination as a general-purpose technique was defined and formalized by Brandt~\cite{Brandt2019automatic} in 2019, and implemented as a computer program by Olivetti~\cite{Olivetti2019}.


\subsection{Propositional Logic}
\input{background/logic.tex}
\subsection{Stochastic Boolean Satisfiability}
\input{background/ssat.tex}
\subsection{Model Counting}
\input{background/counting.tex}


% Copyright 2018 Melvin Eloy Irizarry-Gelpí
\chapter{AW Quaternions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
An AW quaternion has the form
\begin{equation}
    a_{0} + a_{1} A + a_{2} W + a_{3} AW
\end{equation}
These follow from a parabolic Cayley-Dickson construct on the A binions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Arithmetic Operations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Multiplication}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conjugate Operations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Asterisk Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Quadrance}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Cloak Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Dagger Conjugation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Hodge Star}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Zero-Divisors}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Differential Operators}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{M\"{o}bius Transformations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Cross-Ratio}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...


\section{Parameter model}
\label{sec:parameterModel}
\label{maths:parameter_defn}
\label{maths:parameter-model}

The following section outlines the parameter model. We consider three types of parameter model:
\begin{itemize}
\item
Type 1. Equation type
\begin{align*}
\psi_i = H(\beta, C_i, \eta_i)
\end{align*}
This is the most general form of a parameter model with no constraints on the function $H$.
It is an implicit equation as it doesn't allow an easy interpretation of its elements in contrast to the two following forms.
\item
Type 2. Gaussian model with general covariate model
\begin{align*}
h(\psi_i) = H(\beta, C_i) + \eta_i
\end{align*}
Here the parameter is normally distributed up to a transformation $h$ with a general covariate model and additive random effects.
\item
Type 3. Gaussian model with linear covariate model
\begin{align*}
h(\psi_i) = h(\psi_{pop}) + \beta \, C_i + \eta_i
\end{align*}
This is a special case of the models above which allows for the most detailed interpretation as explained in the following section.
\end{itemize}
with
\begin{itemize}
\item
$\psi_i$ -- individual parameter
\item
$\psi_{pop}$ -- typical or population mean parameter
\item
$\eta_i$ -- random effect(s)
\item
$\beta$ -- fixed effect(s)
\item
$C_i$ -- covariate(s)
\item
H -- arbitrary function
\item
h -- function which transforms the model on both sides, e.g. log, logit, probit.
\end{itemize}

\subsection{Discussion and examples of Type 1 models}
\label{subsec:paramModelType1}
This model type is the most flexible one, able to accommodate
\begin{itemize}
\item
multiple fixed effects
\item
multiple random effects and
\item
an arbitrary (nonlinear) covariate model.
\end{itemize}

\paragraph{Example}
Let's consider a complex clearance model as introduced in \cite{NONMEM:2006aa}, which contains
\begin{itemize}
\item
four fixed effects $\theta_1, \cdots, \theta_4$
\item
three continuous covariates $WT, AGE, SECR$
\item
one categorical covariate $ICU$
\item
three random effects $\eta_{1i,met}\sim \mathcal{N}(0,\omega_{1,met}^2),\eta_{2i,met}\sim \mathcal{N}(0,\omega_{2,met}^2), \eta_{3i,ren}\sim \mathcal{N}(0,\omega_{3,ren}^2)$
\end{itemize}
The model is composed of
\begin{enumerate}
\item
the average metabolic clearance which reads
\begin{align*}
& CL_{met_{average}} = WT\times \frac{\theta_1 - \theta_2 \times Cpss_2}{\theta_3 + Cpss_2}
\end{align*}
extended with random effects representing a patient being from an ICU (intensive care unit) or else
\begin{align*}
& CL_{i,met} = CL_{met_{average}} + (1 - ICU) \; \eta_{1,i} + ICU \; \eta_{2,i}
\end{align*}
i.e.
\begin{align*}
& CL_{i,met} = \left\{ \begin{array}{lcl}  CL_{met_{average}} + \eta_{1,i}  & \mbox{for} & ICU = 0 \quad \text{i.e. patient not from ICU} \\
CL_{met_{average}} + \eta_{2,i}  & \mbox{for} & ICU = 1 \quad \text{else}
\end{array}\right.
\end{align*}
\item
and average renal clearance which reads
\begin{align*}
& CL_{ren_{average}} = \theta_4 \times RF \quad \text{with}  \quad
RF = WT\times \frac{1.66 - 0.011 \times AGE}{SECR}
\end{align*}
so the clearance for subject $i$ amounts to
\begin{align*}
& CL_{i,ren} = CL_{ren_{average}}(1+ \eta_{3,i})
\end{align*}
\end{enumerate}
The complete model, combining (1) and (2), for an individual's clearance then reads
\begin{align*}
& CL_i = CL_{i,met} + CL_{i,ren}.
\end{align*}
This model, although fully flexible, is difficult to break into meaningful sub-components. This is an entirely different situation for the following model types, where clearly defined sub-components can be separately stored and annotated.
%\begin{itemize}
%\item
%metabolic clearance
%\begin{align*}
%& CL_{met_{average}} = WT\times \frac{\theta_1 - \theta_2 \times Cpss_2}{\theta_3 + Cpss_2}
%\end{align*}
%extended with random effects representing a patient being from an ICU (Intensive Care Unit) or else
%\begin{align*}
%& CL_{met} = CL_{met_{average}} + (1 - ICU) \, \eta_{1i,met} + ICU \, \eta_{2i,met}
%\end{align*}
%i.e.
%\begin{align*}
%& CL_{met} = \left\{ \begin{array}{lcl}  CL_{met_{average}} + \eta_1  & \mbox{for} & ICU = 0 \quad \text{i.e. patient not from ICU} \\
%CL_{met_{average}} + \eta_2  & \mbox{for} & ICU = 1 \quad \text{else}
%\end{array}\right.
%\end{align*}
%\item
%and renal clearance
%\begin{align*}
% CL_{ren} = \theta_4 \times RF
%\end{align*}
%with
%\begin{align*}
%& RF = WT\times \frac{1.66 - 0.011 \times AGE}{SECR}
%\end{align*}
%with covariates \var{WT}, \var{AGE} and \var{SECR}.
%\end{itemize}
%The complete model for an individual's clearance reads
%\begin{align*}
%& CL_i = CL_{met} + CL_{ren}\; \eta_{3i,ren}.
%\end{align*}

\subsection{Discussion and examples of Type 2 models}
\label{subsec:paramModelType2}
Here, we consider normally distributed parameters, up to a transformation $h$, i.e. normal, log-normal or logit-normally distributed with identity, the natural logarithm or the logit as transformation, respectively.

Compared to the Type 1 parameter model, the Type 2 parameter model has a more structured additive form:
\begin{align*}
h(\psi_i) =
\underbrace{H(\beta, C_i)}_{\text{\parbox{2.5cm}{\centering non-linear covariate\\[-4pt] model}}}
+ \underbrace{\eta_i^{(0)}+ \eta_{ik}^{(-1)} + \dots}_{\text{\parbox{3cm}{\centering IIV and other\\[-4pt] levels of variability}}}
\end{align*}
Accordingly a model for an individual parameter consists of
\begin{itemize}
\item
the left-hand transformation, $h$
\item
a non-linear covariate model, i.e. any function, $H$, of fixed effects, \var{\beta}, and categorical or continuous covariates, $C_i$, e.g. \textit{Sex} or \textit{Weight}, and
\item
random effects, $\eta$, for \textit{inter-individual, inter-occasion} and/or other levels of variability (see section \ref{sec:variabilityModel}).
\end{itemize}

\paragraph{Example}
The following example is taken from the 'Fisher/Shafer NONMEM Workshop', and in NMTRAN code reads
\begin{xmlcode}
	WTE = THETA(1) * WT / (THETA(2)+ WT)
	V = (THETA(3) + WTE) * EXP(ETA(1))
\end{xmlcode}
After taking the logarithm of both sides we get
\begin{align*}
\log(V_i) = \log\Big(\theta_3 + \frac{\theta_1 \times WT_i}{\theta_2 + WT_i}\Big) + \eta_{V,i}.
\end{align*}

\subsection{Discussion and examples of Type 3 models}
\label{subsec:paramModelType3}
Here, we again consider normally distributed parameters, up to a transformation $h$, i.e. normal, log-normal or logit-normally distributed with identity, the natural logarithm or the logit as transformation, respectively.

The Type 3 parameter model has a very convenient fully additive form, which separates all of the sub-components, making it very easy to understand and process:
\begin{align*}
h(X_i) = h(X_{pop})
+ \underbrace{\beta \,C_i}_{\text{\parbox{2cm}{\centering linear covariate\\[-4pt] model}}}
+ \underbrace{\eta_i^{(0)}+ \eta_{ik}^{(-1)} + \dots}_{\text{\parbox{3cm}{\centering IIV and other\\[-4pt] levels of variability}}}
\end{align*}
Accordingly a model for an individual parameter consists of
\begin{itemize}
\item
a parameter transformation, $h$
\item
a typical or population mean value of the parameter, $X_{pop}$
\item
a linear covariate model, $\beta \, C_i$, with
\begin{itemize}
\item
fixed effects, $\beta$, and
\item
categorical or continuous covariates, $C_i$, e.g. \textit{Sex} or \textit{Weight}
\end{itemize}
\item
random effects, $\eta$, for \textit{inter-individual, inter-occasion} and/or other levels of variability (section \ref{sec:variabilityModel}).
\end{itemize}
See Figure \ref{fig:weightAsCovariate} for an example of the linear relationship between a parameter and a continuous covariate and one, \textit{inter-individual}, level of variability.

\paragraph{Example}
Let's consider volume, $V$, as a log-normally distributed parameter with two covariates \textit{Sex} and \textit{Weight} and with three levels of variability as discussed in Example 3 in section \ref{sec:variabilityModel} (see Figure \ref{tree_IOV1}), which can be represented by the equation:
%\begin{align*}
%& \eta_i \sim \mathcal{N}(0,\omega_V); \quad \log( V_i ) = \log( V_{pop} ) + \beta_{V,1} 1_{Sex_i=F} + \beta_{V,2} \log\Big(\frac{W_i}{70}\Big) + \eta_{i,V}
%\end{align*}
\begin{align*}
V_{lik} = V_{pop} e^{\beta_{V,1} 1_{Sex_i=F}} \Big(\frac{W_i}{70}\Big)^{\beta_{V,2}} e^{\eta_{l,V}^{(1)}}  e^{\eta_{li,V}^{(0)}} e^{\eta_{lik,V}^{(-1)}}
\end{align*}
or alternatively as
\begin{align*}
\underbrace{\log(V_{lik})}_{\text{\parbox{2cm}{\centering transformed\\[-4pt] individual value}}} =
\underbrace{\log(V_{pop})}_{\text{\parbox{2cm}{\centering transformed\\[-4pt] typical value}}} +
\underbrace{\beta_{V,1} 1_{Sex_i=F}}_{\text{\parbox{2.2cm}{\centering categorical\\[-4pt] covariate model\\[-4pt] for Sex}}}
+ \underbrace{\beta_{V,2} \log\Big(\frac{W_i}{70}\Big)}_{\text{\parbox{2.2cm}{\centering continuous\\[-4pt] covariate model\\[-4pt] for Weight}}}
+ \underbrace{\eta_{l,V}^{(1)}}_{\text{\parbox{1.8cm}{\centering inter-centre\\[-4pt]  variability}}}
+ \underbrace{\eta_{li,V}^{(0)}}_{\text{\parbox{1.8cm}{\centering inter-individual\\[-4pt] within centre \\[-4pt]  variability}}}
+ \underbrace{\eta_{lik,V}^{(-1)}}_{\text{\parbox{2.2cm}{\centering inter-occasion\\[-4pt] within individual \\[-4pt] within centre \\[-4pt] variability}}}
\end{align*}
with
\begin{align*}
 && \eta_{l,V}^{(1)} \sim \mathcal{N}\big(0,\Omega^{(1)}\big), \quad \eta_{li,V}^{(0)} \sim \mathcal{N}\big(0,\Omega^{(0)}\big),
\quad \eta_{lik,V}^{(-1)} \sim \mathcal{N}\big(0,\Omega^{(-1)}\big).
\end{align*}
The equation for $V_{lik}$ represented in the additive form is clearly easier to understand and one can read out the following information from it:
\begin{itemize}
\item
the parameter transformation, the natural logarithm, $log$
\item
the typical volume, $V_{pop}$
\item
the two linear covariate models, $\beta_{V,1} C_1$ and $\beta_{V,2} C_2$ with
\begin{itemize}
\item
a fixed effect for the categorical covariate, $\beta_{V,1}$
\item
a categorical covariate, $1_{Sex_i=F}$
\item
a fixed effect for the continuous covariate, $\beta_{V,2}$
\item
a continuous covariate, $C_2 = \log(W/W_{pop})$ with $W_{pop}=70$
\end{itemize}
\item
multiple random effects
\begin{itemize}
\item
a random effect above the subject level for \textit{inter-centre} variability, $\eta_{l,V}^{(1)}$
\item
a random effect at the subject level for \textit{inter-individual within centre} variability, $\eta_{li,V}^{(0)}$
\item
a random effect below the subject level for \textit{inter-occasion within individual within centre} variability, $\eta_{lik,V}^{(-1)}$.
\end{itemize}
\end{itemize}

\begin{figure}[htbp]
\centering
 \includegraphics[width=100mm]{weightAsCovariate}
\caption{The linear relationship between the parameter and a continuous covariate after application of appropriate transformations $V_i \longrightarrow \log(V_i)$ and $W \longrightarrow \log(W/70)$ with $\beta_{V,2} = \tan{\alpha}$, the slope of the regression line, and $\log(V_{pop})$ as the $y$-axis intercept.}
\label{fig:weightAsCovariate}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Correlation of random effects}
\label{subsec:correlationModel}\label{maths:param correlation}
Correlation of random effects means that the transformed parameters. e.g. $\log(V_i)$ and $\log(CL_i)$ are correlated as well (although the relationship is not straightforward; see also the discussion below on correlation and covariates). There are two alternative ways to define the correlation, using either
\begin{itemize}
\item
a correlation matrix, $R$, or
\item
a variance-covariance matrix, $\Omega$.
\end{itemize}

\paragraph{Correlation matrix}
In this case it is sufficient to define the non-zero correlation coefficients, e.g. $\rho_{V,CL}$. All other off-diagonal correlation coefficients will be assumed to be equal to 0. For a simple one-compartment oral PK model with parameters $ka$, $V$, $CL$, and a correlation between $CL$ and $V$ the full correlation matrix reads as follows
\[
R =
 \begin{pmatrix}
  1 	& 0 	& 0  	\\
   		& 1	& \rho_{V,CL} \\
  		& 	& 1
 \end{pmatrix}
\]

\paragraph{Variance-covariance matrix}
\label{maths:covariance-mat-derivation}
Alternatively, the variance-covariance matrix for the model
\[
 \Omega =
 \begin{pmatrix}
  \omega_{ka}^2 	& \omega_{ka,V}	& \omega_{ka,CL}\\
   			  	& \omega_{V}^2	& \omega_{V,CL} \\
  				& 				& \omega_{CL}^2
 \end{pmatrix}
 =
  \begin{pmatrix}
  \omega_{ka}^2 	& 0				& 0 \\
   			  	& \omega_{V}^2	& \omega_{V,CL} \\
  				& 				& \omega_{CL}^2
 \end{pmatrix}
\]
is providing the necessary information due to the reletionship
\begin{align*}
	&\mbox{Cov($p_i$,$p_j$)} = \sigma_i \sigma_j \mbox{Corr($p_i$,$p_j$)}  = \sigma_i \sigma_j \;\rho_{i,j} \quad \mbox{i.e.} \quad \omega_{V,CL} = \omega_V \omega_{CL} \rho_{V,CL}
\end{align*}
in which case it is enough to define $\Omega$ to cover the full correlation structure.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Covariate model}
\label{maths:covariate_model}

The covariate model accounts for systematic or known subject
characteristics such as treatment group, gender or body
weight. Accordingly, the model can be defined for discrete and
continuous covariates and is the place where one category of fixed
effects is defined (the other being
the population averages, e.g. $V_{pop}$). Of course, the values of
individual characteristics (weight or sex) are subject specific but
the parameters assigned to them are identical for a group or
population.

As described in the example above the contribution of the continuous
covariate $Weight$ to the parameter value is formulated as
$\beta_{V,2} \log(W_i/70)$ (see figure
\ref{fig:weightAsCovariate}). The figure illustrates the linearity
after the appropriate transformation of the parameter, $V_i
\longrightarrow \log(V_i)$ and $W \longrightarrow \log(W/70)$ with
$\beta_{V,2} = \tan{\alpha}$, the slope of the regression line, and
$\log(V_{pop})$ as the $y$-axis intercept.

In the estimation case the values for the covariate are provided for
each individual. In the case of a simulation (see example
\ref{subsec:exp2_TaskDescription}) its probability distribution has to
be estimated. The information we have to provide is summarised in the

\paragraph{Continuous covariate model}
\begin{align*}
Covariates & =  Weight  \\
CovariatesType & = Continuous  \\
CovariatesPopDistribution\{1\} & \sim \mbox{Normal}(pop_{Weight}, \omega_{Weight})  \\
 \text{with} & \quad pop_{Weight}=70.07 \\
 & \quad \omega_{Weight}=14.09  \\
CovariatesTransf & =\log(Weight/70)
\end{align*}
Analog information has to be provided in the case of a categorical covariate, such as \textit{Sex} and is summarised for a simple example in the

\paragraph{Categorial covariate model}
\begin{align*}
Covariates &= Sex   \\
CovariatesType &= Categorical  \\
CategoriesNumber &= 2   \\
Categories &= \{F,M\}   \\
RefCategory &= F   \\
RefCategProbability &= 14/36
\end{align*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%\subsection{Note on correlation and covariates}
%%This section discusses the influence of covariates on correlation between random effects and that of the parameters. In the case without e.g. normally distributed covariates, the correlation is identical. However, the presence of normally distributed body weight in the parameter model has interesting consequences for these correlations. \\
%%Let's consider as an example two correlated log-normally distributed parameters, $V$ and $CL$, without covariates i.e.
%%\begin{align*}
%%& \eta_{V} \sim \mathcal{N}(0,\omega_V); \quad \log( V ) = \log( V_{pop} ) + \eta_{V}  \\
%%& \eta_{CL} \sim \mathcal{N}(0,\omega_{CL}); \quad \log( CL ) = \log( CL_{pop} ) + \eta_{CL}
%%\end{align*}
%%then the correlation between the random effects is identical to the correlation of the (transformed) parameters, see Figure \ref{fig:correlationEtasLogedParams1}.
%%\begin{figure}[h!]
%%\centering
%% \includegraphics[height=45mm]{correlationsNoCovars}
%%\caption{Correlation of random effects $\eta_V$, $\eta_{CL}$ (blue), transformed parameters $\log(V)$ and $\log(CL)$ (red) and actual parameters  $V$ and $CL$ (green) is equal in the case without covariates. Values used: $V_{pop}=8, \omega_V=0.2, CL_{pop}=0.13,  \omega_{CL}=0.2$.}
%%\label{fig:correlationEtasLogedParams1}
%%\end{figure}
%%\newline
%%Now, we consider that both parameters depend on a continuous normally distributed covariate, e.g. the $Weight$,
%%\begin{align*}
%%& \eta_{V} \sim \mathcal{N}(0,\omega_V); \quad \log( V ) = \log( V_{pop} ) + \beta_{V} \log\Big(\frac{W}{70}\Big) + \eta_{V}  \\
%%& \eta_{CL} \sim \mathcal{N}(0,\omega_{CL}); \quad \log( CL ) = \log( CL_{pop} ) + \beta_{CL} \log\Big(\frac{W}{70}\Big) + \eta_{CL}
%%\end{align*}
%%then the correlation between the transformed parameters is higher then that of the random effects and increases proportionally to $corr(\eta_{V}, \eta_{CL})$, see Figure \ref{fig:correlationEtasLogedParams2}.
%%\begin{figure}[h!]
%%\centering
%% \includegraphics[height=45mm]{correlationsWithCovars}
%%\caption{The correlation between both the transformed parameters (red) and actual parameters (green) is higher then that of the random effects (blue) (and is equal 0.933, 0.948 and 0.750, respectively, for $n=10^8$). Values used as before with $\beta_V=2, \beta_{CL}= 1.75$.}
%%\label{fig:correlationEtasLogedParams2}
%%\end{figure}
%%\newline
%%The consequence of this discussion is that the correlation structure of random effects, as defined in PharmML, translates only in special cases to the correlation between parameters.
%%%This underlines the importance of the fact that we define in PharmML the relationship between random effects and not parameters.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Equivalent representations of the parameter model}
Every parameter model represented in the Type 3 format discussed before has at least three mathematically equivalent representation forms,
which will be presented and discussed in terms of advantages and disadvantages in the following. It is important to understand these different
representation forms, as they explain the different forms of notation used in different software tools. Here, we concentrate on NONMEM and MONOLIX only.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Log-Normal distributed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsubsection{Log-Normal distributed}
For a \textbf{log-normal} distributed parameter, e.g. $V$, the equivalent representations read
\begin{align*}
&(1) \eta_i \sim \mathcal{N}(0,\omega_V); \quad V_i= V_{pop} \; e^{\eta_{i,V}}   \\
&(2) \eta_i \sim \mathcal{N}(0,\omega_V); \quad \log( V_i ) = \log( V_{pop} ) + \eta_{i,V}  \\
&(3) \log( V_i ) \sim \mathcal{N}\big( \log( V_{pop} ),\omega_V\big)
\end{align*}
for a typical value $V_{pop}$ and standard deviation $\omega_V$ as described in \cite{Lavielle:2012b}.\\
The typical NMTRAN code for a log-normally distributed parameter is (\cite{Smith:2012aa})
\begin{lstlisting}
GRPV=THETA(1)
V=GRPV*EXP(ETA(1))
\end{lstlisting}
and in MLXTRAN (\cite{MonolixOverview:2012})
\begin{lstlisting}
# as explicit equation
eta_V ~ normal(0, omega_V)
V = V_pop*exp(eta_V)

# or using short notation
V = {distribution=lognormal, typical=V_pop, sd=omega_V}
\end{lstlisting}

\begin{figure}[htbp]
\centering
 \includegraphics[width=100mm]{paramCovModel_V}
\caption{Log-normally distributed 'V' with $V_{pop}=8$ and $\omega_V=0.2$}
\label{fig:parameterCovModel0}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Log-Normal distributed with a continuous covariate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsubsection{Log-Normal distributed with a continuous covariate}
For a \textbf{log-normal} distributed parameter, e.g. $V$, with body weight, $W$, as covariate the equivalent representations read
\begin{align*}
& (1) \quad \eta_i \sim \mathcal{N}(0,\omega_V); \quad V_i= V_{pop} \; \big(\frac{W_i}{70}\big)^\beta \; e^{\eta_{i,V}}   \\
&(2) \quad \eta_i \sim \mathcal{N}(0,\omega_V); \quad \log( V_i ) = \log( V_{pop} ) + \beta \log\big(\frac{W_i}{70}\big) + \eta_{i,V}  \\
&(3) \quad \log( V_i ) \sim \mathcal{N}\big( \log( V_{pop} )+ \beta\log\Big(\frac{W_i}{70}\Big),\omega_V\big)
\end{align*}
The typical NMTRAN code for a log-normally distributed parameter with weight as covariate is
\begin{lstlisting}
GRPV=THETA(1)*(WT/70)**THETA(2)
V=GRPV*EXP(ETA(1))
\end{lstlisting}
and in MLXTRAN
\begin{lstlisting}
# as explicit equation
V_pop = V_pop*(weight/70)^beta_V
eta_V ~ normal(0, omega_V)
V = V_pop*exp(eta_V)

# or using short notation
V = {distribution=lognormal, typical=V_pop, covariate=lw70, coefficient=beta_V, sd=omega_V}
\end{lstlisting}
with $lw70 \equiv \log(W/70)$.

\begin{figure}[htbp]
\centering
 \includegraphics[width=100mm]{paramCovModel_VlogV}
\caption{Log-normally distributed 'V' with 'Weight' as covariates.}
\label{fig:parameterCovModel1}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Logit-Normal distributed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsubsection{Logit-Normal distributed}
For a \textbf{logit-normal} distributed parameter, e.g. $Imax$, the equivalent representations read
\begin{align*}
&(1) \quad \eta_i \sim \mathcal{N}(0,\omega); \quad  Imax_i= \frac{\bigg[\frac{ Imax_{pop}}{1- Imax_{pop}} \; e^{\eta_{i, Imax}} \bigg]}{ 1+  \bigg[\frac{ Imax_{pop}}{1- Imax_{pop}} \; e^{\eta_{i, Imax}} \bigg]}   \\
&(2) \quad  \eta_i \sim \mathcal{N}(0,\omega); \quad \mbox{logit}(  Imax_i ) = \mbox{logit}(  Imax_{pop} ) + \eta_{i, Imax}  \\
&(3) \quad  \mbox{logit}(  Imax_i ) \sim \mathcal{N}\big( \mbox{logit}( Imax_{pop} ),\omega\big)
\end{align*}
Equation (1) can be rewritten using '$logit$' as follows
\begin{align*}
& Imax_i= \frac{\exp\big(logit(Imax_{pop})  + \eta_{i,Imax} \big)}{ 1+ \exp\big(logit(Imax_{pop}) + \eta_{i,Imax} \big)}  \\
& \Leftrightarrow  Imax_i= \frac{1}{ 1+ \exp\big(- logit(Imax_{pop}) - \eta_{i,Imax} \big)}
\end{align*}\newline
The last form is used for a typical NMTRAN implementation of a logit-normally distributed parameter
\begin{lstlisting}
LGTIMAX=LOG(POP_IMAX/(1-POP_IMAX)) + ETA(IMAX)
IMAX=1/(1+EXP(-LGTIMAX))
\end{lstlisting}
and in MLXTRAN
\begin{lstlisting}
# as explicit equation
eta_Imax ~ normal(0, omega_Imax)
logitImaxi = log(pop_Imax/(1-pop_Imax)) + eta_Imax
Imaxi = 1/(1 + exp(-logitImaxi))

# or using short notation
Imax = {distribution=logitnormal, typical=Imax_pop, sd=omega_Imax}
\end{lstlisting}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Logit-Normal distributed with a continuous covariate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsubsection{Logit-Normal distributed with a continuous covariate}
For a \textbf{logit-normal} distributed parameter with \textit{Weight} as \textbf{covariate} we have
\begin{align*}
&(1)\quad \eta_i \sim \mathcal{N}(0,\omega); \quad Imax_i= \frac{\bigg[\frac{Imax_{pop}}{1-Imax_{pop}} \; \big(\frac{W_i}{70}\big)^\beta \; e^{\eta_{i,Imax}} \bigg]}{ 1+  \bigg[\frac{Imax_{pop}}{1-Imax_{pop}} \; \big(\frac{W_i}{70}\big)^\beta \; e^{\eta_{i,Imax}} \bigg]}
\end{align*}
\begin{align*}
&(2)\quad \eta_i \sim \mathcal{N}(0,\omega); \quad \mbox{logit}( Imax_i ) = \mbox{logit}( Imax_{pop} ) + \beta \log\bigg(\frac{W_i}{70}\bigg) + \eta_{i,Imax}  \\
&(3)\quad \mbox{logit}(  Imax_i ) \sim \mathcal{N}\big( \mbox{logit}( Imax_{pop}) + \beta\log\Big(\frac{W_i}{70}\Big),\omega\big)
\end{align*}
The first equation can be rewritten as follows
\begin{align*}
& Imax_i= \frac{\exp\big(logit(Imax_{pop}) + \beta \log\big(\frac{W_i}{70}\big) + \eta_{i,Imax} \big)}{ 1+ \exp\big(logit(Imax_{pop}) + \beta \log\big(\frac{W_i}{70}\big) + \eta_{i,Imax} \big)}  \\
& \Leftrightarrow Imax_i= \frac{1}{ 1+ \exp\big(- logit(Imax_{pop}) - \beta \log\big(\frac{W_i}{70}\big) - \eta_{i,Imax} \big)}
\end{align*}\newline
The last form is used for a typical NMTRAN implementation of a logit-normally distributed parameter with covariate
\begin{lstlisting}
LGTIMAX=LOG(POP_IMAX/(1-POP_IMAX)) + BETA*LOG(WT/70) + ETA(IMAX)
IMAX=1/(1+EXP(-LGTIMAX))
\end{lstlisting}
and in MLXTRAN
\begin{lstlisting}
# as explicit equation
eta_Imax ~ normal(0, omega_Imax)
logitImaxi = log(pop_Imax/(1-pop_Imax)) + beta*lw70 + eta_Imax
Imaxi = 1/(1 + exp(-logitImaxi))

# or using short notation
Imax =	{distribution=lognormal, typical=Imax_pop, covariate=lw70, coefficient=beta_Imax, sd=omega_Imax}
\end{lstlisting}

\begin{figure}[htbp]
\centering
 \includegraphics[width=100mm]{paramCovModel_ImaxlogImax_Weight}
\caption{Logit-normally distributed 'Imax' with 'Weight' as covariate.}
\label{fig:parameterCovModel3}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Logit-Normal distributed with a categorical covariate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%\subsubsection{Logit-Normal distributed with a categorical covariate}
%For a \textbf{logit-normal} distributed parameter with \textit{Sex} as \textbf{covariate} we have
%\begin{align*}
%&(1)\quad \eta_i \sim \mathcal{N}(0,\omega); \quad Imax_i= \frac{\bigg[\frac{Imax_{pop}}{1-Imax_{pop}} \; e^{\beta_{Imax_i} 1_{Sex_i=F}} \; e^{\eta_{i,Imax}} \bigg]}{ 1+  \bigg[\frac{Imax_{pop}}{1-Imax_{pop}} \; e^{\beta_{Imax_i} 1_{Sex_i=F}} \; e^{\eta_{i,Imax}} \bigg]}  \\
%&(2)\quad \eta_i \sim \mathcal{N}(0,\omega); \quad \mbox{logit}( Imax_i ) = \mbox{logit}( Imax_{pop} ) + \beta_{Imax_i} 1_{Sex_i=F} + \eta_{i,Imax}  \\
%&(3)\quad \mbox{logit}(  Imax_i ) \sim \mathcal{N}\big( \mbox{logit}( Imax_{pop}) + \beta_{Imax_i} 1_{Sex_i=F},\omega\big)
%\end{align*}
%The first equation can be rewritten as follows
%\begin{align*}
%& Imax_i= \frac{\exp\big(logit(Imax_{pop}) + \beta_{Imax_i} 1_{Sex_i=F} + \eta_{i,Imax} \big)}{ 1+ \exp\big(logit(Imax_{pop}) + \beta_{Imax_i} 1_{Sex_i=F} + \eta_{i,Imax} \big)}  \\
%& \Leftrightarrow Imax_i= \frac{1}{ 1+ \exp\big(- logit(Imax_{pop}) - \beta_{Imax_i} 1_{Sex_i=F} - \eta_{i,Imax} \big)}
%\end{align*}\newline
%The last form is used for a typical implementation of a logit-normally distributed parameter with covariate:\\
%in NMTRAN
%\begin{lstlisting}
%LGTIMAX=LOG(POP_IMAX/(1-POP_IMAX)) + BETA*SEX + ETA(IMAX)
%IMAX=1/(1+EXP(-LGTIMAX))
%\end{lstlisting}
%and in MLXTRAN
%\begin{lstlisting}
%# as explicit equation
%eta_Imax ~ normal(0, omega_Imax)
%logitImaxi = log(pop_Imax/(1-pop_Imax)) + beta*Sex + eta_Imax
%Imaxi = 1/(1 + exp(-logitImaxi))
%
%# or using short notation
%Imax =	{distribution=lognormal, typical=Imax_pop, covariate=Sex, coefficient=beta_Imax, sd=omega_Imax}
%\end{lstlisting}
%
%
%\begin{figure}[h!]
%\centering
% \includegraphics[width=100mm]{paramCovModel_ImaxlogImax_Sex}
%\caption{Logit-normally distributed 'Imax' with 'Sex' as a categorical covariate.}
%\label{fig:parameterCovModel4}
%\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Log-Normal distributed with complex variability structure
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsubsection{Log-Normal distributed with complex variability structure}
\label{subsec:logIOVCovariate}
In this example we consider representations of type (1) and (2) only. A typical parameter model with a continuous covariate, $W$, for three levels of variability e.g. \{centre, subject, occasion\} (this will be explained in detail in next section), see Figure \ref{tree_IOV1}, reads as follows
\begin{align*}
&(1)\quad V_{lik} = V_{pop} \; \big(\frac{W_i}{70}\big)^\beta \; e^{\eta_{l,V}^{(1)}} \; e^{\eta_{li,V}^{(0)}} \; e^{\eta_{lik,V}^{(-1)}}   \\
&(2)\quad \log(V_{lik}) = \log(V_{pop}) + \beta\log\Big(\frac{W_i}{70}\Big) + \eta_{l,V}^{(1)} + \eta_{li,V}^{(0)} + \eta_{lik,V}^{(-1)}
\end{align*}
with
\begin{align*}
 & \eta_l^{(1)} \sim \mathcal{N}\big(0,\Omega^{(1)}\big), \quad \eta_{li}^{(0)} \sim \mathcal{N}\big(0,\Omega^{(0)}\big),
\quad \eta_{lik}^{(-1)} \sim \mathcal{N}\big(0,\Omega^{(-1)}\big)
\end{align*}
with $l$ -- centre index, $i$ -- subject index, $k$ -- occasion index.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Discussion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%\subsection{Discussion}
%Currently, \pharmml supports the version (2) of the parameter model. Consider the parameter model from last example
%which with some additional annotation reads as follows
%\begin{align*}
%& \underbrace{\log(V_{lik})}_{\text{\parbox{2cm}{\centering transformed\\[-4pt] individual value}}} = \underbrace{\log(V_{pop})}_{\text{\parbox{2cm}{\centering transformed\\[-4pt] typical value}}} + \underbrace{\beta\log\Big(\frac{W_i}{70}\Big)}_{\text{covariate model}}
%+ \underbrace{\eta_{l,V}^{(1)}}_{\text{\parbox{2cm}{\centering inter-centre\\[-4pt]  variability}}}
%+ \underbrace{\eta_{li,V}^{(0)}}_{\text{\parbox{2cm}{\centering inter-individual\\[-4pt] within centre \\[-4pt]  variability}}}
%+ \underbrace{\eta_{lik,V}^{(-1)}}_{\text{\parbox{2.5cm}{\centering inter-occasion\\[-4pt] within individual \\[-4pt] within centre \\[-4pt] variability}}}
%\end{align*}
%This formula, linear for the transformed parameter, has the following \textbf{advantages}
%\begin{itemize}
%\item
%it has an additive structure allowing for easy interpretation and implementation of its components, i.e.
%\begin{itemize}
%\item
%typical/population value of the parameter
%\item
%covariate model
%\item
%any level of random effects
%\end{itemize}
%\item
%it covers the majority of models relevant for daily practice
%\end{itemize}
%The \textbf{disadvantage} is that it doesn't cover parameter models which cannot be represented in the linear form for the transformed parameter, e.g. the models proposed by \cite{Keizer:2011aa}. This issue has been recognised early on and discussed in the consortium. This class of models is being considered for a subsequent specification of \pharmml.

%
%\paragraph{Discussion}
%Consider for example equation (2) for a parameter with a continuous covariate, $W$, with three levels of variability e.g. \{country,subject, occasion\} from the last example. With some additional annotation it reads then
%\begin{align*}
%& \underbrace{\log(V_{lik})}_{\parbox{2cm}{\centering transformed\\[-4pt] individual\\[-4pt] value}} = \underbrace{\log(V_{pop})}_{\parbox{1.5cm}{\centering transformed\\[-4pt] typical\\[-4pt] value}}
%+ \underbrace{\beta\log\Big(\frac{W_i}{70}\Big)}_{\parbox{2cm}{\centering covariate\\[-4pt] model}}
%+ \underbrace{\eta_{l,V}^{(1)}}_{\parbox{2cm}{\centering inter-centre\\[-4pt]  variability}}
%+ \underbrace{\eta_{li,V}^{(0)}}_{\parbox{2.25cm}{\centering inter-centre-\\[-4pt] individual\\[-4pt]  variability}}
%+ \underbrace{\eta_{lik,V}^{(-1)}}_{\parbox{3cm}{\centering inter-centre-\\[-4pt] individual-occasion\\[-4pt] variability}}
%\end{align*}
%
%This formulation, linear for the transformed parameter, has the following advantages
%\begin{itemize}
%\item
%it has an additive structure allowing for easy interpretation and implementation of its components, i.e.
%\begin{itemize}
%\item
%typical/population value of the parameter
%\item
%covariate model
%\item
%inter-individual variability random effects
%\item
%higher levels of variability
%\end{itemize}
%\item
%it covers the majority of models relevant for daily practice
%\end{itemize}
%More complex models will be supported in an upcoming specification.
%


\documentclass[a4paper]{article}

\input{temp}

\setcounter{section}{-1}

\begin{document}

\title{Advanced Probability}

\maketitle

\newpage

\tableofcontents

\newpage

\section{Reviews}

\subsection{Measure spaces}

Let $E$ be a set. Let $\mathcal{E}$ be a set of subsets of $E$. We say that $\mathcal{E}$ is a $\sigma$-algebra on $E$ if:\\
$\bullet$ $\phi \in \mathcal{E}$;\\
$\bullet$ $\mathcal{E}$ is closed under countable unions and complements.\\
In that case, $(E,\mathcal{E})$ is called a \emph{measurable space}.

We call the elements of $\mathcal{E}$ \emph{measurable sets}.

Let $\mu$ be a function $\mathcal{E} \to [0,\infty]$. We say $\mu$ is a measure if:\\
$\bullet$ $\mu(\phi) = 0$;
$\bullet$ $\mu$ is countably additive: for all sequences $(A_n)$ of disjoint elements of $\mathcal{E}$, then
\begin{equation*}
\begin{aligned}
\mu(\bigcup_n A_n) = \sum_n \mu(A_n)
\end{aligned}
\end{equation*}
In that case, the triple $(E,\mathcal{E},\mu)$ is called a \emph{measure space}.

Given a topological space $E$, there is a smallest $\sigma$-algebra containing all the open sets in $E$. This is the \emph{Borel $\sigma$-algebra of $\mathcal{E}$}, denoted $\mathcal{B}(E)$.

In particular, for the real line $\R$, we will just write $\mathcal{B} = \mathcal{B}(\R)$ for simplicity.

\subsection{Integration of measurable functions}

Let $(E,\mathcal{E})$ and $(E',\mathcal{E}')$ be measurable spaces. A function $f:E \to E'$ is \emph{measurable} if $f^{-1}(A) = \{x \in E: f(x) \in A\} \in \mathcal{E} \forall A \in \mathcal{E}'$.

If we refer to a measurable function $f$ without specifying range, the default is $(\R,\mathcal{B})$.

Similarly, if we refer to $f$ as a non-negative measurable function, then we mean $E'=[0,\infty]$, $\mathcal{E}' = \mathcal{B}([0,\infty])$.

It is worth notice that under this set of definitions, a non-negative measurable function might not be $\R$-measurable (since we allowed $\infty$).

We write $m\mathcal{E}^+$ for set of non-negative measurable functions.

\begin{thm}
Let $(E,\mathcal{E},\mu)$ be a measure space. There exists a unique map $\tilde{\mu}: m\mathcal{E}^+ \to [0,\infty]$ such that:\\
$\bullet$(a) $\tilde{\mu}(1_A) = \mu(A)$ for all $A \in \mathcal{E}$, where $1_A$ is the indicator function;\\
$\bullet$(b) $\tilde{\mu}(\alpha f + \beta g) = \alpha\tilde{\mu}(f) + \beta\tilde{\mu}(g)$ for all $\alpha,\beta \in [0,\infty)$, $f,g \in m\mathcal{E}^+$ (linearity);\\
$\bullet$(c) $\tilde{\mu}(f) = \lim_{n \to \infty} \tilde{\mu}(f_n)$ for any non-decreasing sequence $(f_n:n \in \N)$ in $m\mathcal{E}^+$ such that $f_n(x) \to f(x)$ for all $x \in E$ (monotone-convergence).

We'll only prove uniqueness. For existence, see II Probability and Measure notes.
\end{thm}

From now on, write $\mu$ for $\tilde{\mu}$.\\
We'll call $\mu(f)$ the \emph{integral} of $f$ w.r.t. $\mu$.\\
We also write $\int_E f d\mu = \int E f(x) \mu(dx)$.

A \emph{simple function} is a finite linear combination of indicator functions of measurable sets with positive coefficients, i.e. $f$ is simple if
\begin{equation*}
\begin{aligned}
f =\sum_{k=1}^n \alpha_k 1_{A_k}
\end{aligned}
\end{equation*}
for some $n \geq 0$, $\alpha_k \in (0,\infty), A_k \in \mathcal{E} \forall k = 1,...,n$.

From (a) and (b), for $f$ simple,
\begin{equation*}
\begin{aligned}
\mu(f) =\ sum_{k=1}^n \alpha_k \mu(A_k)
\end{aligned}
\end{equation*}
Also, if $f,g \in m\mathcal{E}^+$ with $f \leq g$, then $f+h = g$ where $h = g - f \cdot 1_{f < \infty} \in m\mathcal{E}^+$. Then since $\mu(h) \geq 0$, (b) implies $\mu(f) \leq \mu(g)$.

Take $f \in m\mathcal{E}^+$. Define for $x \in E$, $n \in \N$,
\begin{equation*}
\begin{aligned}
f_n(x) = \left(2^{-n} \lfloor 2^n f(x)\rfloor \right) \wedge n
\end{aligned}
\end{equation*}
where $\wedge$ means taking the minimum. Note that $(f_n)$ is a non-decreasing sequence of simple functions that converges to $f$ pointwise everywhere on $E$. Then by (c),
\begin{equation*}
\begin{aligned}
\mu(f) = \lim_{n \to \infty} \mu(f_n)
\end{aligned}
\end{equation*}
So we have shown uniqueness: $\mu$ is uniquely determined by the measure (provided that it exists, which we're not going to show).

When is $\mu(f)$ zero (for $f \in m\mathcal{E}^+$)? For measurable functions $f,g$, we say $f=g$ \emph{almost everywhere} if
\begin{equation*}
\begin{aligned}
\mu(\{x \in E: f(x) \neq g(x) \}) = 0
\end{aligned}
\end{equation*}
i.e. they only disagree on a measure-zero set.

We can show, for $f \in m\mathcal{E}^+$, that $\mu(f)=0$ if and only if $f=0$ almost everywhere.

Let $f$ be a measurable function. We say that $f$ is \emph{integrable} if $\mu(|f|) < \infty$.

Write $L^1 = L^1(E,\mathcal{E},\mu)$ for the set of all integrable functions. We extend the integral to $L^1$ by setting $\mu(f) = \mu(f^+) - \mu(f^-)$, where
\begin{equation*}
\begin{aligned}
f^\pm (x) = 0 \vee (\pm f(x))
\end{aligned}
\end{equation*}
where $\vee$ means the maximum (so $f = f^+ - f^-$). Note that now $f^+,f^-$ are both non-negative, with disjoint support. Then we can show that $L^1$ is a vector space, and $\mu:L^1 \to \R$ is linear.

\begin{lemma} (Fatou's lemma)\\
Let $(f_n:n \in \N)$ be any sequence in $m\mathcal{E}^+$. Then
\begin{equation*}
\begin{aligned}
\mu(\liminf_{n\to \infty} f_n) \leq \liminf_{n \to \infty} \mu(f_n)
\end{aligned}
\end{equation*}
The proof is a straight forward application of monotone convergence.\\
The only hard part is to remember which way the inequality is (consider a sliding block function to the right).
\end{lemma}

\begin{thm} (Dominated convergence)\\
Let $(f_n:n \in \N)$ be a sequence of measurable functions on $(E,\mathcal{E})$. Suppose $f_n(x)$ converges pointwise as $n \to \infty$, with limit $f(x)$ say. Suppose further that $|f_n| \leq g$ for all $n$, for some integrable function $g$. Then $f_n$ is integrable for all $n$, so is $f$, and $\mu(f_n) \to \mu(f)$ as $n \to \infty$.
\end{thm}

\begin{defi}
We call a measure space $(\Omega,\mathcal{F},\P)$ such that $\P(\Omega)=1$ a \emph{probability space}. In this setting, measurable functions correspond to random variables, measurable sets correspond to events, almost everywhere corresponds to almost surely, and the integral $\P(X)$ corresponds to the expectation $\E(X) = \int_\Omega X d\P$, sometimes written $\E_\P(X)$ if we need to specify the underlying measure.
\end{defi}

\newpage

\section{Conditional expectation}
Throughout this section we'll use the default probability space $(\Omega \mathcal{F},\P)$.
\subsection{The discrete case}

Suppose $(G_n:n \in \N)$ is a sequence of disjoint set in $\mathcal{F}$ such that $\cup_n G_n = \Omega$ (so a partition of the space $\Omega$). Let $X$ be an integrable random variable. Set $\mathcal{G} = \sigma(G_n:n \in \N)$, which in this case is $\{\cup_{n \in I} G_n:I \subseteq \N\}$, i.e. all countable unions of $G_n$. Define $Y = \sum_{n \in \N} \E(X|G_n) 1_{G_n}$, where $\E(X|G_n) = \E(X 1_{G_n}) / \P(G_n)$, except in the case where $\P(G_n)$ we define LHS to be 0 as well). Now note that $Y$ is $\mathcal{G}$-measurable, is integrable, and $\E(Y 1_A) = \E(X 1_A)$ for any $A \in \mathcal{G}$. We'll write $Y =\E(X|\mathcal{G})$ almost surely, and say $Y$ is \emph{a version of} conditional expectation of $X$ given $\mathcal{G}$.

\subsection{Gaussian case}
Let $(W,X)$ be a Gaussian (normal) random variable in $\R^2$. Take a coarser $\sigma$-algebra $\mathcal{G}$ generated by $W$, which is $\{\{W in B\}: B \in \mathcal{B}\}$. Consider for $a,b \in \R$, the random variable $Y = aW + b$. We can choose $a,b$ so that $\E(Y-X) = a \E(W)+b - \E(X) = 0$, and $cov(Y-X,W) = a\ var(W) - cov(X,W) =0$. Then $Y$ is $\mathcal{G}$-measurable, is integrable, and $\E(Y1_A) = \E(X1_A)$ for all $A \in \mathcal{G}$. To see this, note $Y-X$ and $W$ are independent (as their covariance is 0), and $A = \{W \in B\}$ for some $B \in \mathcal{B}$. So for $A \in \mathcal{G}$, $\E((Y-X)1_A) = \E(Y-X)\P(A) = 0$.

\subsection{Conditional density functions}
Let $(U,V)$ be a random variable in $\R^2$ with density functoin $f(u,v)$, i.e.
\begin{equation*}
\begin{aligned}
\P((U,V) \in A) = \int_A f(u,v) dudv
\end{aligned}
\end{equation*}

Take $\mathcal{G} = \sigma(U) = \{\{U \in B\}:B \in \mathcal{B}\}$. Take a Borel measurable function $h$ on $\R$ and set $X = h(V)$, assume $X \in L^1(\P)$. Note $U$ has density function
\begin{equation*}
\begin{aligned}
f(u) = \int_\R f(u,v) dv
\end{aligned}
\end{equation*}

Define the conditional density function
\begin{equation*}
\begin{aligned}
f(v|u) = f(u,v) / f(u)
\end{aligned}
\end{equation*}
where we define $0/0 = 0$.

Now set $Y = g(U)$, where
\begin{equation*}
\begin{aligned}
g(u) = \int_\R h(v) f(v|u) dv
\end{aligned}
\end{equation*}

Then $g$ is a Borel-measurable functoin on $\R$ (not obvious), so $Y$ is a $\mathcal{G}$-measurable random variable, and is integrable and for all $A = \{U \in B\} \in \mathcal{G}$, $\E(Y 1_A ) = \E(X 1_A)$. To see this,
\begin{equation*}
\begin{aligned}
\E(Y1_A) &=\int_\R g(u) 1_B(u) f(u) du\\
&= \int_\R \int_\R h(v)f(v|u) dv 1_B(u) f(u) du\\
&=\E(X1_A)
\end{aligned}
\end{equation*}
where at the last step we use Fubini's theorem (introduced later) to swap integrals, and note that we can combine $\int f(v|u) f(u)$ to get $f(u,v)$.

\subsection{Product measure and Fubini's theorem}
Take finite (or countably infinite) measure spaces $(E_1,\mathcal{E}_1,\mu_1)$ and $(E_2,\mathcal{E}_2,\mu_2)$. Write $\mathcal{E}_1 \otimes \mathcal{E}_2$ for the $\sigma$-algebra on $E_1 \times E_2$ generated by sets of the form $A_1 \times A_2$ where $A_i \in \mathcal{E}_i$ for $i=1,2$. We call $\mathcal{E}_1 \otimes \mathcal{E}_2$ the \emph{product $\sigma$-algebra}.

\begin{thm}
There exists a unique measure $\mu=\mu_1 \otimes \mu_2$ on $(E_1 \times E_2, \mathcal{E}_1 \otimes \mathcal{E}_2)$ such that
\begin{equation*}
\begin{aligned}
\mu(A_1 \times A_2) = \mu_1(A_1) \mu_2(A_2)
\end{aligned}
\end{equation*}
for all $A_i \in \mathcal{E}_i$ for $i=1,2$.
\end{thm}

\begin{thm} (Fubini's theorem)\\
Let $f$ be a non-negative measurable function $(E_1 \times E_2, \mathcal{E}_1 \otimes \mathcal{E}_2)$. For $x_1 \in E_1$, define in the obvious way
\begin{equation*}
\begin{aligned}
f_{x_1}(x_2) = f(x_1,x_2)
\end{aligned}
\end{equation*}
Then $f_{x_1}$ is $\mathcal{E}_2$-measurable for all $x_1 \in E_1$. Now define $f_1(x_1) = \mu_2(f_{x_1})$. Then $f_1$ is $\mathcal{E}_1$ measurable and $\mu_1(f_1) = \mu(f)$ (see part II Prob and Measure notes for the integrable case). Define $\hat{f}$ on $E_2 \times E_1$ by
\begin{equation*}
\begin{aligned}
\hat{f}(x_2,x_1) = f(x_1,x_2)
\end{aligned}
\end{equation*}
then we can show $\hat{f}$ is $\mathcal{E}_2 \otimes \mathcal{E}_1$-measurable, and
\begin{equation*}
\begin{aligned}
(\mu_2 \otimes \mu_1) (\hat{f}) = (\mu_1 \otimes \mu_2) (f)
\end{aligned}
\end{equation*}
So by Fubini,
\begin{equation*}
\begin{aligned}
\mu_2(f_2) = \hat{f}(\hat{f}) = \mu(f) = \mu_1(f_1)
\end{aligned}
\end{equation*}
with obvious notations. This means
\begin{equation*}
\begin{aligned}
\int_{E_2}\left(\int_{E_1} f(x_1,x_2) \mu_1 (dx_1) \right) \mu_2 (dx_2) = \int_{E_1} \left(\int_{E_2} f(x_1,x_2) \mu_2(dx_2) \right) \mu_1(dx_1)
\end{aligned}
\end{equation*}
Note that this also holds for just $f$ integrable.
\end{thm}

\subsection{Existence and uniqueness of conditional expectation}
\begin{thm}
    Let $X$ be an integrable random variable and let $\mathcal{G}$ be a sub-$\sigma$-algebra of $\mathcal{F}$. There exist a random variable $Y$ s.t.:\\
    $\bullet$ (a) $Y$ is $\mathcal{G}$-measurable;\\
    $\bullet$ (b) $Y$ is integrable;\\
    $\bullet$ (c) For all $A \in \mathcal{G}$, $\E(Y1_A) = \E(X1_A)$.\\
    Moreover, if $Y'$ is another random variable satisfying above, then $Y'=Y$ a.s..

    We write $Y=\E(X|\mathcal{G})$ a.s., and we say that $Y$ is \emph{a version of} the conditional expectation of $X$ given $\mathcal{G}$.\\
    In the case $X=1_A$, write $Y=\P(A|\mathcal{G})$ a.s., the \emph{probability} of event $A$ given $\mathcal{G}$.

    An analogous statement holds with \emph{integrable} replaced by \emph{non-negative} throughout the statement.
    \begin{proof}
        Uniqueness: We'll actually prove something stronger. Suppose $Y$ satisfies the above conditions, and $Y'$ satisfies the above for some integrable $X'$, with $X \leq X'$. We'll show that $Y \leq Y'$ (That gives what we want by setting $X'=X$).\\
        Consider the non-negative random variable $Z=(Y-Y')1_A$ where $A =\{Y \geq Y' \} \in \mathcal{G}$ (think about definition of measurable function here). Then $\E(Y 1_A) = \E(X 1_A) \leq \E(X' 1_A) = \E(Y' 1_A)$, so $\E(Z) \leq 0$, so $Z = 0$ a.s.. But that means $Y\leq Y'$ a.s..

        Existence: Consider for now the case $X \in L^2(\mathcal{F})$ (means $\E(|X|^2) < \infty$). Since $L^2(\mathcal{F})$ is complete, every Cauchy sequence has a limit, and $L^2(\mathcal{G})$ is a closed subspace of $L^2(\mathcal{F})$, there exists orthogonal projection $Y$ of $X$ on $L^2(\mathcal{G})$. That is, $Y \in L^2(\mathcal{G})$ and for all $Z \in L^2(\mathcal{G})$, we have $\E((Y-X)Z) = 0$, i.e. the difference is orthogonal to the subspace.\\
        For $A \in \mathcal{G}$, take $Z = 1_A$ to see $\E(Y1_A) = \E(X1_A)$. So $Y$ satisfies the above conditions (the key point here is that the orthogonal projection always exists, so we've in some sense converted the problem of existence of conditional probability to the existence of orthogonal projection).\\
        Now suppose $X \geq 0$. Set $X_n = X \wedge n$, then $X_n \in L^2(\mathcal{F})$. We have shown ther exists $Y_n \in L^2(\mathcal{G})$, such that for all $A \in \mathcal{G}$, $\E(Y_n1_A) = \E(X_n1_A)$, and $0 \leq Y_n \leq Y_{n+1}$ a.s. for all $n$ (Note $0 \leq X_n \leq X_{n+1})$. Set $\Omega_0 = \{\omega \in \Omega: 0 \leq Y_n(\omega) \leq Y_{n+1}(\omega) \forall n\}$. Then $\P(\Omega_0) = 1$. Define a non-negative $\mathcal{G}$-measurable random variable $$Y_\infty = 1_{\Omega_0} \lim_{n \to \infty} Y_n$$
        Then $0 \leq 1_|{\Omega_0 Y_n} \uparrow Y_\infty$ as $n \to \infty$.\\
        So by monotone convergence, for all $A \in \mathcal{G}$,
        \begin{equation*}
            \begin{aligned}
                \E(Y_\infty 1_A) &= \lim_{n \to \infty} \E(Y_n 1_A)\\
                &= \lim_{n \to \infty} \E(X_n 1_A)\\
                &= \E(X 1_A)
            \end{aligned}
        \end{equation*}
        In particular, taking $A=\Omega$, we see $Y_\infty$ is integrable, so $\P(Y_\infty = \infty) = 0$.\\
        So if we set $Y = Y_\infty 1_{Y_\infty < \infty}$, then $Y$ is a random variable and satisfies the above conditions. So we've done for the case $X \geq 0$.

        In the general case, we use the usual trick: apply the preceding to $X^\pm = 0 \vee (\pm X)$ (so $X = X^+-X^-)$ to obtain $Y^\pm$, and the check $Y=Y^+-Y^-$ satisfies the above conditions similarly.
    \end{proof}
\end{thm}

\subsection{Properties of conditional expectation}
Fix an integrable random variable $X$ and a sub-$\sigma$-algebra $\mathcal{G}$. Theorem 1.4.1 has the following consequences:\\
(i) $\E(\E(X|\mathcal{G})) = \E(X)$;\\
(ii) if $X$ is $\mathcal{G}$-measurable, then $\E(X|\mathcal{G}) = X$ a.s.;\\
(iii) If $X$ is independent of $\mathcal{G}$, then $\E(X|\mathcal{G}) = \E(X)$ a.s..

Check for $A \in \mathcal{G}$,
\begin{equation*}
    \begin{aligned}
        \E(X 1_A) = \E(X)\P(A) = \E(\E(X)1_A)
    \end{aligned}
\end{equation*}
so $\E(X)$ satisfies (b) and (c) in the previous theorem.

(iv) if $X \geq Y$ a.s.., then $\E(X|\mathcal{G}) \geq \E(Y|\mathcal{G})$ a.s. (from the proof).\\
(v) for all $\alpha,\beta \in \R$, all integrable random variables $X,Y$,
\begin{equation*}
    \begin{aligned}
        \E(\alpha X + \beta Y | \mathcal{G}) = \alpha\E(X|\mathcal{G})+\beta\E(Y|\mathcal{G})
    \end{aligned}
\end{equation*}
a.s..

Consider a sequence of random variables $X_n$,\\
(vi) if $0 \leq X_n \uparrow X$ pointwise, then
\begin{equation*}
    \begin{aligned}
        \E(X_n|\mathcal{G}) \to \E(X|\mathcal{G}) \ a.s.
    \end{aligned}
\end{equation*}
(conditional monotone convergence).\\
To see this, we know $\E(X_n|\mathcal{G}) \uparrow Y$ a.s. for some non-negative $\mathcal{G}$-measurable random variable $Y$.

Take $A \in \mathcal{G}$, then by monotone convergence,
\begin{equation*}
    \begin{aligned}
        \E(Y 1_A) &= \lim_{n \to \infty} \E(\E(X_n | \mathcal{G})1_A)\\
        &= \lim_{n \to \infty} \E(X_n 1_A)\\
        &= \E(X 1_A)
    \end{aligned}
\end{equation*}
So $Y$ satisfies (b) and (c) in the above theorem for $X$.

(vii) For any non-negative random variable $X_n$,
\begin{equation*}
    \begin{aligned}
        \E(\liminf_{n \to \infty} X_n | \mathcal{G}) \leq \liminf_{n \to \infty} \E(X_n|\mathcal{G})
    \end{aligned}
\end{equation*}

(viii) If $X_n(\omega) \to X(\omega)$ for all $\omega$ as $n \to \infty$ and there exist $Y$ integrable (so $|X_n| \leq Y$ for all $n$ (???)), then
\begin{equation*}
    \begin{aligned}
        \E(X_n|\mathcal{G}) \to \E(X|\mathcal{G}) \ a.s.
    \end{aligned}
\end{equation*}
For (vii), $(\inf_{m\geq n} X_n : n \in \N)$; (viii) apply Fatou to $(Y \pm X_n: n \in \N$).

Find lecturer's webpage for everything!

\end{document}