\documentclass[]{beamer}

\mode<presentation>{\usetheme{default}\setbeamercovered{invisible}\usecolortheme{crane}}

\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}

\usepackage{xcolor}
\usepackage{relsize}
\usepackage{listings}
\usepackage{verbatim}
\usetheme{Hannover}

\usepackage{varwidth}
\usepackage{xcolor}
\usepackage{lipsum}

\newcommand\MyCBox[1]{%
  \colorbox{red!60}{\begin{varwidth}{\dimexpr\linewidth-2\fboxsep}#1\end{varwidth}}}

\definecolor{LHCblue}{rgb}{0.29, 0.33, 0.13}
\usecolortheme[named=LHCblue]{structure}
\usepackage{textpos}
\usepackage{tikz}
\title{\textbf{\textcolor{blue}{Lab meeting 2015}}\\May 05}
\author{ }

\date{May 05, 2015}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\section{Introduction}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{}

\begin{itemize}
\item What is \LaTeX?
\item Why is it cool?
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{What is \LaTeX?}

Google it:

\centering
\includegraphics[width = 7cm, height = 5cm]{WhatIsLatex.png}

\framebox{\bf{Myself: \LaTeX $\sim$ \bf{\textcolor{red}{Word}} $+$ \bf{\textcolor{red}{Power Point}}}}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Why is it cool?}

\centering
\bf{\textcolor{blue}{Please see what you can do with \LaTeX?}}

\vspace{1cm}
\centering
\includegraphics[with = 3cm, height = 3cm]{question-mark-face.jpg}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\LaTeX}

\subsection{Equation}

\begin{frame}[fragile] \frametitle{No mouse to write any complex equations}

\includegraphics[width = 1.2cm, height = 1.2cm]{SmileFace.png}

\vspace{0.8cm}
Example \footnote{Source: http://en.wikibooks.org/wiki/LaTeX/Mathematics}:

\centering
\includegraphics[width = 4.5cm, height = 4.5cm]{mathSource.png} & \\
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]

\textcolor{blue}{\bf{How can I write this sentence in \LaTeX?}}

\vspace{0.8cm}

\tiny

$scoreP_j^{R} = \sum\limit_{i = 1}^{M_{g}}\sum\limits_{k=1}^{N_{breaks}} w_k^{R}*f(x_k) $ is so easy to write in \LaTeX. Please don't use Word to write such an equation.

\large

\vspace{1cm}
\textcolor{blue}{\bf{Just type:}}
\vspace{0.8cm}
\tiny

\begin{verbatim}

scoreP_j^{R} = \sum\limit_{i = 1}^{M_{g}}\sum\limits_{k=1}^{N_{breaks}} w_k^{R}*f(x_k) is easy

to write in LaTeX. Please don't use Word to write such an equation.

\end{verbatim}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Picture/Table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]\frametitle{Adjust picture sizes}

Example: insert a picture named \underline{RStudioPicture.png}

\vspace{1cm}
\textcolor{blue}{\bf{SMALL? \\Just type}}

\tiny
\begin{verbatim}

\includegraphics[width = 1cm, height = 1cm]{RStudioPicture.png}

\end{verbatim}

\includegraphics[width = 2cm, height = 1cm]{RStudioPicture.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]\frametitle{Adjust picture sizes}

Example: insert a picture named \underline{RStudioPicture.png}

\vspace{1cm}
\textcolor{blue}{\bf{LARGE? \\Just type}}

\tiny
\begin{verbatim}

\includegraphics[width = 3cm, height = 2.5cm]{RStudioPicture.png}

\end{verbatim}

\includegraphics[width = 3cm, height = 2.5cm]{RStudioPicture.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]\frametitle{Adjust your table}

\vspace{-1cm}
\tiny
\bf{\textcolor{blue}{SMALL columns}

\begin{verbatim}
\begin{tabular}{|p{1cm}|p{1cm}|}
\hline
a & b\\
\hline
b & c\\
\hline
\end{tabular}
\end{verbatim}

\begin{tabular}{|p{1cm}|p{1cm}|}
\hline
a & b\\
\hline
b & c\\
\hline
\end{tabular}

\vspace{0.7cm}
\bf{\textcolor{blue}{LARGE and more columns, rows}

\tiny
\begin{verbatim}
\begin{tabular}{|p{2cm}|p{4cm}||p{2cm}|}
\hline
a & b & b1 \\
\hline
b & c & c1\\
\hline
d & d1 & \includegraphics[width = 0.3cm, height = 0.3cm]{SmileFace.png}  \\
\hline
\end{tabular}
\end{verbatim}

\begin{tabular}{|p{2cm}|p{4cm}||p{2cm}|}
\hline
a & b & b1 \\
\hline
b & c & c1\\
\hline
d & d1 & \includegraphics[width = 0.3cm, height = 0.3cm]{SmileFace.png} \\
\hline
\end{tabular}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Citation}
\begin{frame}[fragile]{Citation}

\tiny
\bf{\textcolor{blue}{Want to cite this paper?}
\includegraphics[width = 8cm, height = 2.1cm]{naturePaper.png}

\vspace{1cm}
\bf{\textcolor{blue}{Just type}}

\begin{verbatim}

\citet{chang2015core} published a cool paper.

In 2015, \citeauthor{chang2015core} published a cool paper.

\end{verbatim}

\bf{\textcolor{blue}{And see this}}

\citet{chang2015core} published a cool paper.

In 2015, \citeauthor{chang2015core} published a cool paper.

\vspace{1cm}
\tiny
\textit{*chang2015core} is a short name.

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]{Citation: Natbib package}

\centering
\includegraphics[width = 9cm, height = 8cm]{Natbib.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Thesis}
\begin{frame}[fragile]{Thesis}

\bf{\textcolor{blue}{Great!}}

\vspace{0.7cm}

\tiny
\framebox{Don't want to spend time to adjust \textcolor{red}{tables + pictures + citations + formats ...}}

\vspace{0.7cm}
\large
\bf{\textcolor{blue}{$=>$ please just use \LaTeX.}}

\vspace{1cm}
Otago \LaTeX thesis package can be downloaded from:

\url{http://www.cs.otago.ac.nz/research/systems/resources.html}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Beamer}
\begin{frame}[fragile]{Presentation}

\centering
\bf{\textcolor{blue}{\LaTeX is used to make this presentation.}}

\vspace{1cm}
\centering
\bf{But how?}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]{Presentation}

\bf{The magician \textcolor{blue}{``The Beamer package''}: you can customize (or copy) different themes}

$=>$ I usually download a theme and adjust it.

\vspace{0.8cm}
\centering
\includegraphics[width = 10cm, height = 4cm]{websiteBeamer.png}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Beamer example}

\centering
\includegraphics[width = 6cm, height = 6cm]{beamer1}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\begin{frame}{Beamer example}

\centering
\includegraphics[width = 6cm, height = 6cm]{beamer2}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Beamer example}

\centering
\includegraphics[width = 6cm, height = 6cm]{beamer3}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}{Beamer example}

\centering
\includegraphics[width = 6cm, height = 6cm]{beamer4}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Example}
\begin{frame}{}
\vspace{-0.4cm}
Open emacs/vim/word...and type it, then go to terminal to compile it with \textit{pdflatex} and \textit{bibtex}.
\hspace{-0.5cm}
\includegraphics[width = 10.5cm, height = 8cm]{fullExample.png}

\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Discussion}
\begin{frame}{Discussion}

You can use \LaTeX to:
\begin{enumerate}
\item write your thesis/proposal/manual.
\item make your presentation.
\end{enumerate}

\vspace{1cm}
However, you have to work with biologists, so MUST use Word to write papers.

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliography{bibLabMik}
\end{document}


\unnumberedchapter{Abbreviations}
\chapter*{Abbreviations}

All abbreviations used in the thesis must be listed, with their definitions, in alphabetical order.  This includes trivial and commonly used abbreviations, at your discretion, but not words that have entered into general English usage (laser, for example, or DNA).  In particular, non-standard abbreviations should be presented.

\begin{longtable}{rl}
PPT & positive partial transpose\\
SRPT & Schr\"odinger-Robertson partial transpose
\end{longtable}


\documentclass[12pt]{hitec}

\usepackage{fancyvrb}
\usepackage{hyperref}

\title{Problem set 1}
\author{Joe Armstrong}
\date{}

\begin{document}

\maketitle

\tableofcontents

\section{Introduction}
These problems are for lectures E1 and E2.

Additional material can be found in the course book
{\sl Programming Erlang, 2'nd edition}.

\section{Problems}

The first exercises involve correcting
incorrect programs. The program \verb+bad_prog1.erl+ in my github repository
\newline
\href{https://github.com/joearms/paradis\_jan\_2016/blob/master/lectures/bad\_prog1.erl}
     {https://github.com/joearms/paradis\_jan\_2016/}

has a
large number of errors.

Note: All programs you hand in should contain unit tests together with
documentation and instructions on how to run the program. For
v\"{a}lgodk\"{a}nd you should solve the sections mark advanced and
your programs should be of production quality. This means, not only
should the code be totally correct, it should also be well documented
with no spelling errors and have good test coverage.

\VerbatimInput[frame=single]{./bad_prog1.erl}

Correct all the errors that you can find.  Write unit
tests\footnote{See the note on unit tests.}  for this module and run
these tests.

See how many errors you can find {\sl before} running this through the
compiler.

Hint: Read the error messages - correct the first error and recompile
before tackling the second error. Having fixed the first error the
error messages that the compiler generates may change on subsequent
recompilation (which is why it is good to fix one error at a time).

As you get experienced look at only the line number in the error
message then try to see the error in your code at this line without
reading the remainder of the diagnostic.

Note: Good programs should have good documentation and
comments. Correct the comments as well as the code, and document the
module in an appropriate manner.

\section{A bank account}

The following program implements a simple bank process, where the code
you have to write has been replaced by the atom \verb+implement_this+.

Replace the \verb+implement_this+ atoms by correct code.

\VerbatimInput[frame=single]{./bank.erl}

When your program works the unit test \verb+bank:test()+ should
evaluate to \verb+horray+

Look at the code in \verb+e1.erl+ for inspiration.

\section{Advanced: Many bank accounts}

The previous bank account was for one person only. Implement a module
\verb+multi_bank.erl+ that handles bank accounts for many
people. You'll have to add an additional argument \verb+Who+ to all
the functions in the API, so for example where \verb+bank.erl+ exports
\verb+add(Pid, X)+ \verb+multi_bank.erl+ would have a function
\verb+add(Pid, Who, X)+ where \verb+Who+ is a person name (for example, the
atom \verb+joe+).

Add an additional function \verb+lend(Pid, From, To, Ammount)+ to
transfer money between bank accounts of the people \verb+From+ and \verb+To+.

\section{Unit Tests}

Here's an example of a simple module, containing a test function \verb+test()+.

\VerbatimInput[frame=single]{./math0.erl}

The unit tests are in the body of the function \verb+test()+. To run the tests
we proceed as follows:

\begin{verbatim}
> erl
Eshell V7.1  (abort with ^G)
1> c(math0).
{ok,math0}
2> math0:test().
horray
\end{verbatim}

Here we have used pattern matching to test the return values of the function.
The line:
\begin{verbatim}
24 = fac(4)
\end{verbatim}

will fail with a pattern matching error if \verb+fac(4)+ does not return  \verb+24+
(which is the value of factorial 4).

If we call \verb+fac(N)+ with an argument that is not an integer the function
should raise an exception. We can test that it has throw an exception with a
statement like:

\begin{verbatim}
  {'EXIT', _} = (catch fac(X))
\end{verbatim}

In a later lecture I'll talk about catching exceptions, but for now all you need
to know is that \verb+catch(F(X))+ traps errors occurring during the evaluation
of \verb+F(X)+ converting them to error tuples of the form \verb+{'EXIT', Why}+
which we match with the pattern \verb+{'EXIT', _}+.

\section*{Notes}

\href{https://github.com/joearms/paradis\_jan\_2016/blob/master/lectures/}
     {https://github.com/joearms/paradis\_jan\_2016/blob/master/lectures/}
     contains material referred to in the problems.

If you want to build the lectures locally you will need a working verison
of erlang and pdflatex installed on your machine.

\end{document}


\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[dvips]{graphicx}
\usepackage{fancybox}
\usepackage{verbatim}
\usepackage{array}
\usepackage{latexsym}
\usepackage{alltt}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usepackage{float}
\usepackage[hmargin=3cm,vmargin=5.0cm]{geometry}
%\topmargin=0cm
\topmargin=-2cm
\addtolength{\textheight}{6.5cm}
\addtolength{\textwidth}{2.0cm}
%\setlength{\leftmargin}{-5cm}
\setlength{\oddsidemargin}{0.0cm}
\setlength{\evensidemargin}{0.0cm}

\begin{document}

\section*{Student Information }
%Write your full name and id number between the colon and newline
%Put one empty space character after colon and before newline
Full Name : Zeynep Özalp \\
Id Number : 2237691 \\

% Write your answers below the section tags
\section*{Answer 1}
\subsection*{a}
Note that the symbol "e" is used as empty string.
\begin{figure}[H]
	\centering
	\begin{tikzpicture}

	\node[shape=circle,draw=black] (01) at (-1, 0)     {\textbf{01}};
	\node[shape=circle,draw=black] (10) at (1, 0)     {\textbf{10}};
	\node[shape=circle,draw=black] (0) at (-2, 2) 	 {\textbf{0}};
	\node[shape=circle,draw=black] (1) at (2, 2)     {\textbf{1}};
	\node[shape=circle,draw=black] (e) at (0, 4) 	 {\textbf{e}};
	\node[shape=circle,draw=black] (010) at (-6, 7)     {\textbf{010}};
	\node[shape=circle,draw=black] (101) at (-2, 7) 	 {\textbf{101}};
	\node[shape=circle,draw=black] (110) at (2, 7)     {\textbf{110}};
	\node[shape=circle,draw=black] (011) at (6, 7)     {\textbf{011}};

	\path[->, thick] (e) edge [loop right] (e);
	\path[->, thick] (e) edge (0);
	\path[->, thick] (e) edge (1);
	\path[->, thick] (e) edge (01);
	\path[->, thick] (e) edge (10);
	\path[->, thick] (e) edge (010);
	\path[->, thick] (e) edge (101);
	\path[->, thick] (e) edge (110);
	\path[->, thick] (e) edge (011);
	\path[->, thick] (0) edge [loop right] (0);
	\path[->, thick] (0) edge (01);
	\path[->, thick] (0) edge (10);
	\path[->, thick] (0) edge (010);
	\path[->, thick] (0) edge (101);
	\path[->, thick] (0) edge (011);
	\path[->, thick] (0) edge (110);
	\path[->, thick] (1) edge [loop right] (1);
	\path[->, thick] (1) edge (01);
	\path[->, thick] (1) edge (10);
	\path[->, thick] (1) edge (010);
	\path[->, thick] (1) edge (101);
	\path[->, thick] (1) edge (110);
	\path[->, thick] (1) edge (011);
	\path[->, thick] (01) edge [loop below] (01);
	\path[->, thick] (01) edge (010);
	\path[->, thick] (01) edge (101);
	\path[->, thick] (01) edge (011);
	\path[->, thick] (10) edge [loop below] (01);
	\path[->, thick] (10) edge (010);
	\path[->, thick] (10) edge (110);
	\path[->, thick] (10) edge (101);
	\path[->, thick] (010) edge [loop right] (010);
	\path[->, thick] (101) edge [loop right] (101);
	\path[->, thick] (110) edge [loop right] (110);
	\path[->, thick] (110) edge [loop right] (011);

	\end{tikzpicture}
\end{figure}
\subsection*{b}
Since every string is a subset of itself, this relation is reflexive on S. Assume that $aRb$ and $bRa$ for $a,b \in S$. This is possible if and only if $a=b$. So, R is antisymmetric. Clearly, $aRb \wedge bRc \rightarrow aRc$ for $a,b,c \in S$ since if a is a substring of b and b is a substring of c, a is a substring of c. Thus, $(S,R)$ is a poset.
\subsection*{c}
For every $a,b \in S$, if $a\alpha b$ then the relation $\alpha$ is a total order. For example, between $010$ and $110$ there is no relation. Thus, R is not a total order.
\subsection*{d}
\begin{figure}[H]
	\centering
	\begin{tikzpicture}

	\node[shape=circle,draw=black] (e) at (0, 0)     {\textbf{e}};
	\node[shape=circle,draw=black] (0) at (-2, 2) 	 {\textbf{0}};
	\node[shape=circle,draw=black] (1) at (2, 2)     {\textbf{1}};
	\node[shape=circle,draw=black] (01) at (-1, 4) 	 {\textbf{01}};
	\node[shape=circle,draw=black] (10) at (1, 4) 	 {\textbf{10}};
	\node[shape=circle,draw=black] (101) at (1, 7)     {\textbf{101}};
	\node[shape=circle,draw=black] (010) at (-1, 7) 	 {\textbf{010}};
	\node[shape=circle,draw=black] (011) at (-3, 7)     {\textbf{011}};
	\node[shape=circle,draw=black] (110) at (3, 7)     {\textbf{110}};

	\path[-, thick] (e) edge (0);
	\path[-, thick] (e) edge (1);
	\path[-, thick] (0) edge (01);
	\path[-, thick] (1) edge (01);
	\path[-, thick] (0) edge (10);
	\path[-, thick] (1) edge (10);
	\path[-, thick] (01) edge (010);
	\path[-, thick] (01) edge (101);
	\path[-, thick] (01) edge (011);
	\path[-, thick] (10) edge (110);
	\path[-, thick] (10) edge (010);
	\path[-, thick] (10) edge (101);

	\end{tikzpicture}
\end{figure}
Minimal: e. Maximal: 010,101,110.
\subsection*{e}
Not a lattice since least upper bound of 010 and 101 does not exist in S.
\section*{Answer 2}
\subsection*{a}
\begin{table}[H]
\small
\centering
\begin{tabular}
{|c|c|}	%% specify column number and vertical lines
\hline
Initial Vertex & Terminal Vertex \\
\hline
a & a,b,d\\
b & c,d\\
c & b\\
d & c\\
e & b,f\\
f & b,e,f\\
g & c,f\\
\hline

\end{tabular}
\end{table}
\subsection*{b}
Order of the vertices is a,b,c,d,e,f,g.
$$
\begin{bmatrix}
1 & 1 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 1 & 1 & 0 \\
\end{bmatrix}
$$
\subsection*{c}
\begin{table}[H]
\small
\centering
\begin{tabular}
{|c|c|c|}	%% specify column number and vertical lines
\hline
Vertex & Indegrees & Outdegrees \\
\hline
a & 1 & 3\\
b & 3 & 1\\
c & 3 & 1\\
d & 2 & 1\\
e & 2 & 1\\
f & 2 & 3\\
g & 0 & 2\\
\hline

\end{tabular}
\end{table}
\subsection*{d}
1. abcbd\\
2. adcbc\\
3. ebdcb\\
4. efbdc\\
5. gfebd\\
6. gfbdc
\subsection*{e}
1. dcbd\\
2. bdcb\\
3. cbdc\\
4. feff
\subsection*{f}
Graph G is weakly connected if and only if there is a path between every two vertices when the directions of the edges are disregarded. Vertex b is connected to all vertices except g but vertex g is connected to f and c. Clearly, there is a path between every two vertices.
\subsection*{g}
1. Vertex a.\\
2. Vertex g.\\
3. Subgraph consisting vertices b,c,d and edges (b,c), (c,b), (d,c), (b,d).\\
4. Subgraph consisting vertices e, f and edges (e,f), (f,e).
\subsection*{h}
1. Between a and b: adcb, abcb.\\
1. Between a and c: aabc, aadc, abdc.\\
2. Between a and d there is 1 path : aabd.\\
3. Between b and d there is 1 path : bcbd.\\
4. Between d and c there is 1 path : dcbc.\\
Total = 8.
\section*{Answer 3}
\subsection*{a}
Theorem in lecture notes of section 3: A graph has a Euler path if it is connected and there is either 0 or 2 vertices of odd degree. Clearly, the graph is connected.\\
deg(a)=2, deg(b)=6, deg(c)=4, deg(d)=4, deg(e)=6, deg(f)=6, deg(g)=4, deg(h)=4, deg(i)=4, deg(j)=6. \\
Therefore, G has a Euler path.
\subsection*{b}
Since the graph is connected and every vertex has a even degree, the graph has an Euler circuit by Theorem 1 on page 696.
\subsection*{c}
One example of Hamiltonian path of G: abfehicdgkj. So, G has a Hamiltonian path.
\subsection*{d}
The number of vertices is 11. Not all of vertices have a degree greater than 11/2 and the greatest number of sum of the degrees of two non adjacent vertices is 10. So, there is no Hamiltonian circuit with respect to Theorem 3 and 4 on page 701.
\section*{Answer 4}
\subsection*{a}
There are m+n vertices. Let use the symbols M and N to represent disjoint sets of m and n vertices, respectively. For each vertex in M, there is an n edges to every vertex in N. Since there are m vertices in M, the number of edges is m times n in total.
\subsection*{b}
Since there is no edge between the elements of M and N, the Hamiltonian path have a zigzag shape.\\

1. Assume that $n>m$\\
a) Assume we begin with a vertex in N. Then, we have to visit a vertex in M, then in N, and goes like a zigzag shape until there are n-m unvisited vertices in N. Since there are no edges between these vertices, there are no Hamiltonian circuit or path.\\
b) Assume we begin with a vertex in M. Again we have a zigzag shape. Since we begin with a vertex in M, path will end at one of vertex in N but there are still n-m unvisited vertices in N. Since there are no edges between these vertices, there are no Hamiltonian circuit or path.\\

2. Assume that $m>n$.\\
a) Assume we begin with a vertex in M. Again we have a zigzag shape. Since we begin with a vertex in M, path will end at one of vertex in N but there are still m-n unvisited vertices in M. Since there are no edges between these vertices, there are no Hamiltonian circuit or path.\\
a) Assume we begin with a vertex in N. Again we have a zigzag shape. There remains m-n unvisited vertices in M. Since there are no edges between these vertices, there are no Hamiltonian circuit or path.\\

\section*{Answer 5}
\subsection*{a}
The table shows visited vertices, selected vertex in each step and current distances of vertices to vertex s. The distances are initially infinity. Distance from s to s is zero (no need to show).
\begin{table}[H]
\small
\centering
\begin{tabular}
{|c|c|c|c|c|c|c|c|c|}	%% specify column number and vertical lines
\hline
Visited Vertices & Selected Vertex & u & v & w & x & y & z & t \\
\hline
  & s & 4 & 5 & 3 & $\infty$ & $\infty$ & $\infty$ & $\infty$ \\
  \hline
 s & w & 4 & 5 & 3 & 11 & $\infty$ & 15 & $\infty$ \\
 \hline
 s, w & u & 4 & 5 & 3 & 11 & 15 & 15 & $\infty$ \\
 \hline
 s, w, u & v & 4 & 5 & 3 & 7 & 11 & 15 & $\infty$ \\
 \hline
 s, w, u, v & x & 4 & 5 & 3 & 7 & 8 & 13 & $\infty$ \\
 \hline
 s, w, u, v, x & y & 4 & 5 & 3 & 7 & 8 & 12 & 17 \\
 \hline
 s, w, u, v, x, y & z & 4 & 5 & 3 & 7 & 8 & 12 & 15 \\
 \hline
 s, w, u, v, x, y, z & t & 4 & 5 & 3 & 7 & 8 & 12 & 15 \\
\hline

\end{tabular}
\end{table}
Shortest path from s to t is svxyzt and its weight is 15.
\subsection*{b}

The root is x. Add y since its weight is minimal, 1.
\begin{figure}[H]
\centering
	\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};

	\path[-, thick] (x) edge (y);

	\end{tikzpicture}
\end{figure}

Now, we have vertices x and y. Add v since its weight is smallest among u, w, z, t.
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);

\end{tikzpicture}
\end{figure}
Now we have vertices x, y and v. Add w since its weight is smallest. This procedure goes like this.
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (v) edge (w);

\end{tikzpicture}
\end{figure}

\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (v) edge (w);
	\path[-, thick] (w) edge (u);

\end{tikzpicture}
\end{figure}

\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (s) at (1, -3) 	 {\textbf{s}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (v) edge (w);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (w) edge (s);

\end{tikzpicture}
\end{figure}

\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (s) at (1, -3) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (z) at (-2, -2) 	 {\textbf{z}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (v) edge (w);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (w) edge (s);
	\path[-, thick] (z) edge (y);

\end{tikzpicture}
\end{figure}

\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (s) at (1, -3) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (z) at (-2, -2) 	 {\textbf{z}};
	\node[shape=circle,draw=black] (t) at (-3, -3) 	 {\textbf{t}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (v) edge (w);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (w) edge (s);
	\path[-, thick] (z) edge (y);
	\path[-, thick] (z) edge (t);

\end{tikzpicture}
\end{figure}
\subsection*{c}
\begin{itemize}
\item After adding (s,x,1):
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (s) at (0, -1) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (z) at (-2, -2) 	 {\textbf{z}};
	\node[shape=circle,draw=black] (t) at (-3, -3) 	 {\textbf{t}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (s);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (w) edge (v);
	\path[-, thick] (z) edge (y);
	\path[-, thick] (z) edge (t);

\end{tikzpicture}
\end{figure}
\item After adding (t,u,6): Nothing changes.
\item After adding (s,z,-6):
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (s) at (0, -1) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (2, -2) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (3, -3) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (z) at (0, -2) 	 {\textbf{z}};
	\node[shape=circle,draw=black] (t) at (0, -3) 	 {\textbf{t}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (s);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (w) edge (v);
	\path[-, thick] (z) edge (s);
	\path[-, thick] (z) edge (t);

\end{tikzpicture}
\end{figure}
\item After adding (u,y,3):
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (s) at (0, -1) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (-3, -3) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (-2, -2) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (z) at (0, -2) 	 {\textbf{z}};
	\node[shape=circle,draw=black] (t) at (0, -3) 	 {\textbf{t}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (s);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (w) edge (u);
	\path[-, thick] (u) edge (y);
	\path[-, thick] (z) edge (s);
	\path[-, thick] (z) edge (t);

\end{tikzpicture}
\end{figure}
\item After adding (w,z,-1):
\begin{figure}[H]
\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (x) at (0, 0)     {\textbf{x}};
	\node[shape=circle,draw=black] (y) at (-1, -1) 	 {\textbf{y}};
	\node[shape=circle,draw=black] (s) at (0, -1) 	 {\textbf{s}};
	\node[shape=circle,draw=black] (v) at (1, -1) 	 {\textbf{v}};
	\node[shape=circle,draw=black] (w) at (1, -3) 	 {\textbf{w}};
	\node[shape=circle,draw=black] (u) at (1, -4) 	 {\textbf{u}};
	\node[shape=circle,draw=black] (z) at (0, -2) 	 {\textbf{z}};
	\node[shape=circle,draw=black] (t) at (-1, -3) 	 {\textbf{t}};

	\path[-, thick] (x) edge (y);
	\path[-, thick] (x) edge (s);
	\path[-, thick] (x) edge (v);
	\path[-, thick] (w) edge (z);
	\path[-, thick] (u) edge (w);
	\path[-, thick] (z) edge (s);
	\path[-, thick] (z) edge (t);

\end{tikzpicture}
\end{figure}
\end{itemize}
\subsection*{d}
Yes. Since we construct a minimum spanning tree, we can use the edges of it. So, the shortest path from s to t is szt has weight -3+3=0.
\section*{Answer 6}
\subsection*{a}
13 vertices, 12 edges, height is 4.
\subsection*{b}
Post-order traversal: w, s, m, t, q, x, n, y, u, z, v, r, p.\\
\subsection*{c}
In-order traversal: s, w, q, m, t, p, x, u, n, y, r, v, z.\\
\subsection*{d}
Pre-order traversal: p, q, s, w, t, m, r, u, x, y, n, v, z.\\
\subsection*{e}
No. In a full binary tree every node has two children except the ones at height 0.
\subsection*{f}
No since x:41 should be in the sub-tree of p:42.
\subsection*{g}
By the definition on page 748, in a full m-ary tree, every internal vertex has exactly m children. Let N be the number of vertices.
$$N=1+3+3^2+3^3+...=\sum_{k=0}^h3^k=\dfrac{3^{h+1}-1}{3-1}=\dfrac{3^{h+1}-1}{2}$$
\subsection*{h}
\begin{figure}[H]
	\centering
	\begin{tikzpicture}

	\node[shape=circle,draw=black] (9) at (0, 6)     {\textbf{9}};
	\node[shape=circle,draw=black] (4) at (-2,4) 	 {\textbf{4}};
	\node[shape=circle,draw=black] (15) at (2,4) 	 {\textbf{15}};
	\node[shape=circle,draw=black] (3) at (-3,2) 	 {\textbf{3}};
	\node[shape=circle,draw=black] (7) at (-1,2) 	 {\textbf{7}};
	\node[shape=circle,draw=black] (11) at (1,2) 	 {\textbf{11}};
	\node[shape=circle,draw=black] (21) at (3,2) 	 {\textbf{21}};
	\node[shape=circle,draw=black] (1) at (-4,0) 	 {\textbf{1}};
	\node[shape=circle,draw=black] (22) at (4,0) 	 {\textbf{22}};

	\path[-, thick] (9) edge (4);
	\path[-, thick] (9) edge (15);
	\path[-, thick] (4) edge (3);
	\path[-, thick] (4) edge (7);
	\path[-, thick] (15) edge (11);
	\path[-, thick] (15) edge (21);
	\path[-, thick] (3) edge (1);
	\path[-, thick] (21) edge (22);

	\end{tikzpicture}
\end{figure}
\subsection*{i}
For 2: 9, 4, 3, 1. Unsuccessful search.\\
For 22: 9, 15, 21, 22. Successful search.
\subsection*{j}
\begin{figure}[H]
	\centering
	\begin{tikzpicture}

	\node[shape=rectangle,draw=black] (0000) at (0, 6)     {\textbf{0000}};
	\node[shape=rectangle,draw=black] (001) at (0,5) 	 {\textbf{001}};
	\node[shape=rectangle,draw=black] (010) at (0,4) 	 {\textbf{010}};
	\node[shape=rectangle,draw=black] (1) at (0,3) 	 {\textbf{1}};
	\node[shape=rectangle,draw=black] (10) at (0,2) 	 {\textbf{10}};

	\path[-, thick] (0000) edge (001);
	\path[-, thick] (010) edge (001);
	\path[-, thick] (010) edge (1);
	\path[-, thick] (1) edge (10);

	\end{tikzpicture}
\end{figure}
\subsection*{k}
For 001: 0000, 001. Successful search. \\
For 011: 0000, 001, 010, 1. Unsuccessful search.
\subsection*{l}
First tree:
\begin{figure}[H]
	\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (g) at (0, 0)     {\textbf{g}};
	\node[shape=circle,draw=black] (f) at (0, -1) 	 {\textbf{f}};
	\node[shape=circle,draw=black] (e) at (0, -2) 	 {\textbf{e}};
	\node[shape=circle,draw=black] (b) at (0, -3) 	 {\textbf{b}};
	\node[shape=circle,draw=black] (d) at (0, -4) 	 {\textbf{d}};
	\node[shape=circle,draw=black] (c) at (0, -5) 	 {\textbf{c}};

	\path[->, thick] (g) edge (f);
	\path[<-, thick] (e) edge (f);
	\path[->, thick] (e) edge (b);
	\path[<-, thick] (d) edge (b);
	\path[->, thick] (d) edge (c);

\end{tikzpicture}
\end{figure}
Second tree:
\begin{figure}[H]
	\centering
\begin{tikzpicture}

	\node[shape=circle,draw=black] (a) at (0, 0)     {\textbf{a}};

\end{tikzpicture}
\end{figure}
\end{document}


\subsubsection{Percentage of covered users}\label{subsubsec:rect2krcoverage}

As in the case of other scenarios, the percentage of covered users almost always
reaches its maximum value. The lowest value for is \(99.6664\%\). So, we will
not analyze this index. In any case, from the performance plots at the end of
the notebook, we can clearly see that, generally, the coverage increases with
the broadcast radius (\(R\)), the maximum number of copies (\(m\)) and the
maximum relay delay (\(D\)).


%!TEX root = forallxyyc.tex
\part{Interpretations}
\label{ch.semantics}
\addtocontents{toc}{\protect\mbox{}\protect\hrulefill\par}

\chapter{Extensionality}\label{s:Interpretations}

Recall that TFL is a truth-functional language. Its connectives are all truth-functional, and \emph{all} that we can do with TFL is key sentences to particular truth values. We can do this \emph{directly}. For example, we might stipulate that the TFL sentence `$P$' is to be true. Alternatively, we can do this \emph{indirectly}, offering a symbolization key, e.g.:
	\begin{ekey}
		\item[P] Big Ben is in London
	\end{ekey}
Now recall from \S\ref{s:TruthFunctionality} that this should be taken to mean:
	\begin{ebullet}
		\item The TFL sentence `$P$' is to take the same truth value as the English sentence `Big Ben is in London' (whatever that truth value may be)
	\end{ebullet}
The point that we emphasized is that TFL cannot handle differences in meaning that go beyond mere differences in truth value.

\section{Symbolizing versus translating}
FOL has some similar limitations, but it goes beyond mere truth values, since it enables us to split up sentences into terms, predicates and quantifier expressions. This enables us to consider what is \emph{true of} some particular object, or of some or all objects. But we can do no more than that.

When we provide a symbolization key for some FOL predicates, such as:
	\begin{ekey}
		\item[Cx] \gap{x} teaches Logic III in Calgary
	\end{ekey}
we do not carry the \emph{meaning} of the English predicate across into our FOL predicate. We are simply stipulating something like the following:
	\begin{ebullet}
		\item `$Cx$' and `\gap{x} teaches Logic III in Calgary' are to be \emph{true of} exactly the same things.
	\end{ebullet}
So, in particular:
	\begin{ebullet}
		\item `$Cx$' is to be true of all and only those things which teach Logic III in Calgary (whatever those things might be).
	\end{ebullet}
This is an indirect stipulation. Alternatively, we can directly stipulate which objects a predicate should be true of. For example, we can stipulate that `$Cx$' is to be true of Richard Zach, and Richard Zach alone. As it happens, this direct stipulation would have the same effect as the indirect stipulation. Note, however, that the English predicates `\blank\ is Richard Zach' and `\blank\ teaches Logic III in Calgary' have very different meanings!

The point is that FOL does not give us any resources for dealing with nuances of meaning. When we interpret FOL, all we are considering is what the predicates are true of, regardless of whether we specify these things directly or indirectly. The things a predicate is true of are known as the \define{extension} of that predicate. We say that FOL is an \define{extensional language} because FOL does not represent differences of meaning between predicates that have the same extension.

For this reason, we say only that FOL sentences \emph{symbolize} English sentences. It is doubtful that we are \emph{translating} English into FOL, as translations should preserve meanings, and not just extensions.

\section{A word on extensions}
We can stipulate directly what predicates are to be true of, so it is worth noting that our stipulations can be as arbitrary as we like. For example, we could stipulate that `$Hx$' should be true of, and only of, the following objects:
	\begin{center}
		Justin Trudeau\\
		the number $\pi$\\
		every top-F key on every piano ever made
	\end{center}
Now, the objects that we have listed have nothing particularly in common. But this doesn't matter. Logic doesn't care about what strikes us mere humans as `natural' or `similar'. Armed with this interpretation of `$Hx$', suppose we now add to our symbolization key:
	\begin{ekey}
		\item[j] Justin Trudeau
		\item[r] Rachel Notley
		\item[p] the number $\pi$
	\end{ekey}
Then `$Hj$' and `$Hp$' will both be true, on this interpretation, but `$Hr$' will be false, since Rachel Notley was not among the stipulated objects.

\section{Many-place predicates}
All of this is quite easy to understand when it comes to one-place predicates, but it gets messier when we consider two-place predicates. Consider a symbolization key like:
	\begin{ekey}
		\item[Lxy] \gap{x} loves \gap{y}
	\end{ekey}
Given what we said above, this symbolization key should be read as saying:
	\begin{earg}
		\item[\textbullet] `$Lxy$' and `\gap{x} loves \gap{y}' are to be true of exactly the same things
	\end{earg}
So, in particular:
	\begin{earg}
		\item[\textbullet] `$Lxy$' is to be true of x and y (in that order) iff x loves y.
	\end{earg}
It is important that we insist upon the order here, since love---famously---is not always reciprocated. (Note that `x' and `y' here are symbols of augmented English, and that they are being \emph{used}. By contrast, `$x$' and `$y$' are symbols of FOL, and they are being \emph{mentioned}.)

That is an indirect stipulation. What about a direct stipulation? This is slightly harder. If we \emph{simply} list objects that fall under `$Lxy$', we will not know whether they are the lover or the beloved (or both). We have to find a way to include the order in our explicit stipulation.

To do this, we can specify that two-place predicates are true of \emph{pairs} of objects, where the order of the pair is important. Thus we might stipulate that `$Bxy$' is to be true of, and only of, the following pairs of objects:
	\begin{center}
		\ntuple{Lenin, Marx}\\
		\ntuple{Heidegger, Sartre}\\
		\ntuple{Sartre, Heidegger}
	\end{center}
Here the angle-brackets keep us informed concerning order. Suppose we now add the following stipulations:
	\begin{ekey}
		\item[l] Lenin
		\item[m] Marx
		\item[h] Heidegger
		\item[r] Sartre
	\end{ekey}
Then `$Blm$' will be true, since \ntuple{Lenin, Marx} was in our explicit list, but `$Bml$' will be false, since \ntuple{Marx, Lenin} was not in our list. However, both `$Bhr$' and `$Brh$' will be true, since both \ntuple{Heidegger, Sartre} and \ntuple{Sartre, Heidegger} are in our explicit list.

To make these ideas more precise, we would need to develop some \emph{set theory}. That would give us some precise tools for dealing with extensions and with ordered pairs (and ordered triples, etc.). However, set theory is not covered in this book, so we will leave these ideas at an imprecise level. Nevertheless, the general idea should be clear.

\section{Semantics for identity}
Identity is a special predicate of FOL. We write it a bit differently than other two-place predicates: `$x=y$' instead of `$Ixy$' (for example). More important, though, its interpretation is fixed, once and for all.

If two names refer to the same object, then swapping one name for another will not change the truth value of any sentence. So, in particular, if `$a$' and `$b$' name the same object, then all of the following will be true:\label{model.nonidentity}
	\begin{align*}
	 	Aa &\eiff Ab \\
	 	Ba &\eiff Bb\\
		Raa &\eiff Rbb\\
		Raa & \eiff Rab\\
		Rca &\eiff Rcb\\
		\forall x Rxa &\eiff \forall x Rxb
	\end{align*}
Some philosophers have believed the reverse of this claim. That is, they have believed that when exactly the same sentences (not containing `$=$') are true of two objects, then they are really just one and the same object after all. This is a highly controversial philosophical claim (sometimes called the \emph{identity of indiscernibles}) and our logic will not subscribe to it; we allow that exactly the same things might be true of two \emph{distinct} objects.

To bring this out, consider the following interpretation:
	\begin{ebullet}
		\item[\text{domain}:] P.D.\ Magnus, Tim Button
		\item[$a$:] P.D.\ Magnus
		\item[$b$:] Tim Button
		\item For every primitive predicate we care to consider, that predicate is true of \emph{nothing}.
	\end{ebullet}
Suppose `$A$' is a one-place predicate; then `$Aa$' is false and `$Ab$' is false, so `$Aa \eiff Ab$' is true. Similarly, if `$R$' is a two-place predicate, then `$Raa$' is false and `$Rab$' is false, so that `$Raa \eiff Rab$' is true. And so it goes: every atomic sentence not involving `$=$' is false, so every biconditional linking such sentences is true. For all that, Tim Button and P.D.\ Magnus are two distinct people, not one and the same!

\section{Interpretation}
We defined a \define{valuation} in TFL as any assignment of truth and falsity to atomic sentences. In FOL, we are going to define an \define{interpretation} as consisting of three things:
	\begin{ebullet}
		\item the specification of a domain
		\item for each name that we care to consider, an assignment of exactly one object within the domain
		\item for each predicate that we care to consider---other than `$=$'---a specification of what things (in what order) the predicate is to be true of
	\end{ebullet}
The symbolization keys that we considered in Part~\ref{ch.FOL} consequently give us one very convenient way to present an interpretation. We will continue to use them throughout this chapter. However, it is sometimes also convenient to present an interpretation \emph{diagrammatically}.

\newglossaryentry{interpretation}{
  name = {interpretation},
  description = {a specification of a \gls{domain} together with the objects the \glspl{name} pick out and which objects the \glspl{predicate} are true of}
}

Suppose we want to consider just a single two-place predicate, `$Rxy$'. Then we can represent it just by drawing an arrow between two objects, and stipulate that `$Rxy$' is to hold of x and y just in case there is an arrow running from x to y in our diagram. As an example, we might offer:
\begin{center}
\begin{tikzpicture}
\node (atom1) at (0,2) {1};
\node (atom2) at (2,2) {2};
\node (atom3) at (2,0) {3};
\node (atom4) at (0,0) {4};
\draw[->, thick] (atom1)--(atom2);
\draw[->, thick] (atom2)--(atom3);
\draw[->, thick] (atom3)--(atom4);
\draw[->, thick] (atom4)--(atom1);
\draw[->, thick] (atom1) -- (atom3);
\end{tikzpicture}
\end{center}
This would be suitable to characterize an interpretation whose domain is the first four positive whole numbers, and which interprets `$Rxy$' as being true of and only of:
	\begin{center}
		\ntuple{1, 2},
		\ntuple{2, 3},
		\ntuple{3, 4},
		\ntuple{4, 1},
		\ntuple{1, 3}
	\end{center}
Equally we might offer:

\begin{center}
\begin{tikzpicture}
\node (atom1) at (0,2) {1};
\node (atom2) at (2,2) {2};
\node (atom3) at (2,0) {3};
\node (atom4) at (0,0) {4};
\draw[->, thick] (atom3)--(atom4);
\draw[->, thick] (atom1)+(-0.15,0.15) arc (-330:-30:.3);
\draw[->, thick] (atom3)+(0.15,-0.15) arc (-150:150:.3);
\draw[<->, thick] (atom1) -- (atom3);
\end{tikzpicture}
\end{center}
for an interpretation with the same domain, which interprets `$Rxy$' as being true of and only of:
	\begin{center}
		\ntuple{1, 3},
		\ntuple{3, 1},
		\ntuple{3, 4},
		\ntuple{1, 1},
		\ntuple{3, 3}
	\end{center}
If we wanted, we could make our diagrams more complex. For example, we could add names as labels for particular objects. Equally, to symbolize the extension of a one-place predicate, we might simply draw a ring around some particular objects and stipulate that the thus encircled objects (and only them) are to fall under the predicate `$Hx$', say.

\chapter{Truth in FOL}\label{s:TruthFOL}
We know what interpretations are. Since, among other things, they tell us which predicates are true of which objects, they will provide us with an account of the truth of atomic sentences. However, we must also present a detailed account of what it is for an arbitrary FOL sentence to be true or false in an interpretation.

We know from \S\ref{s:FOLSentences} that there are three kinds of sentence in FOL:
	\begin{ebullet}
		\item atomic sentences
		\item sentences whose main logical operator is a sentential connective
		\item sentences whose main logical operator is a quantifier
	\end{ebullet}
We need to explain truth for all three kinds of sentence.

We will provide a completely general explanation in this section. However, to try to keep the explanation comprehensible, we will, at several points, use the following interpretation:
	\begin{ekey}
		\item[\text{domain}] all people born before 2000\textsc{ce}
		\item[a] Aristotle
		\item[b] Beyonc\'e
		\item[Px] \gap{x} is a philosopher
		\item[Rxy] \gap{x} was born before \gap{y}
	\end{ekey}
This will be our \emph{go-to example} in what follows.

\section{Atomic sentences}
The truth of atomic sentences should be fairly straightforward. The sentence `$Pa$' should be true just in case `$Px$' is true of `$a$'. Given our go-to interpretation, this is true iff Aristotle is a philosopher. Aristotle is a philosopher. So the sentence is true. Equally, `$Pb$' is false on our go-to interpretation.

Likewise, on this interpretation, `$Rab$' is true iff the object named by `$a$' was born before the object named by `$b$'. Well, Aristotle was born before Beyonc\'e. So `$Rab$' is true. Equally, `$Raa$' is false: Aristotle was not born before Aristotle.

Dealing with atomic sentences, then, is very intuitive. When \meta{R} is an $n$-place predicate and $\meta{a}_1, \meta{a}_{2}, \ldots, \meta{a}_{n}$ are names,

	\factoidbox{
		$\meta{R}\meta{a}_{1}\meta{a}_{2}\ldots\meta{a}_{n}$ is true in an interpretation \textbf{iff}\\
		$\meta{R}$ is true of the objects named by $\meta{a}_{1}, \meta{a}_{2}, \ldots, \meta{a}_{n}$ in that interpretation (considered in that order)
	}
Recall, though, that there is a second kind of atomic sentence: two names connected by an identity sign constitute an atomic sentence. This kind of atomic sentence is also easy to handle. Where \meta{a} and \meta{b} are any names,
	\factoidbox{
		$\meta{a} = \meta{b}$ is true in an interpretation \textbf{iff}\\
		 \meta{a} and \meta{b} name the very same object in that interpretation
	}
So in our go-to interpretation, `$a = b$' is false, since Aristotle is distinct from Beyonc\'e.

\section{Sentential connectives}
We saw in \S\ref{s:FOLSentences} that FOL sentences can be built up from simpler ones using the truth-functional connectives that were familiar from TFL. The rules governing these truth-functional connectives are \emph{exactly} the same as they were when we considered TFL. Here they are:
	\factoidbox{
		$\meta{A} \eand \meta{B}$ is true in an interpretation \textbf{iff}\\ both $\meta{A}$ is true and $\meta{B}$ is true in that interpretation

		\
		\\
		$\meta{A} \eor \meta{B}$ is true in an interpretation \textbf{iff}\\ either $\meta{A}$ is true or $\meta{B}$ is true in that interpretation

		\
		\\$\enot \meta{A}$ is true in an interpretation \textbf{iff} \\$\meta{A}$ is false in that interpretation

		\
		\\$\meta{A} \eif \meta{B}$ is true in an interpretation \textbf{iff}\\ either $\meta{A}$ is false or $\meta{B}$ is true in that interpretation

		\
		\\$\meta{A} \eiff \meta{B}$ is true in an interpretation \textbf{iff} \\$\meta{A}$ has the same truth value as $\meta{B}$ in that interpretation
	}
This presents the very same information as the characteristic truth tables for the connectives; it just does so in a slightly different way. Some examples will probably help to illustrate the idea. On our go-to interpretation:
	\begin{earg}
		\item[\textbullet] `$a = a \eand Pa$' is true
		\item[\textbullet] `$Rab \eand Pb$' is false because, although `$Rab$' is true, `$Pb$' is false
		\item[\textbullet] `$a = b \eor Pa$' is true
		\item[\textbullet] `$\enot a = b$' is true
		\item[\textbullet] `$Pa \eand \enot( a= b \eand Rab)$' is true, because `$Pa$' is true and `$a = b$' is false
	\end{earg}
Make sure you understand these examples.

\section{When the main logical operator is a quantifier}\label{s:MainLogicalOperatorQuantifier}
The exciting innovation in FOL, though, is the use of \emph{quantifiers}, but expressing the truth conditions for quantified sentences is a bit more fiddly than one might first expect.

Here is a na\"{i}ve first thought. We want to say that `$\forall x Fx$' is true iff `$Fx$' is true of everything in the domain. This should not be too problematic: our interpretation will specify directly what `$Fx$' is true of.

Unfortunately, this na\"{i}ve thought is not general enough. For example, we want to be able to say that `$\forall x \exists y Lxy$' is true just in case `$\exists y Lxy$' is true of everything in the domain. This is problematic, since our interpretation does not directly specify what `$\exists y Lxy$' is to be true of. Instead, whether or not this is true of something should follow just from the interpretation of `$Lxy$', the domain, and the meanings of the quantifiers.

So here is a second na\"{i}ve thought. We might try to say that `$\forall x \exists y Lxy$' is to be true in an interpretation iff $\exists y L\meta{a}y$ is true for \emph{every} name \meta{a} that we have included in our interpretation. Similarly, we might try to say that $\exists y L\meta{a}y$ is true just in case $L\meta{a}\meta{b}$ is true for \emph{some} name \meta{b} that we have included in our interpretation.

Unfortunately, this is not right either. To see this, observe that in our go-to interpretation, we have only given interpretations for \emph{two} names, `$a$' and `$b$', but the domain---all people born before the year 2000\textsc{ce}---contains many more than two people. We have no intention of trying to name \emph{all} of them!

So here is a third thought. (And this thought is not na\"{i}ve, but correct.) Although it is not the case that we have named \emph{everyone}, each person \emph{could} have been given a name. So we should focus on this possibility of extending an interpretation, by adding a new name. We will offer a few examples of how this might work, centring on our go-to interpretation, and we will then present the formal definition.

In our go-to interpretation, `$\exists x Rbx$' should be true. After all, in the domain, there is certainly someone who was born after Beyonc\'e. Lady Gaga is one of those people. Indeed, if we were to extend our go-to interpretation---temporarily, mind---by adding the name `$c$' to refer to Lady Gaga, then `$Rbc$' would be true on this extended interpretation. This, surely, should suffice to make `$\exists x Rbx$' true on the original go-to interpretation.

In our go-to interpretation, `$\exists x (Px \eand Rxa)$' should also be true. After all, in the domain, there is certainly someone who was both a philosopher and born before Aristotle. Socrates is one such person. Indeed, if we were to extend our go-to interpretation by letting a new name, `$c$', denote Socrates, then `$Wc \eand Rca$' would be true on this extended interpretation. Again, this should surely suffice to make `$\exists x (Px \eand Rxa)$' true on the original go-to interpretation.

In our go-to interpretation, `$\forall x \exists y Rxy$' should be false. After all, consider the last person born in the year 1999. We don't know who that was, but if we were to extend our go-to interpretation by letting a new name, `$d$', denote that person, then we would not be able to find anyone else in the domain to denote with some further new name, perhaps `$e$', in such a way that `$Rde$' would be true. Indeed, no matter \emph{whom} we named with `$e$', `$Rde$' would be false. This observation is surely sufficient to make `$\exists y Rdy$' \emph{false} in our extended interpretation, which in turn is surely sufficient to make `$\forall x \exists y Rxy$' false on the original go-to interpretation.

If you have understood these three examples, good. That's what matters. Strictly speaking, though, we still need to give a precise definition of the truth conditions for quantified sentences. The result, sadly, is a bit ugly, and requires a few new definitions. Brace yourself!

Suppose that \meta{A} is a formula containing at least one instance of the variable \meta{x}, and that $\meta{x}$ is free in $\meta{A}$. We will write this thus:
$$\meta{A}(\ldots \meta{x} \ldots \meta{x} \ldots)$$
Suppose also that \meta{c} is a name. Then we will write:
$$\meta{A}(\ldots \meta{c} \ldots \meta{c} \ldots)$$
for the formula obtained by replacing \emph{every} occurrence of $\meta{x}$ in \meta{A} with $\meta{c}$. The resulting formula is called a \define{substitution instance} of $\forall \meta{x}\meta{A}$ and $\exists\meta{x}\meta{A}$.  Also, $\meta{c}$ is called the \define{instantiating name}. So:
	$$\exists x (Rex \eiff Fx)$$
is a substitution instance of
	$$\forall y \exists x (Ryx \eiff Fx)$$
with the instantiating name `$e$'.

\newglossaryentry{substitution instance}{
  name = substitution instance,
  description = {the result of replacing every occurrence of a \gls{free variable} in a \gls{formula} with a \gls{name}}
}

Armed with this notation, the rough idea is as follows. The sentence $\forall \meta{x}\meta{A}(\ldots \meta{x} \ldots \meta{x} \ldots)$ will be true iff $\meta{A}(\ldots \meta{c} \ldots \meta{c}\ldots)$ is true no matter what object (in the domain) we name with $\meta{c}$. Similarly, the sentence $\exists \meta{x}\meta{A}$ will be true iff there is \emph{some} way to assign the name $\meta{c}$ to an object that makes $\meta{A}(\ldots \meta{c} \ldots \meta{c} \ldots)$ true. More precisely, we stipulate:
	\factoidbox{
		$\forall \meta{x}\meta{A}(\ldots \meta{x}\ldots\meta{x}\ldots)$ is true in an interpretation \textbf{iff}\\
		$\meta{A}(\ldots \meta{c} \ldots \meta{c}\ldots)$ is true in \emph{every} interpretation that extends the original interpretation by assigning an object to any name $\meta{c}$ (without changing the interpretation in any other way).

		\
		\\
		$\exists \meta{x}\meta{A}(\ldots \meta{x}\ldots\meta{x}\ldots)$ is true in an interpretation \textbf{iff}\\
		$\meta{A}(\ldots \meta{c}\ldots\meta{c}\ldots)$ is true in \emph{some} interpretation that extends the original interpretation by assigning an object to some name $\meta{c}$ (without changing the interpretation in any other way).
	}
To be clear: all this is doing is formalizing (very pedantically) the intuitive idea expressed on the previous page. The result is a bit ugly, and the final definition might look a bit opaque. Hopefully, though, the \emph{spirit} of the idea is clear.

\practiceproblems
\solutions
\problempart
\label{pr.TorF1}
Consider the following interpretation:
	\begin{ebullet}
		\item The domain comprises only Corwin and Benedict
		\item `$Ax$' is to be true of both Corwin and Benedict
		\item `$Bx$' is to be true of Benedict only
		\item `$Nx$' is to be true of no one
		\item `$c$' is to refer to Corwin
	\end{ebullet}
Determine whether each of the following sentences is true or false in that interpretation:
\begin{earg}
\item $Bc$
\item $Ac \eiff \enot Nc$
\item $Nc \eif (Ac \eor Bc)$
\item $\forall x Ax$
\item $\forall x \enot Bx$
\item $\exists x(Ax \eand Bx)$
\item $\exists x(Ax \eif Nx)$
\item $\forall x(Nx \eor \enot Nx)$
\item $\exists x Bx \eif \forall x Ax$
\end{earg}

\problempart
\label{pr.TorF2}
Consider the following interpretation:
	\begin{ebullet}
		\item The domain comprises only Lemmy, Courtney and Eddy
		\item `$Gx$' is to be true of Lemmy, Courtney and Eddy.
		\item `$Hx$' is to be true of and only of Courtney
		\item `$Mx$' is to be true of and only of Lemmy and Eddy
		\item `$c$' is to refer to Courtney
		\item `$e$' is to refer to Eddy
	\end{ebullet}
Determine whether each of the following sentences is true or false in that interpretation:
\begin{earg}
\item $Hc$
\item $He$
\item $Mc \eor Me$
\item $Gc \eor \enot Gc$
\item $Mc \eif Gc$
\item $\exists x Hx$
\item $\forall x Hx$
\item $\exists x \enot Mx$
\item $\exists x(Hx \eand Gx)$
\item $\exists x(Mx \eand Gx)$
\item $\forall x(Hx \eor Mx)$
\item $\exists x Hx \eand \exists x Mx$
\item $\forall x(Hx \eiff \enot Mx)$
\item $\exists x Gx \eand \exists x \enot Gx$
\item $\forall x\exists y(Gx \eand Hy)$
\end{earg}

\problempart
\label{pr.TorF3}
Following the diagram conventions introduced at the end of \S\ref{s:Interpretations}, consider the following interpretation:
\begin{center}
\begin{tikzpicture}
\node (atom1) at (0,2) {1};
\node (atom2) at (2,2) {2};
\node (atom4) at (0,0) {3};
\node (atom5) at (2,0) {4};
\node (atom6) at (4,0) {5};
\draw[->, thick] (atom1)+(-0.15,0.15) arc (-330:-30:.3);
\draw[->, thick] (atom6)+(0.15,-0.15) arc (-150:150:.3);
\draw[->, thick] (atom1) -- (atom2);
\draw[->, thick] (atom1) -- (atom4);
\draw[<->, thick] (atom1) -- (atom5);
\draw[->, thick] (atom1) -- (atom6);
\draw[->, thick] (atom2) -- (atom6);
\end{tikzpicture}
\end{center}
Determine whether each of the following sentences is true or false in that interpretation:
\begin{earg}
\item $\exists x Rxx$
\item $\forall x Rxx$
\item $\exists x \forall y Rxy$
\item $\exists x \forall y Ryx$
\item $\forall x \forall y \forall z ((Rxy \eand Ryz) \eif Rxz)$
\item $\forall x \forall y \forall z ((Rxy \eand Rxz) \eif Ryz)$
\item $\exists x \forall y \enot Rxy$
\item $\forall x(\exists y Rxy \eif \exists y Ryx)$
\item $\exists x \exists y (\enot x = y \eand Rxy \eand Ryx)$
\item $\exists x \forall y(Rxy \eiff x = y)$
\item $\exists x \forall y(Ryx \eiff x = y)$
\item $\exists x \exists y(\enot x = y \eand Rxy \eand \forall z(Rzx \eiff y = z))$
\end{earg}

\chapter{Semantic concepts}

Offering a precise definition of truth in FOL was more than a little fiddly, but now that we are done, we can define various central logical notions. These will look very similar to the definitions we offered for TFL. However, remember that they concern \emph{interpretations}, rather than valuations.

We will use the symbol `$\entails$' for FOL much as we did for TFL. So:
	$$\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n \entails\meta{C}$$
means that there is no interpretation in which all of $\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n$ are true and in which \meta{C} is false. Derivatively,
	$$\entails\meta{A}$$
means that \meta{A} is true in every interpretation.

The other logical notions also have corresponding definitions in FOL:

\begin{itemize}
\item An FOL sentence $\meta{A}$ is a \define{logical truth} iff $\meta{A}$ is true in every interpretation; i.e.,  $\entails\meta{A}$.
\newglossaryentry{logical truth}
{
name=logical truth,
description={A \gls{sentence of FOL} that is true in every \gls{interpretation}}
}

\item $\meta{A}$ is a \define{contradiction} iff $\meta{A}$ is false in every interpretation; i.e., $\entails\enot\meta{A}$.
\newglossaryentry{contradiction of FOL}
{
  name=contradiction (of FOL),
  text=contradiction,
description={A \gls{sentence of FOL} that is false in every \gls{interpretation}}
}

\item $\meta{A}_1, \meta{A}_2, \ldots \meta{A}_n \therefore \meta{C}$ is \define{valid in FOL} iff there is no interpretation in which all of the premises are true and the conclusion is false; i.e., $\meta{A}_1,\meta{A}_2,\ldots \meta{A}_n \entails\meta{C}$. It is \define{invalid in FOL} otherwise.
\newglossaryentry{logically valid in FOL}
{
  name=logical validity (in FOL),
  text = logically valid,
description={A property held by arguments if and only if no \gls{interpretation} makes all premises true and the conclusion false}
}

\item Two FOL sentences \meta{A} and \meta{B} are \define{logically equivalent} iff they are true in exactly the same interpretations as each other; i.e., both $\meta{A}\entails\meta{B}$ and $\meta{B}\entails\meta{A}$.

\newglossaryentry{logically equivalent in FOL}
{
  name=logical equivalence (in FOL),
  text = logically equivalent,
description={A property held by pairs of \glspl{sentence of FOL} if and only if the sentences have the same truth value in every \gls{interpretation}.}
}

\item The FOL sentences $\meta{A}_1,\meta{A}_2,\ldots, \meta{A}_n$ are \define{jointly consistent} iff there is some interpretation in which all of the sentences are true. They are \define{jointly inconsistent} iff there is no such interpretation.
\newglossaryentry{logically consistent in FOL}
{
  name=logical consistency (in FOL),
  text=jointly consistent,
description={A property held by \glspl{sentence of FOL} if and only if some \gls{interpretation} makes all the sentences true}
}
\end{itemize}

\chapter{Using interpretations}
\label{sec.UsingModels}

\section{Logical truths and contradictions}
Suppose we want to show that `$\exists xAxx \eif Bd$' is \emph{not} a logical truth. This requires showing that the sentence is not true in every interpretation; i.e.,\ that it is false in some interpretation. If we can provide just one interpretation in which the sentence is false, then we will have shown that the sentence is not a logical truth.

In order for `$\exists xAxx \eif Bd$' to be false, the antecedent (`$\exists x Axx$') must be true, and the consequent (`$Bd$') must be false. To construct such an interpretation, we start by specifying a domain. Keeping the domain small makes it easier to specify what the predicates will be true of, so we will start with a domain that has just one member. For concreteness, let's say it is the city of Paris.
	\begin{ekey}
		\item[\text{domain}] Paris
	\end{ekey}
The name `$d$' must refer to something in the domain, so we have no option but:
	\begin{ekey}
		\item[d] Paris
	\end{ekey}
Recall that we want `$\exists x Axx$' to be true, so we want all members of the domain to be paired with themselves in the extension of `$A$'. We can just offer:
	\begin{ekey}
		\item[Axy] \gap{x} is identical with \gap{y}
	\end{ekey}
Now `$Add$' is true, so it is surely true that `$\exists x Axx$'. Next, we want `$Bd$' to be false, so the referent of `$d$' must not be in the extension of `$B$'. We might simply offer:
	\begin{ekey}
		\item[Bx] \gap{x} is in Germany
	\end{ekey}
Now we have an interpretation where `$\exists x Axx$' is true, but where `$Bd$' is false. So there is an interpretation where `$\exists x Axx \eif Bd$' is false. So `$\exists x Axx \eif Bd$' is not a logical truth.

We can just as easily show that `$\exists xAxx \eif Bd$' is not a contradiction. We need only specify an interpretation in which `$\exists xAxx \eif Bd$' is true; i.e., an interpretation in which either `$\exists x Axx$' is false or `$Bd$' is true. Here is one:
	\begin{ekey}
		\item[\text{domain}] Paris
		\item[d] Paris
		\item[Axy] \gap{x} is identical with \gap{y}
		\item[Bx] \gap{x} is in France
	\end{ekey}
This shows that there is an interpretation where `$\exists xAxx \eif Bd$' is true. So `$\exists x Axx \eif Bd$' is not a contradiction.

\section{Logical equivalence}
Suppose we want to show that `$\forall x Sx$' and `$\exists x Sx$' are not logically equivalent. We need to construct an interpretation in which the two sentences have different truth values; we want one of them to be true and the other to be false. We start by specifying a domain. Again, we make the domain small so that we can specify extensions easily. In this case, we will need at least two objects. (If we chose a domain with only one member, the two sentences would end up with the same truth value. In order to see why, try constructing some partial interpretations with one-member domains.) For concreteness, let's take:
	\begin{ekey}
		\item[\text{domain}] Ornette Coleman, Miles Davis
	\end{ekey}
We can make `$\exists x Sx$' true by including something in the extension of `$S$', and we can make `$\forall x Sx$' false by leaving something out of the extension of `$S$'. For concreteness we will offer:
	\begin{ekey}
		\item[Sx] \gap{x} plays saxophone
	\end{ekey}
Now `$\exists x Sx$' is true, because `$Sx$' is true of Ornette Coleman. Slightly more precisely, extend our interpretation by allowing `$c$' to name Ornette Coleman.  `$Sc$' is true in this extended interpretation, so `$\exists x Sx$' was true in the original interpretation. Similarly, `$\forall x Sx$' is false, because `$Sx$' is false of Miles Davis. Slightly more precisely, extend our interpretation by allowing `$d$' to name Miles Davis, and `$Sd$' is false in this extended interpretation, so `$\forall x Sx$' was false in the original interpretation. We have provided a counter-interpretation to the claim that `$\forall x Sx$' and `$\exists x Sx$' are logically equivalent.
	\factoidbox{
		To show that $\meta{A}$ is not a logical truth, it suffices to find an interpretation where $\meta{A}$ is false.

		To show that $\meta{A}$ is not a contradiction, it suffices to find an interpretation where $\meta{A}$ is true.

		To show that $\meta{A}$ and $\meta{B}$ are not logically equivalent, it suffices to find an interpretation where one is true and the other is false.
	}

\section{Validity, entailment and consistency}
To test for validity, entailment, or consistency, we typically need to produce interpretations that determine the truth value of several sentences simultaneously.

Consider the following argument in FOL:
$$\exists x(Gx \eif Ga) \therefore \exists x Gx \eif Ga$$
To show that this is invalid, we must make the premise true and the conclusion false. The conclusion is a conditional, so to make it false, the antecedent must be true and the consequent must be false. Clearly, our domain must contain two objects. Let's try:
	\begin{ekey}
		\item[\text{domain}] Karl Marx, Ludwig von Mises
		\item[Gx] \gap{x} hated communism
		\item[a] Karl Marx
	\end{ekey}
Given that Marx wrote \emph{The Communist Manifesto}, `$Ga$' is plainly false in this interpretation. But von Mises famously hated communism, so `$\exists x Gx$' is true in this interpretation. Hence `$\exists x Gx \eif Ga$' is false, as required.

Does this interpretation make the premise true? Yes it does! Note that `$Ga \eif Ga$' is true. (Indeed, it is a logical truth.) But then certainly `$\exists x (Gx \eif Ga)$' is true, so the premise is true, and the conclusion is false, in this interpretation. The argument is therefore invalid.

In passing, note that we have also shown that `$\exists x(Gx \eif Ga)$' does \emph{not} entail `$\exists x Gx \eif Ga$'. Equally, we have shown that the sentences `$\exists x (Gx \eif Ga)$' and `$\enot (\exists x Gx \eif Ga)$' are jointly consistent.

Let's consider a second example. Consider:
	$$\forall x \exists y Lxy \therefore \exists y \forall x Lxy$$
Again, we want to show that this is invalid. To do this, we must make the premises true and the conclusion false. Here is a suggestion:
	\begin{ekey}
		\item[\text{domain}] UK citizens currently in a civil partnership with another UK citizen
		\item[Lxy] \gap{x} is in a civil partnership with \gap{y}
	\end{ekey}
The premise is clearly true on this interpretation. Anyone in the domain is a UK citizen in a civil partnership with some other UK citizen. That other citizen will also, then, be in the domain. So for everyone in the domain, there will be someone (else) in the domain with whom they are in a civil partnership. Hence `$\forall x \exists y Lxy$' is true. However, the conclusion is clearly false, for that would require that there is some single person who is in a civil partnership with everyone in the domain, and there is no such person, so the argument is invalid. We observe immediately that the sentences `$\forall x \exists y Lxy$' and `$\enot\exists y \forall x Lxy$' are jointly consistent and that `$\forall x \exists y Lxy$' does not entail `$\exists y \forall x Lxy$'.

For our third example, we'll mix things up a bit. In \S\ref{s:Interpretations}, we described how we can present some interpretations using diagrams. For example:
\begin{center}
\begin{tikzpicture}
\node (atom1) at (0,2) {1};
\node (atom2) at (2,2) {2};
\node (atom3) at (2,0) {3};
\draw[->, thick] (atom1)--(atom2);
\draw[->, thick] (atom1)--(atom3);
\draw[->, thick] (atom1)+(-0.15,0.15) arc (-330:-30:.3);
\draw[->, thick] (atom2) -- (atom3);
\end{tikzpicture}
\end{center}
Using the conventions employed in \S\ref{s:Interpretations}, the domain of this interpretation is the first three positive whole numbers, and `$Rxy$' is true of x and y just in case there is an arrow from x to y in our diagram. Here are some sentences that the interpretation makes true:
	\begin{ebullet}
		\item `$\forall x \exists y Ryx$'
		\item `$\exists x \forall y Rxy$' \hfill witness 1
		\item `$\exists x \forall y (Ryx \eiff x = y)$' \hfill witness 1
		\item `$\exists x \exists y \exists z ((\enot y = z \eand Rxy) \eand Rzx)$' \hfill witness 2
		\item `$\exists x \forall y \enot Rxy$' \hfill witness 3
		\item `$\exists x (\exists y Ryx \eand \enot \exists y Rxy)$' \hfill witness 3
	\end{ebullet}
This immediately shows that all of the preceding six sentences are jointly consistent. We can use this observation to generate \emph{invalid} arguments, e.g.:
	\begin{align*}
		\forall x \exists y Ryx, \exists x \forall y Rxy  &\therefore  \forall x \exists y Rxy\\
		\exists x \forall y Rxy, \exists x \forall y \enot Rxy & \therefore \enot \exists x \exists y \exists z (\enot y = z \eand (Rxy \eand Rzx))
	\end{align*}
and many more besides.

	\factoidbox{
	To show that $\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n \therefore \meta{C}$ is invalid, it suffices to find an interpretation where all of $\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n$ are true and where $\meta{C}$ is false.

	That same interpretation will show that $\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n$ do not entail $\meta{C}$.

	It will also show that $\meta{A}_1, \meta{A}_2, \ldots, \meta{A}_n, \enot \meta{C}$ are jointly consistent.}
When you provide an interpretation to refute a claim---to logical truth, say, or to entailment---this is sometimes called providing a \emph{counter-interpretation} (or providing a \emph{counter-model}).

\practiceproblems

\solutions
\problempart
\label{pr.Contingent}
Show that each of the following is neither a logical truth nor a contradiction:
\begin{earg}
\item \leftsolutions\ $Da \eand Db$
\item \leftsolutions\ $\exists x Txh$
\item \leftsolutions\ $Pm \eand \enot\forall x Px$
\item $\forall z Jz \eiff \exists y Jy$
\item $\forall x (Wxmn \eor \exists yLxy)$
\item $\exists x (Gx \eif \forall y My)$
\item $\exists x (x = h \eand x = i)$
\end{earg}

\solutions
\problempart
\label{pr.NotEquiv}
Show that the following pairs of sentences are not logically equivalent.
\begin{earg}
\item $Ja$, $Ka$
\item $\exists x Jx$, $Jm$
\item $\forall x Rxx$, $\exists x Rxx$
\item $\exists x Px \eif Qc$, $\exists x (Px \eif Qc)$
\item $\forall x(Px \eif \enot Qx)$, $\exists x(Px \eand \enot Qx)$
\item $\exists x(Px \eand Qx)$, $\exists x(Px \eif Qx)$
\item $\forall x(Px\eif Qx)$, $\forall x(Px \eand Qx)$
\item $\forall x\exists y Rxy$, $\exists x\forall y Rxy$
\item $\forall x\exists y Rxy$, $\forall x\exists y Ryx$
\end{earg}

\problempart
Show that the following sentences are jointly consistent:
\begin{earg}
\item $Ma, \enot Na, Pa, \enot Qa$
\item $Lee, Leg, \enot Lge, \enot Lgg$
\item $\enot (Ma \eand \exists x Ax), Ma \eor Fa, \forall x(Fx \eif Ax)$
\item $Ma \eor Mb, Ma \eif \forall x \enot Mx$
\item $\forall y Gy, \forall x (Gx \eif Hx), \exists y \enot Iy$
\item $\exists x(Bx \eor Ax), \forall x \enot Cx, \forall x\bigl[(Ax \eand Bx) \eif Cx\bigr]$
\item $\exists x Xx, \exists x Yx, \forall x(Xx \eiff \enot Yx)$
\item $\forall x(Px \eor Qx), \exists x\enot(Qx \eand Px)$
\item $\exists z(Nz \eand Ozz), \forall x\forall y(Oxy \eif Oyx)$
\item $\enot \exists x \forall y Rxy, \forall x \exists y Rxy$
\item $\enot Raa$, $\forall x (x=a \eor Rxa)$
\item $\forall x\forall y\forall z[(x=y \eor y=z )\eor x=z]$, $\exists x\exists y\ \enot x= y$
\item $\exists x\exists y((Zx \eand Zy )\eand x=y)$, $\enot Zd$, $d=e$
\end{earg}

\problempart
Show that the following arguments are invalid:
\begin{earg}
\item $\forall x(Ax \eif Bx) \therefore \exists x Bx$
\item $\forall x(Rx \eif Dx), \forall x(Rx \eif Fx) \therefore \exists x(Dx \eand Fx)$
\item $\exists x(Px\eif Qx) \therefore \exists x Px$
\item $Na \eand Nb \eand Nc \therefore \forall x Nx$
\item $Rde, \exists x Rxd \therefore Red$
\item $\exists x(Ex \eand Fx), \exists x Fx \eif \exists x Gx \therefore \exists x(Ex \eand Gx)$
\item $\forall x Oxc, \forall x Ocx \therefore \forall x Oxx$
\item $\exists x(Jx \eand Kx), \exists x \enot Kx, \exists x \enot Jx \therefore \exists x(\enot Jx \eand \enot Kx)$
\item $Lab \eif \forall x Lxb, \exists x Lxb \therefore Lbb$
\item $\forall x(Dx \eif \exists y Tyx) \therefore \exists y \exists z\ \enot y= z$
\end{earg}

\chapter{Reasoning about all interpretations}

\section{Logical truths and contradictions}
We can show that a sentence is \emph{not} a logical truth just by providing one carefully specified interpretation: an interpretation in which the sentence is false. To show that something is a logical truth, on the other hand, it would not be enough to construct ten, one hundred, or even a thousand interpretations in which the sentence is true. A sentence is only a logical truth if it is true in \emph{every} interpretation, and there are infinitely many interpretations. We need to reason about all of them, and we cannot do this by dealing with them one by one!

Sometimes, we can reason about all interpretations fairly easily. For example, we can offer a relatively simple argument that `$Raa\eiff Raa$' is a logical truth:
	\begin{quote}
		\label{allmodels1}
		Any relevant interpretation will give `$Raa$' a truth value. If `$Raa$' is true in an interpretation, then `$Raa \eiff Raa$' is true in that interpretation. If `$Raa$' is false in an interpretation, then `$Raa \eiff Raa$' is true in that interpretation. These are the only alternatives. So `$Raa \eiff Raa$' is true in every interpretation. Therefore, it is a logical truth.
	\end{quote}
This argument is valid, of course, and its conclusion is true. However, it is not an argument in FOL. Rather, it is an argument in English \emph{about} FOL: it is an argument in the metalanguage.

Note another feature of the argument. Since the sentence in question contained no quantifiers, we did not need to think about how to interpret `$a$' and `$R$'; the point was just that, however we interpreted them, `$Raa$' would have some truth value or other. (We could ultimately have given the same argument concerning TFL sentences.)

Here is another bit of reasoning. Consider the sentence `$\forall x(Rxx\eiff Rxx)$'. Again, it should obviously be a logical truth, but to say precisely why is quite a challenge. We cannot say that `$Rxx \eiff Rxx$' is true in every interpretation, since `$Rxx \eiff Rxx$' is not even a \emph{sentence} of FOL (remember that `$x$' is a variable, not a name). So we have to be a bit cleverer.
	\begin{quote}
		Consider some arbitrary interpretation. Consider some arbitrary member of the domain, which, for convenience, we will call \emph{obbie}, and suppose we extend our original interpretation by adding a new name, `$c$', to name \emph{obbie}. Then either `$Rcc$' will be true or it will be false. If `$Rcc$' is true, then `$Rcc \eiff Rcc$' is true. If `$Rcc$' is false, then `$Rcc \eiff Rcc$' will be true. So either way, `$Rcc \eiff Rcc$' is true. Since there was nothing special about \emph{obbie}---we might have chosen any object---we see that no matter how we extend our original interpretation by allowing `$c$' to name some new object, `$Rcc \eiff Rcc$' will be true in the new interpretation. So `$\forall x (Rxx \eiff Rxx)$' was true in the original interpretation. But we chose our interpretation arbitrarily, so `$\forall x (Rxx \eiff Rxx)$' is true in every interpretation. It is therefore a logical truth.
	\end{quote}
This is quite longwinded, but, as things stand, there is no alternative. In order to show that a sentence is a logical truth, we must reason about \emph{all} interpretations.

\section{Other cases}
Similar points hold of other cases too. Thus, we must reason about all interpretations if we want to show:
	\begin{ebullet}
		\item that a sentence is a contradiction; for this requires that it is false in \emph{every} interpretation.
		\item that two sentences are logically equivalent; for this requires that they have the same truth value in \emph{every} interpretation.
		\item that some sentences are jointly inconsistent; for this requires that there is no interpretation in which all of those sentences are true together; i.e.\ that, in \emph{every} interpretation, at  least one of those sentences is false.
		\item that an argument is valid; for this requires that the conclusion is true in \emph{every} interpretation where the premises are true.
		\item that some sentences entail another sentence.
	\end{ebullet}
The problem is that, with the tools available to you so far, reasoning about all interpretations is a serious challenge! Let's take just one more example. Here is an argument which is obviously valid:
	$$\forall x(Hx \eand Jx) \therefore \forall x Hx$$
After all, if everything is both H and J, then everything is H. But we can only show that the argument is valid by considering what must be true in every interpretation in which the premise is true. To show this, we would have to reason as follows:
	\begin{quote}
		Consider an arbitrary interpretation in which the premise `$\forall x(Hx \eand Jx)$' is true. It follows that, however we expand the interpretation with a new name, for example `$c$', `$Hc \eand Jc$' will be true in this new interpretation. `$Hc$' will, then, also be true in this new interpretation. But since this held for \emph{any} way of expanding the interpretation, it must be that `$\forall x Hx$' is true in the old interpretation. We've assumed nothing about the interpretation except that it was one in which `$\forall x(Hx \eand Jx)$'  is true, so any interpretation in which `$\forall x(Hx \eand Jx)$' is true is one in which `$\forall x Hx$' is true. The argument is valid!
\end{quote}
Even for a simple argument like this one, the reasoning is somewhat complicated. For longer arguments, the reasoning can be extremely torturous.

The following table summarises whether a single (counter-)interpretation suffices, or whether we must reason about all interpretations.

\begin{center}
\begin{tabular}{l l l}
%\cline{2-3}
 & \textbf{Yes} & \textbf{No}\\
 \hline
%\cline{2-3}
logical truth? & all interpretations & one counter-interpretation\\
contradiction? &  all interpretations  & one counter-interpretation\\
equivalent? & all interpretations & one counter-interpretation\\
consistent? & one interpretation & all interpretations\\
valid? & all interpretations & one counter-interpretation\\
entailment? & all interpretations & one counter-interpretation\\
\end{tabular}
\end{center}
\label{table.ModelOrArgument}

This might usefully be compared with the table at the end of \S\ref{s:PartialTruthTable}. The key difference resides in the fact that TFL concerns truth tables, whereas FOL concerns interpretations. This difference is deeply important, since each truth-table only ever has finitely many lines, so that a complete truth table is a relatively tractable object. By contrast, there are infinitely many interpretations for any given sentence(s), so that reasoning about all interpretations can be a deeply tricky business.