%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Master Thesis in Mathematics
% "Immersions and Stiefel-Whitney classes of Manifolds"
% -- Chapter 2: General Obstructions by Characteristic Classes --
%
% Author: Gesina Schwalbe
% Supervisor: Georgios Raptis
% University of Regensburg 2018
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Results on the Stiefel-Whitney Classes of Manifolds}
\label{chap:massey}
% Review the theory of Stiefel-Whitney classes and the properties of the
% Steenrod algebra (as needed). Give a careful and detailed exposition of
% the proof of Massey’s theorem. Explain that the estimate in Massey’s
% theorem is the best possible in general.
% [massey], [immersionconj]
Recall from Corollary~\ref{cor:obstruction} that a manifold can
only immerse in codimension $k$ if its dual Stiefel-Whitney classes in
degrees higher than $k$ are zero.
This chapter is dedicated to the proof of a theorem by Massey
\cite{massey}, which says that this obstruction vanishes in general for
$k=n-\alpha(n)$ (\autoref{sec:massey}), and that this is the best
possible general result (\autoref{sec:bestpossibleresult}), \idest for
$k<n-\alpha(n)$ there are examples of manifolds not immersing into
$\R^{n+k}$.

The preliminary work for Massey's theorem encompasses a review on
Steenrod squares in \autoref{sec:steenrodsquares}, and the
investigation of Wu characteristic classes in
\autoref{sec:wuclassesmain}.
In the course of this a couple of other important results on
Stiefel-Whitney classes of manifolds are discussed.
Most notably, Wu's formula on their relation to the Wu
characteristic classes is proven in \autoref{sec:wutheorem}

\section{Steenrod Squares}\label{sec:steenrodsquares}
Similar to the cup and cap product Steenrod squares add further
structure to the cohomology ring, thus adding more tools to
differentiate spaces by means of cohomology.
As applications, they will serve in constructing two kinds of
characteristic classes, the Stiefel-Whitney and the Wu classes, and
are a key ingredient for the proof of Massey's theorem on obstructions
for normal bundles of manifolds.

The following definition is due to
Steenrod and Epstein \cite[Chap.~I.1, p.~1]{steenrodepstein}.
\begin{Def}\label{def:sq}
  The \emph{Steenrod squares} $\Sq i$ for $i\in\Nat$ are each a family
  of cohomology operations, \idest families of homomorphisms, of the
  form
  \begin{gather*}
    \left(
      \Sq i\colon \H^n(X, A;\Zmod2) \to \H^{n+i}(X, A;\Zmod2)
      \middlemid
      n\in\Nat
    \right)
  \end{gather*}
  that satisfy the following relations for any pair of spaces $(X,A)$, and any map of
  pairs of spaces $f\colon (X,A)\to (Y,B)$:
  \begin{description}
  \item[(Naturality)]\label{item:sqnaturality}
    $\pb f\circ\Sq i = \Sq i\circ\pb f$.
  \item[(Stability)]\label{item:sqstability}
    $\susp\circ\Sq i = \Sq i\circ\susp$
    where $\susp$ is the suspension isomorphism on cohomology.
  \item[(Cartan formula)] For any $n\in\Nat$, and $x,y\in \H^n(X)$ holds
    \begin{gather}\label{tag:cartan}\tag{Cartan's formula}
      \Sq i(x\cup y) = \sum_{r+s=i}\Sq r(x)\cup\Sq s(y)
    \end{gather}
  \item[(Fixed values)] The following values are fixed for $x\in \H^n(X,A)$:
    % \begin{gather}\label{eq:sqlowerbound}
    %   \Sq i(x) = \begin{cases}
    %     0 & n<i \\
    %     x^2 & n=i
    %   \end{cases}
    %   \qquad\text{and}\qquad
    %   \Sq i = \begin{cases}
    %     \Id & i=0\\
    %     \beta & i=1
    %   \end{cases}
    % \end{gather}
    \begin{alignat}{4}
      \Sq i(x) &= 0     & \qquad\text{for }n<i \label{eq:sqlowerbound}\\
      \Sq i(x) &= x^2   & \qquad\text{for }n=i \label{eq:sqsquared}\\
      \Sq 0    &= \Id   \label{eq:sqidentity}
      % \\\notag
      % \Sq 1    &= \beta \label{eq:sqbockstein}
    \end{alignat}
    % where $\beta$ denotes the Bockstein homomorphism
    % \cite[see \forexample][Chap.~3.E]{hatcher} of the exact
    % coefficient sequence
    % \begin{center}
    %   \begin{tikzcd}
    %     0 \ar[r]
    %     &\Zmod2 \ar[r,"\incl"]
    %     &\Zmod4 \ar[r,"\proj"]
    %     &\Zmod2 \ar[r]
    %     &0
    %   \end{tikzcd}
    % \end{center}
  \item[(Adem relations)] For $\alpha<2\beta$ holds
    \begin{gather}\label{tag:adem}\tag{Adem's formula}
      \Sq\alpha \circ \Sq\beta =
      \sum_{j=0}^{\left\lfloor \frac \alpha 2 \right\rfloor}
      \binom{\beta-j-1}{\alpha-2j}
      \Sq{\alpha+\beta+j}\Sq{j}
    \end{gather}
  \end{description}
  The formal sum of all Steenrod squares
  $\SQ\coloneqq\sum_{j\in\Nat}\Sq j$ is called the \emph{total Steenrod square}.
  Note that for any degree $n\in\Nat$ the total Steenrod square
  $\SQ\colon \H^n(X)\to \H^*(X)$ is well-defined since the sum is
  finite by \eqref{eq:sqlowerbound}.
  Also \ref{tag:cartan} can be reformulated to
  \begin{gather*}
    \SwapAboveDisplaySkip
    \SQ(x\cup y) = \SQ(x)\cup\SQ(y)
    \;,
  \end{gather*}
  \idest $\SQ$ is a group
  homomorphism with respect to the cup\nbd{}product.
\end{Def}

\begin{Thm}
  The Steenrod squares exist and are uniquely determined by
  naturality, \ref{tag:cartan}, and the fixed values
  %\eqref{eq:sqlowerbound}, \eqref{eq:sqsquared}, and
  %\eqref{eq:sqidentity}
  from Definition~\ref{def:sq}.
  \begin{proof}
    For existence see \cite[Chapter 2]{mosher},
    for uniqueness see \cite[VIII §3]{steenrodepstein}.
  \end{proof}
\end{Thm}

The fact that Steenrod squares, or in general cohomology operations,
can be added and concatenated, already gives a hint that they might
form a ring, which was proven by Steenrod. The following notation and
facts are according to \cite[Chap.~6]{mosher}.
\begin{Def}\label{def:steenrodalgebra}
  The \emph{Steenrod algebra} $\A$ is the quotient
  of the graded $\Zmod2$\nbd{}polynomial algebra
  $\Zmod2[\Sq i\mid i\in\Nat]$ with grading $\deg \Sq i\coloneqq i$
  by the two-sided relations of both \ref{tag:adem} and $\Sq 0=1$.
  With the induced grading, multiplication, and the diagonal defined
  by
  \begin{gather*}
    \SwapAboveDisplaySkip
    \A\longto \A\otimes\A
    \;,\qquad
    \Sq i\longmapsto\sum_{r+s=i}\Sq r\otimes\Sq s
    \;,
  \end{gather*}
  it is an associative, connected, non-commutative graded Hopf algebra
  over $\Zmod2$.
\end{Def}
\begin{Not}
  In the following, iterated Steenrod squares
  $\Sq{i_1}\cdot\Sq{i_2}\dotsm\Sq{i_l}$ will have the short form
  $\Sq{(i_1,i_2,\dotsc,i_l)}$,
  and will be evaluated on an element $x$ of a cohomology ring as
  $\Sq{i_1}\circ\dotsb\circ\Sq{i_l}(x)$ respecting the
  properties from Definition~\ref{def:sq}.
  Furthermore, for a sequence $I=(i_1,\dotsc,i_l)$,
  respectively $\Sq I$, denote by
  \begin{compactdescription}[labelindent=1em]
  \item[$\l(I)\coloneqq l$] the \emph{length} of $I$,
  \item[$\d(I)\coloneqq \sum_{j=1}^{l} i_j$] the \emph{degree} of $I$,
    and by
  \item[$\e(I)\coloneqq 2i_1-\d(I)=\sum_{j=1}^{l-1}(i_j-2i_{j+1})$]
    the \emph{excess} of $I$.
  \end{compactdescription}
  The sequence $I$, respectively $\Sq I$, is called \emph{admissible},
  if $\l(I)=1$ or $i_j\geq 2i_{j+1}$ for $0\leq j<\l(I)$.
\end{Not}
\begin{Rem}\label{rem:sq}
  The following properties will be needed for Massey's Theorem:
  \begin{enumerate}
  \item The set of iterated Steenrod squares $\Sq I$ of admissible
    sequences $I$ forms a basis for $\A$ as $\Zmod2$\nbd{}vector space
    \cite[Chap.~6, Theorem~1]{mosher}.
  \end{enumerate}
  Let $I=(i_1,\dotsc,i_l)$ be a sequence in $\Nat$.
  \begin{enumerate}[resume]
  \item $\deg(\Sq I(x)) = \deg(x) + \d(\Sq I)$.
  \item\label{item:squpperboundgeneral}
    $\Sq I(x) = 0$ for $\deg(x)<\e(I)$ if $I$ is admissible.
  \end{enumerate}
  \begin{proof}
    The non-obvious part~\ref{item:squpperboundgeneral} follows by
    induction over $\l(I)$ using \eqref{eq:sqlowerbound}:
    The case $\l(I)=1$ is \eqref{eq:sqlowerbound}.
    For $\l(I)>1$ and $J\coloneqq(i_2,\dotsc,i_l)$, the condition
    $\deg(x) < \e(I)=i_1-\d(J)$
    implies
    \begin{gather*}
      \SwapAboveDisplaySkip
      \deg(\Sq J(x))
      = \deg(x)+\d(J) < \e(J)+\d(J) = 2i_2
      \overset{\text{adm.}}\leq i_1
    \end{gather*}
    So,
    $\Sq I(x)=\Sq{i_1}(\Sq J(x))=0$ by \eqref{eq:sqlowerbound}.
  \end{proof}

\end{Rem}

The subsequent concept of formally inverting a formal sum of elements
in a graded $\Zmod2$\nbd{}algebra will recur for several characteristic
classes. This particular definition is needed to define the Wu classes
in \autoref{sec:wuclasses}.
\begin{Def}\label{def:antipode}
  The \emph{antipode} $\antipode\colon \A\to\A$ of the Steenrod algebra is a
  graded homomorphism inductively defined by the relation
  \begin{gather*}
    1 = \Sq 0
    = \SQ \Sqcup \antipode(\SQ)
    = \sum_{k\geq0}\sum_{r+s=k} \Sq r \Sqcup \antipode(\Sq s)
  \end{gather*}
\end{Def}

\section{Wu Classes and the Wu Formula}\label{sec:wuclassesmain}
A crucial part in the proof of Massey's theorem is to cleverly involve
a new type of characteristic classes with nice properties that are
directly connected to Stiefel-Whitney classes through Steenrod
squares.
The Wu classes were developed by Wu~Wen-Tsün, and will be introduced in
\autoref{sec:wuclasses}.
The proof of Wu's theorem on their relation to Stiefel-Whitney
classes in \autoref{sec:wutheorem} utilizes some properties of Thom
classes and the Thom isomorphism as reviewed in
\autoref{sec:thomclasses}, as well as a certain construction of
Stiefel-Whitney classes as introduced in
\autoref{sec:swclsconstruction}.

\subsection{Thom Classes and the Thom Isomorphisms}\label{sec:thomclasses}
In this subsection, Thom classes and the Thom isomorphisms will be
reviewed. The tools to be recalled in this section are an important
ingredient for the proof of Wu's theorem, both directly as well as for
constructing the Stiefel-Whitney characteristic classes from Steenrod
squares.

Let $B$ be a paracompact space, \forexample a manifold,
$\xi\colon E\xrightarrow{p} B$ a vector bundle over $B$ of rank $\rkk>0$,
and let $R$ be a principal ideal domain.
The following definition can \forexample also be found in
\cite[p.~441]{hatcher}.
\begin{Def}
  A \emph{Thom class} of $\xi$ in $R$\nbd{}coefficients is a
  cohomology class $\u{\xi}$ in $\H^{\rkk}(\spherepair{E}; R)$,
  such that for all points $b\in B$ and fiber inclusions
  \begin{gather*}
    i_b\colon (\spherepair{E_b}) \to (\thomspacepair{E})
  \end{gather*}
  the restriction $\u{\xi}|_{E_b} = \pb i_b (\u{\xi})$ is a
  free generator of the $R$\nbd{}module $\H^{\rkk}(\spherepair{E_b}; R)$,
  \idest a unit
  of the ring
  $\H^{\rkk}(\spherepair{E_b};R)\cong \H^{\rkk}(\spherepair{\R}; R)\cong R$.
\end{Def}

The following corollaries will deduce notions of naturality,
multiplicativity, and uniqueness for Thom classes quite directly from
their above definition.

\begin{Cor}\label{cor:thomclsnatural}
  The Thom class construction is natural with respect to the pullback
  of vector bundles over paracompact spaces.
  \Idest given any map of paracompact spaces $f\colon A\to B$, and a
  vector bundle $\xi\colon E\to B$ with pullback map
  $F\colon\pb f\xi\to\xi$,
  then $\pb F \U$ of a Thom class $\U$ of $\xi$ will
  be a Thom class of $\pb f \xi$.
  \begin{proof}
    Let $\U$ be a Thom class of $\xi$ and $a\in A$ any point.
    Consider the restriction $\pb i_a(\pb f \U)$
    of the pullback of $\U$ to the fiber over $a$. To show that this
    is a generator of $\H^{\rkk}(\spherepair{E_a};R)$ first use that
    pullbacks commute with restriction:
    \begin{gather*}
      \pb i_a(\pb f \U)
      = \pb {(f\circ i_a)} \U
      = \pb {(i_{f(a)}\circ f)} \U
      = \pb f (\pb i_{f(a)} \U)
    \end{gather*}
    $\pb i_{f(a)} \U$ is a generator by definition of $\U$.
    Now the restriction of $f$
    \begin{gather*}
      f\colon (\spherepair{(\pb f E)_a}) \to (\spherepair{E_{f(a)}})
    \end{gather*}
    is an isomorphism, and thus
    $\pb f\colon \H^r(\spherepair{E_{f(a)}})
    \cong \H^r(\spherepair{(\pb f E)_a})$
    sends generators to generators for all $r\in\Nat$.
  \end{proof}
\end{Cor}

\begin{Def}
  Let $\xi$, $\eta$ be vector bundles over a space $B$.
  Define the \emph{cross-product} as in \cite[p.~214]{hatcher} to be
  the map
    \begin{align*}
      \H^*(\thomspacepair{\E\xi})
      \otimes
      \H^*(\thomspacepair{\E\eta})
      &\longto
        \H^*(\thomspacepair{\E{(\xi\oplus\eta)}})\\
      x\otimes y
      &\longmapsto
        \pb \pi_\xi x \cup \pb \pi_\eta y
        \eqqcolon x\times y
        \;.
    \end{align*}
\end{Def}
\begin{Cor}\label{cor:thomclassmultiplicative}
  The Thom class construction for coefficients in a field $R$ is
  multiplicative in the following sense:
  For vector bundles $\xi\colon E\to B$, $\eta\colon E'\to B$
  of rank $\rkk$ respectively $\rkl$ over a paracompact space $B$, and Thom
  classes
  $\u{\xi}\in \H^{\rkk}(\thomspacepair{\E\xi}; R)$,
  $\u{\eta}\in \H^{\rkl}(\thomspacepair{\E\eta}; R)$
  the class
  \begin{gather*}
    \u{\xi}\times\u{\eta}
    \coloneqq \pb \pi_\xi\u{\xi} \cup \pb \pi_\eta\u{\eta}
    \in \H^{\rkk+\rkl}(\thomspacepair{\E{(\xi\oplus\eta)}})
  \end{gather*}
  is a Thom class of $\xi\oplus\eta$.
  \begin{proof}
    Consider a fiber $b\in B$. As cup product and pullback commute
    with restriction, the cross-product also commutes with
    restriction, \idest one has to show that
    \begin{gather*}
      \pb i_b(\u{\xi}\times\u{\eta})
      = \left(\pb i_b\u{\xi}\right)
      \times \left(\pb i_b\u{\eta}\right)
    \end{gather*}
    is a generator of
    $\H^{\rkk+\rkl}(\spherepair{\E{(\xi\oplus\eta)}_b};R)$.
    % There are homotopies making the following diagram commute
    % \begin{center}
    %   \begin{tikzcd}
    %     (\spherepair{\E{(\xi)}_b})
    %     \ar[d, dash, "\isosymb"{above,rotate=90}]
    %     &(\spherepair{\E{(\xi\oplus\eta)}_b})
    %     \ar[l,"\pi_\xi"above] \ar[r,"\pi_\eta"]
    %     \ar[d, dash, "\isosymb"{above,rotate=90}]
    %     &(\spherepair{\E{(\eta)}_b})
    %     \ar[d, dash, "\isosymb"{above,rotate=90}]\\
    %     (\spherepair{\R^i})
    %     &(\spherepair{\R^{i+j}})
    %     \ar[l,"\proj"above] \ar[r,"\proj"]
    %     &(\spherepair{\R^{j}})
    %   \end{tikzcd}
    % \end{center}
    On fibers one has that
    \begin{align*}
      (\spherepair{\E{(\xi\oplus\eta)}_b})
      &= \left(
        \E{\xi}_b\times\E{\eta}_b,
        \left(\E{\xi}_b\times(\minuszero{\E{\eta}_b})\right)
        \cup
        \left((\minuszero{\E{\xi}_b})\times\E{\eta}_b\right)
        \right)
        \\
      &= (\spherepair{\E{\xi}_b})\times(\spherepair{\E{\eta}_b}
    \end{align*}
    which makes the relative Künneth isomorphism theorem applicable.
    For the latter see \forexample \cite[Theorem~3.18]{hatcher}.
    By the naturality of that isomorphism there is the
    following commutative diagram that translates this problem to one
    on the cohomology of spheres (all cohomology rings with
    $R$\nbd{}coefficients),
    similar to \cite[proof of 3.19, p.~221]{hatcher}:
    \begin{center}
      \begin{tikzcd}
        \H^*(\spherepair{\E\xi_b})
        \otimes \H^*(\spherepair{\E\eta_b})
        \ar[r, "\cong"]
        \ar[d, dash, "\cong"{above,rotate=90}]
        & \H^*(\spherepair{\E{(\xi\oplus\eta)}_b})
        \ar[d, dash, "\cong"{below,rotate=90}]
        \\
        \H^*(\spherepair{\R^{\rkk}})
        \otimes \H^*(\spherepair{\R^{\rkl}})
        \ar[r, "\cong"]
        \ar[d, dash, "\cong"{above,rotate=90}]
        & \H^*(\spherepair{\R^{\rkk+\rkl}})
        \ar[d, dash, "\cong"{below,rotate=90}]
        \\
        \H^*(I^{\rkk},\Boundary{I^{\rkk}})
        \otimes \H^*(I^{\rkl}, \Boundary{I^{\rkl}})
        \ar[r, "\cong"]
        \ar[d, dash, "\cong"{above,rotate=90}]
        & \H^*(I^{\rkk+\rkl}, \Boundary{I^{\rkk+\rkl}})
        \ar[d, dash, "\cong"{below,rotate=90}]
        \\
        \H^*(\Sphere{\rkk})
        \otimes \H^*(\Sphere{\rkl})
        \ar[r, "\cong"]
        & \H^*(\Sphere{\rkk+\rkl})
      \end{tikzcd}
    \end{center}
    Furthermore, the simple structure of the cohomology of spheres
    yields for the Künneth isomorphism in the desired degree
    \begin{align*}
      \H^{\rkk+\rkl}(\Sphere{\rkk+\rkl};R)
      &\cong
        \left(\H^*(\Sphere{\rkk}; R)\otimes \H^*(\Sphere{\rkl}; R)\right)_{\rkk+\rkl}\\
      &\coloneqq
        \bigoplus_{\mathclap{r+s=\rkk+\rkl}}
        \H^r(\Sphere{\rkk};R)\otimes \H^s(\Sphere{\rkl};R)
        =
        \H^{\rkk}(\Sphere{\rkk};R)\otimes \H^{\rkl}(\Sphere{\rkl};R)
    \end{align*}
    by leaving out zero-summands for the last equality.
    Thus, a generator $\iota_{\rkk}\otimes\iota_{\rkl}$ of
    $\H^{\rkk}(\Sphere{\rkk}; R)\otimes \H^{\rkl}(\Sphere{\rkl}; R)$,
    which is the tensor product of two generators,
    is mapped to a generator $\iota_{\rkk+\rkl}=\iota_{\rkk}\times\iota_{\rkl}$ of
    $\H^{\rkk+\rkl}(\Sphere{\rkl+\rkl}; R)$.
    Using the isomorphisms above proves the claim.
    % % Maybe put into separate Lemma:
    % Now one can use the fact, that for any two generators
    % $\iota_{\rkk}$ of $\H^{\rkk}(\spherepair{\R^{\rkk}})$ and
    % $\iota_{\rkl}$ of $\H^{\rkl}(\spherepair{\R^{\rkl}})$,
    % the cross-product
    % $\iota_{\rkk}\times\iota_{\rkl}$ is a generator of
    % $\H^{\rkk+\rkl}(\spherepair{\R^{\rkk+\rkl}})$.
  \end{proof}
\end{Cor}

\begin{Cor}
  Every vector bundle $\xi$ has a unique Thom class $\u{\xi}$ in
  $\Zmod2$\nbd{}coefficients.
  Furthermore, for any map of paracompact spaces $f\colon A\to B$ and
  vector bundle $\xi\colon E\to B$ holds $\u{\pb f \xi} = \pb f \u{\xi}$.
  \begin{proof}[Proof (sketch)]
    \begin{description}
    \item[Existence:] See \cite[Theorem~4D.10]{hatcher} or use
      \cite[Prop.~17.9.3]{tomdieck}.
    \item[Uniqueness:]
      Using a suitable Mayer-Vietoris sequence for gluing, and an
      inductive argument starting with the trivial bundle case, one can show:
      Any two classes in $\H^{\rkk}(\thomspacepair{E};R)$ whose
      restrictions coincide on all fibers will coincide.
      However, for $R=\Zmod2$ there is exactly one possible choice for
      a unit $\u{\xi}|_{E_b}$ of the group
      $\H^{\rkk}(\spherepair{E_b})^\times\cong\Zmod2^\times=\{1\}$
      over each point $b$.
      For details see \forexample \cite[Theorem~(17.9.4)]{tomdieck}.
    \item[Naturality:]
      Clear from uniqueness and the naturality of Thom classes.
    \end{description}
  \end{proof}
\end{Cor}

\begin{Rem}
  Using paracompactness of $B$ and
  \cite[Proposition~17.9.6]{tomdieck}, one concludes that
  $\u{\xi}\in \H^{\rkk}(\thomspacepair{E};R)$ has to be a unit.
\end{Rem}

Having a good notion of Thom classes by now, we recall the Thom
isomorphism relating the (co)homology of the total space with that of the base
space of a vector bundle.
\begin{Thm}
  For any Thom class $\u{\xi}$ of $\xi$, and any degree $r$ there are
  the following isomorphisms, called the \emph{Thom isomorphism} for
  cohomology respectively homology,
  that are natural with respect to pullbacks of vector bundles over
  paracompact spaces:
  \begin{align*}
    \thomiso\colon
    \H^r(B;R) &\longrightarrow \H^{r+\rkk}(\thomspacepair{E}; R)
    & \thomiso\colon
      \H_{r+\rkk}(\thomspacepair{E}; R) &\longrightarrow \H_r(B;R)
    \\
    x &\longrightarrow \pb p (x) \cup \u{\xi}
    & \alpha &\longrightarrow \pf p (\u{\xi} \cap \alpha)
               \;.
  \end{align*}
  \begin{proof}
    Naturality directly follows from the naturality of the Thom class
    in Corollary~\ref{cor:thomclsnatural}, and naturality of the cup-
    respectively cap-product.
    The cohomology part then is a direct application of Leray's theorem
    \cite[Theorem~4D.8]{hatcher}.
    For the homology part see \forexample \cite[Theorem~14.6]{switzer}.
  \end{proof}
\end{Thm}
\begin{Lem}\label{lem:thomisoself-adjoint}
  If $B$ is connected, the Thom isomorphisms are adjoint in the
  following sense:
  For $r\in\Nat$, $x\in \H^r(B)$,
  and $\alpha\in \H_{r+\rkk}(\thomspacepair{E})$  holds
  \begin{gather*}
    \pf p\capped{\thomiso(x)}{\alpha} = \capped{x}{\thomiso(\alpha)}
    \in\H_0(B)\cong \Zmod2
  \end{gather*}
\end{Lem}
In order to proof Lemma~\ref{lem:thomisoself-adjoint},
first recall the following properties of the cap product.
\begin{Rem}
  For
  a map of triples of spaces
  $f\colon (Y,Y'',Y')\to (X,X'',X')$,
  cohomology classes
  $a\in \H^i(X,X')$ and $b\in \H^j(X,X')$,
  homology classes
  $\gamma\in \H_{i+j}(X, X'\cup X'')$
  and
  $\beta\in \H_j(Y, Y'\cup Y'')$,
  and a vector bundle $E\xrightarrow{p}B$
  holds
  \begin{align}
    \label{eq:capprod1}
    \capped{a\cup b}{\beta} &= \capped{b}{a\cap\beta}
                              \in \H_0(X,X'')\\
    \label{eq:capprod2}
    \capped{a}{\pf f \beta} &= \pf f \capped{\pb f a}{\beta}
                              \in \H_0(X,X'')
                            &&\text{
                               %\cite[Chap.~3.3.2, p.\,241]{hatcher}
                               \cite[Sec.~18.1.1]{tomdieck}}
  \end{align}
\end{Rem}
\begin{proof}[Proof of Lemma~\ref{lem:thomisoself-adjoint}]
  With $\U\coloneqq\u{\xi}$ one calculates
  \begin{align*}
    \pf p\capped{\thomiso(x)}{\alpha}
    &= \pf p\capped{\pb p x \cup \U}{\alpha} \\
    &\equalsby{\eqref{eq:capprod1}}
      \pf p\capped{\pb p x}{\U\cap\alpha} \\
    &\equalsby{\eqref{eq:capprod2}}
      \capped{x}{\pf p(u\cap\alpha)}
      = \capped{x}{\thomiso (\alpha)} \in\Zmod2
      \qedhere
  \end{align*}
\end{proof}

Now, we can focus on the specific case of normal bundles of manifolds.
The following is a well-known result from intersection theory, which
links the fundamental class of a manifold with that of a submanifold
using the Thom isomorphism corresponding to the normal bundle of the
embedding.
\begin{Lem}\label{lem:thomisofundcl}
  Let $M^n$ and $W^{n+\rkk}$ be manifolds, and
  $\emb\colon M\to W$ be an embedding with
  normal bundle $\N{\emb}$ of rank $\rkk>0$.
  The normal bundle gives rise to an embedding
  $e\colon \E{\N{\emb}}\to W$ of its total space
  as a tubular neighborhood $e(\E{\N{\emb}})$ of $i(M)$ into $W$
  (see \cite[Sec.~15.6]{tomdieck}).
  The quotient map
  \begin{gather*}
    \collapse\colon
     W
    \to  W/\left(  W\setminus e(\E{\N{\emb}}) \right)
    \cong \Thomspace{\N{\emb}}
  \end{gather*}
  that collapses every point outside of $e(\E{\N{\emb}})$ to the infinity
  point fulfills
  \begin{center}
    \begin{tikzcd}[row sep=0pt]
      \H_{n+\rkk}( W) \ar[r, "\pf c"]
      & \H_{n+\rkk}(\Thomspace{\N{\emb}}) \ar [r, "\pf \incl"]
      & \relH_{n+\rkk}(\Thomspace{\N{\emb}})
      %\coloneqq \H_{n+\rkk}(\Thomspace{\N{\emb}}, \infty)
      \ar [r, "\pf t"{above}, "\cong"{below}]
      & \H_{n}(M)% \cong \Zmod2
      \\
      \fundcl{ W} \ar[rrr, mapsto]
      &&&\thomiso(\pf \incl\pf\collapse\fundcl{ W})
      = \fundcl M
    \end{tikzcd}
  \end{center}
  where
  $\incl\colon
  (\Thomspace{\N{\emb}},\emptyset)
  \to(\Thomspace{\N{\emb}}, \{\infty\})$
  is the canonical inclusion of pairs of spaces,
  and the isomorphism
  $\relH_{n+\rkk}(\Thomspace{\N{\emb}})
  \cong \H_{n+\rkk}(\thomspacepair{\E{\N\emb}})$
  of the neighborhood deformation retract pair
  $(\thomspacepair{\E{\N\emb}})$ was used.
  This holds for any choice of $i$ and $e$.
  \begin{proof}
    First note that by the long exact sequence of the pair
    $(\Thomspace{\E{\N\emb}}, \{\infty\})$, the map
    $\pf \incl\colon
    \H_r(\Thomspace{\N{\emb}})
    \to \relH_r(\Thomspace{\N{\emb}})$
    is an isomorphism in every degree $r>0$. The proof will be
    conducted in two steps, first proving the connected case, then
    the general one.
    \begin{description}
    \item[Connected case:]
      Assume that $M$ is connected.
      Then
      \begin{gather*}
        \H_{n+k}(\Thomspace{\N{\emb}})
        \cong\relH_{n+k}(\Thomspace{\N{\emb}})
        \cong \H_n(M) \cong \Zmod2=\{\fundcl M, 0\}
      \end{gather*}
      by the Thom isomorphism, and since $M$ is connected and closed.
      Thus, one only has to show that
      $\pf\collapse\fundcl{ W}$
      is non-zero.
      The trick now is to use that manifolds locally look like some
      Euclidean space, and that this property is mostly preserved by
      the collapse.
      Restricted to $e(\E{\N{\emb}})$ the collapse map looks like
      \begin{gather*}
        c|_{e(\E{\N{\emb}})}\colon
        e(\E{\N{\emb}})
        \overset{e}{\underset{\sim}\longto} \E{\N{\emb}}
        \cong \Discbdl{\N{\emb}}\setminus\Spherebdl{\N{\iota}}
        \cong (\Thomspace{\N{\emb}})\setminus \{\infty\}
      \end{gather*}
      \idest it is a homeomorphism onto
      $(\Thomspace{\N{\emb}})\setminus\{\infty\}$.
      Therefore, by excision there is for any point
      $p\in(\Thomspace{\N{\emb}})\setminus\{\infty\}$
      the following commutative diagram on homology
      \begin{center}
        \begin{tikzcd}
          \fundcl{ W}
          \ar[d,mapsto]\ar[r,phantom,"\in"{near start}]
          &\H_{n+\rkk}( W)
          \ar[r, "\pf\incl\pf\collapse"]\ar[d,"\pf\incl"]
          &\relH_{n+\rkk}(\Thomspace{\N{\emb}})
          \ar[d,"\pf\incl"]
          \\
          \left.\fundcl{ W}\right|_{\collapse^{-1}(p)}
          \ar[r,phantom,"\in"{near start}]
          &\H_{n+k}( W, W\setminus\collapse^{-1}(p))
          \ar[r,"\pf\collapse"{above},"\cong"{below}]
          \ar[d,dash, "\cong", "\text{exc.}"{left}]
          &\H_{n+\rkk}(\Thomspace{\N{\emb}},
          (\Thomspace{\N{\emb}})\setminus p)
          \ar[d,dash, "\cong", "\text{exc.}"{left}]
          \\
          & \H_{n+\rkk}(\R^{n+\rkk}, \R^{n+\rkk}\setminus\pt)
          & \H_{n+\rkk}(\R^{n+\rkk}, \R^{n+\rkk}\setminus\pt)
        \end{tikzcd}
      \end{center}
      By definition of the fundamental class $\fundcl{ W}$,
      the class $\fundcl{ W}|_{\collapse^{-1}(p)}$ in the
      diagram is a generator, and thus also is
      $\pf\collapse\left(\fundcl{ W}|_{\collapse^{-1}(p)}\right)
      = \left(\pf\incl\pf\collapse\fundcl{ W}\right)|_p$.
      However, then $\pf\incl\pf\collapse\fundcl{ W}\in
      \relH_{n+\rkk}(\Thomspace{\N{\emb}})$
      cannot be zero as was to be shown.
    \item[General case] In case $M=\coprod_i M_i$ is the disjoint sum of its connected
      components $M_i$, $i\in I$ for some index set $I$, note the following:
      \begin{itemize}
      \item $\E{\N{\emb}} = \coprod_i\E{\N{\emb_i}}$,
        where $\emb_i\coloneqq\emb|_{M_i}$.
        % where $\N{M_i}\coloneqq\N{\emb}|_{M_i}$.
      \item Thus, $\Thomspace{\N{\emb}} = \bigvee_i\Thomspace{\N{\emb_i}}$ using the
        collapse maps
        \begin{gather*}
          \collapse_i\colon
           W
          \overset{\collapse}\longto
           W/\left( W\setminus e(\E{\N{\emb}})\right)
          \overset{\proj}\longto
           W/\left( W\setminus e(\E{\N{\emb_i}})\right)
        \end{gather*}
        for the disjoint parts,
        and $\collapse=\bigvee_i\collapse_i$.
      \item Thus,
        $\relH_r(\Thomspace{\N{\emb}})
        = \bigoplus_i \relH_r(\Thomspace{\N{\emb_i}})$ for
        all degrees $r$, $\fundcl M = (\fundcl{M_i})_i$, and
        $\pf\collapse = \prod_i\pf{\collapse_i}$.
        % \item Thus, $\H_{n+\rkk}(\Thomspace{\N{\emb}})
        %   \cong \H_{n+\rkk}(M)\cong\prod_i \Zmod2$, and $\fundcl{M} = (1)_i$.
      \end{itemize}
      With this one sees directly from the definition of the fundamental
      class of a manifold that
      $\pf\incl\pf\collapse\fundcl{ W} = \fundcl M$
      if and only if for all connected component manifolds $M_i$ holds
      $\pf\incl\pf{\collapse_i}\fundcl{ W} = \fundcl{M_i}$,
      which is true by the first case.
      \qedhere
    \end{description}
  \end{proof}
\end{Lem}

\subsection{A Construction of Stiefel-Whitney Classes}
\label{sec:swclsconstruction}
Now, the promised construction of the Stiefel-Whitney classes from
Thom classes and Steenrod squares can be presented.

\begin{Thm}\label{thm:altdefswclasses}
  The Stiefel-Whitney classes can be given as
  \begin{gather*}
    \Sq i(\u{\xi}) = \thomiso(\w{i}{\xi}) = \pb p \w{i}{\xi} \cup \u{\xi}
  \end{gather*}
  for any vector bundle $\xi\colon E\to B$ over a paracompact space
  $X$. As the Thom isomorphism is a group homomorphism, one can
  formulate the above as
  \begin{gather*}
    \SQ(\u{\xi}) = \thomiso(\W{\xi}) = \pb p \W{\xi} \cup \u{\xi}
  \end{gather*}
  \begin{proof}
    One has to check naturality of the expression and all further
    defining properties from Definition~\ref{def:swclasses}.
    \begin{description}
    \item[Naturality:] Both $\Sq i$ and $t$ respectively also $t^{-1}$
      are natural.
    \item[$\ws{0}=1$:]
      $\H^0(\thomspacepair{\E{\gamma_0}}) = \Zmod2$, thus 1 is the only
      candidate for a Thom class, $\Sq0(1) = \Id(1) = 1$, and the Thom
      isomorphism sends 1 to 1 in this degree.
    \item[$\W{\gamma_1}=1+x$:]
      Recall that $\H^*(\RP k)=\Zmod2[x_k]/(x_k^{k+1})$.
      For $\w0{\gamma_1}$ the defining relation
      \begin{gather*}
        \pb p\w{0}{\gamma_1}\cup\u{\gamma_1}
        = \Sq 0(\u{\gamma_1})
        \cequalsby{\eqref{eq:sqidentity}}\u{\gamma_1} \neq 0
      \end{gather*}
      directly gives
      $\pb p\w{0}{\gamma_1}=1$, and thus
      $\w{0}{\gamma_1}=1\in\H^0(\RP1)\cong\Zmod2$.
      For $\w1{\gamma_1}$ the defining relation looks like
      \begin{gather*}
        \SwapAboveDisplaySkip
        \thomiso(\w{1}{\gamma_1})
        = \pb p\w{1}{\gamma_1}\cup \u{\gamma_1}
        = \Sq 1(\u{\gamma_1})
        \cequalsby{\eqref{eq:sqsquared}}\u{\gamma_1}^2
        \;,
      \end{gather*}
      which, if non-zero, directly proves that $\w{1}{\gamma_1}$ is
      the unique non-zero element of degree 1 in
      $\H^*(\RP1)=\Zmod2[x]/(x^2)$, which is $x$ as was desired.
      To see that $\u{\gamma_1}^2$ is non-zero,
      observe that the tautological line bundle
      actually is the normal bundle of the embedding of $\RP1$ into
      $\RP2$ induced by the embedding of the circle as equator into
      the $2$\nbd{}sphere. This then yields by excision that
      \begin{gather*}
        \H^r(\thomspacepair{\E{\gamma_1}})
        \cong \H^r(\RP2,\RP2\setminus\RP1)
        \cong \H^r(\RP2, \pt)
        = \relH^r(\RP2)
        \;.
      \end{gather*}
      Let $\incl\colon\RP2\to(\RP2,\pt)$ be the inclusion, which is an
      isomorphism on cohomology groups in degree greater 0.
      Since
      $\u{\gamma_1}\in\relH^1(\RP2)$ is the unique non-zero element,
      $\pb\incl\u{\gamma_1}= x_2$ and
      $\pb\incl(\u{\gamma_1}^2) = x_2^2\neq0$.
      So $\u{\gamma_1}^2\neq 0$.
    \item[Multiplicativity:]
      Consider vector bundles $\xi$, $\eta$ over a paracompact space
      $B$. With $\u{\xi\oplus\eta}=\u{\xi}\cup\u{\eta}$ and the fact that
      \begin{gather}\label{eq:projectionscommute}
        p_\xi\circ\pi_\xi = p_{\xi\oplus\eta} = p_\eta\circ\pi_\eta
      \end{gather}
      one gets
      \begin{align*}
        \thomiso(\w{i}{\xi\oplus\eta})
        &= \Sq i(\u{\xi\oplus\eta}) \\
        &\equalsby{\ref{cor:thomclassmultiplicative}}
          \Sq i(\pb\pi_\xi\u{\xi} \cup \pb\pi_\eta\u{\eta})\\
        &\equalsby{\ref{tag:cartan}}
          \sum_{r+s=i}
          \Sq r(\pb\pi_\xi\u{\xi}) \cup \Sq s(\pb \pi_\eta\u{\eta}) \\
        &\equalsby{Naturality}
          \sum_{r+s=i}
          \pb\pi_\xi\Sq r(\u{\xi}) \cup \pb \pi_\eta\Sq s(\u{\eta}) \\
        &\equalsby{Definition}
          \sum_{r+s=i}
          \pb\pi_\xi\thomiso(\w{r}{\xi})
          \cup \pb\pi_\eta\thomiso(\w{s}{\eta}) \\
        &\equalsby{Definition}
          \sum_{r+s=i}
          \pb\pi_\xi \left(\pb p_\xi  \w{r}{\xi}  \cup \u{\xi} \right)
          \cup
          \pb\pi_\eta\left(\pb p_\eta \w{s}{\eta} \cup \u{\eta}\right) \\
        &= \left(
          \sum_{r+s=i}
          \pb\pi_\xi \pb p_\xi \w{r}{\xi} \cup
          \pb\pi_\eta\pb p_\eta\w{s}{\eta}
          \right)
          \cup
          \left(\pb\pi_\xi\u{\xi} \cup \pb\pi_\eta\u{\eta}\right) \\
        &\equalsby{\eqref{eq:projectionscommute}, Definition}
          \left(\sum_{r+s=i}
          \pb p_{\xi\oplus\eta} \w{r}{\xi} \cup \pb p_{\xi\oplus\eta} \w{s}{\eta}
          \right)
          \cup
          \u{\xi} \times \u{\eta} \\
        &\equalsby{Group Hom., \ref{cor:thomclassmultiplicative}}
          \pb p_{\xi\oplus\eta}
          \left(\sum_{r+s=i}\w{r}{\xi}\cup\w{s}{\eta}\right)
          \cup
          \u{\xi\oplus\eta}\\
        &\equalsby{Definition}
          \thomiso\left(\sum_{r+s=i}\w{r}{\xi}\cup\w{s}{\eta}\right)
          \;.
      \end{align*}
      Applying $\thomiso^{-1}$ yields the result.
      \qedhere
    \end{description}
  \end{proof}
\end{Thm}

\subsection{Equivalent Definitions of Wu Classes}\label{sec:wuclasses}
Let $M$ be a compact, $n$\nbd{}dimensional manifold.
In the following, two approaches to define the Wu characteristic
classes are pursued: an explicit one specially for normal bundles of
manifolds using Poincaré duality, and a more general one, which makes
clear that the Wu classes indeed are characteristic classes of vector
bundles (\idest natural).

\begin{Def}\label{def:wuclasses}
  The $i$th \emph{Wu class} $\v{i}{M}$ of $M$ for $0\leq i\leq n$ is defined
  as the cohomology class in $\H^i(M)$ that is uniquely determined by
  \begin{center}
    \begin{tikzcd}[row sep=0pt, column sep=small]
      \H^i(M) \ar[r, equal, "\isosymb"]
      & \H_{n-i}(M) \ar[r, equal, "\isosymb"]
      &\Hom{\Zmod2}(\H^{n-i}(M), \Zmod2) \ar[r, equal, "\isosymb"]
      &\Zmod2
      \\
      y \ar[rr, mapsto] &&\capped{ x\cup y }{ \fundcl M }\\
      \v{i}{M} \ar[rr, mapsto] &&\capped{\Sq i(x)}{\fundcl M}
    \end{tikzcd}
  \end{center}
  where the first isomorphism from the left is Poincaré duality
  and the second is the universal coefficient theorem
  for the field $\Zmod2$.
  Equivalently, for any cohomology class $x\in \H^{n-i}(M)$ of fixed
  degree $n-i$ holds
  \begin{gather*}
    x\cup \v{i}{M} = \Sq i(x) \in \H^n(M) \cong \Zmod2
  \end{gather*}
  Mind the fixed degree of $x$---the above will not be true for other
  degree cohomology classes in general!
\end{Def}

\begin{Rem}
  Some immediate consequences of the definitions of the Wu classes of
  $M$ are
  \begin{itemize}
  \item $\v{0}{M} = 1$
  \item $\v{i}{M} = 0$ for $i>\frac n 2$, because $\Sq i(x) = 0$ if the
    degree of x is lower than $i$.
  \end{itemize}
\end{Rem}

As for the Stiefel-Whitney classes, one has a notion of a total class.
\begin{Def}\label{def:dualwuclasses}
  The \emph{total Wu class} of $M$ is defined as the sum
  $\sum_{i\geq0}\v{i}{M}$. The \emph{total dual Wu class}
  $\dualV{M}\eqqcolon \sum_{i\geq 0}\dualv{i}{M}$
  and the dual Wu classes $\dualv{i}{M}$
  of $M$ are defined by
  \begin{gather*}
    \V{M} \cup \dualV{M} = 1
  \end{gather*}
  or equivalently
  \begin{alignat*}{4}
    \SwapAboveDisplaySkip
    1 &= \dualv{0}{M} \cup \v{0}{M} = \dualv{0}{M}
    \;,\quad
    &&\text{and}\\
    0 &= \sum_{r+s=i}\v{r}{M}\cup\dualv{s}{M}
    &&\text{in degree $0\leq i\leq n$.}
  \end{alignat*}
\end{Def}

The following more general definition of Wu classes
will turn out to be equivalent in a certain sense to the one above in
Definition~\ref{def:wuclasses}.
For the formulation recall the antipode of the Steenrod algebra
(see Definition~\ref{def:antipode}).
\begin{Def}\label{def:altwuclasses}
  Let $\xi\colon E\xrightarrow{p} B$ be a vector bundle over a
  paracompact space $B$.
  The $i$th \emph{Wu class} $\v{i}{\xi}$ of $\xi$ for $0\leq i\leq n$
  is defined as the cohomology class in $\H^i(B)$ that is uniquely
  determined by
  \begin{gather*}
    \antipode(\Sq i)(\u{\xi}) = \thomiso(\v{i}{\xi}) = \pb p \v{i}{\xi} \cup \u{\xi}
  \end{gather*}
  The \emph{total Wu class} of $\xi$ is defined as usual as
  $\V{\xi}\coloneqq\sum_{i\geq0}\v{i}{\xi}$, and satisfies accordingly
  $\antipode(\SQ)(\u{\xi})=\thomiso(\V{\xi})$.
\end{Def}
\begin{Rem}
  Compare this to the possible definition of the Stiefel-Whitney
  classes in Theorem~\ref{thm:altdefswclasses}.
  Similarly, naturality with respect to pullbacks of vector bundles
  follows immediately from the definition, making the Wu classes
  characteristic classes.
\end{Rem}

Recall that the definition of Stiefel-Whitney classes of manifolds
utilizes the canonical tangent bundle structure.
In contrast to that, the Wu classes of manifolds utilize normal
bundles, as will be clear from the promised equivalence below.
\begin{Thm}\label{thm:altdefwuclasses}
  Let $M$ be a compact manifold of dimension $n$, and let
  $\N{\emb}\colon \E{\N{\emb}} \xrightarrow{p} M$ be
  any normal bundle of rank $k$ of an embedding
  $\emb\colon M\immto\R^{n+k}$. Then
  \begin{gather*}
    \v{i}{M} = \v{i}{\N{\emb}}\in \H^i(M)
  \end{gather*}
  \begin{proof}
    To proof Theorem~\ref{thm:altdefwuclasses}, the defining property of
    $\v{i}{M}$ will be checked on $\v{i}{\N{\emb}}$, \idest one has to show
    that for any $x\in \H^{n-i}(M)$ holds
    \begin{gather*}
      \capped{x\cup \v{i}{\N{\emb}}}{\fundcl M}
      = \capped{\Sq i(x)}{\fundcl M}
    \end{gather*}
    Note, that this is simply the $i$th degree of the equation
    \begin{gather}\label{eq:proofaltdefwuclasses:claim}
      \capped{x\cup \V{\N{\emb}}}{\fundcl M}
      = \capped{\SQ(x)}{\fundcl M}
    \end{gather}
    which will be proven below.
    Beforehand, recall the following:
    \begin{description}
    \item[By \ref{lem:thomisoself-adjoint}:]
      $\pf p\capped{\thomiso(z)}{\alpha} = \capped{z}{\thomiso(\alpha)}$
      for $r\in\Nat$, $z\in \H^r(M)$,
      $\alpha\in \H_{r+\rkk}(\thomspacepair{\E{\N{\emb}}})$.
    \item[By \ref{lem:thomisofundcl}:]
      $\thomiso(\pf\incl\pf\collapse\fundcl{\Sphere{n+\rkk}}) = \fundcl M$
      where $\collapse\colon
      \Sphere{n+\rkk}\to\Discbdl{\N{\emb}}/\Spherebdl{\N{\emb}}$ is
      the collapse map of a tubular embedding of the normal bundle
      $\N M$.
    \item[By \eqref{eq:sqlowerbound} and \eqref{eq:sqidentity}:]
      The total Steenrod square
      $\SQ\colon \H^m(\Sphere m)
      \to \H^*(\Sphere m)$
      is the identity on $\H^m(\Sphere m)$, \idest
      $\Sq i\colon \H^m(\Sphere{m})\to \H^{m+i}(\Sphere{m})$ is zero for
      $i\neq0$.
    \item[By Definition~\ref{def:sq}:] The total Steenrod Square
      $\SQ$ is natural and a ring homomorphism.
    \item[By \eqref{eq:capprod2}:]
      For any map of spaces $f\colon X\to Y$ and co-/homology classes
      $a$ and $\beta$ in the corresponding co-/homology groups holds
      $\capped{a}{\pf f \beta} = \pf f \capped{\pb f a}{\beta}$
    \end{description}
    For the proof fix some $i\leq n$, some arbitrary $x\in
    \H^{n-i}(M)$, as well as a collapse map
    $\collapse\colon\Sphere{n+k}\to\Discbdl{\N{\emb}}/\Spherebdl{\N{\emb}}$
    as in Lemma~\ref{lem:thomisofundcl}.
    For simplicity, denote
    $\Vu\coloneqq \V{\N{\emb}}$,
    $\Sph\coloneqq \Sphere{n+\rkk}$,
    $\U\coloneqq \u{\N{\emb}}$ and
    $\pf\collapse\coloneqq \pf{(\incl\circ\collapse)}$
    respectively
    $\pb\collapse\coloneqq \pb{(\incl\circ\collapse)}$.

    First reformulate
    $\capped{x\cup \V{\N{\emb}}}{\fundcl M}$ using the cohomology of the
    $(n+k)$\nbd{}sphere:
    \begin{align}\notag
      \capped{x\cup \Vu}{\fundcl M}
      &\clapequalsby{\ref{lem:thomisofundcl}}
        \capped
        {x\cup\Vu}
        {\thomiso\left(\pf\collapse\fundcl{\Sph}\right)}
      \\\notag
      &\equalsby{\ref{lem:thomisoself-adjoint}}
        \pf p\capped
        {\thomiso\left(x\cup\Vu\right)}
        {\pf\collapse\fundcl{\Sph}}
      \\\notag
      &\equalsby{\eqref{eq:capprod2}}
        \pf p\pf\collapse\capped
        {\pb\collapse\thomiso\left(x\cup\Vu\right)}
        {\fundcl{\Sph}}
      \\\notag
      &\equalsby{\eqref{eq:sqlowerbound} and \eqref{eq:sqidentity}}
        \pf p\pf\collapse\capped
        {\SQ\left(\pb\collapse\thomiso\left(x\cup\Vu\right)\right)}
        {\fundcl{\Sph}}
      \\\notag
      &\equalsby{Naturality}
        \pf p\pf\collapse\capped
        {\pb\collapse\SQ\left(\thomiso\left(x\cup\Vu\right)\right)}
        {\fundcl{\Sph}}
      \\\label{eq:proofaltdefwuclasses:eq1}
      &\equalsby{\eqref{eq:capprod2}}
        \pf p\capped
        {\SQ\left(\thomiso\left(x\cup\Vu\right)\right)}
        {\pf\collapse\fundcl{\Sph}}
    \end{align}
    Having introduced $\SQ$ on the left hand side, one observes a
    certain commutativity of the Thom isomorphism, and the total
    Steenrod square:
    \begin{align}\notag
      \SQ\left(\thomiso\left(x\cup\Vu\right)\right)
      &=
        \SQ\left(\left(\pb p x\cup \pb p\Vu\right) \cup \U\right)
      \\\notag
      &=
        \SQ\left(\pb p x\cup \left(\pb p\Vu \cup \U\right)\right)
      \\\notag
      &\equalsby{Def. $\thomiso$}
       \SQ\left(\pb p x\cup \thomiso(\Vu)\right)
      \\\notag
      &\equalsby{Naturality, Ring Hom.}
        \pb p\SQ(x) \cup \SQ(\thomiso(\Vu))
      \\\notag
      &\equalsby{Def. $\V{M}$}
        \pb p\SQ(x) \cup \SQ(\antipode(\SQ)(u))
      \\\notag
      &\equalsby{Def. $\antipode$}
        \pb p\SQ(x) \cup u
      \\\label{eq:proofaltdefwuclasses:eq2}
      &\equalsby{Def. $\thomiso$}
        \thomiso(\SQ(x))
    \end{align}
    Inserting \eqref{eq:proofaltdefwuclasses:eq2} into
    \eqref{eq:proofaltdefwuclasses:eq1} from above easily yields the
    claim in \eqref{eq:proofaltdefwuclasses:claim} that proves the theorem:
    \begin{align*}
      \SwapAboveDisplaySkip
      \capped{x\cup \Vu}{\fundcl M}
      &\clapequalsby{\eqref{eq:proofaltdefwuclasses:eq1}}
        \pf p\capped
        {\SQ\left(\thomiso\left(x\cup\Vu\right)\right)}
        {\pf\collapse\fundcl{\Sph}}
      \\
      &\equalsby{\eqref{eq:proofaltdefwuclasses:eq2}}
        \pf p\capped
        {\thomiso(\SQ(x))}
        {\pf\collapse\fundcl{\Sph}}
      \\
      &\equalsby{\ref{lem:thomisoself-adjoint}}
        \capped
        {\SQ(x)}
        {\thomiso\left(\pf\collapse\fundcl{\Sph}\right)}
      \\
      &\equalsby{\ref{lem:thomisofundcl}}
        \capped
        {\SQ(x)}
        {\fundcl M}
        \qedhere
    \end{align*}
  \end{proof}
\end{Thm}

\subsection{Wu's Theorem}\label{sec:wutheorem}
Wu's theorem, the goal of this section, gives a close relation of
the Wu classes from above with the Stiefel-Whitney classes using
Steenrod squares. Besides, it also immediately proves that Wu classes
as defined in Theorem~\ref{thm:altdefwuclasses} are actually characteristic
classes.

\begin{Thm}[Wu]\label{thm:wu}
  A closed manifold gives rise to the following two equalities
  \begin{align}\notag
    \dualW{M} &= \SQ\left(\dualV{M}\right)
    &\text{respectively}&
    &\dualw{k}{M} &= \sum_{i\geq0} \Sq i\left(\dualv{k-i}{M}\right)
    &\text{and}
    \\
    \W{M} &= \SQ\left(\V{M}\right)
    &\text{respectively}&
    &\w{k}{M} &= \sum_{i\geq0} \Sq i\left(\v{k-i}{M}\right)
    \label{tag:wuformula}\tag{Wu's formula}
  \end{align}
  that are equivalent using
  $\dualW{M}\cup\W{M} = 1$ and
  \begin{gather*}
    \SQ(\dualV{M})\cup\SQ(\V{M})
    = \SQ(\dualV{M}\cup\V{M})
    = \SQ(1)
    = 1
    \;.
  \end{gather*}
\end{Thm}
% \begin{Rem}
%   The following is equivalent to Wu's formula
%   \begin{gather*}
%     \dualW{M} = \SQ\left(\dualV{M}\right)
%     \qquad\text{respectively}\qquad
%     \dualw{k}{M} = \sum_{i\geq0} \Sq i\left(\dualv{k-i}{M}\right)
%   \end{gather*}
%   using the inverses $\dualW{M}\cup\W{M} = 1$ and
%   \begin{gather*}
%     \SQ(\dualV{M})\cup\SQ(\V{M})
%     = \SQ(\dualV{M}\cup\V{M})
%     = \SQ(1)
%     = 1
%     \;.
%   \end{gather*}
% \end{Rem}
The proof uses the alternative characterization
\begin{gather*}
  \antipode(\SQ)(\u{\N{\emb}}) = \thomiso(\V{\N{\emb}})
\end{gather*}
of the Wu classes from Theorem~\ref{thm:altdefwuclasses}, and directly
follows from the following Lemma.
\begin{Lem}\label{lem:wu}
  For a vector bundle $\xi\colon \E\xi\xrightarrow{p}\B\xi$ over a
  paracompact space holds
  \begin{gather*}
    \SQ(\V{\xi}) \cup \W{\xi}= 1
    \;.
  \end{gather*}
\end{Lem}
\begin{proof}[Proof of \ref{tag:wuformula}]
  Lemma~\ref{lem:wu} states for a closed manifold $M^n$ and any
  embedding $\emb\colon M\to\R^{n+k}$ that
  \begin{gather*}
    \SwapAboveDisplaySkip
    \SQ(\V{M}) \cup \dualW{M}
    = \SQ(\V{\N M}) \cup \W{\N{\emb}}
    \cequalsby{\ref{lem:wu}} 1
    \;.
  \end{gather*}
  Cupping with $\W{M}=\W{\T M}$ on both sides yields the claim
  as $\W{\T M} \cup \W{\N{\emb}} = 1$ by
  Remark~\itemref{rem:propswclasses}{item:wuclassmfdinverse}.
\end{proof}
\begin{proof}[Proof of Lemma~\ref{lem:wu}]
  For simplicity use the shortenings
  $\U\coloneqq \u{\xi}$,
  $\Vu\coloneqq \V{\xi}$, and
  $\Ws\coloneqq \W{\xi}$.
  Then calculate
  \begin{align*}
    \SwapAboveDisplaySkip
    \thomiso(1)
    &= \U
    \\
    &\equalsby{Def.~\ref{def:antipode}}
      \SQ\left(\antipode(\SQ)(\U)\right)
    \\
    &\equalsby{Def.~\ref{def:altwuclasses}}
      \SQ\left(\thomiso(\Vu)\right)
    \\
    &\equalsby{Def.~$\thomiso$}
      \SQ\left(\pb p\Vu \cup \U\right)
    \\
    &\equalsby{\ref{tag:cartan}, Naturality}
      \pb p\SQ(\Vu) \cup \SQ(\U)
    \\
    &\equalsby{\ref{thm:altdefswclasses}}
      \pb p\SQ(\Vu) \cup \thomiso(\Ws)
    \\
    &\equalsby{Def.~$\thomiso$}
      \pb p\SQ(\Vu) \cup \left(\pb p \Ws \cup \U\right)
    \\
    &=
      \pb p\left(\SQ(\Vu) \cup \Ws\right) \cup \U
    \\
    &\equalsby{Def.~$\thomiso$}
      \thomiso\left(\SQ(\Vu) \cup \Ws\right)
  \end{align*}
  Applying the inverse of the Thom isomorphism to both sides
  yields the equality which was to be shown.
\end{proof}

\section{Massey's Theorem}
\label{sec:massey}
Massey's main theorem on the Stiefel-Whitney classes of manifolds
\cite[Theorem~I.]{massey} gives a concrete statement, in which degrees
the dual Stiefel-Whitney classes may be non-zero in general.
As of Corollary~\ref{cor:obstruction} this is directly related to the
immersion problem respectively an important obstruction for it.
\begin{Thm}[Massey]\label{thm:massey}
  Let $M$ be a compact, $n$\nbd{}dimensional manifold.
  Given an integer $q$ with $0<q<n$ such that $\dualw{n-q}{M}\neq0$,
  there is a sequence of integers $h_1\geq\dotsb\geq h_q\geq0$ of
  length $q$ that fulfills
  \begin{gather*}
    \SwapAboveDisplaySkip
    n = \sum_{i=1}^{q} 2^{h_i}
  \end{gather*}
\end{Thm}
Note that the minimal length of a representation of $n$ by
powers of two is its binary representation of length $\alpha(n)$.
As an immediate consequence:
\begin{Cor}
  For any manifold, all its dual Stiefel-Whitney classes of degree
  greater than $n-\alpha(n)$ must be zero.
\end{Cor}

The following subsections are dedicated to the proof of Massey's Theorem.
Let $M$ be a compact, $n$\nbd{}dimensional manifold throughout the proof.
The latter consists of several steps:
\begin{steps}
\item\label{tag:masseystep1}
  Show that for any $q$, admissible iterated Steenrod square $\Sq I$, and cohomology
  class $x\in\H^q(M)$ of degree $q$ such that $\Sq I(x)$ is non-trivial there exists
  some representation of the form
  \begin{gather*}
    \deg \left(\Sq I(x)\right)
    = 2^k\cdot
    \left( 2^{k_1}+\dotsb+2^{k_{q-1}} + 1 \right)
    \;.
  \end{gather*}
  (All results during this step hold for any space $X$.)
\item\label{tag:masseystep2}
  Find some iterated Steenrod square candidate to which the above
  degree formula is applicable, \idest which is non-trivial in
  degree
  \begin{gather*}
    \Sq I\colon\H^q(M)\to\H^n(M)
    \;.
  \end{gather*}
\end{steps}
Applying \ref{tag:masseystep1} to the Steenrod square $\Sq I$ from
\ref{tag:masseystep2} and some $x\in\H^q(M)$ with $\Sq I(x)\neq 0$
immediately yields the result because
\begin{gather*}
  n = \deg\left(\Sq I(x)\right) = \underbrace
  {2^{k_1+k}+\dotsb+2^{k_{q-1}+k} + 2^{k}}_{\text{$q$ summands}}
  \;.
\end{gather*}

\subsection[A Degree Formula for Iterated Steenrod Squares]
{Step 1: A Degree Formula for Iterated Steenrod Squares}
For this step $M$ may be any space.
\ref{tag:masseystep1} requires to proof the following claim.
\begin{Lem}[\ref{tag:masseystep1}]\label{lem:masseystep1}
  Let $q\geq 0$ be an integer,
  and $I\in\Nat^{\l(I)}$ an admissible sequence of integers.
  Further, let $x\in\H^q(M)$ be a cohomology class of degree $q$
  such that $\Sq I(x)$ is non-trivial.
  Then there exists $k\in\Nat$ and a sequence of integers
  $0\leq k_1\leq\dotsb\leq k_{q-1}$ of length $q-1$ such that the
  degree of $\Sq I(x)$ can be represented as the dissection
  \begin{gather*}
    \deg \Sq I(x)
    = \deg x + \d(I)
    = 2^k\cdot
    \left( 1 + 2^{k_1}+\dotsb+2^{k_{q-1}} \right)
    \;.
  \end{gather*}
  % Mind that the maximum length of such a sequence is $\deg\Sq I(x)$.
\end{Lem}

In order to split the proof into several cases, recall that
$\Sq I(x) = 0$ for $\e(I)>\deg x$ by
Remark~\itemref{rem:sq}{item:squpperboundgeneral}. This leaves the two
cases $\e(I)<\deg x$ and $\e(I)=\deg x$.
Inductively applying the following Lemma by Serre restricts the
proof of Lemma~\ref{lem:masseystep1} to the first case where $\e(I)<q$.
\begin{Lem}[Serre]
  \label{lem:serre}
  Every admissible sequence $I\in\Nat^{\l(I)}$ of excess $\e(I)>0$
  admits an admissible sequence $J$ with $\e(J)<\e(I)$,
  together with some $k\in\Nat$
  such that for any cohomology class $x\in\H^{\e(I)}(M)$ holds
  \begin{gather*}
    \Sq I(x) = \left(\Sq J(x)\right) ^{2^k}
    \qquad\text{respectively}\qquad
    \deg\left(\Sq I(x)\right) = 2^k\cdot \deg\left(\Sq J(x)\right)
    \;.
  \end{gather*}
\end{Lem}

Before proving Lemma~\ref{lem:serre} one can finish the argumentation for
the case $\e(I)<\deg x$.
\begin{proof}[Proof of Lemma~\ref{lem:masseystep1}]
  Let $q\in\Nat$ and $I=(i_1,\dotsc,i_l)$ be an admissible sequence such that
  $\e(I)<q$.
  Assume there is a cohomology class $x\in\H^q(M)$ such that $\Sq I(x)\neq0$.
  Set
  \begin{alignat*}{4}
    \SwapAboveDisplaySkip
    \alpha_0 &= q-1-\e(I)\geq 0 &\qquad&\text{which is positive as $\e(I)<q$,} \\
    \alpha_r &= i_{r}-2i_{r+1}  &&\text{for $1\leq r< \l(I)$, and} \\
    \alpha_{\l(I)} &= i_{\l(I)}
    \;.
  \end{alignat*}
  It is an easy exercise that the excess of $I$ can be rewritten as
  $\e(I)=\sum_{r=1}^{\l(I)}\alpha_r$, so
  \begin{gather}\label{eq:alpha0}
    \sum_{r=0}^{\l(I)}\alpha_r = \alpha_0 + \e(I) \cequalsby{Def.} q-1
    \;.
  \end{gather}
  Just as easily one sees
  \begin{align}
    \SwapAboveDisplaySkip
    \label{eq:proofmassey:eq1}
    i_s
    &= \sum_{r=0}^{s}2^r\alpha_{s+r}\\\notag
  \end{align}
  The above definitions then directly imply the following reformulation
  of $\d(I)$ in terms of $\alpha_i$:
  \begin{align}
    \SwapAboveDisplaySkip
    \notag
    \d(I)
    &\coloneqq \sum_{s=1}^{\l(I)}i_s  \\\notag
    &\equalsby{\eqref{eq:proofmassey:eq1}}
      \sum_{s=1}^{\l(I)}\sum_{r=0}^{s}2^r\alpha_{s+r}\\\notag
    &\equalsby{Reorder} \sum_{j=1}^{\l(I)}
      \left(\sum_{m=0}^{j-1}2^m\right)\alpha_j
      = \sum_{j=1}^{\l(I)}(2^j-1)\alpha_j
      = \sum_{j=1}^{\l(I)}2^j\alpha_j
      - \sum_{j=1}^{\l(I)}\alpha_j\\
    \label{eq:proofmassey:eq2}
    &= \sum_{j=1}^{\l(I)}2^j\alpha_j
      - \e(I)
      \;.
  \end{align}
  All put together yields
  \begin{align*}
    \deg\left(\Sq I(x)\right)
    &= \deg(x) + \d(I)\\
    &= 1 + \deg(x) -1 +\d(I) \\
    &\equalsby{\eqref{eq:proofmassey:eq2}}
      1 + q - 1 - \e(I) + \sum_{j=1}^{\l(I)}2^j\alpha_j \\
    &\equalsby{Def.}
      1 + \alpha_0 + \sum_{j=1}^{\l(I)}2^j\alpha_j \\
    &= 1 + \sum_{j=0}^{\l(I)}2^j\alpha_j
    = 1 + \left(
      \underbrace{2^0 +\dotsb+ 2^0}_{\text{$\alpha_0$ times}}
      + \dotsb
      + \underbrace{2^{\l(I)}+\dotsb+2^{\l(I)}}_{\text{$\alpha_{\l(I)}$ times}}
      \right)
  \end{align*}
  which is one plus a sum of exactly
  $\sum_{j=0}^{\l(I)}\alpha_j\cequalsby{\eqref{eq:alpha0}} q-1$
  powers of two as was to be shown.
  The $k_j$ are in this case
  \begin{gather*}
    \SwapAboveDisplaySkip
    k_j = \begin{cases}
      0 & 0< j\leq \alpha_0\\
      1 & \alpha_0< j\leq \alpha_1\\
      \vdots\\
      \l(I) & \alpha_{\l(I)-1}<j\leq \alpha_{\l(I)}
    \end{cases}
    \qedhere
  \end{gather*}
\end{proof}

\begin{proof}[Proof of Lemma~\ref{lem:serre}]
  A version of the following proof can be found in
  \cite[p.~159, Lemma~1, converse part]{serre}.
  First note that any admissible sequence $I\coloneqq(i_1,\dotsc,i_l)\in\Nat^l$
  of excess $\e(I)>0$ can be written as
  \begin{gather*}
    I=(2^{k-1}i_k,\dotsc,2i_k,i_k,i_{k+1},\dotsc,i_l)
  \end{gather*}
  with $l>k\geq 1$ chosen maximal, \idest $i_k>2i_{k+1}$. If $I$ is admissible, the subsequence
  $J\coloneqq(i_{k+1},\dotsc,i_l)$ will be admissible as well.
  In order to see that such $J$ and $k$ fulfill the requirements from
  Lemma~\ref{lem:serre} one only needs to show
  \begin{claim}
    For $I$ and $J$ as above, and $x\in\H^{\e(I)}(X)$ a cohomology
    class of a space $X$ holds
    \begin{enumerate}
    \item $\Sq I(x) = \left(\Sq J(x)\right)^{2^k}$, and
    \item $\e(I)<\e(J)$.
    \end{enumerate}
  \end{claim}
  For the first part one simply has to check that
  $\deg(\Sq J(x))=i_k$, as the statement then inductively follows from
  property \eqref{eq:sqsquared} that $\Sq i(y)=y^2$ for any cohomology
  class with $i=\deg(y)$.
  So calculate
  \begin{align*}
    \deg(\Sq J(x))
    &= \d(J) + \deg(x)\\
    &= \d(J) + \e(I)\\
    &= \d(J)
      + \left(\sum_{r=1}^{\l(I)-1}(i_r-2i_{r+1})\right)
      + i_{\l(I)}\\
    &= \d(J)
      + \left(\sum_{r=1}^{k-1}\underbrace{(i_r-2i_{r+1})}_{=0}\right)
      + (i_k-2i_{k+1})
      +\left(\sum_{r=k+1}^{\l(I)-1}(i_r-2i_{r+1})\right) + i_{\l(I)}\\
    &= \d(J)
      + (i_k-2i_{k+1})
      + \e(J) \\
    &= \d(J) + i_k - 2i_{k+1} + 2i_{k+1} - \d(J) \\
    &= i_k
  \end{align*}
  Comparing the excesses yields the second part:
  \begin{gather*}
    \e(I) - \e(J)
    = \left(\sum_{r=1}^{k-1}\underbrace{(i_r-2i_{r+1})}_{=0}\right)
    + \underbrace{(i_k - 2i_{k+1})}_{\text{$>0$ by def. of k}}
    > 0
    \qedhere
  \end{gather*}
\end{proof}

\subsection[Candidates for the Degree Formula]
{Step 2: Candidates for the Degree Formula}

This section is dedicated to the search of an iterated Steenrod square
$\Sq I$ of degree $n-q$ that is non-trivial in degree
$\Sq I\colon\H^q(M)\to\H^n(M)$ in order to complete
\ref{tag:masseystep2} of the proof of Theorem~\ref{thm:massey}.

The candidate is the multiplication map
\begin{gather*}
  \H^q(M) \longto \H^n(M)
  \qquad
  x\longmapsto x\cup\dualw{n-q}{M}
\end{gather*}
which is non-trivial if and only if $\dualw{n-q}{M}\neq 0$, since the
cup-product is non-degenerated by Poincaré duality
\cite[Proposition~3.38]{hatcher}.
It remains to see that this map actually comes from a sum of
iterated Steenrod squares, one of which then must be non-trivial and
of the correct degree.
But this easily follows from the next main Lemma,
the proof of which essentially uses Wu's theorem and the properties of
the Wu classes.

\begin{Lem}\label{lem:masseystep2}
  Let $0<k<n$ and $x\in\H^k(M)$ be a cohomology class.
  Then
  \begin{gather*}
    x\cdot\dualw{n-k}{M} = \sum_{i>0}\Sq i(x)\cdot\dualw{n-k-i}{M}
  \end{gather*}
\end{Lem}
Again, before proving the above lemma, let us see how this contributes
to the final result.
\begin{proof}[Proof of Theorem~\ref{thm:massey}]
  The trick to complete \ref{tag:masseystep1} is to show that
  for $\dualw{n-q}{M}\neq 0$, and $k$, $x$ as in the Lemma above
  \begin{gather*}
    \SwapAboveDisplaySkip
    x\cdot \dualw{n-q}{M} = \sum_{I\in A}\Sq I(x)
    \;,
  \end{gather*}
  where $A$ is some collection of sequences of degree $(n-q)$.
  Because then for at least one $I\in A$, $\Sq I(x)$ is non-trivial,
  as is needed to apply Lemma~\ref{lem:masseystep1} which then yields
  the desired decomposition of $n=\deg(\Sq I(x))$.

  The above lemma serves for a descending induction on the maximum
  degree $n-q-r$ of the dual Stiefel-Whitney classes occurring in
  the sum describing $x\cdot\dualw{n-q}{M}$.
  More precisely, assume that
  \begin{gather*}
    \SwapAboveDisplaySkip
    x\cdot \dualw{n-q}{M}
    = \sum_{I\in A}\Sq I(x)
    + \sum_{j=r}^{n-q-1}\Sq{I_j}(x)\cdot\dualw{n-q-j}{M}
    \;.
  \end{gather*}
  Then Lemma~\ref{lem:masseystep2} reduces the maximum degree $n-q-r$
  of dual Stiefel-Whitney classes with the induction rule
  \begin{gather*}
    \Sq I(x)\cdot\dualw{n-k-j}{M}
    \cequalsby{\ref{lem:masseystep2}}
    \sum_{i>0}\Sq i\circ\Sq I(x)\cdot\dualw{n-k-(i+j)}{M}
  \end{gather*}
  as follows:
  \begin{align*}
    \sum_{j=r}^{n-q-1}\Sq{I_j}(x)\cdot\dualw{n-q-j}{M}
    &= \sum_{j=r}^{n-q-1}\sum_{i>0}
      \Sq i(\Sq{I_j}(x))\cdot \dualw{n-q-j-i}{M}
    \\
    &= \sum_{j=r}^{n-q-1}\sum_{i=1}^{n-q-j}
      \Sq{(i)\concat I_j}(x)\cdot \dualw{n-q-j-i}{M}
    \\
    &= \sum_{\mathrlap{r+1\leq i+j\leq n-q}}
      \Sq{(i)\concat I_j}(x)\cdot \dualw{n-q-j-i}{M}
    \\
    &=\sum_{\mathrlap{i+j=n-q}} \Sq{(i)\concat I_j}(x)\cdot \dualw0{M}
      + \sum_{\mathrlap{r+1\leq i+j\leq n-q-1}}
      \Sq{(i)\concat I_j}(x)\cdot \dualw{n-q-j-i}{M}
    \\
    &=\sum_{\mathrlap{i+j=n-q}} \Sq{(i)\concat I_j}(x)
      + \sum_{\mathrlap{r+1\leq i+j\leq n-q-1}}
      \Sq{(i)\concat I_j}(x)\cdot \dualw{n-q-j-i}{M}
      \;.
  \end{align*}
  Going down respectively up to $r=n-q$, one obtains that
  $x\cdot\dualw{n-q}{M}$ is a sum of iterated Steenrod squares
  evaluated on $x$ as was to be shown.
\end{proof}

\begin{proof}[Proof of Lemma~\ref{lem:masseystep2}]
  As above let $0<k<n$ and $x\in\H^k(M)$.
  For simplicity write
  $\ws i\coloneqq\w i M$, $\dualws i\coloneqq\dualw i M$,
  $\vu i = \v i M$ and $\dualvu i = \dualv i M$.
  In order to translate from Stiefel-Whitney classes to Steenrod
  squares and back again recall the following results.
  \begin{description}
  \item[By Theorem~\ref{thm:wu} (Wu):]
    $\sum_{j=0}^{s} \Sq j(\dualvu{s-j}) = \dualws{s-j}$
    for any $s\leq n$.
  \item[By Definition~\ref{def:wuclasses} of $\Vu$:]
    $\vu i \cdot y = \Sq i(y)$
    for any $i\leq n$ and $y\in\H^{n-i}(M)$.
  \item[By Definition~\ref{def:dualwuclasses} of $\dualVu$:]
    $\dualvu d = \sum_{i=1}^{d} \vu i\cdot \dualvu{d-i}$ for $d>0$.
  \end{description}
  The full calculation is then
  \begin{align*}
    \qquad
    x\cdot \dualws{n-k}
    &\clapequalsby{\ref{thm:wu}}
      x\cdot \sum_{i=0}^{n-k} \Sq i(\dualvu{n-k-i}) \\
    &\equalsby{Def. $\Sq 0$}
      x\cdot\left(
      \dualvu{n-k} + \sum_{i=1}^{n-k} \Sq i(\dualvu{n-k-i})
      \right) \\
    &\equalsby{Def. $\dualVu$}
      x\cdot\left(
      \left(\sum_{i=1}^{n-k} \vu{i}\cdot\dualvu{n-k-i}\right)
      + \left(\sum_{i=1}^{n-k} \Sq i(\dualvu{n-k-i})\right)
      \right) \\
    &=
      \sum_{i=1}^{n-k} \left(
      \vu{i}\cdot x\cdot \dualvu{n-k-i}
      + x\cdot \Sq i(\dualvu{n-k-i})
      \right) \\
    &\equalsby{Def. $\Vu$}
      \sum_{i=1}^{n-k} \left(
      \Sq i (x\cdot \dualvu{n-k-i})
      + x\cdot \Sq i(\dualvu{n-k-i})
      \right) \\
    &\equalsby{\ref{tag:cartan}, Def.}
      \sum_{i=1}^{n-k} \left(
      \left( \sum_{r=0}^{i} \Sq r(x)\cdot \Sq{i-r}(\dualvu{n-k-i}) \right)
      + \Sq 0(x)\cdot \Sq i(\dualvu{n-k-i})
      \right) \\
    &=
      \sum_{i=1}^{n-k} \left(
      \sum_{r=1}^{i} \Sq r(x)\cdot \Sq{i-r}(\dualvu{n-k-i})
      \right) \\
    &\equalsby{Reorder}
      \sum_{r=1}^{n-k} \Sq r(x) \cdot
      \left( \sum_{j=0}^{n-k-r} \Sq j(\dualvu{n-k-(j+r)}) \right) \\
    &\equalsby{\ref{thm:wu}}
      \sum_{r=1}^{n-k} \Sq r(x) \cdot\dualws{n-k-r}
      \qedhere
  \end{align*}
\end{proof}
This finished the proof of Massey's theorem.

\section{Best Possible Result}\label{sec:bestpossibleresult}
Recall that a closed $n$\nbd{}manifold can only immerse into
$\R^{n+k}$ if all Stiefel-Whitney classes $\dualw{i}{\N M}$ of its
normal bundle are zero in degrees greater than $k$.
Massey's Theorem now states that this condition is met for
$k=n-\alpha(n)$, and thus for all manifolds the above
obstruction to the immersion property vanishes. From this arose the
idea for the immersion conjecture.

Naturally, there occurs the question whether Massey's $n-\alpha(n)$ is
the best possible (\idest smallest) result for arbitrary closed
$n$\nbd{}manifolds, making the immersion conjecture the best
guess of a general possible immersion codimension.
The answer is yes, proved by the following counterexamples of manifolds
not immersing into $\R^{2n-(\alpha(n)+1)}$.

\begin{Thm}
  Denote by $\RP{i}$ the $i$th real projective space.
  \begin{enumerate}
  \item For $n=2^i$, the Stiefel-Whitney class
    $\dualw{n-\alpha(n)}{\RP{2^i}}$ is not zero.
  \item For $n\in\Nat$ with binary expansion
    $n=\sum_{r=1}^{q}2^{i_r}$, $i_1>\dotsb>i_q$, the Stiefel-Whitney class
    $\dualw{n-\alpha(n)}{\prod_{r=1}^{q}\RP{2^r}}$ is not zero.
  \end{enumerate}
  \begin{proof}
    Compare also \cite[p.~87]{immersionconj}.
    The total Stiefel-Whitney class of $\RP{n}$ for arbitrary
    $n\in\Nat$ is
    \begin{gather*}
      \SwapAboveDisplaySkip
      \W{\RP n} = (1+x_n)^{n+1}\in\H^*(\RP n)\cong \Zmod2[x_n]/(x_n^{n+1})
    \end{gather*}
    (see \forexample \cite[Example~(19.4.1)]{tomdieck}).
    For $n=2^i$ this takes the form
    \begin{align*}
      \W{\RP{2^i}}
      &= (x+1)^{2^i+1}
      = 1 + x + x^{2^i}
        \;,\quad\text{thus} \\
      \dualW{\RP{2^i}}
      &= \sum_{r=0}^{2^i-1} x^r
        \;,\quad\text{especially} \\
      \dualw{n-\alpha(n)}{\RP{2^i}}
      &= x^{2^i-1}\neq 0
        \;,\quad\text{since $\alpha(2^i)=1$,}
      %   \quad\text{, as} \\
      % \W{\RP{2^i}}\cdot\dualW{\RP{2^i}}
      % &= \sum_{r=0}^{2^i-1}x^r
      % + \sum_{r=1}^{2^i}x^r
      % + \sum_{r=0}^{2^i-1}x^{2^i}\cdot x^r \\
      % &= \left( 1 + \sum_{r=1}^{2^i-1}x^r \right)
      %   + \left( \sum_{r=1}^{2^i-1}x^r + x^{2^i} \right)
      %   + x^{2^i}
      %   = 1
    \end{align*}
    which proves the first statement.
    For the second statement where $n=\sum_{r=1}^q 2^{i_r}$ note that
    \begin{gather}
      \SwapAboveDisplaySkip
      \label{eq:bestresultproof1}
      n-\alpha(n)
      = \left( \sum_{r=1}^q 2^{i_r} \right) - q
      = \sum_{r=1}^q \left( 2^{i_r} - 1 \right)
      \;.
    \end{gather}
    Using multiplicativity %(\ref{tag:swclassesmultiplicativity})
    of the Stiefel-Whitney classes one gets
    \begin{align*}
      \dualW{\prod_{r=1}^q \RP{2^{i_r}}}
      &= \prod_{r=1}^q \dualW{\RP{2^{i_r}}}
        = \prod_{r=1}^q \left(\sum_{i=1}^{2^{i_r}-1} x_{2^{i_r}}^{i}\right)
        &\text{and by combinatorics} \\
      \dualw{n-\alpha(n)}{\prod_{r=1}^{q}\RP{2^{i_r}}}
      &= \prod_{r=1}^q x_{2^{i_r}}^{2^{i_r}-1}
        \neq 0
    \end{align*}
    in
    $\Zmod2\left[x_{2^{i_1}},\dotsc,x_{2^{i_q}}\right]/
    \left(x_{2^{i_1}}^{2^{i_1}+1},\dotsc,x_{2^{i_q}}^{2^{i_q}+1}\right)
    \cong \H^*\left(\prod_{r=1}^q \RP{2^{i_r}}\right)$.
  \end{proof}
\end{Thm}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "thesis"
%%% ispell-local-dictionary: "en_US"
%%% End:


\documentclass[a4paper]{article}

\usepackage[version=3]{mhchem}
\usepackage{siunitx}

\title{Analyzing the Effectiveness of Various Types of Aspirin}
\date{9 February 2015}
\author{Tarik Onalan}

\sisetup{ per-mode=fraction }

\begin{document}
    \maketitle
    \section{Price}
        Cost per gram:
        \begin{itemize}
            \item Baby Aspirin: $\frac{\SI{2.99}[\$]{}}{1~pack}\cdot\frac{1~pack}{36~tablets}\cdot\frac{1~tablet}{\SI{81}{\mg}}\cdot\frac{\SI{1000}{\mg}}{\SI{1}{g}}=1.02\frac{\$}{\si{\g}}$
            \item Normal Aspirin: $\frac{\SI{11.99}[\$]{}}{1~pack}\cdot\frac{1~pack}{300~tablets}\cdot\frac{1~tablet}{\SI{325}{\mg}}\cdot\frac{\SI{1000}{\mg}}{\SI{1}{g}}=0.12\frac{\$}{\si{\g}}$
        \end{itemize}
        Cost per tablet:
        \begin{itemize}
            \item Baby Aspirin: $\frac{\SI{2.99}[\$]{}}{1 pack}\cdot\frac{1~pack}{36~tablets}=\frac{\SI{0.08}[\$]{}}{1~tablet}$
            \item Normal Aspirin: $\frac{\SI{2.99}[\$]{}}{1 pack}\cdot\frac{1~pack}{36~tablets}=\frac{\SI{0.04}[\$]{}}{1~tablet}$
        \end{itemize}
    \section{Performance}
        \begin{enumerate}
            \item We used \SI{4.5}{\ml} and \SI{16.5}{\ml} of base to titrate the baby and normal aspirin, respectively.
            \begin{itemize}
                \item Baby Aspirin: $\SI{4.5}{\ml}\cdot\SI{1}{\g\per\ml}\cdot\SI{0.001}{\ml\per\l}\cdot\SI{0.02}{\mol\per\g}=\SI{0.00009}{\mol}$
                \item Normal Aspirin: $\SI{16.5}{\ml}\cdot\SI{1}{\g\per\ml}\cdot\SI{0.001}{\ml\per\l}\cdot\SI{0.02}{\mol\per\g}=\SI{0.00033}{\mol}$
            \end{itemize}
            \item Baby aspirin neutralized \SI{0.09}{\mol} of \ce{OH-}, while normal aspirin neutralized \SI{0.33}{\mol}
            of \ce{OH-}. (See above list for calculations)
            \item The number of moles of \ce{H+} is equal to the number of moles of \ce{OH-} required to titrate the
            solution. If the number of moles of \ce{H+} were equal to the number of moles of acid, then the mass of
            tablets would be:
            \begin{itemize}
                \item Baby Aspirin: $\SI{0.00009}{\mol}\cdot\SI{180.157}{\g\per\mol}=\SI{0.0162}{\g}=\SI{16.2}{\g}$
                \item Normal Aspirin: $\SI{0.00033}{\mol}\cdot\SI{180.157}{\g\per\mol}=\SI{0.0595}{\g}=\SI{59.5}{\g}$
            \end{itemize}
            \item The actual masses of the tablets should be \SI{81}{\mg} and \SI{325}{\mg} for the baby and normal aspirins,
            respectively. The differences between the actual masses and the calculated masses arises from the fact that
            the tablet is not purely acetylsalicylic acid. There are other compounds in the tablet that contribute to its
            mass.
        \end{enumerate}
    \section{Conclusion}
        \begin{enumerate}
            \item The baby aspirin costs $2$ times as much as normal aspirin per tablet and $8.5$ times as much per gram.
            \item I would buy normal aspirin because it is cheaper both per tablet and per gram.
            \item The biggest source of error in the lab was the fact that there were pieces of tablet that did not dissolve,
            possibly skewing titration results.
            \item As the active ingredient of aspirin is an acid, it can cause gastrointestinal irritation and/or bleeding
            if it concentrates on the stomach wall, etc. However, its blood-thinning effects are useful for people who
            have a high risk of clotting.
        \end{enumerate}
\end{document}


\subsection{System Characterisation}
\label{sec:theory:characterisation}

A systems complete dynamic behaviour around an operating point of interest can
be determined by applying a step function -- $\epsilon(t)$ -- to its input and
recording the system's output. The derivative of the resulting function is the
system's  \textit{impulse  response}  and  can  be  used  to calculate optimal
controller parameters.

Before measuring the step response we first have to select the step amplitude.
If the step amplitude is too small, the plant behaves in an atypical way. This
happens because of small disturbances  which  affect the step response. A good
example for this is static friction. On the  other  hand if the step amplitude
is  too  large,  then  non-linear  effects  will throw off the  accuracy  (and
validity) of the result.

After  a system's  step  response  has  been  measured,  it  is  necessary  to
characterise  and  determine  its  properties before it's possible  to  fit  a
transfer function to it. The method  of  characterisation used here is to find
the point of inflection in the measured step response, through which a tangent
is placed.  The  tangent's  intersection  points  with  the  lower  and  upper
horizontal bounds  are used to determine the dead time $T_u$ and the rise time
$T_g$.  Further, the amplitude $K_s$ of the step response can  be  determined.
This process is illustrated in figure \ref{fig:tu-tg-example}.

\begin{figure}[t]
    \centering
    \includegraphics[width=\imagewidth]{images/tu_tg_example}
    \caption{Example step response of a system and measurement of the angle of inflection for determining $K_s$, $T_u$ and $T_g$. Image taken from Wikipedia\cite{ref:tu-tg}.}
    \label{fig:tu-tg-example}
\end{figure}

It is important to note that this method  of  characterisation  is  valid  for
systems with an order of at least $n=2$ and for systems that don't exhibit any
overshoot.


\section{\texorpdfstring{Randomized computation}{Randomized computation}}
\vspace{5mm}
\large

% 9th lecture from 51:50

\begin{definition}[Probabilistic TM (PTM)]
	TM with 2 transition functions: $\delta_1, \delta_2$.
	When PTM works on $x$ it at each step selects $\delta_1$ with probability $\frac{1}{2}$ (same for $\delta_2$).
	PTM uses a fair cons toss that is independent from the previous results.

	PTM M returns a random variable denoted $M(x)$, $M(x) = 1$ if $M$ accepts $x$ and $0$ o/w.

	We say that $M$ runs in tim $T(n)$ if for every input $x$ M stops after at most $T(|x|)$ steps, regardless of the selections.
\end{definition}

\begin{notation}
	For a language $L \in \szo^{\ast}$ and $x \in \szo^{\ast}$ we define:
	\[ L(x) = 1 \iff X \in L \& L(x) = 0 \iff x \notin L \]
\end{notation}

\begin{definition}[BPP]
	PTM M accepts the language $L \in \szo^{\ast}$ in time $T(n)$ if
	\[ \forall x \in \szo^{\ast}: Pr[M(x) = L(x)] \geq \frac{2}{3} \]
	And $M$ runs in $T(n)$.

	$BPTIME(T(n))$ is a class of languages accepted by PTM in time $T(n)$.
	\[ BPP = \bigcup BPTIME(n^c) \]
	BPP - bounded error probabilistic polynomial time.
\end{definition}

\begin{properties}[BPP]
	BPP is invariant to (robust):
	\begin{itemize}
		\item Accepting probability: BPP will remain the same if we replace $\frac{2}{3}$ by any fraction $\in (\frac{1}{2}, 1)$.

		\item Probabilities of picking $\delta_1$ or $\delta_2$ can also be changed to $p, 1 - p$ instead of $\frac{1}{2}$.
		\item Running time: $T(n)$ can be replaced by "expected" $T(n)$.
	\end{itemize}
\end{properties}

\begin{note}[Open Question]
	We know:
	\[ \TP \subseteq BPP \]
	as we can take $\delta_1 = \delta_2$.

	However the strict inclusion is an open question
	\[ \TP \subsetneq BPP \]
\end{note}

\begin{note}[BPP and NP]
	The idea is similar, but BPP requires $\frac{2}{3}$ of accepting computation branches and $\TNP$ only 1.
\end{note}

\begin{definition}[Probabilistic TM (PTM) Alternative]
	Randomness can be presented making PTM accept additional input string, which is random $y \in \szo^{T(n)}$.
	Each bit tells which transition function to choose.
\end{definition}

% todo change to Fact and fix cref
\begin{theorem}[Chernoff bound]\label{chernoff}
	Let $x_i, \ldots, x_n$ be independent r.v. such that $x_i \in \szo$ and let $\mu = \sum \E[x_i]$ then
	\[ \forall c > 0: \Prob[|\sum x_i - \mu| \geq c \cdot \mu ] \leq 2e^{-\min\{ \frac{c^2}{4}, \frac{c}{2} \} \cdot \mu } \]
\end{theorem}

\begin{theorem}[BPP error reduction]\label{error_reduction}
	Let $L \in \szo^{\ast}$ be a language, $c > 0$ constant.
	Assume that there $\exists PTM\ M$ such that
	\[ \forall x \in \szo^{\ast}: Pr[M(x) = L(x)] \geq \frac{1}{2} + |x|^{-c} \]
	Note that as $x$ grows, error $|x|^{-c} \to 0$.

	Then
	\[ \forall d > 0: \exists PTM \ M_e: \forall x \in \szo^{\ast}:Pr[M_e(x) = L(x)] \geq 1 - 2^{-|x|^d} \]

	And if $M$ work in polynomial time so does $M_e$.
\end{theorem}
\begin{proof}
	Idea: $M_e$ runs $M$ $k = 8 \cdot |x|^{2d + c} + 1$ times.
	Assume $k$ is odd.
	Obtaining results $y_1, y_2, \ldots y_k$ and $M_e$ accepts iff
	\[ \sum y_i > \frac{1}{2} k \]
	Majority decision.

	Denote $x_i \in \szo^{\ast}$ r.v. where
	\[ x_i = 1 \iff y_i = L(x) \]
	As each $y_i$ represents different branch of computation, and coin flip is independent, $x_i$ are independent.
	Then by assumption on $M$
	\[ \E[x_i] = \Prob[x_i = 1] \geq \frac{1}{2} + |x|^{-c} = p \]

	Define $\delta = \frac{1}{2} |x|^{-c}$ and consider
	\[ S = \sum x_i \geq pk - \delta pk = pk (1 - \delta) = k \left(\frac{1}{2} |x|^{-c}\right)\left(1 - \frac{1}{2} |x|^{-c}\right) = \frac{1}{2}k + k\left(\frac{3}{4} |x|^{-c} - \frac{1}{2} |x|^{-2c}\right) \]
	Then as $\left(\frac{3}{4} |x|^{-c} - \frac{1}{2} |x|^{-2c}\right) \geq 0$
	\[ S = \frac{1}{2}k + k\left(\frac{3}{4} |x|^{-c} - \frac{1}{2} |x|^{-2c}\right)  > \frac{1}{2} k \]
	We conclude that if $M$ answers correctly at least $> \frac{1}{2} k$ then $M_e$ answers correctly (for sure).

	On the contrary, $M_e$ can make a mistake only if
	\[ \sum x_i < pk - \delta pk \]
	So
	\[ \Prob[\sum x_i < pk - \delta pk] \]
	is an upper bound of the probability that $M_e$ makes a mistake.
	Then
	\[ \E[x_i] \geq p \Rightarrow \sum \E[x_i] \geq pk \]
	For some $\varepsilon > 0$ denote
	\[\mu = \sum \E[x_i] = pk + \varepsilon \]
	Finally compute
	\[ P_e = \Prob[ pk - \sum x_i > \delta pk] \leq \Prob[ pk - \sum x_i + (1 - \delta)\varepsilon > \delta pk] = \Prob[pk + \varepsilon - \sum x_i > \delta pk + \delta \varepsilon] = \]
	\[ = \Prob[\mu - \sum x_i > \delta \mu ] = \]
	As the probability is symmetric and by Chernoff \cref{chernoff}
	% todo picture 9th lecture 01:58:50
	\[ = \frac{1}{2} \Prob[|\mu - \sum x_i| > \delta \mu ] \leq \frac{1}{2} 2 e^{-\frac{\delta^2}{4} \mu} \leq e^{-\frac{\delta^2}{4} pk} \]
	To summarize:
	\[ P_e = \Prob[M_e\ \text{makes an error}] \leq e^{-\frac{1}{4}\frac{|x|^{-2c}}{4} (\frac{1}{2} + |x|^{-c}) 8 \cdot |x|^{2d + c} + 1} = e^{-\frac{8 \cdot |x|^{2c + d}}{32 \cdot |x|^{2c}} + \frac{8 \cdot |x|^{2c + d}}{16 \cdot |x|^{3c}}} \]
	By reducing the exponent (2nd summand) and simplifying the first
	\[ P_e \leq e^{-\frac{1}{4} |x|^d} = (e^{\frac{1}{4}})^{-|x|^d} \leq 2^{-|x|^d} \]
\end{proof}

\begin{lemma}[Fair coin]
	A fair coin can be simulated by a PTM with an access to a biased coin with $\Prob[\text{head}]=p\in(0,1)$ in $\bigO(1)$ expected time.
\end{lemma}
\begin{proof}
	In each round PTM flips the biased coin twice if
	% todo readability
	\[ \twopartdef{H + H}{}{T + T}{} \Rightarrow \text{new pair of flips} \]
	Otherwise
	\[ \twopartdef{H + T}{H, \Prob[H] = p (1 - p)}{T + H}{T, \Prob[H] = (1 - p) p}\]
	As
	\[ \Prob[\text{PTM stops at round}\ i] = 2 p (1 - p) = c, c \in (0, 1) \]
	Then expected \# of trials before PTM stops
	\[ \sum i (1 - c)^{i - 1} c \]
	which converges.
\end{proof}
\begin{lemma}[Biased coin (Von-Neumann)]
	A biased coin with probability $\Prob[\text{head}]=\rho$ can be simulated in $\bigO(1)$ time by a ``standard'' PTM (with fair coin) if the $i$-th bit of $\rho$ can be generated in $\text{poly}(n) = n^c$.
\end{lemma}
\begin{proof}
	Let $\rho$ be a binary written as
	\[ \rho = 0p_1p_2 \ldots \]
	PTM generates fair sequence $b_1, b_2, \ldots$.
	If PTM in $i$-th step generates $b_i$ then
	\begin{itemize}
		\item $b_i < p_i \Rightarrow H$
		\item $b_i > p_i \Rightarrow T$
		\item $b_i = p_i$ go to step $(i + 1)$.
	\end{itemize}
	M gets to $i$-th step $\iff$
	\[ \forall 1 \leq j \leq i - 1: b_j = p_j \]
	which occurs with probability $\frac{1}{2^{i - 1}}$.
	% todo did not understand following implication
	$p_i = 1 \Rightarrow$ return $H$ in step $i$ with probability $\frac{1}{2}$.\\
	$p_i = 0 \Rightarrow$ return $H$ in step $i$ with probability $0$.
	Then
	\[ \Prob[H] = \sum p_i \frac{1}{2^i} = \rho \]

	The expected time $\sum n^i \frac{1}{2^{i - 1}}$ which converges.
\end{proof}

\begin{definition}[Expected running time]
    Let $M$ be a PTM and $x$ an input.
    Then $T_{M,x}$ is a random variable which denotes the time it takes $M$ to halt on $x$.
    The PTM $M$ runs in expected time $T(n)$ if $\forall x \in \szo^{\ast}: \E[T_{N,x}] \leq T(|x|)$.
\end{definition}

\begin{theorem}[Markov inequality]\label{markov}
	Let X be a non-negative r.v. Then
	\[ \Prob[ X \geq k \E[x]] \leq \frac{1}{k} \]
\end{theorem}

\begin{observation}
	Let PTM $M$ have expected time complexity $T(n)$.
	If we simulate $M$ on PTM $M_s$ with time complexity $100 T(n)$ (by rejecting longer computations), then the probability (by Markov \cref{markov})
	\[ \Prob[M\ \text{runs longer than}\ 100 T(n)] \leq \frac{1}{100} \]
	Therefore, $M_s$ rejects if it stops because of the clock, o/w it does the same as $M$.
	Then $\Prob[M_s\ \text{makes an error}]$ is at most $100$ greater than for $M$.

	We can reduce the error back to the error of $M$ by \cref{error_reduction}.
\end{observation}

% 10th lecture
\subsection{Classes RP, ZPP}

\begin{definition}[RTIME, RP]
	$L\in\text{RTIME}(T(n))\Leftrightarrow\exists$ PTM $M$ working in (expected) time $T(n)$ such that
    \begin{gather*}
    	x\in L\Rightarrow \Prob[M(x)=1]\geq 2/3\\
	x\not\in L\Rightarrow\Prob[M(x)=0]=1
    \end{gather*}

    $RP=\bigcup_c\text{RTIME}(n^c)$ -- Randomized Polynomial time

    Note that we can again prove that class is the same with either expected or exact polynomial time.
\end{definition}
\begin{definition}[ZTIME, ZPP]
    $L\in\text{ZTIME}(T(n))\Leftrightarrow\exists$ PTM $M$ working in (expected) time $T(n)$ such that
    \begin{gather*}
    	x\in L\Rightarrow \Prob[M(x)=1]=1\\
	x\not\in L\Rightarrow\Prob[M(x)=0]=1
    \end{gather*}

    $ZPP=\bigcup_c\text{ZTIME}(n^c)$ -- Zero-error Probabilistic Polynomial time

    Note that we can again prove that class is the same with either expected or exact polynomial time.
\end{definition}
\begin{lemma}[On probabilistic classes]\label{rp_bpp_zpp_prop}
    \begin{enumerate}
        \item $RP\subseteq \TNP$
        \item $BPP=co-BPP$
        \item $RP\subseteq BPP, co-RP\subseteq BPP$
        \item $ZPP=RP\cap co-RP$
    \end{enumerate}
\end{lemma}
\begin{proof}
    \begin{enumerate}
	    \item
		For $\TNP$ we require at least one accepting computation, by definition of $RP$ we have at least $\frac{2}{3}$ of them.
		If we allow PTM to work in expected polynomial time, then there is shorter accepting branch of computation.
        \item Design new PTM which simulates original PTM but flips all answers.
		\[ \Prob[\overline{M}(x) = \overline{L}(x)] = \Prob[1 - M(x) = 1 - L(x)] = \Prob[M(x) = L(x)] \geq \frac{2}{3} \]
	\item Follows from stricter definition of $RP$. Second condition follows from 2).
        \item $ZPP \subseteq RP\cap co-RP$
		Follows from the stricter definition of ZPP.

		$ZPP \supseteq RP\cap co-RP$. Let $L \in RP\cap co-RP$ arbitrary.
		By definition, we have 2 PTM: $M_y, M_n$.
    		\begin{gather*}
			x\in L \Rightarrow \Prob[M_y(x)=1] \geq 2/3 \& \Prob[M_n(x)=1] = 1\\
			x \notin L\Rightarrow\Prob[M_y(x)=0]=1 \& \Prob[M_n(x)=1] \geq 2/3
    		\end{gather*}
		Then, if $M_y(x) = 1 \Rightarrow x \in L$ (for sure) and symmetrically $M_n(x) = 1 \Rightarrow x \notin L$ (for sure).
		Construct new PTM $M$ that simulates both PTM in parallel, output depending on the simulation:
		\begin{itemize}
			\item $M_y(x) = 1 \Rightarrow M(X) = 1$
			\item $M_n(x) = 0 \Rightarrow M(X) = 0$
			\item $M_y(x) = 0 \& M_n(x) = 1 \Rightarrow$ try simulation again
		\end{itemize}

		Then
    		\begin{gather*}
			x \in L \Rightarrow \Prob[M_y(x) = 0 \& M_n(x) = 1] \leq \frac{1}{3} \cdot 1 = \frac{1}{3} \\
			x \notin L \Rightarrow \Prob[M_y(x) = 0 \& M_n(x) = 1] \leq 1 \cdot \frac{1}{3} = \frac{1}{3}
    		\end{gather*}

		Expected \# of repetitions of the simulation is $\leq \sum i \cdot (\frac{1}{3})^i$.
		Which converges.
    \end{enumerate}
\end{proof}

\begin{theorem}[$BPP \subseteq \Ppoly$ (Adleman)]
	\[ BPP \subseteq \Ppoly \]
\end{theorem}
\begin{proof}
	$L \in BPP \Rightarrow \exists DTM\ M$ with 2 inputs $x \in \szo^n, r \in \szo^m, m = poly(n)$ such that (by \cref{error_reduction}):
	\[ \Prob[M(x, r) \neq L(x)] \leq \frac{1}{2^{n^2}} \leq \frac{1}{2^{m + 1}} \]

	$r \in \szo^m$ is \emph{bad} for $x \in \szo^m$ if $M(x, r) \neq L(x)$.
	For a fixed $x$ there are $\frac{2^m}{2^{n + 1}}$ strings $r$ that are bad for $x$.
	For all $x$ there exists at $\leq 2^n \cdot \frac{2^m}{2^{n + 1}} = 2^m/2$ bad strings.
	Therefore $\geq \frac{1}{2} 2^m$ strings are good $\forall x$.

	Pick some $r_0$ that is good for $x$.
	From $\TP \subseteq \Ppoly$ \cref{tp_ppoly} $M$ can be simulated by polynomial size family of circuits $\{ C_{m + n} \}$.
	Note that value of $r_0$ is hard wired into the circuit.
	Then
	\[ \forall x \in \szo^n: L(x) = M(x, r_0) = C_{m + n}(x) \Rightarrow L \in \Ppoly \]
\end{proof}

\begin{theorem}[Sipser-Gács-Lautemann]
	BPP$\subseteq \Sigma^p_2 \cap \Pi_2^p$
\end{theorem}
\begin{proof}
	Since BPP is closed under complements \cref{rp_bpp_zpp_prop} it is enough to show
	\[ BPP \subseteq \Sigma^p_2 \]

	$L \in BPP \Rightarrow \exists DTM\ M$ with 2 inputs, size of random bits is $m$, such that (by \cref{error_reduction} setting $d = 1$):
    	\begin{gather*}
		x \in L \Rightarrow \Prob[M(x, r) = 1] \geq 1 - \frac{1}{2^n} \\
		x \notin L \Rightarrow \Prob[M(x, r) = 1] \leq \frac{1}{2^n}
    	\end{gather*}

	Define
	\[ \forall x \in \szo^n: S_x := \{ r |\ M(x, r) = 1 \} \]
	Trivially
    	\begin{gather*}
		x \in L \Rightarrow |S_x| \geq (1 - \frac{1}{2^n}) \cdot 2^m \\
		x \notin L \Rightarrow |S_x| \leq \frac{1}{2^n} \cdot 2^m \\
    	\end{gather*}
	Also define
	\[ \forall k, l \in \szo^m: k + l = k\ XOR\ l = k + l \mod2 \]
	\[ \forall Z \subseteq \szo^m, u \in \szo^m: Z + u = \{ z + u |\ z \in Z \} \]

	\begin{lemma}[Sipser-Gács-Lautemann 1]
		Let $Z \subseteq \szo^m \& |Z| \leq 2^{m - n}$.
		Also let $u_1, \ldots u_k \in \szo^m$.
		Then for $k = \lceil \frac{m}{n} + 1 \rceil$.
		\[ \bigcup (Z + u_i) \subsetneq \szo^m \]
	\end{lemma}
	\begin{proof}
		As in Lagrange theorem for groups
		\[ \forall i: |Z + u_i| = |Z| \]
		Therefore, even if all $Z + u_i$ are disjoint:
		\[ \bigcup (Z + u_i) \leq k |Z| \leq \lceil \frac{m}{n} + 1 \rceil \cdot \frac{2^m}{2^n} \leq 2^m \]
		Holds for large enough $n$ as $m = poly(n)$ but the denominator is exponential $2^n$:
		\[ \frac{m}{n 2^n} < 1 \]
	\end{proof}

	\begin{lemma}[Sipser-Gács-Lautemann 2]
		Let $Z \subseteq \szo^m \& |Z| \geq (1 - 2^m) 2^n$.
		Then
		\[ \exists u_1, \ldots u_k \in \szo^m: \bigcup (Z + u_i) = \szo^m \]
	\end{lemma}
	\begin{proof}
		It is enough to prove that for a random choice of $u_1, \ldots u_k$ we get
		\[ \Prob[\bigcup (Z + u_i) = \szo^m] > 0 \iff \Prob[\bigcup (Z + u_i) \subsetneq \szo^m] < 1 \]
		Which is equivalent
		\[ \Prob[\exists r \in \szo^m : r \notin \bigcup (Z + u_i)] < 1 \]
	Define $r$ is \emph{bad} for $i \iff r \notin Z + u_i \stackrel{XOR}{\iff} r + u_i \notin Z$.
	Pick $u_1, \ldots u_k \in \szo^m$ uniformly independently.
	Then // TODO fix (n, m)
	\[ \forall r: \Prob[r + u_i \in Z] \geq 1 - 2^m \Rightarrow \Prob[r \ \text{is bad for}\ i] \leq  2^{-n} \]
	By independent choice of $u_i$:
	\[ \Prob[r \ \text{is bad }\ \forall i] < 2^{-nk} \]
	\[ \Prob[\exists r \ \text{is bad }\ \forall i] = \Prob[\exists r: r \notin \bigcup (Z + u_i)] < 2^m \cdot 2^{-nk} \stackrel{nk > m}{<} 2^m \cdot 2^{-m} = 1 \]
	\end{proof}

	\[ x \in L \iff \exists u_1, \ldots, u_k \in \szo^m: \forall r \in \szo^m: r \in \bigcup (Z + u_i) \]
	Equivalently
	\[ x \in L \iff \exists u_1, \ldots, u_k \in \szo^m: \forall r \in \szo^m: \vee_i^k M(x, r + u_i) = 1 \]
	As $M$ is deterministic and works in polynomial time and we use it $k = \lceil \frac{m}{n} + 1 \rceil$ times: $\vee_i^k M(x, r + u_i)$ can be checked in polynomial time.
	\[ \vee_i^k M(x, r + u_i) = 1 \in \TP \]
	The formula is
	\[ \exists \forall \TP \in \Sigma_2 \]

\end{proof}