% use [nosolutions] flag to hide solutions.
% use [solutions] flag to show solutions.
\documentclass[
	solutions,
	singlenumbering
]{../../resources/ormc_handout}

\usepackage{ifthen}
\usetikzlibrary{
	knots,
	hobby,
	decorations.pathreplacing,
	shapes.geometric,
	calc
}

\newif{\ifShowKnots}
\ShowKnotsfalse
%\ShowKnotstrue

% Knot debugging.
% Set to true to show knot info
\newif{\ifDebugKnot}
\DebugKnottrue
\DebugKnotfalse

\ifDebugKnot
	\tikzset{
		knot diagram/draft mode = crossings,
		knot diagram/only when rendering/.style = {
			show curve endpoints,
			%show curve controls
		}
	}
\fi


% From "Why knot" by
%
% Create largest crossing number with cord
% Human knot number: how many humans do you need to make the knot?
% Human knot number for trefoil composition?
%	(looks like a wrap around center string)
%
% Figure-8 knot: mirror without letting go


\tikzset{
	knot diagram/every strand/.append style={
		line width = 0.8mm,
		black
	},
	show curve controls/.style={
		postaction=decorate,
		decoration={
			show path construction,
			curveto code={
				\draw[blue, dashed]
					(\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta)
					node [at end, draw, solid, red, inner sep=2pt]{}
				;

				\draw[blue, dashed]
					(\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast)
					node [at start, draw, solid, red, inner sep=2pt]{}
					node [at end, fill, red, ellipse, inner sep=2pt]{}
				;
			}
		}
	},
	show curve endpoints/.style={
		postaction=decorate,
		decoration={
			show path construction,
			curveto code={
				\node [fill, blue, ellipse, inner sep=2pt] at (\tikzinputsegmentlast) {};
			}
		}
	}
}

%\usepackage{lua-visual-debug}

\begin{document}

	\maketitle
		<Advanced 2>
		<Spring 2023>
		{Knots}
		{
			Prepared by Mark on \today
		}

	\section{Introduction}

	\definition{}
	To form a \textit{knot}, take a string, tie a knot, then join the ends. \par
	You can also think of a knot as a path in three-dimensional space that doesn't intersect itself:

	\vspace{2mm}

	\begin{center}
		\begin{minipage}[t]{0.3\textwidth}
		\begin{center}
			\begin{tikzpicture}[scale = 0.8, baseline=(p)]
			\begin{knot}
				\strand
					(1,2) .. controls +(-45:1) and +(1,0) ..
					(0, 0) .. controls +(-1,0) and +(-90 -45:1) ..
					(-1,2);
			\end{knot}

			\coordinate (p) at (current bounding box.center);
			\end{tikzpicture}
		\end{center}
		\end{minipage}
		\hfill
		\begin{minipage}[t]{0.3\textwidth}
		\begin{center}
			\begin{tikzpicture}[scale = 0.8, baseline=(p)]

			% Knot is stupid and includes invisible handles in the tikz bounding box. This line crops the image to fix that.
			\clip (-2,-1.7) rectangle + (4, 4);

			\begin{knot}[
				consider self intersections=true,
				flip crossing = 2,
			]
				\strand
					(1,2) .. controls +(-45:1) and +(120:-2.2) ..
					(210:2) .. controls +(120:2.2) and +(60:2.2) ..
					(-30:2) .. controls +(60:-2.2) and +(-90 -45:1) ..
					(-1,2);
			\end{knot}

			\coordinate (p) at (current bounding box.center);


			\end{tikzpicture}
		\end{center}
		\end{minipage}
		\hfill
		\begin{minipage}[t]{0.3\textwidth}
			\begin{center}
				\begin{tikzpicture}[scale = 0.8, baseline=(p)]

				\clip (-2,-1.7) rectangle + (4, 4);


				\begin{knot}[
					consider self intersections=true,
					flip crossing = 2,
				]
					\strand
						(0,2) .. controls +(2.2,0) and +(120:-2.2) ..
						(210:2) .. controls +(120:2.2) and +(60:2.2) ..
						(-30:2) .. controls +(60:-2.2) and +(-2.2,0) ..
						(0,2);
				\end{knot}

				\coordinate (p) at (current bounding box.center);

				\end{tikzpicture}
			\end{center}
			\end{minipage}
	\end{center}

	If two knots may be deformed into each other without cutting, we say they are \textit{isomorphic}. \par
	If two knots are isomorphic, they are essentially the same knot.

	\definition{}
	The simplest knot is the \textit{unknot}. It is show below on the left. \par
	The simplest nontrivial knot is the \textit{trefoil} knot, shown to the right.

	\begin{center}
		\begin{minipage}[t]{0.48\textwidth}
		\begin{center}
			\begin{tikzpicture}[baseline=(p), scale = 0.8]
			\begin{knot}
				\strand
					(0,2) .. controls +(1.5,0) and +(1.5,0) ..
					(0, 0) .. controls +(-1.5,0) and +(-1.5,0) ..
					(0,2);
			\end{knot}

			\coordinate (p) at (current bounding box.center);
			\end{tikzpicture}
		\end{center}
		\end{minipage}
		\hfill
		\begin{minipage}[t]{0.48\textwidth}
		\begin{center}
		\begin{tikzpicture}[baseline=(p), scale = 0.8]

			\clip (-2,-1.7) rectangle + (4, 4);

			\begin{knot}[
				consider self intersections=true,
				flip crossing = 2,
			]
				\strand
					(0,2) .. controls +(2.2,0) and +(120:-2.2) ..
					(210:2) .. controls +(120:2.2) and +(60:2.2) ..
					(-30:2) .. controls +(60:-2.2) and +(-2.2,0) ..
					(0,2);
			\end{knot}
			\coordinate (p) at (current bounding box.center);

			\end{tikzpicture}
		\end{center}
		\end{minipage}
	\end{center}

	\vfill
	\pagebreak

	\problem{}
	Below are the only four distinct knots with only one crossing. \par
	Show that no nontrivial knot can have has fewer than three crossings. \par
	\hint{There are 4 such knots. What are they?}

	\begin{center}
		\includegraphics[width=0.8\linewidth]{images/one crossing.png}
	\end{center}

	\begin{solution}
		Draw all four. Each is isomorphic to the unknot.
	\end{solution}

	\vfill

	\problem{}
	Show that this is the unknot. \par
	A wire or an extension cord may help.

	\begin{center}
		\includegraphics[width=0.35\linewidth]{images/big unknot.png}
	\end{center}


	\definition{}
	As we said before, there are many ways to draw the same knot. \par
	We call each drawing a \textit{projection}. Below are four projections of the \textit{figure-eight} knot.


	\vspace{2mm}
	\begin{center}
		\includegraphics[width=0.8\linewidth]{images/figure eight.png}
	\end{center}
	\vspace{2mm}

	\problem{}
	Convince yourself that these are equivalent.

	\vfill
	\pagebreak


	\section{Knot Composition}

	Say we have two knots $A$ and $B$.
	The knot $A \boxplus B$ is created by cutting $A$ and $B$ and joining their ends:

	\begin{center}
		\hfill
		\begin{minipage}[t]{0.15\textwidth}
		\begin{center}
			\includegraphics[width=\linewidth]{images/composition a.png}
			$A$
		\end{center}
		\end{minipage}
		\hfill
		\begin{minipage}[t]{0.13\textwidth}
		\begin{center}
			\includegraphics[width=\linewidth]{images/composition b.png}
			$B$
		\end{center}
		\end{minipage}
		\hfill
		\begin{minipage}[t]{0.3\textwidth}
		\begin{center}
			\includegraphics[width=\linewidth]{images/composition c.png}
			$A \boxplus B$
		\end{center}
		\end{minipage}
		\hfill~
	\end{center}

	We must be careful to avoid new crossings when composing knots:

	\vspace{2mm}
	\begin{center}
		\includegraphics[width=0.45\linewidth]{images/composition d.png}
	\end{center}
	\vspace{2mm}

	We say a knot is \textit{composite} if it can be obtained by composing two other knots. \par
	We say a knot is \textit{prime} otherwise.

	\problem{}
	For any knot $K$, what is $K \boxplus \text{unknot}$?

	\vfill

	\problem{}
	Use a pencil or a cord to compose the figure-eight knot with itself.

	\vfill

	\vfill
	\pagebreak{}

	\problem{}
	The following knots are composite. What are their prime components? \par
	Try to make them with a cord! \par
	\hint{Use the table at the back of this handout to decompose the second knot.}

	\begin{center}
		\hfill
		\includegraphics[height=30mm]{images/decompose a.png}
		\hfill
		\includegraphics[height=30mm]{images/decompose b.png}
		\hfill~\par
		\vspace{4mm}
	\end{center}

	\begin{solution}
		The first is easy, it's the trefoil composed with itself. \par

		\vspace{2mm}

		The second is knot $5_2$ composed with itself. \par
		Note that the \say{three-crossing figure eight} is another projection of $5_2$. \par
		The figure-eight knot is NOT a part of this composition. Look closely at its crossings.
	\end{solution}

	\vfill
	\pagebreak

	\input{parts/table}


\end{document}