\chapter{The Collatz Tree}

\section{The Connection between Groups and Graphs}
\label{sec:groups_graphs}
Let $(a_k)$ be a numerical sequence with $a_k=g^{(k)}(m)$, then a reversion produces an infinite number of sequences of reversely-written Collatz members \cite{Ref_Klisse_2010}.

\par\medskip
Let $S$ be a set containing two elements $q$ and $r$, which are bijective
functions over $\mathbb{Q}$:
\begin{equation}
\begin{array}{l}
q(x)=2x \\
r(x)=\frac{1}{3}(x-1)
\end{array}
\end{equation}

Let a binary operation be the right-to-left composition of functions
$q\circ r$, where $q\circ r(x)=q(r(x))$. Composing functions is an
associative operation. All compositions of the bijections $q$ and $r$
and their inverses $q^{-1}$ and $r^{-1}$ are again bijective. The set,
whose elements are all these compositions, is closed under that operation.
It forms a free group $F$ of rank 2 with respect to the free generating set $S$, where the group's binary operation $\circ$ is the function composition and the group's identity element is the identity function $id_{\mathbb{Q}}=e$. We call $e$ an \textit{empty string}. $F$ consists of all expressions (strings) that can be concatenated from the generators $q$ and $r$. The corresponding Cayley graph $Cay(F,S)=G$ is a regular tree whose vertices have four neighbors \cite[p.~66]{Ref_Loeh}. A tree is called \textit{regular} or \textit{homogeneous} when every vertex has the same degree, in this case, $d(v)=4$ for every vertex $v$ in $G$. The Cayley graph's set of vertices is $V(G)=F$, and its set of edges is $E(G)=\left\{\left\{f,f\circ s\right\}\mid f\in F,s\in\left(S\cup S^{-1}\right)\setminus\left\{e\right\}\right\}$ \cite[p.~57]{Ref_Loeh}. More precisely, the vertices are \textit{labeled} by the elements (strings) of $F$.

\par\medskip
In conformance with graph-theoretical precepts \cite{Ref_Bondy_Murty},
\cite{Ref_Bonnington_Little}, \cite{Ref_Bender_Williamson}
we specify a subgraph $H$ of $G$ as a triple
$\left(V(H),E(H),\psi_{H}\right)$ consisting of a set $V(H)$ of vertices,
a set $E(H)$ of edges, and an incidence function $\psi_{H}$. The latter
is, in our case, the restriction $\psi_{G}\vert_{E(H)}$ of the Cayley
graph's incidence function to the set of edges that only join vertices,
which are labeled by a string over alphabet $\{r,q\}$ without the inverses:
$E(H)=\left\{\left\{f,f\circ s\right\}\mid f\in F,s\in S\setminus\left\{e
\right\}\right\}$.

\par\medskip
This subgraph corresponds to the monoid $S^*$, which is freely generated
by $S$ follows related thoughts \cite{Ref_Truemper_2014} that examine
the Collatz problem in terms of a free semigroup on the set $S^{-1}$ of
inverse generators. Note that this semigroup is not to be confused with an
\textit{inverse semigroup} "in which every element has a unique inverse"
\cite[p.~26]{Ref_Almeida}, \cite[p.~22]{Ref_Loeh}.

\par\medskip
Let $Y^X=\{f\mid f\text{ is a map }X\rightarrow Y\}$ be the set of functions, which in category theory is referred to as the \textit{exponential object} for any sets $X$, $Y$. The evaluation function $ev:Y^X\times X\to Y$ sends the pair $(f,x)$ to $f(x)$. For a detailed description of this concept, see \cite[p.~127]{Ref_Johnsonbaugh}, \cite[p.~155]{Ref_MacLane_Birkhoff}, \cite[p.~54]{Ref_Novak_etal} and \cite[p.~188]{Ref_Pellissier}. We define the evaluation function $ev_{S^*}:S^*\times\{1\}\rightarrow\mathbb{Q}$ that evaluates an element of $S^*$, id est a composition of $q$ and $r$, for the given input value $1$. Furthermore we define the corestriction ${ev^0_{S^*}}$ of $ev_{S^*}$ to $\mathbb{N}$. Since a corestricion of a function resricts the function's codomain \cite[p.~3]{Ref_Helemskii}, the function $ev^0_{S^*}$ operates on a subset $T\subset S^*$ that contains only those compositions of $q$ and $r$, which return a natural number when inputting the value $1$.

\par\medskip
The set $T$ forms not a monoid under function composition, for example $ev_{S^*}(qrq^4,1)=10$ and $ev_{S^*}(rq^6,1)=21$, but the composition $qrq^4rq^6$ does not lie in $T$, because the evaluation $ev_{S^*}(qrq^4rq^6,1)$ yields a value outside the codomain $\mathbb{N}$. However, each element of this set labels a vertex of a tree $H_{T}\subset H$, which is a proper subtree of $H$.

\par\medskip
Let $U\subset T$ be a subset of $T$, which does not contain a reduced word with two or more successive characters $r$. The corresponding tree $H_{U}\subset H_{T}$ reflects Collatz sequences as demonstrated in figure~\ref{fig:1}.

\begin{remark}
When talking about trees having a root ("rooted trees"), another important concept should be explained: the \textbf{level of a vertex} or often called \textbf{depth of a vertex} is the length of the path from the root to this vertex \cite[p.~804]{Ref_Rosen}. In other words, it is the vertex's distance (the number of edges in the path) from the root. The \textbf{height of a vertex} is its level plus one $level(v)+1=height(v)$, see \cite[p.~169]{Ref_Makinson}.
\end{remark}

% trim=left top right bottom
\begin{figure}
	\includegraphics[trim=2.3cm 5.8cm 5.9cm 4.8cm,
	width=1.00\textwidth,page=1]{figures/caytree.pdf}
	\caption{Small section of $H_T$ with darkly highlighted subtree $H_U$}
	\label{fig:1}
\end{figure}

\section{Defining the Tree}
The starting point for specifying our tree is $H_U$. Due to its
significance, we first concertize $H_U$ by the definition~\ref{def:H_U}
below, which establishes four essential characteristics.

\pagebreak
\begin{definition}
The graph $H_U$ possess the following key properties:
\begin{itemize}
	\item \mbox{\boldmath$H_U$} \textbf{is a directed graph (digraph):} Fundamentally, when we consider the more general case, an undirected graph as a triple $(V,E,\psi)$, the incidence function maps an edge to an arbitary vertex pair $\psi : E\rightarrow\{X\subseteq V:\left|X\right|=2\}$. In a digraph, the set $V\times V$ represents ordered vertex pairs. Accordingly the incidence function is more specifically defined, namely as a mapping of the edges to that set $\psi : E\rightarrow\{(v,w)\in V\times V:v\neq w\}$, see \cite[p.~15]{Ref_Korte_Vygen}.
	\item \mbox{\boldmath$H_U$} \textbf{is a rooted tree:} According to Rosen \cite[p.~747]{Ref_Rosen}, a rooted tree is "a tree in which one vertex has been designated as the root and every edge is directed away from the root." Peculiarly, this definition considers the directionality as an inherent part of rooted trees. Unlike Mehlhorn and Sanders \cite[p.~52]{Ref_Mehlhorn_Sanders}, for example, who distinguish between an undirected and directed rooted tree.
	\par\smallskip
	\textit{Note: As long as we do not stipulate that vertices may collapse, it is absolutely guaranteed that the graph is a tree.}
	\item \mbox{\boldmath$H_U$} \textbf{is an out-tree:} There is exactly one	path from the root to every other node \cite[p.~52]{Ref_Mehlhorn_Sanders}, which means that edge directions go from parents to children \cite[p.~108]{Ref_Du_Ko_Hu}. This property is implied in Rosen's definition for a rooted tree as well by saying "every edge is directed away from the root." An out-tree is sometimes designated as \textit{out-arborescence} \cite[p.~108]{Ref_Du_Ko_Hu}.
	\item \mbox{\boldmath$H_U$} \textbf{is a labeled tree:} For defining a labeled graph, Ehrig et al. \cite[p.~23]{Ref_Ehrig_etal} use a label alphabet consisting of a vertex label set and an edge label set. Since we only label the vertices, in our case the specification of a vertex label set $L_V$ together with the vertex label function $l_V:V\rightarrow L_V$ is sufficient. Originally, we said vertex labels are strings over the alphabet $S=\{q,r\}$, through which the free monoid $S^*$ is generated. We illustrate labeling $H_U$ by defining $l_{V(H_U)}(v)=ev^0_{S^*}(l_{V(G)}(\iota(v)),1)$, whereby $\iota:V(H_U)\hookrightarrow V(G)$ is the inclusion map \cite[p.~142]{Ref_Childs} from the set of vertices of $H_U$ to the set of vertices from the previously defined Cayley graph $G$.
\end{itemize}
\label{def:H_U}
\end{definition}

\par\medskip
We define a tree $H_C$ by taking the tree $H_U$ as a basis and for every
vertex $v\in V(H_U)$ satisfying $2\mid l_{V(H_U)}(v)$, we contract the
incoming edge. We attach the label of the parent of $v$ to the new
vertex, which results by replacing (merging) the two overlapping
vertices that the contracted edge used to connect. Visually, we
obtain $H_C$ by contracting all edges in $H_U$ that have an even-labeled
target vertex, which (due to contraction) gets "merged into its parent."
Edge contraction is occasionally referred to as \textit{collapsing an
edge}. For more details and examples on edge contraction, one can see
Voloshin \cite[p.~27]{Ref_Voloshin} and Loehr \cite{Ref_Loehr}.

\par\medskip
The tree $H_C$ is a \textit{minor of $H_U$}, since it can be obtained
from $H_U$ "by a sequence of any vertex deletions, edge deletions and
edge contractions" \cite[p.~32]{Ref_Voloshin}. The sequence of contracting
the edges between adjacent (in our case even-labeled) vertices is called
\textit{path contraction}.

\par\medskip
A small section of the tree $H_C$ is shown in figure~\ref{fig:2}. Other
definitions of the same tree exist, see for example Conrow
\cite{Ref_Conrow} or Bauer \cite[p.~379]{Ref_Bauer}.

\begin{figure}
	\includegraphics[width=1.00\textwidth]{figures/h_c.png}
	\caption{Small section of $H_C$ (displaying the trivial cycle is waived)}
	\label{fig:2}
\end{figure}

\section{Relationship of successive nodes in \mbox{$H_C$}}

Let $v_1$ and $v_{n+1}$ be two vertices of $H_C$, where $v_1$ is reachable from $v_{n+1}$ with $level(v_1)-level(v_{n+1})=n$. Hence, a path $(v_{n+1},\ldots,v_1)$ exists between these two vertices. Theorem~\ref{theo:1} specifies the following relationship between $v_1$ and $v_{n+1}$.

\par\medskip
\begin{theorem}
	\label{theo:1}
	$l_{V(H_C)}(v_{n+1})=3^nl_{V(H_C)}(v_1)\prod_{i=1}^{n}\left(1+\frac{1}{3l_{V(H_C)}(v_{i})}\right)2^{-\alpha_i}$.
	In order to simplify readability, we waive writing down the vertex label function and put it shortly:\\
	$v_{n+1}=3^nv_1\prod_{i=1}^{n}\left(1+\frac{1}{3v_{i}}\right)2^{-\alpha_i}$.
	The value $\alpha_i\in\mathbb{N}$ is the number of edges which have been contracted between $v_i$ and $v_{i+1}$ in $H_U$.
\end{theorem}

In order to demonstrate the construction produced by theorem~\ref{theo:1} in an illustrative fashion, example~\ref{ex:vertices} runs through a concrete path in $H_C$.

\par\medskip
\begin{example}
	\label{ex:vertices}
	For example, the two vertices $v_1=45$ and $v_{1+3}=v_4=5$ are
	connected
	via the path $(5,13,17,45)$, see figure~\ref{fig:2}. Furthermore, one
	can retrace in figure~\ref{fig:3} the uncontracted path between these
	two nodes within $H_U$. When applied to this example,
	theorem~\ref{theo:1} produces the following:
	\begin{center}
		$5=v_{1+3}=3^3*45*\left(1+\frac{1}{3*45}\right)*2^{-3}
		*\left(1+\frac{1}{3*17}\right)*2^{-2}
		*\left(1+\frac{1}{3*13}\right)*2^{-3}$
	\end{center}
\end{example}
\begin{proof}
	\label{proof:1}
	This relationship of successive nodes can simply be proven inductively. For the base case, we set $n=1$ and retrieve
	\begin{center}
		$v_{1+1}=3v_1\left(1+\frac{1}{3v_1}\right)2^{-\alpha_1}
		=\left(3v_1+1\right)2^{-\alpha_1}=v_2$
	\end{center}
	The path from $v_2$ to $v_1$ can conformly be expressed by a string $rq\cdots q$ of $S^*$, because of $v_1=r\circ q^{\alpha_1}\left(v_2\right)$. We set $n=n+1$ for the step case, which leads to
	\begin{equation*}
	\begin{array}{cl}
	v_{n+2} &
	=3^{n+1}v_1\prod_{i=1}^{n+1}\left(1+\frac{1}{3v_i}\right)2^{-\alpha_i}\\
	&
	=3^{n+1}v_1\left(1+\frac{1}{3v_{n+1}}\right)2^{-\alpha_{n+1}}\prod_{i=1}^{n}\left(1+\frac{1}{3v_i}\right)2^{-\alpha_i}\\
	&
	=3\left(1+\frac{1}{3v_{n+1}}\right)2^{-\alpha_{n+1}}3^nv_1\prod_{i=1}^{n}\left(1+\frac{1}{3v_i}\right)2^{-\alpha_i}\\
	&
	=3\left(1+\frac{1}{3v_{n+1}}\right)2^{-\alpha_{n+1}}v_{n+1}\\
	&
	=\left(3v_{n+1}+1\right)2^{-\alpha_{n+1}}
	\end{array}
	\end{equation*}
	In this case the path from $v_{n+2}$ to $v_{n+1}$ is conformly
	expressable by a string $rq\cdots q$ of $S^*$ too, since
	$v_{n+1}=r\circ q^{\alpha_{n+1}}\left(v_{n+2}\right)$.
\end{proof}

Even though the tree may theoretically contain two or more identically labeled vertices, it is essential to emphasize that we only consider such paths $(v_{n+1},\ldots,v_1)$ whose vertices are all labeled differently. Later in section~\ref{sec:cycles}, we even require that identically labeled nodes are one and the same. In order to correctly determine successive nodes using theorem~\ref{theo:1}, we must consider the halting conditions. These are specified in Definition~\ref{def:halting_condition}.

\begin{definition}
	\label{def:halting_condition}
	When determining successive nodes starting at $v_1$ according to theorem~\ref{theo:1}, we halt if one of the following two conditions is fulfilled:
	\begin{enumerate}
		\item $v_{n+1}=1$
		\item $v_{n+1}\in\{v_1,v_2,\ldots,v_n\}$
	\end{enumerate}
	If the first condition applies, the Collatz conjecture is true for a specific sequence. When the second condition is fulfilled, the sequence has led to a cycle. For every starting node, except the root node (labeled with $1$), the Collatz conjecture is consequently falsified. Let us consider the example $v_1=13$, where the algorithm halts after two iterations, because the first condition is met:
	\[
	v_{n+1}=3^2\cdot\left(1+\frac{1}{3\cdot13}\right)\left(1+\frac{1}{3\cdot5}\right)\cdot2^{-7}=1
	\]

	If we examine the case $v_{1}=1$, we realize that the algorithm finishes after the first iteration, since both halting conditions are true. The sequence stops because the final node labeled with $1$ is reached. Furthermore, the sequence has led to a cycle:
	\[
	v_{n+1}=3\cdot\left(1+\frac{1}{3}\right)2^{-2}=1
	\]

	The trivial cycle is the only sequence where both conditions are fulfilled.
\end{definition}

\noindent
Theorem~\ref{theo:1} can be used for specifying the condition of a cycle as follows:

\begin{equation}
\label{eq:func_cycle}
\begin{array}{l}
v_{1}=3^nv_1\prod_{i=1}^{n}\left(1+\frac{1}{3v_i}\right)2^{-\alpha_i}
\\[\medskipamount]
2^{\alpha_1+\cdots+\alpha_n}=\prod_{i=1}^{n}\left(3+\frac{1}{v_i}\right)
\end{array}
\end{equation}

A similar condition has been formulated by Hercher \cite{Ref_Hercher} and Eric Roosendaal \cite{Ref_Roosendaal_2020}. Taking a first look at equation~\ref{eq:func_cycle}, we are able to recognize the trivial cycle for $n=1$. One might easily come to the false conclusion that the term only results in a natural number for this trivial cylce, since we are multiplying fractions. The following counterexample, starting at $v_1=31$, disproves this assumption:
\begin{equation*}
20480=\left(3+\frac{1}{31}\right)\left(3+\frac{1}{47}\right)
\left(3+\frac{1}{71}\right)\left(3+\frac{1}{107}\right)\left(3+\frac{1}{161}\right)\left(3+\frac{1}{121}\right)\left(3+\frac{1}{91}\right)\left(3+\frac{1}{137}\right)\left(3+\frac{1}{103}\right)
\end{equation*}

According to OESIS \cite{Ref_OESIS}, the integer $v_1=31$ is called \textit{self-contained}. The term self-contained is based on the fact that the node $v_{n+1}=v_{10}=155$ is divisible by the starting node $v_1=31$. Moreover, $v_{10}$ results from applying one and the same function (in this case the Collatz function) using $v_1$ as input, see also Guy \cite[p.~332]{Ref_Guy}. For such a case equation~\ref{eq:func_cycle} leads to a natural number, but not necessarily to a cycle. A cycle only occurs if the term results in a power of two. One example is the trivial cycle. We find another case when we choose the factor $5$ instead of $3$:
\begin{center}
	$128=2^7=\left(5+\frac{1}{13}\right)\left(5+\frac{1}{33}\right)
	\left(5+\frac{1}{83}\right)$
\end{center}

The above example shows that non-trivial cycles can be found if we generalize the Collatz conjecture by replacing the factor $3$ with the variable $k$. We study this generalized form and the occurance of cycles in section~\ref{sec:cycles}. A detailed elaboration of the divisibility and a deeper understanding of the tree $H_C$ needs to be performed in order to get towards any proof of the Collatz conjecture.

%\par\medskip\noindent
%Generally, for any variant $kx+1$ it applies that if $v_1\mid v_{n+1}$, the the product is natural:
%\begin{equation*}
%	\prod_{i=1}^n\left(k+\frac{1}{v_i}\right)\in \mathbb{N}
%\end{equation*}

\begin{figure}
	\includegraphics[width=1.00\textwidth]{figures/h_u.png}
	\caption{Section of $H_U$ containing the path from $5$ to $45$}
	\label{fig:3}
\end{figure}

\section{Relationship of sibling nodes in \mbox{$H_C$}}
In a rooted tree, vertices which have the same parent are called "siblings" \cite[p.~702]{Ref_Johnsonbaugh}, \cite[p.~747]{Ref_Rosen}. Sibling vertices accordingly have the same level.

\par\medskip
Let $w$ be a vertex, from which a path exists to the vertex $v_1$. Let $v_2$ be the immediate right-sibling of $v_1$, then $l_{V\left(H_C\right)}\left(v_2\right)=4*l_{V\left(H_C\right)}\left(v_1\right)+1$. This fact has been expressed differently by Kak \cite{Ref_Kak_2014} as follows: "If an odd number $a$ leads to another odd number (after several applications of the Collatz transformation) $b$, then $4a+1$ also leads to $b$."

\par\medskip
Applied to our approach, consider $w$ as the parent of $v_1$ and $v_2$. Suppose, in $H_U$, a path consisting of $n+1$ edges goes from $w$ to $v_1$. Then we can straightforwardly show that $n$ edges in $H_U$ have been contracted between both nodes $w$ and $v_1$ and $n+2$ edges between $w$ and $v_2$ (for simplicity we again omit writing the label function):
\begin{equation*}
\begin{array}{l}
		v_1=\frac{w*2^n-1}{3}
		\\[\medskipamount]
		v_2=\frac{w*2^{n+2}-1}{3}=4*v_1+1
\end{array}
\end{equation*}

For example, $n=3$ edges in $H_U$ have been contracted between $w=5$ and $v_1=13$ and $n+2=5$ edges between $w$ and $v_2=53$, whereby in $H_C$, the vertex $v_2$ is the right-sibling of $v_1$ and these two sibling vertices are immediate children of $w$.

\section{A vertex's \mbox{$n$}-fold left-child and right-sibling in \mbox{$H_C$}}
Referring to the "left-child, right-sibling representation" of rooted trees \cite[p.~246]{Ref_Cormen_Leiserson_Rivest_Stein}, the function $\textit{left-child}:V\rightarrow V$ returns the leftmost child of a vertex $v$. Nesting this function $n$ times leads to the definition of a vertex's $n$-fold left-child, which is given by $\textit{left-child}^n(v)$. As shown in figure~\ref{fig:2}, for example $\textit{left-child}^3(13)=7$.

\par\medskip
The function $\textit{right-sibling}:V\rightarrow V$ points to the sibling of a vertex $v$ immediately to its right \cite[p.~246]{Ref_Cormen_Leiserson_Rivest_Stein}. If this function is nested $n$ times, we get a vertex's $n$-fold right-sibling defined by $\textit{right-sibling}^n(v)$. One example is $\textit{right-sibling}^2(113)=1813$ which has been demonstrated in figure~\ref{fig:2} too.

\par\medskip
Let $w$ be a vertex in $H_C$ and $v_0$ the left-child of $w$. The $n$-fold right-sibling of $v_0$ can be calculated as follows:
\begin{equation}
\label{eq:nfold_right_sibling}
	v_n=\textit{right-sibling}^n(v_0)=\frac{1}{3}*\left(w*2^{2*n+\pi_3(w\bmod 3)}-1\right)
\end{equation}

The function $\pi_3$ is the self-inverse permutation (involution):
\begin{equation}
\label{eq:pi_3}
	\pi_3=\left(\begin{array}{cc}
	1 & 2\\
	2 & 1
	\end{array}\right)
\end{equation}
We consider permutations of the set $\{1,2\}$ and not of $\{0,1,2\}$, due to the fact that $w\bmod 3$ cannot be zero. A node $w$ in $H_C$, which is labeled by an integer divisible by $3$ is a leaf; and therefore such node has no left-child, more specifically it has no children at all.

\par\medskip
\noindent
When setting $n=0$, we trivially retrieve the vertex's $w$ left-child:
\begin{center}
	$v_0=\textit{left-child}(w)=\frac{1}{3}*\left(w*2^{\pi_3(w\bmod 3)}-1\right)$
\end{center}

\begin{example}
	\label{ex:siblings}
	Let us refer to figure~\ref{fig:2} again and pick out $w=5$. Then the
	vertex's $w$ left-child is $v_0=3$ and the threefold right-sibling
	$v_3=213$:

	\begin{equation*}
	\begin{array}{l}
		v_0=\frac{1}{3}*\left(5*2^{\pi_3(5\bmod 3)}-1\right)=3
		\\[\medskipamount]
		v_3=\frac{1}{3}*\left(5*2^{2*3+\pi_3(5\bmod 3)}-1\right)=213
	\end{array}
	\end{equation*}
\end{example}

\section{Left-child and right-sibling in the \mbox{$5x+1$} variant of \mbox{$H_C$}}
In the following we take a look at the $5x+1$ variant of $H_C$. We name this graph $H_{C,5}$ and must note that it is not a tree and moreover that not all of its vertices are reachable from the root. We define the permutation $\pi_5$ as follows:
\begin{center}
	$\pi_5=\left(\begin{array}{cccc}
		1 & 2 & 3 & 4\\
		4 & 3 & 1 & 2
	\end{array}\right)$
\end{center}

Next, by letting $w$ be a vertex in $H_{C,5}$ and $v_0$ the left-child of $w$
we obtain the $n$-fold right-sibling of $v_0$ by the function that
is slightly different to the one defined by \ref{eq:nfold_right_sibling}:
\begin{equation}
\label{eq:nfold_right_sibling_5}
	v_n=\textit{right-sibling}^n(v_0)=\frac{1}{5}*\left(w*2^{4*n+\pi_5(w\bmod 5)}-1\right)
\end{equation}

Analogous to \ref{eq:pi_3} only permutations on the set without zero
\{1,2,3,4\} need to be considered, since $w\bmod 5$ cannot be zero.
Otherwise, if $w\equiv 0 (\bmod 5)$ which means that $w$ were labeled
by an integer divisible by 5, then the node $w$ has no successor in $H_{C,5}$.

\par\medskip
\noindent
By setting $n=0$, the function (above given by \ref{eq:nfold_right_sibling_5}) returns the left child of $w$:
\begin{center}
	$v_0=\textit{left-child}(w)=\frac{1}{5}*\left(w*2^{\pi_5(w\bmod 5)}-1\right)$
\end{center}

\begin{figure}
	\includegraphics[width=1.00\textwidth]{figures/h_c5b.png}
	\caption{Section of the graph $H_{C,5}$ starting at its root (without branches that reflect a subsequence containing the trivial cycle)}
	\label{fig:4}
\end{figure}

Figure~\ref{fig:4} illustrates a small section of $H_{C,5}$ starting at its root. The particularly interesting thing about the graph $H_{C,5}$ is that it contains three cycles, the trivial cycle starting from the root $1,3$ and two non-trivial cycles $43,17,27$ and $83,33,13$. To be precise, three cycles are known (as it will become apparent later in section~\ref{sec:non_trivial_cycles}), and on the basis of present knowledge it cannot be ruled out with any certainty that other cycles exist.


\documentclass[../main.tex]{subfiles}
 \begin{document}
  \chapter{$ L^p $ Spaces}
  \begin{exercise}
    Prove that the supremum of any collection of convex funtions on $ (a, b) $ is convex on $ (a, b) $ (if it is finite) and that pointwise limits of sequences of convex functions are convex. What can you say about the upper and lower limits of sequences of convex functions.
    \paragraph{Solution. }
    If $ f_n $ is a sequence of convex functions, and $ f $ is its supremum. For any $ x, y \in (a, b) $, $ n \in \mathbb{N} $,
    \begin{align*}
      \lambda f(x) + (1 - \lambda) f(y) \ge \lambda f_n(x) + (1 - \lambda) f_n(y) \ge f_n(\lambda x  + (1 - \lambda) y)
    \end{align*}
    Taking supremum on the right side gives the result.

    Now take $ f = \lim f_n $, if that exists and $ \{\infty, -\infty \} \not \subset f[(a, b)] $. Then $ f $ is convex by observing
    \begin{align*}
      f_n(\lambda x + (1 - \lambda) y) \to f(\lambda x + (1 - \lambda y)),\\
      \lambda f_n(x) + (1 - \lambda) f_n(y) \to \lambda f(x) + (1 - \lambda) f(y).
    \end{align*}

    Notice $ \limsup f_n = \lim _{n = 1} \sup _{k \ge n} f_n $ is convex by the above arguments.

    However, $ \liminf f_n $ may not be convex. Take $ (a, b) = (0, 1) $. Define
    \begin{align*}
      f_n (x) = \begin{cases}
        x, \text{$ n $ is odd}\\
        1 - x, \text{$ n $ is even}
    \end{cases}.
    \end{align*}
    Clearly $ \liminf f(x) = \begin{cases}
      x, 0 < x \le 1/2\\
      1 - x, 1/2 \le x < 1
    \end{cases}. $
    That $ f $ is not convex is by verifying $ f(1/2) > 1/2f(1/4) + 1/2f(3/4) $
  \end{exercise}

  \setcounter{exercise}{3}
  \begin{exercise}
    Suppose $ f $ is a complex measurable function on $ X $, $ \mu $ is a positive measure on $ X $, and
    \begin{align*}
      \phi(p) = \int_X |f ^{p} | d\mu = || f ||^p_p, (0 < p < \infty).
    \end{align*}
    Let $ E = \{p: \phi(p) < \infty\} $. Assume $ ||f||_\infty > 0 $.

    \begin{enumerate}
      \item If $ r < p < s, r\in E $ and $ s \in E $, prove that $ p \in E $.
      \item Prove that $ \log \phi $ is convex in the interior of $ E $ and that $ \phi $ is continuous on $ E $.
      \item By a), $ E $ is connected. Is $ E $ necessarily open? Closed? Can $ E $ consist of a single point? Can $ E $ be any connected subset of $ (0, \infty) $?
      \item if $ r < p < s $, prove that $ ||f||_p \le \max(||f||_r, ||f||_s) $. Show that this implies the inclusion $ L^r(\mu) \cap L^s(\mu) \subset L^p(\mu) $.
      \item Assume that $ ||f||_r < \infty $ for some $ r < \infty $ and prove that
      \begin{align*}
        ||f||_p \to ||f||_\infty, \text{as $ p \to \infty.$}
      \end{align*}
    \end{enumerate}

  \end{exercise}

  \begin{exercise}
    Assume, in addition to the hypothesis of Exercise 4, that
    \begin{align*}
      \mu(X) = 1.
    \end{align*}
    \begin{enumerate}
      \item Prove that $ ||f||_r \le ||f||_s $, if $ 0 < r < s \le \infty $.
      \item Under what conditions does it happen that $ 0 < r < s \le \infty $ and $ ||f||_r = ||f||_s < \infty $?
      \item Prove that $ L^r(\mu) \subset L^s(\mu) $ if $ 0 < r < s $. Under what conditions do these two spaces contain the same functions?
      \item Assume that $ ||f||_r < \infty $ for some $ r > 0 $, and prove that
      \begin{align*}
        \lim _{p \to 0} ||f||_p = \exp \left \{\int_X \log |f| d\mu \right \}
      \end{align*}
      if $ \exp \{-\infty\} $ is defined to be $ 0 $.

    \end{enumerate}

    \paragraph{Solution. }
    \begin{enumerate}
      \item
      \item
      \item
      \item By definition of Lebesgue integral,
      \begin{align*}
        \int \log |f| d\mu = \int _{|f| \ge 1} \log |f| d\mu - \int _{|f| \le 1} -\log|f| d\mu
      \end{align*}
      since the above is essentially decomposing a integral of a function into that of its positive and negative parts. Note the integral of the positive part cannot be $ \infty $, because otherwise by the inequality $ \log t \le t - 1 $,
      \begin{align*}
        \infty = \int _{|f| \ge 1} \log |f| d\mu = \int _{|f| \ge 1} \frac {1}{p} (|f|^p - 1) d\mu \le \frac {1}{p} \int _{|f| \ge 1} (|f|^p - 1)
      \end{align*}
      showing $ ||f||_p = \infty $ for any $ p > 0 $, a contradition to the hypothesis in the question. Therefore $ \int \log |f| = -\infty $ or it is finite.

      Frist consider the finite case.
      Take any $ p_n \to 0 $, define $ f_n = \frac {|f|^{p_n} - 1}{p_n} $. Notice $ \lim f_n = \frac {d}{d|f|} |f|^p| _{|f| = 0} $ = $ \log |f| $. Further for any $ 0 < p_n < r $, if $ |f| \ge 1 $,
      \begin{align*}
        |f_n| = \left | \frac {|f|^{p_n}  - 1}{p_n} \right| = \int _{1} ^{|f|} s ^{p_n-1} ds \le \int _{1} ^{|f|} s ^{r - 1}  ds \le \frac {|f|^r - 1}{r} ,
      \end{align*}
      and if $ |f| \le 1 $,
      \begin{align*}
        |f_n| = \left | \frac {|f|^{p_n} - 1}{p_n} \right| = \int _{|f|} ^{1} s ^{p_n-1} ds \le \int _{1} ^{|f|} s ^{-1} ds \le -\log|f|.
      \end{align*}
      Therefore $ |f_n| \le \frac {|f|^r - 1}{r}\mathcal{X} _{|f| \ge 1} - \log |f|\mathcal{X} _{|f| \le 1} $. By Dominated Convergence,
      \begin{align*}
        \int f_n \to \int \log |f|.
      \end{align*}
      Observe, by the inequality $ \log t \le t -1$ again,
      \begin{align*}
        \frac {1}{p} \log \int |f|^p \le \int \frac {|f|^p - 1}{p} \to \int \log |f|,
      \end{align*}
      as $ p \to 0 $.
      By Jensen,
      \begin{align*}
        \frac {1}{p} \log \int |f|^p \ge \int \log |f|,
      \end{align*}
      for any $ p \le r $, since $ \log $ is concave over $ \mathbb{R} $.
      Finally the result is obtained by sandwich theorem.

      Now if $ \int \log |f| d\mu = -\infty $, take $ f_n = |f|\mathcal{X}_{|f| > 1/n} + \mathcal{X}_{|f| \le 1/n} $, where $ n $ starts at $ 1 $. Clearly,
      \begin{enumerate}
        \item $ ||f||_p \le ||f_n||_p$.
        \item $ \log |f_n| = \log |f| \mathcal{X}_{|f| > 1/n} $.
        \item $ -\log |f_n| < \log n $
      \end{enumerate}
      Notice the positive and negative part of $ \log|f_n| $, by b), both converges increasingly to those of $ \log |f| $. By Monotone Convergence, $ \lim\limits _{n\to \infty} \exp \{\int \log |f_n|\} \to \exp \{\int \log |f|\} = 0  $. By c) $ \int \log |f_n| \ne -\infty $.
      Obviously $ f_n \in L ^{r}(\mu) $, therefore $ \log |f_n| $ can only have finite integral by the same proof as in $ \log |f| $.     Now together with previous arguments, $ \lim\limits _{p \to 0}  ||f_n||_p \to \exp \{\int \log |f_n|\} $.
      Therefore by a),
      \begin{align*}
        \limsup _{p\to 0} ||f||_p = \lim _{n\to \infty} \limsup _{p \to 0} ||f||_p \le \lim _{n\to \infty} \lim _{p \to 0} ||f_n||_p = \lim _{n\to \infty} \exp\left \{\int \log |f_n|\right \} = 0.
      \end{align*}
      Since $ ||f||_p \ge 0$, $ ||f||_p \to 0 $, as $ p \to 0 $.
    \end{enumerate}

  \end{exercise}
 \end{document}


\documentclass[12pt]{amsart}
\usepackage[margin=1.5in]{geometry}
%\usepackage{graphicx}
\usepackage{txfonts}
\pagestyle{plain}
\nofiles
\begin{document}

\begin{center}
  \textbf{Adding/Deleting Elements/Relations To/From a Poset}
\end{center}

Let $P=(X,\le)$ be a partially order set (or poset). Here $X$ is a set
of \emph{elements} and $\le$ is a reflexive, antisymmetric, transitive
\emph{relation} on $X$.

We wish to consider the following four operations: (1)~add an element
to a poset, (2)~delete an element from a poset, (3)~add a relation
to a poset, and (4)~delete a relation from a poset.

\section*{Adding/Deleting Elements}

Operations on elements are relatively simple to describe. Let
$P=(X,\le)$ be a poset.

If $a\notin X$, then to add the element $a$ to $P$ results in a new
poset that includes $a$ in which $a$ is related only to
itself. Formally, let $P'= P+a$ be the poset $P'=(X',\le')$ where we
have the following:
\begin{enumerate}
\item $X' = X \cup \{a\}$.
\item $\mathord{\le'} = \mathord{\le} \cup \{(a,a)\}$. That is,
  \begin{itemize}
  \item $\forall x,y \in X, x\le'y\iff x\le y$,
  \item $\forall x \in X,\ x\not\le'a$ and $a \not\le' x$, and
  \item $a\le' a$.
  \end{itemize}
\end{enumerate}

Element deletion is also easy to describe. Deleting an element $a$
from $P$ deletes $a$ from the set $X$ and all remaining elements have
the same relations they had before. Formally, for $a \in X$, let
$P'=P-a$ be the poset $P'=(X',\le')$ where we have the following:
\begin{enumerate}
\item $X' = X - \{a\}$.
\item $\forall x,y \in X',\ x \le' y \iff x\le y$.
\end{enumerate}

Note that element addition and deletion operations need not
commute. While it is true that $(P+a)-a=P$, in general we have
$(P-a)+a\not=P$.

\section*{Adding/Deleting Relations}

Adding a relation to a poset requires us to include additional
relations implied by transitivity. Let $P=(X,\le)$ be a poset
containing incomparable elements $a$ and $b$.

We define $P+(a<b)$ to be the poset $P' = (X',\le')$ in which we have
the following:
\begin{itemize}
\item $X' = X$.
\item $\forall x,y \in X', \ x \le' y \iff (x \le y) \text{ or }
  (x \le a \text{ and } b \le y)$.
\end{itemize}
Stated differently, $\le'$ is the minimal superset of $\le$ that
includes the pair $(a,b)$ and that is reflexive, antisymmetric, and
transitive.

There does not appear to be ``best'' way to define relation
deletion. Suppose $P=(X,\le)$ is a poset in which $a<b$; we want to
define $P' = P-(a<b)$.  For example, suppose $P=([3],\le)$ is the
total order $1<2<3$. How shall we define $P-(1<3)$? Since we delete
$(1,3)$ from the relation, we cannot have both $1<2$ and $2<3$, so one
of those must be deleted as well.  This leads to two possible choices
for $\le'$ are these:
\begin{itemize}
\item $\mathord{\le'} = \{(1,1),(2,2),(3,3), (1,2) \}$ and
\item $\mathord{\le'} = \{(1,1),(2,2),(3,3), (2,3) \}$.
\end{itemize}
There's no reasonable way to choose between these alternatives. Both
are derived from $\le$ with a minimum number of changes. So we take
another approach by deleting both $1<2$ and $2<3$. This results in the
antichain on $[3]$.

More generally, when we delete $a<b$ from $P$ we need to delete other
relations. In particular, if there is an $x$ with $a<x<b$, we cannot
keep both $a<x$ and $x<b$. Our solution is to delete \emph{both}.

Thus we define $P-(a<b)$ to be the poset $P' = (X',\le')$ in which
$X'=X$ and
\[
\mathord{\le'} = \mathord{\le}
- \bigl\{ (a,b) \bigr\}
- \bigl\{(a,x),(x,b) : a<x<b \bigr\} .
\]

\noindent\textbf{Claim}. \emph{$P'$ is a poset.}

\begin{proof}
  We need to check that $\le'$ is reflexive, antisymmetric, and
  transitive.

  Since we have not deleted any relation of the form $(x,x)$ from
  $\le$, it follows that $\le'$ is reflexive.

  Since $\mathord{\le'} \subset \mathord{\le}$ it follows that
  \[
  (x \le' y \text{ and } y \le' x) \Rightarrow
  (x \le y \text{ and } y \le x) \Rightarrow x=y .
  \]

  Finally, we must show that $\le'$ is transitive. Suppose $x <' y <'
  z$ but we do not have $x <' z$. This means that $(x,z)$ was a
  relation deleted from $\le$ and so we have one of the following:
  \begin{enumerate}
  \item $(x,z) = (a,b)$,
  \item $a=x < z < b$, or
  \item $a<x<z=b$.
  \end{enumerate}

  Case (1) cannot hold because then we have $x=a<y<b=z$ in which case
  neither $x<'y$ nor $y<'z$ contradicting the supposition that
  $x<'y<'z$.

  In case (2) we have that $a=x < y < z < b$ contradicting $x <' y$,
  and a similar contradiction holds in case~(3).
\end{proof}

\end{document}


\section*{Exercise 26.3-2}
Proof of Theorem 26.10.
\\
\\
The proof is by induction.

\emph{The base case, the first iteration}

First, the Ford-Fulkerson method initializes the flow to 0 on all edges. Hence at iteration 0, no iteration have run, all flow values are 0 and the outgoing flow is 0. Hence the induction base case is valid.

Now assume that for iteration $n$ the theorems statement is true, we now want to show that for iteration $n+1$ the statement is also true.

At the beginning of iteration $n+1$ two things can happen.

1) There is no path from $s$ to $t$ in $G_f$.

If there is no path, then the Ford-Fulkerson method finishes with the values found from iteration $n$. Those values are true by the induction step assumptions.

2) There is a path from $s$ to $t$ in $G_f$.

In this case the algorithm determines $c_f(p)$ which is an integer, since that value is chosen from the integer residual capacities that is the outcome of the  $n$'th iteration. All existing flow on path $p$ are updated with the $c_f(p)$. The existing flow is integer because of the induction assumption and adding or subtracting the integer $c_f(p)$ will yield an integer. Since the flow $f$ is only updated with the integer capacity $c_f(p)$, the new $\abs{f}$ that yields from the iteration will also only be updated with that integer value. Thus $\abs{f}$ is also integer after iteration $n+1$.


\documentclass[11pt, numbers=endperiod, parskip=half]{scrartcl}

\usepackage{amsmath}
\usepackage{color}
\usepackage{semantic}
\usepackage{minted}

\title{Assignment 3}
\subtitle{COS30023 - Languages in Software Development}
\author{Daniel Parker - 971328X}

\date{\today}

\begin{document}
\maketitle

\section{Problem 1}
\subsection{String specification}
\begin{align*}
S ::=& \ \ \ \epsilon \\
&|\ \ aS
\end{align*}
\subsection{String Length Specification}

\begin{align*}
length(\ \epsilon\ ) &= 0 \\
length(\ aS\ ) &= 1 + length(\ S\ )
\end{align*}

\subsection{String Concatenation Specification}
\begin{align*}
s_1 &= \epsilon: & \epsilon \oplus s_2 & &= &s_2 &\\
s_1 &= as'_1: & as'_1 \oplus s_2 & &= &a(s'_1 \oplus s_2)
\end{align*}
\clearpage
\subsection{a)}
Show that if \(s \in S\), then \(s \oplus \epsilon = s\)\\
\textbf{Base Case 1}\\
\[
s \equiv \epsilon
\]
\[
\epsilon \oplus \epsilon = \epsilon
\]
The first base case is when s is structurally equivalent to the empty string \(\epsilon\) and it's a fact that concatenating two empty strings will yield another empty string.

\textbf{Base Case 2}\\
if \(length(s) = 1\) then
\[
s \oplus \epsilon = s
\]

In this second base case we take s to be any string of length 1 and again it is a fact that any string concatenated with the empty string \(\epsilon\) will be the original first string. In this case the string will still be of length 1.

\textbf{Inductive Step}\\
We assume that the base case holds for all lengths of s greater than 1, therefore:

if \(length (s) > 1\)
\[
s \oplus \epsilon = s
\]
\textbf{Q.E.D.}
\subsection{b)}
Show that if \(s_1, s_2 \in S\) then \(length(s_1 \oplus s_2) = length(s_1) + length(s_2)\)\\
\textbf{Base Case 1}\\
\(s_1, s_2 \equiv \epsilon\)

Given that \(length(\epsilon) = 0\) then it goes to say that \(length(\epsilon \oplus \epsilon) = 0\).\\

\textbf{Base Case 2}\\
\(s_1 \neq \epsilon\), where \(length(s_1) = 1\) and \(s_2 \equiv \epsilon\).
\[
length(s_1 \oplus \epsilon) = length(s_1)
\]

For the case where \(s_1\) is a string of length 1 and \(s_2\) is an empty string, the concatenated length will be the length of \(s_1\).\\

\textbf{Base Case 3}\\
\(s_1, s_2 \neq \epsilon\), where \(length(s_1) = 1\) and \(length(s_2) = 1\).
\[
length(s_1 \oplus s_2) = length(s_1) + length(s_2) = 2
\]

For the case where both \(s_1\) and \(s_2\) are strings of length 1, the concatenated length will be the sum of the individual lengths, which is 2.

\textbf{Inductive Step} \\
\(length(s_1) > 1\) and \(length(s_2) > 1\)
\[
length(s_1 \oplus s_2) = length(s_1) + length(s_2)
\]

We assume the base case 3 holds for strings \(s_1, s_2\) of any length greater than 1.\\

\textbf{Q.E.D.}
\section{Problem 2}
\inputminted{prolog}{list_check.pl}
\end{document}


% Copyright 2018 Markus J. Pflaum, licensed under GNU FDL v1.3
% main author:
%   Markus J. Pflaum
%
\section{Projection-valued measures and spectral integrals}
\para
  In this section $\hilbertH$ will always denote a fixed complex Hilbert space.
\begin{definition}
  By a \emph{projection-valued measure} or a \emph{spectral measure} on a
  measurable space $(\Omega,\mathscr{A})$ one understands a map
  $E: \mathscr{A} \to \blinOps(\hilbertH)$ having the following properties:
  \begin{axiomlist}[SM]
  \setcounter{enumi}{-1}
  \item For each $\Delta \in \mathscr{A}$ the operator $E(\Delta)$ is an orthogonal projection
        that is $E(\Delta)^2 = E(\Delta)$ and $E(\Delta)^* = E(\Delta)$.
  \item $E(\Omega) = \id_\hilbertH$.
  \item For every sequence $(\Delta_n)_{n\in \N}$ of pairwise disjoint elements of $\mathscr{A}$
        one has
        \[ E\left(\bigcup_{n\in\N} \Delta_n \right) =   \strong\sum_{n=0}^\infty E(\Delta_n) \ , \]
        where convergence is with respect to the strong operator toplogy.
  \end{axiomlist}
\end{definition}

\begin{remark}
  Recall that \emph{convergence}  of a sequence of operators
  $(A_n)_{n\in \N} \subset \blinOps(\hilbertH)$ in the \emph{strong operator topology} to some $A $ means
  that for every $v\in \hilbertH$ the sequence $(A_nv)_{n\in\N}$ converges in $\hilbertH$ to $Av$.
  One denotes this by $A =\strong\lim\limits_{n\to\infty} A_n$.
  Likewise, $B = \strong\sum\limits_{n=0}^\infty A_n$ means that the sequence of partial sums
  $\left( \sum\limits_{k=0}^n A_n \right)_{n\in \N}$ converges  in the strong operator topology
  to some $B  \in \blinOps (\hilbertH)$.
\end{remark}

\begin{proposition}
  A spectral measure $E : \mathscr{A} \to \blinOps (\hilbertH)$   has the following properties
  in addition to the defining axioms:
  \begin{axiomlist}[SM]\setcounter{enumi}{1}
  \item[\textup{{\sffamily (SM1')}}\hspace{-1mm}]\itemlabel{ite:spectral-measure-empty-set}
     $E(\emptyset) = 0$.
  \item[\textup{{\sffamily (SM2')}}\hspace{-1mm}]\itemlabel{ite:spectral-measure-finite-additivity}
     \textup{(Finite additivity)}  One has for all disjoint $\Delta_1,\Delta_2 \in \mathscr{A}$
      \[ E( \Delta_1  \cup \Delta_2) = E(\Delta_1) + E(\Delta_2) \ . \]
  \setcounter{enumi}{2}
  \item\label{ite:spectral-measure-finite-multiplicativity}
     One has for all $\Delta_1,\Delta_2 \in \mathscr{A}$
     \[ E( \Delta_1  \cap \Delta_2) = E(\Delta_1)\cdot E(\Delta_2) \ . \]
  \end{axiomlist}
\end{proposition}

\begin{proof}
  {\itshape ad} \hyperref[ite:spectral-measure-empty-set]{\textup{\sffamily (SM1')}}.

  {\itshape ad} \hyperref[ite:spectral-measure-finite-additivity]{\textup{\sffamily (SM2')}}.

  {\itshape ad} \ref{ite:spectral-measure-finite-multiplicativity}.
\end{proof}


\documentclass[12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath}

\title{Fermion Operators}
\date{}
\author{}

\begin{document}

\maketitle

\tableofcontents

\newpage

\section{Anticommutation}
Consider the following eigenstates of a hypothetical quantum system.\footnote{
Adapted from problem 16.1.1 of ``Quantum Mechanics for Scientists and Engineers.''\\
{\tt https://ee.stanford.edu/{\textasciitilde}dabm/QMbook.html}}
\begin{align*}
|00\rangle&=(\text{1 0 0 0})\qquad\text{no fermions}\\
|10\rangle&=(\text{0 1 0 0})\qquad\text{one fermion in state 1}\\
|01\rangle&=(\text{0 0 1 0})\qquad\text{one fermion in state 2}\\
|11\rangle&=(\text{0 0 0 1})\qquad\text{two fermions, one in state 1, one in state 2}
\end{align*}

\noindent
Creation and annihilation operators are formed from outer products of state vectors.
Sign changes make the operators antisymmetric.
\begin{align*}
\hat{b}_1^\dag&=|10\rangle\langle00|-|11\rangle\langle01| \qquad\text{Create one fermion in state 1}
\\
\hat{b}_1&=|00\rangle\langle10|-|01\rangle\langle11| \qquad\text{Annihilate one fermion in state 1}
\\
\hat{b}_2^\dag&=|01\rangle\langle00|+|11\rangle\langle10| \qquad\text{Create one fermion in state 2}
\\
\hat{b}_2&=|00\rangle\langle01|+|10\rangle\langle11| \qquad\text{Annihilate one fermion in state 2}
\end{align*}

\noindent
The operators in matrix form.
\begin{equation*}
\hat{b}_1^\dag=\begin{pmatrix}0&0&0&0\\1&0&0&0\\0&0&0&0\\0&0&-1&0\end{pmatrix}
\quad
\hat{b}_1=\begin{pmatrix}0&1&0&0\\0&0&0&0\\0&0&0&-1\\0&0&0&0\end{pmatrix}
\quad
\hat{b}_2^\dag=\begin{pmatrix}0&0&0&0\\0&0&0&0\\1&0&0&0\\0&1&0&0\end{pmatrix}
\quad
\hat{b}_2=\begin{pmatrix}0&0&1&0\\0&0&0&1\\0&0&0&0\\0&0&0&0\end{pmatrix}
\end{equation*}

\noindent
Verify anticommutation relations of the operators.
\begin{align*}
\hat{b}_j\hat{b}_k+\hat{b}_k\hat{b}_j&=0
\\[2ex]
\hat{b}_j^\dag\hat{b}_k^\dag+\hat{b}_k^\dag\hat{b}_j^\dag&=0
\\[2ex]
\hat{b}_j\hat{b}_k^\dag+\hat{b}_k^\dag\hat{b}_j&=\delta_{jk}
\end{align*}

\newpage

\section{Wavefunction operator}
Consider the following eigenstates of a hypothetical quantum system.\footnote{
Adapted from problem 16.2.1 of ``Quantum Mechanics for Scientists and Engineers.''\\
{\tt https://ee.stanford.edu/{\textasciitilde}dabm/QMbook.html}}
\begin{align*}
|00\rangle&=(\text{1 0 0 0})\qquad\text{no fermions}\\
|10\rangle&=(\text{0 1 0 0})\qquad\text{one fermion in state $\phi_1$}\\
|01\rangle&=(\text{0 0 1 0})\qquad\text{one fermion in state $\phi_2$}\\
|11\rangle&=(\text{0 0 0 1})\qquad\text{two fermions, one in state $\phi_1$, one in state $\phi_2$}
\end{align*}

\noindent
Let fermion states $\phi_n$ be modeled by a one dimensional box of length $L$.
\begin{equation*}
\phi_n(x)=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)
\end{equation*}

\noindent
Creation and annihilation operators are formed from outer products of state vectors.
Sign changes make the operators antisymmetric.
\begin{align*}
\hat{b}_1^\dag&=|10\rangle\langle00|-|11\rangle\langle01| \qquad\text{Create one fermion in state $\phi_1$}
\\
\hat{b}_1&=|00\rangle\langle10|-|01\rangle\langle11| \qquad\text{Annihilate one fermion in state $\phi_1$}
\\
\hat{b}_2^\dag&=|01\rangle\langle00|+|11\rangle\langle10| \qquad\text{Create one fermion in state $\phi_2$}
\\
\hat{b}_2&=|00\rangle\langle01|+|10\rangle\langle11| \qquad\text{Annihilate one fermion in state $\phi_2$}
\end{align*}

\noindent
Given the wavefunction operator
\begin{equation*}
\hat{\psi}=\frac{1}{\sqrt{2}}\sum_{n,m}\phi_n(x)\phi_m(y)\hat{b}_n\hat{b}_m
\end{equation*}

\noindent
show that
\begin{equation*}
\hat{\psi}|11\rangle=\frac{1}{\sqrt{2}}\big(\phi_1(x)\phi_2(y)-\phi_1(y)\phi_2(x)\big)|00\rangle
\end{equation*}

\newpage

\section{Position operator}
Consider the following eigenstates of a hypothetical quantum system.
\begin{align*}
|00\rangle&=(\text{1 0 0 0})\qquad\text{no fermions}\\
|10\rangle&=(\text{0 1 0 0})\qquad\text{one fermion in state $\phi_1$}\\
|01\rangle&=(\text{0 0 1 0})\qquad\text{one fermion in state $\phi_2$}\\
|11\rangle&=(\text{0 0 0 1})\qquad\text{two fermions, one in state $\phi_1$, one in state $\phi_2$}
\end{align*}

\noindent
Let fermion states $\phi_n$ be modeled by a one dimensional box of length $L$.
\begin{equation*}
\phi_n(x)=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)
\end{equation*}

\noindent
Creation and annihilation operators are formed from outer products of state vectors.
Sign changes make the operators antisymmetric.
\begin{align*}
\hat{b}_1^\dag&=|10\rangle\langle00|-|11\rangle\langle01| \qquad\text{Create one fermion in state $\phi_1$}
\\
\hat{b}_1&=|00\rangle\langle10|-|01\rangle\langle11| \qquad\text{Annihilate one fermion in state $\phi_1$}
\\
\hat{b}_2^\dag&=|01\rangle\langle00|+|11\rangle\langle10| \qquad\text{Create one fermion in state $\phi_2$}
\\
\hat{b}_2&=|00\rangle\langle01|+|10\rangle\langle11| \qquad\text{Annihilate one fermion in state $\phi_2$}
\end{align*}

\noindent
Let $\hat{r}$ be the position operator
\begin{equation*}
\hat{r}=\sum_{n,m}r_{nm}\hat{b}_n^\dag\hat{b}_m
\end{equation*}

\noindent
where
\begin{equation*}
r_{nm}=\int_0^L\phi_n^*(x)x\phi_m(x)\,dx
\end{equation*}

\noindent
Note that for a one dimensional box
\begin{equation*}
r_{nn}=\langle x\rangle=\tfrac{1}{2}L
\end{equation*}

\noindent
Verify that
\begin{align*}
\langle10|\hat{r}|10\rangle&=r_{11}\\
\langle10|\hat{r}|01\rangle&=r_{12}\\
\langle01|\hat{r}|10\rangle&=r_{21}\\
\langle01|\hat{r}|01\rangle&=r_{22}
\end{align*}

\newpage

\section{Exchange energy}
Let $\psi(x,y)$ be the antisymmetrized wave function for two electrons in a box of length $L$.
\begin{align*}
\psi(x,y)&=\frac{1}{\sqrt{2}}
\big(\phi_1(x)\phi_2(y)-\phi_1(y)\phi_2(x)\big)
\\[2ex]
\phi_n(x)&=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)
\end{align*}

\noindent
For $L=10^{-9}$ meter the expected potential energy is
\begin{equation*}
V=\frac{e^2}{4\pi\epsilon_0}\int_0^L\int_0^L\frac{\psi^*(x,y)\psi(x,y)}{|x-y|}\,dx\,dy
=4.67\,\text{eV}
\end{equation*}

\noindent
Next calculate the potential energy for a wave function that is not antisymmetrized.
\begin{equation*}
V_0=\frac{e^2}{4\pi\epsilon_0}
\int_0^L\int_0^L\frac{\phi_1^*(x)\phi_2^*(y)\phi_1(x)\phi_2(y)}{|x-y|}\,dx\,dy
=12.80\,\text{eV}
\end{equation*}

\noindent
The difference is the exchange energy.
\begin{equation*}
V_{ex}=V-V_0=-8.13\,\text{eV}
\end{equation*}

\noindent
Note that the formula for $V_0$ has a singularity at $x=y$.
The computed value shown above is the result of an arbitrary cutoff in numerical integration.
The actual value of $V_0$ goes to infinity.

\bigskip
\noindent
Note also that there is a singularity at $x=y$ in the formula for $V$.
However, due to antisymmetry we have $\psi(x,x)=0$ and hence the integral converges.

\newpage

\section{Energy matrix}
Consider a system with the following eigenstates.
\begin{align*}
|0\rangle&=(\text{1 0 0 0})\qquad\text{no electrons}\\
|1\rangle&=(\text{0 1 0 0})\qquad\text{one electron in state $\phi_1$}\\
|2\rangle&=(\text{0 0 1 0})\qquad\text{one electron in state $\phi_2$}\\
|3\rangle&=(\text{0 0 0 1})\qquad\text{two electrons, one in state $\phi_1$, one in state $\phi_2$}
\end{align*}

\noindent
Let electron states $\phi_n$ be modeled by a one dimensional box of length $L$.
\begin{equation*}
\phi_n(x)=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)
\end{equation*}

\noindent
Let $|\xi\rangle$ be an arbitrary normalized state vector.
\begin{equation*}
|\xi\rangle=c_0|0\rangle+c_1|1\rangle+c_2|2\rangle+c_3|3\rangle,\qquad\langle\xi|\xi\rangle=1
\end{equation*}

\noindent
Let us determine an energy matrix $\hat{E}$ such that the expected
energy $\langle E \rangle$ in state $|\xi\rangle$ is
\begin{equation*}
\langle E\rangle=\langle\xi|\hat{E}|\xi\rangle
\end{equation*}

\noindent
Energy matrix $\hat{E}$ is the sum of kinetic and potential energy matrices.
\begin{equation*}
\hat{E}=\hat{K}+\hat{V}
\end{equation*}

\noindent
Kinetic energy matrix $\hat{K}$ can be computed from energy eigenvalues of the box model.
\begin{equation*}
\hat{K}=\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & E_1 & 0 & 0\\
0 & 0 & E_2 & 0\\
0 & 0 & 0 & E_1+E_2
\end{pmatrix},
\qquad
E_n=\frac{n^2\pi^2\hbar^2}{2mL^2}
\end{equation*}

\noindent
Potential energy matrix $\hat{V}$ has one entry due to Coulomb interaction in the two electron state.
\begin{equation*}
\hat{V}=
\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & V
\end{pmatrix}
\end{equation*}

\noindent
Let $\psi(x,y)$ be the antisymmetrized wavefunction of the two electrons.
\begin{equation*}
\psi(x,y)=\frac{1}{\sqrt{2}}\big(\phi_1(x)\phi_2(y)-\phi_1(y)\phi_2(x)\big)
\end{equation*}

\noindent
Then
\begin{equation*}
V=\frac{e^2}{4\pi\epsilon_0}\int_0^L\int_0^L
\psi^*(x,y)\left(\frac{1}{|x-y|}\right)\psi(x,y)\,dx\,dy
\end{equation*}

\noindent
Let us now choose $L=10^{-9}$ meters and compute numerical values.
For $\hat{K}$ we have
\begin{equation*}
\hat{K}=\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0.38\,\text{eV} & 0 & 0\\
0 & 0 & 1.50\,\text{eV} & 0\\
0 & 0 & 0 & 1.88\,\text{eV}
\end{pmatrix}
\end{equation*}

\noindent
Computing $V$ by numerical integration we have
\begin{equation*}
\hat{V}=\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 4.67\,\text{eV}
\end{pmatrix}
\end{equation*}

\noindent
Hence
\begin{equation*}
\hat{E}=\hat{K}+\hat{V}=\begin{pmatrix}
0 & 0 & 0 & 0\\
0 & 0.38\,\text{eV} & 0 & 0\\
0 & 0 & 1.50\,\text{eV} & 0\\
0 & 0 & 0 & 6.55\,\text{eV}
\end{pmatrix}
\end{equation*}

\newpage

\section{Superposition of eigenstates}
Consider a system with the following eigenstates.
\begin{align*}
|0\rangle&=(\text{1 0 0 0})\qquad\text{no electrons}\\
|1\rangle&=(\text{0 1 0 0})\qquad\text{one electron in state $\phi_1$}\\
|2\rangle&=(\text{0 0 1 0})\qquad\text{one electron in state $\phi_2$}\\
|3\rangle&=(\text{0 0 0 1})\qquad\text{two electrons, one in state $\phi_1$, one in state $\phi_2$}
\end{align*}

\noindent
Then for the wavefunction basis
\begin{equation*}
\phi_n(x)=\sqrt{\frac{2}{L}}\sin\left(\frac{n\pi x}{L}\right)
\end{equation*}

\noindent
and for $L=10^{-9}$ meters we have
\begin{equation*}
\hat{E}=\begin{pmatrix}
0&0&0&0\\
0&0.38\,\text{eV}&0&0\\
0&0&1.50\,\text{eV}&0\\
0&0&0&6.55\,\text{eV}
\end{pmatrix}
\end{equation*}

\noindent
Let $|\xi\rangle$ be the state vector
\begin{equation*}
|\xi\rangle
=\frac{1}{2}|0\rangle+\frac{1}{2}|1\rangle+\frac{1}{2}|2\rangle+\frac{1}{2}|3\rangle
=\begin{pmatrix}1/2\\1/2\\1/2\\1/2\end{pmatrix}
\end{equation*}

\noindent
The expected energy is
\begin{equation*}
\langle\xi|\hat{E}|\xi\rangle
=\frac{0\,\text{eV}}{4}+\frac{0.38\,\text{eV}}{4}+\frac{1.50\,\text{eV}}{4}+\frac{6.55\,\text{eV}}{4}
=2.11\,\text{eV}
\end{equation*}

\noindent
For the system we are considering, the result of a single measurement is either
0~eV, 0.38~eV, 1.50~eV, or 6.55~eV.
%The probability of observing each eigenvalue is 0.25 when the system is in state $|\xi\rangle$.
The value 2.11 eV is the expected average across multiple measurements.
Recall that a measurement causes the system to exit state $|\xi\rangle$
and enter an eigenstate $|0\rangle$, $|1\rangle$, $|2\rangle$, or $|3\rangle$
corresponding to the measured eigenvalue.
The system must be put back in state $|\xi\rangle$ before the next measurement.

\bigskip
\noindent
To use a slot machine analogy, state $|\xi\rangle$ is like the wheels spinning.
Observing the system makes the wheels stop.
The stopped wheels are in an eigenstate $|0\rangle$, $|1\rangle$, $|2\rangle$, or $|3\rangle$.
Once they are stopped the wheels don't change, they remain in the same eigenstate.
You have to pull the lever to get the wheels spinning again.

\end{document}


\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[UKenglish]{babel}
\usepackage{enumitem}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{stmaryrd}

\newtheorem{n}{}

\theoremstyle{plain}
\newtheorem{corollary}[n]{Corollary}
\newtheorem{lemma}[n]{Lemma}
\newtheorem{proposition}[n]{Proposition}
\newtheorem{theorem}[n]{Theorem}

\theoremstyle{definition}
\newtheorem{definition}[n]{Definition}
\newtheorem{remark}[n]{Remark}

\newcommand{\function}[5][]{
  \begin{array}{crcl}
    #1 : & #2 & \to     & #3 \\
         & #4 & \mapsto & #5
  \end{array}
}

\newcommand{\ab}[1]{\left\langle #1 \right\rangle}
\newcommand{\rb}[1]{\left( #1 \right)}
\renewcommand{\sb}[1]{\left[ #1 \right]}
\newcommand{\cb}[1]{\left\{ #1 \right\}}

\renewcommand{\P}{\mathbb{P}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}

\renewcommand{\AA}{\mathcal{A}}
\newcommand{\II}{\mathcal{I}}
\newcommand{\LL}{\mathcal{L}}
\newcommand{\OO}{\mathcal{O}}
\newcommand{\PP}{\mathcal{P}}

\title{Group law}
\author{David Kurniadi Angdinata}
\date{Winter 2019}

\begin{document}

\maketitle

\section{Statement}

Let $ K $ be an algebraically closed field and let $ E $ be an \emph{elliptic curve} over $ K $ defined by the \emph{Weierstrass equation}
$$ E : y^2 = x^3 + Ax + B, \qquad A, B \in K, $$
in \emph{dehomogenised} form. Then the following theorem holds.

\begin{theorem}[Group law]
\label{thm:grouplaw}
$ \rb{E, \OO, +} $ is an abelian group.
\end{theorem}

Rather than providing the conventional geometric proof using \emph{B\'ezout's theorem} and \emph{the Cayley-Bacharach theorem}, this algebraic proof using the theory of \emph{divisors} establishes Theorem \ref{thm:grouplaw} more naturally.

\section{Restatement}

Let the \emph{coordinate ring} $ R $ of $ E $ be
$$ R = \dfrac{K\sb{x, y}}{I}, $$
where $ I $ is the ideal generated by the Weierstrass equation of $ E $,
$$ I = \ab{y^2 - x^3 - Ax - B}. $$
Let $ \AA\rb{R} $ be the \emph{ideal class group} of $ R $, defined as the quotient
$$ \AA\rb{R} = \dfrac{\II\rb{R}}{\PP\rb{R}}, $$
where $ \II\rb{R} $ is the group of \emph{fractional ideals} of $ R $ and $ \PP\rb{R} $ is the subgroup of \emph{principal fractional ideals} of $ R $.

\begin{definition}
\label{def:picard}
The \textbf{Picard group} of $ E $ is
$$ Pic^0\rb{E} = \AA\rb{R}. $$
\end{definition}

\begin{remark}
Strictly speaking, Definition \ref{def:picard} is that of the \emph{degree zero} subgroup of the actual \emph{Picard group}, but this terminology will be used for the sake of brevity.
\end{remark}

It is then sufficient to prove the following theorem, which implies Theorem \ref{thm:grouplaw}.

\begin{theorem}
\label{thm:bijection}
There is a set bijection
$$ Pic^0\rb{E} \leftrightarrow E. $$
\end{theorem}

In fact, the following stronger theorem will be proven as well, assuming the geometric group law.

\begin{theorem}
\label{thm:isomorphism}
There is a group isomorphism
$$ Pic^0\rb{E} \cong E. $$
\end{theorem}

The proof involves defining $ Pic^0\rb{E} $ in detail, which requires the notion of a \emph{divisor} of $ E $.

\pagebreak

\section{Divisors}

A \emph{divisor} is defined as follows.

\begin{definition}
\label{def:divisor}
A \textbf{divisor} of $ E $ is a free abelian group generated by a finite basis $ C \subseteq E $ of formal symbols of the form $ \sb{P} $ for some point $ P \in E $, denoted
$$ D = \sum_{P \in C} n_P\sb{P}, $$
for some $ n_P \in \Z $.
\end{definition}

It can be easily shown that the set of divisors forms an additive group $ Div\rb{E} $, called the \textbf{divisor group} of $ E $. Let $ D, D' \in Div\rb{E} $ be divisors as in Definition \ref{def:divisor} throughout.

\begin{definition}
The \textbf{degree} of $ D $ is
$$ \deg\rb{D} = \sum_{P \in C} n_P \in \Z. $$
\end{definition}

It follows easily that the set of divisors of $ E $ of degree zero forms a subgroup $ Div^0\rb{E} $ of $ Div\rb{E} $, which is precisely the group of fractional ideals $ \II\rb{R} $. Now divisors can also be defined for \emph{functions} $ f \in K\rb{E}^* $. Let $ P \in E $ be a point throughout. With some commutative algebra, it can be shown that there is a function $ u_P \in K\rb{E}^* $ that is zero at $ P $, called the \textbf{uniformiser} at $ P $, such that any other function $ f \in K\rb{E}^* $ can be written in the form $ f \equiv u_P^{d_P}g $, for some $ d_P \in \Z $, and some function $ g \in K\rb{E}^* $ such that $ g\rb{P} \notin \cb{0, \infty} $. In fact, it can be shown that simply choosing
$$ u_P =
\begin{cases}
x - a & P = \rb{a, b} \\
y & P = \rb{a, 0} \\
\tfrac{x}{y} & P = \OO
\end{cases}
$$
works as a uniformiser at $ P $.

\begin{remark}
The functions $ f, g, u_P \in K\rb{E}^* $ must take values in $ K \cup \cb{\infty} $.
\end{remark}

The \textbf{valuation} of $ f $ at $ P $ is
$$ ord_P\rb{f} = d_P \in \Z. $$
Then $ f $ has a \textbf{zero} at $ P $ if $ ord\rb{P} > 0 $, which corresponds to the multiplicity of $ f\rb{P} = 0 $. Similarly, $ f $ has a \textbf{pole} at $ P $ if $ ord\rb{P} < 0 $, which corresponds to the multiplicity of $ f\rb{P} = \infty $. With some algebraic geometry, the following proposition can be shown.

\begin{proposition}
\label{prop:ag}
\hfill
\begin{itemize}
\item $ f $ has only finitely many zeroes and poles, that is $ ord_P\rb{f} \ne 0 $ for only finitely many points $ P \in E $.
\item $ f $ has an equal number of zeroes and poles counted with multiplicity, that is $ \deg\rb{div\rb{f}} = 0 $.
\item if $ f $ has no zeroes or poles, that is $ div\rb{f} = 0 $, then $ f $ is constant.
\end{itemize}
\end{proposition}

The following definition is then well-defined.

\begin{definition}
$ D $ is \textbf{principal} if
$$ D = div\rb{f} = \sum_{P \in E} ord_P\rb{f}\sb{P}, $$
for some function $ f \in K\rb{E}^* $.
\end{definition}

It follows that the subset of principal divisors of $ E $ forms a subgroup $ Prin\rb{E} $ of $ Div^0\rb{E} $, which is precisely the subgroup of principal fractional ideals $ \PP\rb{R} $. Definition \ref{def:picard} can now be restated as
$$ Pic^0\rb{E} = \dfrac{Div^0\rb{E}}{Prin\rb{E}}. $$
Alternatively, $ Pic^0\rb{E} $ can also be thought of as $ Div^0\rb{E} $ modulo an equivalence relation $ \sim $, where
$$ D \sim D' \qquad \iff \qquad D - D' \ \text{is principal}. $$

\pagebreak

\section{The Riemann-Roch theorem}

Before proceeding to the proof in the next section, a fundamental result in algebraic geometry concerning divisors will be stated in this section in its full generality. Although it is possible to complete the proof without this theorem, its statement allows for a simpler argument. Let $ C $ be an algebraic curve throughout. The notion of a \emph{divisor} $ D \in Div\rb{C} $ and the results that follow can be defined analogously. Now let $ \le $ be a partial order on $ Div\rb{C} $ defined by
$$ \sum_{P \in C} n_P\sb{P} \le \sum_{P' \in C'} n'_{P'}\sb{P'} \qquad \iff \qquad \forall P \in C \cup C', \ n_P \le n'_{P'}. $$
For any divisor $ D \in Div\rb{C} $, define a finite-dimensional $ K $-vector space of functions by
$$ \LL\rb{D} = \cb{f \in K\rb{C}^* \mid div\rb{f} \ge -D} \cup \cb{0}, $$
denoting its dimension as
$$ l\rb{D} = \dim_K\rb{\LL\rb{D}}. $$
The theorem can then be stated as follows.

\begin{theorem}[Riemann-Roch]
\label{thm:riemannroch}
Let $ D \in Div\rb{C} $ be a divisor. There is a divisor $ K_C \in Div\rb{C} $ such that
$$ l\rb{D} - l\rb{K_C - D} = \deg\rb{D} - g_C + 1, $$
where $ g_C $ is the genus of $ C $.
\end{theorem}

\begin{remark}
The divisor $ K_C $ in Theorem \ref{thm:riemannroch} is called a \emph{canonical divisor}. It is the divisor $ div\rb{\omega} $ of some \emph{meromorphic differential} $ \omega $ in the \emph{$ K\rb{C} $-vector space of meromorphic differential forms} $ \Omega_C $. In turn, it is a divisor of the \emph{canonical divisor class} subgroup $ div\rb{\Omega_C} $ of $ Pic\rb{C} $.
\end{remark}

The proof of Theorem \ref{thm:riemannroch} can be found in basic algebraic geometry books. Fortunately, the argument in the next section does not require formally defining $ K_C $, leaving the following corollary sufficient for purposes of the proof.

\begin{corollary}[Roch]
\label{thm:roch}
Let $ D \in Div\rb{C} $ be a divisor such that $ \deg\rb{D} > 2g_C - 2 $. Then
$$ l\rb{D} = \deg\rb{D} - g_C + 1. $$
Furthermore, if $ C = E $ and $ \deg\rb{D} > 0 $, then
$$ l\rb{D} = \deg\rb{D}. $$
\end{corollary}

\begin{proof}
Let $ f \in \LL\rb{0}^* $ be a function, so
$$ div\rb{f} = \sum_{P \in C} n_P\sb{P}, $$
for some finite basis $ C \subseteq E $, and some $ n_P \in \Z $. Then $ div\rb{f} \ge 0 $, so $ n_P \ge 0 $ for all $ P \in C $. Since $ \deg\rb{div\rb{f}} = 0 $, it holds that $ n_P = 0 $ for all $ P \in C $, so $ div\rb{f} = 0 $. Proposition \ref{prop:ag} gives that $ f $ is constant, so $ \LL\rb{0} = K $. Hence $ l\rb{0} = 1 $, so letting $ D = 0 $ in Theorem \ref{thm:riemannroch} gives
$$ l\rb{0} - l\rb{K_C - 0} = \deg\rb{0} - g_C + 1 \qquad \implies \qquad l\rb{K_C} = g_C. $$
Similarly, letting $ D = K_C $ in Theorem \ref{thm:riemannroch} gives
$$ l\rb{K_C} - l\rb{K_C - K_C} = \deg\rb{K_C} - g_C + 1 \qquad \implies \qquad \deg\rb{K_C} = 2g_C - 2. $$
Now let $ D $ be the given divisor. If $ l\rb{K_C - D} \ne 0 $, then let $ f \in \LL\rb{K_C - D}^* $ be a function, so $ div\rb{f} \ge K_C - D $. Then
$$ 0 = \deg\rb{div\rb{f}} \ge \deg\rb{K_C - D} = \deg\rb{K_C} - \deg\rb{D} < \rb{2g_C - 2} - \rb{2g_C - 2} = 0, $$
which is a contradiction. Hence $ l\rb{K_C - D} = 0 $. Thus Theorem \ref{thm:riemannroch} gives
$$ l\rb{D} = \deg\rb{D} - g_C + 1. $$
The final part follows by virtue of the genus $ g_E = 1 $ of elliptic curves.
\end{proof}

\section{Summation}

The required bijection is defined as follows.

\begin{definition}
Let $ D \in Div\rb{E} $ be a divisor as in Definition \ref{def:divisor}. Then the \textbf{sum} of $ D $ is
$$ sum\rb{D} = \sum_{P \in C} n_PP \in E. $$
Define the \textbf{summation} map as the restriction of $ sum $ onto the subgroup $ Div^0\rb{E} $,
$$ \function[\sigma]{Div^0\rb{E}}{E}{\sum_{P \in C} n_P\sb{P}}{\sum_{P \in C} n_PP}, $$
and denote its inverse by
$$ \function[\kappa]{E}{Div^0\rb{E}}{P}{\sb{P} - \sb{\OO}}. $$
\end{definition}

With the first isomorphism theorem, Theorem \ref{thm:bijection} is equivalent to the following two propositions and an application of forgetful functors.

\begin{proposition}
\label{prop:image}
$ Im\rb{\sigma} = E $.
\end{proposition}

Proposition \ref{prop:image} is practically trivial, considering $ \kappa $.

\begin{proof}
It is sufficient to verify that $ \kappa $ is well-defined. Let $ P \in E $ be a point. Then $ \deg\rb{\sb{P} - \sb{\OO}} = 1 - 1 = 0 $, so $ \sb{P} - \sb{\OO} \in Div^0\rb{E} $. Now $ \sigma\rb{\sb{P} - \sb{\OO}} = P - \OO = P $, so $ P \in Im\rb{E} $. Hence $ E \subseteq Im\rb{E} \subseteq E $. Thus $ Im\rb{\sigma} = E $.
\end{proof}

\begin{proposition}
\label{prop:kernel}
$ Ker\rb{\sigma} = Prin\rb{E} $.
\end{proposition}

Proposition \ref{prop:kernel} requires more work, starting with the following lemma that utilises Theorem \ref{thm:roch}.

\begin{lemma}
Let $ P, Q \in E $ be points. Then
$$ P = Q \qquad \iff \qquad \sb{P} \sim \sb{Q}. $$
\end{lemma}

\begin{proof}
The forward direction is clear. Conversely, assume that $ \sb{P} \sim \sb{Q} $. Then there is some function $ f \in K\rb{E}^* $ such that $ div\rb{f} = \sb{P} - \sb{Q} $, so $ f \in \LL\rb{\sb{Q}} $. Hence Theorem \ref{thm:roch} gives
$$ l\rb{\sb{Q}} = \deg\rb{\sb{Q}} = 1, $$
so $ f $ is constant. Thus $ P - Q = \OO $, so $ P = Q $.
\end{proof}

The following lemma relates the group law definition with linear equivalence of divisors.

\begin{lemma}
Let $ P, Q \in E $ be points. Then
$$ \sb{P} + \sb{Q} \sim \sb{P + Q} + \sb{\OO}. $$
\end{lemma}

\begin{proof}
Let $ L : f\rb{x, y} = 0 $ be the unique line through $ P $, $ Q $, and $ -\rb{P + Q} $. Then $ f $ has exactly three zeroes at these points. Since $ \deg\rb{div\rb{f}} = 0 $ and $ f $ has no affine poles, it holds that $ f $ has exactly one triple pole at $ \OO $. Hence
$$ div\rb{f} = \sb{P} + \sb{Q} + \sb{-\rb{P + Q}} - 3\sb{\OO}. $$
Now let $ L' : g\rb{x, y} = 0 $ be the unique line through $ P + Q $, $ -\rb{P + Q} $, and $ \OO $. Similarly,
$$ div\rb{g} = \sb{P + Q} + \sb{-\rb{P + Q}} - 2\sb{\OO}. $$
Hence
$$ div\rb{\dfrac{f}{g}} = div\rb{f} - div\rb{g} = \sb{P} + \sb{Q} - \sb{P + Q} - \sb{\OO}. $$
Thus
$$ \sb{P} + \sb{Q} \sim \sb{P + Q} + \sb{\OO}. $$
\end{proof}

The following lemma consequently hinges on this observation.

\begin{lemma}
Let $ D \in Div^0\rb{E} $ be a divisor of degree zero. Then
$$ D \sim \sb{P} - \sb{Q}, \qquad \sigma\rb{D} = P - Q, $$
for some points $ P, Q \in E $.
\end{lemma}

\begin{proof}
Let
$$ D = \sum_{P \in C} n_P\sb{P} - \sum_{P' \in C'} n'_{P'}\sb{P'}, $$
for some finite subsets $ C, C' \subseteq E $ such that $ C \cup C' \subseteq E $ is a finite basis, and some $ n_P, n'_{P'} \in \N $ such that
$$ \sum_{P \in C} n_P - \sum_{P' \in C'} n'_{P'} = \deg\rb{D} = 0. $$
Then for any $ P, P' \in C $ or any $ P, P' \in C' $,
$$ \sb{P} + \sb{P'} = \sb{P + P'} + \sb{\OO} + div\rb{f}, $$
for some function $ f \in K\rb{E}^* $ such that
$$ \sigma\rb{div\rb{f}} = \sigma\rb{\sb{P} + \sb{P'} - \sb{P + P'} + \sb{\OO}} = P + P' - \rb{P + P'} + \OO = \OO. $$
Hence by induction,
$$ D = \rb{\sb{P} + \rb{\sum_{P \in C} n_P - 1}\sb{\OO}} - \rb{\sb{Q} + \rb{\sum_{P' \in C'} n'_{P'} - 1}\sb{\OO}} + div\rb{g} = \sb{P} - \sb{Q} + div\rb{g}, $$
for some function $ g \in K\rb{E}^* $ such that $ \sigma\rb{div\rb{g}} = 0 $, where
$$ P = \sum_{P \in C} n_PP, \qquad Q = \sum_{P' \in C'} n'_{P'}P'. $$
Thus
$$ \sigma\rb{D} = \sigma\rb{\sb{P} - \sb{Q} + div\rb{g}} = P - Q. $$
\end{proof}

\begin{proof}[Proof of Proposition \ref{prop:kernel}]
Let $ D \in Div^0\rb{E} $ be a divisor of degree zero. Then
\begin{align*}
D \in Ker\rb{\sigma} \qquad
& \iff \qquad \sigma\rb{D} = \OO \\
& \iff \qquad P = Q & \text{for some points} \ P, Q \in E \\
& \iff \qquad \sb{P} \sim \sb{Q} \\
& \iff \qquad D \sim 0 & \iff \qquad D \in Prin\rb{E}.
\end{align*}
Thus $ Ker\rb{\sigma} = Prin\rb{E} $.
\end{proof}

Hence Theorem \ref{thm:bijection} follows. The observation that for any points $ P, Q, R \in E $,
$$ P + Q = R \qquad \iff \qquad \rb{\sb{P} - \sb{\OO}} + \rb{\sb{Q} - \sb{\OO}} \sim \rb{\sb{R} - \sb{\OO}}, $$
is clear from the definition of $ \kappa $. Thus Theorem \ref{thm:isomorphism} follows as well.

\begin{remark}
In fact, the following fundamental \emph{exact sequence} in algebraic number theory, applied to elliptic curves, would provide a succinct summary.
$$ 1 \rightarrow K^* \xrightarrow{\subseteq} K\rb{E}^* \xrightarrow{div} Div^0\rb{E} \xrightarrow{\sigma} E \cong Pic^0\rb{E} \rightarrow 1. $$
\end{remark}

\section{References}

\begin{enumerate}[label={[\arabic*]}]
\item J Silverman's 1986 book \emph{The arithmetic of elliptic curves} \label{gtm}
\item L Washington's 2003 book \emph{Elliptic curves: number theory and cryptography} \label{ntc}
\item R Hartshorne's 1977 book \emph{Algebraic geometry} \label{ag}
\end{enumerate}

\end{document}


% \subsection{Proof of Proposition~\ref{prop:41:Lagrangian}}
% \label{sec:5:proofLagrangian}

We include here the missing details of the proof of Proposition~\ref{prop:41:Lagrangian}.
%
First, we need to justify that the objective function is quasi-convex, in each of its coordinates.
%
Then, we develop the computation of $D_i^*(\lambda)$, as a closed form expression of the system parameters ($K, p$), the distribution of static devices ($S_1,\dots,S_{K}$) and the Lagrange multiplier $\lambda$.

\paragraph{Quasi-convexity.}

\begin{itemize}
	\item
	For $0 < \gamma < 1$, the function $g(x) \eqdef x \gamma^x$ is quasi-convex on $[0,\infty)$, \ie, $g(\eta x + (1-\eta)y) \leq \max(g(x), g(y))$ for any $x,y \in [0,\infty)$ and $\eta \in [0,1]$ (definition from \cite{Luenberger68}).
    Indeed, $g(\eta x + (1-\eta)y) = \eta \left[ x (\gamma^x)^{\eta} \right] \gamma^{((1-\eta)y)} + (1-\eta)\left[ y (\gamma^y)^{1-\eta}\right] \gamma^{\eta x}$, and $\gamma^{((1-\eta)y)} \leq 1$ and $\gamma^{\eta x} \leq 1$. But also $(\gamma^x)^{\eta} \leq \gamma^x$ as $\eta \leq 1$, and the same holds for $(\gamma^y)^{1-\eta} \leq \gamma^y$. So $g(\eta x + (1-\eta)y) \leq \eta (x \gamma^x) + (1 - \eta) (y \gamma^y)$ which is a convex combination of $x \gamma^x$ and $y \gamma^y$, so smaller than the larger of the two values, and so $g(\eta x + (1-\eta)y) \leq \max(x \gamma^x, y \gamma^y)$.

    \item
    The function $f(D_1, \dots, D_{K}) \eqdef \sum\limits_{i=1}^{K} D_i (1 - p)^{S_i + D_i -1}$ is quasi-convex in each of its coordinates, on $[0,\infty)^{K}$, as a sum of component-wise quasi-convex functions (with $\gamma = (1 - p) \in (0, 1)$, thanks to the first point).
    \hfill{}$\square$
\end{itemize}

\paragraph{Derivation of the Lagrange multiplier solution.}

Let us now prove the expression for $D_i^*$ given above in \eqref{eq:41:Dilambda}.

\begin{itemize}
	\item
	If $\boldsymbol{D} \eqdef (D_1,\dots,D_{K})$,
    the Lagrangian is denoted $\mathcal{L}(\boldsymbol{D}, \lambda) \eqdef f(\boldsymbol{D}) + \lambda(D - \sum\limits_{i=1}^{K} D_i)$, and its derivative w.r.t. $D_i$ is
    $\frac{\partial}{\partial D_i} \mathcal{L}(\boldsymbol{D}, \lambda) = (1-p)^{S_i + D_i - 1} + \log(1 - p) D_i (1-p)^{S_i + D_i - 1} - \lambda$.

    \item
    So the gradient is zero $\frac{\partial}{\partial D_i} \mathcal{L}(\boldsymbol{D}, \lambda) |_{D_i=D_i^*} = 0$
    iff $D_i^*$ satisfies $(1-p)^{D_i^*}( 1 + \log(1-p) D_i^*) = \lambda / (1-p)^{S_i - 1}$. Let $x = \log(1-p) D_i^*$ this is equivalent to $\e^{x}(1 + x) = \lambda / (1-p)^{S_i - 1}$
    and with $y = 1 + x$, we get $\e^{y}y = \lambda\e / (1-p)^{S_i - 1}$.

	\item
    By using the $\mathcal{W}$-Lambert function $\mathcal{W}$ \cite{Corless96}, reciprocal of $y \mapsto \e^{y}y$, we get $x = y - 1 = \mathcal{W}(\lambda\e / (1-p)^{S_i - 1}) - 1$.
    So the gradient of the Lagrangian is zero iff $D_i^* = \max(0, x/\log(1-p)) = \left[ \frac{1}{\log(1-p)}\mathcal{W}(\lambda\e / (1-p)^{S_i - 1}) - 1\right]^{+}$, because $D_i^*$ has to be non-negative.
    This gives the $i$-th coordinate of the unique saddle point of $f(\boldsymbol{D})$,
    and so the unique solution to the maximization problem \eqref{eq:41:optPb}, thanks to \cite[Theorem 1]{Luenberger68}.
    \hfill{}$\square$
\end{itemize}