In this section we will give an informal introduction of a partizan two-player game played on black-and-white-colored posets. The game is played by removing poset elements of your color, with the result that all greater elements in the poset are removed as well. The game ends when  one of the players has no elements left to remove. This player then loses.
\\
An example of such a game is provided below in Example \ref{ex:game}.
\\
\begin{ex}{}
\label{ex:game}
An example of a partizan element removal game played on a colored poset and an example of gameplay on this game.
\begin{figure}[H]
\centering
$
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
=\left\{
\underbrace{
\emptyset
,
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-1) -- (3,2);
  \draw[thick] (0,-1) -- (0,2);
  \node (zero) at (0,-1) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,2) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,2) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
\end{tikzpicture}
,
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0);
  \draw[thick] (0,-3) -- (3,0);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
\end{tikzpicture}
}_{\text{Left player options}}
\middle|
\underbrace{
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
,
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
\end{tikzpicture}
,
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
}_{\text{Right player options}}
\right\}
$
\caption{Example of a colored poset element removal game.}
\label{fig:posetgameex}
\end{figure}
\begin{figure}[H]
\centering
$
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=blue!60] (0,0) circle (.7ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0);
  \draw[thick] (0,-3) -- (3,0);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=red!60] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
\end{tikzpicture}
\overset{R}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0);
  \draw[thick] (0,-3) -- (3,0);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=blue!60] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (3,0);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=red!60] (0,0) circle (.7ex);};
\end{tikzpicture}
\overset{R}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \node (zero) at (0,-3) {\tikz\draw[black,fill=blue!60] (0,0) circle (.7ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
%\emptyset
$
\caption{Example of gameplay on the game in Figure \ref{fig:posetgameex} where Left player wins. Play moves are highlighted with blue (Left) and red (Right).}
\end{figure}
\end{ex}
~\\
In particular, this thesis will focus on games played on \emph{chess-colored} posets, where the posets are in the form of \emph{Young diagrams}. An example of a chess-colored Young diagram and a game played on this Young diagram is provided in Example \ref{ex:younggameplay}.
\begin{ex}{}
\label{ex:younggameplay}
An example of a chess-colored Young diagram and an example of a gameplay on this Young diagram.
\begin{figure}[H]
\centering
\begin{tabular}{ | c | c | c | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~\\
\hline
\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\cline{1-5}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
~\\
\cline{1-1}
\end{tabular}
\captionof{figure}{Example of a chess-colored Young diagram.}
\label{fig:chessyoungex}
\end{figure}
\begin{figure}[H]
\centering
$
\begin{tabular}{ | c | c | c | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&\cellcolor{blue!60}&\cellcolor[gray]{0}&~\\
\hline
\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\cline{1-5}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
~\\
\cline{1-1}
\end{tabular}
\overset{L}{\longrightarrow}
\begin{tabular}{ | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\hline
\cellcolor{red!60}&~&\cellcolor[gray]{0}&~\\
\cline{1-4}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
~\\
\cline{1-1}
\end{tabular}
\overset{R}{\longrightarrow}
\begin{tabular}{ | c | c | c | c |}
\hline
\cellcolor{blue!60}&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\hline
\end{tabular}
\overset{L}{\longrightarrow}
\emptyset
$
\captionof{figure}{Example of gameplay on the chess-colored Young diagram of Figure \ref{fig:chessyoungex} where Left player wins. Play moves are highlighted with blue (Left) and red (Right).}
\label{fig:chessyounggameplay}
\end{figure}
\end{ex}
~\\
For these games in general, we will show that they are all surreal numbers, and that, given some properties, they always are valued between 0 and 1. %We will also show that games played on \emph{forest posets} are equivalent to games of \emph{Blue-Red Hackenbush}.
\\
Finally, for games played on chess-colored Young diagrams with $\le3$ rows, we will show that the value is easy to compute by proving that they can be computed with a given formula.
\\\\
First a brief background of poset games will be covered.
\subsection{Background}
A poset game is an element-removal game played on a poset, where a player selects an element and removes this element and all greater elements. A poset game can be both impartial (if it is not colored) and partizan (if it is colored, i.e., each element has a color which specifies who can select and remove it). It is known that the problem of deciding the winner of an impartial uncolored poset game is \textsf{PSPACE}-complete\cite{grier2013}.
\\\\
The simplest possible impartial poset game is the one played on a collection of one-dimensional chain posets, also known as \emph{Nim}. The game of Nim is played by removing a number of elements from one of multiple piles of elements. The player removing the last element wins the game. For a more intuitive understanding of Nim, an example of a gameplay on a game of Nim is provided in Example \ref{ex:nim}.
\begin{ex}{}
\label{ex:nim}
An example gameplay on a game of Nim.
\begin{figure}[H]
\centering
$
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[ultra thick] (-2,-3) -- (-2,6);
  \draw[ultra thick] (1,-3) -- (1,3);
  \draw[ultra thick] (4,-3) -- (4,9);
  \draw[ultra thick] (7,-3) -- (7,0);
  \node (11) at (-2,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-2,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-2,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (-2,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (1,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (22) at (1,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (23) at (1,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (31) at (4,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (32) at (4,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (33) at (4,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (34) at (4,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (35) at (4,9) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (41) at (7,-3) {\tikz\draw[black,fill=blue!60] (0,0) circle (1ex);};
  \node (42) at (7,0) {\tikz\draw[black,fill=blue!35] (0,0) circle (1ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[ultra thick] (-2,-3) -- (-2,6);
  \draw[ultra thick] (1,-3) -- (1,3);
  \draw[ultra thick] (4,-3) -- (4,9);
  \node (11) at (-2,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-2,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-2,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (-2,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (1,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (22) at (1,0) {\tikz\draw[black,fill=red!60] (0,0) circle (1ex);};
  \node (23) at (1,3) {\tikz\draw[black,fill=red!35] (0,0) circle (1ex);};
  \node (31) at (4,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (32) at (4,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (33) at (4,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (34) at (4,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (35) at (4,9) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
\end{tikzpicture}
\overset{R}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[ultra thick] (-2,-3) -- (-2,6);
  \draw[ultra thick] (4,-3) -- (4,9);
  \node (11) at (-2,-3) {\tikz\draw[black,fill=blue!60] (0,0) circle (1ex);};
  \node (12) at (-2,0) {\tikz\draw[black,fill=blue!35] (0,0) circle (1ex);};
  \node (13) at (-2,3) {\tikz\draw[black,fill=blue!35] (0,0) circle (1ex);};
  \node (14) at (-2,6) {\tikz\draw[black,fill=blue!35] (0,0) circle (1ex);};
  \node (21) at (1,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (31) at (4,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (32) at (4,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (33) at (4,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (34) at (4,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (35) at (4,9) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[ultra thick] (4,-3) -- (4,9);
  \node (21) at (1,-3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (31) at (4,-3) {\tikz\draw[black,fill=red!60] (0,0) circle (1ex);};
  \node (32) at (4,0) {\tikz\draw[black,fill=red!35] (0,0) circle (1ex);};
  \node (33) at (4,3) {\tikz\draw[black,fill=red!35] (0,0) circle (1ex);};
  \node (34) at (4,6) {\tikz\draw[black,fill=red!35] (0,0) circle (1ex);};
  \node (35) at (4,9) {\tikz\draw[black,fill=red!35] (0,0) circle (1ex);};
\end{tikzpicture}
\overset{R}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \node (21) at (0,-3) {\tikz\draw[black,fill=blue!60] (0,0) circle (1ex);};
\end{tikzpicture}
\overset{L}{\longrightarrow}
\begin{tikzpicture}[baseline=-0.0ex]
  \node at (0,-0.55) {$\emptyset$};
\end{tikzpicture}
%\emptyset
$
\caption{Example of gameplay on a game of Nim where Left player wins. Play moves are highlighted with blue (Left) and red (Right).}
\end{figure}
\end{ex}
~\\
Another impartial poset game is the game \emph{Chomp}, more thoroughly introduced in Section \ref{section:chomp}. A game of Chomp can be represented by a poset game with a two-dimensional $n\times m$ lattice poset, $n,m>0$ integers, with the bottom element removed, as illustrated in Figure \ref{fig:chompposet}.

\begin{figure}[H]
\centering
\begin{subfigure}{0.25\textwidth}
\begin{tabular}{ | c | c | c | c | c |}
\hline
~&~&~&~&~\\
\hline
~&~&~&~&~\\
\hline
~&~&~&~&~\\
\hline
~&~&~&~&~\\
\hline
~&~&~&~&~\\
\hline
~&~&~&~&~\\
\hline
\cellcolor{red}&~&~&~&~\\
\hline
\end{tabular}
\hfill$\Longleftrightarrow$
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\centering
%\begin{turn}{45}
\begin{tikzpicture}[scale=.4]
  \draw[ultra thick] (1,0) -- (4,3);
  \draw[ultra thick] (-1,0) -- (3,4);
  \draw[ultra thick] (-2,1) -- (2,5);
  \draw[ultra thick] (-3,2) -- (1,6);
  \draw[ultra thick] (-4,3) -- (0,7);
  \draw[ultra thick] (-5,4) -- (-1,8);
  \draw[ultra thick] (-6,5) -- (-2,9);
  \draw[ultra thick] (-1,0) -- (-6,5);
  \draw[ultra thick] (1,0) -- (-5,6);
  \draw[ultra thick] (2,1) -- (-4,7);
  \draw[ultra thick] (3,2) -- (-3,8);
  \draw[ultra thick] (4,3) -- (-2,9);
  \node (12) at (1,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (2,1) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (3,2) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (4,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-1,0) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (0,1) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (1,2) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (2,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (3,4) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-2,1) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-1,2) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (1,4) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (2,5) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-3,2) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-2,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-1,4) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (0,5) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (1,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-4,3) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-3,4) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-2,5) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (-1,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (0,7) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-5,4) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-4,5) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-3,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (-2,7) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (-1,8) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-6,5) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (12) at (-5,6) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (13) at (-4,7) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (14) at (-3,8) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
  \node (21) at (-2,9) {\tikz\draw[black,fill=white] (0,0) circle (1ex);};
\end{tikzpicture}
%\end{turn}
\end{subfigure}
\captionof{figure}{A game of Chomp is equivalent to an impartial poset game.}
\label{fig:chompposet}
\end{figure}
While the game of Nim is solved\cite{bouton1901}, i.e., there is a known optimal strategy, there is not so much known about the game of Chomp in general. This also points out how the difficulty can differ for two classes of impartial poset games. Therefore, it is interesting to investigate the properties of \emph{partizan} poset games, i.e., games on colored posets.
\\
In general, there have been very few studies on partizan poset games. One class of partizan poset games that have been studied are \emph{pomax games}. A pomax game is played on a colored poset, where each player can remove only maximal elements of their own color. Examples of pomax games can be found in Figures \ref{fig:posetpomax} and \ref{fig:youngpomax}.
\begin{figure}[H]
\centering
$
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \draw[thick] (3,0) -- (3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (6) at (3,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
=\left\{
\underbrace{
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \draw[thick] (0,-3) -- (3,0) -- (3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (6) at (3,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
,
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0) -- (-3,3);
  \draw[thick] (-3,0) -- (-3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (4) at (-3,3) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
}_{\text{Left player options}}
\;\middle|\;
\underbrace{
\begin{tikzpicture}[baseline=-0.65ex,scale=.2]
  \draw[thick] (0,-3) -- (-3,0) -- (0,3) -- (3,0) -- (0,-3);
  \draw[thick] (0,-3) -- (0,0);;
  \draw[thick] (3,0) -- (3,3);
  \node (zero) at (0,-3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (1) at (-3,0) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (2) at (0,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (3) at (3,0) {\tikz\draw[black,fill=black] (0,0) circle (.7ex);};
  \node (5) at (0,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
  \node (6) at (3,3) {\tikz\draw[black,fill=white] (0,0) circle (.7ex);};
\end{tikzpicture}
}_{\text{Right player options}}
\right\}$
\caption{Example of an arbitrary pomax game.}
\label{fig:posetpomax}
\end{figure}
\begin{figure}[H]
\centering
$
\begin{tabular}{ | c | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~\\
\hline
\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\cline{1-3}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
\end{tabular}
=\left\{
\underbrace{
\begin{tabular}{ | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\hline
\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\cline{1-3}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
\end{tabular}
,
\begin{tabular}{ | c | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~\\
\hline
\cellcolor[gray]{0}&~&\cellcolor[gray]{0}\\
\cline{1-3}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}\\
\cline{1-1}
\end{tabular}
}_{\text{Left player options}}
\;\middle|\;
\underbrace{
\begin{tabular}{ | c | c | c | c | c |}
\hline
~&\cellcolor[gray]{0}&~&\cellcolor[gray]{0}&~\\
\hline
\cellcolor[gray]{0}&~\\
\cline{1-2}
~&\cellcolor[gray]{0}\\
\cline{1-2}
\cellcolor[gray]{0}&~\\
\cline{1-2}
\end{tabular}
}_{\text{Right player options}}
\right\}
$
\captionof{figure}{Example of a pomax game on a chess-colored Young diagram.}
\label{fig:youngpomax}
\end{figure}
It has been shown that all pomax games are integer valued\cite{j2013}, that it is easy to determine the value of pomax games played on trees or on chess-colored Young diagrams\cite{j2013} and that the problem of determining the winner of an arbitrary pomax game is \textsf{PSPACE}-complete\cite{js2014}.
\\\\
This thesis will focus on partizan poset games without the constraint of only being able to remove maximal elements, i.e., more similar to the gameplay of the regular poset games, only played on a colored poset. An illustrative example of this type of game is provided in Example \ref{ex:game}.


\graphicspath{{Pics/}}

\newpage\section{Projective Geometry}

\begin{myitemize}
    \item \href{https://math.mit.edu/~notzeb/cross.pdf}{Cross Ratio - Zarathustra Brady}
    \item \href{https://artofproblemsolving.com/community/q2h1509866p8957048}{Desargues'
        Involution Theorem - MarkBcc168}
\end{myitemize}

\subsection{Definitions}

\den{Projective Plane}{
    The \emph{projective plane} $ \mathbb{P}^2 $ is a \textit{set of lines}
    passing through an observation point $ O $ in three dimensional space. A
    \emph{porjective line} is a plane passing through $ O $, and a
    \emph{projective point} is a line passing throught $ O $.
}

\den{Coordinates in Projective Planes}{
    A point in a projective plane $ \mathbb{P}^2 $ has coordinates $ (p: q: r) $.
    If $ r=0 $, we say that the point is an \emph{infinite point}. Every line in $
    \mathbb{P}^2 $ can also be described with $ (p:q:r) $ in a sense that this
    line (which is a plane passing through $ O $) has the equation \[pa+qb+rc=0\]
}

\den{Projection}{
    We can define \emph{projection} of $ \mathbb{P}^2 $ on some plane $ A^2 $
    not passing through $ O $ (for simplicity we will take the plane $ z=1 $)
    by associating
    \[ P=(p:q:r)\in \mathbb{P}^2 \to P'=\left(\dfrac{p}{r}:\dfrac{q}{r}:1\right)\in A^2 \]
    If $ r=0 $, then we say $ P' $ is an infinite point with slope $ \dfrac{q}{p} $.

    A projective line $ l $ with coordinates $ p:q:r $ gets associated to a line $
    l\in A^2 $ likewise. The line at infinity is the line associated with the
    projective line passing through $ O $ and parallel to $ A^2 $.
}

\den{Projective Line and Inversive Plane}{
Every point in a \emph{projective line} $ \mathbb{P}^1 $ has a coordinate $
(s:t) $ which corresponds to the ordinary point $ x=\dfrac{s}{t} $. The point
at infinity will have $ t=0 $. If we let $ s, t $ be complex numbers then the
projective line is called the \emph{inversive plane}.
}

\den{Cross Ratio}{
    If four points $ A, B, C, D $ lie on a line, their \emph{cross ratio} is defined as
    \[(A, B; C, D) = \frac{AC}{BC}\div \frac{AD}{BD}\]
    If four lines $ l_1, l_2, l_3, l_4 $ pass through a point, then their cross ratio is

    \[(l_1, l_2; l_3, l_4) = \frac{\sin\angle l_1l_3}{\sin\angle
    l_2l_3}\div\frac{\sin\angle l_1l_4}{\sin\angle l_2l_4}\]

    If four points on the inversive plane has the complex coordinate $ a, b,
    c, d $, then the cross ratio is defined by
    \[(A, B; C, D) = \frac{a-c}{b-c}\div \frac{a-d}{c-d}\]
}

\den{Möbius Transformation}{
    A \emph{Möbius Transformation} is defined by a transformation $ f_M $ of
    the inversive plane by a two by two matrix
    $ \begin{pmatrix}
        a & b \\
        c & d
    \end{pmatrix} $
    with non zero determiant as followed:
    \[(s:t) \in \mathbb{P}^1 \to (sa+tb\ :\ sc+td)\]

    Which is in ordinary coordinates:
    \[f_M(z) = \frac{az+b}{cz+d}\]

    A Möbius transformation can be thought as a \textit{matrix transformation} of
    the projective line	(which can be thought as a plane) and then projection on
    an ordinary line.
}

\den{Harmonic Conjugate Map}{
    For any points $ A, B $ on $ \mathbb{P}^1 $, we define
    \[h_{A, B}(C) = D \text{ if } (A, B; C, D) = -1 \]
    A harmonic cojugate is a Möbius transformation. And a Möbius
    transformation that is also an \emph{involution}, i.e. that has $
    f(f(x))=x $, is a harmonic conjugate.
}

\den{Circle Points}{
    The circle points are the points in $ \mathbb{P}^2 $ with coordinates $
    \a=(1:i:0) $ and $ \a'=(-i:1:0) $. These two points are both infinite and
    imaginary. And \emph{every circle} passes through these two points.
}

\den{Coharmonic Points}{
    Three pairs of points $ \{A, A'\}, \{C, C'\}, \{E, E'\} $ on the same line
    are called \emph{coharmonic points} iff there exists a pair of points $
    \{M, N\} $ on the line such that
    \[(M, N; A, B) = (M, N;C, D) = (M, N; E, F)=-1\]
}

\den{Involution}{
    If there exists a point $ X $ on $ l $ such that for the Möbius Transformation
    $ f:l\to l $, such that $ f(f(X))=X $, then $ f $ is an \emph{involution}.
}

\theo{}
{Properties of Coharmonic Points}{
    If $ A, B, C, A', B', C' $ lie on a line, no three the same and $A\ne X$,
    then the following are equivalent:

    \begin{enumerate}[itemsep=0pt, left=20pt]
        \item $ \{A,A'\}, \{B, B'\}, \{C, C'\} $ are coharmonic.
        \item There is a Möbius Transformation with $ f(A)=A', f(B)=B',
            f(C)=C' $ which is an involution.
        \item $ (A, A'; B, C)=(A', A; B', C') $\vspace{.5em}
        \item $ \dfrac{AC'}{C'B}\dfrac{BA'}{A'C}\dfrac{CB'}{B'A}=-1 $\vspace{.5em}
        \item $ (A, A'; C, C') = (A, A'; C, B)\ (A, A'; C, B') $
    \end{enumerate}
}

\theo{}
{Invertible Function on a line}{
    If $ f $ is an \emph{invertible function} from a line to itself that is
    defined by some geometric procedure that has no \emph{configuration mess},
    then $ f $ preserves cross ratio, and is a Möbius Transformation. Similarly,
    an invertible Möbius Transformation is an involution on the line.
}

\newpage
\subsection{Cross Ratio}

\vspace{-4em}
\begin{minipage}{.5\linewidth}
    \theo{}
    {Pappus's Hexagon Theorem}{
        Let $ A,B,C $ be on a line, and let $ D,E,F $ be on another line. Let
        $ X=AE\cap BD,Y=BF\cap CE,Z=CD\cap AF $. Then $ X,Y,Z $ are on a line.
    }

    \proof{
        Let $ CD\cap BF=J, DE\cap BD = K $. We have,
        \begin{align*}
            (D, Z;\ J, C) \stackrel{F}{=}\ &(AB\cap FD, A;\ B, C)\\
            \stackrel{C}{=}\ (D, X;\ B, K) \stackrel{Y}{=}\ &(D, XY\cap DC;\ J, C)
        \end{align*}
    }

    \vspace{-2em}

    \theo{}
    {Cross Ratio Equality}{
        Let $ A,B,C,D $ be on a line, and let $ E,F,G,H $ be on another line.
        Let $X=AF\cap BE, Y=BG\cap CF, Z=CH\cap DG$. Then $ X,Y,Z $ are on a
        line if and only if $ (A,B;C,D) = (E,F;G,H) $.
    }

    \vspace{2em}

    \prob{}
    {Isogonal Conjugate and cevians}{}{
        Let $P, Q$ be two points inside $\triangle ABC$. Let $P', Q'$ be the
        isogonal conjugates of $P, Q$. Let $DEF, WUV$ be the
        cevian triangles of $P, Q$. Prove that iff $Q'\in EF$, then $P'\in
        UV$.
    }
\end{minipage}\hfill%
\begin{minipage}{.47\linewidth}
    \vspace{5em}
    \figdf{.9}{pappu_cross}{}
    \vspace{2em}
    \figdf{.8}{pappu_cross_4}{$ (A,B;C,D) = (E,F;G,H) $}
    \figdf{.9}{cross_ratio_joydip_1}{}
\end{minipage}

\newpage
\subsection{Involution}

\theo{}
{Involution on a line}{
    An involution on a line $ l $ is an inversion around some point on $ l $.
}

\theo{}
{Involution on a conic}{
    Let $ f:\mathcal{C}\to \mathcal{C} $ be an
    involution. Let $ f(X)=X' $ for all $ X\in \mathcal{C} $. Then all $ XX' $
    pass through a fixed point $ P $.
}

\begin{solution}[Polar line, Pascal]
    Let $ l $ be the polar line of $ P $ wrt $ \mathcal{C} $. Let $ l' $ be
    the line parallel to $ l $ passing through $ P $. Let $ l'\cap \mathcal{C}
    = \{X, X'\} $. We show that, if $ A, B\in\mathcal{C} $, and $ A', B' $ are
    the second intersection of $ AP, BP $ with $ \mathcal{C} $, then, $ \{A,
    A'\}, \{B, B'\} $ and $ \{X, X'\} $ are coharmonic points wrt $
    \mathcal{C} $, that is, for a point $ Q\in \mathcal{C} $,

    \[(QX, QX'; QA, QB) = (QX', QX; QA', QB')\]

    Let $ XA, XB\cap l = A_1, B_1  $, and $ XA', XB'\cap l = A_1', B_1' $.
    Since the line $ \left(XA\cap X'A', XA'\cap X'A\right) $ is the polar of $
    XX'\cap AA' $, $ X', A', A_1' $ are collinear. Similarly for $ X', B',
    B_1' $. Let $ T $ be the polar point of $ XX' $. \\

    \begin{minipage}{.7\linewidth}
        We have, $ T, XB\cap X'A,\ XA\cap X'B $ collinear by Pascal's theorem
        on hexagon $ XXABX'X' $. Let, $ T' = (T, XB\cap X'A, XA\cap X'B)\cap
        l' $. We have,

        \begin{align*}
            \frac{XT'}{T'X}=\frac{B_1T}{TA_1'}&=\frac{A_1T}{TB_1'}
            \implies \frac{TB_1}{TA_1} = \frac{TA_1'}{TB_1'}
        \end{align*}

        Now, we have
        \begin{align*}
            X(X, X'; A, B) &= (T,\infty; A_1, B_1)&\\[.5em]
                &=\frac{TA_1}{TB_1}=\frac{TB_1'}{TA_1'}&&=(\infty, T; A_1', B_1')\\
                & &&=X(X', X; A', B')
        \end{align*}
    \end{minipage}\hfill%
    \begin{minipage}{.29\linewidth}
        \figdf{}{involution_conic}{}
    \end{minipage}

    \vspace{1em}

    Which concludes the proof.
\end{solution}

\begin{solution}[Inversion]
    First project the conic to a circle, then invert $ \mathcal{C}\to l $
    across a point $ P $ on $ \mathcal{C} $. The goal is to show that for
    every conjugate pair $ X, X' \in \mathcal{C} $ and their image after
    inversion $ X_1, X_1'\in l $, $ \odot PX_1X_1' $ passes through a fixed
    point.
    By \autoref{theorem:Involution on a line}, we know that there is a point $
    K $ on $ l $ that inverts $ X_1 $ to $ X_1' $. So the circles $ PX_1X_1' $
    have radical  axis $ PK $. Which concludes the proof.
\end{solution}

\begin{BoxedTheorem}[Three Conic Law]
    Let $ A, B, C, D $ be any four points, no three on a line. Let $ l $ be a
    line passing through at most one of them. For a point $ P $ on $ l $,
    define $ f(P) = P' $, where $ P' $ is the second intersection of $ l $
    with the conic passing through $ A, B, C, D, P' $. Then $ f $ is an
    involution.\\

    Then for any three points $ X, Y, Z \in l$, $ \{X, f(X)\},\ \{Y, f(Y)\},\
    \{Z, f(Z)\} $ are coharmonic, i.e. $ \{X, f(X)\} $ are conjugate pairs of
    an involution on $ l $,
\end{BoxedTheorem}

\theo{}
{Desargues' Involution Theorem}{
    Let $ ABCD $ be a quadrilateral, let a conic $ \mathcal{C} $ pass through
    $ A, B, C, D $. And let a line $ l $ intersect $ (AB, CD), (AD, BC), (AC,
    BD), \mathcal{C} $ at $ (X_1, X_2), (Y_1, Y_2), (Z_1, Z_2), (W_1, W_2) $.
    Then \[\{X_1, X_2\}, \{Y_1, Y_2\}, \{Z_1, Z_2\}, \{W_1, W_2\}\] are
    \textit{coharmonic points} i.e. they are reciprocal pairs of some
    involution on $ l $.
}
\figdf{.8}{desargues_invo_theorem}{Desargues' Involution Theorem}

\proof{
    Apply the \textit{Three Conic Law} on $ l $ with points $ A, B, C, D $.
}

\theo{}{Degenerate Desargues' Involution: 2 Points}{Let $A, B$, be two points on a conic $\mathcal{C}$, let a line $l$ meet $AB, \mathcal{C}$ and the tangents at $A, B$ to $\mathcal{C}$ at $X, (W_1, W_2), (Y_1, Y_2)$. Then $(X, X), (W_1, W_2), (Y_1, Y_2)$ are reciprocal pairs of an involution on $l$.}

\den{Involution on Pencil}{
    Let $P$ be a point on the plane. Let $\mathcal{L}$ be the set of all line
    containing $P .$ Then $f: \mathcal{L} \rightarrow \mathcal{L}$ is
    an \emph{involution on a pencil} of lines if and only if.

    \begin{enumerate}
        \item For every $\ol{P A}, \ol{P B}, \ol{P C}, \ol{P D} \in
            \mathcal{L},$ we have
            \[(\ol{P A}, \ol{P B} ; \ol{P C}, \ol{P D})=(f(\ol{P A}), f(\ol{PB});
            f(\ol{P C}), f(\ol{P D})) \]
        \item  $f(f(\ell))=\ell$ for every $\ell \in \mathcal{L} .$
            Furthermore, we call a pair $(\ell, f(\ell))$ reciprocal pair.
    \end{enumerate}
}

\theo{}
{Dual of Desargues' Involution Theorem}{
    Let $P, A, B, C, D$ be points on a plane with $\ol{A B} \cap \ol{C D}=E,
    \ol{A D} \cap \ol{B C}=F .$ Let a conic $\mathcal{C}$ tangent to lines $A
    B, C D, A D, B C .$ Let $\ol{P X}, \ol{P Y}$ are the tangent line from $P$
    to $\mathcal{C} .$ Then
    \[(\ol{P X}, \ol{P Y}),(\ol{P A}, \ol{P C}),(\ol{P B}, \ol{P D}),(\ol{P
    E}, \ol{P F})\]
    are reciprocal pairs of some involution on pencil of lines through $P$.
}

\figdf{.8}{dual_desargues}{}

\newpage\subsection{Inversion}

\href{http://artofproblemsolving.com/community/c5h1101224p5015914}{TelvCohl’s $\sqrt bc$ inversion problem collection}

\lem{}{WRT a circle $ \omega $ with center $ O $ the polar of a point $ A $ can be constructed as the radical axis of $ \omega $ and the circle with diameter $ OA $.}

\lem{}{$ \measuredangle (a, b) = \measuredangle AOB $}

\theo{}{Pascal's Theorem for Octagons: A special case}{Let $ ABCDA'B'C'D' $ be a octagon inscribed in a conic section. If the points:

    \[ AD\cap BC,\ AC'\cap BB',\ AD'\cap CA',\ BD'\cap DA',\ DB'\cap CC' \]

    are collinear, then so are the points

    \[ A'D'\cap B'C',\ A'C\cap B'B,\ A'D\cap C'A,\ B'D\cap D'A,\ D'B\cap C'C \]

    \figdf{1}{PG1_OctagonalPascal}{If the small Red points are collinear, then the Blue ones are too.}
}

\theo{}{Inscribed Conic in Pascal's theorem}{$ A_1A_2A_3A_4A_5A_6 $ be a hexagon inscribed in a conic section. Then the hexagon formed by \[A_1A_3\cap A_2A_6,\ A_2A_4\cap A_1A_3,\ A_2A_4\cap A_3A_5,\ A_3A_5\cap A_4A_6,\ A_5A_1\cap A_4A_6,\ A_1A_5\cap A_2A_6\] has an inscribed conic section.}

\prob{}{}{E}{Let $ ABCD $ have an incircle $ (I) $. Let $ (I) $ meet $ AB, BC, CD, DA $ at $ M, N, P, Q $. Let $ K, L $ be the circumcenters of $ AMN, APQ $. $ KL\cap BD = R,\ AI\cap MQ = J $. Prove that $ RA=RJ $.}

\prob{}{}{E}{Let the $A$ mixtilinear incircle $(O)$ of $\triangle ABC$ meet $\odot ABC, AC, AB$ at $P, E, F$. Let $M$ be the $BC$ arc midpoint. Let $\mathcal{H}$ be the conic that goes through $E, F, O, P, M$ meet $\odot ABC$ at $X, Y$. Prove that $AA, XY, EF$ are concurrent.}

\prob{https://artofproblemsolving.com/community/c6h1140471p5353038}{Iran 3rd Round G4}{EM}{Let $ABC$ be a triangle with incenter $I$. Let $K$ be the midpoint of $AI$ and $BI\cap \odot(\triangle ABC)=M, CI\cap \odot(\triangle ABC)=N$. points $P,Q$ lie on $AM,AN$ respectively such that $\angle ABK=\angle PBC,\angle ACK=\angle QCB$. Prove that $P,Q,I$ are collinear.}

\solu{Since we are dealing with collinearity, and usually we use harmonic bundle in these cases to show collinearity. But in this problem, there is no harmonic bundle. So we use cross ratio...}

\gene{http://artofproblemsolving.com/community/c6h1140471p5356029}{Iran 3rd Round G4 Generalized version}{Let $ABC$ be a triangle inscribed in circle $(O)$ and $P,Q$ are two isogonal conjugate points. $PB,PC$ cut $(O)$ again at $M,N$. $QA$ cuts $MN$ at $K$. $L$ is isogonal conjugate of $K$. $LB,LC$ cut $AM,AN$ at $S,T$, resp. Prove that $S,Q,T$ are collinear.}

\lem{}{Too long, can't explain, loot at the figure. The dotted lines go through that concurrency point.
    \figdf{.5}{concurrent_segments_almost_pascal}{Everything concurrs}
}

\lem{Construction of Involution Center on Line}{Given a line $ l $, four points $ A, B, A', B' $ such that $ A, A' $ and $ B, B' $ are two conjugate pairs of some involution i.e. some inversion on $ l $, find the center $ O $ of inversion.}

\newpage\subsection{Problems}

\prob{}{Dunno}{E}{Let $ E, F $ be on the lines $ AC, AB $ of $ \triangle ABC $. Let $ P $ be a point on $ EF $. Let $ Q $ be the intersection of the lines through $ E, F $ and parallel to $ BP $ and $ CP $ respectively. Prove that, as $ P $ moves along $ EF $, $ Q $ moves along a line.}

\solu{[Cross Ratio]
    Let $ X \in BF, Y\in CE $ such that $ \dfrac{BX}{XF} = \dfrac{CE}{EA},\ \dfrac{CY}{YA} = \dfrac{BF}{FA} $. With trivial calculation, we have $ XY\parallel BC $ We show that $ Q, X, Y $ are collinear. For that we will show $ FU\parallel EV $ where $ U=BP\cap XY, V=CP\cap XY $. And by reverse Pappu's theorem on $ FPE, UQV $, we will have $ U,Q,V $ collinear. \\

    \begin{minipage}{.5\linewidth}
        Let $ K, L = BP, CP\cap XY $. Also, $ S = BC\cap EF $. Then we have,
        \[(S, P; F, E) \stackrel{B}{=} (\infty, U; X, K) \stackrel{C}{=} (\infty, V; L, Y)\]
        \[\implies \frac{XU}{UK} = \frac{LV}{VY}\]

        But we have,
        \begin{align*}
            \frac{FX}{XB} = \frac{FL}{LC} = \frac{AE}{EC}
        \end{align*}
    \end{minipage}\hfill%
    \begin{minipage}{.5\linewidth}
        \figdf{}{mine_(maybe)_1}{}
    \end{minipage}

    \vspace{1em}

So, $ FX\parallel EL $, and similarly, $ FK\parallel EY $. So by similarity, we have $ FU\parallel EV $.}

\begin{minipage}{.6\linewidth}
    \lem{Conic through orthocenter and vertices}{Let $ ABCD $ be a quadrilateral. Let $ G, H $ be the orthocenters of $ \triangle ABC $ and $ \triangle DBC $. Then $ A, B, C, D, G, H $ all lie on a conic.}

    \proof{
        Since $ line(AC\cap BD, BG\cap CH) $ is perpendicular to $ BC $, we have $ AG\cap DH, AC\cap BD, BG\cap CH  $ collinear. So by reverse Pascal's theorem, $ A, D, G, H, B, C $ lie on a conic.
    }
\end{minipage}\hfill%
\begin{minipage}{.35\linewidth}
    \figdf{}{orthocenters_on_conic}{}
\end{minipage}

\lem{Orthogonal Hyperbola}{Let $ H $  be the orthocenter of $ ABC $. Let $ \mathcal{C} $ be a conic through $ A, B, C, H $. If $ XYZ $ is a triangle with vertices in $ \mathcal{C} $, then the orthocenter $ W $ of $ XYZ $ lies also on $ \mathcal{C} $. Also, the asymptotes of $ \mathcal{C} $ are orthogonal.}

\solu{
    As in \autoref{lemma:Conic through orthocenter and vertices}, the orthocenter ot $ XBC $ lies on $ \mathcal{C} $ too. So the orthocenter of $ XYC $ lies on $ \mathcal{C} $ and so does the orthocenter of $ XYZ $.\\

    Now we show that asymptotes of $ \mathcal{C} $ are orthogonal.\\

    Let the two infinity points on $ \mathcal{C} $ be $ s, t $. Consider the triangle $ Ast $. Let its orthocenter be $ B $. Then we have, $ tB\perp sA $. But $ tB $ is parallel to the asymptote through $ t $ and $ sA $ is parallel to the asymptote through $ s $. So the asymptotes themselves are orthogonal.

    \figdf{.5}{orthogonal_hyperbola}{Hyperbola through $ A, B, C, H $}
}

\prob{}{Canada 1994}{E} {Let $ABC$ be an acute triangle. Let $AD$ be the altitude on $BC$, and let $H$ be any interior point on $AD$. Lines $BH,CH$, when extended, intersect $AC,AB$ at $E,F$ respectively. Prove that $\angle EDH=\angle FDH$.}

\solu{$EF$ intersects $BC$ at $R$.

	Through Ceva and Menelaus, we know that $(R, AD \cap EF; E, F) = -1$.
	Let's define $AD \cap  EF = M$.
	\[\]

	Notice that, $\angle MDR = 90 ^ \circ$. and as we have a $(R, M, E, F)$ is a harmonic bundle, we can say that $MD$ bisects $\angle EDF$.
}

\prob{}{JMO 2011/5}{}{Points $A,B,C,D,E$ lie on a circle $\omega$ and point $P$ lies outside the circle. The given points are such that (i) lines $PB$ and $PD$ are tangent to $\omega$, (ii) $P, A, C$ are collinear, and (iii) $DE \parallel AC$. Prove that $BE$ bisects $AC$.
}{}

\solu{Proving that the cross ration of $(A, C; M, AC \cap DF) = - 1$ is enough to prove that $M$ is the midpoint of segment $AC$. ($BE$ intersects $AC$ at $M$). Projecting from $E$ sends the points to $A, C, B, D$. And from the definition we know that $ACBD$ is a harmonic quad. So, $(A, C; M, P_{\infty}) = -1$

}


\documentclass[12pt]{cdblatex}
\usepackage{exercises}
\usepackage{fancyhdr}
\usepackage{footer}

\begin{document}

% --------------------------------------------------------------------------------------------
\section*{Exercise 2.4 Combining rules -- a problem}

\begin{cadabra}
   {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u#}::Indices(position=independent).

   \nabla{#}::Derivative.
   \partial{#}::PartialDerivative.

   # rules for covariant derivatives of v

   deriv1 := \nabla_{a}{v^{b}} -> \partial_{a}{v^{b}}
                                + \Gamma^{b}_{d a} v^{d}.

   deriv2 := \nabla_{a}{\nabla_{b}{v^{c}}} -> \partial_{a}{\nabla_{b}{v^{c}}}
                                            + \Gamma^{c}_{d a} \nabla_{b}{v^{d}}
                                            - \Gamma^{d}_{b a} \nabla_{d}{v^{c}}.

   # attempt to combine both rules for second covariant derivative of v

   substitute (deriv2,deriv1)       # cdb (ex-0204.101,deriv2)

\end{cadabra}

\vskip 1cm

Note that the call to \verb|substitute| has made changes to both sides of the rule for
\verb|deriv2|. This is not ideal and a better method is developed in the following exercise.

\begin{align*}
   \Cdb{ex-0204.101}
\end{align*}

\end{document}


\documentclass[letterpaper]{article}

\usepackage[utf8x]{luainputenc}
\usepackage{aeguill}
%\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{fullpage}
\usepackage{fancyhdr}
\setlength{\headheight}{12pt}
\pagestyle{fancy}
\chead{Linear Algebra}
\lhead{October 19, 2015}
\rhead{Jon Allen}
\allowdisplaybreaks

\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

\begin{document}
%\renewcommand{\labelenumii}{\alph{enumii}.}
%\renewcommand{\labelenumiii}{\alph{enumiii}.}
%\renewcommand{\labelenumi}{(\arabic{enumi})}
\section*{3.2}
\begin{enumerate}
\setcounter{enumi}{1}
\item
Find Null($A$), Row($A$), Null($A^T$), Col($A$) for
  \begin{enumerate}
  \item
  \[
  A=
  \left[\begin{array}{rr}
    3&-1\\
    6&-2\\
    -9&3
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rr}
    3&-1\\
    0&0\\
    0&0
  \end{array}\right]
  \]
  So Null($A$)=Span((1,3)) and Row($A$)=Span((3,-1))
  \[
  A^T=
  \left[\begin{array}{rrr}
    3&6&-9\\
    -1&-2&3
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rrr}
    1&2&-3\\
    0&0&0
  \end{array}\right]
  \]
  So Null($A^T$)=Span((-2,1,0),(3,0,1)) and Col(A)=Span((1,2,-3))
  \end{enumerate}
\item
Find Null($A$), Row($A$), Null($A^T$), Col($A$) for
  \begin{enumerate}
  \setcounter{enumii}{2}
  \item
  \[
  A=
  \left[\begin{array}{rrr}
    1&1&1\\
    1&2&0\\
    1&1&1\\
    1&0&2\\
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rrr}
    1&1&1\\
    0&1&-1\\
    0&0&0\\
    0&-1&1\\
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rrr}
    1&0&2\\
    0&1&-1\\
    0&0&0\\
    0&0&0\\
  \end{array}\right]
  \]
  So Row(A)=Span((1,0,2),(0,1,-1)) and Null(A)=Span((-2,1,1))
  \[
  A^T=
  \left[\begin{array}{rrrr}
    1&1&1&1\\
    1&2&1&0\\
    1&0&1&2\\
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rrrr}
    1& 1&1& 1\\
    0& 1&0&-1\\
    0&-1&0& 1\\
  \end{array}\right]
  \Rightarrow
  \left[\begin{array}{rrrr}
    1& 0&1& 2\\
    0& 1&0&-1\\
    0& 0&0& 0\\
  \end{array}\right]
  \]
  So Col(A)=Span((1,0,1,2),(0,1,0,-1)) and Null($A^T$)=Span((-1,0,1,0),(-2,1,0,1))
  \end{enumerate}
\setcounter{enumi}{5}
\item
  \begin{enumerate}
  \item
  Construct a matrix whose column space contains [1,1,1] and [0,1,1] and whose nullspace contains [1,0,1]and [0,1,0], or explain why none can exist.

  If we know the matrix is $3\times 3$ and because $[0,1,0]$ is in the nullspace then the center column must be all zeroes. And because $[1,0,1]$ is in the nullspace then the first column is equal to the negative of the last column. So the column space of our vector is Span((1,1,1)). But $[0,1,1]$ is not in this form so we cannot construct such a matrix.
  \item
  Construct a matrix whose column space contains $[1,1,1]$ and $[0,1,1]$ and whose nullspace contains $[1,0,1,0]$ and $[1,0,0,1]$, or explain why none can exist.

  \[\left[\begin{array}{rrrr}1&0&-1&-1\\1&1&-1&-1\\1&1&-1&-1\end{array}\right]\]
  \end{enumerate}
\item
  Let $A=\left[\begin{array}{rrr}1&1&0\\1&1&0\\0&1&1\end{array}\right]$ and $B=\left[\begin{array}{rrr}1&1&0\\-1&-1&0\\0&-1&-1\end{array}\right]$
  \begin{enumerate}
  \item
  Give $\mathbf{C}(A)$ and $\mathbf{C}(B)$. Are they lines, planes or all of $\mathbb{R}^3$?

  \begin{align*}
    A^T&=
    \left[\begin{array}{rrr}
      1&1&0\\
      1&1&1\\
      0&0&1\\
    \end{array}\right]
    &&\Rightarrow
    \left[\begin{array}{rrr}
      1&1&0\\
      0&0&1\\
      0&0&0\\
    \end{array}\right]\\
    B^T&=
    \left[\begin{array}{rrr}
      1&-1& 0\\
      1&-1&-1\\
      0& 0&-1\\
    \end{array}\right]
    &&\Rightarrow
    \left[\begin{array}{rrr}
      1&-1& 0\\
      0& 0& 1\\
      0& 0& 0\\
    \end{array}\right]
  \end{align*}
  So $\mathbf{C}(A)=\text{Span}([1,1,0],[0,0,1])$ and $\mathbf{C}(B)=\text{Span}([1,-1,0],[0,0,1])$ which are both planes.
  \item
  Describe $\mathbf{C}(A+B)$ and $\mathbf{C}(A)+\mathbf{C}(B)$. Compare your answers.

  This question is confusing to me. It is asking me to compare a set with two sets under a binary operation, but doesn't really define what the operation is. I don't think it's a direct sum. I guess it's either a union,  or the sum of any two elements from each set.

  First I guess we will figure out what $\mathbf{C}(A+B)$ is.
  \[
  (A+B)^T=
  \left[\begin{array}{rrr}2&2&0\\0&0&0\\0&0&0\end{array}\right]^T
  =\left[\begin{array}{rrr}2&0&0\\2&0&0\\0&0&0\end{array}\right]
  \Rightarrow\left[\begin{array}{rrr}1&0&0\\0&0&0\\0&0&0\end{array}\right]
  \]
  \end{enumerate}
  So $\mathbf{C}(A+B)=\text{Span}([1,0,0])$, which is a line.

  Now $a[1,1,0]\ne b[1,-1,0]\forall a,b\in \mathbb{R}$ and so $\mathbf{C}(A)$ and $\mathbf{C}(B)$ are not the same planes, but they both contain $[0,0,1]$ and so they are nonparallel and intersecting. So $\mathbf{C}(A)\cup\mathbf{C}B)$ is two nonparallel planes.

  Now as we have noted, $[1,1,0]$ and $[1,-1,0]$ are linearly independent. Obviously these are both idependant to $[0,0,1]$ and so these three vectors form a basis for $\mathbb{R}^3$. Thus we can represent any element of $\mathbb{R}^3$ as a linear combination of these vectors, which in turn means that we can represent any $x\in \mathbb{R}^3$ as $x=u+v$ where $u\in \mathbf{C}(A)$ and $v\in \mathbf{C}(B)$.
\item
  \begin{enumerate}
  \item
  Construct a $3\times 3$ matrix $A$ with $\mathbf{C}(A)\subset \mathbf{N}(A)$.

  \[A=\left[\begin{array}{rrr}1&-1&0\\1&-1&0\\0&0&0\end{array}\right]\]
  \item
  Construct a $3\times 3$ matrix $A$ with $\mathbf{N}(A)\subset \mathbf{C}(A)$.

  \[A=\left[\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array}\right]\]
  \item
  Do you think there can be a $3\times 3$ matrix $A$ with $\mathbf{N}(A)=\mathbf{C}(A)$? Why or why not?

  There can't. $\dim \mathbf{N}(A)=3-\text{rank } A=3-\mathbf{R}(A)=3-\mathbf{C}(A)$. And so because $3$ is odd then the nullspace and the column space can't have the same dimension, and so can't be the same.
  \item
  Construct a $4\times 4$ matrix $A$ with $\mathbf{C}(A)=\mathbf{N}(A)$.

  \[A=\left[\begin{array}{rrrr}1&-1&0&0\\1&-1&0&0\\0&0&1&-1\\0&0&1&-1\end{array}\right]\]
  \end{enumerate}
\setcounter{enumi}{9}
\item
Let $A$ be an $m\times n$ matrix and $B$ be an $n\times p$ matrix. Prove that
  \begin{enumerate}
  \item
  $\mathbf{N}(B)\subset\mathbf{N}(AB)$

  We take any $\mathbf{x}\in \mathbf{N}(B)$. Then $B\mathbf{x}=\mathbf{0}$ and $AB\mathbf{x}=A\mathbf{0}=\mathbf{0}$. And so $\mathbf{x}\in \mathbf{N}(AB)$

  \item
  $\mathbf{C}(AB)\subset\mathbf{C}(A)$

  We choose some $\mathbf{b}\in \mathbf{C}(AB)$. We know that $\mathbf{b}=(AB)\mathbf{x}$ for some $\mathbf{x}\in \mathbb{R}^p$. But then $(AB)\mathbf{x}=A(B\mathbf{x})$ and so $\mathbf{b}\in \mathbf{C}(A)$ also by proposition 2.1 and so we are done.
  \item
  $\mathbf{N}(B)=\mathbf{N}(AB)$ when $A$ is $n\times n$ and nonsingular

  If $A$ is nonsingular than it is invertible. And so if we have $AB\mathbf{x}=\mathbf{0}$ then we also have $A^{-1}AB\mathbf{x}=A^{-1}\mathbf{0}$ or $B\mathbf{x}=\mathbf{0}$. Thus if $\mathbf{x}\in \mathbf{N}(AB)$ then $\mathbf{x}\in \mathbf{N}(B)$. We already did the reverse containment in part a
  \item
  $\mathbf{C}(AB)=\mathbf{C}(A)$ when $B$ is $n\times n$ and nonsingular

  We choose some $\mathbf{b}\in \mathbf{C}(A)$. Then $\mathbf{b}=A\mathbf{x}$ for some $\mathbf{x}\in \mathbb{R}^n$. And so $\mathbf{b}=ABB^{-1}=AB(B^{-1}x)$. Because $B^{-1}\mathbf{x}$ exists, then $\mathbf{b}$ is in $\mathbf{C}(AB)$. The reverse containment was done above.
  \end{enumerate}
\item
Let $A$ be an $m\times n$ matrix. Prove that $\mathbf{N}(A^TA)=N(A)$

If $A\mathbf{x}=\mathbf{0}$ then $A^TA\mathbf{x}=A^T\mathbf{0}=\mathbf{0}$ and so $\mathbf{N}(A)\subset \mathbf{N}(A^TA)$. Now from 2.5.15 we know that if $A^TA\mathbf{x}=\mathbf{0}$ then $A\mathbf{x}=\mathbf{0}$ and so $\mathbf{N}(A^TA)\subset \mathbf{N}(A)$.
\item
Suppose $A$ and $B$ are $m\times n$ matrices. Prove that $\mathbf{C}(A)$ and $\mathbf{C}(B)$ are orthogonal subspaces of $\mathbb{R}^m$ if and only if $A^TB=O$

If $\mathbf{C}(A)$ and $\mathbf{C}(B)$ are orthogonal subspaces, then $\text{row}_i(A^TB)=\text{row}_i(A^T)B=\text{col}_i(A)B=[\text{col}_i(A)\cdot\text{col}_1(B),\dots,\text{col}_i(A)\cdot\text{col}_n]=\mathbf{0}$. Similarly, if they are not orthogonal subspaces, then there must exist some $k,l$ such that $\text{col}_k(A)\cdot\text{col}_l(B)\ne 0$. But then $\text{row}_k(A^T)\cdot\text{col}_l(B)=\text{elem}_kl(A^TB)\ne 0$. And so then $A^TB\ne O$.
\item
Suppose $A$ is an $n\times n$ matrix with the property that $A^2=A$.
  \begin{enumerate}
  \item
  Prove that $\mathbf{C}(A)=\{\mathbf{x}\in \mathbb{R}^n:\mathbf{x}=A\mathbf{x}\}$.

  If $\mathbf{x}=A\mathbf{x}$ then $\mathbf{x}\in \mathbf{C}(A)$ by Theorem 4. Let us choose $\mathbf{b}\in \mathbf{C}(A)$. Then we know that $\mathbf{b}=A\mathbf{x}$ for some $\mathbf{x}$. Now because $A^2=A$ then $A\mathbf{b}=A^2\mathbf{x}=A\mathbf{x}$. But $A\mathbf{x}=\mathbf{b}$ and so $\mathbf{b}=A\mathbf{b}$. Thus if $\mathbf{b}\in \mathbf{C}(A)$ then $\mathbf{b}\in \{\mathbf{x}\in \mathbb{R}^n:\mathbf{x}=A\mathbf{x}\}$ and so we have equality.
  \item
  Prove that $\mathbf{N}(A)=\{\mathbf{x}\in \mathbb{R}^n:\mathbf{x}=\mathbf{u}-A\mathbf{u}\text{ for some }\mathbf{u}\in \mathbb{R}^n\}$.

  If $\mathbf{x}=\mathbf{u}-A\mathbf{u}$ then $A\mathbf{x}=A(\mathbf{u}-A\mathbf{u})=A\mathbf{u}-A^2\mathbf{u}=A\mathbf{u}-A\mathbf{u}=\mathbf{0}$ and so $\mathbf{x}\in \mathbf{N}(A)$. Now if $\mathbf{x}\in \mathbf{N}(A)$ then $A\mathbf{x}=\mathbf{0}$. Obviously $A\mathbf{0}=\mathbf{0}$ and so $A\mathbf{x}=\mathbf{0}-A\mathbf{0}$ and so $\mathbf{x}\in \{x\in \mathbb{R}^n:\mathbf{x}=\mathbf{u}-A\mathbf{u}\}$. Thus we have equality.
  \item
  Prove that $\mathbf{C}(A)\cap\mathbf{N}(A)=\{\mathbf{0}\}$.

  Let us choose some $\mathbf{b}\in \mathbf{C}(A)$ such that $\mathbf{b}\ne \mathbf{0}$. Now then we know that $\mathbf{b}=A\mathbf{x}$ for some $\mathbf{x}$. And because $A=A^2$ then $A\mathbf{b}=A\mathbf{x}$. But because $\mathbf{b}\ne \mathbf{0}$ then $A\mathbf{x}\ne0$ and $A\mathbf{b}\ne 0$. Thus $\mathbf{b}\ne 0$ and so $\mathbf{b}\not\in \mathbf{N}(A)$. It is obvious that $\mathbf{0}$ is in the span of any set of vectors, including $\mathbf{C}(A)$. Just as obviously $A\mathbf{0}=\mathbf{0}$ and so $\mathbf{0}\in \mathbf{C}(A)\cap \mathbf{N}(A)$. And so we have our proof.
  \item
  Prove that $\mathbf{C}(A)+\mathbf{N}(A)=\mathbb{R}^n$.

  We choose any $\mathbf{x}\in \mathbb{R}^n$. Then $A\mathbf{x}\in \mathbf{C}(A)$ and $\mathbf{x}-A\mathbf{x}\in \mathbf{N}(A)$. And so $\mathbf{x}-A\mathbf{x}+A\mathbf{x}=\mathbf{x}$. Thus any element of $\mathbb{R}^n$ can be written as the sum of elements in $\mathbf{N}(A)$ and $\mathbf{C}(A)$.
  \end{enumerate}
\end{enumerate}
\section*{2.5}
\begin{enumerate}
\setcounter{enumi}{14}
\item
Suppose $A$ is an $m\times n$ matrix and $\mathbf{x}\in \mathbb{R}^n$ satisfies $(A^{T}A)\mathbf{x}=\mathbf{0}$. Prove that $A\mathbf{x}=\mathbf{0}$.

If $A^TA\mathbf{x}=\mathbf{0}$ then $(A^TA\mathbf{x})\cdot\mathbf{x}=\mathbf{0}$. This leads to $A^T(A\mathbf{x})\cdot\mathbf{x}=(A\mathbf{x})\cdot A\mathbf{x}=||A\mathbf{x}||^2=0$. This means that $A\mathbf{x}$ must be $\mathbf{0}$
\end{enumerate}
\end{document}


\section{Additional analysis of calibration convergence}

In the main analysis described above, each of the seven chains of the adaptive Metropolis algorithm was initialised by adding random noise around parameter values obtained from a previous calibration. This approach was used to assist the algorithm to reach the parameter space's high posterior areas within a reasonable number of iterations. The high number of dimensions ($N=18$) made other approaches such as Latin-Hypercube-based initialisation impractical, as chains could take millions of iterations before adequately sampling plausible parameter sets.

In a separate experiment, we ran another adaptive Metropolis algorithm where only ten parameters were varied, but this time initialisation was performed with Latin Hypercube Sampling (LHS) across ten independent chains. The ten parameters were selected based on their expected influence on the main findings and whether they were among the primary estimands of interest (e.g. the face coverings effect parameter). The remaining eight parameters were fixed to the maximum a-posteriori value obtained in the main analysis. The aim of this analysis was to verify that the calibration algorithm could recover similar convergence to that obtained in the main analysis despite starting from highly diverse initial points.

Figures \ref{fig:lhs_experiments_likelihood} and \ref{fig:lhs_experiments_traces} illustrate the progression of the parameters during this experiment. The parameter traces were compared against the posterior distributions obtained from the main analysis (Figure \ref{fig:lhs_experiments_traces}). We found that the chains converged to similar values when considering the LHS-based calibration compared to the original analysis. The posterior ranges obtained with the LHS-based analysis were sometimes slightly narrower compared to the original calibration. This is attributable to the fact that more parameters were fixed throughout calibration in the LHS-based calibration than in the original calibration. Consequently, more constraints were imposed on the varied parameters that were previously found to be correlated with parameters that have been fixed in the LHS-based analysis.

\begin{figure}[ht]
    \resizebox{1\textwidth}{!}{\includegraphics[scale=1]{../covid_19/projects/victoria/lhs_experiments/likelihood_against_params.png}}
    \caption{\textbf{
	Likelihood against ten key parameters during calibration initialised with Latin Hypercube Sampling.
    }
The different colours represent the ten independent adaptive Metropolis chains initialised with Latin Hypercube Sampling. The likelihood values were transformed to increase clarity using $x \rightarrow -log(-log(x) + m + 1)$, where $m$ is the maximum log-likelihood value. The pink stars highlight the starting points.
    }
    \label{fig:lhs_experiments_likelihood}
\end{figure}

\begin{figure}[ht]
    \resizebox{1\textwidth}{!}{\includegraphics[scale=1]{../covid_19/projects/victoria/lhs_experiments/lhs_start_traces_median.png}}
    \caption{\textbf{Parameter progression traces during calibration initialised with Latin Hypercube Sampling.} The horizontal lines represent the median (solid line) and 95\% credible interval (dotted lines) of the posterior estimates obtained in the main analysis.}
    \label{fig:lhs_experiments_traces}
\end{figure}


\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{mathtools,amssymb,stackengine}

\begin{document}

\chapter{Transformation}

\section{Matrix transformations}
Objectives:
\begin{enumerate}
    \item Learn to view a matrix geometrically as a function
    \item Learn example of matrix transformations: reflection, dilation, rotation, shear, projection
    \item Understand vocabulary surrounding transformation: domain, codomain, range.
    \item Understand domain, codomain, and range of a matrix transformation.
    \item Pictures: common matrix transformations.
    \item Vocabulary words: transformation/function, domain, codomain, range, identity transformation, matrix transformation.
\end{enumerate}

Objectives:
\begin{enumerate}
    \item Learn how to verify that a transformation is linear, prove that a transformation is not linear.
    \item Understand the relationship between linear transformations and matrix transformations.
    \item Recipe: Compute the matrix of linear transformation.
    \item Theorem: linear transformations and matrix transformations
    \item Notation: the stand of coordinate vector
    \item Vocabulary words: linear transformation, standard matrix, identity matrix
  \end{enumerate}

In mathematics, a linear transformation (also called linear mapping) is a mapping $\mathbb{W} \to \mathbb{V}$ between two modules (for example, two vector spaces) that preserves the operation of addition and scalar multiplication.

\end{document}


\chapter{Reinforcement Learning}

In this section, we introduce deep reinforcement learning (RL) instead of the classical one, for which one may refer to \emph{Reinforcement Learning: An Introduction} by Sutton.

As for deep RL, \emph{Tutorial on Deep Reinforcement Learning, decision making, and control} in International Conference on Machine Learning(ICML) 2017 is a nice reference.

\section{The Framework of Reinforcement Learning}

We introduce the basic framework of RL with the descriptions in TRPO. This is a general framework adopted in reinforcement learning, which formulates the conception that an agent interacts with the environment, and learns how to get more rewards by modifying its policy.

Consider an infinite-horizon discounted Markov decision process(MDP):
\begin{itemize}
    \item  $\mathcal{S}$ is a finite set of states, $s\in\mathcal{S}$
    \item $ \mathcal{A}$ is a finite set of actions, $a\in\mathcal{A}$
    \item $\mathcal{P}$ is the transition probability distribution, $\mathcal{P}_{ss'}^{a}:=P(s'|s,a)$
    \item $r$ is a one step reward function, $r(s,a,s')$,or $r(s)$
    \item $\gamma\in[0,1]$ is a discount factor
\end{itemize}

The agent can then interact with the environment. At time step $t$, it receives an observation $s_t$(it should be $o_t$, whereas $s_t$ is the true state, but here we identify them for simplicity), and adopts an action $a_t$ from the policy $\pi$, then the environment replies a new state $s_{t+1}$ and a reward $r_t$.

\begin{center}
\includegraphics[width=\textwidth]{RLEnv}
\end{center}

As a result, the agent generates a \emph{path} $p=(s_0,a_0,r_0,s_1,\cdots)$.

Based on these notions, we mainly consider the following special functions.
\begin{enumerate}
\item
The expected discounted reward $\eta(\pi)=\mathbb{E}_{s_0, a_0, \cdots}\left[\sum_{t=0}^\infty \gamma^l r(s_t)\right]$
\item
The state-action value function $Q(s_t,a_t)=\mathbb{E}_{s_{1+t},a_{t+1},\cdots}[\sum_{l=0}^\infty\gamma^lr(s_{t+l})]$, which represents the value of the state-action pair $(s,a)$.
\item
The value function $V_{\pi}(s_t)=\mathbb{E}_{a_t,s_{t+1},a_{t+1},\cdots}[\sum_{l=0}^\infty\gamma^lr(s_{t+l})]$, which represents the value of the state $s$.
\item
The advance function $A_\pi(s,a)=Q_{\pi}(s,a)-V_\pi(s)$, which represents the advantage of the action $a$ against the mean value.
\end{enumerate}

One important connection between two distinct policies $\pi$, $\tilde\pi$ is
$$\eta(\tilde\pi)=\eta(\pi)+\mathbb{E}_{s_0,a_0,\cdots|\tilde\pi}[\sum_{t=0}^\infty\gamma^tA_\pi(s_t,a_t)].$$

It has a corollary,
$$ \eta(\tilde\pi)=\eta(\pi)+\sum_s\rho_{\tilde\pi(s)}\sum_a\tilde\pi(a|s)A_{\pi}(s,a)
$$
where
$$ \rho_\pi(s)=P(s_0=s)+\gamma P(s_1=s)+\gamma^2P(s_2=s)+\cdots.
$$
To get this equation, one only need to transform from the last term. We will show the proof later.

Finally, our aim is to find a stochastic policy $\pi(a|s)$ that maximizes the expected discounted reward
\begin{align*}
\max_{\pi}\eta(\pi)=\mathbb{E}_{\pi}(\sum_{t=0}^{\infty}\gamma^{t}r(s_{t}))
\end{align*}
where $s_{0}\sim P_{0}$, $a_{t}\sim \pi(\cdot|s_{t})$, and $s_{t+1}\sim P(\cdot|s_{t},a_{t})$.

\section{The Vanilla Policy Gradient Method}
We  now briefly summarize a classical training algorithm, also known as the \emph{vanilla}(means \emph{plain}) policy gradient(VPG) method.

Suppose the policy $\pi$ is parametrized by $\theta$, denoted as $\eta=\eta_{\theta}$, and the time is limited by $T$. With the likelihood ratio trick, the gradient of $\eta_{\theta}$ can be written as
\[\nabla_{\theta}\eta(\theta)=\mathbb{E}\left[ \left(\sum_{t=0}^T \gamma^tr(s_t,a_t)\right)\left(\sum_{t=0}^T \nabla_{\theta}\log\pi_{\theta}(a_t|s_t)\right)  \right].\]

Notice that for $t'<t$, we have
\begin{align*}
	&\mathbb{E}[r(s_{t'},a_{t'})\nabla_{\theta}\log\pi_{\theta}(a_t|s_t))]\\
	=&\nabla_{\theta}\mathbb{E}[r(s_{t'},a_{t'})\log\pi_{\theta}(a_t|s_t))]\\
	=&\nabla_{\theta}\mathbb{E}[r(s_{t'},a_{t'})]\\
	=&0.
\end{align*}
We can then reduce the gradient to
\[\nabla_{\theta}\eta(\theta)=\mathbb{E}\left[ \left(\sum_{t'=t}^T \gamma^{t'}r(s_{t'},a_{t'})\right)\left(\sum_{t=0}^T \nabla_{\theta}\log\pi_{\theta}(a_t|s_t)\right)  \right].\]
In practical, we often cut off the extra $\gamma$ in the above formula, and get
\[\nabla_{\theta}\eta(\theta)=\mathbb{E}\left[ \left(\sum_{t'=t}^T \gamma^{t'-t}r(s_{t'},a_{t'})\right)\left(\sum_{t=0}^T \nabla_{\theta}\log\pi_{\theta}(a_t|s_t)\right)  \right].\]
Based on this formula, the empirical policy gradient can be written as
\[\widehat{\nabla_{\theta}\eta_{\theta}}=\frac{1}{NT}\sum_{i=1}^N\sum_{t=0}^{T-1}\nabla_{\theta}\log\pi_{\theta}(a_t|s_t)R_t^i\]
where
\[R_t=\sum_{t'=t}^T\gamma^{t'-t}r(s_{t'},a_{t'}).\]
One can see that VPG is a classical gradient descent(or ascent) method. We need choose a step size $\alpha$ and then update $\theta$ by
\[\theta_{i+1}=\theta_{i}+\alpha\widehat{\nabla_{\theta}\eta_{\theta}}.\]
A lack of VPG is that it gives no guidance to choose $\alpha$. Some algorithms are proposed to solve this problem, among which is TRPO.

\section{The Formulation of TRPO}
Notice that
\begin{align*}
&\mathbb{E}_{\pi}[r(s_{t})+\gamma V_{\pi}(s_{t+1})-V_{\pi}(s_{t})]\\
&=\mathbb{E}_{\pi}[r(s_{t})+\gamma V_{\pi}(s_{t+1})]-V_{\pi}(s_{t})\\
 &=Q_{\pi}(s_{t},a_{t})-V_{\pi}(s_{t})=A_{\pi}(s_{t},a_{t}).
\end{align*}
For two different policies $\tilde{\pi}$ and $\pi$, we have:
\begin{align*}
\mathbb{E}_{\tilde{\pi}}[\sum_{t=0}^{\infty}\gamma^{t}A_{\pi}(s_{t},a_{t})]&=\mathbb{E}_{\tilde{\pi}}[\sum_{t=0}^{\infty}\gamma^{t}\mathbb{E}_{\pi}(r(s_{t})+\gamma V_{\pi}(s_{t+1})-V_{\pi}(s_{t}))]\\
&=\mathbb{E}_{\tilde{\pi}}[\sum_{t=0}^{\infty}\gamma^{t}r(s_{t})+\sum_{t=0}^{\infty}\gamma^{t}\mathbb{E}_{\pi}(\gamma V_{\pi}(s_{t+1})-V_{\pi}(s_{t}))]\\
&=\mathbb{E}_{\tilde{\pi}}(\sum_{t=0}^{\infty}\gamma^{t}r(s_{t}))+\mathbb{E}_{\tilde{\pi}}[\sum_{t=0}^{\infty}\gamma^{t}\mathbb{E}_{\pi}[\gamma V_{\pi}(s_{t+1})-V_{\pi}(s_{t})]]\\
&=\mathbb{E}_{\tilde{\pi}}[\mathbb{E}_{\pi}(-V_{\pi}(s_{0}))]+\eta(\tilde{\pi})=\eta(\tilde{\pi})-\eta(\pi).
\end{align*}
We have omitted the term $\gamma^{t}V_{\pi}(s_{t})\rightarrow0(t\rightarrow\infty)$ in the last equality, since $\gamma^{t}\rightarrow 0(t\rightarrow\infty)$.

Rearrange the terms, we have
\begin{align*}
\eta(\tilde{\pi})&=\eta(\pi)+\mathbb{E}_{\tilde{\pi}}(\sum_{t=0}^{\infty}\gamma^{t}A_{\pi}(s_{t},a_{t}))\\
&=\eta(\pi)+\sum_{t=0}^{\infty}\sum_{s}P(s_{t}=s|\tilde{\pi})\sum_{a}\tilde{\pi}(a|s)\gamma^{t}A_{\pi}(s,a)\\
&=\eta(\pi)+\sum_{s}\sum_{t=0}^{\infty}\gamma^{t}P(s_{t}=s|\tilde{\pi})\sum_{a}\tilde{\pi}(a|s)A_{\pi}(s,a)\\
&=\eta(\pi)+\sum_{s}\rho_{\tilde{\pi}}(s)\sum_{a}\tilde{\pi}(a|s)A_{\pi}(s,a)
\end{align*}

\section{Establishing the Approximater}
To derive a practical algorithm, we consider parameterize the policy as $\pi_{\theta}$.

Let us propose a local approximation to $\eta(\pi_{\theta})$:
\begin{align}
L_{\pi_{\theta_{old}}}(\pi_{\theta})=\eta(\pi_{\theta_{old}})+\sum_{s}\rho_{\pi_{\theta_{old}}}(s)\sum_{a}\pi_{\theta}(a|s)A_{\pi_{\theta_{old}}}(s,a).
\end{align}
Why is this approximation reasonable?  For any given policy $\pi_{\theta_{old}}$, we have
\begin{align*}\begin{cases}
L_{\pi_{\theta_{old}}}(\pi_{\theta_{old}})=\eta(\pi_{\theta_{old}}),\\
\nabla_{\theta}L_{\pi_{\theta_{old}}}(\pi_{\theta})|_{\theta=\theta_{old}}=\nabla_{\theta}\eta(\pi_{\theta})|_{\theta=\theta_{old}}\end{cases}
\end{align*}
Proof:
\begin{align*}
L_{\pi_{\theta_{old}}}(\pi_{\theta_{old}})=&\eta(\pi_{\theta_{old}})+\sum_{s}\rho_{\pi_{\theta_{old}}}(s)\sum_{a}\pi_{\theta_{old}}(a|s)A_{\pi_{\theta_{old}}}(s,a)\\
=&\eta(\pi_{\theta_{old}})+E_{\pi_{\theta_{old}}}[A_{\pi_{\theta_{old}}}(s,a)]=\eta(\pi_{\theta_{old}})
\end{align*}
and
\begin{align*}
\nabla_{\theta}L_{\pi_{\theta_{old}}}(\pi_{\theta})=&\sum_{s}\rho_{\pi_{\theta_{old}}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)A_{\pi_{\theta_{old}}}(s,a)\\
\nabla_{\theta}\eta(\pi_{\theta})=&\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)Q_{\pi_{\theta}}(s,a)\\
=&\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)(A_{\pi_{\theta_{old}}}(s,a)+V_{\pi_{\theta_{old}}}(s))\\
=&\sum_{s}\rho_{\pi_{\theta_{old}}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)A_{\pi_{\theta}}(s,a)+\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)V_{\pi_{\theta}}(s)\\
=&\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)A_{\pi_{\theta}}(s,a)+\sum_{s}\rho_{\pi_{\theta}}(s)V_{\pi_{\theta}}(s)\nabla\sum_{a}\pi_{\theta}(a|s)\\
=&\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla\pi_{\theta}(a|s)A_{\pi_{\theta}}(s,a)
\end{align*}
thus, $\nabla_{\theta}L_{\pi_{\theta_{old}}}(\pi_{\theta})|_{\theta=\theta_{old}}=\nabla_{\theta}\eta(\pi_{\theta})|_{\theta=\theta_{old}}.$

These two equalities imply that a sufficiently small update for $\pi$ (by $\theta_{old}\rightarrow\theta$) which improves $L_{\pi_{\theta_{old}}}(\pi_{\theta})$ will also improves $\eta(\pi_{\theta})$, but we still have no idea about the size of the "sufficiently small update". In this paper, the principle theoretical result is the bound for improvement:
\begin{align*}
|\eta(\pi_{\theta})-L_{\pi_{\theta_{old}}}(\pi_{\theta})|\leq\frac{2\epsilon\gamma\alpha}{(1-\gamma)^{2}}
\end{align*}
where $\epsilon=\max_{s}|E_{\pi_{\theta}}[A_{\pi_{\theta_{old}}}(s,a)]|$, $\alpha=\max_{s} D_{KL}(\pi_{\theta_{old}}(\cdot|s)||\pi_{\theta}(\cdot|s))$.
It is a generalization of Kakade \& Langford(2002)'s conclusion.

\section{Optimization}
Different from the other algorithms, TRPO argues that maximizing $L_{\pi_{\theta_{old}}}(\pi_{\theta})-\frac{2\epsilon\gamma\alpha}{(1-\gamma)^{2}}$ can ensure an improvement of true expected reward $\eta(\pi_{\theta})$.

Furthermore, the penalty coefficient $\frac{2\epsilon\gamma}{(1-\gamma)^{2}}$ is large in general, which may yield small update. We thus propose an approximate optimization,
\begin{align*}
\max_{\theta} &\quad L_{\pi_{\theta_{old}}}(\pi_{\theta})\\
\text{s.t.} &\quad D_{KL}^{max}(\pi_{\theta_{old}}||\pi_{\theta})\leq\delta.
\end{align*}
the constrain implies a large computation because each divergence needs to be computed. Let us introduce another notation: $$ \overline{D}_{KL}^{\rho}(\theta_{old}||\theta)=E_{s\sim\rho}[D_{KL}(\theta_{old}(\cdot|s)|\theta(\cdot|s))].$$

The optimization problem can then be written as
\begin{align}
&\max_{\theta}L_{\pi_{\theta_{old}}}(\pi_{\theta})\\
&s.t.\ \overline{D}_{KL}^{\rho_{\pi_{\theta_{old}}}}(\pi_{\theta_{old}}\|\pi_{\theta})\leq\delta.
\end{align}


\subsection{Results} \label{subsec:results_logistic_regression}
Using scikit's grid search functionality it can be shown that both a rbf and a linear kernel with $C=1$ are a good choice for the support vector machine. Therefore, we will use a linear kernel and set $C=1$.

\begin{table}[H]
\begin{tabular}{@{}lllll@{}}
\toprule
Classification Method                   & TP (train) & TN (train)   & TP (test)   & TN (test)   \\ \midrule
logistic sgd                            & 0.94      & 0.99 & 0.90 & 0.97 \\
logistic sgd cv                         & 0.95      & 0.98 & 0.93 & 0.99 \\
logistic scikit                         & 0.94      & 0.99 & 0.90 & 1    \\
logistic scikit cv                      & 0.92      & 0.99 & 0.90 & 1    \\
svm                                     & 0.96      & 1    & 0.94 & 0.97 \\
svm cv                                  & 0.96      & 1    & 0.93 & 1   \\ \bottomrule
\end{tabular}
\caption{Performance of each classification method in terms of the true positive (TP) and true negative (TN) percentage for training and test data. We use the following hyperparameters: $\lambda=0.001$, learn rate=0.001, batchsize=1, epoch=1000, test ratio=0.1, k-fold=5.}
\label{table:1}
\end{table}

From table \ref{table:1} it shows that SVM is the best performing classification algorithm. SVM is known to be capable of separating overlapping class distribution \cite{bishop2006pattern}. Logistic regression, on the other hand, requires too many hyperparameters that finding the best set of hyperparameters is another task aside from optimizing the learnable parameters. We can say that all methods perform well in classifying benign classes and perform average on classifying cancer, i.e. malignant tumors.

\begin{figure}[H]
    \centering
    \includegraphics[width=1\linewidth]{Images/epoch100.png}
    \caption{Accuracy variation as a function of the learning rate for the case with the following hyperparameter: $\lambda=0.001$, batch size=32, epoch=100, test ratio=0.2}
    \label{fig:epoch100}
\end{figure}

To study the effect of tuning parameters in the performance of the model we examine the following cases: effect of the number of epoch and effect of the number of batches.

In figure \ref{fig:epoch100} we see that the model starts to overfit as the learning rate increases, it is evident in the result of the testing accuracy. It is a result of a small number of iteration. One can improve the model by increasing the number of iterations, as seen in \ref{fig:epoch1000}, which starts performing well as a function of the learning rate.

\begin{figure}[H]
    \centering
    \includegraphics[width=1\linewidth]{Images/epoch1000.png}
    \caption{Accuracy variation as a function of the learning rate for the case with the following hyperparameter: $\lambda=0.001$, batch size=32, epoch=1000, test ratio=0.2}
    \label{fig:epoch1000}
\end{figure}

We explore also the effect of mini-batches size. The number of mini-batches determines the speed of the gradient search and thus helps minimize the chances of being stuck in a local minimum. This can be seen in figure \ref{fig:MS1}-\ref{fig:MS32} in both mini-batch cases. At standard stochastic gradient descent case (batch size=1) the accuracy increase is slow, as shown in the test accuracy of figure \ref{fig:MS1}, compared that to the second case where the mini-batch size is 32 shown in the test accuracy of figure \ref{fig:MS32}, the change of accuracy improves drastically. Basically, the batch size affects how quickly the model optimizes the learnable parameters.

\begin{figure}[H]
    \centering
    \includegraphics[width=1\linewidth]{Images/MS1.png}
    \caption{Accuracy variation as a function of the learning rate for the case with the following hyperparameter: $\lambda=0.001$, batch size=1, epoch=1000, test ratio=0.2}
    \label{fig:MS1}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=1\linewidth]{Images/MS32.png}
    \caption{Accuracy variation as a function of the learning rate for the case with the following hyperparameter: $\lambda=0.001$, batch size=32, epoch=1000, test ratio=0.2}
    \label{fig:MS32}
\end{figure}


\documentclass[11pt]{article}
\usepackage[top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{url}
\usepackage{hyperref}
\usepackage{xcolor}
%
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{ifthen}
\usepackage{mathpartir}
\usepackage{mathtools}
\input{macros}
%
\begin{document}

\title{CO663 \LaTeX\ template}

\date{\vspace{-5ex}}
\maketitle

% \pagenumbering{gobble}

\newcommand{\answerbox}[1]{\framebox{\parbox[c][#1]{\textwidth}{
      \color{white}{h}%
    }}}

\section{Syntax and typing rules (for language $\lggeE$)}

\subsection{Syntax}

There is \LaTeX\ macro for each construct, see the sources of the
table below.

  \[
  \begin{array}{llclll}
    \TYPES & \tau & \Coloneqq & \enum{}  & \enum{} & \text{numbers}
    \\
           &&& \estr{} & \estr{} & \text{strings}
    \\
    \\
    %
    \EXPS & e & \Coloneqq  & \var{x} & \var{x} & \text{variable}
    \\
           &&& \enum{n} & n & \text{numeral}
    \\
           &&& \estr{s} & \litstr{s} & \text{literal}
    \\
           &&& \eplus{e_1}{e_2} & e_1 {+} e_2 & \text{addition}
    \\
           &&& \etimes{e_1}{e_2} & e_1 {*} e_2 & \text{multiplication}
    \\
           &&& \ecat{e_1}{e_2} & e_1 \concat e_2 & \text{concatenate}
    \\
           &&& \elen{e} & \lvert e \rvert & \text{length}
    \\
           &&& \elet{e_1}{x}{e_2} & \clet{e_1}{x}{e_2} & \text{definition}
  \end{array}
  \]
\subsection{Typing rules}

The macro for typing judgement is called \texttt{tyjudge}, it takes
three arguments: the environment $\Gamma$, the expression being typed
$e$, and its type $\tau$.
%
The macro to type-set typing rules (and trees) is called
\texttt{tyrule}, it also takes three arguments: the name of the rule,
the premises (separated by $\backslash\backslash$ or
$\backslash$\texttt{and}), and the conclusion.

  \[
  \tyrule
  {\etyrulename{var}}
  {\,}
  {\tyjudge{\Gamma_1, \var{x}: \tau, \Gamma_2}{\var{x}}{\tau} }
  \]
  \[
  \tyrule
  {\etyrulename{str}}
  {\,}
  {\tyjudge{\Gamma}{\estr{s}}{\estr{}}}
  \qquad\qquad\qquad
  \tyrule
  {\etyrulename{num}}
  {\,}
  {\tyjudge{\Gamma}{\enum{n}}{\enum{}}}
  % \end{array}
  \]
  \[
  \tyrule
  {\etyrulename{plus}}
  {
    \tyjudge{\Gamma}{e_1}{\enum{}}
    \and
    \tyjudge{\Gamma}{e_2}{\enum{}}
  }
  {\tyjudge{\Gamma}{\eplus{e_1}{e_2}}{\enum{}}}
  \qquad\qquad\qquad
  \tyrule
  {\etyrulename{times}}
  {
    \tyjudge{\Gamma}{e_1}{\enum{}}
    \and
    \tyjudge{\Gamma}{e_2}{\enum{}}
  }
  {\tyjudge{\Gamma}{\etimes{e_1}{e_2}}{\enum{}}}
  %
  \]
  \[
  \tyrule
  {\etyrulename{cat}}
  {
    \tyjudge{\Gamma}{e_1}{\estr{}}
    \and
    \tyjudge{\Gamma}{e_2}{\estr{}}
  }
  {\tyjudge{\Gamma}{\ecat{e_1}{e_2}}{\estr{}}}
  \qquad\qquad\qquad
  \tyrule
  {\etyrulename{len}}
  {
    \tyjudge{\Gamma}{e}{\estr{}}
  }
  {\tyjudge{\Gamma}{\elen{e}}{\enum{}}}
  \]
  \[
  \tyrule
  {\etyrulename{let}}
  {
    \tyjudge{\Gamma}{e_1}{\tau_1}
    \and
    \tyjudge{\Gamma, \var{x} : \tau_1 }{e_2}{\tau}
  }
  {\tyjudge{\Gamma}{\elet{e_1}{x}{e_2}}{\tau}}
  \]

\section{Typing derivation}

Type-setting the typing derivation of
$\elet{\enum{42}}{z}{\eplus{\var{z}}{1}}$ (which has type $\enum{}$):

  {\small
  \[
  \tyrule{{r1}}
  {
    \tyrule{{r2}}
    {\,}
    {
      \tyjudge{\emptyset}
      {\enum{42}}
      {\enum{}}
    }
    \\
    \qquad   \qquad
    \tyrule{{r3}}
    {
      \tyrule{{r2}}
      {\,}
      {
        \tyjudge{\var{z} : \enum{}}
        {\var{z}}
        {\enum{}}
      }
      \\
      \qquad   \qquad
      \tyrule{{r4}}
      {\,}
      {
        \tyjudge{\var{z} : \enum{}}
        {\enum{1}}
        {\enum{}}
      }
    }
    {
      \tyjudge{\var{z} : \enum{}}
      {\eplus{\var{z}}{\enum{1}}}
      {\enum{}}
    }
  }
  {
    \tyjudge{\emptyset}
    {\elet{\enum{42}}{z}{\eplus{\var{z}}{\enum{1}}}}
    {\enum{}}
  }
  \]
}

\section{Evaluation}

The macro of evaluation steps is called \texttt{jtrans}, it takes two
arguments: the initial expression and its result.
%
The macro to typeset evaluation rules and trees is called
\texttt{semrule}, it works like \texttt{tyrule}.
%
To evaluate $\elet{\enum{42}}{z}{\eplus{\var{z}}{1}}$, we proceed in
several steps:

\begin{enumerate}
\item First apply the rule for \texttt{let}:
  \[
  \semrule
  {r5}
  {\,}
  {
    \jtrans
    {\elet{\enum{42}}{z}{\eplus{\var{z}}{\enum{1}}}}
    {
      {\eplus{\enum{42}}{\enum{1}}}
    }
  }
  \]
\item Then we apply the rule for \texttt{plus}:
  \[
  \semrule
  {r6}
  {\,}
  {\jtrans
    {\eplus{\enum{42}}{\enum{1}}}
    {\enum{43}}
  }
  \]
\end{enumerate}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: