%% -*- coding:utf-8 -*-
\chapter{Objects and morphisms}

\section{Equality}

The important question is how can we decide whenever an
object/morphism is equal to another object/morphism? The trivial
answer is possible if an \mynameref{def:object} is a
\mynameref{def:set}. In the case we can say that 2 objects are equal
if they contain the equivalent collection of elements. Unfortunately
we cannot do the same trick for categorical \mynameref{def:object}s as
soon as they don't have any internal
structure but can use a \mynameref{def:categorical_approach} (see
\mynameref{rem:set_vs_category}): if we cannot use ``microscope'' lets
use ``telescope'' and define the equality of objects and morphisms of
a category $\cat{C}$ in the terms of whole $\cathom{C}$.

\begin{definition}[Objects equality]
\label{def:object_equality}
Two \mynameref{def:object}s $a$ and $b$ in \mynameref{def:category}
$\cat{C}$ are equal if there exists an unique
\mynameref{def:isomorphism} $a \cong_f b$. This also means that
also exist unique isomorphism $b \cong_g a$. These two
\mynameref{def:morphism}s ($f$ and $g$) are related each other via
the following equations: $f \circ g = \idm{a}$ and $g \circ f
= \idm{b}$.
\end{definition}

Unlike \mynameref{def:function}s between \mynameref{def:set}s we don't
have any additional info
\footnote{
for instance info about sets internals. i.e. which elements of the sets
are connected by the considered functions
}
about \mynameref{def:morphism}s except
category theory axioms which the morphisms satisfy
\cite{bib:stackexchange:morphism:equality}. This leads us to the
following definition of morphims equality:
\begin{definition}[Morphisms equality]
\label{def:morphism_equality}
Two \mynameref{def:morphism}s $f$ and $g$ in \mynameref{def:category}
$\cat{C}$ are equal if the equality can be derived from the base axioms:
\begin{itemize}
\item \mynameref{axm:composition}
\item \mynameref{axm:associativity}
\item \mynameref{def:id}: \eqref{eq:leftid}, \eqref{eq:rightid}
\end{itemize}
or \mynameref{def:commutative_diagram}s which postulate the equality.
\end{definition}
As an example lets proof the following theorem
\begin{theorem}[Identity is unique]
\label{thm:identity_unique}
The \mynameref{def:id} is unique.
\begin{proof}
Consider an \mynameref{def:object} $a$ and it's \mynameref{def:id}
$\idm{a}$. Let $\exists f: a \to a$ such that $f$ is also
identity. In the case \eqref{eq:leftid} for $f$ as identity gives
\[
f \circ \idm{a} = \idm{a}.
\]
From other side \eqref{eq:rightid} for $\idm{a}$ satisfied
\[
f \circ \idm{a} = f
\]
i.e.
\[
f = f \circ \idm{a} = \idm{a}
\]
or
$f = \idm{a}$.
\end{proof}
\end{theorem}

\section{Initial and terminal objects}
\begin{definition}[Initial object]
\label{def:initial_object}
Let $\cat{C}$ is a \mynameref{def:category}, the
\mynameref{def:object} $i \in \catob{C}$ is called
\textit{initial object} if $\forall x \in \catob{C}
\exists! f_x: i \to x \in \cathom{C}$.
\end{definition}

\begin{example}[Initial object][\textbf{Set}]
\label{ex:set_initial_object}
Note that there is only one function from empty set to any other sets
\cite{bib:proofwiki:Empty_Mapping_is_Unique} that makes the empty set
as the \mynameref{def:initial_object} in \mynameref{def:setcategory}.
\end{example}

\begin{definition}[Terminal object]
\label{def:terminal_object}
Let $\cat{C}$ is a \mynameref{def:category}, the
\mynameref{def:object} $t \in \catob{C}$ is called
\textit{terminal object} if $\forall x \in \catob{C}
\exists! g_x: x \to t \in \cathom{C}$.
\end{definition}

\begin{example}[Terminal object][\textbf{Set}]
\label{ex:set_terminal_object}
\mynameref{def:terminal_object} in \mynameref{def:setcategory} is a set
with one element i.e \mynameref{def:singleton_set}.
\end{example}

As you can see the initial and terminal objects are opposite each
other. I.e. if $i$ is an \mynameref{def:initial_object} in $\cat{C}$
then it will be \mynameref{def:terminal_object} in
the \mynameref{def:op_category} $\cat{C^{op}}$.

\begin{theorem}[Initial object is unique]
\label{thm:initial_object_unique}
Let $\cat{C}$ is a category and $i, i' \in \catob{C}$ two
\mynameref{def:initial_object}s then there exists an unique
\mynameref{def:isomorphism} $u: i \to i'$ (see
\mynameref{def:object_equality})
\begin{proof}
Consider the following \mynameref{def:commutative_diagram} (see
\cref{fig:initial_object_unique}). As soon as $i$ initial object
$\exists! \, u: i \to i'$. From other side $i'$ is also initial object
and therefore $\exists! \, u^{-1}: i' \to i$. Combining them together
via composition we can get $u^{-1} \circ u: i \to i$ and $u \circ
u^{-1}: i' \to i'$. From the fact that $i$ is initial object one can
get that there exists
only one morphism $\idm{i}: i \to i$. The same is the truth for $i'$.
Therefore $u^{-1} \circ u = \idm{i}$ and $u \circ u^{-1} = \idm{i'}$.
These complete the commutative diagram build and finishes the proof.
\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=above:$i$] (i1) at (0,3) {};
    \node[ele,label=above:$i'$] (i2) at (3,3) {};
    \node[ele,label=below:$i$] (i12) at (3,0) {};
    \node[ele,label=below:$i'$] (i22) at (6,0) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (i1) to
    node[sloped,above]{$u$} (i2);
    \draw[->,thick,shorten <=2pt,shorten >=2] (i12) to
    node[sloped,above]{$u$} (i22);
    \draw[->,thick,shorten <=2pt,shorten >=2] (i1) to
    node[sloped,above]{$\idm{i}$} (i12);
    \draw[->,thick,shorten <=2pt,shorten >=2] (i2) to
    node[sloped,above]{$\idm{i'}$} (i22);
    \draw[->,thick,shorten <=2pt,shorten >=2] (i2) to
    node[right]{$u^{-1}$} (i12);
  \end{tikzpicture}
  \caption{Commutative diagram for initial object uniqueness  proof}
  \label{fig:initial_object_unique}
\end{figure}
\end{proof}
\end{theorem}

\begin{theorem}[Terminal object is unique]
\label{thm:terminal_object_unique}
Let $\cat{C}$ is a category and $t, t' \in \catob{C}$ two
\mynameref{def:terminal_object}s then there exists an unique
\mynameref{def:isomorphism} $v: t' \to t$ (see
\mynameref{def:object_equality})
\begin{proof}
Just got to the \mynameref{def:op_category} and revert arrows in
\cref{fig:initial_object_unique}. The result shown on
\cref{fig:terminal_object_unique} and it proofs the theorem statement.
\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=above:$t$] (t1) at (0,3) {};
    \node[ele,label=above:$t'$] (t2) at (3,3) {};
    \node[ele,label=below:$t$] (t12) at (3,0) {};
    \node[ele,label=below:$t'$] (t22) at (6,0) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (t2) to
    node[sloped,above]{$v$} (t1);
    \draw[->,thick,shorten <=2pt,shorten >=2] (t22) to
    node[sloped,above]{$v^{-1}$} (t12);
    \draw[->,thick,shorten <=2pt,shorten >=2] (t12) to
    node[sloped,above]{$\idm{t}$} (t1);
    \draw[->,thick,shorten <=2pt,shorten >=2] (t22) to
    node[sloped,above]{$\idm{t'}$} (t2);
    \draw[->,thick,shorten <=2pt,shorten >=2] (t12) to
    node[right]{$v^{-1}$} (t2);
  \end{tikzpicture}
  \caption{Commutative diagram for terminal object uniqueness proof}
  \label{fig:terminal_object_unique}
\end{figure}
\end{proof}
\end{theorem}

\begin{example}[Toy example]
In our toy example \cref{fig:pl_example} the type String is
\mynameref{def:initial_object} and type Bool is the
\mynameref{def:terminal_object}.
\end{example}

\section{Product and sum}
The pair of 2 objects is defined via the universal property in
the following way:
\begin{definition}[Product]
\label{def:product}
Let we have a category $\cat{C}$ and $c_1, c_2 \in \catob{C}$ -two
\mynameref{def:object}s then the product of the objects $c_1, c_2$ is
another object in $\cat{C}$ $c = c_1 \times c_2$ with 2
\mynameref{def:morphism}s $\pi_1, \pi_2$ such that $c_1 = \pi_1(c),
c_2 = \pi(c_2)$ and the
following universal property is satisfied: $\forall c' \in \catob{C}$
and morphisms $\pi'_1: c' \to c_1, \pi'_2: c' \to c_2$, exists unique
morphism $h$ such that the following diagram (see \cref{fig:product})
commutes, i.e. $\pi'_1 = \pi_1 \circ h, \pi'_2 = \pi_2 \circ h$.
\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=left:$c_1$] (a) at (0,0) {};
    \node[ele,label=right:$c_2$] (b) at (4,0) {};
    \node[ele,label=below:$c$] (c) at (2,0) {};
    \node[ele,label=above:$c'$] (c') at (2,3) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to
    node[sloped,above]{$\pi_1$} (a);
    \draw[->,thick,shorten <=2pt,shorten >=2] (c) to
    node[sloped,above]{$\pi_2$} (b);
    \draw[->,thick,shorten <=2pt,shorten >=2] (c') to
    node[sloped,above]{$\pi'_1$} (a);
    \draw[->,thick,shorten <=2pt,shorten >=2] (c') to
    node[sloped,above]{$\pi'_2$} (b);
    \draw[->,thick,shorten <=2pt,shorten >=2] (c') to
    node[right]{$h$} (c);
  \end{tikzpicture}
  \caption{Product $c = c_1 \times c_2$. $\forall c, \exists! h \in
    \cathom{C}: \pi'_1 = \pi_1 \circ h, \pi'_2 = \pi_2 \circ h$.}
  \label{fig:product}
\end{figure}
In other words $h$ factorizes $\pi'_{1,2}$.
\end{definition}

\begin{example}[Product][\textbf{Set}]
\label{ex:set_product}
The \mynameref{def:product} of two sets $A$ and $B$ in
\mynameref{def:setcategory} is defined
as a \mynameref{def:cartesian_product}: $A \times B = \{(a,b)| a \in A, b \in B\}$.
\end{example}

If we invert arrows in \mynameref{def:product} we will got another
object definition that is called sum

\begin{definition}[Sum]
\label{def:sum}
Let we have a category $\cat{C}$ and $c_1, c_2 \in \catob{C}$ -two
\mynameref{def:object}s then the sum of the objects $c_1, c_2$ is
another object in $\cat{C}$ $c = c_1 \oplus c_2$ with 2
\mynameref{def:morphism}s $i_1, i_2$ such that $c = i_1(c_1), c = i_2
(c_2)$ and the
following universal property is satisfied: $\forall c' \in \catob{C}$
and morphisms $i'_1: c_1 \to c', i'_2: c_2 \to c'$, exists unique
morphism $h$ such that the following diagram (see \cref{fig:sum})
commutes, i.e. $i'_1 = h \circ i_1, i'_2 = h \circ i_2$.
\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=left:$c_1$] (a) at (0,0) {};
    \node[ele,label=right:$c_2$] (b) at (4,0) {};
    \node[ele,label=below:$c$] (c) at (2,0) {};
    \node[ele,label=above:$c'$] (c') at (2,3) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to
    node[sloped,above]{$i_1$} (c);
    \draw[->,thick,shorten <=2pt,shorten >=2] (b) to
    node[sloped,above]{$i_2$} (c);
    \draw[->,thick,shorten <=2pt,shorten >=2] (a) to
    node[sloped,above]{$i'_1$} (c');
    \draw[->,thick,shorten <=2pt,shorten >=2] (b) to
    node[sloped,above]{$i'_2$} (c');
    \draw[->,thick,shorten <=2pt,shorten >=2] (c) to
    node[right]{$h$} (c');
  \end{tikzpicture}
  \caption{Sum $c = c_1 \oplus c_2$. $\forall c, \exists! h \in
    \cathom{C}: i'_1 = h \circ i_1, i'_2 = h \circ i_2 $.}
  \label{fig:sum}
\end{figure}
In other words $h$ factorizes $i'_{1,2}$.
\end{definition}

\begin{definition}[Disjoint union]
  \label{def:disjoint_union}
  Let $\{A_i: i \in I\}$ be a family of sets
  indexed by $I$. The
  \textit{disjoint union} \cite{wiki:disjointunion} of this family is
  the set
  \[
  \sqcup_{i \in I} A_i = \cup_{i \in I}\left\{
  \left(x, i\right): x \in A_i
  \right\}.
  \]
  The elements of the disjoint union are ordered pairs $(x, i)$. Here $i$
  serves as an auxiliary index that indicates which $A_i$ the element $x$
  came from.
\end{definition}

\begin{example}[Sum][\textbf{Set}]
  \label{ex:set_sum}
  The \mynameref{def:sum} of two sets $A$ and $B$ in
  \mynameref{def:setcategory} is defined as
  \mynameref{def:disjoint_union}.
\end{example}

The \mynameref{def:product} of objects will provide also a definition
for product of morphisms
\begin{definition}[Product of morphisms]
\label{def:product_of_morphisms}
Let $\cat{C}$ is a category and $a,a' \in \catob{C}$ and
$b, b' \in \catob{C}$ are 2 pairs of \mynameref{def:object}s that admit
\cref{def:product}. Consider 2 morphisms that connects the objects:
$f: a \to b, f': a' \to b'$ then we can create a new unique morphism that
connects the products: $f \times f': a \times a' \to b \times b'$ and
makes the diagram commute (see \cref{fig:product_of_morphisms}).

\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=above:$a$] (a) at (0,2) {};
    \node[ele,label=above:$a \times a'$] (aa') at (2,2) {};
    \node[ele,label=above:$a'$] (a') at (4,2) {};
    \node[ele,label=below:$b$] (b) at (0,0) {};
    \node[ele,label=below:$b \times b'$] (bb') at (2,0) {};
    \node[ele,label=below:$b'$] (b') at (4,0) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to
    node[sloped,above]{$f$} (b);
    \draw[->,thick,shorten <=2pt,shorten >=2pt] (a') to
    node[sloped,above]{$f'$} (b');
    \draw[->,thick,shorten <=2pt,shorten >=2pt] (aa') to
    node[sloped,above]{$f \times f'$} (bb');

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (aa') to
    node[sloped,above]{$\pi_a$} (a);
    \draw[->,thick,shorten <=2pt,shorten >=2] (aa') to
    node[sloped,above]{$\pi_{a'}$} (a');
    \draw[->,thick,shorten <=2pt,shorten >=2pt] (bb') to
    node[sloped,above]{$\pi_b$} (b);
    \draw[->,thick,shorten <=2pt,shorten >=2] (bb') to
    node[sloped,above]{$\pi_{b'}$} (b');
  \end{tikzpicture}
  \caption{Product of morphisms.}
  \label{fig:product_of_morphisms}
\end{figure}
\end{definition}

\section{Category as a monoid}
Consider the following definition from abstract algebra
\begin{definition}[Monoid]
  \label{def:monoid}
  The set of elements $M$ with defined binary operation $\circ$ we will call
  as a monoid if the following conditions are satisfied.
  \begin{enumerate}
  \item Closure: $\forall a, b \in M$: $a \circ b \in M$
  \item Associativity: $\forall a, b, c \in M$:
    $a \circ \left( b \circ c \right) =
    \left( a \circ b \right) \circ c$
  \item Identity element: $\exists e \in M$ such that
    $\forall a \in M$: $e \circ a = a \circ e = a$
  \end{enumerate}
\end{definition}

We can consider 2 \mynameref{def:monoid}s. The first one has
\mynameref{def:product} as the binary operation and
\mynameref{def:terminal_object} as the identity element. As result we
just got an analog of multiplication in the category theory. This is why
the terminal object is often denoted as $\mathbf{1}$ and the operation
is called as the product.

Another one is additional \mynameref{def:monoid} that has
\mynameref{def:initial_object} as the identity element and the
\mynameref{def:sum} as the binary operation. The initial object in
that case  is often denoted as $\mathbf{0}$. I.e. we can see a direct
connection with addition in algebra.

If we do such consideration then we can make a step forward and look
at the distributive law that sum and multiplication satisfy.
\begin{definition}[Distributive category]
\label{def:distributive_category}
A category $\cat{C}$ is \textit{distributive} if
\cite{wiki:distributive_category}
it has finite
\mynameref{def:product}s and \mynameref{def:sum}s such that
$\forall a,b,c \in \catob{C}$:
\[
a \times b \oplus a \times c \cong a \times ( b \oplus c )
\]
and
\[
a \times 0 \cong 0
\]
where $\mathbf{0}$ is the \mynameref{def:initial_object}.
\end{definition}

\begin{example}[Distributive category]
\label{ex:distributive_category}
\mynameref{def:setcategory} is an example
\cite{wiki:distributive_category}
of \mynameref{def:distributive_category}

From other hand not all categories which have both product and sum are
distributive. One of such example is a category of all groups
\cite{wiki:distributive_category}
$\cat{Grp}$ where groups are considered as objects and group
homomorphisms as morphisms.
\end{example}

\section{Exponential}
We are going to talk about functions (aka morphisms) as
\mynameref{def:object}s.

\begin{example}[Hom set]
\label{ex:homset}
Consider 2 sets $A$ and $B$ the set of functions between the 2 sets
form a new set that is called as \textit{Hom-set} and denoted as $A
\to B$. Thus if $A,B \in \catob{Set}$ then the Hom-set will also $A
\to B \in \catob{Set}$.
\end{example}

The construction of \mynameref{ex:homset} is applied to
\mynameref{def:setcategory} but not to an arbitrary category because
the Hom-set is a set and therefore the object in the \textbf{Set}
category. I.e. if $\cat{C}$ is a category and $a, b \in \catob{C}$
then the Hom-set $a \to b \in \catob{Set}$ but we now want to
construct something like to the Home-set but that is an object in
$\cat{C}$. This will be called as the function object. We will use the
universal construction for the object definition.

\begin{definition}[Exponential]
\label{def:exponential}
\begin{figure}
  \centering
  \begin{tikzpicture}[ele/.style={fill=black,circle,minimum
        width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner
        sep=-2pt}]

    % the texts

    \node[ele,label=above:$z'$] (z1) at (0,3) {};
    \node[ele,label=below:$z^y$] (zy) at (0,0) {};
    \node[ele,label=above:$z' \times y$] (z1y) at (3,3) {};
    \node[ele,label=below:$z^y \times y$] (zyy) at (3,0) {};
    \node[ele,label=below:$z$] (z) at (6,0) {};

    \draw[->,thick,shorten <=2pt,shorten >=2pt] (z1) to
    node[left]{$h$} (zy);
    \draw[->,thick,shorten <=2pt,shorten >=2] (z1y) to
    node[left]{$h \times \idm{y}$} (zyy);
    \draw[->,thick,shorten <=2pt,shorten >=2] (z1y) to
    node[sloped,above]{$e'$} (z);
    \draw[->,thick,shorten <=2pt,shorten >=2] (zyy) to
    node[sloped,above]{$e$} (z);
  \end{tikzpicture}
  \caption{Exponential object}
  \label{fig:exponential}
\end{figure}
Let $\cat{C}$ is a category and $z, y \in \catob{C}$. We also assume
that $\cat{C}$ allows all \mynameref{def:product}s with $y$, i.e.
$\forall z' \in \catob{C}, \exists z' \times y$. An object $z^y$
together with a \mynameref{def:morphism} $e: z^y \times y \to z$ is
an \textit{exponential object} if $\forall e' \in \cathom{C}$ and
$\forall z' \in \catob{C}$ exists an
unique morphism $h: z' \to z$ such that the
\mynameref{def:commutative_diagram} shown in \cref{fig:exponential}
commutes:
\[
e' = e \circ \left(h \times \idm{y} \right)
\]
\end{definition}

\begin{example}[Exponential][\textbf{Set}]
\label{ex:exponential_set}
Lets look at the \mynameref{def:exponential} in $\cat{Set}$. We want
to show that the object corresponds to the function. Really if we want
to define a function $f: X \to Y$ then we should look at the
\mynameref{ex:homset} $F = X \to Y$. $f \in F$ - is an element of the
Hom-set. For the function application we have to take the argument $x
\in X$ and the function we want to apply $f \in F$. Then we construct
the pair $(f,x) \in F \times X$. For the function application we have
to call a \mynameref{def:morphism} $e: F \times X \to Z$.
\footnote{$e$ from the word ``eval''}
I.e. the
application $e(f, x)$ gives us $e(f, x) = y \in Y$ - the function
value.
\end{example}

\begin{definition}[Cartesian closed category]
\label{def:cartesian_closed_category}
If a category $\cat{C}$ satisfies the following conditions then it is
called \textit{Cartesian closed category}
\begin{enumerate}
\item It has \mynameref{def:terminal_object}
\item $\forall a,b \in \catob{C}$ exists \mynameref{def:product} $a
  \times b \in \catob{C}$.
\item $\forall a,b \in \catob{C}$ exists \mynameref{def:exponential}
  $a^b \in \catob{C}$
\end{enumerate}
\end{definition}

\begin{theorem}[Cartesian closed category]
\label{thm:ccc}
If $\cat{C}$ is a \mynameref{def:cartesian_closed_category} with
finite \mynameref{def:sum} then it is a
\mynameref{def:distributive_category}.
\begin{proof}
TBD
\end{proof}
\end{theorem}

\section{Type algebra and Curry-Howard-Lambek correspondence}
\label{sec:curry_howard_lambek}
There is an interesting correspondence between computer programs and
mathematical proofs. First of all consider a category of proofs
\subsection{\textbf{Proof} category}
\begin{definition}[Proposition]
\label{def:proposition}
\textit{Proposition} is a statement that either true or false.
\end{definition}

There are 2 main propositions
\begin{definition}[True]
\label{def:true}
A true statement is one that is correct, either in all cases or at
least in the sample case \cite{bib:studycom:truefalse}.
\end{definition}
and
\begin{definition}[False]
\label{def:false}
A false statement is one that is not correct \cite{bib:studycom:truefalse}.
\end{definition}

\begin{example}[Proposition]
\label{ex:proposition}
There is an example of correct (true) proposition
\[
\forall n \in \mathbb{R}: n^2 \ge 0
\]

There is an example of incorrect (false) proposition
\[
\forall n \in \mathbb{C}: n^2 \ge 0,
\]
for instance $i \in \mathbb{C}$ gives $i^2 = -1$.

\end{example}

\begin{definition}[Implication]
\label{def:implication} \textit{An implication} is a
\mynameref{def:proposition} of the form $P \implies Q$ i.e. if $P$
then $Q$ \cite{bib:whatisaproof}.
\end{definition}

The main logical deduction rule is the following
\begin{definition}[Modus ponens]
\label{def:modusponens}
If $P$ is true and $P \implies Q$ is true then $Q$ is also true. The
rule is often written as \cite{bib:whatisaproof}
\[
\frac{
\begin{array}{c}
P \\
P \implies Q
\end{array}
}{Q}
\]
where if statements above the line are true then the statement below
the line is also true.
\end{definition}

\begin{definition}[Proof]
\label{def:proof}
\textit{Proof} is a verification \cite{bib:whatisaproof} of a
\mynameref{def:proposition} by a chain of logical deduction from a
base set of axioms.
\end{definition}

Propositions can be combined into new propositions via the following
logical operations
\begin{definition}[Conjunction]
\label{def:conjunction}
Conjunction or logical AND is the operation with following rules
  \begin{table}[H]
    \centering
    \caption{Conjunction}
    \label{tab:conjunction}
      \begin{tabular}{|l|l|l|}
        \hline
        $a$ & $b$ & $a \land b$ \\ \hline
        True & True & True \\ \hline
        True & False & False \\ \hline
        False & True & False \\ \hline
        False & False & False \\ \hline
      \end{tabular}
  \end{table}
\end{definition}
\begin{definition}[Disjunction]
\label{def:disjunction}
Conjunction or logical OR is the operation with following rules
  \begin{table}[H]
    \centering
    \caption{Disjunction}
    \label{tab:disjunction}
      \begin{tabular}{|l|l|l|}
        \hline
        $a$ & $b$ & $a \lor b$ \\ \hline
        True & True & True \\ \hline
        True & False & True \\ \hline
        False & True & True \\ \hline
        False & False & False \\ \hline
      \end{tabular}
  \end{table}
\end{definition}

Operations in Boolean logic follow the distributive low:
\begin{equation}
a \land ( b \lor c) = (a \land b) \lor (a \land c)
\nonumber
\end{equation}
i.e. the operation $\land$ corresponds to multiplication and $\lor$ to
sum. Therefore the $\cat{Proof}$ can be considered as a
\mynameref{def:distributive_category}.

\begin{definition}[\textbf{Proof} category]
\label{def:proof_category}
The $\cat{Proof}$ category is a category where \mynameref{def:proposition}s are
\mynameref{def:object}s and \mynameref{def:proof}s are
\mynameref{def:morphism}s. I.e. proofs are used as connectors between
different propositions.
\end{definition}

Consider different objects and constructions of the proof (logic)
theory from the categorical point of view
\begin{example}[Initial object][\textbf{Proof}]
\label{ex:proof_initial_object}
The \textit{false} statement can be considered as the initial object
because for any other statement exists only one proof from the false
statement to that one.
\end{example}

\begin{example}[Terminal object][\textbf{Proof}]
\label{ex:proof_terminal_object}
The \textit{true} statement can be considered as the terminal object
\end{example}

\begin{example}[Product][\textbf{Proof}]
\label{ex:proof_product}
\mynameref{def:conjunction} can be considered as
\mynameref{def:product} in \mynameref{def:proof_category}.
\end{example}

\begin{example}[Sum][\textbf{Proof}]
\label{ex:proof_sum}
\mynameref{def:disjunction} can be considered as
\mynameref{def:sum} in \mynameref{def:proof_category}.
\end{example}

Thus we can declare the following correspondence (see
\cref{tab:curry_howard_lambek}) between logic
proofs and \mynameref{def:cartesian_closed_category} and therefore
also between programming languages.
\begin{table}[H]
  \centering
  \caption{Relation between logic proofs and programming languages}
  \label{tab:curry_howard_lambek}
  \begin{adjustbox}{width=1\textwidth}
    \small
    \begin{tabular}{l|l|l}
      \toprule
      \mynameref{def:proof_category} & Programming language &
      \mynameref{def:cartesian_closed_category}\\
      \midrule
      \mynameref{def:proposition}/\mynameref{def:implication} & Type &
      \mynameref{def:object} \\
      \mynameref{def:proof} & Function type & \mynameref{def:exponential} \\
      \mynameref{def:conjunction} & Product type & \mynameref{def:product} \\
      \mynameref{def:disjunction} & Sum type & \mynameref{def:sum} \\
      \mynameref{def:true} & unit type & \mynameref{def:terminal_object} \\
      \mynameref{def:false} & botom type & \mynameref{def:initial_object} \\
      \bottomrule
    \end{tabular}
  \end{adjustbox}
\end{table}

\subsection{\textbf{Hask} category}
\begin{example}[Initial object][\textbf{Hask}]
If we avoid lazy evaluations in Haskell (see
\mynameref{rem:hask_lazy_eval}) then we can found several types
as candidates for initial and terminal object in Haskell.
\label{ex:hask_initial_object}
\mynameref{def:initial_object} in \mynameref{def:haskcategory} is a
type without values
\begin{minted}{haskell}
data Void
\end{minted}
i.e. you cannot construct a object of the type.

There is only one function from the initial object:
\begin{minted}{haskell}
absurd :: Void -> a
\end{minted}
The function is called absurd because it does absurd action. Nobody
can proof that it does not exist. For the existence proof the
following absurd argument can be used: ``Just provide me an object type
\mintinline{haskell}{Void} and I will provide you the result of
evaluation''.

There is no function in opposite direction because it would had been
used for the \mintinline{haskell}{Void} object creation.
\end{example}

\begin{example}[Terminal object][\textbf{Hask}]
\label{ex:hask_terminal_object}
Terminal object (unit) in \mynameref{def:haskcategory} keeps only one element
\begin{minted}{haskell}
data () = ()
\end{minted}
i.e. you can create only one element of the type. You can use the
following function for the creation:
\begin{minted}{haskell}
unit :: a -> ()
unit _ = ()
\end{minted}
\end{example}

\begin{example}[Product][\textbf{Hask}]
\label{ex:hask_product}
The \mynameref{def:product} in \mynameref{def:haskcategory} keeps a
pair and the constructor defined as follows
\begin{minted}{haskell}
(,) :: a -> b -> (a, b)
(,) x y = (x, y)
\end{minted}
There are 2 projectors:
\begin{minted}{haskell}
fst :: (a, b) -> a
fst (x, _) = x
snd :: (a, b) -> b
snd (_, y) = y
\end{minted}
\end{example}

\begin{example}[Sum][\textbf{Hask}]
\label{ex:hask_sum}
The \mynameref{def:sum} in \mynameref{def:haskcategory} defined as
follows
\begin{minted}{haskell}
data Either a b = Left a | Right b
\end{minted}

The typical usage is via pattern matching for instance
\begin{minted}{haskell}
factor :: (a -> c) -> (b -> c) -> Either a b -> c
factor f _ (Left x) = f x
factor _ g (Right y) = g y
\end{minted}
\end{example}

\begin{example}[Distributive category][\textbf{Hask}]
As soon as $\cat{Hask}$ is a \mynameref{def:cartesian_closed_category}
then by \cref{thm:ccc} it is a \mynameref{def:distributive_category}
i.e. one can conclude that
\begin{minted}{haskell}
(a,Either b c)
\end{minted}
is the same to
\begin{minted}{haskell}
Either (a, b) (a, c)
\end{minted}
\end{example}

\begin{example}[Exponential][\textbf{Hask}]
\label{ex:exponential_hask}
It's not surprisingly that the \mynameref{def:exponential} in
$\cat{Hask}$ is a function object i.e. $b^a$ can be written as
\mintinline{haskell}{a -> b}.
\end{example}

\begin{example}[Type algebra]
\cref{ex:exponential_hask} gives interesting results with types
manipulations. For instance the type $a^{b+c}$ can be written as
\begin{minted}{haskell}
Either b c -> a
\end{minted}
for the function we should have both functions
\mintinline{haskell}{b -> a} and \mintinline{haskell}{b -> c}. I.e.
the code is equivalent to the following one
\begin{minted}{haskell}
(b -> a, c -> a)
\end{minted}
These transformations correspond to the following simple algebraic
equation
\[
a^{b+c} = a^b a^c.
\]
This is also called as \textit{type algebra}.
\end{example}

\subsection{\textbf{C++} category}
\begin{example}[Initial object][\textbf{C++}]
\label{ex:cpp_initial_object}
In C++ exists a special type that does not hold any values and as
result cannot be created: \mintinline{c++}{void}.
You cannot create an object of that type i.e. you will get a compiler
error if you try.
\end{example}

\begin{example}[Terminal object][\textbf{C++}]
\label{ex:cpp_terminal_object}
C++ 17 introduced a special type that keeps only one value -
\mintinline{c++}{std::monostate}:
\begin{minted}{c++}
namespace std {
  struct monostate {};
}
\end{minted}
\end{example}

\begin{example}[Product][\textbf{C++}]
\label{ex:cpp_product}
The \mynameref{def:product} in \mynameref{def:cppcategory} keeps a
pair and the constructor defined as follows
\begin{minted}{c++}
namespace std {
  template< class A, class B > struct pair {
    A first;
    B second;
  };
}
\end{minted}

There is a simple usage example
\begin{minted}{c++}
  std::pair<int, bool> p(0, false);

  std::cout << "First projector: " << p.first << std::endl;
  std::cout << "Second projector: " << p.second << std::endl;

\end{minted}
Really any \mintinline{c++}{struct} or \mintinline{c++}{class} can be
considered as a product.
\end{example}

\begin{example}[Sum][\textbf{C++}]
  \label{ex:cpp_sum}
  If we consider \mynameref{def:object}s as types then
  \mynameref{def:sum} is an object that can be either one or another
  type. The corresponding C/C++ construction that provides an ability
  to keep one of two types is \mintinline{c++}{union}.

  %% There is an \mintinline{haskell}{Either} implementation from
  %% \mynameref{ex:hask_sum}
  %% \begin{minted}{c++}
  %%   template <typename A, typename B> class Either
  %%   {
  %%   public:
  %%     Either(const Either& e) : is_left_(e.is_left_){
  %%       if (is_left_){
  %%         data.l = e.data.l;
  %%       } else {
  %%         data.r = e.data.r;
  %%       }
  %%     }
  %%     ~Either(){
  %%       if (is_left_){
  %%         data.l.~A();
  %%       } else {
  %%         data.r.~B();
  %%       }
  %%     }
  %%     Either(const A& l) : data(l), is_left_(true){
  %%     }
  %%     Either(const B& r) : data(r), is_left_(false){
  %%     }
  %%     const A& left() const {
  %%       if (!is_left_){
  %%         throw std::logic_error("no left");
  %%       }
  %%       return data.l;
  %%     }
  %%     const B& right() const {
  %%       if (is_left_){
  %%         throw std::logic_error("no right");
  %%       }
  %%       return data.r;
  %%     }
  %%   private:
  %%     union Data {
  %%       Data() {}
  %%       Data( const A& a) : l(a) {}
  %%       Data (const B& b) : r(b) {}
  %%       ~Data() {}
  %%       A l;
  %%       B r;
  %%     } data;
  %%     bool is_left_;
  %%   };
  %% \end{minted}
  %% The usage example:
  %% \begin{minted}{c++}
  %%   template <typename A, typename B, typename C, typename D>
  %%   auto factor(A f, B g, const Either<C, D>& either) {
  %%     try {
  %%       return f(either.left());
  %%     }
  %%     catch(...) {
  %%       return g(either.right());
  %%     }
  %%   };

  %%   auto stringLength = [](std::string s) {
  %%     return static_cast<int>(s.size()); };
  %%   auto id = [](auto x) { return x; };

  %%   Either<std::string, int> str = std::string("abc");
  %%   std::cout << "String length:" <<
  %%   factor<>(stringLength, id, str) << std::endl;
  %%   Either<std::string, int> i = 4;
  %%   std::cout << "id(int):" <<
  %%   factor<>(stringLength, id, i) << std::endl;
  %% \end{minted}

  C++17 suggests \mintinline{c++}{std:variant} as a safe replacement
  for \mintinline{c++}{union}. The example of the \mintinline{c++}{factor}
  function is below
  \begin{minted}{c++}
    template <typename A, typename B, typename C, typename D>
    auto factor(A f, B g, const std::variant<C, D>& either) {
      try {
        return f(std::get<C>(either));
      }
      catch(...) {
        return g(std::get<D>(either));
      }
    };
  \end{minted}
  The simple usage as follows:
  \begin{minted}{c++}
    std::variant<std::string, int> var = std::string("abc");
    std::cout << "String length:" <<
    factor<>(stringLength, id, var) << std::endl;
    var = 4;
    std::cout << "id(int):" <<
    factor<>(stringLength, id, var) << std::endl;
  \end{minted}

\end{example}
TBD
\subsection{\textbf{Scala} category}
\begin{example}[Initial object][\textbf{Scala}]
\label{ex:scala_initial_object}
We used a same trick as for \mynameref{ex:hask_initial_object} in
\mynameref{def:haskcategory} and define
\mynameref{def:initial_object} in \mynameref{def:scalacategory} as a
type without values
\begin{minted}{scala}
sealed trait Void
\end{minted}
i.e. you cannot construct a object of the type.
\end{example}

\begin{example}[Terminal object][\textbf{Scala}]
\label{ex:scala_terminal_object}
We used a same trick as for \mynameref{ex:hask_terminal_object}
in \mynameref{def:haskcategory} and define
\mynameref{def:terminal_object} in \mynameref{def:scalacategory} as a
type with only one value
\begin{minted}{scala}
abstract final class Unit extends AnyVal
\end{minted}
TBD
i.e. you can create only one element of the type.
\end{example}

TBD

\section{Quantum mechanics}
\begin{example}[Initial object][\textbf{FdHilb}]
\label{ex:quant_initial_object}
We will use a Hilber space of dimensional 0 as the
\mynameref{def:initial_object}. I.e. the set that does not have any
states in it.
\end{example}

\begin{example}[Terminal object][\textbf{FdHilb}]
  \label{ex:quant_terminal_object}
We will use a Hilber space of dimensional 1 as the
\mynameref{def:terminal_object}. I.e. the set of complex numbers
$\mathbb{C}$.
\end{example}

\begin{example}[Product][\textbf{FdHilb}]
  \label{ex:quant_product}
  The \mynameref{def:product} in \mynameref{def:fdhilbcategory} is a
  \mynameref{def:fdhilb_direct_sum}.
\end{example}

\begin{example}[Sum][\textbf{FdHilb}]
  \label{ex:quant_sum}
  The \mynameref{def:sum} in \mynameref{def:fdhilbcategory} is a
  \mynameref{def:fdhilb_direct_sum}.
\end{example}

TBD


\section{Change of Bases, Canonical Forms and Symmetries}
\subsection{Change of Bases in General}
Recall that given a linear operator $T:V\to W$, we can write its matrix form once we have specified the bases $\{\underline{e_1},\underline{e_2},\ldots,\underline{e_n}\}$ and $\{\underline{f_1},\underline{f_2},\ldots,\underline{f_m}\}$ for $V,W$.
So $T(\underline{e_i})=A_{ai}\underline{f_a}$ for some matrix $A$,
For other bases $\{\underline{e_i'}\}$ and $\{\underline{f_i'}\}$ for $V,W$, we have a matrix $A'$ with $T(\underline{e_i'})=A'_{ai}\underline{f_a'}$.
Suppose the bases are related by $\underline{e_i'}=P_{ji}\underline{e_j}, \underline{f_a'}=Q_{ba}\underline{f_b}$.
So $P,Q$ are invertible and
\begin{proposition}
    $A'=Q^{-1}AP$.
\end{proposition}
We say $P,Q$ constitutes a change of bases.
The column $i$ of $A$ consists of components of $T(\underline{e_i})$ with respect to the basis $\{\underline{f_a}\}$, column $i$ of $P$ consists of components of new basis vectors with respect to the old basis, similar for $Q$.
\begin{example}
    Let $\dim V=n=2$, $\dim W=m=3$, and consider the linear map $T$ with $T(\underline{e_1})=\underline{f_1}+2\underline{f_2}-\underline{f_3}$ and $T(\underline{e_2})=-\underline{f_1}+2\underline{f_2}+\underline{f_3}$, so $T$ has matrix
    $$A=\begin{pmatrix}
        1&-1\\
        2&2\\
        -1&1
    \end{pmatrix}$$
    Under these choice of bases.
    Now consider the new basis $\underline{e_i'}$ for $V$ by
    $$\underline{e_1'}=\underline{e_1}-\underline{e_2},\underline{e_2'}=\underline{e_1}+\underline{e_2}$$
    which yields a changes of basis matrix
    $$P=\begin{pmatrix}
        1&1\\
        -1&1
    \end{pmatrix}$$
    And a new basis $\underline{f_i'}$ for $W$ is defined by $$\underline{f_1'}=\underline{f_1}-\underline{f_3},\underline{f_2'}=\underline{f_2},\underline{f_3'}=\underline{f_1}+\underline{f_3}$$
    which has a matrix
    $$Q=\begin{pmatrix}
        1&0&1\\
        0&1&0\\
        -1&0&1
    \end{pmatrix}$$
    So the change of basis formula gives
    $$A'=Q^{-1}AP=\begin{pmatrix}
        2&0\\
        0&4\\
        0&0
    \end{pmatrix}$$
    which can be verified by direct calculation.
\end{example}
\begin{proof}
    For vectors $\underline{y},\underline{x}$ with $\underline{y}=A\underline{x}$ for some invertible matrix (representing a basis) $A$, we denote the components in the respective components by
    $$X=\begin{pmatrix}
        x_1\\
        x_2\\
        \vdots\\
        x_n
    \end{pmatrix},Y=\begin{pmatrix}
        y_1\\
        y_2\\
        \vdots\\
        y_n
    \end{pmatrix}$$
    to avoid confusion.
    So for a change of basis by matrix $P,Q$, the formula $Y=AX$ turns to $Y'=A'X'$, hence, we have $\underline{x}=x_i\underline{e_i}=x_j'\underline{e_j'}=x_j'(\underline{e_i}P_{ij})=P_{ij}x_j'\underline{e_i}$.
    Therefore $X=PX'$, similarly $Y=QY'$, so $A'X'=Y'=Q^{-1}Y=Q^{-1}AX=(Q^{-1}AP)X'$, so $A'=Q^{-1}AP$
\end{proof}
In the special cases where $V=W$ and the bases are the same for $V,W$ before and after the change of basis, then $A$ is transformed to a matrix similar to $A$ by that change-of-basis matrix.
Note that this can justify immediately that $\operatorname{tr}A'=\operatorname{tr}A,\det A'=\det A,\chi_{A'}=\chi_A$ for similar matrices $A,A'$.\\
If $V=W=\mathbb F^n$ where $\mathbb F=\mathbb R$ or $\mathbb C$.
For a diagonalizable matrix $M$, then by changing the standard basis into the eigenbasis, $M$ becomes diagonal.
\begin{proof}[Alternative proof]
    Take the linear map $T$, then
    $$\underline{f_a}Q_{ab}A'_{bi}=\underline{f_b'}A'_{bi}=T(\underline{e_i'})=T(\underline{e_j}P_{ji})=P_{ji}T(\underline{e_j})=\underline{f_a}A_{aj}P_{ji}$$
    So $AP=QA'$ by considering the coefficient of $\underline{f_a}$.
\end{proof}
\subsection{Jordan Canonical/Normal Form}
This result classifies complex $n\times n$ matrices up to similarity (i.e. conjugacy classes).
\begin{proposition}
    Any $2\times 2$ complex matrix $A$ is similar to one of the followings:
    $$
    \begin{pmatrix}
        \lambda_1&0\\
        0&\lambda_2
    \end{pmatrix},\lambda_1\neq\lambda_2;
    \begin{pmatrix}
        \lambda&0\\
        0&\lambda
    \end{pmatrix};
    \begin{pmatrix}
        \lambda&1\\
        0&\lambda
    \end{pmatrix}
    $$
    Where $\lambda_1,\lambda_2,\lambda\in\mathbb C$.
\end{proposition}
\begin{proof}
    If $A$ is diagonalizable (which includes the case where $\chi_A$ has two distinct roots) then the proposition is immediate.
    Otherwise, $\chi_A(t)=c(t-\lambda)^2,c\neq 0$ and $\operatorname{null}(A-\lambda I)=1$ and we shall show that $A$ is similar to a matrix of the third form.
    Indeed, let $\underline{v}$ be an eigenvector for $\lambda$ and $\underline{w}$ any vector that is independent from $\underline{v}$.
    Then $A\underline{v}=\lambda\underline{v},A\underline{w}=\alpha\underline{v}+\beta\underline{w}$, then the matrix of this transformation under the basis $\underline{v},\underline{w}$ is
    $$\begin{pmatrix}
        \lambda&\alpha\\
        0&\beta
    \end{pmatrix}$$
    But then $\beta=\lambda$ by looking at the eigenvalue of matrices of this form, and $\alpha\neq 0$ by assumption.
    So we can set $\underline{u}=\alpha\underline{v}$, then under the basis $\underline{u},\underline{w}$, we get the matrix of $A$ to be
    $$\begin{pmatrix}
        \lambda&1\\
        0&\lambda
    \end{pmatrix}$$
    As claimed.
\end{proof}
\begin{proof}[Alternative approach for the third case]
    If $A$ has characteristic polynomial of the form $\chi_A(t)=c(t-\lambda)^2$ with $c\neq 0$ and $A\neq \lambda I$, then there is some vector $\underline{w}$ with
    $$(A-\lambda I)\underline{w}=\underline{u}\neq\underline{0}$$
    but by Cayley-Hamilton, we have
    $$(A-\lambda I)\underline{u}=(A-\lambda I)^2\underline{w}=\underline{0}$$
    so $A$ is of the form under the basis $\underline{u},\underline{w}$.
\end{proof}
\begin{example}
    Consider
    $$A=\begin{pmatrix}
        1&4\\
        -1&5
    \end{pmatrix}$$
    Then $\lambda=3$ and we can have $\underline{w}=(1,0)^\top$, $\underline{u}=(-2,-1)^\top$, therefore
    $$\begin{pmatrix}
        3&1\\
        0&3
    \end{pmatrix}=
    \begin{pmatrix}
        -2&1\\
        -1&0
    \end{pmatrix}^{-1}
    \begin{pmatrix}
        1&4\\
        -1&5
    \end{pmatrix}
    \begin{pmatrix}
        -2&1\\
        -1&0
    \end{pmatrix}$$
\end{example}
\begin{theorem}
    Any $n\times n$ complex matrix is similar to a matrix of the form
    $$A'=
    \begin{pmatrix}
        J_{n_1}(\lambda_1)&&\\
        &\ddots&\\
        &&J_{n_r}(\lambda_r)
    \end{pmatrix}$$
    where $\lambda_1,\ldots,\lambda_r$ are the eigenvalues, $n_1+n_2+\cdots+n_r=n$ and $J_p(\lambda)$, the Jordan Block, is of the form
    $$J_p(\lambda)=\begin{pmatrix}
        \lambda&1&&&\\
        &\lambda&1&&\\
        &&\lambda&&\\
        &&&\ddots&1\\
        &&&&\lambda
    \end{pmatrix}$$
\end{theorem}
\subsection{Quadrics and Conics}
A quadric in $\mathbb R^n$ is a hypersurface defined by
$$Q(\underline{x})=\underline{x}^\top A\underline{x}+\underline{b}^\top\underline{x}+c=0$$
For some real symmetric $n\times n$ matrix $A$, $\underline{b}\in \mathbb R^n,c\in\mathbb R$.
So $Q(\underline{x})=A_{ij}x_ix_j+b_ix_i+c$.\\
Consider classifying solutions up to geometrical equivalence, i.e. no distinction up to isometries.
\begin{theorem}
    Any isometry in $\mathbb R^n$ is a composition of translation and orthogonal transformation.
\end{theorem}
\begin{proof}
    Trivial.
\end{proof}
If $A$ in invertible, we can complete the square.
We set $\underline{y}=\underline{x}+A^{-1}\underline{b}$, so $\mathcal{F}(\underline{y})=\underline{y}^\top A\underline{y}=Q(\underline{x})-k$ for some constant $k$.
So $Q(\underline{x})=0\iff \mathcal F(\underline{y})=k$ for some $k$, but the quadratic form is with respect to a new origin.
In this case, we can diagonalize $\mathcal F$ and change the basis as appropriate and think of them as new coordinate (bases).
The case in $\mathbb R^3$ has been discussed in the previous sections and we see that the quadrics are ellipsoids and hyperboloids (in $2$ directions).\\
If $A$ is singular, that is, if $A$ has one or more $0$ eigenvalue, things change.\\
Back in $\mathbb R^2$, if $A$ is invertible, then by our analysis above, we can write it as a (diagonalized) quadratic form $k=\lambda_1x_1^2+\lambda_2x_2^2$.
For $\lambda_1,\lambda_2>0$, $k>0$ gives an ellipse, $k=0$ gives a point and $k<0$ no solution.
For $\lambda_1\lambda_2<0$, so WLOG $\lambda_1>0>\lambda_2$, then we get a hyperbola for any $k\neq 0$, and a pair of lines for $k=0$.\\
If $\det A=0$, then unless $A$ is zero, we have $\lambda_1\neq 0$ and $\lambda_2=0$, so we diagonaize $A$ in the original formula to get
$$\lambda_1x_1'^2+b_1'x_1'+b_2'x_2'+c=0\iff \lambda_1x_1''^2+b_2'x_2'+c'=0$$
By a shift in $x_1$.
If $b_2'=0$, then we again get a pair of lines for $c'<0$, a single line for $c'=0$ and no solution for $c'>0$.
Otherwise $b_2'\neq 0$, it gives a parabola.\\
Note that all these changes of coordinates is prepresented by an isometry.
They are called conics because these shapes can be obtained by slicing the cone.
The general form for conics can be expressed in terms of $a,b$ semi-major and semi-minor axes or in terms of length unit $\ell$ and eccentricity $e$.\\
For ellipses, we have the general form
$$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$
WLOG $b>a$, then $b^2=(1-e^2)a^2$ for some $0\le e<1$.
So we take this $e$ to be the eccentricity.
So the foci are at $x=\pm ae$.\\
And for parabola in the form $y^2=4ax$, the focus is at $x=a$ and $e=1$.\\
For hyperbola, i.e.
$$\frac{x^2}{a^2}-\frac{y^2}{b^2}=1$$
So for $b^2=a^2(e^2-1)$ for $e>1$ the eccentricity.
The foci are $x=\pm ae$.
\subsection{Symmetries and Transformation Groups}
Recall from a previous section that $R$ is orthogonal iff $R^\top R=RR^\top=I$ iff it preserves dot products.
The set of such matrices is a group $\operatorname{O}(n)$.
Also, given the properties above and the multiplictivity of $\det$, $\det R=\pm 1$.
And $\operatorname{SO}(n)\le \operatorname{O}(n)$ is the set of orthogonal matrices with determinant $1$.
While orthogonal matrices preserves lengths, angles and volumns (by alternating forms), special orthogonal matrices also preserves orientation.
Reflections belongs in $\operatorname{O}(n)\setminus\operatorname{SO}(n)$.
For a specific $H\in \operatorname{O}(n)\setminus\operatorname{SO}(n)$, any element in $\operatorname{O(n)}$ is of the form $R$ or $RH$ for some $R\in\operatorname{SO}(n)$.
For example, if $n$ is odd, then we can take $H=-I$
We can regard the transformation $x_i'=R_{ij}x_j$ in two ways:\\
The ``active'' way is to say the rotations transform vectors.
Then $\operatorname{SO}(n)\star\underline{x}$ would be a hypersphere.
The components $x_i'$ are components of new vector.\\
By contrast, the ``passive'' point of view is to think about the basis vectors and the vectors that they are mapped to, so $x_i'$ are the components of the same vector $\underline{x}$ wrt a new (rotated) orthonormal basis.
\subsection{2-Dimensional Minkowski Space and Lorentz Transformations}
Consider a new ``inner product'' in $\mathbb R^2$ given by
$$(\underline{x},\underline{y})=x^\top J\underline{y},J=\begin{pmatrix}
    1&0\\
    0&-1
\end{pmatrix}$$
And also we write $\underline{x}=(x_0,x_1)^\top$ and $\underline{y}=(y_0,y_1)^\top$.
Note that all original properties of inner products hold except positive definiteness.
We can choose basis vectors that are orthonormal, which are the standard basis $\underline{e_0},\underline{e_1}$ with $(\underline{e_0},\underline{e_0})=1=-(\underline{e_1},\underline{e_1}), (\underline{e_0},\underline{e_1})=0$.
\begin{definition}
    This ``new inner product'' is called the Minkowski metric, and $\mathbb R^2$ equipped with it is called Minkowski space.
\end{definition}
Consider
$$M=\begin{pmatrix}
    M_{00}&M_{01}\\
    M_{10}&M_{11}
\end{pmatrix}$$
which preserves Minkowski metric if and only if $(M\underline{x},M\underline{y})=(\underline{x},\underline{y})$ if and only if
$$\underline{x}^\top M^\top JM\underline{y}=\underline{x}^\top J\underline{y}$$
for any $\underline{x},\underline{y}\in\mathbb R^2$, which happens iff $M^\top JM=J$.
By taking determinant, $\det(M)=\pm 1$.
So all such $M$ constitutes a group and has a subgroup with $\det M=1$ and $M_00>0$ is the Lorentz group.\\
To determine the general form of $M$ in Lorentz group, we can find it by requiring $M\underline{e_0},M\underline{e_1}$ to be orthonormal in this generalized sense, so $M$ is in the general form
$$M(\theta)=\begin{pmatrix}
    \cosh\theta&\sinh\theta\\
    \sinh\theta&\cosh\theta
\end{pmatrix}$$
Fixed by $(M\underline{e_0},M\underline{e_0})=1$ and $M_{00}>0$.
Note that $M(\theta)M(\phi)=M(\theta+\phi)$.\\
Curves with $(\underline{x},\underline{x})=k$ with $k$ constant are simply hyperbolic.
Since lengths are preserve, $\underline{x'}=M\underline{x}$ must lie on the same hyperbola.\\
Physically, we want to set
$$M(\theta)=\gamma(v)\begin{pmatrix}
    1&v\\
    v&1
\end{pmatrix}$$
where $v=\tanh\theta$, then $|v|<1$ and $\gamma(v)=(1-v^2)^{-1/2}$
Then (with $x_0=t$ the time dimension and $x_1=x$ the space parameter)
$$\begin{cases}
    t'=\gamma(v)(t+vx)\\
    x'=\gamma(v)(x+vt)
\end{cases}$$
This is the Lorentz Transformation, or boost, relating time and space coordinates for observers moving with relative velocity $v<1$.
The $\gamma$ factor here implies time dilation and length contraction.
Note that $M(\theta_3)=M_{\theta_1}M_{\theta_2}$ and $v_i=\tanh(\theta_i)$ gives $v_3=\frac{v_1+v_2}{1+v_1v_2}$ which is consistent with $v<1$.


\section{Theory}

In the following section, equations and algorithms used to model the behavior of
a symmetric ideal gas centrifuge cascade from individual centrifuge properties
are described. Details will also be provided to model centrifuge behavior
when fed with a different feed enrichment than designed.

\subsection{Centrifuge properties}

\subsubsection{Separative power}

\paragraph{R\"aetz equation}

As described by Glaser in \cite{glaser.2008}, the separative power of a single centrifuge can be express as an analytical solution \cite{raetz.phd} of the
differential equation for the gas centrifuge:

\begin{eqnarray}
    \label{eq:raetz}
    \delta U(L,F,\theta,Z_{p}) &= &\frac{1}{2}
            F\theta(1 - \theta)
            \left(\frac{\Delta M}{2 RT}v_{a}^{2}\right)^{2}
            \left(\frac{r_{2}}{a}\right)^{4}
            \left[1 - \left(\frac{r_{1}}{r_{2}}\right)^{2}\right]^{2}
            \label{eq_raetz}\\
        &&
            \left[
                \left(\frac{1+L/F}{\theta}\right)
                (1- exp[ - A_{P}(L,F,\theta)Z_{p}])  \nonumber  \right. \\
        &&~~ + \left.\left(\frac{L/F}{1 - \theta}\right)
                (1 - exp[ -A_{W}(L,F,\theta)(Z - Z_{p}])\right]^{2}, \nonumber
                \\
    \textrm{with~ ~ ~ ~ ~}
        A_{P} &= &\frac{2\pi D\rho }{ ln(r_{2}/r_{1}) }
                 \frac{ 1 }{ F }
                 \frac{ 1-\theta }{(1+L/F)(1-\theta+L/F) }\\
        A_{W} &= &\frac{2\pi D\rho }{ ln(r_{2}/r_{1}) }
                 \frac{ 1 }{ F }
                 \frac{ 1-\theta }{ (L/F)(1-\theta+L/F) }
\end{eqnarray}

In this equation, the parameters of average gas temperature, $T$, peripheral speed,
$v_a$, height, $h$, diameter, $d$, pressure ratio, $x$, feed flow rate, $F$,
counter-current flow ratio, $L/F$, are intrinsic to the centrifuge design.
To match the cascade design describe in \cite{glaser.2008} and \cite{walker.2017},
P1-type centrifuge properties have been chosen (Table \ref{tab:centrifuges}).

\begin{table}[htb]
    \centering
    \caption{Summary of the centrifuge parameters.}
    \begin{tabular}{ccccccc}
        \toprule
        $T$[K] & $v$[m/s] & $h$[m] & $d$[m]   & $x$      & $F$[mg/s]  & $L/F$  \\
        \midrule
        320    & $320$    & $1.8$  & $0.105$  & $10^{3}$ & $13$       & 2   \\
        \bottomrule
    \end{tabular}
    \label{tab:centrifuges}
\end{table}

The variable $Z_p$ is the rectifier length, or the location of the feed point,
and has an optimal axial location as defined by \cite{raetz.phd}:

\begin{equation}
    Z_p = \frac{(1-\theta)(1+L/F)}{1-\theta+L/F}Z
\end{equation}

This optimizes the recitifer length based on the cut, $\theta$, which is an expression
of the fraction of the centrifuge feed that is output as product, and the counter-current
flow, $L/F$. In practice, this value is a design parameter that is defined in the model
during the design of the centrifuge cascade.

The parameters $r_1$ and $r_2$ are the separation radii of the enriched material
(here ${}^{235}\mathrm{U}$ vs. ${}^{238}\mathrm{U}$), $r_1$ being the withdrawal
radius for the lighter isotope and $r_2$ for the heavier isotope. R\"aetz's
two-shell model looks for optimal values between these two, as described by
the hydrodynamic equations. The radii ratio is optimized using the following relationship:

\begin{equation}
    \max \left\{ \left[1-\left(\frac{r_1}{r_2}\right)^2 \right]^2 \times \left[ \ln \left(\frac{r_2}{r_1} \right) \right]^{-1} \right\}
\end{equation}

This ratio can further be constrained by approximating $r_2$ as being very close
to the inner centrifuge wall with radius $a$:

\begin{equation}
    \left(\frac{r_1}{r_2}\right) \approx \left(\frac{r_1}{a}\right) = \sqrt{1 - \frac{2RT}{M}(\ln x)\frac{1}{v_{a}^{2}}}
\end{equation}

Here the gas constants are molar mass, $M$, temperature $T$, universal gas constant, $R$,
and the pressure ratio, $x$ (typically $1000:1$) \cite{}. %needs citation?
This relationship is valid when $v_a > 380 \frac{\mathrm{m}}{\mathrm{s}}$.
Otherwise, the relationship can be approximated $\{\frac{r_1}{r_2} \approx 0.534 \mid v_a \leq 380 \frac{\mathrm{m}}{\mathrm{s}}\}$.
In order to decompose the ratio into each individual radius, knowledge on one
of them is required. Glaser \cite{glaser.2008} states that $r_2$ typically ranges
from $96\%$ to $99\%$ the value of the inner centrifuge wall radius $a$. The exact
behavior of $r_2$ between these two values in operational conditions is unknown,
but a linear approximation can be made. It is assumed that $r_2$ is always at
the midpoint of these two extremes (i.e. $r_2 = 0.975 a$). Then, $r_1$ can be
found by simply multiplying this value by the ratio.

With this, all parameters of the separative power equation \ref{eq:raetz} are
defined and a value can be calculated. Separative power, $\delta U$, has units similar to the feed flow, that of $[mg/s]$.

\paragraph{First principle}

It can be shown \cite{avery} that the separative power of a single centrifuge can be
derived from first principles and expressed as a function of the feed-to-product enrichment factor, $\alpha$, the cut, $\theta$, and the feed rate, $F$:
%I think we should replicate at least some of that here

\begin{equation} \label{eq_alpha_principle}
    \delta U = \frac{F}{2}\frac{\theta}{1-\theta}(\alpha-1)^{2}
\end{equation}

\subsection{Centrifuges basic properties and definition}

The outputs of a centrifuge relative to its input can be described with ratios
of the abundance ($R = \frac{N}{1-N}$) where the feed, product, and tail enrichment $N, N', N''$ respectively. Enrichment factors of $\alpha$ (feed-to-product),
$\beta$ (feed-to-tail), and $\gamma$ (tail-to-product) can then be defined:

\begin{subequations}
    \label{eq_alphabeta}
    \begin{equation} \label{eq_alpha_def}
        \alpha = \frac{1-N}{N}\frac{N'}{1-N'}
    \end{equation}
    \begin{equation}\label{eq_beta-def}
        \beta = \frac{1-N''}{N''}\frac{N}{1-N}
    \end{equation}
    \begin{equation}\label{eq_gamma-def}
        \gamma = \alpha \, \beta
    \end{equation}
\end{subequations}

\subsection{Cascade Design}
\subsubsection{Symmetric Cascade}

A symmetric cascade is a cascade where a stage is fed using the tail, $T$, of the next stage and the product, $P$, of the previous one. The the cascade feeding stage, $F_{i}$ flow, with external feed, $F_{ext}$, is given by:

\begin{equation}
    F_{i} = T_{i+1} + F_{i-1} ~(+ F_{ext})
\end{equation}

\subsubsection{Symmetric Ideal Cascade}
This model constructs cascades as symmetrical and ideal, with no losses in
separative work. This means that the tail assay of the next stage ($N''_{i+1}$)
is the product assay of the previous stage ($N'_{i-1}$), which can be
expressed as:

\begin{equation}
    \forall i~ N_{i} = N'_{i-1} = N''_{i+1}~ ~\Leftrightarrow~ ~\forall (i,j)~
    \alpha_{i} = \beta_{j}
\end{equation}

\subsection{Building the cascade}

Designing a symmetric ideal cascade beings with the feeding
stage. As all the enrichment factors are equal across all the cascade, the
feeding stage is used to determine all subsequent stages.
The feed assay of the feeding stage, $N_{0}$, is fixed by the external feed assay
provided as an input.

From equation \eqref{eq_raetz} and \eqref{eq_alpha_principle} it is possible to
express the feed-to-product enrichment factor $\alpha$ as a function of the feed rate $F$, the separative performance
$\delta U$ (a function of $\theta$), and the cut $\theta$:

\begin{equation} \label{eq_alpha}
    \alpha = \sqrt{\frac{2\delta U(\theta)}{F} \frac{1-\theta}{\theta}} + 1
\end{equation}

From equations \eqref{eq_alphabeta}, the product assay can be expressed as:

\begin{equation}\label{eq_product_assay}
    N' = \frac{\alpha \frac{N}{1-N}}{1+\alpha \frac{N}{1-N}} = \frac{\alpha R}{1 + \alpha R}
\end {equation}

Then, from mass conservation, $N = \theta N' + (1-\theta)N''$ and equation
\eqref{eq_product_assay}, it is possible to express the feed-to-tail enrichment factor $\beta$ as a function of only the feed abundance, $R$, the cut $\theta$, and the feed-to-product enrichment factor, $\alpha$:

\begin{subequations}
    \begin{equation}\label{eq_beta_interim}
        \beta = \left( 1 - \frac{N - \theta N'}{1-\theta} \right)
                        \left( \frac{R}{\frac{N - \theta N'}{1 - \theta}} \right)
    \end{equation}
    \begin{equation}\label{eq_beta}
        \beta =   R \left(\dfrac{1-\theta}
                        {\dfrac{R}{R+1}- \theta \dfrac{\alpha R}{1+\alpha R}} -1\right)
    \end{equation}
\end{subequations}

Finally from equation \eqref{eq_alpha} and \eqref{eq_beta} it is possible to
determine the cut, $\theta$, required to build an ideal cascade:

\begin{eqnarray}
    \theta_{i} = \dfrac{N_{i} - \dfrac{1}{1 + \beta/R_{i}}}{ \dfrac{\alpha R_{i}}{1 + \alpha R_{i}} -
           \dfrac{1}{1 + \beta/R_{i}}}
           \label{eq_theta}
\end{eqnarray}

To construct an ideal stage, a cut, $\theta$, must first be computed.
This is found iteratively, searching for the optimal cut value where $\alpha = \beta$
for given feed and centrifuge parameters. With a separative power calculated,
an $\alpha$ and $\beta$ value can be determined for an initial cut guess. This
model assumes that the ideal cut for a stage should be between 0.1 and 0.9. The
two enrichment factors are compared, and the higher or lower cut value is chosen
by which pair of factors are closer. A new cut is determined from the chosen
factors, a new separative power is computed, and new $\alpha$ and $\beta$ values
are compared. This process continues until, to some precision, the resulting
enrichment factors are approximately equal. As illustrated in Fig. \ref{fig_a_m_b},
for a given input feed assay, the ideal feeding stage typically has a $\theta$
value between 0.45 and 0.525 when $\alpha = \beta$.

\begin{figure}[h!] % replace 't' with 'b' to force it to be on the bottom
    \centering
    \includegraphics[scale=0.5]{alpha_minus_beta}
    \caption{Evolution of the difference between $\alpha$ and $\beta$ as a
    function of the cut value for different of feed assays, 0.007 (black),
    0.035 (red), 0.2 (green), 0.7 (black). }
    \label{fig_a_m_b}
\end{figure}

The number of machines required to construct a stage can then be computed using
equation \eqref{eq_alpha_principle} to solve for the centrifuge feed flow:

\begin{equation}\label{eq_cent_feed}
    F_c = \frac{2 \delta U}{(\alpha - 1)^2} \frac{M}{M_{238}} \frac{1-\theta}{\theta}
\end{equation}

Where the molar mass ratio $\frac{M}{M_{238}}$ accounts for the molar mass
differences between the feed gas, $UF_6$, and the individual uranium isotopes
being separated. The stage feed flow can then be divided by the individual
centrifuge feed flow, equation \eqref{eq_cent_feed}, to find the exact number of
machines needed for the ideal stage. In practice, this number is rounded up to
account for fractional machines required.

In a cascade, as the stage feed-to-product enrichment factor $\alpha_{i}$ and stage feed-to-tail enrichment factor $\beta_{i}$ remain constant, only the value of
the cut, $\theta_{i}$, changes across the different stages of a cascade.  This
algorithm assumes that the corresponding separative power $\delta U$ (not
re-computed) can be achieved with the chosen centrifuge design by tuning other
operational parameters such as the rotation speed, counter-current flow
ratio, etc.  Once $\theta_{i}$ is determined, it is possible to compute the
product and the tail assays.

The design of the ideal symmetric cascade is performed through 2 steps. First,
the configuration and number of stages is determined, adding stages with product assay $N'_i$ calculated using equation \ref{eq_product_assay}, until the
product assay of the final stage is greater than or equal to the product targeted assay. The stage tails assay $N''_i$ is calculated similarly, until it is less than or equal to the tails desired assay.  This determines the number of enriching and stripping stages as well as their enrichment properties ($N_{i}$, $N'_{i}$, $N''_{i}$,$\theta_{i}$).

The second step determines the relative flows at each stage, solving the linear
flow equation, \eqref{eq_flow}.
The cascade can then be populated with actual machines until the maximum number
of available machines is reached.

\begin{equation}
\resizebox{\linewidth}{!}{%
$\displaystyle
\setcounter{MaxMatrixCols}{20}
\begin{bmatrix}
     -1      & 1-\theta_{_{S+1}} & 0                 & ...  & 0            & 0            & 0             & 0             & 0             & ... & 0               & 0  & 0 \\
\theta_{_S}  & -1                & 1-\theta_{_{S+2}} & ...  & 0            & 0            & 0             & 0             & 0             & ... & 0               & 0  & 0 \\
             &                   &                   &      &              &              & ...           &               &               &     &                 &    &   \\
 0           & 0                 & 0                 & ...  & \theta_{_-2} & -1           & 1-\theta_{_0} & 0             & 0             & ... & 0               & 0  & 0 \\
 0           & 0                 & 0                 & ...  & 0            & \theta_{_-1} & -1            & 1-\theta_{_1} & 0             & ... & 0               & 0  & 0 \\
 0           & 0                 & 0                 & ...  & 0            & 0            & \theta_{_0}   & -1            & 1-\theta_{_2} & ... & 0               & 0  & 0 \\
             &                   &                   &      &              &              & ...           &               &               &     &                 &    &   \\
 0           & 0                 & 0                 & ...  & 0            & 0            & 0             & 0             & 0             & ... & \theta_{_{E-2}} & -1 & 1-\theta_{_E} \\
 0           & 0                 & 0                 & ...  & 0            & 0            & 0             & 0             & 0             & ... & 0               & \theta_{_{E-1}} & -1
 \end{bmatrix}
 \times
 \begin{bmatrix}
     F_{_{S}}   \\
     F_{_{S+1}} \\
     \cdots     \\
     F_{_{-1}}  \\
     F_{_{0} }  \\
     F_{_{1} }  \\
     \cdots     \\
     F_{_{E-1}} \\
     F_{_{E}}
 \end{bmatrix}
 =
 \begin{bmatrix}
     0      \\
     0      \\
     \cdots \\
     0      \\
     F      \\
     0      \\
     \cdots \\
     0      \\
     0
\end{bmatrix}
$}
%\caption{caption needed!}
\label{eq_flow}
\end{equation}

\subsection{Misuse models}

Little information is available about optimising an existing enrichment cascade
that is being fed with a feed enrichment that does not match the design
enrichment. Here, 3 different methods will be investigated.

The first method, A, assumes that no changes are being made to the cascade, i.e $\delta U$, $F$ and $\theta$ are fixed across all stages. The second method, B, assumes the cut value $\theta$ is re-tuned at each stage to maintain the ideal state of the cascade, while $\alpha$ and $\beta$ remain fixed. The last method, C, described in \cite{walker.2017} assumes the tails-to-product enrichment factor $\gamma$ and the cut $\theta$ remain constants
(eq. \eqref{eq_gamma-def}: $\gamma = \alpha\beta$). Model behaviors and
assumptions are summarized in Tab. \ref{tab:models}.

\begin{table}[htb]
\centering
  \caption{Summary of misuse model properties.}
\begin{tabular}{l|ccc}
\toprule

Model                &    A                 & B                  & C  \\
\midrule
Constant parameters  & $\alpha_i, \theta_i$ & $\alpha_i=\beta_i$ & $\gamma_i=\alpha_i\beta_i, \theta_i$       \\
Varying parameters   & $\beta_i$            & $\theta_i$         & $\alpha_i, \beta_i$                     \\
Assays determination & blended              & ideal              & blended                  \\
Flow                 & unchanged            & reduced            & unchanged       \\

\bottomrule
\end{tabular}
  \label{tab:models}
\end{table}

\subsubsection{Model A}

The tuning method A does not re-optimize $\theta_i$, keeping the same flow as the
ideal configuration. From equation \eqref{eq_alpha}, maintaining $\delta U$ and
$F$ while $\theta$ is unchanged implies $\alpha$ remains unchanged as well.
According to equation \eqref{eq_beta}, when $\alpha$ and $\theta$ are fixed, if
the feed assay ($N$) changes, $\beta$ will change accordingly.  This breaks the
ideal status of the cascade, i.e. $N_{i} \neq N'_{i-1} \neq N''_{i+1}$.

In order to compute the proper product and tails assay at each stage, the tail
and the product from the next and the previous stage respectively must be
blended in order to determine the correct stage feed assay. All feed assays are
iteratively updated, blending the proper product and tails, then using the
updated feed assay, the new product and tails assays are recomputed. This
process is repeated until the sum of the square difference in assays is smaller
than $10^{-8}$.  As the cut remains fixed at each stage, the flows do not need
to be recomputed.

This model assumes that it is possible to maintain the separative power of a
centrifuges, $\delta U$, for any feed assays $N$ while maintaining its cut
$\theta$ and feed flow $F$.

\subsubsection{Model B}

Using the second method, the cut value at each stage, $\theta_i$, is retuned in
order to maintain the $\alpha_i$ and $\beta_i$ at their original values
(equation \eqref{eq_theta}). Since the cascade remains ideal, the product and
tails assay at each stage can easily be determined using equations
\eqref{eq_alphabeta}.

As the cut values change, the relative flow rates between the different stages
are recomputed using equation \eqref{eq_flow}.  Under this model, the flow at
each stage of the original ideal cascade is assumed to be the maximum flow
allowed at that stage.  Therefore, all of the recomputed flow rates are scaled
together to ensure that no stage experiences a flow rate larger than that of
the original cascade.  Some stages may now experience flow rates much lower
than the original cascade.

%% The flow rates are determinted as
%% the largest flow rates allowed by the cascade design, number of centrifuges
%% limiting the flow at each stage.

This model assumes that it is possible to tune a centrifuge separative power
$\delta U$, for any feed assay $N$, cut $\theta$ and feed flow $F$, in order to
maintain its constant feed to product enrichment factor $\alpha$.

\subsubsection{Model C}
The last model assumes that the tails to product enrichment factor remains
constant regardless to the feed assays. To compute the response of the cascade
one need to determine $\alpha$ and $\beta$ such that their product and
$\theta$ remain fixed.
From equations \eqref{eq_alphabeta} and the assay conservation equation $N =
\theta N' + (1-\theta)N''$ it is possible to express the product, $N'$,
dependent on the feed assay $N$, $\gamma$, and the cut, $\theta$, as one
solution of the second order equation \eqref{eq_gamma_p}:

\begin{equation}\label{eq_gamma_p}
    \theta(\gamma-1)N'^2+((N+\theta)(\gamma-1)+1)N'-N\gamma = 0
\end{equation}

The only solution allowing product assay to range between 0 and 1 is the
following :

\begin{equation}\label{eq_model_b_sol}
    N' = \frac{N+\theta}{2\theta} +
         \frac{1 - \sqrt{\gamma^{2}(N-\theta)^{2}
                         + 2\gamma( N^{2} + N - \theta^{2} + \theta)
                         + (N + \theta + 1)^{2}}}
              {2\theta(\gamma - 1)}
\end{equation}

Once the product assay is known, one can trivially determine the tails assay,
$\alpha$ and $\beta$, using equations \eqref{eq_alphabeta} and mass
conservation.

Similar to model A, because the cut values remain constant, the flows do not
need to be recomputed and the correct assays, $\alpha$ and $\beta$, are
determined through iterative blending of the product assays of the previous
stage and the tails assay of the next stage using equation
\eqref{eq_model_b_sol}.

This model assumes that it is possible to tune the centrifuge separative power
$\delta U$ in order to maintain for any feed assay $N$ and its tails to product
enrichment factor $\gamma$ while maintaining its cut $\theta$ and feed flow $F$.

%The speed at which each models reach a threshold of $90\%$ enrichment is
%illustrated in Figure \ref{fig:model_comparison}. The production curve of
%enrichment for each model is shown. The step functions for each model represent
%the cascade configuration. Each step is one cascade in a chain of cascades and
%the shape of the curve for each model gives an indication of how quickly the model
%can reach the enrichment threshold. The main difference is that Model B reaches
%the threshold faster, whereas Models A and C reach a higher enrichment value.
%This highlights some of the immediate differences that would influence the choice
%of using each model in a breakout scenario.

%\begin{figure}[ht]
%    \centering
%    \includegraphics[scale=0.4]{ModelComparison}
%    \caption{The curve of resulting product assays for each model is plotted.
%    Since the feed assay of each cascade is fed into the next cascade in the
%    chain, a linear relationship between the product and feed assays is plotted
%    in black. The step function for each model represents the output of the
%    cascade chain (each step is a cascade). While there are four steps for each
%    model, Model B (green) reached the $90\%$ enrichment threshold before
%    Model A (red) or Model C (blue). However, in the same amount of steps, Models
%    A and C are able to achieve a higher enrichment percent than Model B.}
%    \label{fig:model_comparison}
%\end{figure}


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

\begin{document}

% =================================================================================================
\section*{Symmetrised derivatives of the connection}

Here we compute, just for a check, the symmetrised derivatives of the connections.
These are defined by
\begin{align}
   \Gamma^{d}_{a(b,\uc)} = \Gamma^{d}_{a(b,c_1,c_2,\cdots c_n)}
\end{align}
Note that these are \emph{not} the generalised connections. The generalised connections
involve $\Gamma^{d}_{(ab,\uc)}$ and quadratice combinations of lower order generalised
connections (see eq (1) of {\tt\small ../genGamma.pdf}). Note that the
generalised connections vanish at the origin (unlike the $\Gamma^{d}_{a(b,\uc)}$).

These results agree with those of Hatzinikitas equation (12) (arXiv:hep-th/0001078).

This code provides an indirect check on our results for the connection. It does not
prove that the code {\tt connection.tex} is correct but it does show that our
results are consistent with those of Hatzinikitas.

\clearpage

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

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

   g_{a b}::Metric.
   g^{a b}::InverseMetric.
   g_{a}^{b}::KroneckerDelta.
   g^{a}_{b}::KroneckerDelta.
   \delta^{a}_{b}::KroneckerDelta.
   \delta_{a}^{b}::KroneckerDelta.

   R_{a b c d}::RiemannTensor.
   R^{a}_{b c d}::RiemannTensor.
   R_{a b c}^{d}::RiemannTensor.

   \Gamma^{a}_{b c}::TableauSymmetry(shape={2}, indices={1,2}).

   x^{a}::Depends(D{#}).

   g_{a b}::Depends(\partial{#}).
   R_{a b c d}::Depends(\partial{#}).
   R^{a}_{b c d}::Depends(\partial{#}).
   \Gamma^{a}_{b c}::Depends(\partial{#}).

   R_{a b c d}::Depends(\nabla{#}).
   R^{a}_{b c d}::Depends(\nabla{#}).

   import cdblib

   Gamma = cdblib.get ('Gamma','../connection.json')

\end{cadabra}

\clearpage

\begin{cadabra}
   tmp := D_{p}{@(Gamma)}.
   distribute     (tmp)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   eliminate_kronecker (tmp)
   substitute     (tmp,$x^{a}->0$)
   sort_product   (tmp)
   rename_dummies (tmp)
   canonicalise   (tmp)

   foo := A^{p} A^{b} @(tmp).
   distribute     (foo) # cdb(foo.301,foo)
   sort_product   (foo) # cdb(foo.302,foo)
   rename_dummies (foo) # cdb(foo.303,foo)
   canonicalise   (foo) # cdb(foo.304,foo)

   # save the result
   dGamma1 := @(foo).   # cdb (dGamma1.000,dGamma1)

\end{cadabra}

\clearpage

\begin{dgroup*}
   \begin{dmath*} \cdb*{foo.301} \end{dmath*}
   \begin{dmath*} \cdb*{foo.302} \end{dmath*}
   \begin{dmath*} \cdb*{foo.303} \end{dmath*}
   \begin{dmath*} \cdb*{foo.304} \end{dmath*}
\end{dgroup*}

\clearpage

\begin{cadabra}
   tmp := D_{p q}{@(Gamma)}.
   distribute     (tmp)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   eliminate_kronecker (tmp)
   substitute     (tmp,$x^{a}->0$)
   sort_product   (tmp)
   rename_dummies (tmp)
   canonicalise   (tmp)

   foo := A^{p} A^{q} A^{b} @(tmp).
   distribute     (foo) # cdb(foo.401,foo)
   sort_product   (foo) # cdb(foo.402,foo)
   rename_dummies (foo) # cdb(foo.403,foo)
   canonicalise   (foo) # cdb(foo.404,foo)

   # save the result
   dGamma2 := @(foo).   # cdb (dGamma2.000,dGamma2)

\end{cadabra}

\clearpage

\begin{dgroup*}
   \begin{dmath*} \cdb*{foo.401} \end{dmath*}
   \begin{dmath*} \cdb*{foo.402} \end{dmath*}
   \begin{dmath*} \cdb*{foo.403} \end{dmath*}
   \begin{dmath*} \cdb*{foo.404} \end{dmath*}
\end{dgroup*}

\clearpage

\begin{cadabra}
   tmp := D_{p q r}{@(Gamma)}.
   distribute     (tmp)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   eliminate_kronecker (tmp)
   substitute     (tmp,$x^{a}->0$)
   sort_product   (tmp)
   rename_dummies (tmp)
   canonicalise   (tmp)

   foo := A^{p} A^{q} A^{r} A^{b} @(tmp).
   distribute     (foo) # cdb(foo.501,foo)
   sort_product   (foo) # cdb(foo.502,foo)
   rename_dummies (foo) # cdb(foo.503,foo)
   canonicalise   (foo) # cdb(foo.504,foo)

   # save the result
   dGamma3 := @(foo).   # cdb (dGamma3.000,dGamma3)

\end{cadabra}

\clearpage

\begin{dgroup*}
   % \begin{dmath*} \cdb*{foo.501} \end{dmath*}
   % \begin{dmath*} \cdb*{foo.502} \end{dmath*}
   % \begin{dmath*} \cdb*{foo.503} \end{dmath*}
   \begin{dmath*} \cdb*{foo.504} \end{dmath*}
\end{dgroup*}

\clearpage

\begin{cadabra}
   tmp := D_{p q r s}{@(Gamma)}.
   distribute     (tmp)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   eliminate_kronecker (tmp)
   substitute     (tmp,$x^{a}->0$)
   sort_product   (tmp)
   rename_dummies (tmp)
   canonicalise   (tmp)

   foo := A^{p} A^{q} A^{r} A^{s} A^{b} @(tmp).
   distribute     (foo)
   sort_product   (foo)
   rename_dummies (foo)
   canonicalise   (foo)

   # save the result
   dGamma4 := @(foo).   # cdb (dGamma4.000,dGamma4)

\end{cadabra}

\clearpage

\begin{cadabra}
   tmp := D_{p q r s t}{@(Gamma)}.
   distribute     (tmp)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   unwrap         (tmp)
   product_rule   (tmp)
   distribute     (tmp)
   substitute     (tmp,$D_{a}{x^{b}}->\delta_{a}^{b}$)
   eliminate_kronecker (tmp)
   substitute     (tmp,$x^{a}->0$)
   sort_product   (tmp)
   rename_dummies (tmp)
   canonicalise   (tmp)

   foo := A^{p} A^{q} A^{r} A^{s} A^{t} A^{b} @(tmp).
   distribute     (foo)
   sort_product   (foo)
   rename_dummies (foo)
   canonicalise   (foo)

   # save the result
   dGamma5 := @(foo).   # cdb (dGamma5.000,dGamma5)

\end{cadabra}

\clearpage

Compare these results against those of Hatzinikitas equation (12) (arXiv:hep-th/0001078).
Our final $d\Gamma$ is zero because our metric was expanded to order $x^5$ so the $\Gamma$
only contain terms to order $x^4$. Hence the 5-th partial derivatices are zero.

\begin{dgroup*}
   \begin{dmath*} A^b A^c \Gamma^{d}{}_{ab,c} = \Cdb*{dGamma1.000} \end{dmath*}
   \begin{dmath*} A^b A^c A^e \Gamma^{d}{}_{ab,ce} = \Cdb*{dGamma2.000} \end{dmath*}
   \begin{dmath*} A^b A^c A^e A^f \Gamma^{d}{}_{ab,cef} = \Cdb*{dGamma3.000} \end{dmath*}
   \begin{dmath*} A^b A^c A^e A^f A^g \Gamma^{d}{}_{ab,cefg} = \Cdb*{dGamma4.000} \end{dmath*}
   \begin{dmath*} A^b A^c A^e A^f A^g A^h \Gamma^{d}{}_{ab,cefgh} = \Cdb*{dGamma5.000} \end{dmath*}
\end{dgroup*}

\end{document}


%==============================================================================
\chapter{Distances in Quantum Theory}
\label{chap:distappd}
%==============================================================================

This chapter follows mostly \cite{Wilde2009}. Some conventions follow those in
\cite{Petz2008}.

%------------------------------------------------------------------------------
\section{Trace Distance}
\label{sec:trace-dist}
%------------------------------------------------------------------------------

To begin with, define the \emph{trace norm} or \emph{$l_1$-norm} of an
Hermitian operator $M$ as
\begin{equation}
	\dvbr{M}_1 \coloneqq \tr\sqrt{M^\dagger M}.
\end{equation}
When the spectral decomposition $M = \sum_i \mu_i \Ket{i}\Bra{i}$ exists, the
trace norm reads
\begin{equation}
	\dvbr{M}_1 \equiv \sum_i\vbr{\mu_i},
\end{equation}
so the name $l_1$-norm comes. It is positive definite and homogeneous; the
triangle inequality also holds. Thus it can be used to define the \emph{trace
distance} between Hermitian operators ${M}$ and ${N}$ as
\begin{equation}
\rfun{T}{{M}, {N}} \coloneqq \frac{1}{2} \dvbr{M-N}_1 \equiv
\frac{1}{2} \tr \sqrt{\rbr{{M}-{N}}^\dagger\rbr{{M}-{N}}}.
\label{eq:def-trace-dist}
\end{equation}
Now consider density operators $\rho$ and $\sigma$ only. Since $\dvbr{\rho}_1
\equiv 1$, one sees
\begin{equation}
0 \le \rfun{T}{{\rho}, {\sigma}} \le 1,
\label{eq:def-trace-prop}
\end{equation}
followed from positive definiteness and triangle inequality.

The following lemma helps constructing a physical interpretation of the
distance. Let the Hermitian operator $\Lambda$ be such that all its eigenvalues
lies within $\sbr{0,1}$, then
\begin{equation}
\rfun{T}{{\rho}, {\sigma}} = \max_{0 \le {\Lambda} \le \Bbbone}
\cfun{\tr}{{\Lambda}\rbr{{\rho}-{\sigma}}}.
\end{equation}
To understand this, take $\Lambda \equiv \Ket{\alpha}\Bra{\alpha}$,
where $\Ket{\alpha}$ is the eigenket of some observable $\Alpha$, with
eigenvalue $\alpha$. Then $\tr\cbr{\Lambda \rho}$ tells the probability of
measuring $\Alpha$ which gives the result $\alpha$. Therefore $\tr\cbr{\Lambda
\rbr{\rho-\sigma}}$ gives the difference of the probability above for $\rho$ and
$\sigma$, and $\rfun{T}{{\rho}, {\sigma}}$ is the maximal value of the
difference above.

Though the trace distance is used in formulating \cref{chap:quantifing}, it is
rather formidable to compute due to the operatorial square root in
\cref{eq:def-trace-dist}. Therefore the author seeks other ways to evaluate the
quantity.

%------------------------------------------------------------------------------
\section{Fidelity}
\label{sec:fidelity}
%------------------------------------------------------------------------------

Fidelity is another means to compare two quantum states. The simplest case
of fidelity is that of two pure states,
\begin{equation}
\rfun{F}{\Ket{\alpha},\Ket{\beta}} \coloneqq \vbr{\Braket{\alpha | \beta }}.
\end{equation}
One sees that it is just the modulus of the transition amplitude, a measure of
\emph{faithfulness}. For more general cases, fidelity is defined as
\begin{align}
\rfun{F}{\Ket{\alpha},{\sigma}} &\coloneqq \sqrt{\Braket{\alpha | {\sigma} |
\alpha}}, \\
\label{eq:fidelity-pure-mixed}
\rfun{F}{{\rho},{\sigma}} &\coloneqq \tr\sqrt{{\rho}^\frac{1}{2}
{\sigma} {\rho}^\frac{1}{2}}.
\end{align}
In applications in this work, fidelity is solvable because only
\cref{eq:fidelity-pure-mixed} is needed.

An important property of fidelity is that it follows the \emph{Fuchs--van de
Graaf inequality} \cite{Fuchs1999})
\begin{equation}
1 - \rfun{F}{{\rho},{\sigma}} \le \rfun{T}{{\rho},{\sigma}}
\le \sqrt{1 - \rfun{F^2}{{\rho},{\sigma}}}.
\label{eq:ineq-fvdg}
\end{equation}
In this work, the trace distances are evaluated by computing the fidelities
exactly and inserting them to \cref{eq:ineq-fvdg}.

Consider a single harmonic oscillator with intrinsic frequency $\Omega$, a
thermalised state of it at temperature $T$ described by a density operator
$\rfun{\rho}{T}$, as well as a generalised Gaussian state $\Ket{\omega}$ (see
\cref{sec:single-harosc}). In the following the fidelity of them will be
calculated.

Since $\rfun{\rho}{T}$ is diagonal in the energy-eigenstate basis $\Ket{n}$, one
has
\begin{equation}
\Braket{\omega | \rfun{\rho}{T} | \omega} = \sum_{n=0}^{+\infty}
\Braket{\omega | n} \Braket{n | \rfun{\rho}{T} | n} \Braket{n | \omega},
\label{eq:fidelity-1}
\end{equation}
in which
\begin{align}
\Braket{n | \omega} &=
\begin{cases} \rbr{\Omega  \Re\omega }^{\frac{1}{4}}
\dfrac{2^{\frac{1}{2}-m} \sqrt{(2 m)!} }{m!}
\dfrac{(\Omega -\omega )^m}{(\omega +\Omega )^{m+\frac{1}{2}}}
& n = 2m, \\
0 & n = 2m+1,
\end{cases}
\tag{\ref{eq:n|omega} revisited} \\
\Braket{n | \rho | n} &=
\frac{1}{Z}\cfun{\exp}{-\rbr{n+\frac{1}{2}}\frac{\Omega}{T}}
\equiv
\rbr{\ee^{\Omega/T}-1} \cfun{\exp}{-\rbr{n+1}\frac{\Omega}{T}}.
\label{eq:n|rho|n}
\end{align}
Inserting \cref{eq:n|omega,eq:n|rho|n} into \cref{eq:fidelity-1}, one finds
that each term in the summation is of the form $b\cdot\binom{2m}{m}a^{2m}$
where $a$ and $b$ are expressions of $\Omega$, $\omega$ and $T$, which can be
computed by using
\begin{equation}
\arcsin z = \sum_{n=0}^{+\infty} \binom{2n}{n}\frac{z^{2n+1}}{4^n\rbr{2n+1}}
\end{equation}
and taking derivative with respect to $z$ on both sides. Therefore the fidelity
of $\rho(T)$ and $\Ket{\omega}$ is computed to be
\begin{equation}
\rfun{F}{\Ket{\omega}, \rho(T)} = \sqrt{2} \sqrt[4]{\frac{\Omega  \Re{\omega}
\left(\ee^{\Omega /T}-1\right)^2}{(\Omega -\Re{\omega})^2+\Im{\omega}^2 -
\ee^{2 \Omega/T} \rbr{(\Omega +\Re{\omega})^2+\Im{\omega}^2})}},
\label{eq:fidelity-gg-th}
\end{equation}
which can be used to set a bound on the trace distance by \cref{eq:ineq-fvdg}.


%!TEX root =  ../main.tex
% !TEX useTabs

\subsection{$r, \theta$}
Apart from arbitrary roads running north-south and east-west, no one would ever walk solely
in horizontal and vertical lines.  When you want to fly your plane somewhere, you turn the
nose towards where you want to go, and walked the shortest path.  For example, you might
know that your friend is 3m east of you and 4m north, but you would never walk the 7m such
ludacrous path takes.  What is the shortest path ($r$)?  What angle would you turn ($\theta$)?

\begin{tikzpicture}
	\draw (0,0) -- (3,0) -- (3,4) -- (0,0);
	\draw (1.5,0) node[anchor=north] {3m};
	\draw (3,2) node[anchor=west] {4cm};
	\draw (1.4,2) node[anchor=south] {$r$};
	\draw (0.5,0.4) node {$\theta$};
\end{tikzpicture}

Well, by this point in this class, you are undoubtedly very used to using the Pythagorean Theorem
to find hypotenuses, and inverse tangent to calculate angle.  While you should certainly be able to
calculate $r=5$, a calculator or table is required to know when tangent is $1.\overline{3}$,
approximately 0.927 radians.

On the other hand, suppose you knew something was 6 miles away, at an angle of $\frac{2}{3}\tau$.
How would you determine how far east-west and north-south it is?  Just as we learned with vectors,
we can use sine and cosine to calculate these values.  $\sin(\frac{2}{3}\tau)=\frac{y}{6}$ and
$\cos(\frac{2}{3}\tau)=\frac{x}{6}$.  Solving for $x$ and $y$, we see the coordinates of the
destination are $(-3,-3\sqrt{3})$.

\begin{derivation}{Polar Conversion Formulae}
\begin{equation}
	r^2=x^2+y^2
\end{equation}
\begin{equation}
	\tan\theta=\frac{y}{x}
\end{equation}
\begin{equation}
	x=r\cdot\cos\theta
\end{equation}
\begin{equation}
	y=r\cdot\sin\theta
\end{equation}
*The tangent equation doesn't work everywhere: what are the limitations on how we can use it?
\end{derivation}

\subsection{Properties}
Working with $r$ and $\theta$ to the exclusion of $x$ and $y$ yields a different way of looking
at the coordinate plane, called \emph{polar coordinates}.  Locations are still labeled via ordered
pairs, but of the form $(r,\theta)$.  Polar graph paper looks like this:

  \begin{tikzpicture}[scale=0.5]
    %Circles
    \foreach \r in {1, 2,...,7}
      \draw[thick] (0,0) circle (\r);
     %half radii
    %\foreach \r in {0.5, 1.5,...,7}
      %\draw[thin] (0,0) circle (\r);
    %1° Rays
    %\foreach \a in {0, 1,...,359}
      %\draw[-] (\a:7.7) -- (\a:8);
    %5° Rays
    %\foreach \a in {0, 5,...,359}
      %\draw[-] (\a:7.5) -- (\a:8);
    %15° Rays
    \foreach \a in {0, 15,...,359}
      \draw[thick] (\a:1) -- (\a:8);
    %30° Rays
    \foreach \a in {0, 30,...,359}
      \draw[thick] (0, 0) -- (\a:8);
    %Radius labels (background filled white)
    %\foreach \r in {1, 2,...,7}
      %\draw (\r,0) node[inner sep=1pt,below=3pt,rectangle,fill=white] {$\r$};
    %Main rays
    \foreach \a in {0, 90,...,359}
      \draw[very thick] (0, 0) -- (\a:8);
\end{tikzpicture}

\subsection{Negative Radii}
The ``spokes'' are every $\frac{\tau}{24}$, and the circles are every unit.  You might begin by turning
the angle first, and then ``walking out'' the radius.  On the polar graph, try locating $(3,\frac{\tau}{4})$.
It shouldn't be too complicated to see this is the same as the rectangular coordinate (0,3).  Angles
greater than $\tau$ are not difficult to reduce to simpler terms, but what about negative radii?
Where would $(-3,\frac{3}{4}\tau)$ take you?  We might imagine a person standing at the
pole (the origin on a polar graph), he or she would begin facing to the right, and then turning
counter-clockwise.  $\frac{3}{4}\tau$ is straight down, so our person's back is to the ``north''.  A
negative radii can be thought of as walking \emph{backwards}, so $(3,\frac{\tau}{4})$ and
$(-3,\frac{3}{4}\tau)$ take you to the same place!

\subsection{Polar Equations}
Just as Cartesian (or rectangular) equations as $y$ equals something in terms of $x$, so
too polar equations are written as $r$ equals something in terms of $\theta$.  Press the `mode'
button on your calculator, and you can see that there is an option called `POL', short for POLAR.
Accept that option and see what the `y=' button has become!  What has the X button become?

The exercise or problems will walk you through many different types of $r=$ equations, and they
can all be demonstrated in your calculator.  However, just as you have to know how to graph
$x=n$ even though it is not a function in rectangular, so too you should take a moment and reason
through how to graph $\theta=\frac{1}{5}\tau$ and similar equations.

When we attempt plot points to determine the make-up of $x=3$, we see that $y$ can be anything.
In other words, (3,0); (3,1); (3,2); (3,-2); (3,-10), etc. are all on the graph.  When we take this principle
over to graphing $\theta=\frac{5}{6}$, we recognize that any radius is possible, including negatives.
~\vfill