\chapter{Transfer and $p-$complements}
\section{Transfer}
{\bf Definition 1:}  Suppose $G$ is a finite group and $H$ is a subgroup, $|G:H|=n$.
Let $ \langle r_1, \ldots, r_n \rangle $ be a right transversal so $G= \bigcup_{i=1}^n Hr_n$ and
$Hr_i \cap Hr_j = \emptyset$ if $i \ne j$.  Suppose $r_i g= h_i(g) r_j$.
The \emph {transfer} map from $G$ to $H$ is defined as
$V_{G \rightarrow H}(g)= \prod_{i=1}^n h_i(g) \jmod {H'}$.
\\
\\
{\bf Definition 2:} $Foc_G(H)= \langle y^{-1} y^g: y, y^g \in H \rangle $,
thus $H' \le Foc_G(H) \le H \cap G'$.
\\
\\
{\bf Theorem 1:}
The map $V_{G \rightarrow H}$ is well defined and is a homomorphism.
\begin{quote}
\emph{Proof:}
Let
$T= \{ t_1 , t_2 , \ldots , t_n \}$ and
$T'= \{ t_1' , t_2' , \ldots , t_n' \}$ be two transversals for $G/H$.
$\exists k_i \in H: t_i'= k_i t_i$.  If
$t_i g = h_i(g) t_j$ and
$t_i' g = h_i'(g) t_j'$, $t_i g= k_i^{-1} h_i(g)' k_j^{-1}$ and $k_i^{-1} h_i(g)' k_j = h_i(g)$.
For each $g$, each $k_i^{-1}, k_j$ occur once when $h_i(g)$ is calculated the cosets.
$\prod_{i=1}^n h_i(g) = \prod_{i=1}^n k_i^{-1} h_i(g)' k_j \jmod{H'}$ but the elements of $H$
commute $\jmod{H'}$ and all the $k_i's$ cancel thus
$\prod_{i=1}^n h_i(g) = \prod_{i=1}^n  h_i(g)' \jmod{H'}$ and
thus $V_{G \rightarrow H}$ is well defined.
\\
\\
Now
$V_{G \rightarrow H}(g_1 g_2)= \prod_{i=1}^n h_i(g_1 g_2) \jmod {H'}$.
$t_i g_1 g_2 = h_i(g_1 g_2) t_j = h_i(g_1) t_k g_2 = h_i(g_1) h_k(g_2) t_j$. So
$V_{G \rightarrow H}(g_1 g_2) = $
$\prod_{i=1}^n h_i(g_1 g_2) =$ $ \prod_{i=1, k=1}^n h_i(g_1) h_k(g_2) \jmod{H'} =$
$(\prod_{i=1}^n h_i(g_1) \jmod{H'})$ $(\prod_{k=1}^n h_k(g_2) \jmod{H'}$
$= V_{G \rightarrow H}(g_1) V_{G \rightarrow H}(g_2)$,
thus, $V_{G \rightarrow H}$ is a homomorphism.
\end{quote}
{\bf Theorem 2:}
$V_{G \rightarrow H}(g)= \prod_{i=1}^k  h_j \jmod {H'}
= \prod_{i=1}^k  r_i g^{n_i}{r_i}^{-1} \jmod {H'}$.  Further, $\sum_{i=1}^h n_i = |G:H|$.
\begin{quote}
\emph{Proof:}
For fixed $g \in G$, we can pick the transversal
$Hr_1, H r_1, \ldots, H r_1 g^{n_1 -1}$,
$Hr_2, H r_2, \ldots, H r_2 g^{n_2 -1}$, \ldots,
$Hr_k, H r_k, \ldots, H r_k g^{n_k -1}$, where $r_j g^{n_j} = h_j r_j$ for
some, $h_j= r_j g^{n_j}{r_j}^{-1}$. So
$V_{G \rightarrow H}(g)= \prod_{i=1}^k  h_j \jmod {H'}
= \prod_{i=1}^k  r_i g^{n_i}{r_i}^{-1} \jmod {H'}$.  Further, $\sum_{i=1}^h n_i = |G:H|$.
\end{quote}
{\bf Theorem 3:}
If $Z$ is a central subgroup of $G$, $|G:Z|=n$ then
$V_{G \rightarrow Z}(g)= g^n$
\begin{quote}
\emph{Proof:}
Choose a right transversal, $T$ for $Z$ in $G$ and let $g \in G$.  Choose $T_0 \subseteq T$
and integers $n_t$ for $t \in T_0$.  For $t \in T_0$, we have
$t g^{n_t} t^{-1} \in Z$
and thus
$t^{-1} t g^{n_t} t^{-1} t= g^{n_t}$ and the product over all these is $g^{\sum_t n_t}= g^n$.
\end{quote}
{\bf Lemma A:}
Let $T$ be a right transversal for $Z={\mathbb Z}(G)$ in $G$, then every commutator in $G$
is of the form $[s,t], s,t \in T$.  So if $|G:Z|$ is finite, there are only finitely
many commutators.
\begin{quote}
\emph{Proof:}    The second statement follows from the first since $|T|= |G:{\mathbb Z}(G)$.
If $g \in G, g= xs, x \in {\mathbb Z}(G), t \in T$.  So it suffices to show
$[xs,yt]=[s,t]$  with $x, y \in {\mathbb Z}(G)$ and $s, t \in T$.  So
$[xs,yt]= [x,yt]^s [s,yt]= [s,yt]$.  Also,
$[s,yt]= [yt,s]^{-1}= ([y,s]^t [t,s]^{-1}= [t,s]^{-1}=[s,t]$.
\end{quote}
{\bf Theorem 4:}
If $|G:{\mathbb Z}(G)|=n$ then $[g,h]^n=1, \forall g,h \in G$.
\begin{quote}
\emph{Proof:}
The map $g \mapsto g^n$ is a homomorphism from $G$ into ${\mathbb Z}(G)$ and so $G'$ is
in the kernel.
\end{quote}
{\bf Theorem 5:}
Let $X$ be a finite subseteq of $G$ closed under conjugation and
suppose $\exists n: x^n = 1, \forall x \in X$ then $ \langle X \rangle $ is a
finite subgroup of $G$.
\begin{quote}
\emph{Proof:}
Let $S$ be the subseteq of $G$ of all products of finitely many elements of $X$.  $S$
is closed under multiplication.  Since $x^n=1$, $x^{n-1}= x^{-1} \in S$ and
$ \langle X \rangle = S$.
\emph{Claim:} Such an expression in $S$ never requires more than $(n-1) |X|$ factors.  The result
follows from the claim.
\\
\emph {Proof of claim:} Put $g= x_1 x_2 \ldots x_m$. Suppose an element of $x \in X$ occurs $k$
times.  We now that $g$ can be rewritten with leading factor $x$ with $x$ occuring no more than
$k$ times.  To show this, assume $t$ is the smallest index for which $x=x_t$.
If $t=1$, we're done.
$x_1 x_2 \ldots x_t = x(x_1 \ldots x_{t-1})^x= x (x_1^x) \ldots (x_{t-1}^x)$, this is
a product of $t$ elements of $X$ since $X$ is closed under conjugation. We can continue and
extract all copies of $x$ to the front.  Since $x^n=1$, the exponent of $x$ is $\le n-1$.
\end{quote}
{\bf Schur's Theorem:}
Suppose $|G:{\mathbb Z}(G)| < \infty$ then $|G'|< \infty$.
\begin{quote}
\emph{Proof:}
Let $X$ be the set of all commutators of $G$ and observe $|X|$ is finite.  Also,
$[x,y]^g= [x^g, y^g]$.
$x^{|G:{\mathbb Z }(G)|}=1$ and the result follows from the previous result.
\end{quote}
{\bf Theorem 6:} Let $p \mid |G| < \infty$ and $p \mid |G' \cap {\mathbb Z}(G)|$, then
the Sylow $p$-subgroup of $G$ is nonabelian.
\begin{quote}
\emph{Proof:}
Suppose $P \in S_p(G)$ is abelian and let $T$ be a right transversal.  Put
$v(g)= V_{G \rightarrow P}(g)$. Let $Z= {\mathbb Z}(G)$.
$G' \cap Z \cap P > 1$ since $G' \cap Z \lhd G$.
For $t \in T, z \in G' \cap Z \cap P$, $Ptz=Pzt=Pt$ so $t$ is the element in $Ptz$ and
$t \cdot z= t$.  Thus, $tz(t \cdot z)^{-1}= tzt^{-1}=z$ and $v(z)= z^{|T|}=z^{|G:P|}$.
We know, since $P$ is abelian that $G' \subseteq ker(v)$. So
$z \in G'\rightarrow 1=v(z)=z^{|G:P|}$.  Thus $z=1$.  This contradicts the choice of $z$.
\end{quote}
{\bf Theorem 7:} Let $Z < {\mathbb Z}(\Gamma)$, $\Gamma$, finite, then a Sylow $p$-subgroup of
$\Gamma/Z$ is non-cyclic for all $p \mid |Z|$.
\begin{quote}
\emph{Proof:}
Let $P \in S_p( \Gamma )$, $p \mid |Z|$ and $Z \subseteq {\mathbb Z}( \Gamma ) \cap \Gamma'$
so by the foregoing, $P$ is not abelian.  Since $P \cap Z \subseteq {\mathbb Z}(P)$ and
$P$ is not abelian, $P/(P \cap Z)$ cannot be cyclic.
But $P/(P \cap Z) \cong PZ/Z \in S_p(\Gamma/Z)$ and so $\Gamma/Z$ has a
non-cyclic Sylow $p$-subgroup.
\end{quote}
{\bf Observation:} Note that $\Gamma$ is a central extension of $G$ if $\Gamma/Z \cong G$.
In the case $Z \cong M(G)$ (the Schur multiplier), $\Gamma$ is a Schur representation group and
if $G$ is perfect, this representation group is unique.
If $G= \langle x \rangle , x^4=1$, $|M(G)|=2$.  The
theorem shows, for example, that $|M(A_5)|=2$
\\
\\
{\bf Definition 3:} $A^p(G)$ is the smallest normal subgroup of $G$ such that
$G/A^p(G)$ is an abelian $p$-group.  If $P$ is a Hall $\pi$ subgroup of $G$,
we use $G(\pi)$ to denote the inverse image of $O_{\pi}(G/G')$.
\\
\\
{\bf Focal Subgroup Theorem:}
If $P \in S_p(G)$, $Foc_G(P) = P \cap G' = P \cap A^p(G) = ker(V_{G \rightarrow P})$.
\begin{quote}
\emph{Proof:}
$Foc_G(P) \subseteq  P \cap G' \subseteq  P \cap A^p(G)  \subseteq ker(V_{G \rightarrow P})$ is
easy.  So if we prove
$ker(V_{G \rightarrow P}) \subseteq Foc_G(P)$, we're done.  Let $x \in ker(V_{G \rightarrow P})$, so $x \in P'$.
Suppose $\langle Pg_i x, \ldots , P g_i x^{n_i - 1} \rangle$ is an orbit of $x$ acting on $Pg_i$ in $G/P$. So $Pg_i = Pg_i x^{n_i}$,
${g_i}^{-1} x^{n_i} g_i \in P$, and $x^{n_i} \in P$.
We can find a complete set of coset representatives of $P$ in $G$ consisting of such orbits with $g_i \in G, i = 1,2, \ldots, h$.
For each $i$, $x^{n_i} = {g_i}^{-1} x^{n_i} g_i \jmod{Foc_G(P)}$.  So
$V_{G \rightarrow P}(x) \jmod{Foc_G(P)} = \prod_{i=1}^h {g_i}^{-1} x^{n_i} g_i \jmod{Foc_G(P)} = x^{|G:P|} \jmod{Foc_G(H)}$
and  $x^{|G:P|} \in Foc_G(P)$.  Since $P' \subseteq Foc_G(P) \subseteq P$ and $(|x|, |G:P|) =1$, $\exists k_1, k_2: k_1|G:P| + k_2|x| = 1$
so $x = x^{|G:P| k_1} x^{|x| k_2} \in Foc_G(H)$ and all the groups are the same.
\end{quote}
{\bf Theorem 8:}
If $P \in S_p(G)$ then $ker(V_{G \rightarrow P})= A^p(G)$.
\begin{quote}
\emph{Proof:}
Put $K= ker(V_{G \rightarrow P})$, $A= A^p(G)$,  $A \supseteq K$ by the last result.
$|G:K|$ and $|G:A|$ are $p$-powers.  $PK=G=PA$.  By FST, $P \cap K = P \cap A$ and
$|G:K|= |P:P \cap K|= |P: P \cap A|= |G:A|$.  So $|A|= |K|$ and the result holds.
\end{quote}
{\bf Theorem 9:}
Let $H$ be a Hall $\pi$ subgroup of $G$ and $v(g)= V_{G \rightarrow H}(g)$ then
$v(H)=v(G)$ and $|H: H \cap ker(v)|= |G:ker(v)|$.
\begin{quote}
\emph{Proof:}
We know $|G:ker(v)| = |v(G)|$ and since
$v(G) \subseteq H/H'$, we have $|G:ker(v)| \mid |H|$.  $(|G:ker(v)|, |G:H|)=1$ so
$ker(v)H=G$.
\end{quote}
{\bf Theorem 10:}
If $P \in S_p(G)$ then $N_G(P)$ controls $G$-fusion in $C_G(P)$.
\begin{quote}
\emph{Proof:}
Let $c_1 , c_2 \in C_G(P)$ and $c_1^g=c_2$.  Then $c_2 = c_1^g \in C_G(P^g)$
We know $c_2 \in C_G(P)$, so $P, P^g \in C_G(c_2)$ and since they are both
Sylow subgroups of $C_G(c_2)$ by Sylow, $\exists h \in C_G(c_2): P^{gh}=P$ and
hence $gh \in N_G(P)$.  $c_1^{gh}= c_2^h= c_2$ and so $c_1$ and $c_2$ fuse in $N_G(P)$.
\end{quote}
{\bf Theorem 11:}  Let  $P$ be a Hall subgroup of $G$ then $Foc_G(H) = P \cap G(\pi)=P \cap G'$ and
$G/Foc_G(H) \cong G/G(\pi)$, $ker(V_{G \rightarrow P}) = G(\pi)$ and $P/P' = {\overline P} = {\overline {Foc_G(P)}} \times Im(V_{G \rightarrow P})$.
\begin{quote}
\emph{Proof:}  $(|P|,|G:P|) = 1$.  $V_{G \rightarrow P} {\overline {Foc_G(P)}} = \langle {\overline x} \rangle {\overline {Foc_G(P)}}$ as in the
proof of the FST.  Conversely, $G(\pi) \subseteq ker(V_{G \rightarrow P})$ and ${\overline P}$ is abelian so
$Foc_G(P) \leq P \cap G' = P \cap G(\pi) \leq P \cap ker(V_{G \rightarrow P})$.  As before, equality holds
$|G/G(\pi)| \geq |G/ker(V_{G \rightarrow P})| = |Im(V_{G\rightarrow P})|$.
Finally, $P/(P \cap G') \cong G/G(\pi)$,
so $ker(V_{G \rightarrow P}) = G(\pi)$ and $Im(V_{G \rightarrow P}) \cong P/Foc_G(P)$.
${\overline P} = {\overline {Foc_G(P)}} \times Im(V_{G \rightarrow P})$.
\end{quote}
{\bf Corollary:} If $P$ is a Hall $\pi$
group of $G$, $G/G'= PG'/G' \times O_{\pi'}(G/G')$; hence, if $P \ne Foc_G(P)$,
$G \ne O^{\pi'}(G)$.
\begin{quote}
\emph{Proof:}
Follows from Theorem 11.
\end{quote}
{\bf Burnside's Lemma:}  If $P \in S_p(G)$, $A_1, A_2 \subseteq P$ with
$(A_i)^x = A_i, \forall x \in P, i= 1, 2$, then
if $A_1^g=A_2$, then $\exists h \in N_G(P): A_1^h=A_2$. ($N(P)$ controls fusion in $P$.)
\begin{quote}
\emph{Proof:}
Same as the earlier proof about $N_G(P)$ controlling fusion on $C_G(P)$.
\end{quote}
{\bf Definition 4:}
$Z$ is \emph {weakly closed} in $P$ with respect to $G$ if $Z^g \subseteq P \rightarrow Z^G=Z$.
The \emph {weak closure} of $Z$ in $P$ with respect to $G$ is
$wcl_G(Z, P)= \langle Z^g| Z^g \subseteq P \rangle$.
\\
\\
{\bf Theorem 12:}
Let $P \in S_p(G)$ and $Z \subseteq {\mathbb Z}(P)$
is weakly closed in $P$.  Suppose $x \in P$ and $g \in G$ such that
$y^g \in P$.  The $\exists n \in N_G(Z): y^g=y^n$.
\begin{quote}
\emph{Proof:}
Note $y^g \in P \cap P^g$ and $ \langle Z, Z^g \rangle \subseteq C_G(y^g )$.  By Sylow,
$\exists c \in C_G(y^g )$ such that
$ \langle Z^g, Z^c \rangle $ is a $p$-group and $\exists h \in G:
\langle Z^{gh}, Z^{ch} \rangle \le P$.  Since $Z$ is weakly closed in $P$,
$Z^{gh}= Z^{ch}= Z$. So
$n= g c^{-1} \in N_G(Z)$ and since $c \in C(y^g): y^n= y^g$.
\end{quote}
{\bf Grun's Theorem:} If $P \in S_p(G)$ and $Z \subseteq {\mathbb Z}(P)$
is weakly closed in $P$ then
$P/(P \cap G') \approx G/G' (p) \approx N(Z)/N(Z)'$ and so
$G \ne O^p(G) \rightarrow N(Z) \ne O^p(N(Z))$.
\begin{quote}
\emph{Proof:}
This follows from Theorem 12 and Theorem 11.
\end{quote}
{\bf Theorem 13:} If
$P \in S_p(G)$ and $Z \lhd N(P)$ then the following are equivalent:
(1) $Z$ is weakly closed in $P$ with respect to $G$;
(2) $Z \le R \in S_p(G) \rightarrow Z \lhd R$.
\begin{quote}
\emph{Proof:}
\\
(1) implies (2): If $Z \le R = P^{g^{-1}}, g \in G$, then $Z^g \le P$ and $Z=Z^g$.
Hence, $Z^R= Z^{P^{g^{-1}}} = Z$.\\
(2) implies (1):  Let $Z^g \le P$ so by (2), $ \langle Z^g \rangle \lhd P$.
By Burnside, $\exists y \in N_G(P)$
such that  $Z^y=Z^g$ and thus $Z^y=Z^g=Z$.
\end{quote}
{\bf Theorem 13a:}  (1) Let $P \in S_p(G)$ then (1) $\exists K \lhd G: G/K \approx P/ P \cap G'$.
(2) If $K \lhd G$ such that $G/K$ is an abelian $p$-group then $P \cap G' \subseteq K$
and $G/K$ is isomorphic to a homomorphic image of $P/P \cap G'$.
\begin{quote}
\emph{Proof:}  Assume $K \lhd G$ and $G/K$ is an abelian $p$-group.  Then $G' \subseteq K$ and
$G= KP$.  $P \cap G' \subseteq K$ and so $P/P \cap K$ is a homomorphic image of $P/P \cap G'$ and (2)
holds.  For 1, put ${\overline G} = G/Foc_G(P)$ and let
$K$ be the inverse image of $O_{p}({\overline G})$
in $G$.  $P \cap G' \in S_p(G')$.
$P \cap G' = P \cap K, K \lhd G$ and $G/K$ is isomorphic to $P/P \cap G'$ and (1) holds.
\end{quote}
{\bf Burnside's Theorem:}
If $P \in S_p(G)$ and $P \subseteq {\mathbb Z}(N_G(P))$ then $P$ has a normal
$p$-complement.
\begin{quote}
\emph{Proof:}  Put $N=N_G(P)$.  Note that $P$ is abelian so $P \cap Q'= 1, Q \in S_p(G)$.
$P$ is a normal Hall subgroup of $N$ so it has a complement $H$ in $N$.  $N= P \times H$ so
$N' = H'$ so $P \cap N' = P \cap H' = 1$ so by Grun, $P \cap G'=1$.  By previous result, $\exists K:
G/K \approx P/P \cap G'$ thus $K$ is a $p'$-group and $K= O_{p'}(G)$.
\end{quote}
{\bf Another statement of Burnside's Theorem:}
If $P \in S_p(G)$ and $N_G(P) = C_G(P)$ then $G$ has a normal $p$ complement.
\begin{quote}
\emph{Proof:}
$P \leq {\mathbb Z}(N_G(P))$.
\end{quote}
{\bf Theorem 13b:} Suppose Sylow $p$-subgroups of $G$ and $G$ is a semidirect product of $N \lhd G$ and $P$,
$Z \subseteq P$ wiht $Z^g \leq P$. $\exists x \in P: Z^g = Z^x$ so every normal subgroup of $P$ is weakly
closed in $P$.
\begin{quote}
\emph{Proof:}
$g=yx$, $y \in N$ and $x \in P$.
$Z^g \leq P$ so $Z^y \leq P$ so $Z^g = Z^x$.
This shows that $\forall z \in Z, [z,y] \in N \cap P = 1$ and so
$y \in C_G(Z)$ and the result follows.
\end{quote}
{\bf Baer's Theorem:}
$X$ be a $p$-group of $G$ then either
$X \le O_p(G)$ or $\exists g: \langle X, X^g \rangle $ is not a $p$-group.
\begin{quote}
\emph{Proof:}
See the stability section.
\end{quote}
{\bf Theorem 14:} If $Q$ is an abelian sylow subgroup in $G$ and if $Q \subseteq {\mathbb Z}(G)$ then
$V_{G \rightarrow Q}(g)= g^{|G:Q|}, \forall g \in G$.
\begin{quote}
\emph{Proof:}
Let $T$ be the transversal
$T= \{ Qh_1, Qh_1g, \ldots , Qh_1g^{n_1-1}, Qh_2, Qh_2 g^{n_2-1}, \ldots, Qh_m g^{n_t-1} \}$.
$V_{G \rightarrow Q}(g)= \prod_{k=0}^t h_i g_{n_i} h_i^{-1} \jmod{Q'}$.  Since
$g^{n_i}, h_i g^{n_i} h_i^{-1} \in Q \subseteq {\mathbb Z}(G)$,
$V_{G \rightarrow Q}(g)= g_{\sum_{i=1}^t n_i} = g^{|G:Q|}$.
\end{quote}
{\bf Theorem 15:}
If $P \in S_p (G), P'=1$ then $P \cap G' = P \cap N_G(P)'$.
\begin{quote}
\emph{Proof:}
As proved earlier, $N_G(P)$ controls fusion on $C_G(P) \supseteq P$ (since $P$ is abelian).
\end{quote}
{\bf Theorem 16:} If $P \in S_p(G)$ is cyclic where $p$ is the smallest prime divisor of $|G|$,
then $G$ has a normal $p$-complement.
\begin{quote}
\emph{Proof:}
$1 \rightarrow N_G(P)/C_G(P) \rightarrow Aut(P)$ and since $|P|$ is cyclic it has order
$\varphi(|P|)$.  If $|P|= p^n$, $\varphi(|P|)= p^{n-1}p$, this is divisible by no prime
bigger than $p$ and the index is divisible by no prime smaller than $p$.
Since $p \nmid |N_G(P):C_G(P)|$ and since $P$ is abelian it has index $1$, $C_G(P)= N_G(P)$;
thus, $P \subseteq  {\mathbb Z}(N_G(P))$ and by Burnside, $G$ has a normal $p$-complement.
\end{quote}
{\bf Theorem 17:}
If all Sylow subgroups of $G$ are cyclic, $G$ is solvable.
\begin{quote}
\emph{Proof:}
Induction on $|G|$.  Let be $p$ be the smallest prime such that $p \mid |G|$.
$G$ has a normal $p$-complement, $N$, by the previous result.  $N < G$ and all the
Sylow subgroups of $N$ are cyclic.  $N$ is solvable by induction. $G/N$ is a $p$-group
so it is solvable.
\end{quote}
{\bf Theorem 18:}
Suppose all Sylow subgroups of $G$ are cyclic then $(|G'|, |G/G'|)=1$ and both are cyclic.
\begin{quote}
\emph{Proof:}
$G/G'$ is cyclic.  To show $G'$ is cyclic, we proceed by induction on $|G|$.
$G' < G$ so $G''$ is cyclic (by induction).  $Aut(G'')$ is thus abelian and
$1 \rightarrow G/C_G(G'') \rightarrow Aut(G'')$ and $G' \subseteq G_G(G'')$ and
$G'' \subseteq {\mathbb Z}(G') \rightarrow G'$ is abelian and thus $G'$ is cyclic.
\end{quote}
{\bf Theorem 19:}
Let $P$ be a cyclic Sylow subgroup of $G$ then $p$ divides at most one of $|G'|$ and $|G/G'|$.
\begin{quote}
\emph{Proof:}
Let $N=N_G(P)$, $K \subseteq N$ a complement for $P$ in $N$.  $P= [P,K] \times C_P(K)$.
If $[P, K]=1$, $C_P(K)=P$ and $P$ is central in $N=PK$.  By Burnside,
$G$ has a normal $p$-complement, $M$ and $G/M$ is a $p$-group which is cyclic so
$G' \subseteq M$ and $p \nmid |G'|$.
\end{quote}
{\bf Theorem 20:}
Let $P$ be an abelian Sylow subgroup of $G$ then $G' \cap P \cap {\mathbb Z}(N_G(P))=1$.
\begin{quote}
\emph{Proof:}
Let $v:G \rightarrow P$ and $x \in G' \cap P \cap {\mathbb Z}(N_G(P))$ then $x \in G'$ so
$1=v(x)=\prod_{t \in T_0} t x^{n_t} t^{-1} \in P$.  $x^{n_t} , t x^{n_t} t^{-1} \in C_G(P)$ and
$x$ is central so self conjugate in $N_G(P)$.  $x^{n_t}= t x^{n_t} t^{-1}, \forall t \in T_0$,
so, since $|G:P|= \sum_t n_t$, $v(x)= x^{|G:P|}$.  $1= x^{|G:P|}$ and since $x \in P$ then
$x=1$.
\end{quote}
{\bf Theorem 21:}
Suppose the Sylow $2$-subgroups of $G$, $G$ is nonabelian, are direct products of cyclic groups
one of which is strictly larger than the other then $G$ is not simple.
\begin{quote}
\emph{Proof:}
Let $P \in S_2(G)$.  $P= A \times B$ where $A$ is cyclic of order $a \ge 2$ and
$x^{a/2}=1, \forall x \in B$.  Let $C= \{ x^{a/2}: x \in P \} \; char \; P$ so there is
the unique $t \in C$ is central in $N_G(P)$.  $t \notin G'$ so $G' < G$ and the result follows.
\end{quote}
{\bf Gaschutz:}  Let $K$ be a normal abelian $p$-subgroup of a finite group $G$ and let
$P \in S_p(G)$.  Then $K$ has a complement in $G$ iff $K$ has a complement in $P$.
\begin{quote}
\emph{Proof:}
Let $A$ be a complement of $K$ in $U$: $=KA, K \cap A = 1$.
Let ${\cal L}$ be the set of left transversals of $U$ in $G$ and $S_0 \in {\cal L}$.
Then $\forall L \in {\cal L}, l \in L$:
$l=s_l k_l a_l, s_l \in S_0, k_l \in K, a_l \in A$ and $s_l U = lU$ and the factorization is
unique.  Hence
$\forall l \in L, \exists! l_0 \in S_0 K: lU=l_0 U$ (i.e. - $l_0=s_l k_l$).  So every
$L \in {\cal L}$ is associated with $L_0 = \{ l_0 : l \in L \}$ in
${\cal S} = \{ L \in {\cal L}: L \subseteq S_0 K \}$ such that $LA= L_0 A$.  For $x \in G$ and
$xL \in {\cal L}$: $(xL)_0A = xLA = x L_0 A = (xL_0)_0 A$ and thus $(xL)_0 = (x L_0)_0$.
Now define $S^x= (x^{-1} S)_0 = (y^{-1} ( x^{-1} S))_0 = ((xy)^{-1} S)_0 = S^{xy}$.
This defines an action of $G$ on ${\cal S}$.  Now write $(xS)_0$ instead of $S^{x^{-1}}$.
$R|S= \prod_{(r,s) \in R \times S, Kr=Ks} (rs^{-1}), R, S \in {\cal S}$.  For
$kS \subseteq k S_0 K= S_0 K$ and thus $kS = (kS)_0 \in {\cal S}$.  Further,
$(kS)_0|R = k^{G:K|} (S|R). k \in K, S,R \in {\cal S}$.  As in Schur-Zassnehaus,
$R \sim S  \leftrightarrow R|S=1$ thus defines an equivalence relation on ${\cal S}$
and the existance of a complement follows using the action of $G$ and $K$ on ${\cal S}/ \sim$.
\end{quote}
{\bf Theorem 22:}
Let $N \lhd G$ and $G$ be a semidirect product of $N$ with $P$, $g \in G: Z^g \le P$.  Then
$\exists x \in P: Z^g = Z^x$ so every normal subgroup of $P$ is weakly closed in $P$.
\begin{quote}
\emph{Proof:}
$g=yx, y \in N, x \in P$ so $Z^g \le P \rightarrow Z^y \le P$.  Thus, $\forall z \in Z:
[z,y] \in N \cap P =1$ and $y \in C(Z)$ so $Z^g=Z^x$.
\end{quote}
{\bf Observation:} If $N$ is a $p$-complement in $G$ then $O_{p'}(G)=N=O^{p}(G)$.
\\
\\
{\bf Frobenius Normal $p-$complement Theorem:}  Let $P \in S_p(G)$ if $\forall U \in p(G)$,
$N_G(U)$ has a normal $p$-complement then $G$ has a normal $p$ -complement.  Note: There is a
stronger result in which $U$ can be restricted to characteristic $p$-locals and Thompson's
$p$-complement theorem is a further strengthening.
\begin{quote}
\emph{Proof:}
$G$ has a normal $p$-complement if $P = 1$.  If $P > 1, Z={\mathbb Z}(P) > 1$ and $H= N_G(Z)$ has a normal $p$-complement
by hypothesis.  Thus $O^p(H) \ne H$.\\
\emph{Claim:} $Z$ is weakly closed in $P$.
\\
\emph{Proof of claim:}  It suffices to show, $Z \le R \in S_p(N_G(P)) \rightarrow
Z \lhd R$.  Assume this condition does not hold and choose $R$ such that
$S=N_R(Z)$ is maximal.  $S < N_R(S)$ and $S < N_T(S)$.  Put $M= N_G(S)$ and let
$N_T(S) \le T_1 \in S_p(M)$.  By the maximality, $Z \lhd T_1$  Since $M$ has a normal $p$-complement, the
previous result show $Z$ is normal in every Sylow subgroup of $M$ containing it.  Hence
$Z \lhd N_R(S)$ which contradicts $S < N_R(S)$.
\\
Now Grun's Theorem shows $O^p(G) \ne G$ and by induction on $|G|$, $O^p(G)$ has a normal $p$-complement, $K$.
$K \lhd G$ and $G/K$ is a $p$-group, so $K$ is also a normal $p$-complement of $G$.
\end{quote}
{\bf Theorem 23:} A finite group $G$ has a normal $p$ complement iff a Sylow $p$-group
controls its own fusion.
\begin{quote}
\emph{Proof:}
\\
\\
$\rightarrow$:  Let $P \in S_p(G)$ and $N$ be a normal $p$ complement so $G=NP$.
Suppose $x, y \in P$ and $x^g=y$.  Let ${\overline G}= G/N$ so the isomorphism
$G \rightarrow {\overline G}$ induces an isomorphism of $P$ onto ${\overline G}$.
${\overline x}$ and
${\overline y}$ are conjugate in
${\overline G}$ so by the isomorphism, they are $P$-conjugate and $P$ controls its own
fusion.
\\
\\
$\leftarrow$:  Let $N= O^p(G)$, $Q= N \cap P$ so $Q \in S_p(N)$.  We show $Q=1$ and hence
$N$ is a normal $p$-complement.
\\
\emph{Claim:} $N= A^p(N)=N$.
\\
\emph{Proof of claim:}
$A^p(N) \; char \; N$ so $A^p(N) \lhd G$.  Further,
$|G:A^p(N)|= |G:N||N:A^p(N)|$, which is a $p$-power.  Thus
$N= O^p(G) \subseteq A^p(N)$ and $O^p(N)=A^p(N)$ as claimed.
\\
By the focal subgroup theorem,  $Foc_N(Q)= Q \cap A^p(N)= Q \cap N = Q$.  Let
$x, y \in Q$ be $N$-conjugate so $x^{-1}y$ is a typical generator in $Foc_N(Q)$.
$\exists u \in P: x^u=y$ so $x^{-1}y = [x,u] \in [Q, P]$.  So
$Q= Foc_N(Q) \subseteq [Q, P]$, so $Q \subseteq [Q, P, P, \ldots ,P]$ but
$Q \subseteq P$ and $P$ is nilpotent so $[Q, P, \ldots , P]= 1$ eventually and so
$Q= 1$.
\end{quote}
{\bf Theorem 23a:}  The following are equivalent:
(1) $G$ has a normal $p-$complement,
(2) Each $p-$local subgroup of $G$ has a normal $p-$complement,
(3) $Aut_G(P)$ is a $p-$group $\forall P \in p(G)$.
\begin{quote}
\emph{Proof:}
$1 \rightarrow 2 \rightarrow 3$ is easy.
\\
\emph{Claim:} Assume $N_G(X)/C_G(X)$ is a $p$-group for every $p$-group, $X$, of a finite
group $G$ and let $P, Q \in S_p(G)$ then $Q=P^c$ for some $c \in C_G(P \cap Q )$.
\\
\emph{Proof of claim:}
Assume (3).  It suffices to show that $P$ controls its own fusion in $G$.  If
$x,y \in P$ are conjugate in $G$, $x^g=y$, $y \in P \cap P^g$ and by the claim,
$\exists c \in C_G(P \cap P^g): (P^G)^c=P$.  Since $N_G(P)/C_G(P)$ is a $p$-group
and $P$ is a Sylow $p$-subgoup of $N_G(P)$,  $N_G(P)= C_G(P)P$.  We have
$gc=tu$, $t \in C_G(P)$ and $u \in P$.  Since $x \in P$ and $[x,t]=1$ and thus
$y=y^c=x^{gc}=x^{tu}=x^u$ so $x$ and $y$ are $P$-conjugate.
\end{quote}
{\bf Definition 5:} $G$ is $\pi$-closed if $G/O_{\pi}(G)$ is a $\pi'$ group and thus
$O_{\pi}(G)=O^{\pi'}(G)$.\\
\\
{\bf Definition 6:} $A^{\pi}(G)$ is the unique smallest normal subgroup of $G$ such that
$G/A^{\pi}(G)$ is an abelian $\pi$-group.  If $P \subseteq H \subseteq G$ then
$ |G:A^p(G)| \le |H:A^p(H)|$ if equality holds we say $H$ \emph {controls $p$-transfer in $G$}.
\\
\\
{\bf Burnside $p$-complement theorem:}  If $C_G(P)= N_G(P)$ then $G$ has a normal $p$-complement.
\begin{quote}
\emph{Proof:}  Obviously, $P$ controls its own fusion in this case and the result follows.
\end{quote}
{\bf Theorem 24:}  If $P \in S_p(G)$ and $H$ controls $p$-fusion in $P$ then $H$ controls $p$-transfer
in $G$.  If $P \in S_p(G)$ is abelian, then $N_G(P)$ controls $p$-transfer.
\begin{quote}
\emph{Proof:}
Want to show $|G:V_{G \rightarrow P}| = |H:V_{H \rightarrow P}|$ this happens iff
$P \cap ker(V_{G \rightarrow P}) = Foc_G(P) = P \cap ker(V_{H \rightarrow P}) = Foc_H(G)$.
$Foc_G(P) = Foc_G(H)$ since $H$ controls $G$-fusion.
\end{quote}
{\bf Theorem 25:}
Let $p \ne 2$ and suppose every $p$-element is central in
$G$ then $G$ has a normal $p$ complement.
\begin{quote}
\emph{Proof:}
This follows from the Frobenius normal $p$-complement theorem.
\end{quote}
{\bf Theorem 26:}
Let $G$ be a finite group $H \le G$, $(p, |G:H|)=1, K \lhd H$, $H/K$ abelian,
$g$ a $p-$element in $H \setminus K$: $g^{ma} \in g^m K, \forall m$, all $a \in G$ such that
$g^{ma} \in H$ then $g \notin G'$.
\begin{quote}
\emph{Proof:}
See, Stellmacher,  p 73.
\end{quote}
{\bf Definition 7:} The action of $A$ on $N \lhd G$ is \emph{Frobenius} if $n^a \neq n$, if $a \neq 1 \neq n$.
\\
\\
{\bf Lemma:}  Let $A<G$ with the TI property for all $g \in G-A$ then
$X= \{x: x \neq y, y= a^g \}$, $|X|= |G|/|A|$.
\begin{quote}
\emph{Proof:}
If $A>1$, $A=N_G(A)$ since $A^x=a$ then $A \cap A^x=A>1$, $x \in A$.  So $A$ has exactly $|G:A|$ conjugates
in $G$ all with the same TI property as $A$.  These contain $|G:A|(|A|-1)$ non-identity elements of $G$.
$|X|= |G| - |G:A| (|A|-1) = |G:A|$.
\end{quote}
{\bf Theorem 27:}
Let $N \lhd G$ and $A$ is a complement for $N$ in $G$.  The following are equivalent:
(1) The conjugate action of $A$ on $N$ is Frobenius;
(2) $A \cap A^g = 1$, $\forall g \in G-A$;
(3) $C_G(A) \subseteq A$.
\begin{quote}
\emph{Proof:}
$1 \rightarrow 2$:
If $A \cap A^x \neq 1$ with $x=an$.  $A^x= A^{an}= A^n$ so $A \cap A^n \neq 1$ so
$a=a^n$ and $a^n=a \in A \cap A^n= 1$ so $n=1$ and $x \in A$.
\\
$2 \rightarrow 3$:  Suppose $g \in C_G(A), g \notin A$ then $g=an$ and $[A, an]=1$ and
$b= b^{an} \in A \cap A^n =1$ so $n=1$ by (1).
\\
$3 \rightarrow 1$:
If $1 \neq a  \in A$ by (3), then $C_N(a)= N \cap C_G(a)=1$ so $a^n \neq a$ for $n \neq 1$.
\end{quote}


\section*{Exercises}

\begin{ex}
  Encode the message $0110$ using the 3-repetition code.  Decode the
  message $100$ $011$ $000$ $110$ $101$ $110$ after correcting single-bit
  errors.
\end{ex}

\begin{ex}
  Use the code of Example~\ref{exa:code-simple} to encode the message
  $01~11~10~00~01$. Use the syndrome method to correct all single-bit
  errors in the message $10100~00001~11001$. What is the decoded message?
\end{ex}

\begin{ex}
  Consider the code
  \begin{equation*}
    C=\set{000000,011100,111010,101001,100110,110101,010011,001111}.
  \end{equation*}
  Is this a linear code? What are the message length and block length
  of this code?  What is its Hamming distance? How many errors per
  code block can this code detect? How many can it correct?
\end{ex}

\begin{ex}
  Consider a linear code with check matrix
  \begin{equation*}
    H = \begin{mymatrix}{cccccc}
      1 & 1 & 0 & 0 & 0 \\
      1 & 0 & 1 & 1 & 0 \\
      1 & 0 & 1 & 0 & 1 \\
    \end{mymatrix}.
  \end{equation*}
  Find a generator matrix for this code (hint: the columns of $G$
  should form a basis for the null space of $H$). List all possible
  code blocks. What is the Hamming distance of the code? Make a
  syndrome table for this code.
\end{ex}

\begin{ex}
  Use the generator matrix
  \begin{equation*}
    G = \begin{mymatrix}{ccc}
      1 & 0 & 0 \\
      1 & 1 & 1 \\
      1 & 0 & 1 \\
      0 & 1 & 0 \\
      1 & 1 & 0 \\
      0 & 0 & 1 \\
    \end{mymatrix}
  \end{equation*}
  to encode the message $111~110~101~001$. Find a check matrix for
  this code and make a syndrome table. Is the code 1-error correcting?
  Use the syndrome method to correct and decode the message
  $111000~101111~100111~110100$.
\end{ex}

\begin{ex}
  Construct check and generator matrices of a Hamming code for $r=4$.
  What is the block length and message length of this code? Encode the
  message $00110011000~10100000001$. Decode the message
  $001000010010000~010000001000001$ after correcting single-bit errors.
  \begin{sol}
    The block length is $n=r-1=15$ and the message length is
    $k=n-r=11$.  The check matrix and generator matrix are not unique,
    because there are different ways of ordering the columns of the
    check matrix. Here is one possible answer:
    \begin{equation*}
      H = \begin{mysmallmatrix}{ccccccccccc|cccc}
        1&1&0&1&1&0&1&0&1&0&1&1&0&0&0 \\
        1&0&1&1&0&1&1&0&0&1&1&0&1&0&0 \\
        0&1&1&1&0&0&0&1&1&1&1&0&0&1&0 \\
        0&0&0&0&1&1&1&1&1&1&1&0&0&0&1 \\
      \end{mysmallmatrix},
      \quad
      G = \begin{mysmallmatrix}{ccccccccccc}
        1&0&0&0&0&0&0&0&0&0&0 \\
        0&1&0&0&0&0&0&0&0&0&0 \\
        0&0&1&0&0&0&0&0&0&0&0 \\
        0&0&0&1&0&0&0&0&0&0&0 \\
        0&0&0&0&1&0&0&0&0&0&0 \\
        0&0&0&0&0&1&0&0&0&0&0 \\
        0&0&0&0&0&0&1&0&0&0&0 \\
        0&0&0&0&0&0&0&1&0&0&0 \\
        0&0&0&0&0&0&0&0&1&0&0 \\
        0&0&0&0&0&0&0&0&0&1&0 \\
        0&0&0&0&0&0&0&0&0&0&1 \\\hline
        1&1&0&1&1&0&1&0&1&0&1 \\
        1&0&1&1&0&1&1&0&0&1&1 \\
        0&1&1&1&0&0&0&1&1&1&1 \\
        0&0&0&0&1&1&1&1&1&1&1 \\
      \end{mysmallmatrix}.
    \end{equation*}
    With these matrices, the encoding of $00110011000~10100000001$ is
    $001100110000110~101101110110101$. The error syndrome for
    $001000010010000$ is $1010$, which corresponds to an error in bit
    $2$. We find that the corrected code block is $011000010010000$,
    and the decoding is $01100001001$. The error syndrome for
    $010000100000001$ is $0110$, which corresponds to an error in bit
    $3$. The corrected code block is $011000100000001$ and the
    decoding is $01100010000$.  However, if you have used a different
    check matrix and/or generator matrix, your answers might differ.
  \end{sol}
\end{ex}


\section{Neural Networks}
% only CNN?
\textbf{Activation:} $\tanh(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}}$ sigmoid $s(x)= \frac{1}{1+e^{-x}},s^{'}(x)=s(x)(1-s(x))$, ReLU $\max(0,x)$\\
\textbf{Neurons}: $F_\sigma(\mathbf{x};\mathbf{w}) = \sigma(w_0 + \sum_{i=1}^M{x_iw_i})$.\\ \textbf{Output}: linear regression $\mathbf{y} = \mathbf{W}^L\mathbf{x}^{L-1}$, binary (logistic) $y_1 = \text{P}[Y=1|\mathbf{x}] = \frac{1}{1 + \exp(-\mathbf{w}^T \mathbf{x}^{L-1})}$, multiclass (soft-max) $y_k = \text{P}[Y=k|\mathbf{x}]= \frac{\exp( \mathbf{w}_k^T\mathbf{x}^{L-1})}{\sum_{m=1}^{K}{\exp(\mathbf{w}^T\mathbf{x}^{L-1})}}$.
\textbf{Loss function} $l(y, \hat{y})$: squared loss $\frac{1}{2}(y - \hat{y})^2$, cross-entropy loss $-y \log \hat{y} - (1-y)\log(1-\hat{y})$.  \textbf{Units and Layers}: layer-to-layer fwd. prop. notation: $\mathbf{x}^{l} = \sigma^{l}\left(\mathbb{W}^{\left(l\right)}\mathbf{x}^{\left(l-1\right)}\right)$. L-layer network: $\mathbf{y}=\sigma^{\left(L\right)}\left(\mathbf{W}^(L)\sigma^{(L-1)}\left(\cdots\left(\sigma^{(1)}\left(\mathbf{W}^{(1)}\mathbf{x}\right)\cdots\right)\right)\right)$

\subsection*{Backpropagation}
Layer-to-layer Jacobian: $\mathbf{x}$ = prev. layer activation, $\mathbf{x^+}$ = next layer activation. Jacobian matrix $\mathbf{J}$ = $J_{ij}$ of mapping $\mathbf{x}\rightarrow\mathbf{x^+}$, $\mathbf{x_i^+} = \sigma(\mathbf{w}_i^\top\mathbf{x})$, $J_{ij} = \frac{\partial \mathbf{x_i^+}}{\partial \mathbf{x}_j} = w_{ij}\cdot\sigma'(\mathbf{w}_i^\top\mathbf{x})$. Across multiple layers: $\frac{\partial\mathbf{x}^{(l)}}{\partial\mathbf{x}^{(l-n)}} = \mathbf{J}^{(l)}\cdot\frac{\partial\mathbf{x}^{(l-1)}}{\partial\mathbf{x}^{(l-n)}}=\mathbf{J}^{(l)}\cdot\mathbf{J}^{(l-1)}\cdots\mathbf{J}^{(l-n+1)}$ and then back prop. $ \nabla_{\mathbf{x}^{(l)}}^\top\ell=\nabla_{\mathbf{y}}^\top\ell\cdot\mathbf{J}^{(L)}\cdots\mathbf{J}^{(l+1)}$\\
Weights: $\frac{\partial l}{\partial w_{ij}^{(l)}} = \frac{\partial l}{\partial x_i^{(l)}}\frac{\partial x_i^{(l)}}{\partial w_{ij}^{(l)}}$, $\frac{\partial x_i^{l}}{\partial w_{ij}^{l}} = \sigma'([\mathbf{w}_i^{(l)}]^T \mathbf{x}^{(l-1)})\cdot x_j^{(l-1)}$ (sensitivity of down-stream unit $\cdot$ activation of up-stream unit)

\subsection*{Gradient Descent (or Deepest Descent)}
\textbf{Gradient}: $\nabla f(\mathbf{x}) := \left( \frac{\partial f(\mathbf{x})}{\partial \mathbf{x}_1}, \ldots, \frac{\partial f(\mathbf{x})}{\partial \mathbf{x}_D} \right)^\top$

1. init: $\mathbf{x}^{(0)} \in \mathbb{R}^D$\\
2. for $t = 0 \ \text{to} \ \mathit{maxIter}$:\\
3. $\mathbf{x}^{(t+1)} = \mathbf{x}^{(t)} - \gamma \nabla f(\mathbf{x}^{(t)})$, usually $\gamma \approx \frac{1}{t}$

\subsection*{Stochastic Gradient Descent (SGD)}
Assume \textbf{Additive Objective}:\\
$f(x) = \frac{1}{N}\sum_{n=1}^{N}f_n(x)$\\
1. init: $\mathbf{x}^{(0)} \in \mathbb{R}^D$\\
2. for $t = 0 \ \text{to} \ \mathit{maxIter}$:\\
3. sample $n \in_{u.a.r.} \{1, \ldots, N\}$\\
4. $\mathbf{x}^{(t+1)} = \mathbf{x}^{(t)} - \gamma \nabla f_n(\mathbf{x}^{(t)})$, typically  $\gamma \approx \frac{1}{t}$.

\subsection*{Neural Networks for Images (CNN)}
Translation invariance of images $\rightarrow$ neurons compute same fct, shift invariant filters; weights defined as filter masks, e.g. convolution: $F_{n,m}(\mathbf{x};\mathbf{w}) = \sigma(b + \sum_{k=-2}^2\sum_{l=-2}^{2}{w_{k,l}x_{n+k,m+l}})$. To reduce dimension of convolution, use \{max, avg\}-pooling


\subsection{The Position of the Sound Source}

The position of the sound source needs to be referenced both in terms of $O$ and in terms of the position of $m$. Given $\theta_s$ and $d_S$, its position $(x,y)$ can be found through the usual conversion:

\begin{equation}
\begin{bmatrix} x_S \\ y_S \end{bmatrix} = \begin{bmatrix} \cos{\theta_S} \\ \sin{\theta_S} \end{bmatrix}
\end{equation}

Following this, finding the position of the sound source relative to the microphone, $(x,y)_{Sm}$ can be done by shifting the reference origin in terms of the position of $m$:

\begin{equation}
\begin{bmatrix} x_Sm \\ y_Sm \end{bmatrix} = \begin{bmatrix} x_S \\ y_S \end{bmatrix} + \begin{bmatrix} x_m \\ y_m \end{bmatrix}
\end{equation}

\subsection{Finding $d_{\vec{mS}}$}

With the positions of the sound source and the microphones defined in the virtual space, it becomes important to define their relationships to one another. Since the encoding of the source at each microphone depends on the relationship between the source's location and the location of the microphone. These key parameters can be derived from a vector taken from the microphone to the source, $\vec{v}_m = \vec{mS}$.

If follows that:

\begin{equation}\label{distance}
d_{\vec{v}} = \sqrt{
(x_s - x_m)^2 + (y_s - y_m)^2
}
\end{equation}

\subsection{Finding $\theta_{mS}$}

Since a microphone's polar directivity pattern applies an amplitude scalar based on the amount of angular deflection the source is away from the forward-facing axis of the microphone, $\theta_mS$ should represent this amount of deflection. There are two different methods that can be used to find $\theta_mS$.

\subsubsection{Difference in rotations}

The first method is to find the angular rotation of the position of $S$ around the position of $m$, and then taking the difference of this angular rotation and the amount of rotation of the virtual microphone ($\theta_m$).

\begin{equation}
\theta_{mS} = \tan^{-1}\left(\frac{y_{Sm}}{x_{Sm}}\right) - \theta_m
\end{equation}

\subsubsection{Using linear transformations}

Alternatively, the endpoint of $\vec{v}$ could be redefined by applying a rotation matrix based on $\theta_m$

\begin{equation}\label{rotationMatrix}
\begin{bmatrix} X \\ Y \end{bmatrix} = \begin{bmatrix} \cos{\theta_m} & -\sin{\theta_m} \\ \sin{\theta_m} & \cos{\theta_m} \end{bmatrix} \cdot \begin{bmatrix} x_{Sm} \\ y_{Sm} \end{bmatrix}
\end{equation}

\begin{equation}\label{arctan}
\theta_{mS} = \tan^{-1}\left(\frac{Y}{X}\right)
\end{equation}

By combining (\ref{rotationMatrix}) and (\ref{arctan}):

\begin{equation}
	\theta_{mS} = \tan^{-1}\left(\frac{x_{Sm}\sin{\theta_m} + y_{Sm}\cos{\theta_m}}{x_{Sm}\cos{\theta_m} - y_{Sm}\sin{\theta_m}}\right)
\end{equation}


\subsection{Difference-in-difference}

Consider the grouped linear model:

\(y_{ij}=\mu+\tau_i+X_{j}\theta +\epsilon_{ij}\)

By taking differences with another observation in the same group we remove the average terms.

\(y_{ij}-y_{ik}=(\mu+\tau_i+X_{j}\theta +\epsilon_{ij})- (\mu + \tau_i + X_{k}\theta + \epsilon_{ik})\)

\(y_{ij}-y_{ik}=(X_{j}\theta - X_{k})+(\epsilon_{ij}- \epsilon_{ik})\)

diff in diff: control group and treated group. page on leakiness? are control affected too? Assumption: in absense of treatment, price would have evolved like control


\section{Learning with SGD}
\frame{\tableofcontents[currentsection, hideothersubsections]}

\begin{frame}
\frametitle{Learning with SGD: Risk Minimization}

Recall, in learning:\\
\begin{itemize}
\item want to minimize the risk function, $L_D(\mathbf{w}) = \mathbb{E}_{z \sim D} [\ell(\mathbf{w}, z)]$
\item do not know $D$, so cannot simply calculate $\nabla L_D (\mathbf{w}^{(t)} )$
\item as an estimate to minimizing $L_D(w)$: minimize $L_S(w)$~\footnote{empirical risk}
\end{itemize}
\vspace{5mm}

SGD minimizes $L_D(w)$ directly:\\
find an \textbf{unbiased estimate} of the gradient of $L_D(\mathbf{w})$, that is,\\
a random vector whose conditional expected value is $\nabla L_D (\mathbf{w}^{(t)} )$

\end{frame}

\begin{frame}
\frametitle{Learning with SGD: Risk Minimization}

Construction of the random vector $\mathbf{v}_t$ for  a differentiable risk fn $L_D$:
\begin{itemize}
\item sample $z \sim D$
\item define $\mathbf{v}_t$ to be the gradient of $\ell(\mathbf{w}, z)$ wrt $\mathbf{w}$, at $\mathbf{w}^{(t)}$
\item by the linearity of the gradient we have:
    \begin{figure}
        \centering
        \includegraphics[scale=0.25]{eq_14_13}
    \end{figure}
\end{itemize}
\vspace{5mm}

Thus, the gradient of the loss function $\ell(w, z)$ at $\mathbf{w}^{(t)}$ is
\begin{itemize}
\item unbiased estimate of the gradient of the risk function $L_D( w^{(t)} )$ and
\item constructed by sampling a single fresh example $z \sim D$ at each iteration $t$.
\end{itemize}

\end{frame}

\begin{frame}
\frametitle{Learning with SGD: Risk Minimization}

\begin{figure}
    \centering
    \includegraphics[scale=0.25]{sgd2}
\end{figure}

Same for nondifferentiable loss functions,\\
simply let $\mathbf{v}_t$ be a subgradient of $\ell(\mathbf{w}, z)$ at $\mathbf{w}^{(t)}$

\end{frame}

\begin{frame}
\frametitle{Learning with SGD: Convex-Smooth Learning Problems}

\begin{figure}
    \centering
    \includegraphics[scale=0.25]{theorem_14_13}
\end{figure}

\begin{figure}
    \centering
    \includegraphics[scale=0.25]{corollary_14_14}
\end{figure}

\end{frame}

\begin{frame}
\frametitle{Learning with SGD: Regularized Loss Minimization}

WHAT:\\
to solve the regularized loss minimization:
\begin{figure}
    \centering
    \includegraphics[scale=0.25]{eq_14_14}
\end{figure}

WHY:\\
\begin{itemize}
\item SGD enjoys the same worst-case sample complexity bound as regularized loss minimization
\item on some distributions, regularized loss minimization may yield a better solution.
\end{itemize}

HOW:\\
...
\end{frame}

\begin{frame}
\frametitle{Learning with SGD: Regularized Loss Minimization}

WHAT:\\
to solve the regularized loss minimization:
\begin{figure}
    \centering
    \includegraphics[scale=0.25]{eq_14_14}
\end{figure}

HOW:\\
\begin{itemize}
\item define $f(\mathbf{w}) = \frac{\lambda}{2} \parallel w \parallel^2 + L_S(\mathbf{w})$.
    \begin{itemize}
        \item $f$ is a $\lambda$-strongly convex function;
        \item therefore, apply the SGD variant with $\mathcal{H} = \mathbb{R}^d$.
    \end{itemize}
\item construct an unbiased estimate of a subgradient of $f$ at $\mathbf{w}^{(t)}$
    \begin{itemize}
        \item pick $z$ uniformly at random from $S$,
        \item choose $\mathbf{v}_t$ in $\partial \ell(\mathbf{w}^{(t)}, z)$
        \item (then) the expected value of $\lambda \mathbf{w}^{(t)} + \mathbf{v}t$ is a subgradient of f at $\mathbf{w}^{(t)}$.
    \end{itemize}
\end{itemize}

\end{frame}


\subsection{Lévy distribution}

\subsubsection{Definition}

The Lévy distribution is a continuous probability distribution.

The marginal probability is:

\(P(X)=\sqrt {\dfrac{c}{2\pi }}\dfrac{e^{-\dfrac{c}{2(x-\mu )}}}{(x-\mu )^{\dfrac{3}{2}}}\)


\subsection{The Solow-Swan model}

\subsubsection{Recap of growth models}

As with the Harrod-Domar model we have output as a function of capital:

\(Y=f(K)\)

Capital dynamics:

\(\dot K=I-\delta K\)

\(I=S=sY\)

This gives us:

\(\dot K = sY-\delta K\)

\subsubsection{Recap of the Harrod-Domar model}

The production function of the Harrod-Domar model is:

\(Y=cK\)

And long-term growth of:

\(\dfrac{\dot Y}{Y}=sc-\delta \)

\subsubsection{The Solow-Swan production function}

We use a new production function:

\(Y=K^\alpha (AL)^{1-\alpha }\)

We add dynamics for technology and labour.

\(A_t=A_0e^{gt}\)

\(L_t=L_0e^{nt}\)

\(Y_t=K_t^\alpha (A_0e^{gt}L_0e^{nt})^{1-\alpha }\)

\subsubsection{Effective captial}

\(k_t=\dfrac{K_t}{A_tL_t}\)

\(Y_t=\dfrac{Y_t}{A_tL_t}\)

The dynamics of effective capital is:

\(\dot k_t=sk_t^{\alpha }-(n+\delta +g)k_t\)

\subsubsection{Steady state}

In equilibrium effective capital is stable.

\(\dot k_t^*=sk_t^{\alpha }-(n+\delta +g)k_t^8=0\)

\(sk_t^{*\alpha }=(n+\delta +g)k_t^8\)

\(k_t^*=\biggr (\dfrac{s}{n+g+\delta }\biggr )^{\dfrac{1}{1-\alpha }}\)


\chapter{Bonus: Cellular homology}
We now introduce cellular homology, which essentially lets us compute
the homology groups of any CW complex we like.

\section{Degrees}
\prototype{$z \mapsto z^d$ has degree $d$.}
For any $n > 0$ and map $f : S^n \to S^n$, consider
\[ f_\ast : \underbrace{H_n(S^n)}_{\cong \ZZ} \to \underbrace{H_n(S^n)}_{\cong \ZZ} \]
which must be multiplication by some constant $d$.
This $d$ is called the \vocab{degree} of $f$, denoted $\deg f$.
\begin{ques}
	Show that $\deg(f \circ g) = \deg(f) \deg(g)$.
\end{ques}

\begin{example}
	[Degree]
	\listhack
	\begin{enumerate}[(a)]
		\ii For $n=1$, the map $z \mapsto z^k$ (viewing $S^1 \subseteq \CC$)
		has degree $k$.
		\ii A reflection map $(x_0, x_1, \dots, x_n) \mapsto (-x_0, x_1, \dots, x_n)$
		has degree $-1$; we won't prove this, but geometrically this should be clear.
		\ii The antipodal map $x \mapsto -x$ has degree $(-1)^{n+1}$
		since it's the composition of $n+1$ reflections as above.
		We denote this map by $-\id$.
	\end{enumerate}
\end{example}

Obviously, if $f$ and $g$ are homotopic, then $\deg f = \deg g$.
In fact, a theorem of Hopf says that this is a classifying invariant:
anytime $\deg f = \deg g$, we have that $f$ and $g$ are homotopic.

One nice application of this:
\begin{theorem}
	[Hairy ball theorem]
	If $n > 0$ is even, then $S^n$ doesn't have a continuous field
	of nonzero tangent vectors.
\end{theorem}
\begin{proof}
	If the vectors are nonzero then WLOG they have norm $1$;
	that is for every $x$ we have an orthogonal unit vector $v(x)$.
	Then we can construct a homotopy map $F : S^n \times [0,1] \to S^n$ by
	\[ (x,t) \mapsto (\cos \pi t)x + (\sin \pi t) v(x). \]
	which gives a homotopy from $\id$ to $-\id$.
	So $\deg(\id) = \deg(-\id)$, which means $1 = (-1)^{n+1}$
	so $n$ must be odd.
\end{proof}
Of course, the one can construct such a vector field whenever $n$ is odd.
For example, when $n=1$ such a vector field is drawn below.
\begin{center}
	\begin{asy}
		size(5cm);
		draw(unitcircle, blue+1);
		label("$S^1$", dir(100), dir(100), blue);
		void arrow(real theta) {
			pair P = dir(theta);
			dot(P);
			pair delta = 0.8*P*dir(90);
			draw( P--(P+delta), EndArrow );
		}
		arrow(0);
		arrow(50);
		arrow(140);
		arrow(210);
		arrow(300);
	\end{asy}
\end{center}

\section{Cellular chain complex}
Before starting, we state:
\begin{lemma}
	[CW homology groups]
	Let $X$ be a CW complex. Then
	\begin{align*}
		H_k(X^n, X^{n-1}) &\cong
		\begin{cases}
			\ZZ^{\oplus\text{\#$n$-cells of $X$}} & k = n \\
			0 & \text{otherwise}.
		\end{cases} \\
		\intertext{and}
		H_k(X^n) &\cong
		\begin{cases}
			H_k(X) & k \le n-1 \\
			0 & k \ge n+1.
		\end{cases}
	\end{align*}
\end{lemma}
\begin{proof}
	% I'll prove just the case where $X$ is finite-dimensional as usual.
	The first part is immediate by noting that $(X^n, X^{n-1})$ is a good pair
	and $X^n/X^{n-1}$ is a wedge sum of two spheres.
	For the second part, fix $k$ and note that, as long as $n \le k-1$ or $n \ge k+2$,
	\[
		\underbrace{H_{k+1}(X^n, X^{n-1})}_{=0}
		\to H_k(X^{n-1})
		\to H_k(X^n)
		\to \underbrace{H_{k}(X^n, X^{n-1})}_{=0}.
	\]
	So we have isomorphisms
	\[ H_k(X^{k-1}) \cong H_k(X^{k-2}) \cong \dots \cong H_k(X^0) = 0 \]
	and
	\[ H_k(X^{k+1}) \cong H_k(X^{k+2}) \cong \dots \cong H_k(X). \qedhere \]
\end{proof}

So, we know that the groups $H_k(X^k, X^{k-1})$ are super nice:
they are free abelian with basis given by the cells of $X$.
So, we give them a name:
\begin{definition}
	For a CW complex $X$, we define
	\[ \Cells_k(X) = H_k(X^k, X^{k-1}) \]
	where $\Cells_0(X) = H_0(X^0, \varnothing) = H_0(X^0)$ by convention.
	So $\Cells_k(X)$ is an abelian group with basis given by
	the $k$-cells of $X$.
\end{definition}

Now, using $\Cells_k = H_k(X^k, X^{k-1})$ let's use
our long exact sequence and try to string together maps between these.
Consider the following diagram.

\begingroup
\fontsize{10pt}{12pt}\selectfont
\begin{diagram}
	\small
	&& \underbrace{H_3(X^2)}_{=0} &&&&&&&& \\
	&& \dTo~0 &&&&&&&& \\
	\boxed{\Cells_4(X)} & \rTo^{\partial_4} & H_3(X^3) & \rSurj
		& \underbrace{H_3(X^4)}_{\cong H_3(X)} &
		\rTo~0 & \underbrace{H_3(X^4, X^3)}_{= 0} &&&& \\
	& \rdDotted~{d_4} & \dTo~0 &&&&&&&& \\
	&& \boxed{\Cells_3(X)} &&&& \underbrace{H_1(X^0)}_{=0} &&&& \\
	&& \dTo^{\partial_3} & \rdDotted~{d_3} &&& \dTo~0 &&&& \\
	\underbrace{H_2(X^1)}_{=0} & \rTo~0 & H_2(X^2) & \rInj &
		\boxed{\Cells_2(X)} & \rTo^{\partial_2} & H_1(X^1) & \rSurj &
		\underbrace{H_1(X^2)}_{\cong H_1(X)} & \rTo~0 &
		\underbrace{H_1(X^2, X^1)}_{=0} \\
	&& \dSurj &&& \rdDotted~{d_2} & \dInj &&&& \\
	&& \underbrace{H_2(X^3)}_{\cong H_2(X)} &&&& \boxed{\Cells_1(X)} &&&& \\
	&& \dTo~0 &&&& \dTo^{\partial_1} & \rdDotted~{d_1} &&& \\
	&& \underbrace{H_2(X^3, X^2)}_{=0} && \underbrace{H_0(\varnothing)}_{=0}
		& \rTo~0 & H_0(X^0) & \rInj & \boxed{\Cells_0(X)} & \rTo^{\partial_0} & \dots \\
	&&&&&& \dSurj &&&& \\
	&&&&&& \underbrace{H_0(X^1)}_{\cong H_0(X)} &&&& \\
	&&&&&& \dTo~0 &&&& \\
	&&&&&& \underbrace{H_0(X^1, X^0)}_{=0} &&&& \\
\end{diagram}
\endgroup
The idea is that we have taken all the exact sequences generated by adjacent
skeletons, and strung them together at the groups $H_k(X^k)$,
with half the exact sequences being laid out vertically
and the other half horizontally.

In that case, composition generates a sequence of dotted maps
between the $H_k(X^k, X^{k-1})$ as shown.
\begin{ques}
	Show that the composition of two adjacent dotted arrows is zero.
\end{ques}

So from the diagram above, we can read off a sequence of arrows
\[
	\dots \taking{d_5} \Cells_4(X)  \taking{d_4} \Cells_3(X)
	\taking{d_3} \Cells_2(X) \taking{d_2} \Cells_1(X)
	\taking{d_1} \Cells_0(X) \taking{d_0} 0.
\]
This is a chain complex, called the \vocab{cellular chain complex};
as mentioned before before all the homology groups are free,
but these ones are especially nice because for most reasonable CW complexes,
they are also finitely generated
(unlike the massive $C_\bullet(X)$ that we had earlier).
In other words, the $H_k(X^k, X^{k-1})$ are especially nice ``concrete'' free groups
that one can actually work with.

The other reason we care is that in fact:
\begin{theorem}[Cellular chain complex gives $H_n(X)$]
	\label{thm:cellular_chase}
	The $k$th homology group of the cellular chain complex
	is isomorphic to $H_k(X)$.
\end{theorem}
\begin{proof}
	Follows from the diagram; \Cref{prob:diagram_chase}.
\end{proof}

A nice application of this is to define
the \vocab{Euler characteristic} of a finite CW complex $X$.
Of course we can write
\[ \chi(X) = \sum_n (-1)^n \cdot \#(\text{$n$-cells of $X$}) \]
which generalizes the familiar $V-E+F$ formula.
However, this definition is unsatisfactory because it
depends on the choice of CW complex, while we actually
want $\chi(X)$ to only depend on the space $X$ itself
(and not how it was built). In light of this, we prove that:
\begin{theorem}
	[Euler characteristic via Betti numbers]
	For any finite CW complex $X$ we have
	\[ \chi(X) = \sum_n (-1)^n \rank H_n(X). \]
\end{theorem}
Thus $\chi(X)$ does not depend on the choice of CW decomposition.
The numbers
\[ b_n = \rank H_n(X) \]
are called the \vocab{Betti numbers} of $X$.
In fact, we can use this to define $\chi(X)$ for any reasonable space;
we are happy because in the (frequent) case that $X$ is a CW complex,

\begin{proof}
	We quote the fact that if $0 \to A \to B \to C \to D \to 0$
	is exact then $\rank B + \rank D = \rank A + \rank C$.
	Then for example the row
	\begin{diagram}
		\underbrace{H_2(X^1)}_{=0} & \rTo~0 & H_2(X^2) & \rInj &
		H_2(X^2, X^1) & \rTo^{\partial_2} & H_1(X^1) & \rSurj &
		\underbrace{H_1(X^2)}_{\cong H_1(X)} & \rTo~0 &
		\underbrace{H_1(X^2, X^1)}_{=0} \\
	\end{diagram}
	from the cellular diagram gives
	\[ \#(\text{$2$-cells}) + \rank H_1(X)
		= \rank H_2(X^2) + \rank H_1(X^1). \]
	More generally,
	\[ \#(\text{$k$-cells}) + \rank H_{k-1}(X)
		= \rank H_k(X^k) + \rank H_{k-1}(X^{k-1}) \]
	which holds also for $k=0$ if we drop the $H_{-1}$ terms
	(since $\#\text{$0$-cells} = \rank H_0(X^0)$ is obvious).
	Multiplying this by $(-1)^k$ and summing across $k \ge 0$
	gives the conclusion.
\end{proof}

\begin{example}
	[Examples of Betti numbers]
	\listhack
	\begin{enumerate}[(a)]
		\ii The Betti numbers of $S^n$ are $b_0 = b_n = 1$,
		and zero elsewhere. The Euler characteristic is $1 + (-1)^n$.
		\ii The Betti numbers of a torus $S^1 \times S^1$
		are $b_0 = 1$, $b_1 = 2$, $b_2 = 1$, and zero elsewhere.
		Thus the Euler characteristic is $0$.
		\ii The Betti numbers of $\CP^n$ are $b_0 = b_2 = \dots = b_{2n} = 1$,
		and zero elsewhere. Thus the Euler characteristic is $n+1$.
		\ii The Betti numbers of the Klein bottle
		are $b_0 = 1$, $b_1 = 1$ and zero elsewhere.
		Thus the Euler characteristic is $0$, the same as the sphere
		(also since their CW structures use the same number of cells).
	\end{enumerate}
	One notices that in the ``nice'' spaces $S^n$, $S^1 \times S^1$ and $\CP^n$
	there is a nice symmetry in the Betti numbers, namely $b_k = b_{n-k}$.
	This is true more generally; see Poincar\'e duality and \Cref{prob:betti}.
\end{example}

\section{The cellular boundary formula}
In fact, one can describe explicitly what the maps $d_n$ are.
Recalling that $H_k(X^k, X^{k-1})$ has a basis the $k$-cells of $X$, we obtain:
\begin{theorem}
	[Cellular boundary formula for $k=1$]
	For $k=1$, \[ d_1 : \Cells_1(X) \to \Cells_0(X) \] is just the boundary map.
\end{theorem}
\begin{theorem}
	[Cellular boundary for $k > 1$]
	Let $k > 1$ be a positive integer.
	Let $e^k$ be an $k$-cell, and let $\{e_\beta^{k-1}\}_\beta$
	denote all $(k-1)$-cells of $X$.
	Then \[ d_k : \Cells_k(X) \to \Cells_{k-1}(X) \]
	is given on basis elements by
	\[ d_k(e^k) = \sum_\beta d_\beta e_\beta^{k-1} \]
	where $d_\beta$ is be the degree of the composed map
	\[ S^{k-1} = \partial D_\beta^k \xrightarrow{\text{attach}}
		X^{k-1} \surjto S_\beta^{k-1}. \]
	Here the first arrow is the attaching map for $e^k$
	and the second arrow is the quotient of collapsing
	$X^{k-1} \setminus e^{k-1}_\beta$ to a point.
\end{theorem}
This gives us an algorithm for computing homology groups of a CW complex:
\begin{itemize}
	\ii Construct the cellular chain complex,
	where $\Cells_k(X)$ is $\ZZ^{\oplus \# \text{$k$-cells}}$.
	\ii $d_1 : \Cells_1(X) \to \Cells_0(X)$ is just the boundary map
	(so $d_1(e^1)$ is the difference of the two endpoints).
	\ii For any $k > 1$, we compute $d_k : \Cells_k(X) \to \Cells_{k-1}(X)$
	on basis elements as follows.
	Repeat the following for each $k$-cell $e^k$:
	\begin{itemize}
		\ii For every $k-1$ cell $e^{k-1}_\beta$,
		compute the degree of the boundary of $e^k$ welded onto
		the boundary of $e^{k-1}_\beta$, say $d_\beta$.
		\ii Then $d_k(e^k) = \sum_\beta d_\beta e^{k-1}_\beta$.
	\end{itemize}
	\ii Now we have the maps of the cellular chain complex,
	so we can compute the homologies directly
	(by taking the quotient of the kernel by the image).
\end{itemize}

We can use this for example to compute the homology groups of the torus again,
as well as the Klein bottle and other spaces.

\begin{example}
	[Cellular homology of a torus]
	Consider the torus built from $e^0$, $e^1_a$, $e^1_b$ and $e^2$ as before,
	where $e^2$ is attached via the word $aba\inv b\inv$.
	For example, $X^1$ is
	\begin{center}
		\begin{asy}
			unitsize(0.8cm);
			draw(shift(-1,0)*unitcircle, blue, MidArrow);
			draw(shift(1,0)*rotate(180)*unitcircle, red, MidArrow);
			label("$e^1_a$", 2*dir(180), dir(180), blue);
			label("$e^1_b$", 2*dir(0), dir(0), red);
			dotfactor *= 1.4;
			dot("$e^0$", origin, dir(0));
		\end{asy}
	\end{center}
	The cellular chain complex is
	\begin{diagram}
		0 & \rTo & \ZZ e^2 & \rTo^{d_2} & \ZZ e^1_a \oplus \ZZ e^1_b
			& \rTo^{d_1} & \ZZ e^0 & \rTo^{d_0} & 0 \\
	\end{diagram}
	Now apply the cellular boundary formulas:
	\begin{itemize}
		\ii Recall that $d_1$ was the boundary formula.
		We have $d_1(e^1_a) = e_0 - e_0 = 0$ and similarly $d_1(e^1_b) = 0$.
		So $d_1 = 0$.

		\ii For $d_2$, consider the image of the boundary $e^2$ on $e^1_a$.
		Around $X^1$, it wraps once around $e^1_a$, once around $e^1_b$,
		again around $e^1_a$ (in the opposite direction),
		and again around $e^1_b$.
		Once we collapse the entire $e^1_b$ to a point,
		we see that the degree of the map is $0$.
		So $d_2(e^2)$ has no $e^1_a$ coefficient.
		Similarly, it has no $e^1_b$ coefficient, hence $d_2 = 0$.
	\end{itemize}
	Thus \[ d_1=d_2=0. \]
	So at every map in the complex, the kernel of the map
	is the whole space while the image is $\{0\}$.
	So the homology groups are $\ZZ$, $\ZZ^{\oplus 2}$, $\ZZ$.
\end{example}
\begin{example}
	[Cellular homology of the Klein bottle]
	Let $X$ be a Klein bottle.
	Consider cells $e^0$, $e^1_a$, $e^1_b$ and $e^2$ as before,
	but this time $e^2$ is attached via the word $abab\inv$.
	So $d_1$ is still zero, but this time we have
	$d_2(e^2) = 2e^1_a$ instead (why?).
	So our diagram looks like
	\begin{diagram}
		0 & \rTo & \ZZ e^2 & \rTo^{d_2} & \ZZ e^1_a \oplus \ZZ e^1_b
			& \rTo^{d_1} & \ZZ e^0 & \rTo^{d_0} & 0 \\
		&& e^2 & \rMapsto & 2e^1_a && && \\
		&&&& e_1^a & \rMapsto & 0 && \\
		&&&& e_1^b & \rMapsto & 0 && \\
	\end{diagram}
	So we get that $H_0(X) \cong \ZZ$,
	but \[ H_1(X) \cong \ZZ \oplus \Zc2 \] this time
	(it is $\ZZ^{\oplus 2}$ modulo a copy of $2\ZZ$).
	Also, $\ker d_2 = 0$, and so now $H_2(X) = 0$.
\end{example}

\section\problemhead
\begin{dproblem}
	Let $n$ be a positive integer.
	Show that
	\[
		H_k(\CP^n) \cong
		\begin{cases}
			\ZZ & k=0,2,4,\dots,2n \\
			0 & \text{otherwise}.
		\end{cases}
	\]
	\begin{hint}
		$\CP^n$ has no cells in adjacent dimensions,
		so all $d_k$ maps must be zero.
	\end{hint}
\end{dproblem}

\begin{problem}
	Show that a non-surjective map $f : S^n \to S^n$ has degree zero.
	\begin{hint}
		The space $S^n - \{x_0\}$ is contractible.
	\end{hint}
\end{problem}

\begin{problem}[Moore spaces]
	\gim
	Let $G_1$, $G_2$, \dots, $G_N$ be a sequence of
	finitely generated abelian groups.
	Construct a space $X$ such that
	\[
		\wt H_n(X)
		\cong
		\begin{cases}
			G_n & 1 \le n \le N \\
			0 & \text{otherwise}.
		\end{cases}
	\]
\end{problem}

\begin{problem}
	\label{prob:diagram_chase}
	Prove \Cref{thm:cellular_chase},
	showing that the homology groups of $X$
	coincide with the homology groups of the cellular chain complex.
	\begin{hint}
		You won't need to refer to any elements.
		Start with \[ H_2(X) \cong H_2(X^3) \cong
			H_2(X^2) / \ker \left[ H_2(X^2) \surjto H_2(X^3) \right], \] say.
		Take note of the marked injective and surjective arrows.
	\end{hint}
	\begin{sol}
		For concreteness, let's just look at the homology at $H_2(X^2, X^1)$
		and show it's isomorphic to $H_2(X)$.
		According to the diagram
		\begin{align*}
			H_2(X) &\cong H_2(X^3) \\
			&\cong H_2(X^2) / \ker \left[ H_2(X^2) \surjto H_2(X^3) \right] \\
			&\cong H_2(X^2) / \img \partial_3 \\
			&\cong \img\left[ H_2(X^2) \injto H_2(X^2, X^1) \right] / \img \partial_3 \\
			&\cong \ker(\partial_2) / \img\partial_3 \\
			&\cong \ker d_2 / \img d_3. \qedhere
		\end{align*}
	\end{sol}
\end{problem}

\begin{dproblem}
	\gim
	Let $n$ be a positive integer. Show that
	\[
		H_k(\RP^n)
		\cong
		\begin{cases}
			\ZZ & \text{if $k=0$ or $k=n\equiv 1 \pmod 2$} \\
			\Zc2 & \text{if $k$ is odd and $0 < k < n$} \\
			0 & \text{otherwise}.
		\end{cases}
	\]
	\begin{hint}
		There is one cell of each dimension.
		Show that the degree of $d_k$ is $\deg(\id)+\deg(-\id)$,
		hence $d_k$ is zero or $\cdot 2$ depending
		on whether $k$ is even or odd.
	\end{hint}
\end{dproblem}


\externaldocument{paper.tex}
\section{Experimental results} \label{sec:results}

	\subsection{Simulated data}

	Consider an intrinsic manifold $\mathcal{X}$ corresponding to a 2-dimensions square with a cross shaped hole in its center which makes it non-convex. This latent manifold is observed via the following observation function:
	\begin{equation} \label{eq:simulated_data_observation_function}
	\mathbf{y\left(\mathbf{x}\right)}=f\left(\mathbf{x}\right)=\text{\ensuremath{\left[\begin{array}{c}
			y_{1}\left(\mathbf{x}\right)\\
			y_{2}\left(\mathbf{x}\right)\\
			y_{3}\left(\mathbf{x}\right)
			\end{array}\right]}=}
		\left[\begin{array}{c}
	\sin \left(2.5 \cdot x_1 \right)\cdot \sin \left( x_2 \right)\\
	\sin \left(2.5 \cdot x_1 \right)\cdot \cos \left( x_2 \right)\\
	-\sin \left( x_2 \right)
	\end{array}\right]
	\end{equation}
	The observation function embeds the data in 3-dimensional Euclidean space by partially wrapping it on the unit sphere. The resulting observed manifold $\mathcal{Y}=\left\{ f\left(\mathbf{x}\right) \mid \mathbf{x}\in\mathcal{X}\right\}$ has the shape of a severed ball with a cross shaped hole in it. In order to generate the sample subsets $\mathcal{X}_{s}$ and $\mathcal{Y}_{s}$, $N=1000$ points are sampled uniformly with respect to $\mathcal{X}$.

	\subsubsection{Intrinsic isometric embedding} \label{ssec:simulated_data_Intrinsic_isometric_embedding}
	First we evaluate the validity of the intrinsic Euclidean distance estimation presented in \cref{eq:int_dist_approx} and the ability of the embedding method suggested in \cref{sec:Intrinsic-isometric-manifold-learning} to recover the latent geometric structure of the data, given the intrinsic metric over the observed manifold. To do so we analytically calculate $\frac{df}{dx}\left(\mathbf{x}_{i}\right)\frac{df}{dx}\left(\mathbf{x}_{i}\right)^{T}$ by taking the derivative of the observation function given in \cref{eq:simulated_data_observation_function} with respect to the intrinsic latent variable.

	The results of applying the suggested intrinsic isometric embedding algorithm on this data set are displayed in \cref{fig:punctured_severed_sphere}. In \cref{fig:punctured_severed_sphere_intrinsic} we present the intrinsic latent manifold in the intrinsic space and in \cref{fig:punctured_severed_sphere_observed} we present the observed manifold embedded in the observation space. In \cref{fig:punctured_severed_sphere_intrinsic_metric} we visualize the exact intrinsic metric (the push-forward metric) by plotting corresponding ellipses at several sample points. These  ellipses represent the images of circles of equal radius in the intrinsic space according to the estimated metric, this visualizes the amount of local stretch and contraction in each direction that the observed manifold experiences with respect to the latent intrinsic manifold . In \cref{fig:punctured_severed_sphere_intrinsic_dist_est} we plot the ground truth intrinsic Euclidean inter-point distances against the approximated inter-point distance using \cref{eq:int_dist_approx}, this results in a scatter plot where the closer a point is to the diagonal red line, the better the distance estimation of the corresponding intrinsic distance between the point pair is. In \cref{fig:punctured_severed_sphere_intrinsic_dist_est_knn} we plot the same distance estimation scatter plot but restrict the point pairs represented to distances to the selected $k$ nearest neighbors, which are the only distances which are taken into account by our suggested algorithm. For the following results we used $k=30$.

	In order to compare different manifold learning methods we plot for each method the resulting embedding and a scatter plot which for each point pair, compares the Euclidean distance in the resulting embedding to the true intrinsic Euclidean distance as measured in the intrinsic space. In general a concentration of point along the diagonal line represents a better embedding. In order to provide a single quantitative measure of the quality of the reconstruction , we also calculate for each embedding the Stress (\cref{eq:stress}) of the embedding with respect to the true intrinsic structure. These to graphs are plotted for standard Isomap (\cref{fig:punctured_severed_sphere_standard_isomap_embedding} and \cref{fig:punctured_severed_sphere_standard_isomap_stress}, intrinsic Isomap (\cref{fig:punctured_severed_sphere_standard_isomap_embedding} and \cref{fig:punctured_severed_sphere_intrinsic_isomap_stress}) and finally for our suggested intrinsic-isometric algorithm (\cref{fig:punctured_severed_sphere_intrinsic_isometric_embedding} and \cref{fig:punctured_severed_sphere_intrinsic_isometric_stress}).

	Similar results on several other synthetic data sets are provided as supplementary material \cref{ssec:Additional-results-manifold-learning}.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[b]{0.3\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/intrinsic}
				\caption{\label{fig:punctured_severed_sphere_intrinsic}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.3\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/observed}
				\caption{\label{fig:punctured_severed_sphere_observed}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.3\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/metric_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_metric}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.45\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/dist_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_dist_est}}
			\end{subfigure}
			\hfill
			\begin{subfigure}[b]{0.45\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/dist_local_dense_knn}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_dist_est_knn}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/standard_isomap_embedding}
				\caption{\label{fig:punctured_severed_sphere_standard_isomap_embedding}}
			\end{subfigure} \hfill
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/embedding_intrinsic_isomap_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_isomap_embedding}}
			\end{subfigure} \hfill
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/embedding_intrinsic_isometric_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_isometric_embedding}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/standard_isomap_stress}
				\caption{\label{fig:punctured_severed_sphere_standard_isomap_stress}}
			\end{subfigure}
			\hfill
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/stress_intrinsic_isomap_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_isomap_stress}}
			\end{subfigure}
			\hfill
			\begin{subfigure}[b]{0.32\linewidth}
				\includegraphics[width=1\linewidth]{figures/Chapter_3/cross_punctured_2d_square_severed_sphere/stress_intrinsic_isometric_local_dense}
				\caption{\label{fig:punctured_severed_sphere_intrinsic_isometric_stress}}
			\end{subfigure}
		\end{centering}
		\caption{\label{fig:punctured_severed_sphere} Punctured severed sphere (embedding). \protect\subref{fig:punctured_severed_sphere_intrinsic} Intrinsic space.
		\protect\subref{fig:punctured_severed_sphere_observed} Observed space.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_metric} Intrinsic metric.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_dist_est} Intrinsic distance approximation.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_dist_est_knn} Intrinsic distance approximation - $k$-NN only.
		\protect\subref{fig:punctured_severed_sphere_standard_isomap_embedding} Standard Isomap embedding.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_isomap_embedding} Intrinsic Isomap embedding.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_isometric_embedding} Intrinsic Isometric embedding.
		\protect\subref{fig:punctured_severed_sphere_standard_isomap_stress} Standard Isomap Stress.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_isomap_stress} Intrinsic Isomap Stress.
		\protect\subref{fig:punctured_severed_sphere_intrinsic_isometric_stress} Intrinsic Isometric Stress.
		}
	\end{figure}

	As expected we see that the distance approximation is indeed valid for short distances for which the manifold is approximately linearly distorted, additionally we see that geodesic distance approximation does not suffer from this since geodesics can be calculated using only local distance information. Finally we see that the  non-convexity of the intrinsic dataset does indeed cause a distortion in the intrinsic isometric embedding when compared to the ground truth.

	\subsubsection{Metric estimation}

	Next we analyze the effect of using an intrinsic metric estimated from the observed data as opposed to using the exact intrinsic metric (as was the case in \cref{ssec:simulated_data_Intrinsic_isometric_embedding}). To do so we use the same example used in the previous sub-section under the setting described in \cref{ssec:Intrinsic-isotropic-GMM} with either $N_{i}=5$ or $N_{i}=200$ measurements made at each sample point, sampled from a isotropic Gaussian probability distribution centered at the sample point with intrinsic variance $\sigma_{int}^{2}=0.03^{2}$ in the intrinsic space. Additionally observation noise is added with variance $\sigma_{obs}^{2}=0.03^{2}$.

	In \cref{fig:metric_punctured_severed_sphere} we compare the trivial local estimation (as described in \cref{ssec:Intrinsic-isotropic-GMM}) and the global estimation approach implemented via a \ac{ANN} which is suggested in this paper (\cref{sec:Intrinsic-Metric-Estimation}). For each metric estimation method we plot, similarity to the previous sub-section, a visualization of the metric via ellipsis, a scatter plot of the true intrinsic distance against the approximated intrinsic distances, the resulting low-dimensional embedding and the scatter plot of the Euclidean distances in the embedding compared to the true intrinsic distance ,including a calculation of the Stress value. These are produced for the case of local estimation with dense sampling $N_{i}=200$ (\cref{fig:1a}, \cref{fig:1d}, \cref{fig:1g}, \cref{fig:1j}), for the case of sparse sampling (\cref{fig:1b}, \cref{fig:1e}, \cref{fig:1h}, \cref{fig:1k}) and finally for our sugestedd global metric estimation method (\cref{fig:1c}, \cref{fig:1f}, \cref{fig:1i}, \cref{fig:1l}).

	Similar results on several other synthetic data sets are provided as supplementary material \cref{ssec:Additional-results-manifold-learning}.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/metric_local_dense}
					\caption{\label{fig:1a}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/metric_local}
					\caption{\label{fig:1b}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/metric_net}
					\caption{\label{fig:1c}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/dist_local_dense}
					\caption{\label{fig:1d}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/dist_local}
					\caption{\label{fig:1e}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/dist_net}
					\caption{\label{fig:1f}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/embedding_intrinsic_isometric_local_dense}
					\caption{\label{fig:1g}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/embedding_intrinsic_isometric_local}
					\caption{\label{fig:1h}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/embedding_intrinsic_isometric_net}
					\caption{\label{fig:1i}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/stress_intrinsic_isometric_local_dense}
					\caption{\label{fig:1j}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/stress_intrinsic_isometric_local}
					\caption{\label{fig:1k}}
			\end{subfigure}\hfill
			\begin{subfigure}[b]{0.32\linewidth}
					\includegraphics[width=1\textwidth]{figures/Chapter_4/cross_punctured_2d_square_severed_sphere/stress_intrinsic_isometric_net}
					\caption{\label{fig:1l}}
			\end{subfigure}
		\end{centering}

	\caption{Punctured severed sphere (metric estimation).
		\protect\subref{fig:1a} True intrinsic metric.
		\protect\subref{fig:1b} Locally estimated intrinsic metric.
		\protect\subref{fig:1c} Net learned intrinsic metric.
		\protect\subref{fig:1d} Distance estimation using true metric.
		\protect\subref{fig:1e} Distance estimation using locally estimated metric.
		\protect\subref{fig:1f} Distance estimation using net estimated metric.
		\protect\subref{fig:1g} Embedding using true intrinsic metric.
		\protect\subref{fig:1h} Embedding using locally learned intrinsic metric.
		\protect\subref{fig:1i} Embedding using net learned intrinsic metric.
		\protect\subref{fig:1j} Embedding stress using true intrinsic metric.
		\protect\subref{fig:1k} Embedding stress using locally estimated intrinsic metric.
		\protect\subref{fig:1l} Embedding stress using net learned intrinsic metric}

	\label{fig:metric_punctured_severed_sphere}
	\end{figure}

	We see that the estimations in the sparse case are ``noisy'' and can sometimes change abruptly between similar locations on the manifold. This noisiness in the estimated distances adversely effects the intrinsic distance estimation is the cornerstone of the algorithm suggested in \cref{sec:Intrinsic-isometric-manifold-learning} this of course damages the results of the intrinsic-isometric learned representation. Similar results on several other synthetic data sets are provided as supplementary material.

	\subsection{Localization in sensor networks}
	\label{ssec:localization}

	In \cref{sec:motivation} we provided initial motivation for our work through the simple and intuitive example of localization in sensor networks. We now revisit this example and discuss in detail how the manifold learning algorithm proposed in this work can be applied to this problem.

	In this experiment, we simulate positioning of an agent using observations with an unknown model, which is intended to represent the setting encountered for indoor positioning. Through this experiment we examine the advantages of intrinsic geometry preservation and demonstrate its relevance to complex, high-dimensional and realistic scenarios.

	\subsubsection{Experiment setting}
	\label{sssec:Experiment-setting}

	The experimental setting is as follows: An agent is allowed to be located within a compact, path-connected subset $\mathcal{X}$ of $\mathbb{R}^{2}$ which represents a closed indoor environment. The shape of $\mathcal{X}$ used in this experiment is depicted in \cref{fig:Indoor-environment-shape}. At each point $\mathbf{x}\in\text{\ensuremath{\mathcal{X}}}$ a number of measurements of different modalities (which will be described later) are observed. These observations are such that they are only effected by the locations where the measurements are made (and possibly some additional noise which is assumed to be uncorrelated with the location). Such observations are made in enough different locations so that $\mathcal{X}$ is completely covered. The dimension of the intrinsic vector space is $n=2$ corresponding to the two dimensional physical space and the dimension of the observation space depends on the dimensionality of observation function output but is in general high-dimensional.

	\begin{figure}[h]
		\begin{centering}
			\includegraphics[scale=0.5]{figures/Chapter_5/apt_geometry}
		\end{centering}
		\caption{Outline of the intrinsic manifold which represents a confined indoor environment \label{fig:Indoor-environment-shape}}
	\end{figure}

	As discussed in \cref{sec:Intrinsic-Metric-Estimation}, in order to uncover the intrinsic metric of the manifold from the observed data, we require the intrinsic data sampling to adhere to some known structure. For this experiment the intrinsic sampling is assumed to be acquired by the use of a rigid sensor array, as described in \cref{ssec:Rigid-sensor-array}. The sensor array used consists of measurement points with a structure that corresponds to measurements in two orthogonal directions with $15cm$ distance between measurements as illustrated in \cref{fig:sensor_array_localization} and depicts the points at which measurements were performed for a sub-set of 13 sampling points.

	\subsubsection{Sensor modalities}

	To stress the fact that our algorithm is invariant with respect to the sensor modality (i.e to the specific observation function used), we perform simultaneous observations using multiple
	different modalities.

	In what follows we only discuss two vision related modalities, however results for other modalities are included in the supplementary material \cref{ssec:additional-results-localization}.

	\subsubsection*{Color camera}
		\label{sssec:Color-camera}

	This modality simulates a camera mounted on the agent which shows the environment from the point of view of the agent. To accomplish this, we used ``Blender'', a professional, freely available and open-source 3-dimensional graphics software. Using ``Blender'' \url{www.blender.org}, we constructed a 3-dimensional model mimicking the interior of an apartment. The created model is shown in \cref{fig:3D-model-in}. The regions of the model in which there are no objects and in which the simulated agent is allowed to move, correspond to the shape of $\mathcal{X}$ presented in \cref{fig:Indoor-environment-shape}.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[b]{0.45\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/blue_print}
			\end{subfigure} \hfill
			\begin{subfigure}[b]{0.45\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/blue_print_3d}
			\end{subfigure}
		\end{centering}
		\caption{3-dimensional model in Blender\label{fig:3D-model-in}}
	\end{figure}

	``Blender'' allows us to render an image of the model as seen via a virtual camera. Using this ability, we produce a set of 360 degree panoramic color images of size $128\times256$ pixels, taken from the point of view of the agent as seen in \cref{fig:Room-from-Agent's}. These images serve as an observation of the location of the agent. Slight variations in the location of the agent cause slight variations in the point of view of the camera and therefore in the produced image, as seen in \cref{fig:sensor_array_localization}. These slight observed variations, combined with our assumption about the intrinsic structure of the data allow us to infer the local intrinsic metric.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_view_1}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_view_2}
			\end{subfigure}
		\end{centering}

		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_view_3}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_view_4}
			\end{subfigure}
		\end{centering}
		\caption{Samples of generated panoramic color images}
		\label{fig:Room-from-Agent's}
	\end{figure}

	\begin{figure}[h]
		\begin{centering}
			\includegraphics[width=1\textwidth]{figures/Chapter_5/sensor_array/small_var}
		\end{centering}
		\caption{Observation points using a rigid sensor array for a subset of 13 sample points. On the right, one can see the effect of slight variations in agents position on the viewed panoramic images \label{fig:sensor_array_localization}}
	\end{figure}

	One of the requirements of the algorithm presented in \cref{sec:Intrinsic-isometric-manifold-learning}, was that the observations need to only be a function of the latent variable, which in this case is the 2-dimensional location of the agent. Panoramic images produced at the same location but starting from different angles would be cyclically rotated with respect to each other, thus violating this requirement. To overcome this, we make these observations invariant to cyclical rotation on the horizontal axis. We implement this in the frequency domain by applying a Fourier transform to each frame and then estimating and removing the linear phase in the horizontal direction. Since cyclical rotations in the horizontal axis are equivalent to an addition of linear phase in the Fourier domain, this makes the observation invariant to the initial cyclical rotation.

	In order to reduce the initial dimensionality of the data, \ac{PCA} was performed and only the first 100 principle components were taken since these practically contained all the energy/power in the data.

	Images are used as inputs to our algorithm since this represents a possible realistic setting and since it is a non-liner sensor modality which is easy to simulate using 3-dimensional
	modeling software. We wish to emphasis however, that after the per-processing stage in which these images are made invariant to cyclical rotations, the input is no longer treated as an image, and our proposed algorithm uses no additional image or computer vision related computation on the input. This invariance of the algorithm to the input type, allows us to perform the additional stage of dimensionality reduction using \ac{PCA} which would otherwise not be possible since it ``strips'' the input of its image structure.

	\subsubsection*{Depth Camera}

	An additional sensor modality, which is also produced using ``Blender'', is a gray-scale depth map, where the gray level at each pixel represents the distance, in that pixels direction, from the observing camera to the nearest object. Several examples of such images are shown in \cref{fig:Panoramic-depth-images}. Since the geometry of the image acquisition model is similar, the need for imposing invariance to cyclical rotation in the horizontal axis arises again and we perform the same per-processing stages described in \cref{sssec:Color-camera}. The dimensionality of the input is also reduced using \ac{PCA} to 40 principle component since this accounts for almost all of the observed energy/power in the data.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_depth_1}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_depth_2}
			\end{subfigure}
		\end{centering}

		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_depth_3}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/roomba_depth_5}
			\end{subfigure}
		\end{centering}
		\caption{Samples of generated panoramic depth maps \label{fig:Panoramic-depth-images}}
	\end{figure}

	\subsubsection{Results}

	For each of the four modalities described above $N=1000$ intrinsic points were sampled, 3 measurement were made around each such location using the sensor array described, a 2-dimensional embedding was constructed using our proposed algorithm and using the standard Isomap methods. Results are presented in \cref{fig:Color-image-observations}, \cref{fig:Depth-image-observations}.

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/intrinsic}
				\caption{\label{fig:3a}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/regular_isomap_embedding}
				\caption{\label{fig:3b}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/dist_local}
				\caption{\label{fig:3c}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/dist_local_knn}
				\caption{\label{fig:3d}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/intrinsic_isometric_local}
				\caption{\label{fig:3e} \label{fig:bend1}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/color/intrinsic_isometric_local_stress}
				\caption{\label{fig:3f}}
			\end{subfigure}
		\end{centering}
		\caption{Color image observations\label{fig:Color-image-observations}.
			\protect\subref{fig:3a} Intrinsic space.
			\protect\subref{fig:3b} Embedding using standard Isomap.
			\protect\subref{fig:3c} Intrinsic Euclidean distance estimation.
			\protect\subref{fig:3d} Intrinsic Euclidean distance estimation ($k$-NN).
			\protect\subref{fig:3e} Intrinsic-isometric embedding.
			\protect\subref{fig:3f} Euclidean distance discrepancy and stress in resulting embedding}
	\end{figure}

	\begin{figure}[h]
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/intrinsic}
				\caption{\label{fig:4a}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/regular_isomap_embedding}
				\caption{\label{fig:4b}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/dist_local}
				\captionsetup{justification=centering}
				\caption{\label{fig:4c}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/dist_local_knn}
				\caption{\label{fig:4d}}
			\end{subfigure}
		\end{centering}
		\begin{centering}
			\begin{subfigure}[t]{0.47\columnwidth}%
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/intrinsic_isometric_local}
				\caption{\label{fig:4e} \label{fig:bend2}}
			\end{subfigure}\hfill
			\begin{subfigure}[t]{0.47\columnwidth}
				\includegraphics[width=1\textwidth]{figures/Chapter_5/depth/intrinsic_isometric_local_stress}
				\caption{\label{fig:4f}}
			\end{subfigure}
		\end{centering}
		\caption{Depth image observations \label{fig:Depth-image-observations}.
			\protect\subref{fig:4a} Intrinsic space.
			\protect\subref{fig:4b} Embedding using standard Isomap.
			\protect\subref{fig:4c} Intrinsic Euclidean distance estimation.
			\protect\subref{fig:4d} Intrinsic Euclidean distance estimation ($k$-NN).
			\protect\subref{fig:4e} Intrinsic-isometric embedding.
			\protect\subref{fig:4f} Euclidean distance discrepancy and stress in resulting embedding}
	\end{figure}

	Our proposed algorithm accurately retrieves the intrinsic structure for all observation modalities. This is evident by fact that the intrinsic-isometric embedding structure is almost identical to the structure of the sampled points in the intrinsic space (can be observed for both modalities by comparing \cref{fig:3a} to \cref{fig:3e} and by comparing \cref{fig:4a} to \cref{fig:4e}) and from the fact that most inter-point distances in the final embedding closely approximate the true intrinsic Euclidean distance which also leads to a low stress value for the embedding (as can be observed for both modalities in \cref{fig:3f} and \cref{fig:4f}). The success of the embedding stems form the fact that the estimated intrinsic metric allows for a good estimation of short-range intrinsic distances (as can be observed for both the modalities in \cref{fig:3c}, \cref{fig:3d}, \cref{fig:3c} and \cref{fig:3d}). We notice that since the observation functions used are not locally isometric, standard Isomap fails to retrieve the intrinsic structure of the data or to even provide a 2-dimensional parameterization of the intrinsic space (as can be observed for all the modalities in \cref{fig:3b} \cref{fig:4c}). Isomap does, for the most part, preserve proximity on a local scale (can be observed by points with similar colors being embedded close to each other) but global structure is not preserved (as can be observed for all the modalities by comparing \cref{fig:3a} and \cref{fig:3b} and \cref{fig:4a} and \cref{fig:4b}). Since standard Isomap is non-intrinsic, it is effected by the modality of the observation and we receive a different embeddings for different sensor modalities (as can be observed by comparing \cref{fig:3b} and \cref{fig:3d}).

	One noticeable weak point of our algorithm, which manifests slightly in these examples, occurs around the coordinate $\left(9,4\right)$ in the true intrinsic space (\cref{fig:3a} and \cref{fig:4a}). This region corresponds to a narrow area in the apartment model in which there are not a lot of sample points. Errors in distance estimations for these points are not ``balanced'' or ``countered'' by distance constrains in other regions of the apartment since no other distance constraints influence this region. This leads to a slight distortion in the embedding of this region which causes a ``bend'' in the global structure of the embedding (as seen in \cref{fig:bend1} and \cref{fig:bend2}).

	These results show that our proposed intrinsic-isometric dimensionality reduction algorithm could be successfully applied to the problem of localization and mapping. While this application might fall into the much researched subject of indoor mapping and localization, we wish to remark that we make no claim that this algorithm is superior or even comparable to existing algorithms tailored to specific measurement modalities or to machine learning tools trained on labeled data-sets. Our algorithms advantage that it is completely unsupervised and modality invariant which makes it especially suitable for setting where one wants to use an automatic algorithm for localization or/and when the observation model is unknown; which is often the case with indoor localization.


\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[a4paper, total={6.25in, 8in}]{geometry}
\usepackage[section]{placeins}
\usepackage{float}

\title{CS 660: Programming Assignment 3}
\author{Derek Jones}

\begin{document}
\maketitle

	\section{Part 1}]
In Part 1 of the assignment, a set of 3 dimensional world coordinates and 10 sets of camera coordinates were provided. The task was to estimate a camera projection matrix that maps a 3 dimensional world coordinate to a particular coordinate in a camera's image space. The projection matrices $M$ were found by minimizing the following set of equations:
\begin{equation}
x_i = \frac{p_{00}X_{i} + p_{01}Y_{i} + p_{02}Z_{i} + p_{03}}{p_{20}X_{i} + p_{21}Y_{i} + p_{22}Z_{i} +p_{23}}
\end{equation}
\begin{equation}
y_i = \frac{p_{10}X_{i} + p_{11}Y_{i} + p_{12}Z_{i} + p_{13}}{p_{20}X_{i} + p_{21}Y_{i} + p_{22}Z_{i} +p_{23}}
\end{equation}

	\section{Part 2}
For Part 2 of the assignment, using the provided set of matches for each image pair, a fundamental matrix was estimated for each image pair that maps each point in a particular image to an epipolar line in the other image. Given sets of match points, $\mathbf{x}_{0}$ \& $\mathbf{x}_{1}$,the fundamental matrix was estimated by solving the following system of equations:
	\begin{equation}
		\mathbf{x}_{1}^{T}\mathbf{F}\mathbf{x}_{0} = 0
	\end{equation}
Once the fundamental matrix $F$ was computed, RANSAC was implemented in order to choose the matrix $F$ that contained the largest number of \emph{inlier} matches. Once the optimal $F$ was computed, it was recomputed using its inlier matches. The results for each image pair are given in the subsequent sections.

		\section{Notre Dame Results}

		The fundamental matrix $F$ for the Notre Dame image pair was computed using RANSAC with a maximum of 5000 iterations, a minimum of 300 inliers, and a match error tolerance of $\epsilon = 0.1$. The results for the Notre Dame images capture a large number of match points and seem to be fairly accurate, although they do not exactly replicate the output of the provided ground truth fundamental matrix.

Based upon the epipolar line estimations, the results for matching the inliers generated a fairly accurate result with few spurrious matches present in the final output. It is assumed that with a greater error tolerance and more iterations, a more accurate fundamental matrix could be computed.

\begin{center}
\begin{figure}[H]
  \centering
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.25]{notre_dame_img1_epipolar_lines.jpg}
    \caption{Image 1 epipolar lines.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.25]{notre_dame_img2_epipolar_lines.jpg}
    \caption{Image 2 epipolar lines.}
  \end{minipage}
\end{figure}
\end{center}

\begin{center}
\begin{figure}[H]
			\includegraphics[scale = 0.35]{notre_dame_estimated_matches.jpg}
\caption{Notre Dame estimated matches.}
\end{figure}
\end{center}

		\section{Episcopal Gaudi Results}

	The results for the Episcopal Gaudi epipolar lines were not as accurate, in terms of captured inliers, as compared to the Notre Dame and Mount Rushmore results. The fundamental matrix for the Episcopal Gaudi image pair was computed using a maximum of 5000 iterations, a minimum of 40 inliers, and an error tolerance of $\epsilon = 1$.

The results for the Episcopal Gaudi image pair resulted in fairly accurate matches, however a few spurrious matches remain. To counter this, more iterations of RANSAC could be used to try a larger number of possible estimates and the error tolerance could be decreased to attempt to force more accurate matches. Decreasing the error tolerance may also result in fewer inliers, producing fewer matches in the output.

\begin{center}
\begin{figure}[H]
  \centering
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.2]{episcopal_gaudi_img1_epipolar_lines.jpg}
    \caption{Image 1 epipolar lines.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.2]{episcopal_gaudi_img2_epipolar_lines.jpg}
    \caption{Image 2 epipolar lines.}
  \end{minipage}
\end{figure}
\end{center}

\begin{center}
\begin{figure}[H]
			\includegraphics[scale = 0.2125]{episcopal_gaudi_estimated_matches.jpg}
\caption{Episcopal Gaudi estimated matches.}
\end{figure}
\end{center}

		\section{Mount Rushmore Results}

The fundamental matrix for the Mount Rushmore image pair was computed with RANSAC using a maximum of 5000 iterations, a minimum of 300 matches, and an error tolerance of $\epsilon = 0.1$. An immediate problem is that the provided set of matches only contains 245 match pairs, meaning that the algorithm will always take 5000 iterations before terminating. Nonetheless, the results for the Mount Rushmore image pair appeared to be the most accurate.

In particular, the matches for the Mount Rushmore image pair contain few spurrious matches. It is believed that since the algorithm completed 5000 iterations with a relatively low error tolerance, a fairly accurate set of inliers were found, resulting a good estimation of the fundamental matrix.

\begin{center}
\begin{figure}[H]
  \centering
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.2]{mount_rushmore_img1_epipolar_lines.jpg}
    \caption{Image 1 epipolar lines.}
  \end{minipage}
  \hfill
  \begin{minipage}[b]{0.4\textwidth}
    \includegraphics[scale=0.2]{mount_rushmore_img2_epipolar_lines.jpg}
    \caption{Image 2 epipolar lines.}
  \end{minipage}
\end{figure}
\end{center}

\begin{center}
\begin{figure}[H]
			\includegraphics[scale = 0.25]{mount_rushmore_estimated_matches.jpg}
\caption{Mount Rushmore estimated matches.}
\end{figure}
\end{center}

	\section{Remarks}
	Each of the requested outputs are contained within the source code directory, estimations of the camera intrinsic matrices are also included.
		A notable issue that arose during the implementation was the speed of the RANSAC algorithm. Specifically, the problem of speed occurs in the subroutine in which the pairwise distances between each point and epipolar line are computed. This function requires $\mathcal{O}(n^{2})$ comparisons FOR EACH iteration of the RANSAC algorithm, requiring RANSAC to have a total worst case execution time proportional to $\mathcal{O}(mn^{2})$ where $n$ is equivalent to the number of matches and $m$ is equivalent to the number of RANSAC iterations. As a consequence, parameter optimization was less than ideal. It was later discovered that the algorithm primarily had difficulties with the Notre Dame matches as there were a rather large number, but performed quite well on the Episcopal Gaudi and Mount Rushmore match sets with fewer total matches.

		Additionaly, finding the correct RQ decomposition proved to be challengin when attempting to estimate the intrinsic camera matrix (and rotation matrix). I was not able to spend more time understanding how exactly the RQ decomposition algorithm functions, however I included my results for these items in the code.
		Helper code for drawing the matches, drawing the epipolar lines, and for computing the RQ decomposition were utilized from outside sources with the references included in each function.

\end{document}


\begin{definition}[Labelled Transistion System]
	A \emph{Labelled Transition System (LTS)} is a tuple
	\[
		\left(\proc,\act,\left\lbrace\xrightarrow{\alpha} \middle\vert \alpha\in\act\right\rbrace\right)
	\]
	where $ \proc $ is a set of states, $ \act $ is a set of actions, for each $ \alpha\in\act $, $ \xrightarrow{\alpha} \subseteq \proc\times\proc $ is a binary relation called \emph{transition relation}.
\end{definition}
\subsection*{Notation}
We can extend $ \xrightarrow{\alpha} $ from labels $ \alpha\in\act $ to words $ w\in\act^* $
\begin{itemize}
	\item $ p\xrightarrow{\varepsilon}p $, for every $ p\in\proc $
	\item $ p\xrightarrow{\alpha w}p' $, if there is $ p''\in\proc $, such that $ p\xrightarrow{\alpha}p'' $ and $ p''\xrightarrow{w}p' $ for every $ p,p'\in\proc $, $ \alpha\in\act $, and $ w\in\act^* $.
\end{itemize}
Other notation
\begin{itemize}
	\item $ \rightarrow = \left\lbrace(p,p')\middle\vert \text{ if } p\xrightarrow{\alpha}p'\text{, for some } \alpha\in\act\right\rbrace$
	\item $ \rightarrow^* $ is the \emph{reflexive} and \emph{transitive} closure of $ \rightarrow $
	\item $ p\xrightarrow{\alpha} $~~ if there exist $ p'\in\proc $ such that $ p\xrightarrow{\alpha}p' $
	\item $ p\cancel{\xrightarrow{\alpha}} $~~ if there is no $ p'\in\proc $ such that $ p\xrightarrow{\alpha}p' $
\end{itemize}

Modeling and Verification - Reference/LTS.tex


\subsection{Unconstrained envelope theorem}

Consider a function which takes two parameters:

\(f(x,\alpha \)

We want to choose \(x\) to maximise \(f\), given \(\alpha \).

\(V(\alpha )=\sup_{x\in X}f(x,\alpha )\)

There is a subset of \(X\) where \(f(x,\alpha )=V(\alpha )\).

\(X^*(\alpha )=\{x\in X|f(x, \alpha )=V(\alpha )\}\)

This means that \(V(\alpha )=f(x^*,\alpha )\) for \(x^*\in X^*\).

Let’s assume that there is only one \(x^*\).

\(V(\alpha )=f(x^*,\alpha )\)

What happens to the value function as we relax \(\alpha\)?

\(V_{\alpha_i}(\alpha )=f_{\alpha_i}(x^*(\alpha ),\alpha )\).

\(V_{\alpha_i}(\alpha )=f_x\dfrac{\delta x^*}{\delta \alpha }+f_{\alpha_i}\).

We know that \(f_x=0\) from first order conditions. So:

\(V_{\alpha_i}(\alpha )= f_{\alpha_i}\).

That is, at the optimum, as the constant is relaxed, we can treat the \(x^*\) as fixed, as the first-order movement is \(0\).