\documentclass[12pt,letterpaper]{article}
\usepackage[margin=1.0in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{cite}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{hyperref}
\setlength\parindent{0pt}
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}

\author{Victorique Pang}
\title{HW: Controller Area Network (CAN) data analysis.}

\begin{document}

\maketitle

\section{Objectives}
The objective of this homework is to familiarize students with CAN data and analyze them using Excel, MatLab and Google Earth.

\section{Introduction}
Modern vehicles including cars, trucks/buses as well as off-road equipment have a computer network that serves to manage the drive train, interaction with the operator, as well as to communicate with implements. We can tap into this computer network and record a host of messages that contain data that we are interested in during operations.\\

The data we are going to analyze were collected during a tillage operation with a John Deere tractor in spring 2016 using a Vector CAN data interface. The Vector unit was programmed to record data such as GPS location, Engine torque, RPM, as well as Wheel Speed, Ground Speed and Fuel consumption. Vector provides a tool that allow us to translate the proprietary Vector (xlx) format into an Excel readable format. The identifier and the data are in hexadecimal format, so we need to convert them to decimal format to extract the GPS coordinates in Latitude/ Longitude form. The Excel file that contains our data has the filename 60519009.xls. We are going to open this file in Excel, convert the strings into cells using Excel's text to column function, then we are going to extract only GPS data, we will convert them to decimal format, and copy and paste all our coordinates into a text file (either using Notepad or MatLab's editor). We will then use a small MatLab program that translates these coordinates into a kml file. This file will be read by Google Earth which will show our GPS locations graphically.\\

\section{Procedures}

The standard CAN message that shows the GPS location of a vehicle, is as follows: Note that the identifier is given in hexadecimal format. You can always convert the hexadecimal number into a decimal number, but the hexadecimal notation is far more compact and elegant. As you can see from the definition, the GPS location has the identifier CFEF31C, and it contains 8 bytes (that is 64 bits). The first 4 bytes represent the Longitude and the second 4 bytes the Latitude. After we convert the Lat and Lon data to decimal, we need to multiply that decimal number by a scaling factor of $10^{-7}$ and add an offset of -210. Since this field is in central Illinois, the latitude always starts with 40 and the longitude with -88 (going west from Greenwich in the UK yields a negative number).

\begin{itemize}
	\item   CFEF31C – Vehicle Position
	\item	Latitude
	\subitem	Bit Start: 0
	\subitem	Bits: 32
	\subitem	Scaling Factor: .0000001
	\subitem	Offset: -210
	\item	Longitude
	\subitem	Bit Start: 32
	\subitem	Bits: 32
	\subitem	Scaling Factor: .0000001
	\subitem	Offset: -210
\end{itemize}
\begin{enumerate}
	\item First open the CAN data file 60519009.xls in Excel format (answer yes on the question whether you want to open it).

	Select column A and now perform a text to column operation using tab, space and the colon (special character as delimiters), see Figure \ref{fig:TextToColumnDelimiters}. Be patient, for a large datafile like this it will take a while to do this.

	\begin{figure}
		\centering
		\includegraphics[width=0.8\linewidth]{TextToColumnDelimiters}
		\caption{Text To Column Delimiters choice in Excel}
		\label{fig:TextToColumnDelimiters}
	\end{figure}

	If you did it right now column L should contain the CAN message identifiers. Now you want to sort everything on column L so we can select only messages that contain GPS data, which have the identifier CFEF31C. MAKE SURE to select ALL columns before you sort on column L, otherwise the GPS data and the identifier are no longer matched.
	\item Remove all records (rows) that do not have the identifier CFEF31C. If all went well you should have 14,261 records.

	\item 	Save your file as "CANDataAnalysis\_YourName.xlsx" in excel format (not text).
	\item	Now we are going to extract the data from the GPS records. The standard says that the Latitude is contained in bytes 1-4 (that is 32 bits) of the datastring, and that the Longitude is contained in bytes 5-8. If you look in the datafile you will see not only numbers but also letters. This is because the data is given in the hexadecimal format so we need to first convert it into decimal format. We do this in a couple of steps: Firstly, we will convert all hexadecimal data into decimal data using Excel's hex2dec function. Start with the first record and in column W type =hex2dec(N1) copy this over to all 7 cells to the right of it.\\

	Now we need to calculate the Latitude and the Longitude from the decimal data records. The basis of our decimal data is 256. Therefore the Latitude will be (assuming the data is in columns W-AD, see Figure \ref{fig:FinalExcelSpreadsheet}):\\

	Cell AE\\

	$=(AD1+AC1*256+AB1*256^2+AA1*256^3)*0.0000001-210$

	The factor $10^{-7}$ is the scaling factor and the -210 is the offset, see the definition of the Vehicle position in the standard.

	Do the same thing for Cell AF:\\

	$=(Z1+Y1*256+X1*256^2+W1*256^3)*0.0000001-210$

	Copy cells W1 through AF1 over all the way to the last record in the file. Now you should have two columns one for the Latitude column AE () and one for the Longitude (column AF) containing 14,261 GPS coordinates. ALL GPS coordinates should start with 40 for the latitude and -88 for the longitude records.

	\begin{figure}
		\centering
		\includegraphics[width=1\linewidth]{FinalExcelSpreadsheet}
		\caption{This is what your spreadsheet should look like when you are done with it.}
		\label{fig:FinalExcelSpreadsheet}
	\end{figure}

	\item Copy ALL GPS coordinates (that is two columns and 14,261 rows), start Matlab, and open its editor (type edit). Now paste these two columns into a new file and save that file as GPSdataDemo.txt, \textbf{make sure you save it as a text file, not a m-file}.
	\item Type in (or copy from the tex file) the code shown below. Save this file as CANDataAnalysis.m (with extension m, since it is an executable MatLab script, make sure it is saved in the same folder where your GPSdataDemo.txt file resides). The program will load your GPSdataDemo.txt file and write the GPS coordinates in kml format which Google Earth can read.
	\begin{lstlisting}
	close all
	clear all
	clc

	KML_filename = 'GPSdataDemo.kml';
	load GPSdataDemo.txt;

	FieldPlots   = struct('lat', GPSdataDemo(:,1), 'lon', GPSdataDemo(:,2));

	kmlwritepoint([KML_filename], FieldPlots.lat, FieldPlots.lon);
	\end{lstlisting}

	\item Find your kml file and double click on it. This will open Google Earth, and if all went well, show the exact coordinates where the machine traveled. If MatLab throws an error in the kmlwritepoint line, that means that the Mapping toolbox is not installed, in that case finish this homework in the computer lab (220).

\end{enumerate}

\section{Submission}

Add a screenshot of the output that you saw in Google Earth to this file. Given in the tex file is the code to add a figure commented out, save the screenshot as AgEngineeringFarmGPS\_GoogleEarth.png.

%	\begin{figure}
%		\centering
%		\includegraphics[width=1\linewidth]{AgEngineeringFarmGPS_GoogleEarth}
%		\caption{Google Earth output screen shot.}
%		\label{fig:AgEngineeringFarmGPS_GoogleEarth.PNG}
%	\end{figure}

\end{document}


\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}
\usepackage{fancyvrb}
\usetikzlibrary{automata,positioning}

%
% Basic Document Settings
%

\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in

\linespread{1.1}

\pagestyle{fancy}
\lhead{\hmwkAuthorName}
\chead{\hmwkClass\ : \hmwkTitle}
\rhead{\firstxmark}
\lfoot{\lastxmark}
\cfoot{\thepage}

\renewcommand\headrulewidth{0.4pt}
\renewcommand\footrulewidth{0.4pt}

\setlength\parindent{0pt}

%
% Create Problem Sections
%

\newcommand{\enterProblemHeader}[1]{
    \nobreak\extramarks{}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
    \nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
}

\newcommand{\exitProblemHeader}[1]{
    \nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
    \stepcounter{#1}
    \nobreak\extramarks{Problem \arabic{#1}}{}\nobreak{}
}

\setcounter{secnumdepth}{0}
\newcounter{partCounter}
\newcounter{homeworkProblemCounter}
\setcounter{homeworkProblemCounter}{1}
\nobreak\extramarks{Problem \arabic{homeworkProblemCounter}}{}\nobreak{}

%
% Homework Problem Environment
%
% This environment takes an optional argument. When given, it will adjust the
% problem counter. This is useful for when the problems given for your
% assignment aren't sequential. See the last 3 problems of this template for an
% example.
%
\newenvironment{homeworkProblem}[1][-1]{
    \ifnum#1>0
        \setcounter{homeworkProblemCounter}{#1}
    \fi
    \section{Problem \arabic{homeworkProblemCounter}}
    \setcounter{partCounter}{1}
    \enterProblemHeader{homeworkProblemCounter}
}{
    \exitProblemHeader{homeworkProblemCounter}
}

%
% Homework Details
%   - Title
%   - Due date
%   - Class
%   - Section/Time
%   - Instructor
%   - Author
%

\newcommand{\hmwkTitle}{Homework\ \#1}
\newcommand{\hmwkDueDate}{\today}
\newcommand{\hmwkClass}{MATH6644 Iterative Methods}
\newcommand{\hmwkClassTime}{}
\newcommand{\hmwkClassInstructor}{}
\newcommand{\hmwkAuthorName}{Komahan Boopathy}

%
% Title Page
%

\title{
    \vspace{2in}
    \textmd{\textbf{\hmwkClass:\ \hmwkTitle}}\\
    \normalsize\vspace{0.1in}\small{\hmwkDueDate}\\
    %\vspace{0.1in}\large{\textit{\hmwkClassInstructor\ \hmwkClassTime}}
    \vspace{3in}
}

\author{\textbf{\Large\hmwkAuthorName}}
\date{}

\renewcommand{\part}[1]{\textbf{\large Part \Alph{partCounter}}\stepcounter{partCounter}\\}

%
% Various Helper Commands
%

% Useful for algorithms
\newcommand{\alg}[1]{\textsc{\bfseries \footnotesize #1}}

% For derivatives
\newcommand{\deriv}[1]{\frac{\mathrm{d}}{\mathrm{d}x} (#1)}

% For partial derivatives
\newcommand{\pderiv}[2]{\frac{\partial #1}{\partial #2}}

% Integral dx
\newcommand{\dx}{\mathrm{d}x}

% Alias for the Solution section header
\newcommand{\solution}{\textbf{\large Solution}}

% Probability commands: Expectation, Variance, Covariance, Bias
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\Bias}{\mathrm{Bias}}

\begin{document}
\maketitle
\thispagestyle{empty}

\pagebreak

\begin{homeworkProblem}
  Find an orthonormal basis for the column space of matrix
  $$A =
  \begin{bmatrix}
    1 & 1 & 0 \\
    1 & 0 & 2 \\
    1 & 0 & 1 \\
    1 & 1 & -1
  \end{bmatrix}$$

  The columns $\mathbf{c_1}$, $\mathbf{c_1}$ and $\mathbf{c_3}$ are
  \underline{not orthonormal} to each other. Gram-Scmidt orthogonalization
  procedure is used to orthogonalize the columns as follows.
  \\
  The first
  column $\mathbf{c_1}$ is chosen as the reference.
  $$\mathbf{v_1} = \mathbf{c_1} =
  \begin{bmatrix}
    1 \\
    1 \\
    1 \\
    1
  \end{bmatrix}$$

  The second vector
  \begin{equation*}
    \begin{split}
    \mathbf{v_2} & = \mathbf{c_2} - \dfrac{(\mathbf{c_2},\mathbf{v_1})}{(\mathbf{v_1},\mathbf{v_1})}\mathbf{v_1} \\
    & =   \begin{bmatrix}
    1 \\
    0 \\
    0 \\
    1
  \end{bmatrix}
    -\dfrac{1}{2}
    \begin{bmatrix}
      1 \\
      1 \\
      1 \\
      1
    \end{bmatrix}
     =
    \begin{bmatrix}
      1/2 \\
      -1/2 \\
      -1/2 \\
      1/2
    \end{bmatrix}
    \end{split}
  \end{equation*}

  The third vector
    \begin{equation*}
  \begin{split}
      \mathbf{v_3}  & = \mathbf{c_3} - \dfrac{(\mathbf{c_3},\mathbf{v_1})}{(\mathbf{v_1},\mathbf{v_1})}\mathbf{v_1} - \dfrac{(\mathbf{c_3},\mathbf{v_2})}{(\mathbf{v_2},\mathbf{v_2})}\mathbf{v_2} \\
      & =
      \begin{bmatrix}
        0 \\
        2 \\
        1 \\
        -1
      \end{bmatrix}
      -\dfrac{1}{2}
      \begin{bmatrix}
        1 \\
        1 \\
        1 \\
        1
      \end{bmatrix}
      +\dfrac{2}{1}
      \begin{bmatrix}
      1/2 \\
      -1/2 \\
      -1/2 \\
      1/2
      \end{bmatrix}
     =
     \begin{bmatrix}
       1/2 \\
       1/2 \\
       -1/2 \\
       -1/2
    \end{bmatrix}
    \end{split}
  \end{equation*}

  Finally these vectors are \underline{normalized to unity} and the corresponding
  orthonormal basis for the column space of $\mathbf{A}$ is
  $$\begin{bmatrix}
    1/2 &  1/2 & 1/2  \\
    1/2 & -1/2 & 1/2  \\
    1/2 & -1/2 & -1/2 \\
    1/2 &  1/2 & -1/2
  \end{bmatrix}$$

\end{homeworkProblem}

\clearpage
\begin{homeworkProblem}
  Consider a matrix
  $$A =
  \begin{bmatrix}
     2 & 2 & -2 \\
     2 & 6 & 0 \\
    -2 & 0 & 7
  \end{bmatrix}$$

  \paragraph{a.}
  \emph{Is this matrix diagonalizable? Why or why not?}
  \medskip
  A matrix is diagonalizable if there are $n$ linearly independent
  eigenvectors. Then, we can do a similarity transformation of the
  form $J=V^{-1}AV$, where $V$ is the matrix of eigenvectors.
  \\

  The
  eigenvalues are found using $|A-\lambda I|=0$ which results in the
  cubic characteristic equation
  $$
  -\lambda^3 + 15\lambda^2 -60\lambda + 32 = 0
  $$

  The eigenvalues are $\lambda_1 = 8$, $\lambda_2 =
  \frac{7+\sqrt{33}}{2}$ and $\lambda_2 = \frac{7-\sqrt{33}}{2}$ The
  eigenvalues are distinct (not repeated), therefore we can find
  eigenvectors that form a simularity transformation as shown
  above. Therefore it is possible to diagonalize the matrix.

  \paragraph{b.}
  \emph{Compute the 1-norm, 2-norm, Frobenius norm and infinite-norm.}
  \medskip

  \begin{itemize}
  \item  1-norm of the matrix is the largest column sum i.e. $\max
    \{\sum{c_1}, \sum{c_2}, \sum{c_3}\} = \max\{6,8,9\}=9$

  \item  2-norm of the matrix is the largest singular value (eigenvalue
    in this case) i.e., $\max \{8,\frac{7-\sqrt{33}}{2},\frac{7-\sqrt{33}}{2}\} = 8$.

  \item  Infinite-norm of the matrix is the largest row sum i.e., $\max
    \{\sum{r_1}, \sum{r_2}, \sum{r_3}\} = \max\{8,8,9\}=9$

  \item Frobenius-norm of the matrix is $\sum_{i,j} |A_{ij}|^2 = \sqrt{2^2+2^2+2^2+2^2+6^2+2^2+7^2} = 10.247$.

  \end{itemize}

  \paragraph{c.}
  \emph{Compute the spectral radius of A. Compare and comment on the values from (b) and (c).}
  \medskip

  The spectral radius of A is $\rho(A) = \max\{\lambda_i\} = 8$.  In
  this case, the spectral radius is same as the 2-norm of the matrix
  A. The 2-norm of the matrix is the smallest norm of the different
  computed norms of the matrix.

\end{homeworkProblem}
\clearpage
\begin{homeworkProblem}
  \emph{Give the matrix expression for the symmetric Gauss-Seidel iterations.}
  \medskip

  The matrix $A = D-E-F$ and the right hand side $b$. The symmetric
  Gauss-Seidel iterations are defined as follows.
  One iteration of Symmetric GS involves one forward and one reverse
  sweeps, each of ${\cal{O}}(n^2)$ operations.

  \paragraph{Forward Sweep}

  $$(D-E) x^{k+1/2} = F x^{k} + b$$

  The strictly lower triangular system D-E is swept using forward
  substitution method.

  \paragraph{Backward Substitution}

  $$(D-F) x^{k+1} = E x^{k+1/2} + b$$

  The strictly upper triangular system D-E is swept using backward
  substitution method.

\end{homeworkProblem}
\clearpage
\begin{homeworkProblem}
Construct a $3 \times 3$ dense matrix with $\rho(A)>1$. Define an
iteration,
$$
\mathbf{x}^{k+1} = G \mathbf{x} + \mathbf{c}.
$$
Find an example $\mathbf{x_0}$ and $\mathbf{c}$ such that the
iteration does not converge.
\medskip

\paragraph{Example}

Let the matrix $A = M-N$.  We define an iteration,
$$
\mathbf{x}^{k+1} = G \mathbf{x} + \mathbf{c}.
$$ where $G = M^{-1}N$ and $c = M^{-1}b$.
%Consider a Gauss-Jacobi
%iteration where $G=I-D^{-1}A$, where $D$ being the diagonal entries of
%the matrix A.
Let
$$\mathbf{G} =
\begin{bmatrix}
  0.1 & 1 & 1 \\
  1 & 0.1 & 1 \\
  1 & 1 & 0.1
\end{bmatrix}$$
$$
\mathbf{c} =
  \begin{bmatrix}
    1 \\
    1 \\
    1 \\
  \end{bmatrix}$$
and
$$
\mathbf{x_0} =
  \begin{bmatrix}
    1 \\
    2 \\
    3 \\
  \end{bmatrix}$$
The following sequence of solutions is obtained for iterations
\begin{verbatim}
1    6.1000    5.2000    4.3000
2   11.1100   11.9200   12.7300
3   26.7610   26.0320   25.3030
4   55.0111   55.6672   56.3233
5  118.4916  117.9011  117.3106
\end{verbatim}

\paragraph{Discussion}

It can be seen that the scheme diverges and reaches infinity within a
hundred iterations. The spectral radius of $\mathbf{G}$ is 2.1 which
is greater than 1 and therefore we can not expect this iteration to
converge.  An iterative method is guaranteed to converge if $\rho(G) <
1$. On the contrary, in this case the spectral radius is greater than
1 and therefore the iterative method will not converge. The
convergence is largly not caused by the choice of the initial guess
$x_0$ , but rather is a properly of the iteration matrix, because it
is the matrix which enlarges (or diminishes) the solution vector
repeatedly (unless it is an eigenvector at that iteration). Only, the
\emph{rate} of convergence is will be affected by $x_0$. Also note
that the vector $\mathbf{c}$ \emph{simply} translates the solution and
would not scale the solution up or down.

\end{homeworkProblem}
\clearpage
\begin{homeworkProblem}
\emph{Discretize the following differential equation}
  $$ -u^{\prime\prime} + 4 u = 0 $$
  $$ u(0) = -1, u(1) = 2, x\in [0,1]$$
\emph{by the central
    difference scheme. Write your linear system of equaitons. Solve
    the system by classical iterations such as Jacobi, Gauss-Seidel,
    SOR with n = 1000. Test the relaxation parameter for several
    values and decide which one is better.  You need to discuss your
    results. }

  \paragraph{a. Discretization of ODE}
  \medskip
  The discretized ODE is  $ - \dfrac{u_{i+1} -2 u_i + u_{i-1}}{h^2} + 4 u_i = 0.$
  This can be rewritten as follows$$- u_{i+1} + (2 + 4h^2) u_i - u_{i-1}  = 0.$$

  \paragraph{b. Linear system of equations}
  \medskip
  The matrix
  $$\mathbf{A} =
  \begin{bmatrix}
    (2 + 4h^2) & -1         & 0 & 0 \\
    -1         & (2 + 4h^2) & -1 & 0  \\
    0          & -1         & (2 + 4h^2) & -1  \\
    \vdots      &      & \ddots  &   \\
    0          &       0    & -1        & (2 + 4h^2)
  \end{bmatrix}$$
This is a banded tri-diagonal system. The right hand side is
 $$\mathbf{b} =
  \begin{bmatrix}
    -1 \\
    0 \\
    0 \\
    \vdots\\
    2
  \end{bmatrix}$$
  There are 1000 unknowns in this problem.

  \paragraph{c. Iterative solutions}
  The linear system is solved using Gauss-Jacobi, Gauss-Seidel and SOR
  methods. The stopping tolerance was taken to be $10^{-6}$ and
  maximum allowed iterations are $10^{5}$. The exact solution is
  computed using direct factorization method.  Figure~\ref{fig:profile} compares
  the solutions produced by each of these methods. All methods were
  converged to the same tolerance and therefore produce similar
  profile for the unknown $u(x)$. A minor discrepancy with the exact
  solution can also be noticed but it can be reduced with a higher
  tolerance for convergence.

  \begin{figure}[H]
    \centering
    \includegraphics[width=0.65\textwidth]{profile.pdf}
    \caption{Plot of solution profile in the domain for different
      solution methods.}
    \label{fig:profile}
  \end{figure}

  %plot of u vs. x for 1,2, 3, 4

  \paragraph{d. Relaxation Parameter}

  Several values of the relaxation parameter $\omega$ was tested
  between 0.4 and 2.0. Figure~\ref{fig:relaxation} shows the plot of the value of
  the relaxation parameter with the number of SOR iteration took to
  converge to the specified tolerance. From this plot it can be seen
  that the optimal value of $\omega$ lies somewhere between in (1.99,
  2.0). As soon as $\omega$ hits 2.0, the speedup is lost and also SOR
  becomes unstable.

  % plot of omega vs. niters for sor

  \begin{figure}[H]
    \centering
    \includegraphics[width=0.65\textwidth]{relaxation_study.pdf}
    \caption{Finding optimal relaxation parameter based on
      experimentation.}
    \label{fig:relaxation}
  \end{figure}

  The best perfoming SOR with $\omega=1.99$ is compared with plain
  Gauss-Jacobi and Gauss-Seidel in Figure~\ref{fig:convergence} in
  terms of the number of iterations taken to converge to a
  solution. Gauss Seidel is faster than Gauss Jacobi. SOR is faster
  than the other two methods.

  \begin{figure}[H]
    \centering
    \includegraphics[width=0.65\textwidth]{convergence.pdf}
    \caption{Convergence of iterative solution methods.}
    \label{fig:convergence}
  \end{figure}

  % plot of tol vs. niters for 1, 2, 3

  In general, the number of iterations are too many for the problem
  size of $1000\times1000$ for GJ and GS methods and SOR without
  optimal $\omega$. The reason is that as $h \to 0$ (with refinement
  of the discretization), the matrix $A$ loses its diagonal
  dominance. Mathematically,
  $$ \lim_{h \to 0} 2 + 4h^2 \approx 2 $$ which equals the sum of
  magnitudes of the non-diagonal entries (-1 and -1 in this case).
  This can be seen as the reason for poor performance in this test
  case.  Therefore proper care must be exercised before choosing h and
  order of discretization of derivatives for the iterative schemes to
  perform well.

\end{homeworkProblem}

\end{document}


\newcommand{\of}{\texttt{.o}~}

\lab{Python}{Interfacing With Other Programming Languages Using Cython}{Interfacing With Other Programming Languages Using Cython}
\label{lab:cythonwrap}

\objective{Learn to interface with object files using Cython. This lab should be worked through on a machine that has already been configured to build Cython extensions using gcc or MinGW.}

There are several ways to interface with other languages from Python.
Calling code written in C or Fortran is often done for performance reasons.
There is also an easy built in interface for R, which is a statistical computing language.
Writing an interface for functions or objects that have been written in one language so that they are accessible in another language is called \emph{wrapping}.  For example, many of the linear algebra functions in NumPy wrap the corresponding function in LAPACK or BLAS.
This allows us to gain the speed of these very optimized libraries but use them in a nice, Pythonic way.

In this lab we will focus primarily on how Python can interact with C, C++, and Fortran.
Python can interface with these languages in a variety of ways.
There is a built-in library, ctypes, that allows you to interface with object files compiled from other languages.
There are also many other methods for interfacing with compiled languages like C, C++, and Fortran.
A particularly convenient way to do this is with Cython.
Since Cython already compiles as a C file, we can essentially use it to call functions from a C program.
This is done through the use of object files.

% Describe .o files and dll's
% This is mainly just to help them know what is going on.
\section*{Object Files and DLL's}
For C, C++, and Fortran, the desired functions or classes are compiled into an object file containing instructions in assembly that can be used by compilers of a variety of languages.
Object files typically use the \of extension.
An object file that can be used and modified by multiple programs is called a \emph{shared object} and generally use the \texttt{.so} extension.
When C code has been compiled with the proper headers, etc. to interface with Python, it uses the \texttt{.pyd} extension on Windows and the \texttt{.so} extension on Unix-based operating systems.
The two extensions are essentially the same, except that Python object files are distinguished from shared object files on Windows.
When you compile anything that uses functions from object files, you must tell your compiler to link to the contents of the object file.
Otherwise it will not be able to find any of the needed functions.
The part of the compiler that forms these links between the code is called the \emph{linker}.
If you do not give your compiler proper instructions for linking, it will raise a linking error.
The compiler must also be able to find the necessary header files for compiling the source code.
This can be done by including the proper directories in the system path or by passing the paths to the proper directories as arguments to the compiler at compile time.

Object files can statically linked or dynamically linked.
When statically linked, the entire object file becomes part of the final program.
Dynamic linking, on the other hand, is just a reference to the object file.
At runtime, the operating system will take care of loading any needed dynamically linked libraries.
The dynamically linked programs depend on the presence of the appropriate object files on the target system in order to work.
Since the statically linked libraries are part of the program itself, there is no need to load any libraries

In our instructions here we will use the GNU C Compiler (gcc) to demonstrate how Python can be made to interface with other languages.
Other compilers can be used, but, particularly on Windows based computers, a significant amount of configuration may be needed to get everything to work properly.
Python's distutils package is designed to avoid some of the difficulty that comes when interfacing with interfacing with different compilers, and we will show some very basic examples of how it is used here.
The simplest way to learn to interface with other languages is to work through simple examples.
\begin{info}
The examples in this lab are intended to provide simple templates that you can use later to wrap C and Fortran functions.
It will be good to read through and think about how each file works, but it will not be critical for you to understand every detail of how this works at this point.
\end{info}

\begin{warn}
When passing arrays as pointers to C, C++, and Fortran functions, you must be \emph{absolutely sure} that the array you are passing to the function is contiguous.
This means that the entries of the array are stored in \emph{adjacent} entries in memory.
Passing one of these functions a strided array will result in out of bounds memory accesses and could crash your computer.
When working with two dimensional arrays, C and C++ expect rows to be stored in contiguous blocks of memory.
Fortran expects columns to be stored in contiguous blocks of memory.

You will also need to pass the size of the array as a separate parameter to avoid out of bounds memory accesses.
\end{warn}

\section*{Wrapping a C Function}
Consider the following C function to compute the solution to a tridiagonal system.
it works by taking pointers to four arrays.
Array \li{a} and \li{c} have length \li{n-1} and represent the first subdiagonal and first superdiagonal of a banded matrix with bandwidth 3.
Array \li{b} and \li{x} have length \li{n} and represent the main diagonal of the banded matrix and the right hand side of the system of equations.
\li{c} and \li{x} are modified in place to compute the solution the the system.
\li{c} is used to store temporary values and \li{x} is transformed into the solution to the system.

\lstinputlisting[style=fromfile, language=C, name=ctridiag.c]{./ctridiag/ctridiag.c}

This file can be compiled to a \li{.o} file so that this function can be called by other programs by running the following command in a terminal:
\begin{lstlisting}[style=ShellInput]
gcc -fPIC -c ctridiag.c -o ctridiag.o
\end{lstlisting}
This calls the C-compiler gcc and tells it to compile the file \texttt{ctridiag.c} to an object file \texttt{ctridiag.o}.
The \texttt{-c} flag tells it to compile to an object file without linking as opposed to compiling to some sort of executable.
Those that are familiar with C may have noticed that we did not include a \li{main} function in our C file.
The \texttt{-c} flag is what prevents this from causing errors with the compiler.
The \texttt{-fPIC} option is required when building code for a shared object.

Once we have run this command the file has been compiled to a \of file, but it still is not accessible in Python.
Python, though it relies on C internally, needs some special interfaces to interact with \of files like this.
A general approach for accessing these external functions from Python is to define in some way what inputs each function takes.
We will show how this is done with Cython.
Since a Cython file compiles to a C file which is then compiled to a callable extension for Python, it can be used to interface with C code and other object files.
We will use the following approach:
\begin{enumerate}
\item Write a C header that specifies what the function is named and how it is called.
\item Write a Cython file that imports the header to its C file and defines a Python wrapper for C function to import.
\item Compile the Cython file to C code.
\item Compile the Cython file to a Python extension, giving it access to the the object file we are accessing and giving the compiler access to the proper header files.
\end{enumerate}

An approach similar to this will work for some other types of \of files compiled from other languages as well.

The header file that defines how to interface with the C function is very simple:

\lstinputlisting[style=fromfile, language=C, name=ctridiag.h]{./ctridiag/ctridiag.h}

We can now use this header file to tell Cython how to interact with the object file once it has been loaded.
Here is a simple Cython file that defines a Python wrapper for the C function contained in the object file:

\lstinputlisting[style=fromfile, language=Python, name=cython_ctridiag.pyx]{./ctridiag/cython_ctridiag.pyx}

\begin{info}
This is a good example of the reason header files are used.
A C header file tells the C compiler how to interface with compiled C functions that it will link to later in compilation.
The compiler then allows for the use of the given function throughout the C file as if it had already been defined.
The Cython \li{cdef extern} declaration shown in this cython file is used in the same way for the Cython compiler.
Essentially what it does is it tells the Cython compiler, "When the C file generated from this .pyx file is compiled it will be linked against a C library that contains a C function that acts like this:..."
Describing the C function this way to the Cython compiler allows it to check for undefined references and improper function use before building the C file.
It is possible to define Cython headers much the same way we define C headers.
These headers use the .pxd file extension and can be imported via the \li{cimport} statement in Cython.
.pxd files are called Cython declaration files.
When you use a \li{cimport} statement to import basic C functions or to interface with NumPy arrays and NumPy datatypes, you are really importing Cython declaration files that contain the proper signatures so that the Cython compiler can know how these functions are meant to behave.
Several different tools for automatically generating Cython declaration files from C and C++ headers are available online.
\end{info}

Now that we have the needed source files written, we can build the Python extension.
On Windows, using the compiler MinGW (a version of gcc for windows), the compilation can be performed by running the following setup file.

\lstinputlisting[style=fromfile, language=Python, name=ctridiag_setup_windows64.py]{./ctridiag/ctridiag_setup_windows64.py}

The following file works on Linux and Macintosh machines using gcc.

\lstinputlisting[style=fromfile, language=Python, name=ctridiag_setup_linux.py]{./ctridiag/ctridiag_setup_linux.py}

The distutils module in Python is designed to allow the compilation of Python extensions on different platforms with a single setup file.
The following setup file uses distutils to compile the Cython file.
It should run on Windows, Linux, or Macintosh based computers.
This is a more standard way to build this sort of Cython extension.

\lstinputlisting[style=fromfile, language=Python, name=ctridiag_setup_distutils.py]{./ctridiag/ctridiag_setup_distutils.py}

This setup file can be called via command line using the following command:
\begin{lstlisting}[style=ShellInput]
python ctridiag_setup_distutils.py build_ext --inplace
\end{lstlisting}
The \texttt{--inplace} flag tells the script to compile the extension in the current directory.

Here is a simple script to test whether or not the compilation worked.

\lstinputlisting[style=fromfile, language=Python, name=ctridiag_test.py]{./ctridiag/ctridiag_test.py}

\begin{info}
It is a good idea to test whether or not these compilations work using test scripts instead of doing it manually or in an IPython notebook since you may run into trouble when trying to build an extension that replaces a file currently in use.
\end{info}

\section*{Wrapping a Fortran Function}
By making some small modifications to our original approach we can also use Cython to interface with functions that have been written in Fortran.
Here we will consider a simple Fortran implementation of the same function as before.
Here is that same algorithm implemented in Fortran.
Since this function does not return a value, it is called a subroutine in Fortran.
In this case we have used the \li{iso_c_binding} library in C to make the function accept pointers to native C types.
If we were wrapping a function or subroutine that we did not write ourselves we would have to define a Fortran function that uses the \li{iso_c_binding} library to accept pointers from C and then uses the values it receives to call the original function.
\lstinputlisting[style=fromfile, language=Fortran, name=ftridiag.f90]{./ftridiag/ftridiag.f90}

We will now write a header that tells C how to interface with the function we have just defined.
\begin{warn}
When interfacing between Fortran and C, you will have to pass pointers to \emph{all} the variables you send to the Fortran function as arguments.
Passing a variable directly will probably crash Python.
\end{warn}
Here is the file:
\lstinputlisting[style=fromfile, language=C, name=ftridiag.h]{./ftridiag/ftridiag.h}

To compile \li{ftridiag.f90} to an object file you can run the following command in your command line:
\begin{lstlisting}[style=ShellInput]
gfortran -fPIC -c ftridiag.f90 -o ftridiag.o"
\end{lstlisting}
As before, if you are working on a Linux or Macintosh based machine you will probably need to include the \texttt{-fPIC} flag as well.

Aside from the small changes in the names used, the modified header file, and the use of gfortran instead of gcc, the rest of the compilation process is entirely the same.
The test script that verifies that the function works properly is the same except that it will import the function from the module \li{cython_ftridiag} instead.
The setup files specific to Windows and Linux, the setup file using distutils, and the test script are included with this lab.

\begin{warn}
When working with higher dimensional arrays Fortran differs from C in that the columns are stored in contiguous blocks of memory instead of the rows.
The default for NumPy and for C arrays is to have rows stored in contiguous blocks, but this varies, depending on what computation has already been done with the NumPy array.
This means that, whenever you need to interface with Fortran code that is meant to act on arrays with multiple dimensions, you \emph{must} be very careful about what is a row and what is a column.
When you pass a Fortran subroutine a pointer to an array it will, by default, assume that the entries of the array are arranged in Fortran order.
Many Fortran routines have options that allow you to specify whether to act on an array or its transpose, but you should still be very careful about this.
\end{warn}

\begin{info}
It may seem unusual that we have already provided a Fortran function that has been modified so that it is callable from C.
Though this is not pure Fortran, it is not necessarily an uncommon scenario.
Many larger Fortran libraries (for example, LAPACK) provide C wrappers for all their functions.
When wrapping a Fortran library, a C wrapper may already be available for use.
\end{info}

Here is a file for the next problem:
\lstinputlisting[style=fromfile, language=Fortran, name=fssor.f90]{./fssor/fssor.f90}

\begin{problem}
The Fortran subroutine \li{fssor} included with this lab uses a technique called Successive Over Relaxation to solve Laplace's equation on a rectangular domain discretized as a grid of equally spaced points.
It solves the same problem as problem involving Laplace's equation in Lab \ref{lab:NumPyArrays}.
It takes the following inputs:
\begin{itemize}
\item $U$ is expected to be a pointer to a Fortran ordered array of double precision numbers.
\item $m$ is a pointer to an integer storing the number of rows of $U$.
\item $n$ is a pointer to an integer storing the number of columns of $U$.
\item $\omega$ is a pointer to a double precision floating point value storing some parameter between $1$ and $2$.
The closer this value is to $2$, the faster the algorithm will converge, but if it is too close the algorithm may not converge at all.
For this lab just use $1.9$.
\item tol is a pointer to a floating point number storing a tolerance used to determine when the algorithm should terminate.
\item maxiters is a pointer to an integer storing the maximum allowable number of iterations.
\item info is a pointer to an integer.
This subroutine will set info to $0$ if it converged to a solution within the given tolerance.
It will set info to $1$ if it did not.
\end{itemize}

Write a corresponding C header \li{fssor.h}, Cython wrapper \li{cython_fssor.pyx}, and Cython setup file (using distutils) \li{fssor_setup_distutils.py} to wrap this subroutine for use in Python.
Call the wrapper function in your Cython file \li{cyssor}.

Fortran works with Fortran ordered arrays, but this algorithm does not need any particular orientation of axes.
Have your Cython wrapper swap the length of the axes when calling \li{fssor} if the array is C ordered.
If it is Fortran ordered, pass the lengths as they are.
Have the wrapper raise an error if the array $U$ is neither Fortran ordered nor C ordered.
Also have it raise an error if the algorithm failed to converge to within the desired tolerances (i.e. if the function sets info to 1).
Use keyword arguments to pass \li{fssor} a default tolerance of $10e^{-9}$ and a default maximum number of iterations to 10000.

Here is how you should be able to call this function:
\begin{lstlisting}
import numpy as np
from cython_fssor import cyssor
resolution = 501
U = np.zeros((resolution, resolution))
X = np.linspace(0, 1, resolution)
U[0] = np.sin(2 * np.pi * X)
U[-1] = - U[0]
cyssor(U, 1.9)
\end{lstlisting}

Generate a 3D plot of $U$ after it has been modified by the function \li{cyssor}.
Use equally spaced points between 0 and 1 as your $x$ and $y$ values.
\end{problem}

Here is some code for the next problem.
\lstinputlisting[style=fromfile, language=C, name=cssor.c]{./cssor/cssor.c}
\begin{problem}
(Optional)
The above C code is another implementation of the Successive Over Relaxation algorithm for solving Laplace's equation.
Wrap it so that it is callable from Python as well.
Produce the same plot as in the previous problem using the C version of this algorithm.
Notice that info is still passed as a pointer because the function needs to be able to modify it.
\end{problem}

\section*{Interfacing with C++}
Cython can also be used to wrap C++ functions and classes.
It can compile entire modules to C++ instead of C if we specify C++ as the language in the setup file.
Here we will focus primarily on wrapping C++ classes since wrapping a C++ function is roughly the same as wrapping a function from C or Fortran.
Cython also supports wrapping templated classes and functions.
Many other C++ features like operator overloading and the \li{new} and \li{del} operators are also supported when using C++.

The process for exposing a C++ class to Cython is essentially the same.
The C++ code must first be compiled to an object file.
In our Cython file we then declare that we will be importing functions and classes from a C++ file so that the Cython compiler knows how they will behave.
We then compile our Cython file by first compiling to C++

Included with this lab are three C++ classes.
The \li{Permutation} class is the primary class we will be wrapping.
It implements arithmetic for the Cauchy cycle representation of permutations.
For those not familiar with permutation arithmetic, there are some examples in the file \li{unittest.py}.
The other two classes are used in the construction of the \li{Permutation} class.
Because the Permutation class depends on the \li{Node} and \li{Cycle} classes, they must all be compiled together.
Here is the \li{setup.py} to set up the wrapper for the \li{Permutation} class.

\lstinputlisting[style=fromfile, language=Python, name=pypermutation_setup.py]{./permutations/pypermutation_setup.py}

\begin{warn}
When wrapping C++ classes, templates, etc. you should always make sure that you specify the language as C++ as we have shown in this setup file.
\end{warn}

We need to tell the Cython compiler how to interface with the C++ class.
This can be done in much the same way that we defined the interfaces for C and Fortran functions, but we now need to declare that we are importing a class with several functions that act on it.
We will include the declarations corresponding to this class in a \li{.pxd} file.
\li{.pxd} are called \emph{declaration} files.
Though declarations are, strictly speaking, not ``Cython headers'', they can be used in similar ways.
Here we will declare the Permutation class and some of its public methods so that we can use them in Cython.
\lstinputlisting[style=fromfile, language=Python, name=Permutation.pxd]{./permutations/Permutation_incomplete.pxd}
This \li{.pxd} file can be included in our Cython file with the line \li{from Permutation cimport Permutation}.
Cython comes with several pre-built declaration files.
These declaration files are good examples of the proper syntax for wrapping C++ class templates.
Some of these declaration files allow Cython code to interface with containers and other classes from the C++ standard library like \li{deque}, \li{list}, \li{map}, \li{pair}, \li{queue}, \li{set}, \li{stack}, \li{string}, \li{utility}, and \li{vector}.
Each of these declaration files can be loaded by using something like
\begin{lstlisting}
from libcpp.vector cimport vector
\end{lstlisting}
Cython also supports some kinds of automatic conversion from Python data types to standard library containers.
See the Cython documentation for more information on interfacing with C++ containers.

As we mentioned before, the general approach for wrapping a C++ class is to make a Cython class that wraps a pointer to the C++ class.
Here is an example of how this is done.
\lstinputlisting[style=fromfile, language=Python, name=pypermutation.pyx]{./permutations/pypermutation_incomplete.pyx}
Notice that we included the declaration file for the class.

\begin{problem}
The Permutation class includes methods to trace an index through the inverse permutation, get the minimum index that is changed by the permutation, and raise the permutation to a power.
The declarations for these functions are commented out in the \li{pypermutation.pyx} file.
Uncomment the declarations and add in the code necessary so that these methods are also available in Python.
These functions are declared in the header \li{Permutation.hpp}, but they are not declared in the declaration file \li{Permutation.pxd}.
Add the proper declarations to the declaration file.

Note: the argument $z$ that is included in the power function for the Permutation class is a mandatory argument for the exponentiation operator in Cython.
It tells the computer to compute the power of a number mod another number.
In this case, raise an error if $z$ is not \li{None}.

Look at the \li{__mul__} method for an example of how to construct and return a new PyPermutation object.
Keep in mind that the \li{power} method of the \li{Permutation} class in C++ returns a pointer to a new \li{Permutation} object.
\end{problem}

\let\of\undefined


\documentclass[../../main]{subfiles}
\pagestyle{fancy}

\begin{document}

\chapter{Preliminaries}
\thispagestyle{fancy}

This chapter will give a rough overview of concepts that will be used in subsequent chapters. We start with briefly recalling properties regarding filters and elementary embeddings that we will be employing, as well as describing \gbc\, G\"odel-Bernays class theory. We then spend some time on large cardinal theory, as it plays a prominent role in understanding how the \textit{virtual} large cardinals in Chapter~\ref{chapter.virtual-large-cardinals} compares to the other large cardinals.

We will also routinely be working with the core model $K$ throughout this thesis, so we include a section that will give a high-level overview of what $K$ is and which key properties it has. The last section in these preliminaries will cover some results related to working with elementary embeddings in different forcing extensions, which tend to not be covered in standard textbooks. In the interest of brevity we will provide references rather than proofs of most of these results.

\section{Filters and elementary embeddings}
\label{prelims.filters}

When we are dealing with elementary embeddings between set-sized structures, we will usually be interested in structures of the following form:

\defi{
	For a cardinal $\kappa$, a \textbf{weak $\kappa$-model} is a set $\M$ of size $\kappa$ satisfying that $\kappa+1\subset\M$ and $(\M,\in)\models\zfc^-$. If furthermore $\M^{<\kappa}\subset \M$, $\M$ is a \textbf{$\kappa$-model}.\footnote{Note that our (weak) $\kappa$-models do not have to be transitive, in contrast to the models considered in \cite{Ramsey1} and \cite{Ramsey2}. Not requiring the models to be transitive was introduced in \cite{HolySchlicht}.}
}

A proto-typical example of a weak $\kappa$-model is any $\kappa$-sized $M\prec H_{\kappa^+}$, as it is well-known that $H_{\kappa^+}$ satisfies $\zfc^-$. We can get a $\kappa$-model from this by closing off $M$ under ${<}\kappa$-sequences while maintaining being an elementary substructure of $H_{\kappa^+}$. Note that this only works if $2^{<\kappa}=\kappa$ however, as otherwise the resulting structure would be too large.

Embeddings between these weak $\kappa$-models can equivalently be phrased in terms of ultrafilters, or \textit{measures}. Recall that $\mu$ is an \textbf{$\M$-measure} if
\eq{
  (\M,\in,\mu)\models\godel{\mu\text{ is a $\kappa$-complete ultrafilter on $\kappa$}}.
}

Some common properties of such measures are the following:

\xdefi{
	For a weak $\kappa$-model $\M$, an $\M$-measure $\mu$ is...
\begin{itemize}
	\item \textbf{weakly amenable} if $x\cap\mu\in\M$ for every $x\in\M$ with $\Card^{\M}(x)=\kappa$;
	\item \textbf{countably complete} if $\bigcap\vec X\neq\emptyset$ for every $\omega$-sequence $\vec X\in{^\omega\mu}$.$\hfill\circ$
\end{itemize}
}

Weak amenability can equivalently be phrased in terms of a property concerning only the embedding.

\qprop[\cite{KunenPhD}]{
	Let $\M$ be a weak $\kappa$-model, $\mu$ an $\M$-measure and $j:\M\to\N$ the ultrapower embedding. Then $\mu$ is weakly amenable iff $j$ is \textbf{$\kappa$-powerset preserving}, meaning that $\M\cap\p(\kappa)=\N\cap\p(\kappa)$.
}

We will also be employing the following well-known result regarding set-sized embeddings:

\lemm[Ancient Kunen Lemma][lemm.kunen]{
  Let $\kappa$ be regular, $\M,\N$ weak $\kappa$-models, $\theta\in(\kappa,o(\M))$ a regular $\M$-cardinal, and $\pi\colon\M\to\N$ an elementary embedding with $\crit\pi=\kappa$ and $H_\theta^{\M}\subset\N$. Then for every $X\in H_\theta^{\M}$ with $\card^{\M}(X)=\kappa$ it holds that $\pi\restr X\in\N$.
}
\proof{
  Let $f\colon\kappa\to X$, $f\in\M$, be a bijection and note that $\pi(x)=\pi(f)(f^{-1}(x))$ for all $x\in X$, so it suffices that $f,\pi(f)\in\N$, which is true since $f\in H_\theta^{\M}\subset\N$.
}

\section{G\"odel-Bernays class theory}
\label{prelims.gbc}

As we will often find ourselves working with proper classes, we need to be able to work rigourously with these. We formalise this in second-order \textit{G\"odel-Bernays class theory}, \gbc. In the following we will use the standard convention of using uppercase letters for classes and lowercase letters for sets.

\xdefi{
  The axioms of \textbf{G\"odel-Bernays set theory with Choice}, \gbc, are as follows.
  \begin{enumerate}
    \item \zfc;
    \item (Class extensionality) Two classes are equal iff they have the same elements;
    \item (Class replacement) Every class-sized function restricted to a set is a set;
    \item (Class comprehension scheme) For classes $Y_1,\dots,Y_m$ and every formula $\varphi(v_1,\dots,v_n,V_1,\dots,V_m)$ that only quantifies over sets it holds that
      \eq{
        \{(x_1,\dots,x_n)\mid\varphi[x_1,\dots,x_n,Y_1,\dots,Y_m]\}
      }

      is a class;
    \item (Global choice) There is a class function $G$ such that, for every non-empty set $x$, $G(x)\in x$.$\hfill\circ$
  \end{enumerate}
}

\qtheo[Cohen-Kripke-Solovay; \cite{Cohen-book}]{
  \gbc\ is \textit{conservative} over \zfc, meaning that if $\sigma$ is a first-order sentence and $\gbc\proves\sigma$ then $\zfc\proves\sigma$ as well. Intuitively speaking, \gbc\ does not add new information about sets.
}

\section{Large cardinals}
\label{prelims.large-cardinals}

Since large cardinals came into existence in the beginning of the 20th century, a vast zoo of different types of such have appeared. The aim of this section is to act as a reference for the definitions of these as well as the relations between them.

\qquad Large cardinals are roughly split into two ``sections'': the small ones and the large ones. This distinction is a bit blurry and varies from set theorist to set theorist, but here the distinction will be made at the point where \textit{global elementary embeddings} enter the picture, which starts at the measurable cardinals.

\qquad We will start from the bottom and only cover the large cardinals that we will be dealing with in this thesis. See Figure~\ref{fig.large-cardinals} for an overview of these.

\subsection{Small large cardinals}

The first large cardinal lies at the very bottom of the hierarchy: the inaccessibles.

\defi{
  A cardinal $\kappa$ is \textbf{regular} if $\cof\kappa=\kappa$; i.e. that there is no ordinal $\gamma<\kappa$ with a cofinal function $f\colon\gamma\to\kappa$. $\kappa$ is a \textbf{strong limit} if $2^\lambda<\kappa$ for all cardinals $\lambda<\kappa$. If $\kappa$ is both regular and a strong limit then we say that it is (strongly) \textbf{inaccessible}.
}

Every other large cardinal is either inaccessible or implies that there exists an inner model with an inaccessible cardinal. The following shows that inaccessible cardinals transcend \zfc:

\qprop[Sierpi\' nski-Tarski-Zermelo; \cite{Kanamori} 1.2]{
  If $\kappa$ is an inaccessible cardinal then $(V_\kappa, \in)\models\zfc$.
}

G\"odel's Second Incompleteness Theorem from \cite{godel-incompleteness} then shows that \zfc\ can prove neither the existence of any inaccessible cardinals nor the mere consistency of inaccessible cardinals existing. This is the foundation of the large cardinal hierarchy. We say that a large cardinal is \textbf{stronger} than another large cardinal if the former proves the consistency of the latter, so that the same application of the Incompleteness Theorem shows that the weaker large cardinal theory can never prove the consistency of the stronger one.

\qquad Taking a tiny step further, we arrive at the (inaccessible) $\Sigma_n$-reflecting cardinals.

\defi{
  For $n<\omega$, an inaccessible cardinal $\kappa$ is \textbf{$\Sigma_n$-reflecting} if it holds that $H_\kappa\prec_n V$.
}

Note that it is also common to not require inaccesibility of $\Sigma_n$-reflecting cardinals, in which case they are simply equiconsistent with $\zfc$ by the Reflection Theorem. But as all our $\Sigma_n$-reflecting cardinals will be inaccessible in this thesis we include this in the definition.

\prop[Folklore]{
  For $n\geq 2$, every $\Sigma_n$-reflecting cardinal is a limit of inaccessible cardinals.
}
\proof{
  Let $\kappa$ be $\Sigma_n$-reflecting. Note that the definitions of both regularity and strong limit are $\Pi_1$-formulae, making inaccessibility $\Pi_1$ as well. But now we get that, for every $\xi<\kappa$, $V\models\exists\lambda>\xi\colon\godel{\text{$\lambda$ is inaccessible}}$. This statement is a $\Sigma_2$-sentence, so since we in particular have that $H_\kappa\prec_2 V$ it holds that
  \eq{
    H_\kappa\models\exists\lambda>\xi\colon\godel{\text{$\lambda$ is inaccessible}}.
  }

  We can therefore define a sequence of inaccessible cardinals $\bra{\lambda_\alpha\mid\alpha<\kappa}$ with $\lambda_0$ being the least inaccessible below $\kappa$, $\lambda_{\alpha+1}$ being the least inaccessible cardinal in $(\lambda_\alpha,\kappa)$, and $\lambda_\gamma$ being the least inaccessible cardinal in $[\sup_{\alpha<\gamma}\lambda_\alpha,\kappa)$ for $\gamma<\kappa$ a limit ordinal. These exist by regularity of $\kappa$ and since a cardinal $\lambda<\kappa$ is inaccessible iff $H_\kappa\models\godel{\text{$\lambda$ is inaccessible}}$ by $\Sigma_1$-reflection.
}

\qquad Next, we move a handful of steps up the large hierarchy ladder and introduce the \textit{weakly compact cardinals}. These have a multitude of different equivalent definitions which we will not cover here, but instead define them in terms of a combinatorial colouring relation. We need a definition.

\defi[][defi.homogeneous]{
  For any function $f\colon A\to B$, a subset $H\subset A$ is \textbf{homogeneous for $f$} if $f\restr H$ is a constant function.
}

We may think of $f$ in the above Definition~\ref{defi.homogeneous} as being a \textit{colouring function} that colours elements of $A$ in colours taken from $B$. For $H\subset A$ to be homogeneous would then mean that everything in $H$ has the same colour.

\defi{
  An uncountable cardinal $\kappa$ is \textbf{weakly compact} if to every function $f\colon[\kappa]^2\to\{0, 1\}$ there is a $H\subset[\kappa]^2$ of size $\kappa$ which is homogeneous for $f$.
}

Again, thinking in terms of colourings, $\kappa$ is weakly compact if whenever we colour pairs of ordinals below $\kappa$ in two colours, then we can find a large (i.e. of size $\kappa$) set of such pairs all of the same colour.

\qquad The following result then shows that the weakly compact cardinals are indeed stronger than the inaccessibles:

\qtheo[Erd\H os-Tarski; \cite{Jech} 9.9]{
  Every weakly compact cardinal is a limit of inaccessible cardinals.
}

Moving a tiny step further, we introduce two strengthenings of the weakly compacts: the \textit{ineffables} and the \textit{completely ineffables}.

\defi{
  An uncountable cardinal $\kappa$ is \textbf{ineffable} if there to any function $f\colon[\kappa]^2\to~2$ exists a \textit{stationary} $H\subset[\kappa]^2$ which is homogeneous for $f$.
}

Ineffable cardinals are weakly compact by definition, and the following theorem from \cite{Friedman} shows that they are strictly stronger:

\qtheo[Friedman]{
  Ineffable cardinals are weakly compact limits of weakly compacts.
}

A way of improving ineffability is to ``close under homogeneity'', in the sense that if $H$ is homogeneous for $f\colon[\kappa]^2\to 2$ and $g\colon[H]^2\to 2$ is any function, then there is a subset of $H$ which is homogeneous for $g$. To formalise this notion we use the concept of a \textit{stationary class}.

\xdefi{
  For $X$ any set, a set $\R\subset\p(X)$ is a \textbf{stationary class} if
  \begin{itemize}
    \item $\R\neq\emptyset$;
    \item Every $A\in\R$ is a stationary subset of $X$;
    \item If $A\in\R$ and $B\supset A$ then $B\in\R$.$\hfill\circ$
  \end{itemize}
}

\defi{
  An uncountable cardinal $\kappa$ is \textbf{completely ineffable} if there is a stationary class $\R\subset\p(\kappa)$ such that for every $A\in\R$ and $f\colon[A]^2\to 2$ there exists a $H\in\R$ which is homogeneous for $f$.
}

As suspected, these completely ineffable cardinals are indeed strictly stronger than the ineffables, as the following theorem shows:

\qtheo[\cite{Abramson}]{
  Completely ineffable cardinals are ineffable limits of ineffable cardinals.
}

The next kind of large cardinal involves elementary embeddings. To motivate the definition we note the following characterisation of the weakly compact cardinals:

\qtheo[\cite{Hauser}]{
  An uncountable cardinal $\kappa$ is weakly compact if and only if for every $A\subset\kappa$ there exist weak $\kappa$-models $\M,\N$ with $A\in\M$ and an elementary embedding $\pi\colon\M\to\N$ with $\crit\pi=\kappa$.
}

We would arrive at a natural strengthening of this characterisation if we require more agreement between $\M$ and $\N$, leading to the following definition:

\defi[\cite{Ramsey1}]{
  An uncountable cardinal $\kappa$ is \textbf{1-iterable} if to every subset $A\subset\kappa$ there exists a weak $\kappa$-model $\M$ such that $A\in\M$ and there exists a weakly amenable $\M$-measure $\mu$ on $\kappa$ such that $\ult(\M,\mu)$ is wellfounded.
}

In the same paper, Gitman shows that these large cardinals are indeed consistency-wise stronger than the completely ineffables.

\qtheo[\cite{Ramsey1}]{
  Every $1$-iterable cardinal is a limit of completely ineffable cardinals.
}

Lastly, the \textit{Ramsey cardinals} are natural strengthenings of the weakly compacts.

\defi{
  An uncountable cardinal $\kappa$ is \textbf{Ramsey} if there to every function $f\colon[\kappa]^{<\omega}\to\{0,1\}$ exists a subset $H\subset[\kappa]^{<\omega}$ such that, for every $n<\omega$, $H\cap[\kappa]^n$ is homogeneous for $f\restr[\kappa]^n$.
}

See Figure~\ref{fig.large-cardinals} for an overview of all the large cardinals covered in this section.

\subsection{Large large cardinals}

Moving on to the higher reaches of the large cardinals, these are more uniformly defined and all involve elementary embeddings. Our first type of large large cardinal is the measurable cardinal, being the first cardinal witnessing an elementary embedding from the entire universe. We formalise this in \gbc, defined in Section \ref{prelims.gbc}.

\defi[\gbc]{
  An uncountable cardinal $\kappa$ is \textbf{measurable} if there exists a transitive class $\M$ and an elementary embedding $j\colon (V,\in)\to(\M,\in)$ with critical point $\kappa$.
}

The measurable cardinals were the first cardinals shown to ``transcend'' G\"odel's constructible universe $L$.\footnote{For more information about $L$, see e.g. \cite{SchindlerBook}} This was proven by Dana Scott and has now become known as Scott's Theorem.\footnote{The measurables are not the weakest large cardinals with this property, however. For instance, the Ramsey cardinals enjoy this property too, but none of the other large cardinals described in the previous subsection enjoys this property.}

\qtheo[Scott's Theorem; \cite{Kanamori} 5.5][theo.scott]{
  $L$, G\"odel's constructible universe, has no measurable cardinals.
}

Given this result, it is not surprising that the measurables then exceed the strength of the previous large cardinals.

\prop{
  Measurable cardinals are completely ineffable limits of completely ineffable cardinals.
}
\proof{
  (Sketch) If $j\colon V\to\M$ is a non-trivial elementary embedding then the \textbf{derived ultrafilter} $\mu\subset\p(\kappa)$ on $\kappa:=\crit j$ is defined as $X\in\mu$ iff $\kappa\in j(X)$. Section 5 in \cite{Kanamori} shows that it is indeed an ultrafilter and that its ultrapower $\ult(V, \mu)$ is wellfounded. A reflection argument then shows that we can simply take $\R:=\mu$.
}

Moving even further, we strengthen the definition of measurable cardinals to arrive at the \textit{strong cardinals}.

\defi[\gbc]{
  An uncountable cardinal $\kappa$ is \textbf{strong} if there to every cardinal $\theta>\kappa$ exists a transitive class $\M_\theta$ satisfying that $H_\theta\subset\M_\theta$, and an elementary $j_\theta\colon(V,\in)\to(\M_\theta,\in)$ with critical point $\kappa$. We say that $\kappa$ is \textbf{$\theta$-strong} if the property holds for a specific $\theta$.
}

\qprop[Gaifman, \cite{Kanamori} 26.6]{
  Strong cardinals are measurable limits of measurable cardinals.
}

One property of the strong cardinals that we will get back to in the next subsection and which will be important in Chapter \ref{chapter.virtual-large-cardinals} is the following:

\qprop[\cite{Kanamori} 26.7][prop.strong-prestrong-equivalence]{
  If $j\colon V\to\M_\theta$ witnesses that $\kappa:=~\crit j$ is a $\theta$-strong cardinal then $j(\kappa)>\theta$.
}

We can strengthen the strongs even more by requiring \textit{sequence closure} rather than only containing an initial segment of the universe.

\defi[\gbc]{
  An uncountable cardinal $\kappa$ is \textbf{supercompact} if there to every cardinal $\theta>\kappa$ exists a transitive class $\M_\theta$ satisfying that $^{<\theta}\M_\theta\subset\M_\theta$, and an elementary $j_\theta\colon(V,\in)\to(\M_\theta,\in)$ with critical point $\kappa$.
}

To get an intuition of why the sequence closure is a lot more powerful, note that bits of the elementary embedding itself are now elements of $\M_\theta$, so that $\M_\theta$ can now start reasoning about large cardinals and, $j_\theta$ being elementary, these facts will then be carried back into the universe. Here is an example of such an argument.

\prop{
  If $\kappa$ is supercompact then
  \eq{
    V_\kappa\models\godel{\text{There exists a proper class of strong cardinals}}.\tag*{$(1)$}
  }
}
\proof{
  (Sketch) By noting that the restrictions of the supercompact embedding is an element of the target model by supercompactness, $\kappa$ is strong up to $j(\kappa)$ in the target model, so that a reflection argument shows $(1)$.
}

\cite{Magidor-supercompact} introduced the following equivalent definition of supercompactness\footnote{See Theorem 22.10 in \cite{Kanamori} for a proof.}:

\defi{
  A cardinal $\kappa$ is supercompact iff for every regular $\theta>\kappa$ there is a $\bar\theta<\kappa$ and an elementary embedding $\pi\colon H_{\bar\theta}\to H_{\theta}$ with $\pi(\crit\pi)=\kappa$.
}

Another way of strengthening the strong cardinals is by restricting the behaviour of what the elementary embedding can do on certain sets.

\defi[][defi.A-strong]{
  Let $A$ be any (potentially proper) class. An uncountable cardinal $\kappa$ is \textbf{$A$-strong} if there to every cardinal $\theta>\kappa$ exists a transitive class $\M_\theta$ satisfying that $H_\theta\subset\M_\theta$, and an elementary $j_\theta\colon(V,\in)\to(\M_\theta,\in)$ with critical point $\kappa$, such that $A\cap H_\theta = j(A)\cap H_\theta$.\footnote{When $A$ is a proper class then $j(A)$ is short for the proper class $\bigcup_{\theta\in\on}j(A\cap H_\theta)$.}
}

These $A$-strong cardinals are not used much in practice, but the following \textit{Woodin cardinals} are immensely useful and can be seen as a ``local'' version of a proper class of $A$-strongs for every class $A$:

\defi{
  An uncountable cardinal $\delta$ is a \textbf{Woodin cardinal} if there to every subset $A\subset H_\delta$ exists a cardinal $\kappa<\delta$ such that $(H_\delta, \in, A)\models\godel{\text{$\kappa$ is $A$-strong}}$.
}

Woodin cardinals can equivalently be defined in terms of functions instead of the $A$-strong cardinals.

\theo[Woodin; \cite{Kanamori} 26.14]{
  The following are equivalent for an uncountable cardinal $\kappa$:
  \begin{enumerate}
    \item $\kappa$ is a Woodin cardinal;
    \item For any $f\colon\kappa\to\kappa$ there exists $\alpha<\kappa$ such that $f[\alpha]\subset\alpha$, a transitive $\M$ with $V_{j(f)(\alpha)}\subset\M$ and an elementary embedding $j\colon(V,\in)\to(\M,\in)$ with $\crit j=\kappa$.
  \end{enumerate}
}

Our last large cardinal in this section is ostensibly completely different from the others. It originates from category theory, and according to \cite{pudlak} was originally proposed by Petr Vop\v enka as a ``bogus large cardinal property'' which he believed was inconsistent with \zfc, but a proof of this never appeared.

\defi[\gbc]{
  \textbf{Vop\v enka's Principle (\vp)} postulates that to any first-order language $\mathcal L$ and proper class $\C$ of $\mathcal L$-structures, there exist distinct $\M,\N\in\C$ and an elementary embedding $j\colon\M\to\N$.
}

\defi{
  An uncountable cardinal $\delta$ is \textbf{Vop\v enka} if $(V_\delta,\in;V_{\delta+1})\models\vp$.
}

Perlmutter showed that the Woodin- and Vop\v enka cardinals are closely connected, with Woodin cardinals relating to Vop\v enka cardinals in the same way that strong cardinals relate to supercompacts.

\qtheo[\cite{Perlmutter}]{
  Vop\v enka cardinals are equivalent to cardinals $\delta$ that are ``Woodin for supercompactness'', meaning that to any subset $A\subset H_\delta$ there is a cardinal $\kappa<\delta$ with $(H_\delta,\in,A)\models\godel{\text{$\kappa$ is $A$-supercompact}}$.\footnote{Here $\kappa$ is, in analogy with Definition \ref{defi.A-strong}, \textbf{$A$-supercompact} if there to every cardinal $\theta>\kappa$ exists a transitive class $\M_\theta$, closed under ${<}\theta$-sequences, and an elementary $j_\theta\colon(V,\in)\to(\M_\theta,\in)$ with critical point $\kappa$, such that $A\cap H_\theta=j(A)\cap H_\theta$.}
}

See Figure~\ref{fig.large-cardinals} for an overview of all the large cardinals covered in this section.

\subsection{Inconsistent large cardinals}

In these highest reaches of the large cardinal hierarchy we encounter large cardinals whose existence are inconsistent with \zfc. The reason why these are still interesting to us is because none of them have yet been proven inconsistent with \zf. The first such cardinal is the following:

\defi[\gbc]{
  An uncountable cardinal $\kappa$ is a \textbf{Reinhardt cardinal} if there exists an elementary embedding $j\colon(V,\in)\to (V,\in)$ with $\crit j=\kappa$.
}

This was shown to be inconsistent in \cite{kunen-inconsistency}.

\theo[Kunen inconsistency; \gbc; \cite{Kanamori} 23.12]{
  There is no non-trivial elementary $j\colon(V_{\lambda+2},\in)\to(V_{\lambda+2}, \in)$ for any uncountable cardinal $\lambda$. In particular, there is no Reinhardt cardinal.
}

The proof of Proposition~\ref{prop.strong-prestrong-equivalence}, which stated that $j(\kappa)>\theta$ always holds for strong cardinals $\kappa$, relies heavily on the Kunen inconsistency. When we are going to deal with the \textit{virtual} large cardinals in Chapter \ref{chapter.virtual-large-cardinals} we do not have such a Kunen inconsistency and we will show that in that case the property $j(\kappa)>\theta$ is a highly non-trivial assumption.

\qquad There is also the following strengthening of the Reinhardts, in analogy with the strong cardinals:

\defi{
  An uncountable cardinal $\kappa$ is \textbf{super Reinhardt} if for all ordinals $\lambda$ there exists an elementary embedding $j\colon (V,\in)\to(V,\in)$ with $\crit j=\kappa$ and $j(\kappa)>\lambda$.
}

We can improve this even further by defining a notion corresponding to Woodin cardinals. If we define $\kappa$ to be \textbf{$A$-super Reinhardt} for a class $A$ to be a super Reinhardt cardinal with $\bigcup_{\alpha\in\on}j(A\cap V_\alpha)=A$, in analogy with the $A$-strong cardinals, then we define the \textit{totally Reinhardts} as follows.

\xdefi{
  An inaccessible cardinal $\kappa$ is \textbf{totally Reinhardt} if for each $A\subset V_\kappa$ it holds that
  \eq{
    (V_\kappa, \in; V_{\kappa+1})\models\godel{\text{There exists an $A$-super Reinhardt cardinal}}.\tag*{$\circ$}
  }
}

The last large cardinals that we will introduce are the Berkeley cardinals. These were introduced by Woodin at University of California, Berkeley around 1992. Similar to the Vop\v enka cardinals, these were introduced as a large cardinal candidate that would ``clearly'' be inconsistent with \zf, but such as result has not yet been found. They imply the Kunen inconsistency and are therefore at least inconsistent with \zfc, but that is as far as it currently goes.

\qquad We start with a preliminary definition.

\defi[\gb]{
  An uncountable cardinal $\delta$ is a \textbf{proto-Berkeley cardinal} if to every transitive \textit{set} $\M$ such that $\delta\subset\M$ there exists an elementary embedding $j\colon(\M,\in)\to(\M,\in)$ with $\crit j<\delta$.
}

To see that these indeed imply the Kunen inconsistency, note that we in particular get an elementary embedding $\pi\colon V_{\gamma + 2}\to V_{\gamma + 2}$, which is inconsistent by Corollary 23.14 in \cite{Kanamori}.

\qquad Note that if $\kappa$ is a proto-Berkeley cardinal then every $\lambda>\kappa$ is also proto-Berkeley, which makes it quite an uninteresting notion. But we can isolate the interesting cases, leading to the definition of a Berkeley cardinal.

\qtheo[\cite{Cutolo} 2.1.14]{
  If $\delta_0$ is the least proto-Berkeley cardinal then we can choose the critical point of the embedding to be arbitrarily large below $\delta_0$.
}

As this property is clearly not preserved upwards, this makes for a good candidate for the large cardinal notion.

\defi[\gb]{
  A proto-Berkeley cardinal $\delta$ is \textbf{Berkeley} if we can choose the critical point of the embedding to be arbitrarily large below $\delta$. If we furthermore can choose the critical point as an element of any club $C\subset\delta$ then we say that $\delta$ is \textbf{club Berkeley}.
}

In \cite{Cutolo}, the author furthermore mention that, among the above-mentioned cardinals, the non-trivial relative consistency implications currently known are the following:

\qtheo[\cite{Cutolo} 2.2.1]{
  Berkeley cardinals are consistency-wise strictly stronger than Reinhardt cardinals.
}

\qtheo[\cite{Cutolo} 2.2.2]{
  Club Berkeley cardinals are consistency-wise strictly stronger than super Reinhardt cardinals.
}

See Figure~\ref{fig.large-cardinals} for an overview of all the large cardinals covered in this section.

\figx[fig.large-cardinals][210]{large-cardinal-hierarchy.pdf}{A subset of the large cardinal hierarchy, with lines indicating relative consistency implications.}

\section{Core model theory}
\label{prelims.core-model-theory}

As we will be utilising the core model at various points throughout this thesis, we give here an idea of what we mean by the \textit{core model}. A convenient feature of core model theory is that most of the technical details regarding the construction is not needed for applications; it suffices to know only its abstract properties. That being said, we \textit{will} provide a glimpse of the construction at the end of this section. To see the full construction we refer the interested reader to \cite{MSc}, \cite{Zeman} and \cite{JensenSteel}.

\subsection{The core model $K$}

The \textbf{core model}\footnote{$K$ is short for \textit{Kern}, meaning \textit{core} in German.} $K$ of a universe is roughly speaking the subuniverse that strikes a balance between retaining the complexity of the universe while being as simple as possible. The problem is then making all of this precise. Some aspects of the definition is agreed upon by most researchers:
\begin{enumerate}
  \item We choose to define the \textit{complexity} of a universe by its large cardinal structure. This is based on the empirical fact that large cardinals seem to capture the strength of every ``naturally defined'' hypothesis, and gives us a convenient yard stick. For instance, a universe containing a measurable cardinal is more complex than $L$, as Scott's Theorem \ref{theo.scott} shows that $L$ cannot contain any measurable cardinals (or any large cardinals stronger than measurables);
  \item We further postulate that $L$ is the simplest universe there is, and the simplicity of a universe should therefore be measured in terms of how much it resembles $L$. We will be more precise about what it means to ``resemble $L$'' below, but with this intuitive notion is should at least be clear that, say, $L$ is simpler than $L[\mu]$.\\
\end{enumerate}

Even though $(i)$ captures what we mean by complexity, it leaves much to be desired. For instance, as the structure of the large cardinal hierarchy can only be verified empirically, we might end up in an unfortunate situation where we simply do not know whether a given universe is more complex than another one\footnote{It might also be the case that the large cardinal hierarchy is not linear at all.}. The famous example of this is the current situation with the superstrong and strongly compact cardinals, that we simply do not know which one is stronger\footnote{Although the general consensus is that the strongly compact cardinals should be equiconsistent with the supercompacts, making them stronger than the superstrongs.}. Thus, given a universe whose strength corresponds to that of a strongly compact and another one at the level of superstrongs, we would not be able to say which one is more complex.

\qquad To remedy this situation, we choose instead to define the complexity of a universe in terms of an intermediate property. A universe satisfying this property should then entail that it inherits the large cardinal structure of its surrounding universe. All the intermediate properties currently being used are all instances of a general phenomenon called \textit{covering}. The intuitive idea is that every set in the universe can be ``approximated'' by a set in the subuniverse, and arose from a seminal theorem of Jensen, see \cite[11.56]{SchindlerBook}, stating that $0^\sharp$ exists if and only if \textit{strong covering} fails for $L$, defined as follows.

\defi[Jensen]{
  We say that \textbf{strong covering} holds for universes $\U\subset\V$ if to every $\alpha<o(\V)$ and $X\in\p^{\V}(\alpha)$ with $\Card^{\V}(X)\geq\aleph_1^{\V}$ there exists $A\in\U$ such that $X\subset A$ and $\Card^{\V}(X) = \Card^{\V}(A)$.
}

We can then interpret Jensen's result as saying that, if the complexity of the surrounding universe $\V$ is below the strength of $0^\sharp$ then $L$ is a good candidate for $K$. In a complex universe we would therefore be looking for the core model among subuniverses more complex than $L$, and it turns out that also requiring strong covering to hold in such models is too much to ask; the current definition of covering has thus been weakened to the following:

\defi[][defi.weak-covering]{
  We say that \textbf{(weak) covering} holds for universes $\U\subset\V$ if $\cof^{\V}(\alpha^{+\U}) = \Card^{\V}(\alpha^{+\U})$ holds for any ordinal $\alpha$ with $\alpha^{+\U}\geq\aleph_2^{\V}$.
}

This statement might seem very distant from the strong version, but one can think of weak covering as saying that $\U$ ``knows'' the true cofinality of its successor cardinals $\kappa\geq\aleph_2^{\V}$ within the error margin $\varepsilon:=\kappa^{+\U}-\Card^{\V}(\kappa^{+\U})$. More concretely, we could equivalently define weak covering as $\U$ containing all cofinal maps $f\colon\gamma\to\kappa$ in $\V$ for every $\gamma\in\Card^{\V}(\kappa)$, making it closer in spirit to the strong covering property.

\begin{center}
  \begin{figure}
    \begin{tikzpicture}

      % Borders
      \draw[black, thick]
        (0, 0)
        -- (-6, 7)
        -- (6, 7) node[anchor=north west] {$\V$}
        -- (0, 0);
      \draw[orange, thick]
        (0, 0)
        -- (-3, 7)
        -- (3, 7) node[anchor=north west] {$\U$}
        -- (0, 0);

      % Center line
      \draw[gray]
        (0, 0)
        -- (0, 7);

      % Aleph 2 line
      \draw[gray, dashed]
        (-1.7, 2)
        -- (2.2, 2) node[anchor=west] {$\aleph_2^{\V}$};

      % epsilon interval
      \draw[blue!80!black, thick]
        (0, 4) node[anchor=west] {$\abs{\alpha^{+\U}}^{\V}$}
        -- (-0.2, 4)
        -- (-0.2, 5.25) node[anchor=east] {$\varepsilon$}
        -- (-0.2, 6.5)
        -- (0, 6.5) node[anchor=west] {$\alpha^{+\U}$};

      % alpha
      \fill[blue!80!black]
        (0, 5) circle (0.05cm) node[anchor=west] {$\alpha$};

      % gamma
      \fill[blue!80!black]
        (0, 3) circle (0.05cm) node[anchor=west] {$\gamma$};

       % g function
      \fill[red!90!black]
        (-2, 6.3) node[anchor=west] {$g$} circle (0.05cm);
      \draw[red!90!black]
        (-1.2, 5) node {$g$};
      \draw[red!90!black, dashed, ->>]
        (0, 3) .. controls (-1.2, 4.25) and (-1.2, 5.25) .. (-0.3, 6.4);

       % f function
      \fill[green!80!black]
        (3.1, 4.7) node[anchor=west] {$f$} circle (0.05cm);
      \draw[green!80!black]
        (1.2, 5.3) node {$f$};
      \draw[green!80!black, dashed, ->>]
        (0.5, 4.3) .. controls (1.1, 4.8) and (1.1, 5.8) .. (0.6, 6.3);

    \end{tikzpicture}
    \caption{Weak covering property}
  \end{figure}
\end{center}

\qquad When it comes to $(ii)$ we have to define what we mean by ``resembling $L$''. Ultimately this boils down to the current working definition of a \textit{mouse} and is still a work in progress. If our universe is no more complex than the strength of a Woodin cardinal however, then we know what the correct definition of a mouse is, and hence also what ``resembling $L$'' would mean in this context. The definition of mice along with the assumption of covering then turns out to imply that the core model will indeed inherit the large cardinal strength of the universe\footnote{To show this one first uses covering to show that $K$ is \textit{universal}, i.e. that it wins every coiteration. With universality at hand, a comparison argument with any $L[\vec E]$-model containing a large cardinal will then show that $K$ will have an inner model with the large cardinal in question.}.

\qquad To construct the core model one could then take a bottom-up approach, starting with $L$ and then carefully include the complexity of the universe while remaining similar to $L$\footnote{This strategy has a long history and current leading figures following it are Steel and Sargsyan.}. Alternatively, a top-down approach would be to define a structure which has \textit{all} the complexity of the universe, and then showing that this structure indeed exhibits these $L$-like properties\footnote{Woodin is pursuing this path.}.

\subsection{Constructing $K$}

The standard construction of $K$ takes the bottom-up approach. The first step towards this is the construction of $K^c$,\footnote{The ``c'' stands for \textit{certified}, as the extenders we put on the sequence was historically called \textit{certified extenders}.} which we build by recursion on the ordinals. We start with $K^c_0 := \emptyset$ and at every successor ordinal $\alpha$ we do one of two things:

\begin{enumerate}
  \item If there exists a ``nice'' extender indexed at $\alpha$ then we put it onto the extender sequence of $\core(K^c_\alpha$), where $\core(X)$ is the transitive collapse of a certain hull of $X$;\footnote{Think of $\core(X)$ as ``removing the noise of $X$''.}
  \item Otherwise we let $K^c_\alpha := \J(\core(K^c_{\alpha-1}))$, with $\J(x):=\text{rud}(\trcl(x\cup\{x\}))$ being the usual operator we use to build $L$ with Jensen's hierarchy.\\
\end{enumerate}

In other words, we are essentially building $L$ with extenders attached onto it in a canonical fashion. Taking cores at every step will ensure that the initial segments will be \textit{sound}, which ultimately is what guarantees iterability of $K^c$. The fact that we put on all the relevant extenders from $V$ is what will ensure the covering property of the model. It turns out that $K^c$ is not exactly what we want however, as it relies \textit{too much} on the surrounding universe, in contrast with $L$ whose construction procedure builds the exact same model in every universe. To attain this \textit{canonicity} we are again taking certain ``thick'' hulls of $K^c$ (again, think of it as removing the noise). The resulting construction \textit{almost} gives us what we want and is dubbed \textit{pseudo-K}. The problem with this is that the technicalities of the construction uses certain properties of a fixed cardinal $\Omega$, so to build the true core model we ``glue'' these pseudo-K's together.

\qquad The takeaway here is that whenever we are working with an initial segment of $K$ then that segment will be built using the recursive steps $(i)$ and $(ii)$ above, carefully including extenders from $V$. For more details, see \cite{JensenSteel} or \cite{MSc}.

\subsection{Properties of $K$}

In terms of applications of core model theory, the properties of $K$ are usually what matters. We touched on the weak covering property above, but for completeness we state most of the properties usually employed when working with $K$. In \cite{JensenSteel} they isolate a set of properties of $K$ which leads them to \textit{define} $K$ as the structure satisfying the conjunction of these properties. These are as follows.\footnote{See \cite{steel2010outline} for definitions of premice, iteration trees and iteration strategies.}

\begin{enumerate}
  \item $K$ is a transitive proper class premouse satisfying \zfc;
  \item $K$ is $\Sigma_2$-definable;
  \item $K$ has a $\Sigma_2$-definable iteration strategy $\Sigma$;
  \item $K$ is \textbf{generically absolute}, meaning that $K^V=K^{V[g]}$ and $\Sigma^{V[g]}\restr V=\Sigma^V$ for any $V$-generic filter $g\subset\mathbb P$ for a set-sized forcing notion $\mathbb P$;
  \item $K$ is \textbf{inductively defined}, meaning that $K\l\omega_1^V$ is $\Sigma_1$-definable over $J_{\omega_1}(\mathbb R)$;
  \item $K$ satisfies \textbf{weak covering} as in Definition \ref{defi.weak-covering}.\\
\end{enumerate}

On top of these properties, we will also employ the following property, which is proven in Lemmata 7.3.7--7.3.9 and 8.3.4 in \cite{Zeman}:

\qtheo[Zeman][theo.beaver]{
  Assume $0^\pistol$ does not exist. If $\mu$ is a countably complete weakly amenable $K$-measure then $\mu\in K$.
}

\subsection{Coiterations of mice}

One of the crucial lemmata in the theory of mice, of which $K$ is a special case, is the comparison lemma. Intuitively, it says that any two mice $\M,\N$ can be \textit{compared}, in the sense that we can transform $\M$ and $\N$ into new mice $\hat\M$ and $\hat\N$, respectively, such that either $\hat\M$ is an initial segment of $\hat\N$ or vice versa. Such a transformation is called a \textbf{coiteration}, which can be thought of as being successive applications of measures in the mice, forming iterative ultrapowers. For more details regarding mice and coiterations, see \cite{steel2010outline} or \cite{MSc}.

\lemm[Comparison lemma]{
  Let $\theta$ be an uncountable regular cardinal or $\theta=\on$. Let $\M$ and $\N$ be \textit{sound} mice of size $\leq\theta$. Then there are iterations $\T$ and $\U$ of $\M$ and $\N$ having last models $\hat\M$ and $\hat\N$, respectively, such that either
  \begin{enumerate}
    \item $\hat\M\init\hat\N$ and there is an elementary embedding $\pi\colon\M\to\hat\M$; or
    \item $\hat\N\init\hat\M$ and there is an elementary embedding $\pi\colon\N\to\hat\N$.$\hfill\qed$
  \end{enumerate}
}

\section{Forcing lemmata}
\label{prelims.forcing}

In this section we will cover a few results that we will need when working with elementary embeddings in different forcing extensions. These are the \textit{lifting criterion}, which characterises when we can lift an elementary embedding to a forcing extension, \textit{countable embedding absoluteness}, which allows us to ``transfer'' elementary embeddings from one forcing extension to another, and lastly a result that gives a sufficient condition for preserving sequence closure when moving to generic extensions.

\subsection{Lifting criterion}
When we are working with an elementary embedding $\pi\colon\M\to\N$ between sets in the universe, we would sometimes like to lift such an embedding to a generic extension, meaning that given a forcing notion $\mathbb P\in\M$ and an $\M$-generic $g\subset\mathbb P$, we are interested in when we can lift $\pi$ to an embedding
\eq{
  \pi^+\colon\M[g]\to\N[h],
}

where $h\subset\pi(\mathbb P)$ is $\N$-generic. The \textbf{lifting criterion} shows exactly when this is possible.

\prop[The Lifting Criterion; \cite{handbook-cummings} 9.1][prop.lifting-criterion]{
  Let $\pi\colon\M\to\N$ be an elementary embedding between weak $\kappa$-models. Fix a forcing notion $\mathbb P\in\M$, an $\M$-generic $g\subset\mathbb P$ and an $\N$-generic $h\subset\pi(\mathbb P)$. Then the following are equivalent:
  \begin{enumerate}
    \item $\pi[g]\subset h$;
    \item There exists an elementary $\pi^+\colon\M[g]\to\N[h]$ such that $\pi^+(g)=h$ and $\pi^+\restr\M = \pi$.
  \end{enumerate}
}
\proof{
  $(ii)\Rightarrow(i)$ is clear, so assume $(i)$. Define $\pi^+\colon\M[g]\to\N[h]$ as $\pi^+(\dot\tau^g) := \pi(\tau)^h$. To see that $\pi^+$ is well-defined fix $\dot\sigma,\dot\tau\in\M^{\mathbb P}$ such that $\dot\sigma^g=\dot\tau^g$, and fix $p\in g$ such that $p\forces\dot\sigma=\dot\tau$. By elementarity $\pi(p)\forces\pi(\dot\sigma)=\pi(\dot\tau)$, so since $\pi(p)\in h$ by $(i)$ we get that $\pi(\dot\sigma)^h=\pi(\dot\tau)^h$.

  \qquad To show elementarity, note that for $x\in\M$ it holds that $\pi(\check x) = \check{\pi(x)}$, implying $\pi^+(x)=\pi^+(\check x^g) = \pi(\check x)^h = \pi(x)$. Further, letting $\dot g\in\M^{\mathbb P}$ be the standard $\mathbb P$-name for $g$, then $\pi(\dot g)$ is the standard $\pi(\mathbb P)$-name for $h$ and therefore $\pi^+(g)=h$.
}

\subsection{Countable embedding absoluteness}
A key folklore lemma which we will frequently need when dealing with elementary embeddings existing in generic extensions is the following:

\lemm[Countable Embedding Absoluteness][lemm.ctblabs]{
  Let $\M,\N$ be sets, $\P$ a transitive class with $\M,\N\in\P$, and let $\pi\colon\M\to\N$ be an elementary embedding. Assume that $\P\models\zf^-+\dc+\godel{\text{$\M$ is countable}}$ and fix any finite $X\subset\M$.

  \qquad Then $\P$ contains an elementary embedding $\pi^*\colon\M\to\N$ which agrees with $\pi$ on $X$. If $\pi$ has a critical point and if $\M$ is transitive then we can also assume that $\crit\pi=\crit\pi^*$.\footnote{We are using transitivity of $\M$ to ensure that the \textit{ordinal} $\crit\pi$ exists.}
}
\proof{
  Let $\{a_i\mid i<\omega\}\in\P$ be an enumeration of $\M$ and set
  \eq{
    \M\restr n:=\{a_i\mid i<n\}.
  }

  Then, in $\P$, build the tree $\T$ of all partial isomorphisms between $\M\restr n$ and $\N$ for $n<\omega$, agreeing with $\pi$ on $X$, ordered by extension. Then $\T$ is illfounded in $V$ by assumption, so it is also illfounded in $\P$ since $\P$ is transitive and $\P\models\zf^-+\dc$. The branch then gives us the embedding $\pi^*$, and if $\crit\pi$ exists then we can ensure that it agrees with $\pi$ on the critical point and finitely many values by adding these conditions to $\T$.
}

The following proposition is an almost immediate corollary of Countable Embedding Absoluteness:

\qprop[][prop.coll]{
    Let $\M$ and $\N$ be transitive models and assume that there is a generic elementary embedding $\pi:\M\to \N$. Then $V^{\col(\omega,\M)}$ has an elementary embedding $\pi^*:\M\to\N$ which agrees with $\pi$ on any desired finite set and has the same critical point if it exists.
}

\subsection{Preservation of sequence closure}
The following lemma is from \cite{lucke-schlicht-notes} and gives a useful condition on when sequence closure is preserved when moving to generic extensions:

\lemm[][lemm.lucke-schlicht]{
  Let $\lambda$ be an infinite cardinal, $\M\models\zf^-$ a transitive model, $\mathbb P\in\M$ a $\lambda^+$-cc forcing notion and $g\subset\mathbb P$ an $\M$-generic filter. Then $V\models{^\lambda}\M\subset\M$ implies that $V[g]\models{^\lambda}\M\subset\M$.
}
\proof{
  Work in $V[g]$. Let $c:=\bra{c_\alpha\mid\alpha<\lambda}$ be a $\lambda$-sequence such that $c_\alpha\in\M[g]$ for every $\alpha<\lambda$. Fix for every $\alpha<\lambda$ a $\mathbb P$-name $\dot c_\alpha$ such that $\dot c_\alpha^g=c_\alpha$. Also let $\dot a$ be a $\mathbb P$-name with $\dot a^g=\bra{\dot c_\alpha\mid\alpha<\lambda}$ and choose $p\in g$ such that $V\models\godel{p\forces\forall\alpha<\check\lambda\colon\dot a(\alpha)\in\M^{\mathbb P}}$.

  \qquad Now, working in $V$, there is for each $\alpha<\lambda$ a maximal antichain $A_\alpha$ below $p$ such that every $q\in A_\alpha$ decides $\dot a(\alpha)$; i.e., $q\forces\godel{\dot a(\alpha)=\check x}$ for some $x\in\M$. Define now
  \eq{
    \sigma := \{((\alpha,x),q)\mid\alpha\in\lambda\land q\in A_\alpha\land q\forces\godel{\dot a(\alpha)=\check x}\}.
  }

  Then $p\forces\godel{\sigma=\dot a}$. Note that $\abs{\sigma}\leq\lambda$, since $\abs{A_\alpha}\leq\lambda$ for each $\alpha<\lambda$. Thus $\sigma\in\M$. Now it holds that
  \eq{
    V[g]\models\godel{\bra{\dot c_\alpha\mid\alpha<\lambda}=\dot a^g=\sigma^g\in\M[g]},
  }

  and we can compute $c=\bra{c_\alpha\mid\alpha<\lambda}=\bra{\dot c_\alpha^g\mid\alpha<\lambda}$ from $\bra{\dot c_\alpha\mid\alpha<\lambda}$ and $g$, so $c\in\M[g]$ by Replacement.
}

%\section{Ideals}
%\label{prelims.ideals}
%
%\defi{
%  Let $I$ be an ideal on a nonempty set $Z$. Let
%  \begin{enumerate}
%    \item $I^{+} := \mathcal{P}(Z) \setminus I$,
%    \item for $a,b \in I^{+}$ let $a \sim_{I} b$ iff $a \Delta b \in I$,
%    \item $\mathcal{P}(Z)/I:=\P(Z)/{\sim_I}$ is the Boolean algebra with subset inclusion modulo $\sim_I$.
%  \end{enumerate}
%
%  We call $\P(Z)/I$ the
%  \textbf{associated forcing} to $I$.
%}
%
%\defi{
%  If $I$ is an ideal on a cardinal $\kappa$ and $g\subset\P(\kappa)/I$ $V$-generic then $g$ is a $V$-ultrafilter on $\kappa$ in $V[g]$, so that we may take the  \textbf{generic ultrapower} $\ult(V,g)$.
%}
%
%\prop{
%  Let $I$ be an ideal on a cardinal $\kappa$. Then..
%  \begin{enumerate}
%    \item if $I$ is $\kappa$-complete then so is any generic ultrafilter;
%    \item if $I$ is normal then so is any generic ultrafilter.$\hfill\circ$
%    \end{enumerate}
%    \todo{define $\kappa$-complete and normal for an ideal. Add reference.}
%}
%
%\xdefi{
%  Let $\lambda$ be any cardinal. Then an ideal $I$ on a cardinal
%  $\kappa$ is...
%  \begin{itemize}
%  \item \textbf{precipitous} if the generic ultrapower is wellfounded;
%  \item \textbf{$\lambda$-saturated} if the associated forcing has the $\lambda$-chain condition;
%  \item \textbf{$\lambda$-dense} if the associated forcing has a dense subset of size $\lambda$.$\hfill\circ$
%  \end{itemize}
%}
%
%Note that $\lambda$-dense trivially implies $\lambda^+$-saturated. We will need the following facts about $\omega_2$-saturated ideals on $\omega_1$:
%
%\prop[][prop.ideal]{
%  Let $I$ be an $\omega_2$-saturated ideal on $\omega_1$. Then $I$ is precipitous, and letting $j \colon V\to M$ be the generic ultrapower map, it holds that\todo{Parts (ii)-(v) is Example 4.29 in Foreman's handbook chapter. Perhaps include the proof.}
%  \begin{enumerate}
%    \item $M$ is closed under $\omega$-sequences in $V[g]$;
%    \item $j(\omega_1^V)=\omega_2^V=\omega_1^{V[g]}$;
%    \item $j(\omega_2^V)\in(\omega_2^V,\omega_3^V)$;
%    \item $j$ is continuous at $\omega_2^V$;
%    \item $j(\omega_n^V)=\omega_n^V=\omega_{n-1}^{V[g]}$ for all
%      $n\in[3,\omega]$.$\hfill\circ$
%  \end{enumerate}
%}
%
%As for the density, we in particular need the following fact:
%
%\qprop{
%  Let $I$ be an $\omega_1$-dense ideal on $\omega_1$. Then the associated forcing is forcing equivalent to $\col(\omega,\omega_1)$, so in particular it is homogeneous.
%}
%
%\proof{
%  \cite[Proposition~10.20]{Kanamori}.
%}
%
%\section{Descriptive Set Theory}
%\label{prelims.descriptive-set-theory}
%
%\begin{convention}
%  We will be using the ``logician's reals'',
%  meaning that $\mathbb{R} := {^{\omega}\omega}$ with the product
%  topology, having the sets $\{x\in\mathbb R\mid x\supset s\}$ for
%  $s\in{^{<\omega}\omega}$ as a clopen basis.
%\end{convention}
%
%\defi{
%  Let $A, B \subset \mathbb{R}$. We say that \textbf{$A$ is Wadge
%    reducible to $B$} (in symbols
%  $A \le_{W} B$) iff there is some continuous
%  function $f \colon \mathbb{R} \to \mathbb{R}$ such that
%  \[
%    A = f^{-1}[B] := \{ a \in A \mid f(a) \in B \}.
%  \]
%  We write $A <_{W} B$ iff $A \le_{W} B$ and $B \not \le_{W} A$.
%}
%
%\rema{
%  $\mathbb{R}$ and $\mathbb{R}^{n}$, for $1 \leq n \le \omega$
%  are homeomorphic and we shall often identify them with one another.
%
%}
%
%\defi{
%  Subseteq of $\mathcal{R}$ are called \textbf{pointsets}
%  . Subsets of $\mathcal{P}(\mathbb{R})$ are called
%  \textbf{pointclasses} .
%
%}
%
%\defi{
%  Let $\Gamma$ be a pointclass. We define
%  \begin{enumerate}
%  \item $\exists^{\mathbb{R}} \Gamma := \{ A \mid \exists B \in \Gamma \colon A = \{ x \in \mathbb{R} \mid \exists y \in \mathbb{R} (x,y) \in B \} \}$,
%  \item
%    $\forall^{\mathbb{R}} \Gamma := \{ A \mid \exists B \in \Gamma
%    \colon A = \{ x \in \mathbb{R} \mid \forall y \in \mathbb{R} (x,y)
%    \in B \} \}$. \Gamma$}
%  \end{enumerate}
%}
%
%\defi{
%  Let $\Gamma$ be a pointclass. We define
%  \begin{enumerate}
%  \item
%    $\overset{\smallsmile}{\Gamma} := \{ \mathbb{R} \setminus A \mid A \in
%    \Gamma \}$ ,
%  \item $\Delta_{\Gamma} := \Gamma \cap \overset{\smallsmile}{\Gamma}$  and
%  \item $\underset{\sim}{\Gamma} := \exists^{\mathbb{R}} \Gamma$ .
%  \end{enumerate}
%}
%
%\begin{lemma}[\cite{Wadge}]
%  Assume $\zf + \ad$ and let $A, B \subset \mathbb{R}$. Then
%  \[
%    A \le_{W} B \text{ or } B \le_{W} \mathbb{R} \setminus A.
%  \]
%\end{lemma}
%
%\begin{lemma}[Martin-Monk-Wadge]
%  Assume $\zf + \ad + \dc_{\mathbb{R}}$. Then
%  $\leq_{W}$ is wellfounded.\footnote{See \cite{Larson} for a proof.}
%\end{lemma}
%
%\begin{remark}
%  When considering $(\mathcal{P}(\mathbb{R}); \le_{W})$ in a
%  $\zf + \ad+\dc_{\mathbb R}$ context, we will often tacitly identify
%  $A \subset \mathbb{R}$ with its complement, making $<_W$ a wellorder.
%\end{remark}
%
%\defi[$\zf + \ad + \dc_{\mathbb{R}}$]{
%  Let $A \subset \mathbb{R}$. Then the \textbf{Wadge rank of $A$}
%  is defined recursively as
%  $\abs A_{W} := \sup\{\abs B_W+1\mid B <_W A\}$.  }
%
%\begin{definition}
%  Let $X$ be a set. We write $\od_{X}$ for the
%  collection of all $A$ for which there is some formula $\phi$,
%  ordinals $\alpha_{0}, \ldots, \alpha_{k}$ and $x_{0}, \ldots, x_{l}\in X$
%  with
%  \[
%    A = \{ a \mid \phi[a, \alpha_{0}, \ldots, \alpha_{k}, x_{0},
%    \ldots, x_{l}] \}.\tag*{$\circ$}
%  \]
%  We write $\hod_{X}$ for the collection of all $A$ such that
%  $\tc(\{A\}) \subset \od_{X}$. \\
%  If $X = \emptyset$, we will often drop the subscript and simply
%  write $\od$ and $\hod$ for $\od_{\emptyset}$ and $\hod_{\emptyset}$
%  respectively.
%\end{definition}
%
%\defi[$\zf + \ad + \dc_{\mathbb{R}}$]{ For $B \subset \mathbb{R}$
%  let \eq{
%    \theta_{B} :& = \sup \{ \abs A_{W} \mid \exists x \in
%    \mathbb{R} \colon A \in \od_{\mathbb{R} \cup \{B \}} \} \\
%    & = \sup \{ \alpha \in \on \mid \text{ there is a } \od_{\mathbb{R} \cup
%      \{B\}} \text{-surjection } f \colon \mathbb{R} \to \alpha \}.
%  }
%\todo{Verify that these two values are in fact identical.}
%}
%
%\defi[$\zf + \ad + \dc_{\mathbb{R}}$]{  Define
%  the \textbf{Solovay sequence}
%  $\bra{\theta_{\alpha} \mid \alpha \le \Omega}$
%   \mid \alpha \le \Omega)$}
%   as follows:
%  \begin{enumerate}
%  \item
%    $\theta_{0} := \theta_{\emptyset}$,
%  \item if there is some $B$ such that $|B|_{W} = \theta_{\alpha}$ let $\theta_{\alpha + 1} := \theta_{B}$.\footnote{Since
%        continuous functions are coded by reals, this is independent
%        of the choice of $B$.}
%  \item if $\alpha$ is a limit ordinal, we let
%    $\theta_{\alpha} := \sup_{\beta < \alpha} \theta_{\beta}$.
%  \end{enumerate}
%  Finally, $\Omega$ is the least ordinal such that
%  $\theta_{\alpha+1} = \theta_{\alpha}$, and
%  $\Theta := \theta_{\Omega}$.
%}

\end{document}