\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{wasysym}
\usepackage{easytable}
\usepackage{ytableau}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Tuesday, December 26, 2023 03:07:23}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\newcounter{exer}
\numberwithin{exer}{subsection}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\medskip \begin{small}}{\end{small} \medskip}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{warning}[1][Warning]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{teachingnote}[1][Teaching note]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\voffset=0cm
\hoffset=-0.7cm
\setlength\textheight{22.5cm}
\setlength\textwidth{15.5cm}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\newenvironment{teachingnote}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\excludecomment{teachingnote}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\id}{\operatorname{id}}
\newcommand{\lcm}{\operatorname{lcm}}
\newcommand{\rev}{\operatorname{rev}}
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\lf}[2]{#1^{\underline{#2}}}
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}
\newcommand{\are}{\ar@{-}}
\newcommand{\nnn}{\nonumber\\}
\newcommand{\sslash}{\mathbin{/\mkern-6mu/}}
\newcommand{\numboxed}[2]{\underbrace{\boxed{#1}}_{\text{box } #2}}
\newcommand{\ig}[2]{\includegraphics[scale=#1]{#2.png}}
\iffalse
\NOEXPAND{\today}{\today}
\NOEXPAND{\sslash}{\sslash}
\NOEXPAND{\numboxed}[2]{\numboxed}
\fi
\ihead{Math 235 Fall 2023, Worksheet 10, version \today}
\ohead{page \thepage}
\cfoot{Darij Grinberg}
\begin{document}
\setcounter{section}{9}

\section{Math 235 Fall 2023, Worksheet 10: Applications of linear algebra}

This worksheet is devoted to linear algebra, and specifically to its uses in
contest-style problems (often of combinatorial or arithmetical nature).

This is \textbf{not} an introduction to linear algebra, as there are several
good textbooks for that: Strickland's notes \cite{Strick21} are a well-written
and rigorous introduction to matrices (despite their applied audience),
whereas the textbook \cite{LaNaSc16} exposes the subject from the point of
view of vector spaces. Axler's book \cite{Axler23} is also recommended, even
though it bungles the definition of a polynomial\footnote{Every time Axler
says \textquotedblleft polynomial\textquotedblright, read \textquotedblleft
polynomial function\textquotedblright\ instead.}. Other (more advanced) texts
are \cite{Treil21}, \cite{Griffin20}, \cite{Camero08}, \cite{StoLui18} and
\cite{Kuttle22}.\footnote{This list restricts itself to the sources openly
available online and written in English; otherwise it would go on for several
more lines.}

Thus, I assume that you are familiar with the basics of linear algebra
(although I will insert the occasional reminder), and set out to show how it
can be used in some unexpected places.

As before, $\mathbb{N}$ means the set $\left\{  0,1,2,\ldots\right\}  $.

\subsection{\label{subsec.linalg.fields}A note on fields}

One of the main concepts in abstract algebra is that of a \emph{field}.
Roughly speaking, a field is a set of \textquotedblleft
numbers\textquotedblright\ (in a sufficiently wide sense), which can be added,
subtracted, multiplied and divided (except by zero). These four operations are
assumed to satisfy certain axioms (commutativity, associativity,
distributivity, existence of $0$ and $1$, and of course we want subtraction to
undo addition and division to undo multiplication). See any textbook on
abstract algebra for details (e.g., \cite[Chapter 3]{Aluffi21} or
\cite[Chapter 7 onwards]{Steinb06} or \cite[\S 2.5 onwards]{23wa}). The sets
$\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$ are fields, with the usual four
operations. The set $\mathbb{Z}$ is not, since integers cannot always be
divided (at least not without leaving $\mathbb{Z}$ or incurring remainders).
Other fields exist, and we will meet one more on this very worksheet; but the
most important ones are $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$.

The main concepts of linear algebra (matrices, vector spaces, linear maps,
determinants) can be defined over any field: If $\mathbb{F}$ is any field
(e.g., one of $\mathbb{Q}$, $\mathbb{R}$ and $\mathbb{C}$), then we can define

\begin{itemize}
\item matrices over $\mathbb{F}$ (these are matrices whose entries belong to
$\mathbb{F}$);

\item vector spaces over $\mathbb{F}$ (these are vector spaces in which the
vectors can be scaled by the elements of $\mathbb{F}$);

\item linear maps (these are maps $f:V\rightarrow W$ that satisfy $f\left(
v_{1}+v_{2}\right)  =f\left(  v_{1}\right)  +f\left(  v_{2}\right)  $ for all
$v_{1},v_{2}\in V$ and $f\left(  \lambda v\right)  =\lambda f\left(  v\right)
$ for all $\lambda\in\mathbb{F}$ and $v\in V$);

\item and so on.
\end{itemize}

When $\mathbb{F}=\mathbb{R}$, these concepts become the usual
\textquotedblleft real\textquotedblright\ concepts (i.e., matrices with real
entries, real vector spaces, real linear maps, etc.) known from basic courses
on linear algebra. Likewise, for $\mathbb{F}=\mathbb{C}$, we obtain complex
matrices, complex vector spaces, etc.\footnote{For example, the matrix
$\left(
\begin{array}
[c]{cc}%
1 & 1\\
-1 & 1
\end{array}
\right)  $ can be viewed both as a real matrix and as a complex matrix (and
even as a rational matrix). As a real matrix, it cannot be diagonalized, since
its eigenvalues $1+i$ and $1-i$ are not real. But as a complex matrix, it can
be diagonalized:%
\[
\left(
\begin{array}
[c]{cc}%
1 & 1\\
-1 & 1
\end{array}
\right)  =\left(
\begin{array}
[c]{cc}%
1 & 1\\
-i & i
\end{array}
\right)  \left(
\begin{array}
[c]{cc}%
1-i & 0\\
0 & 1+i
\end{array}
\right)  \left(
\begin{array}
[c]{cc}%
1 & 1\\
-i & i
\end{array}
\right)  ^{-1}.
\]
}. In general, when doing linear algebra using a field $\mathbb{F}$, one
commonly says that one is \textquotedblleft working over $\mathbb{F}%
$\textquotedblright, and one refers to the elements of $\mathbb{F}$ as
\textquotedblleft\emph{scalars}\textquotedblright.

\subsection{Linear dependence, bases, spanning}

Some of the most fundamental facts in linear algebra concern lists of vectors
in vector spaces. Such lists can be linearly dependent or independent; they
have spans (which are subspaces); they can be a basis of the vector space.
Furthermore, finite-dimensional vector spaces have bases and
dimensions\footnote{Infinite-dimensional vector spaces have bases and
dimensions, too, at least if you believe in the axiom of choice. But this is
both harder to prove and far less useful than the finite case.}. This all can
be found in any good textbook on linear algebra (e.g., \cite[Chapter
5]{LaNaSc16} or \cite[Chapter 2]{Axler23}). Let me highlight one particular
result for its usefulness:

\begin{theorem}
\label{thm.linalg.php.1}Let $k,n\in\mathbb{N}$. Assume you have a list of $k$
vectors in an $n$-dimensional vector space $V$.

\begin{enumerate}
\item[\textbf{(a)}] If $k>n$, then your $k$ vectors are linearly dependent.

\item[\textbf{(b)}] If $k=n$ and if your $k$ vectors are linearly independent,
then they form a basis of $V$.

\item[\textbf{(c)}] If $k<n$, then your $k$ vectors cannot span $V$.

\item[\textbf{(d)}] If $k=n$ and if your $k$ vectors span $V$, then they form
a basis of $V$.
\end{enumerate}
\end{theorem}

\begin{proof}
Part \textbf{(a)} is \cite[Theorem 1.59]{Griffin20}. Part \textbf{(b)} is
\cite[Theorem 1.63]{Griffin20} or \cite[Theorem 5.4.4 part 3]{LaNaSc16}. Part
\textbf{(c)} follows easily from \cite[Theorem 5.2.9]{LaNaSc16}. Part
\textbf{(d)} is \cite[Theorem 5.4.4 part 2]{LaNaSc16}.
\end{proof}

The four parts of Theorem \ref{thm.linalg.php.1} are sometimes called the
\emph{pigeonhole principles for vector spaces}, due to their similarity to the
pigeonhole principles for finite sets (Theorem 3.0.1 in Worksheet 3). Just
like the latter, they require finiteness ($k$ and $n$ must be finite, although
$V$ will usually not be finite as a set), but finite-dimensional vector spaces
are widespread in mathematics, so there is no shortage of situations to apply
them to.

Part \textbf{(a)} alone is surprisingly useful. The following two
\textquotedblleft exercises\textquotedblright\ are combinatorial results with
known names and a long history; both are rather hard to prove by elementary
combinatorics. Using Theorem \ref{thm.linalg.php.1} \textbf{(a)}, we will
prove them both with fairly little effort. The first is known as the
\emph{easy Lindstr\"{o}m theorem} (the hard one is Exercise
\ref{exe.linalg.php.lind2}):

\begin{exercise}
\label{exe.linalg.php.lind1}Let $n\in\mathbb{N}$. Let $S$ be an $n$-element
set. Let $A_{1},A_{2},\ldots,A_{n+1}$ be $n+1$ nonempty subsets of $S$. Prove
that there exist two disjoint nonempty subsets $I$ and $J$ of $\left\{
1,2,\ldots,n+1\right\}  $ such that%
\[
\bigcup_{i\in I}A_{i}=\bigcup_{i\in J}A_{i}.
\]
(Recall that $\bigcup\limits_{i\in I}A_{i}$ denotes the union of the $A_{i}$
for all $i\in I$. For example, if $I=\left\{  2,3,6\right\}  $, then
$\bigcup\limits_{i\in I}A_{i}=A_{2}\cup A_{3}\cup A_{6}$. Similarly,
$\bigcup\limits_{i\in J}A_{i}$ is understood.)
\end{exercise}

\begin{example}
For instance, let $n=5$ and $S=\left\{  1,2,3,4,5\right\}  $. Let%
\begin{align*}
A_{1}  &  =\left\{  1,2,3\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{2}=\left\{
2,3,5\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{3}=\left\{  2,4\right\}  ,\\
A_{4}  &  =\left\{  1,5\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{5}=\left\{
2,3\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{6}=\left\{  1\right\}  .
\end{align*}
Then, $A_{5}\cup A_{6}=A_{1}$. In other words, the two disjoint nonempty
subsets $I=\left\{  5,6\right\}  $ and $J=\left\{  1\right\}  $ of $\left\{
1,2,3,4,5,6\right\}  $ satisfy $\bigcup\limits_{i\in I}A_{i}=\bigcup
\limits_{i\in J}A_{i}$.
\end{example}

\begin{example}
For another example, let $n=5$ and $S=\left\{  1,2,3,4,5\right\}  $. Let%
\begin{align*}
A_{1}  &  =\left\{  1,3,4\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{2}=\left\{
2,3,5\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{3}=\left\{  2,4\right\}  ,\\
A_{4}  &  =\left\{  1,5\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{5}=\left\{
2,3\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{6}=\left\{  1\right\}  .
\end{align*}
Then, $A_{1}\cup A_{2}=A_{3}\cup A_{4}\cup A_{5}$. In other words, the two
disjoint nonempty subsets $I=\left\{  1,2\right\}  $ and $J=\left\{
3,4,5\right\}  $ of $\left\{  1,2,3,4,5,6\right\}  $ satisfy $\bigcup
\limits_{i\in I}A_{i}=\bigcup\limits_{i\in J}A_{i}$.
\end{example}

\begin{example}
We cannot allow the sets $A_{1},A_{2},\ldots,A_{n+1}$ in Exercise
\ref{exe.linalg.php.lind1} to be empty. In fact, if we did so, then we could
set $S=\left\{  1,2,\ldots,n\right\}  $ and
\begin{align*}
A_{1}  &  =\left\{  1\right\}  ,\ \ \ \ \ \ \ \ \ \ A_{2}=\left\{  2\right\}
,\ \ \ \ \ \ \ \ \ \ \ldots,\ \ \ \ \ \ \ \ \ \ A_{n}=\left\{  n\right\}  ,\\
A_{n+1}  &  =\varnothing,
\end{align*}
and then there would not be any two disjoint nonempty subsets $I$ and $J$ of
$\left\{  1,2,\ldots,n+1\right\}  $ such that $\bigcup\limits_{i\in I}%
A_{i}=\bigcup\limits_{i\in J}A_{i}$.
\end{example}

\begin{proof}
[Solution to Exercise \ref{exe.linalg.php.lind1}.]WLOG assume that $S=\left\{
1,2,\ldots,n\right\}  $ (otherwise, just rename the elements).

We shall use vectors -- specifically, row vectors of size $n$ with real
entries. Such vectors are written as $\left(  a_{1},a_{2},\ldots,a_{n}\right)
$, and the vector space consisting of these vectors is called $\mathbb{R}^{n}%
$. The $j$-th entry of such a vector is called its $j$\emph{-th coordinate}.

For each subset $J$ of $S$, we define the \emph{indicator vector} $e_{J}%
\in\mathbb{R}^{n}$ as follows: For each $i\in S=\left\{  1,2,\ldots,n\right\}
$, the $i$-th coordinate of $e_{J}$ shall be
\[%
\begin{cases}
1, & \text{if }i\in J;\\
0, & \text{if }i\notin J.
\end{cases}
\]
For example:

\begin{itemize}
\item If $n=5$ and $J=\left\{  1,3,4\right\}  $, then $e_{J}=\left(
1,0,1,1,0\right)  $.

\item If $n=5$ and $J=\left\{  2,4\right\}  $, then $e_{J}=\left(
0,1,0,1,0\right)  $.

\item If $n=5$ and $J=\varnothing$, then $e_{J}=\left(  0,0,0,0,0\right)  $.

\item If $n=5$ and $J=S=\left\{  1,2,3,4,5\right\}  $, then $e_{J}=\left(
1,1,1,1,1\right)  $.
\end{itemize}

This indicator vector $e_{J}$ is also known as \textquotedblleft incidence
vector\textquotedblright\ or \textquotedblleft characteristic
vector\textquotedblright, but we prefer the name \textquotedblleft indicator
vector\textquotedblright\ since it is the most informative (the entries of
$e_{J}$ literally indicate what numbers belong to $J$, like an indicator light
on an electric appliance).

Thus, we have $n+1$ indicator vectors $e_{A_{1}},e_{A_{2}},\ldots,e_{A_{n+1}}$
all belonging to the $n$-dimensional vector space $\mathbb{R}^{n}$ (of row
vectors). By Theorem \ref{thm.linalg.php.1} \textbf{(a)} (applied to $m=n+1$),
we thus conclude that they are linearly dependent (since $n+1>n$). In other
words, there exist real numbers $c_{1},c_{2},\ldots,c_{n+1}$, not all zero,
such that%
\begin{equation}
c_{1}e_{A_{1}}+c_{2}e_{A_{2}}+\cdots+c_{n+1}e_{A_{n+1}}=\mathbf{0}
\label{sol.linalg.php.lind1.2}%
\end{equation}
(where $\mathbf{0}$ denotes the zero vector). Consider these numbers
$c_{1},c_{2},\ldots,c_{n+1}$.

Let $I$ and $J$ be the two subsets of $\left\{  1,2,\ldots,n+1\right\}  $
defined by%
\begin{align*}
I  &  =\left\{  i\in\left\{  1,2,\ldots,n+1\right\}  \ \mid\ c_{i}>0\right\}
\ \ \ \ \ \ \ \ \ \ \text{and}\\
J  &  =\left\{  i\in\left\{  1,2,\ldots,n+1\right\}  \ \mid\ c_{i}<0\right\}
.
\end{align*}
These two subsets $I$ and $J$ are disjoint (since a single $i$ cannot satisfy
$c_{i}>0$ and $c_{i}<0$ at the same time). Moreover, we can easily rewrite the
equality (\ref{sol.linalg.php.lind1.2}) as%
\begin{equation}
\sum_{i\in I}c_{i}e_{A_{i}}=-\sum_{i\in J}c_{i}e_{A_{i}},
\label{sol.linalg.php.lind1.3}%
\end{equation}
since (\ref{sol.linalg.php.lind1.2}) leads to%
\begin{align*}
\mathbf{0}  &  =c_{1}e_{A_{1}}+c_{2}e_{A_{2}}+\cdots+c_{n+1}e_{A_{n+1}}%
=\sum_{i\in\left\{  1,2,\ldots,n+1\right\}  }c_{i}e_{A_{i}}\\
&  =\underbrace{\sum_{\substack{i\in\left\{  1,2,\ldots,n+1\right\}
;\\c_{i}>0}}}_{\substack{=\sum_{i\in I}\\\text{(by the definition of
}I\text{)}}}c_{i}e_{A_{i}}+\sum_{\substack{i\in\left\{  1,2,\ldots
,n+1\right\}  ;\\c_{i}=0}}\underbrace{c_{i}}_{=0}e_{A_{i}}+\underbrace{\sum
_{\substack{i\in\left\{  1,2,\ldots,n+1\right\}  ;\\c_{i}<0}}}%
_{\substack{=\sum_{i\in J}\\\text{(by the definition of }J\text{)}}%
}c_{i}e_{A_{i}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }i\in\left\{  1,2,\ldots,n+1\right\}  \text{ satisfies}\\
\text{either }c_{i}>0\text{ or }c_{i}=0\text{ or }c_{i}<0
\end{array}
\right) \\
&  =\sum_{i\in I}c_{i}e_{A_{i}}+\underbrace{\sum_{\substack{i\in\left\{
1,2,\ldots,n+1\right\}  ;\\c_{i}=0}}0e_{A_{i}}}_{=0}+\sum_{i\in J}%
c_{i}e_{A_{i}}\\
&  =\sum_{i\in I}c_{i}e_{A_{i}}+\sum_{i\in J}c_{i}e_{A_{i}}.
\end{align*}


Now comes a crucial but simple observation: The equality
(\ref{sol.linalg.php.lind1.3}) entails%
\begin{equation}
\bigcup\limits_{i\in I}A_{i}=\bigcup\limits_{i\in J}A_{i}.
\label{sol.linalg.php.lind1.4}%
\end{equation}


\begin{proof}
[Proof of (\ref{sol.linalg.php.lind1.4}).]Let $k\in S$. Thus, $k\in S=\left\{
1,2,\ldots,n\right\}  $. Recall that the $k$-th coordinate of a given
indicator vector $e_{A_{i}}$ is
\[%
\begin{cases}
1, & \text{if }k\in A_{i};\\
0, & \text{if }k\notin A_{i}\text{.}%
\end{cases}
\]
Thus, the $k$-th coordinate of the vector $\sum_{i\in I}c_{i}e_{A_{i}}$ equals%
\[
\sum_{i\in I}c_{i}%
\begin{cases}
1, & \text{if }k\in A_{i};\\
0, & \text{if }k\notin A_{i}%
\end{cases}
\ \ =\sum_{\substack{i\in I;\\k\in A_{i}}}\underbrace{c_{i}\cdot1}_{=c_{i}%
}+\underbrace{\sum_{\substack{i\in I;\\k\notin A_{i}}}c_{i}\cdot0}_{=0}%
=\sum_{\substack{i\in I;\\k\in A_{i}}}c_{i}.
\]
This sum is $0$ when $k\notin\bigcup\limits_{i\in I}A_{i}$ (because in this
case, the sum is empty\footnote{since $k\notin\bigcup\limits_{i\in I}A_{i}$
means that there exists no $i\in I$ satisfying $k\in A_{i}$}), and positive
otherwise (because if $k\in\bigcup\limits_{i\in I}A_{i}$, then the sum
$\sum_{\substack{i\in I;\\k\in A_{i}}}c_{i}$ is nonempty\footnote{since
$k\in\bigcup\limits_{i\in I}A_{i}$ means that there exists some $i\in I$
satisfying $k\in A_{i}$}, and all its addends are positive\footnote{since
$c_{i}>0$ for each $i\in I$}). Thus, we have shown that the $k$-th coordinate
of the vector $\sum_{i\in I}c_{i}e_{A_{i}}$ is $0$ when $k\notin%
\bigcup\limits_{i\in I}A_{i}$ and positive otherwise. Hence, the $k$-th
coordinate of the vector $\sum_{i\in I}c_{i}e_{A_{i}}$ is nonzero exactly when
$k\in\bigcup\limits_{i\in I}A_{i}$.

An analogous argument shows that the $k$-th coordinate of the vector
$\sum_{i\in J}c_{i}e_{A_{i}}$ is nonzero exactly when $k\in\bigcup
\limits_{i\in J}A_{i}$. (The only difference is that now it will be negative,
rather than positive, in the case when $k\in\bigcup\limits_{i\in J}A_{i}$.)

However, the equality (\ref{sol.linalg.php.lind1.3}) shows that the two
vectors $\sum_{i\in I}c_{i}e_{A_{i}}$ and $\sum_{i\in J}c_{i}e_{A_{i}}$ are
equal up to a factor of $-1$. Thus, in particular, the $k$-th coordinate of
the former vector equals the $k$-th coordinate of the latter vector times
$-1$. Hence, the $k$-th coordinate of the former vector is nonzero if and only
if the $k$-th coordinate of the latter vector is nonzero. In other words, we
have $k\in\bigcup\limits_{i\in I}A_{i}$ if and only if $k\in\bigcup
\limits_{i\in J}A_{i}$ (since the $k$-th coordinate of the vector $\sum_{i\in
I}c_{i}e_{A_{i}}$ is nonzero exactly when $k\in\bigcup\limits_{i\in I}A_{i}$,
and since the $k$-th coordinate of the vector $\sum_{i\in J}c_{i}e_{A_{i}}$ is
nonzero exactly when $k\in\bigcup\limits_{i\in J}A_{i}$).

Forget that we fixed $k$. We thus have shown that for each $k\in S$, we have
$k\in\bigcup\limits_{i\in I}A_{i}$ if and only if $k\in\bigcup\limits_{i\in
J}A_{i}$. In other words, the sets $\bigcup\limits_{i\in I}A_{i}$ and
$\bigcup\limits_{i\in J}A_{i}$ contain the exact same elements of $S$. Since
both $\bigcup\limits_{i\in I}A_{i}$ and $\bigcup\limits_{i\in J}A_{i}$ are
subsets of $S$, this entails that they are identical. In other words,
$\bigcup\limits_{i\in I}A_{i}=\bigcup\limits_{i\in J}A_{i}$. This proves
(\ref{sol.linalg.php.lind1.4}).
\end{proof}

We are now almost done: We have constructed two disjoint subsets $I$ and $J$
of $\left\{  1,2,\ldots,n+1\right\}  $ such that%
\[
\bigcup_{i\in I}A_{i}=\bigcup_{i\in J}A_{i}.
\]
It remains to prove that $I$ and $J$ are nonempty.

Here, we need to recall that the numbers $c_{1},c_{2},\ldots,c_{n+1}$ are not
all zero. Thus, at least one of them is positive or negative. In other words,
at least one of the sets $I$ and $J$ is nonempty. Let us WLOG assume that
$J\neq\varnothing$ (since the case $I\neq\varnothing$ is analogous). We shall
now show that $I\neq\varnothing$ as well. Indeed, from $J\neq\varnothing$, we
see that $\bigcup_{i\in J}A_{i}$ is a nonempty union of nonempty sets (since
all $n+1$ sets $A_{1},A_{2},\ldots,A_{n+1}$ are nonempty), and thus is
nonempty itself. In other words, $\bigcup_{i\in I}A_{i}$ is nonempty (since
$\bigcup_{i\in I}A_{i}=\bigcup_{i\in J}A_{i}$). But this is only possible if
$I\neq\varnothing$ (since $I=\varnothing$ would lead to $\bigcup_{i\in I}%
A_{i}=\bigcup_{i\in\varnothing}A_{i}=\varnothing$). Hence, we have shown that
$I\neq\varnothing$. Thus, both $I$ and $J$ are nonempty, and this completes
our solution to Exercise \ref{exe.linalg.php.lind1}.
\end{proof}

\begin{noncompile}
This has also been discussed at

https://artofproblemsolving.com/community/c6h3798

https://artofproblemsolving.com/community/c6h5684

and proposed as a problem at the CWMO 2002.
\end{noncompile}

The next exercise is known as the the \emph{nonuniform Fisher inequality}
(\cite[Theorem 4.1]{BabFra23}):

\begin{exercise}
\label{exe.linalg.php.fisher1}Let $k$, $n$ and $m$ be three positive integers.
In a town with $n$ inhabitants, there are $m$ clubs, no two of which have the
exact same set of members. Assume that any two distinct clubs share exactly
$k$ members. Prove that $m\leq n$.
\end{exercise}

\begin{noncompile}
This is also Theorem 3 in https://math.mit.edu/\symbol{126}%
fox/MAT307-lecture15.pdf .
\end{noncompile}

\begin{example}
Let $n=3$ and let the inhabitants be $1,2,3$. Consider the three clubs%
\[
\left\{  1,2\right\}  ,\ \left\{  1,3\right\}  ,\ \left\{  2,3\right\}
\]
(of course, we regard each club as the set of its members). Any two of them
share exactly $1$ member. Exercise \ref{exe.linalg.php.fisher1} claims that we
cannot find more than $3$ clubs with this property.
\end{example}

\begin{example}
Let $n=4$ and let the inhabitants be $1,2,3,4$. Consider the four clubs%
\[
\left\{  1,2,3\right\}  ,\ \left\{  2,3,4\right\}  ,\ \left\{  3,4,1\right\}
,\ \left\{  4,1,2\right\}  .
\]
Any two of them share exactly $2$ members. Exercise
\ref{exe.linalg.php.fisher1} claims that we cannot find more than $4$ clubs
with this property.
\end{example}

\begin{proof}
[Solution idea to Exercise \ref{exe.linalg.php.fisher1}.]Let the $n$
inhabitants be called $1,2,\ldots,n$. Thus, each club is a subset of $\left\{
1,2,\ldots,n\right\}  $.

Let $C_{1},C_{2},\ldots,C_{m}$ be our $m$ clubs (regarded as subsets of
$\left\{  1,2,\ldots,n\right\}  $). Let $v_{1},v_{2},\ldots,v_{m}$ be the
indicator vectors of these clubs (defined in the same way as in the solution
to Exercise \ref{exe.linalg.php.lind1}). Thus, for each $i\in\left\{
1,2,\ldots,m\right\}  $, the vector $v_{i}$ is a row vector in $\mathbb{R}%
^{n}$ whose $j$-th coordinate is%
\[%
\begin{cases}
1, & \text{if }j\in C_{i};\\
0, & \text{otherwise}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }j\in\left\{  1,2,\ldots,n\right\}  .
\]


These indicator vectors $v_{1},v_{2},\ldots,v_{m}$ are distinct (since no two
clubs have the exact same set of members).

Recall one more concept from linear algebra: The \emph{dot product} of two
vectors $x=\left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{R}^{n}$ and
$y=\left(  y_{1},y_{2},\ldots,y_{n}\right)  \in\mathbb{R}^{n}$ is defined to
be the scalar%
\[
x_{1}y_{1}+x_{2}y_{2}+\cdots+x_{n}y_{n}=\sum_{p=1}^{n}x_{p}y_{p}.
\]
This dot product is denoted by $\left\langle x,y\right\rangle $ or sometimes
by $x\cdot y$. We will use the notation $\left\langle x,y\right\rangle $ in
the following.

For any $i,j\in\left\{  1,2,\ldots,m\right\}  $, we have
\begin{align}
\left\langle v_{i},v_{j}\right\rangle  &  =\sum_{p=1}^{n}\underbrace{%
\begin{cases}
1, & \text{if }p\in C_{i};\\
0, & \text{otherwise}%
\end{cases}
\ \ \cdot%
\begin{cases}
1, & \text{if }p\in C_{j};\\
0, & \text{otherwise}%
\end{cases}
}_{\substack{=%
\begin{cases}
1, & \text{if }p\in C_{i}\text{ and }p\in C_{j};\\
0, & \text{otherwise}%
\end{cases}
\\\text{(since }1\cdot1=1\text{ but }1\cdot0=0\cdot1=0\cdot0=0\text{)}%
}}\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the definition of the dot product}\\
\text{and of the indicator vectors }v_{i}\text{ and }v_{j}%
\end{array}
\right) \nonumber\\
&  =\sum_{p=1}^{n}%
\begin{cases}
1, & \text{if }p\in C_{i}\text{ and }p\in C_{j};\\
0, & \text{otherwise}%
\end{cases}
\ \ =\sum_{p=1}^{n}%
\begin{cases}
1, & \text{if }p\in C_{i}\cap C_{j};\\
0, & \text{otherwise}%
\end{cases}
\nonumber\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the statement \textquotedblleft}p\in C_{i}\text{ and }p\in
C_{j}\text{\textquotedblright}\\
\text{is equivalent to \textquotedblleft}p\in C_{i}\cap C_{j}%
\text{\textquotedblright}%
\end{array}
\right) \nonumber\\
&  =\left\vert C_{i}\cap C_{j}\right\vert
\label{sol.linalg.php.fisher1.vivj-gen}%
\end{align}
(since this sum has a nonzero addend corresponding to each $p\in C_{i}\cap
C_{j}$, and all these nonzero addends equal $1$).

Therefore, for any two \textbf{distinct} elements $i,j\in\left\{
1,2,\ldots,m\right\}  $, we have
\begin{equation}
\left\langle v_{i},v_{j}\right\rangle =\left\vert C_{i}\cap C_{j}\right\vert
=k \label{sol.linalg.php.fisher1.vivj-dist}%
\end{equation}
(by our assumption that any two distinct clubs share exactly $k$ members). On
the other hand, for each $i\in\left\{  1,2,\ldots,m\right\}  $, we have%
\begin{align}
\left\langle v_{i},v_{i}\right\rangle  &  =\left\vert C_{i}\cap C_{i}%
\right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{by
(\ref{sol.linalg.php.fisher1.vivj-gen}), applied to }j=i\right) \nonumber\\
&  =\left\vert C_{i}\right\vert . \label{sol.linalg.php.fisher1.vivi}%
\end{align}


Now, we must prove that $m\leq n$. Assume the contrary. Thus, $m>n$. Hence, by
Theorem \ref{thm.linalg.php.1} \textbf{(a)}, the $m$ vectors $v_{1}%
,v_{2},\ldots,v_{m}$ in the $n$-dimensional vector space $\mathbb{R}^{n}$ are
linearly dependent. In other words, there exist reals $c_{1},c_{2}%
,\ldots,c_{m}$, not all zero, such that%
\[
c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}=\mathbf{0}%
\]
(where $\mathbf{0}$ denotes the zero vector). Consider these reals. Thus,%
\[
\mathbf{0}=c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}=\sum_{i}c_{i}v_{i}.
\]
(Here and in the following, all summation indices range from $1$ to $m$. Thus,
\textquotedblleft$\sum_{i}$\textquotedblright\ means \textquotedblleft%
$\sum_{i=1}^{m}$\textquotedblright, and similarly for any other sums.)

It is easy to see that each $i\in\left\{  1,2,\ldots,m\right\}  $ satisfies
\begin{equation}
\left\vert C_{i}\right\vert \geq k. \label{sol.linalg.php.fisher1.Cigeqk}%
\end{equation}
(Indeed, if $i\in\left\{  1,2,\ldots,m\right\}  $, then we can pick any
arbitrary $j\in\left\{  1,2,\ldots,m\right\}  $ that is distinct from
$i$\ \ \ \ \footnote{Why does such a $j$ exist? Because we have $m>n\geq1$,
and thus there are at least two different $j\in\left\{  1,2,\ldots,m\right\}
$ (and therefore at least one of them is distinct from $i$).}, and then we
have $C_{i}\supseteq C_{i}\cap C_{j}$ and therefore $\left\vert C_{i}%
\right\vert \geq\left\vert C_{i}\cap C_{j}\right\vert =k$ (by our assumption
that any two distinct clubs share exactly $k$ members). Thus,
(\ref{sol.linalg.php.fisher1.Cigeqk}) is proved.)

Now, from $\mathbf{0}=\sum_{i}c_{i}v_{i}$ and $\mathbf{0}=\sum_{i}c_{i}%
v_{i}=\sum_{j}c_{j}v_{j}$, we obtain%
\begin{align*}
\left\langle \mathbf{0},\mathbf{0}\right\rangle  &  =\left\langle \sum
_{i}c_{i}v_{i},\ \sum_{j}c_{j}v_{j}\right\rangle \\
&  =\sum_{i}\ \ \sum_{j}c_{i}c_{j}\left\langle v_{i},v_{j}\right\rangle
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the dot product is linear}\\
\text{in each of its two arguments}%
\end{array}
\right) \\
&  =\sum_{i,j}c_{i}c_{j}\left\langle v_{i},v_{j}\right\rangle
\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{of course, both indices }i\text{ and }j\\
\text{range over }\left\{  1,2,\ldots,m\right\}
\end{array}
\right) \\
&  =\underbrace{\sum_{\substack{i,j;\\i=j}}c_{i}c_{j}\left\langle v_{i}%
,v_{j}\right\rangle }_{=\sum_{i}c_{i}c_{i}\left\langle v_{i},v_{i}%
\right\rangle }+\sum_{\substack{i,j;\\i\neq j}}c_{i}c_{j}%
\underbrace{\left\langle v_{i},v_{j}\right\rangle }_{\substack{=k\\\text{(by
(\ref{sol.linalg.php.fisher1.vivj-dist}))}}}\\
&  =\sum_{i}\underbrace{c_{i}c_{i}}_{=c_{i}^{2}}\underbrace{\left\langle
v_{i},v_{i}\right\rangle }_{\substack{=\left\vert C_{i}\right\vert \\\text{(by
(\ref{sol.linalg.php.fisher1.vivi}))}}}+\underbrace{\sum
_{\substack{i,j;\\i\neq j}}c_{i}c_{j}k}_{=k\sum_{\substack{i,j;\\i\neq
j}}c_{i}c_{j}}\\
&  =\sum_{i}c_{i}^{2}\left\vert C_{i}\right\vert +k\sum_{\substack{i,j;\\i\neq
j}}c_{i}c_{j}.
\end{align*}
Comparing this with $\left\langle \mathbf{0},\mathbf{0}\right\rangle =0$
(which is obvious), we obtain%
\begin{equation}
\sum_{i}c_{i}^{2}\left\vert C_{i}\right\vert +k\sum_{\substack{i,j;\\i\neq
j}}c_{i}c_{j}=0. \label{sol.linalg.php.fisher1.4}%
\end{equation}


Now, let us simplify the second sum on the left hand side here. (It is
generally a good idea to simplify the sums that have the most addends.) The
trick is to observe that
\begin{align*}
\left(  \sum_{i}c_{i}\right)  ^{2}  &  =\left(  \sum_{i}c_{i}\right)  \left(
\sum_{i}c_{i}\right)  =\left(  \sum_{i}c_{i}\right)  \left(  \sum_{j}%
c_{j}\right) \\
&  =\sum_{i,j}c_{i}c_{j}=\underbrace{\sum_{\substack{i,j;\\i=j}}c_{i}c_{j}%
}_{=\sum_{i}c_{i}^{2}}+\sum_{\substack{i,j;\\i\neq j}}c_{i}c_{j}=\sum_{i}%
c_{i}^{2}+\sum_{\substack{i,j;\\i\neq j}}c_{i}c_{j},
\end{align*}
so that%
\[
\sum_{\substack{i,j;\\i\neq j}}c_{i}c_{j}=\left(  \sum_{i}c_{i}\right)
^{2}-\sum_{i}c_{i}^{2}.
\]
Thus,%
\begin{align*}
\sum_{i}c_{i}^{2}\left\vert C_{i}\right\vert +k\underbrace{\sum
_{\substack{i,j;\\i\neq j}}c_{i}c_{j}}_{=\left(  \sum_{i}c_{i}\right)
^{2}-\sum_{i}c_{i}^{2}}  &  =\sum_{i}c_{i}^{2}\left\vert C_{i}\right\vert
+k\left(  \left(  \sum_{i}c_{i}\right)  ^{2}-\sum_{i}c_{i}^{2}\right) \\
&  =\sum_{i}c_{i}^{2}\left(  \left\vert C_{i}\right\vert -k\right)  +k\left(
\sum_{i}c_{i}\right)  ^{2}.
\end{align*}
Comparing this with (\ref{sol.linalg.php.fisher1.4}), we obtain%
\begin{equation}
0=\sum_{i}c_{i}^{2}\left(  \left\vert C_{i}\right\vert -k\right)  +k\left(
\sum_{i}c_{i}\right)  ^{2}. \label{sol.linalg.php.fisher1.6}%
\end{equation}
This equality is peculiar in that the left hand side is $0$, whereas the right
hand side is a sum of nonnegative addends (indeed, all the addends
$\underbrace{c_{i}^{2}}_{\substack{\geq0\\\text{(since squares are }%
\geq0\text{)}}}\underbrace{\left(  \left\vert C_{i}\right\vert -k\right)
}_{\substack{\geq0\\\text{(by (\ref{sol.linalg.php.fisher1.Cigeqk}))}}}$ and
$\underbrace{k}_{>0}\underbrace{\left(  \sum_{i}c_{i}\right)  ^{2}%
}_{\substack{\geq0\\\text{(since squares are }\geq0\text{)}}}$ on the right
hand side are nonnegative). However, a sum of nonnegative reals can only be
$0$ if all addends are $0$. Thus, the equality (\ref{sol.linalg.php.fisher1.6}%
) entails that all the addends on the right hand side are $0$. In other words,%
\begin{equation}
c_{i}^{2}\left(  \left\vert C_{i}\right\vert -k\right)
=0\ \ \ \ \ \ \ \ \ \ \text{for each }i\in\left\{  1,2,\ldots,m\right\}  ,
\label{sol.linalg.php.fisher1.7a}%
\end{equation}
and%
\begin{equation}
k\left(  \sum_{i}c_{i}\right)  ^{2}=0. \label{sol.linalg.php.fisher1.7b}%
\end{equation}


From (\ref{sol.linalg.php.fisher1.7b}), we obtain%
\begin{equation}
\sum_{i}c_{i}=0 \label{sol.linalg.php.fisher1.7bb}%
\end{equation}
(since $k$ is nonzero). Since the reals $c_{1},c_{2},\ldots,c_{m}$ are not all
zero, this entails that there exist \textbf{at least two} numbers
$p\in\left\{  1,2,\ldots,m\right\}  $ satisfying $c_{p}\neq0$ (because if
there was only one such number $p$, then the sum $\sum_{i}c_{i}$ would equal
its single nonzero addend $c_{p}\neq0$; but this would contradict
(\ref{sol.linalg.php.fisher1.7bb})). In other words, there exist two distinct
numbers $i$ and $j$ in $\left\{  1,2,\ldots,m\right\}  $ that satisfy
$c_{i}\neq0$ and $c_{j}\neq0$. Consider these $i$ and $j$. From
(\ref{sol.linalg.php.fisher1.7a}), we obtain $c_{i}^{2}\left(  \left\vert
C_{i}\right\vert -k\right)  =0$. Since $c_{i}\neq0$, we can divide this
equality by $c_{i}^{2}$, and thus obtain $\left\vert C_{i}\right\vert -k=0$.
In other words, $\left\vert C_{i}\right\vert =k$. However, $\left\vert
C_{i}\cap C_{j}\right\vert =k$ (by our assumption that any two distinct clubs
share exactly $k$ members). Now, $C_{i}\cap C_{j}$ is a subset of the finite
set $C_{i}$ that has the same size as $C_{i}$ (because $\left\vert C_{i}\cap
C_{j}\right\vert =k=\left\vert C_{i}\right\vert $). But the only such subset
is obviously $C_{i}$. Thus, $C_{i}\cap C_{j}=C_{i}$. Similarly, $C_{i}\cap
C_{j}=C_{j}$. Comparing these two equalities, we obtain $C_{i}=C_{j}$. But
this contradicts the assumption that no two clubs have the exact same set of
members. Hence, we found a contradiction, and the exercise is solved.
\end{proof}

Theorem \ref{thm.linalg.php.1} also leads to a useful general result about
dimensions of vector spaces (similar to the well-known fact in combinatorics
that any subset of an $n$-element set has size $\leq n$):

\begin{theorem}
\label{thm.linalg.subset}Let $W$ be a subspace of a finite-dimensional vector
space $V$. (Here and in the following, \textquotedblleft
subspace\textquotedblright\ means \textquotedblleft vector
subspace\textquotedblright.) Then:

\begin{enumerate}
\item[\textbf{(a)}] We have $\dim W\leq\dim V$.

\item[\textbf{(b)}] If $\dim W=\dim V$, then $V=W$.
\end{enumerate}
\end{theorem}

\begin{proof}
[Proof sketch.]Set $n:=\dim V$. Let $\mathbb{F}$ be the field over which $V$
is a vector space. \medskip

The vector space $V$ is $n$-dimensional (since $n=\dim V$). Thus, Theorem
\ref{thm.linalg.php.1} \textbf{(a)} shows that $V$ does not contain more than
$n$ linearly independent vectors. Hence, $W$ does not contain more than $n$
linearly independent vectors either (since $W$ is a subspace of $V$). But of
course, $W$ contains $0$ linearly independent vectors. Thus, there exists a
\textbf{largest} integer $m\in\mathbb{N}$ such that $W$ contains $m$ linearly
independent vectors. Consider this largest $m$, and pick a list $\left(
w_{1},w_{2},\ldots,w_{m}\right)  $ of $m$ linearly independent vectors in $W$.
Note that $m$ cannot be larger than $n$ (since $W$ contains $m$ linearly
independent vectors but does not contain more than $n$ linearly independent
vectors). In other words, $m\leq n$. Also note that $W$ does not contain $m+1$
linearly independent vectors\footnote{since $m$ was chosen to be the
\textbf{largest} integer with the property that $W$ contains $m$ linearly
independent vectors}.

Now, we claim that the list $\left(  w_{1},w_{2},\ldots,w_{m}\right)  $ is a
basis of $W$. Indeed, we already know that this list is linearly independent,
so we only need to prove that it spans $W$. To this purpose, we fix a vector
$w\in W$. Then, the list $\left(  w_{1},w_{2},\ldots,w_{m},w\right)  $
consists of $m+1$ vectors, and thus cannot be linearly independent (because if
it was, then $W$ would contain $m+1$ linearly independent vectors, but we know
that $W$ does not contain $m+1$ linearly independent vectors). Hence, there
exist scalars $c_{1},c_{2},\ldots,c_{m},c\in\mathbb{F}$, not all zero, such
that
\begin{equation}
c_{1}w_{1}+c_{2}w_{2}+\cdots+c_{m}w_{m}+cw=\mathbf{0}
\label{pf.thm.linalg.subset.2}%
\end{equation}
(where $\mathbf{0}$ denotes the zero vector of $V$). Consider these scalars.
If $c$ was $0$, then the equality (\ref{pf.thm.linalg.subset.2}) would
simplify to $c_{1}w_{1}+c_{2}w_{2}+\cdots+c_{m}w_{m}=\mathbf{0}$ (since
$\underbrace{c}_{=0}w=0w=\mathbf{0}$), which would entail $c_{1}=c_{2}%
=\cdots=c_{m}=0$ (since the list $\left(  w_{1},w_{2},\ldots,w_{m}\right)  $
is linearly independent) and therefore $c_{1}=c_{2}=\cdots=c_{m}=c=0$ (since
$c=0$); but this would contradict the fact that $c_{1},c_{2},\ldots,c_{m},c$
are not all zero. Hence, $c$ cannot be $0$. Thus, we can divide by $c$ in the
field $\mathbb{F}$. Dividing both sides of the equality
(\ref{pf.thm.linalg.subset.2}) by $c$ (that is, multiplying them by $\dfrac
{1}{c}$), we obtain%
\[
\dfrac{c_{1}}{c}w_{1}+\dfrac{c_{2}}{c}w_{2}+\cdots+\dfrac{c_{m}}{c}%
w_{m}+w=\mathbf{0}.
\]
Solving this for $w$, we find%
\begin{align*}
w  &  =-\left(  \dfrac{c_{1}}{c}w_{1}+\dfrac{c_{2}}{c}w_{2}+\cdots
+\dfrac{c_{m}}{c}w_{m}\right) \\
&  =\dfrac{-c_{1}}{c}w_{1}+\dfrac{-c_{2}}{c}w_{2}+\cdots+\dfrac{-c_{m}}%
{c}w_{m}\\
&  \in\operatorname*{span}\left\{  w_{1},w_{2},\ldots,w_{m}\right\}  .
\end{align*}


Forget that we fixed $w$. We thus have shown that $w\in\operatorname*{span}%
\left\{  w_{1},w_{2},\ldots,w_{m}\right\}  $ for each $w\in W$. In other
words, $W\subseteq\operatorname*{span}\left\{  w_{1},w_{2},\ldots
,w_{m}\right\}  $. Thus, the list $\left(  w_{1},w_{2},\ldots,w_{m}\right)  $
spans the vector space $W$. Since this list is also linearly independent, we
conclude that it is a basis of $W$.

Hence, the vector space $W$ has a basis consisting of $m$ vectors (namely,
this list $\left(  w_{1},w_{2},\ldots,w_{m}\right)  $). Thus, its dimension is
$\dim W=m$. Now, $\dim W=m\leq n=\dim V$, so that Theorem
\ref{thm.linalg.subset} \textbf{(a)} is proved. \medskip

\textbf{(b)} Assume that $\dim W=\dim V$. Then, $m=\dim W=\dim V=n$. Now,
recall that the $m$ vectors $w_{1},w_{2},\ldots,w_{m}$ are linearly
independent. In other words, the $n$ vectors $w_{1},w_{2},\ldots,w_{n}$ are
linearly independent (since $m=n$). Hence, $w_{1},w_{2},\ldots,w_{n}$ are $n$
linearly independent vectors in the $n$-dimensional vector space $V$, and thus
form a basis of $V$ (by Theorem \ref{thm.linalg.php.1} \textbf{(b)}). Thus,
\begin{align*}
V  &  =\operatorname*{span}\left\{  w_{1},w_{2},\ldots,w_{n}\right\}
=\operatorname*{span}\left\{  w_{1},w_{2},\ldots,w_{m}\right\}
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }n=m\right) \\
&  =W\ \ \ \ \ \ \ \ \ \ \left(  \text{since the list }\left(  w_{1}%
,w_{2},\ldots,w_{m}\right)  \text{ spans }W\right)  .
\end{align*}
This proves Theorem \ref{thm.linalg.subset} \textbf{(b)}.
\end{proof}

\subsection{Determinants}

A highly useful subfield of linear algebra is the evaluation of determinants.
This is an art all in itself, with a long history predating most of linear
algebra (determinants were introduced two centuries before
matrices!\footnote{The word \textquotedblleft matrix\textquotedblright\ was
introduced by J. J. Sylvester to refer to a rectangular table of numbers out
of which many determinants (\textquotedblleft minor\textquotedblright) can be
formed by removing some rows and some columns (\textquotedblleft as from the
womb of a common parent\textquotedblright; thus the word \textquotedblleft
matrix\textquotedblright). Before Sylvester, authors would just talk about
determinants $\left\vert
\begin{array}
[c]{cc}%
a & b\\
c & d
\end{array}
\right\vert $ without having a special name for the table of entries
\textquotedblleft within\textquotedblright\ the determinant.}). An
introduction to this art can be found in \cite[\S 6.4]{21s}, more advanced
methods in \cite{Krattenthaler}, and a multitude of exercises in \cite[Chapter
1]{Prasolov} and \cite[Chapter 6]{detnotes}. We will only give a few examples
and applications here.

\subsubsection{Definition and methods of computation}

We recall that the determinant of an $n\times n$-matrix%
\[
A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}=\left(
\begin{array}
[c]{cccc}%
a_{1,1} & a_{1,2} & \cdots & a_{1,n}\\
a_{2,1} & a_{2,2} & \cdots & a_{2,n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n,1} & a_{n,2} & \cdots & a_{n,n}%
\end{array}
\right)
\]
is defined by the formula%
\begin{equation}
\det A=\sum_{\sigma\in S_{n}}\left(  -1\right)  ^{\sigma}a_{1,\sigma\left(
1\right)  }a_{2,\sigma\left(  2\right)  }\cdots a_{n,\sigma\left(  n\right)
}, \label{eq.det.leib}%
\end{equation}
where

\begin{itemize}
\item the set $S_{n}$ is the set of all permutations of the set $\left\{
1,2,\ldots,n\right\}  $ (that is, bijective maps from this set $\left\{
1,2,\ldots,n\right\}  $ to itself);

\item the factor $\left(  -1\right)  ^{\sigma}$ denotes the sign of the
permutation $\sigma$ (that is, $1$ if $\sigma$ is even, and $-1$ if $\sigma$
is odd). (See, e.g., \cite[Appendix B]{Strick21} for a quick but well-written
introduction to signs of permutations.)
\end{itemize}

The above formula (\ref{eq.det.leib}) is known as the \emph{Leibniz formula},
and is probably the simplest way to define determinants, but one of the least
efficient ways to compute them. Over the centuries, many techniques for the
computation of determinants have appeared, such as the following:

\begin{itemize}
\item \emph{Laplace expansion} (along a row or a column). See \cite[\S 6.4.7]%
{21s}, \cite[\S 6.12]{detnotes} or \cite[Propositions B.24 and B.25]{Strick21}
(or various other sources) for statements and proofs. For example, here is how
a $3\times3$-determinant can be expanded along the second row and the second
column:%
\[
\det\left(
\begin{array}
[c]{ccc}%
a & b & c\\
a^{\prime} & b^{\prime} & c^{\prime}\\
a^{\prime\prime} & b^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  =-a^{\prime}\det\left(
\begin{array}
[c]{cc}%
b & c\\
b^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  +b^{\prime}\det\left(
\begin{array}
[c]{cc}%
a & c\\
a^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  -c^{\prime}\det\left(
\begin{array}
[c]{cc}%
a & b\\
a^{\prime\prime} & b^{\prime\prime}%
\end{array}
\right)
\]
and%
\[
\det\left(
\begin{array}
[c]{ccc}%
a & b & c\\
a^{\prime} & b^{\prime} & c^{\prime}\\
a^{\prime\prime} & b^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  =-b\det\left(
\begin{array}
[c]{cc}%
a^{\prime} & c^{\prime}\\
a^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  +b^{\prime}\det\left(
\begin{array}
[c]{cc}%
a & c\\
a^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  -b^{\prime\prime}\det\left(
\begin{array}
[c]{cc}%
a & c\\
a^{\prime} & c^{\prime}%
\end{array}
\right)  .
\]
Note the signs, which always alternate and are positive whenever the entry
being plucked out comes from the diagonal of the matrix! Tactically, Laplace
expansion is at its most useful when many addends in the resulting sum vanish.
For example, when computing $\det\left(
\begin{array}
[c]{ccc}%
1 & 0 & 2\\
2 & 3 & 0\\
4 & 0 & 0
\end{array}
\right)  $ by Laplace expansion, it is reasonable to expand along the first
row (since it has a $0$ entry), but it is best to expand along the third row
or the second or third column (since it has two $0$ entries).

\item \emph{Multilinearity} and \emph{alternatingness}. These basic properties
of determinants (see \cite[Theorems 6.4.12 and 6.4.14]{21s} or \cite[Exercise
6.7]{detnotes}, for example) look harmless, but are often helpful as steps in
longer computations. Here is a quick summary:

\begin{itemize}
\item If a row of a matrix $A$ is zero (i.e., consists entirely of zeroes),
then $\det A=0$.

\item If two rows of a matrix $A$ are equal, then $\det A=0$.

\item If we swap two rows of a matrix $A$, then $\det A$ gets multiplied by
$-1$.

\item If we multiply a row of a matrix $A$ by a given scalar $\lambda$, then
$\det A$ gets multiplied by $\lambda$.

\item If we add a scalar multiple of a row of a matrix $A$ to another row of
$A$, then $\det A$ remains unchanged.

\item Let $k\in\left\{  1,2,\ldots,n\right\}  $ be arbitrary. If three
$n\times n$-matrices $A$, $B$ and $C$ satisfy%
\[
\left(  \text{the }k\text{-th row of }C\right)  =\left(  \text{the }k\text{-th
row of }A\right)  +\left(  \text{the }k\text{-th row of }B\right)
\]
and%
\begin{align*}
\left(  \text{the }i\text{-th row of }C\right)   &  =\left(  \text{the
}i\text{-th row of }A\right) \\
&  =\left(  \text{the }i\text{-th row of }B\right)
\ \ \ \ \ \ \ \ \ \ \text{for all }i\neq k,
\end{align*}
then%
\[
\det C=\det A+\det B.
\]
This property (known as \emph{multilinearity}) is best illustrated on an
example (with $n=3$ and $k=2$):%
\[
\det\underbrace{\left(
\begin{array}
[c]{ccc}%
a & b & c\\
d+d^{\prime} & e+e^{\prime} & f+f^{\prime}\\
g & h & i
\end{array}
\right)  }_{\text{this is }C}=\det\underbrace{\left(
\begin{array}
[c]{ccc}%
a & b & c\\
d & e & f\\
g & h & i
\end{array}
\right)  }_{\text{this is }A}+\det\underbrace{\left(
\begin{array}
[c]{ccc}%
a & b & c\\
d^{\prime} & e^{\prime} & f^{\prime}\\
g & h & i
\end{array}
\right)  }_{\text{this is }B}.
\]


\item All of the above holds if \textquotedblleft row\textquotedblright\ is
replaced by \textquotedblleft column\textquotedblright.
\end{itemize}

\item \emph{Gaussian elimination}, and (more generally) artful use of
\emph{row and column operations}. This relies on the properties listed above,
and is particular convenient when you have a fully specified matrix (with
given size and given entries) in front of you, but sometimes works in more
general settings.

\item The transpose $A^{T}$ of a matrix $A$ has the same determinant as $A$
(that is, $\det\left(  A^{T}\right)  =\det A$).

\item The determinant of a triangular matrix equals the product of its
diagonal entries. This holds both for upper-triangular and lower-triangular
matrices. For example, for $3\times3$-matrices, this is saying that%
\[
\det\left(
\begin{array}
[c]{ccc}%
a & b & c\\
0 & b^{\prime} & c^{\prime}\\
0 & 0 & c^{\prime\prime}%
\end{array}
\right)  =\det\left(
\begin{array}
[c]{ccc}%
a & 0 & 0\\
a^{\prime} & b^{\prime} & 0\\
a^{\prime\prime} & b^{\prime\prime} & c^{\prime\prime}%
\end{array}
\right)  =ab^{\prime}c^{\prime\prime}.
\]


\item \emph{Multiplicativity}: i.e., the formula $\det\left(  AB\right)  =\det
A\cdot\det B$ that holds for any two $n\times n$-matrices $A$ and $B$. This is
useful whenever you can factor your matrix as a product of two (or more)
simpler matrices. Particularly helpful are factorizations into triangular
matrices (such as LU-factorization), whose determinants can be immediately
computed according to the previous bullet point. See \cite[\S 6.4.5]{21s} or
\cite[\S 2.6]{Krattenthaler} for examples of this strategy in action.

Keep in mind that there is no simple formula for $\det\left(  A+B\right)  $
(it rarely ever equals $\det A+\det B$), and don't forget that $\det\left(
\lambda A\right)  $ for a number $\lambda$ is not $\lambda\det A$ but
$\lambda^{n}\det A$.

Note that there is also a formula for $\det\left(  AB\right)  $ when $A$ and
$B$ are not square (but $AB$ is). This is the \emph{Cauchy--Binet formula}
(\cite[\S 6.4.3]{21s}), and is less simple than the $n\times n$-case (of
course, $\det A$ and $\det B$ are not defined when $A$ and $B$ are not square,
so it cannot possibly be as simple).

\item \emph{Eigenvalues}. If the $n$ eigenvalues of an $n\times n$-matrix $A$
are $\lambda_{1},\lambda_{2},\ldots,\lambda_{n}$ (listed with their algebraic
multiplicities), then $\det A=\lambda_{1}\lambda_{2}\cdots\lambda_{n}$. This
fact is not very helpful for computing $\det A$, since any practical use
requires computing all eigenvalues of $A$ without going through the
characteristic polynomial in the first place (since the latter is no easier
than computing $\det A$). Nevertheless, there have been situations in which
this has been useful (e.g., \cite[Problem 3]{Zhao09} or \cite[\S 5.14.5 and
\S 5.15.2]{23s}).

\item The
\href{https://en.wikipedia.org/wiki/Invertible_matrix#The_invertible_matrix_theorem}{\emph{invertible
matrix theorem}} says (among many other things) that an $n\times n$-matrix $A$
has determinant $0$ if and only if it has a nonzero nullspace (i.e., if there
exists a nonzero vector $v$ such that $Av=\mathbf{0}$). This can be used to
prove that some determinants are $0$.

\item \emph{Factor hunting} (aka \emph{identification of factors}). This works
when the entries of your matrix are polynomials, ideally in several
indeterminates. See \cite[\S 6.4.6]{21s} or \cite[\S 2.4]{Krattenthaler}.

\item \emph{Block matrices} and \emph{Schur complements}. The most useful
facts here are (I am assuming that you are familiar with
\href{https://en.wikipedia.org/wiki/Block_matrix}{block matrix notation})

\begin{itemize}
\item the formula $\det\left(
\begin{array}
[c]{cc}%
A & B\\
\mathbf{0} & D
\end{array}
\right)  =\det A\cdot\det D$, where the matrix on the left is a block matrix
with square blocks $A$ and $D$. (The $\mathbf{0}$ in the bottom left means a
zero matrix.)

\item the Schur complement formula $\det\left(
\begin{array}
[c]{cc}%
A & B\\
C & D
\end{array}
\right)  =\det A\cdot\det\left(  D-CA^{-1}B\right)  $, where the matrix on the
left is a block matrix with square blocks $A$ and $D$. This requires $A$ to be invertible.
\end{itemize}

\item
\href{https://math.stackexchange.com/questions/17831/how-can-we-prove-sylvesters-determinant-identity}{The
\emph{Sylvester identity}} (one of the many): If $A$ is an $n\times m$-matrix,
and if $B$ is an $m\times n$-matrix, then $\det\left(  I_{n}+AB\right)
=\det\left(  I_{m}+BA\right)  $. See \cite[Remark after Problem 5]{Zhao09} for
a sketch of another proof.

The usefulness of this identity comes mainly from the fact that $n$ can be
much larger than $m$, in which case it reduces a large determinant (in terms
of matrix size) to a small one. A striking example of this trick in use is
found in the second solution to problem B5 in the 60th Putnam contest 1999 on
\href{https://kskedlaya.org/putnam-archive/}{Kiran Kedlaya's website}.

\item \emph{Dodgson condensation}. This is a recursive method based upon a
surprising formula. See \cite[\S 6.4.8]{21s} and \cite[\S 2.3]{Krattenthaler}
for details.
\end{itemize}

\subsubsection{Computing practice}

Here is an example of a matrix whose determinant can be computed using some of
the above techniques.

\begin{exercise}
\label{exe.det.b-off-diag}Let $n\in\mathbb{N}$. Let $a_{1},a_{2},\ldots
,a_{n},b$ be $n+1$ numbers (e.g., real or complex). Compute the determinant%
\[
\det\underbrace{\left(
\begin{array}
[c]{ccccc}%
a_{1}+b & b & b & \cdots & b\\
b & a_{2}+b & b & \cdots & b\\
b & b & a_{3}+b & \cdots & b\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
b & b & b & \cdots & a_{n}+b
\end{array}
\right)  }_{\substack{\text{This is the }n\times n\text{-matrix whose}%
\\\text{diagonal entries are }a_{1}+b,\ a_{2}+b,\ \ldots,\ a_{n}+b\\\text{and
whose off-diagonal entries all equal }b}}.
\]

\end{exercise}

\begin{proof}
[First solution.]The cases $n=0$ and $n=1$ are easily solved by hand: The
determinant is $1$ if $n=0$ (since the $0\times0$-matrix has determinant $1$),
and is $a_{1}+b$ if $n=1$.

Now, assume that $n\geq2$. Let us denote our matrix (i.e., the $n\times
n$-matrix whose diagonal entries are $a_{1}+b,\ a_{2}+b,\ \ldots,\ a_{n}+b$
and whose off-diagonal entries all equal $b$) by $A\left(  a_{1},a_{2}%
,\ldots,a_{n}\right)  $ (in order to stress its dependence on $a_{1}%
,a_{2},\ldots,a_{n}$\ \ \ \ \footnote{Of course, it also depends on $b$, but
we have no need to make this explicit in our notation, since $b$ will remain
unchanged in our entire solution.}). Thus, we must compute $\det\left(
A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right)  $.

We recall that the determinant of a matrix does not change when we add a
scalar multiple of a row to another row. In particular, it does not change if
we subtract a row from another row. Therefore, the determinant of the matrix
\[
A\left(  a_{1},a_{2},\ldots,a_{n}\right)  =\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-1}+b & b\\
b & b & b & \cdots & b & a_{n}+b
\end{array}
\right)
\]
does not change when we subtract the second-to-last row from the last row. We
thus obtain%
\begin{align*}
&  \det\left(  A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right) \\
&  =\det\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-1}+b & b\\
b-b & b-b & b-b & \cdots & b-\left(  a_{n-1}+b\right)  & \left(
a_{n}+b\right)  -b
\end{array}
\right) \\
&  =\det\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-1}+b & b\\
0 & 0 & 0 & \cdots & -a_{n-1} & a_{n}%
\end{array}
\right)  .
\end{align*}
The matrix on the right hand side has the nice property that the first $n-2$
entries of its last row are $0$'s. This suggests computing its determinant by
Laplace expansion along the last row. In this expansion, all but the last two
addends vanish (since the $0$'s from the last row appear as factors), and we
are left with
\begin{align*}
&  \det\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-1}+b & b\\
0 & 0 & 0 & \cdots & -a_{n-1} & a_{n}%
\end{array}
\right) \\
&  =\underbrace{\left(  -1\right)  ^{n+\left(  n-1\right)  }}_{=-1}\left(
-a_{n-1}\right)  \det\underbrace{\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-2}+b & b\\
b & b & b & \cdots & b & b
\end{array}
\right)  }_{=A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  }\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  -1\right)  ^{n+n}}_{=1}a_{n}%
\det\underbrace{\left(
\begin{array}
[c]{ccccc}%
a_{1}+b & b & b & \cdots & b\\
b & a_{2}+b & b & \cdots & b\\
b & b & a_{3}+b & \cdots & b\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
b & b & b & \cdots & a_{n-1}+b
\end{array}
\right)  }_{=A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  }\\
&  =\underbrace{\left(  -1\right)  \left(  -a_{n-1}\right)  }_{=a_{n-1}}%
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  \right)  +a_{n}%
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  \right) \\
&  =a_{n-1}\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  \right)
+a_{n}\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  \right)  .
\end{align*}
Altogether, we thus have%
\begin{align}
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right)   &
=\det\left(
\begin{array}
[c]{cccccc}%
a_{1}+b & b & b & \cdots & b & b\\
b & a_{2}+b & b & \cdots & b & b\\
b & b & a_{3}+b & \cdots & b & b\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
b & b & b & \cdots & a_{n-1}+b & b\\
0 & 0 & 0 & \cdots & -a_{n-1} & a_{n}%
\end{array}
\right) \nonumber\\
&  =a_{n-1}\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  \right)
+a_{n}\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  \right)  .
\label{sol.det.b-off-diag.1st.rec}%
\end{align}
This is a recursive formula for $\det\left(  A\left(  a_{1},a_{2},\ldots
,a_{n}\right)  \right)  $ that allows us to easily compute these determinants
for small values of $n$, starting with
\begin{align*}
\det\left(  A\left(  {}\right)  \right)   &  =1\ \ \ \ \ \ \ \ \ \ \left(
\text{this was the case }n=0\right)  \ \ \ \ \ \ \ \ \ \ \text{and}\\
\det\left(  A\left(  a_{1}\right)  \right)   &  =a_{1}%
+b\ \ \ \ \ \ \ \ \ \ \left(  \text{this was the case }n=1\right)  .
\end{align*}
We obtain%
\begin{align*}
\det\left(  A\left(  a_{1},a_{2}\right)  \right)   &  =a_{1}\underbrace{\det
\left(  A\left(  0\right)  \right)  }_{=0+b}+\,a_{2}\underbrace{\det\left(
A\left(  a_{1}\right)  \right)  }_{=a_{1}+b}\\
&  =a_{1}\left(  0+b\right)  +a_{2}\left(  a_{1}+b\right) \\
&  =a_{1}a_{2}+b\left(  a_{1}+a_{2}\right)
\end{align*}
and similarly%
\[
\det\left(  A\left(  a_{1},a_{2},a_{3}\right)  \right)  =a_{1}a_{2}%
a_{3}+b\left(  a_{1}a_{2}+a_{1}a_{3}+a_{2}a_{3}\right)
\]
and%
\[
\det\left(  A\left(  a_{1},a_{2},a_{3},a_{4}\right)  \right)  =a_{1}a_{2}%
a_{3}a_{4}+b\left(  a_{1}a_{2}a_{3}+a_{1}a_{2}a_{4}+a_{1}a_{3}a_{4}+a_{2}%
a_{3}a_{4}\right)  .
\]
This suggests a general formula: We claim that for every $n\in\mathbb{N}$ and
every $n$ numbers $a_{1},a_{2},\ldots,a_{n}$, we have%
\begin{align}
&  \det\left(  A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right) \nonumber\\
&  =a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}^{n}a_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n}, \label{sol.det.b-off-diag.1st.claim}%
\end{align}
where the hat over the \textquotedblleft$a_{i}$\textquotedblright\ means that
the factor $a_{i}$ is being omitted from the product (i.e., the product
$a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}$ should be read as $a_{1}%
a_{2}\cdots a_{i-1}a_{i+1}a_{i+2}\cdots a_{n}$).

It remains to prove our formula (\ref{sol.det.b-off-diag.1st.claim}). This can
be done quite easily by induction on $n$: The cases $n=0$ and $n=1$ are
obvious and can be used as \textit{base cases}. For the \textit{induction
step}, we fix an integer $n\geq2$, and we assume (as the induction hypothesis)
that (\ref{sol.det.b-off-diag.1st.claim}) has already been proved for $n-1$
instead of $n$. Now, we must prove that (\ref{sol.det.b-off-diag.1st.claim})
also holds for $n$. Since $n\geq2$, we can use the formula
(\ref{sol.det.b-off-diag.1st.rec}). Our induction hypothesis yields that
(\ref{sol.det.b-off-diag.1st.claim}) holds for $n-1$ instead of $n$. In other
words, the equality%
\[
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  \right)  =a_{1}%
a_{2}\cdots a_{n-1}+b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots
a_{n-1}%
\]
holds. Applying this same equality to $0$ instead of $a_{n-1}$, we obtain%
\[
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  \right)  =a_{1}%
a_{2}\cdots a_{n-2}0+b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots
a_{n-2}0,
\]
where the expression \textquotedblleft$a_{1}a_{2}\cdots\widehat{a_{i}}\cdots
a_{n-2}0$\textquotedblright\ is to be read as the product $a_{1}a_{2}\cdots
a_{n-2}0$ with its $i$-th factor removed. In view of%
\begin{align*}
\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-2}0  &  =\sum
_{i=1}^{n-2}\underbrace{a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-2}%
0}_{\substack{=0\\\text{(since the last factor of this product is }0\text{)}%
}}+\underbrace{a_{1}a_{2}\cdots a_{n-2}\widehat{0}}_{=a_{1}a_{2}\cdots
a_{n-2}}\\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{here, we have removed the addend}\\
\text{for }i=n-1\text{ from the sum}%
\end{array}
\right) \\
&  =\sum_{i=1}^{n-2}0+a_{1}a_{2}\cdots a_{n-2}=a_{1}a_{2}\cdots a_{n-2},
\end{align*}
this becomes%
\begin{align*}
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2},0\right)  \right)   &
=\underbrace{a_{1}a_{2}\cdots a_{n-2}0}_{=0}+\,b\underbrace{\sum_{i=1}%
^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-2}0}_{=a_{1}a_{2}\cdots
a_{n-2}}\\
&  =b\cdot a_{1}a_{2}\cdots a_{n-2}.
\end{align*}
Plugging these results into (\ref{sol.det.b-off-diag.1st.rec}), we find%
\begin{align*}
&  \det\left(  A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right) \\
&  =a_{n-1}\underbrace{\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-2}%
,0\right)  \right)  }_{=b\cdot a_{1}a_{2}\cdots a_{n-2}}+\,a_{n}%
\underbrace{\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n-1}\right)  \right)
}_{=a_{1}a_{2}\cdots a_{n-1}+b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n-1}}\\
&  =\underbrace{a_{n-1}\cdot b\cdot a_{1}a_{2}\cdots a_{n-2}}%
_{\substack{=b\cdot a_{1}a_{2}\cdots a_{n-2}\cdot a_{n-1}\\=b\cdot a_{1}%
a_{2}\cdots a_{n-1}}}+\underbrace{a_{n}\cdot\left(  a_{1}a_{2}\cdots
a_{n-1}+b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-1}\right)
}_{=a_{n}\cdot a_{1}a_{2}\cdots a_{n-1}+a_{n}\cdot b\sum_{i=1}^{n-1}a_{1}%
a_{2}\cdots\widehat{a_{i}}\cdots a_{n-1}}\\
&  =b\cdot a_{1}a_{2}\cdots a_{n-1}+\underbrace{a_{n}\cdot a_{1}a_{2}\cdots
a_{n-1}}_{\substack{=a_{1}a_{2}\cdots a_{n-1}\cdot a_{n}\\=a_{1}a_{2}\cdots
a_{n}}}+\underbrace{a_{n}\cdot b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots
\widehat{a_{i}}\cdots a_{n-1}}_{=b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots
\widehat{a_{i}}\cdots a_{n-1}\cdot a_{n}}\\
&  =b\cdot a_{1}a_{2}\cdots a_{n-1}+a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}%
^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-1}\cdot a_{n}.
\end{align*}
Comparing this with%
\begin{align*}
&  a_{1}a_{2}\cdots a_{n}+b\underbrace{\sum_{i=1}^{n}a_{1}a_{2}\cdots
\widehat{a_{i}}\cdots a_{n}}_{\substack{=\sum_{i=1}^{n-1}a_{1}a_{2}%
\cdots\widehat{a_{i}}\cdots a_{n}+a_{1}a_{2}\cdots\widehat{a_{n}%
}\\\text{(here, we have split off the addend for }i=n\\\text{from the sum)}%
}}\\
&  =a_{1}a_{2}\cdots a_{n}+b\left(  \sum_{i=1}^{n-1}a_{1}a_{2}\cdots
\widehat{a_{i}}\cdots a_{n}+a_{1}a_{2}\cdots\widehat{a_{n}}\right) \\
&  =a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}^{n-1}\underbrace{a_{1}a_{2}%
\cdots\widehat{a_{i}}\cdots a_{n}}_{=a_{1}a_{2}\cdots\widehat{a_{i}}\cdots
a_{n-1}\cdot a_{n}}+\,b\cdot\underbrace{a_{1}a_{2}\cdots\widehat{a_{n}}%
}_{=a_{1}a_{2}\cdots a_{n-1}}\\
&  =a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n-1}\cdot a_{n}+b\cdot a_{1}a_{2}\cdots a_{n-1}\\
&  =b\cdot a_{1}a_{2}\cdots a_{n-1}+a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}%
^{n-1}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n-1}\cdot a_{n},
\end{align*}
we obtain%
\begin{equation}
\det\left(  A\left(  a_{1},a_{2},\ldots,a_{n}\right)  \right)  =a_{1}%
a_{2}\cdots a_{n}+b\sum_{i=1}^{n}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots
a_{n}.\nonumber
\end{equation}
In other words, (\ref{sol.det.b-off-diag.1st.claim}) holds for $n$. This
completes the induction step. Thus, (\ref{sol.det.b-off-diag.1st.claim}) is
proved, and the problem solved.
\end{proof}

\begin{proof}
[Second solution (sketched).]We start in a similar way as in our first
solution, namely by recalling that the determinant of a matrix does not change
when we add a scalar multiple of a row to another row. But this time, let us
perform not one, but several such row operations: We subtract the first row
from each of the other rows of our matrix. Thus, we obtain%
\begin{align*}
&  \det\left(
\begin{array}
[c]{ccccc}%
a_{1}+b & b & b & \cdots & b\\
b & a_{2}+b & b & \cdots & b\\
b & b & a_{3}+b & \cdots & b\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
b & b & b & \cdots & a_{n}+b
\end{array}
\right) \\
&  =\det\left(
\begin{array}
[c]{ccccc}%
a_{1}+b & b & b & \cdots & b\\
-a_{1} & a_{2} & 0 & \cdots & 0\\
-a_{1} & 0 & a_{3} & \cdots & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
-a_{1} & 0 & 0 & \cdots & a_{n}%
\end{array}
\right)  .
\end{align*}
This has noticeably simplified our matrix, at least in the sense that it now
has lots of zero entries -- but we still don't have an immediate way to
compute its determinant.\footnote{Actually, we could compute it immediately if
we knew the formula for determinants of arrowhead matrices (\cite[Exercise 6
\textbf{(b)}]{18s-hw4s}). But let us try to avoid any apocryphal formulas
here.} So let us perform some more row operations.

We can try to get rid of the $b$'s in the first row by subtracting appropriate
multiples of other rows. Namely, let us subtract the $\dfrac{b}{a_{i}}%
$-multiple of the $i$-th row from the first row for each $i\in\left\{
2,3,\ldots,n\right\}  $. The factor $\dfrac{b}{a_{i}}$ was chosen here
precisely to cancel the $b$ in the first row (as in Gaussian elimination); we
obtain the matrix%
\[
\left(
\begin{array}
[c]{ccccc}%
r & 0 & 0 & \cdots & 0\\
-a_{1} & a_{2} & 0 & \cdots & 0\\
-a_{1} & 0 & a_{3} & \cdots & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
-a_{1} & 0 & 0 & \cdots & a_{n}%
\end{array}
\right)  ,
\]
where%
\[
r=\left(  a_{1}+b\right)  -\sum_{i=2}^{n}\dfrac{b}{a_{i}}\left(
-a_{1}\right)  .
\]
This matrix is lower-triangular, and thus its determinant is the product of
its diagonal entries, i.e., the product%
\[
ra_{2}a_{3}\cdots a_{n}.
\]
Since all our row operations left the determinant of the matrix unchanged, we
thus conclude that the original matrix must have determinant $ra_{2}%
a_{3}\cdots a_{n}$ as well.

Are we done? Almost. We have tacitly assumed that the numbers $a_{2}%
,a_{3},\ldots,a_{n}$ are nonzero, since we have been dividing by them. Even
our final result $ra_{2}a_{3}\cdots a_{n}$ makes no sense if one of these
numbers is zero, since these numbers appear as denominators in the definition
of $r$. Thus, we have solved the problem in the \textquotedblleft
generic\textquotedblright\ case when the numbers $a_{2},a_{3},\ldots,a_{n}$
are nonzero, but the \textquotedblleft exceptional\textquotedblright\ case
when some of them are zero still remains to be addressed.

Let us address it in steps: First, we adapt the answer; then, we will adapt
the proof. To adapt the answer, we rewrite our formula $ra_{2}a_{3}\cdots
a_{n}$ by plugging the definition of $r$ into it:%
\begin{align*}
ra_{2}a_{3}\cdots a_{n}  &  =\left(  \left(  a_{1}+b\right)  -\sum_{i=2}%
^{n}\dfrac{b}{a_{i}}\left(  -a_{1}\right)  \right)  a_{2}a_{3}\cdots a_{n}\\
&  =\left(  a_{1}+b\right)  a_{2}a_{3}\cdots a_{n}-\sum_{i=2}^{n}%
\underbrace{\dfrac{b}{a_{i}}\left(  -a_{1}\right)  a_{2}a_{3}\cdots a_{n}%
}_{\substack{=-\dfrac{b}{a_{i}}\cdot a_{1}a_{2}\cdots a_{n}\\=-b\cdot
\dfrac{a_{1}a_{2}\cdots a_{n}}{a_{i}}\\=-ba_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n}\\\text{(where the hat over the \textquotedblleft}a_{i}%
\text{\textquotedblright\ is}\\\text{understood as in the First solution)}}}\\
&  =\left(  a_{1}+b\right)  a_{2}a_{3}\cdots a_{n}-\sum_{i=2}^{n}\left(
-ba_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}\right)  .
\end{align*}
This latter expression involves no fractions any more, so it makes sense in
both \textquotedblleft generic\textquotedblright\ and \textquotedblleft
exceptional\textquotedblright\ cases. We can actually rewrite it in a nicer
(more symmetric) form:%
\begin{align*}
&  \left(  a_{1}+b\right)  a_{2}a_{3}\cdots a_{n}-\sum_{i=2}^{n}\left(
-ba_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}\right) \\
&  =\underbrace{\left(  a_{1}+b\right)  a_{2}a_{3}\cdots a_{n}}_{=a_{1}\cdot
a_{2}a_{3}\cdots a_{n}+b\cdot a_{2}a_{3}\cdots a_{n}}+\sum_{i=2}^{n}%
ba_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}\\
&  =\underbrace{a_{1}\cdot a_{2}a_{3}\cdots a_{n}}_{=a_{1}a_{2}\cdots a_{n}%
}+\underbrace{b\cdot a_{2}a_{3}\cdots a_{n}+\sum_{i=2}^{n}ba_{1}a_{2}%
\cdots\widehat{a_{i}}\cdots a_{n}}_{=b\left(  a_{2}a_{3}\cdots a_{n}%
+\sum_{i=2}^{n}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}\right)  }\\
&  =a_{1}a_{2}\cdots a_{n}+b\underbrace{\left(  a_{2}a_{3}\cdots a_{n}%
+\sum_{i=2}^{n}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}\right)  }%
_{=\sum_{i=1}^{n}a_{1}a_{2}\cdots\widehat{a_{i}}\cdots a_{n}}\\
&  =a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}^{n}a_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n}.
\end{align*}
Altogether, our claimed formula is therefore%
\begin{align}
&  \det\left(
\begin{array}
[c]{ccccc}%
a_{1}+b & b & b & \cdots & b\\
b & a_{2}+b & b & \cdots & b\\
b & b & a_{3}+b & \cdots & b\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
b & b & b & \cdots & a_{n}+b
\end{array}
\right) \nonumber\\
&  =a_{1}a_{2}\cdots a_{n}+b\sum_{i=1}^{n}a_{1}a_{2}\cdots\widehat{a_{i}%
}\cdots a_{n}. \label{sol.det.b-off-diag.2nd.claim}%
\end{align}
This is the exact same formula (\ref{sol.det.b-off-diag.1st.claim}) that we
obtained in the First solution. But (in order to get an independent second
solution) we still need to prove it in the \textquotedblleft
exceptional\textquotedblright\ case. There are several ways to do this:

\begin{enumerate}
\item One way is to observe that (\ref{sol.det.b-off-diag.2nd.claim}) is a
polynomial identity in $a_{1},a_{2},\ldots,a_{n},b$ (that is, both of its
sides are polynomial functions in each of the arguments $a_{1},a_{2}%
,\ldots,a_{n},b$). Thus, the polynomial identity trick (Corollary 8.5.7 on
Worksheet 8) shows that (for instance) if it holds for infinitely many values
of $a_{2}$, then it holds for all values of $a_{2}$ (where all the remaining
arguments $a_{1},a_{3},a_{4},\ldots,b$ are held constant). Thus, in
particular, if it holds for all nonzero $a_{2}$, then it holds for all values
of $a_{2}$ (including $0$). By drawing such conclusion several times (once for
each of the arguments $a_{2},a_{3},\ldots,a_{n}$), we see that if the equality
(\ref{sol.det.b-off-diag.2nd.claim}) holds for all nonzero $a_{2},a_{3}%
,\ldots,a_{n}$, then it holds for all $a_{2},a_{3},\ldots,a_{n}$ (including
$0$). In other words, if (\ref{sol.det.b-off-diag.2nd.claim}) holds in the
\textquotedblleft generic\textquotedblright\ case, then it holds in all cases.
Since we have already proved (\ref{sol.det.b-off-diag.2nd.claim}) in the
\textquotedblleft generic\textquotedblright\ case, this completes our proof.

\item Alternatively, we can prove (\ref{sol.det.b-off-diag.2nd.claim}) in the
\textquotedblleft exceptional\textquotedblright\ case by hand: First, we
observe that $a_{1},a_{2},\ldots,a_{n}$ play symmetric roles in the equality
(\ref{sol.det.b-off-diag.2nd.claim}) (since the determinant of a matrix
responds in very simple ways when we permute its rows or columns). Hence, we
can permute the numbers $a_{1},a_{2},\ldots,a_{n}$ at will\footnote{In more
details: Swapping two numbers $a_{i}$ and $a_{j}$ is tantamount to swapping
the $i$-th row with the $j$-th row and then swapping the $i$-th column with
the $j$-th column in the matrix on the left hand side of
(\ref{sol.det.b-off-diag.2nd.claim}). The row swap multiplies the determinant
by $-1$; then the column swap multiplies it by $-1$ again. Both operations
combined therefore leave the determinant unchanged (since $\left(  -1\right)
\left(  -1\right)  =1$). Thus, we can swap two of our numbers $a_{1}%
,a_{2},\ldots,a_{n}$ without affecting the correctness of
(\ref{sol.det.b-off-diag.2nd.claim}).}. In particular, if \textbf{exactly one}
of these numbers $a_{1},a_{2},\ldots,a_{n}$ is $0$, then we can permute them
so that this number becomes $a_{1}$, while the remaining numbers $a_{2}%
,a_{3},\ldots,a_{n}$ are nonzero; but this lands us in the \textquotedblleft
generic\textquotedblright\ case, and we already know that
(\ref{sol.det.b-off-diag.2nd.claim}) holds in this case. Hence, it remains to
only consider the case when \textbf{at least two} of the numbers $a_{1}%
,a_{2},\ldots,a_{n}$ are $0$. But this case is particularly simple: In this
case, the left hand side of (\ref{sol.det.b-off-diag.2nd.claim}) is $0$
because the matrix has two equal columns\footnote{Namely, if $a_{i}=0$ and
$a_{j}=0$, then the $i$-th and $j$-th columns of the matrix are equal.},
whereas the right hand side of (\ref{sol.det.b-off-diag.2nd.claim}) is $0$
because each of the products has at least one vanishing factor. All in all,
(\ref{sol.det.b-off-diag.2nd.claim}) has thus been proved.
\end{enumerate}

In either case, we are done.
\end{proof}

Yet another solution to Exercise \ref{exe.det.b-off-diag} (with a slight
change of notations: each $a_{i}$ is replaced by $a_{i}-b$) can be found in
\url{https://math.stackexchange.com/questions/2110766/a/2112473#2112473} .

More examples of matrices with nicely computable determinants can be found in
the class and homework problems below.

\subsubsection{A Putnam problem}

Determinants have been originally introduced for solving systems of linear
equations. Better ways are known for this nowadays, but determinants still
have a theoretical significance in determining how many solutions a given
system has.

\begin{exercise}
\label{exe.det.put1973B1.real}Let $n\in\mathbb{N}$. Assume that $a_{1}%
,a_{2},\ldots,a_{2n+1}$ are $2n+1$ real numbers with the following property:

\begin{statement}
\textit{Splitting property:} If any of the $2n+1$ numbers $a_{1},a_{2}%
,\ldots,a_{2n+1}$ is removed, then the remaining $2n$ numbers can be split
into two equinumerous heaps with equal sum. (\textquotedblleft
Equinumerous\textquotedblright\ means that each heap contains exactly $n$ numbers.)
\end{statement}

Prove that all $2n+1$ numbers $a_{1},a_{2},\ldots,a_{2n+1}$ are equal.

(34th Putnam contest 1973, problem B1, generalized)
\end{exercise}

\begin{proof}
[Solution idea.]I shall proceed informally: I will show the argument on an
example, while occasionally explaining why the argument generalizes.

For my example, I take $n=2$. Thus, we have $2n+1=5$ real numbers $a_{1}%
,a_{2},a_{3},a_{4},a_{5}$ satisfying the splitting property. The splitting
property is saying that if we remove any of these $5$ numbers, then the
remaining $4$ can be split into two equinumerous heaps (i.e., two heaps of $2$
numbers each) with equal sum. For example, if $a_{1}$ is removed, then the
remaining $4$ numbers $a_{2},a_{3},a_{4},a_{5}$ can be split into two such
heaps -- meaning that we have $a_{2}+a_{3}=a_{4}+a_{5}$ or $a_{2}+a_{4}%
=a_{3}+a_{5}$ or $a_{3}+a_{4}=a_{2}+a_{5}$. For example, let me assume that
$a_{2}+a_{4}=a_{3}+a_{5}$. Likewise, I assume that removing $a_{2}$ leads to
$a_{1}+a_{3}=a_{4}+a_{5}$; that removing $a_{3}$ leads to $a_{1}+a_{5}%
=a_{2}+a_{4}$; that removing $a_{4}$ leads to $a_{1}+a_{2}=a_{3}+a_{5}$; and
that removing $a_{5}$ leads to $a_{1}+a_{3}=a_{2}+a_{4}$. Altogether, we now
know that our five numbers $a_{1},a_{2},a_{3},a_{4},a_{5}$ satisfy the five
linear equations%
\begin{equation}
\left\{
\begin{array}
[c]{l}%
a_{2}+a_{4}=a_{3}+a_{5};\\
a_{1}+a_{3}=a_{4}+a_{5};\\
a_{1}+a_{5}=a_{2}+a_{4};\\
a_{1}+a_{2}=a_{3}+a_{5};\\
a_{1}+a_{3}=a_{2}+a_{4}.
\end{array}
\right.  \label{sol.det.put1973B1.real.sys}%
\end{equation}


Our goal is to prove that all $5$ numbers $a_{1},a_{2},a_{3},a_{4},a_{5}$ are
equal. We observe that if we subtract one and the same real number $b$ from
each of our $5$ numbers $a_{1},a_{2},a_{3},a_{4},a_{5}$ (that is, if we
replace each $a_{i}$ by $a_{i}-b$), then nothing really changes: Our $5$
numbers still satisfy the splitting property after this transformation
(because the sum of the two numbers in either heap is decreased by $2b$), and
our goal (to prove that $a_{1},a_{2},a_{3},a_{4},a_{5}$ are equal) remains the
same.\footnote{Note that we are using the \textquotedblleft
equinumerous\textquotedblright\ requirement in the splitting property here! If
the two heaps were not required to be equinumerous, then their sums could
decrease by different multiples of $b$ when we subtract $b$ from each of our
$5$ numbers $a_{1},a_{2},a_{3},a_{4},a_{5}$.}

Thus, we can freely choose a real number $b$ and subtract it from each of our
$5$ numbers $a_{1},a_{2},a_{3},a_{4},a_{5}$. Let us choose $b=a_{5}$. Then,
this subtraction results in $a_{5}$ becoming $a_{5}-a_{5}=0$. Hence, we can
WLOG assume that $a_{5}=0$. Assume this. Of course, in the general case (as
opposed to the example we are looking at), the assumption is $a_{2n+1}=0$
rather than $a_{5}=0$, but it is obtained in the same way (viz., subtracting
$a_{2n+1}$ from each of our $2n+1$ numbers $a_{1},a_{2},\ldots,a_{2n+1}$).

Since $a_{5}=0$, we can simplify the system of equations
(\ref{sol.det.put1973B1.real.sys}) by removing each appearance of $a_{5}$. We
thus obtain%
\begin{equation}
\left\{
\begin{array}
[c]{l}%
a_{2}+a_{4}=a_{3};\\
a_{1}+a_{3}=a_{4};\\
a_{1}=a_{2}+a_{4};\\
a_{1}+a_{2}=a_{3};\\
a_{1}+a_{3}=a_{2}+a_{4}.
\end{array}
\right.  \label{sol.det.put1973B1.real.sys2}%
\end{equation}
Furthermore, let us remove the last equation from this system, thus obtaining%
\begin{equation}
\left\{
\begin{array}
[c]{l}%
a_{2}+a_{4}=a_{3};\\
a_{1}+a_{3}=a_{4};\\
a_{1}=a_{2}+a_{4};\\
a_{1}+a_{2}=a_{3}.
\end{array}
\right.  \label{sol.det.put1973B1.real.sys3}%
\end{equation}


Recall that our goal is to prove that all $5$ numbers $a_{1},a_{2},a_{3}%
,a_{4},a_{5}$ are equal. Equivalently, we must prove that all $4$ numbers
$a_{1},a_{2},a_{3},a_{4}$ are $0$ (since $a_{5}$ is already $0$).

Thus, our goal is an instance of a well-known basic problem in linear algebra:
To show that the only solution of a certain system of linear equations
(specifically, (\ref{sol.det.put1973B1.real.sys3})) is the zero vector (i.e.,
the solution where each unknown is $0$).

The system (\ref{sol.det.put1973B1.real.sys3}) of linear equations can, of
course, be solved by Gaussian elimination, but this would not be generalizable
beyond the specific example I have chosen. So let us instead analyze it from a
\textquotedblleft bird's-eye view\textquotedblright, without looking too
closely at the specifics. As with any system of linear equations, we can
rewrite it in the form \textquotedblleft matrix times unknown vector equals
known vector\textquotedblright. Rewritten in this form, it becomes%
\[
\left(
\begin{array}
[c]{cccc}%
0 & 1 & -1 & 1\\
1 & 0 & 1 & -1\\
1 & -1 & 0 & -1\\
1 & 1 & -1 & 0
\end{array}
\right)  \left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
a_{3}\\
a_{4}%
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
0\\
0\\
0\\
0
\end{array}
\right)  .
\]
In other words, it becomes%
\begin{equation}
A\left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
a_{3}\\
a_{4}%
\end{array}
\right)  =\left(
\begin{array}
[c]{c}%
0\\
0\\
0\\
0
\end{array}
\right)  , \label{sol.det.put1973B1.real.mateq}%
\end{equation}
where
\[
A:=\left(
\begin{array}
[c]{cccc}%
0 & 1 & -1 & 1\\
1 & 0 & 1 & -1\\
1 & -1 & 0 & -1\\
1 & 1 & -1 & 0
\end{array}
\right)  .
\]
The entries of this matrix $A$ are specific to our example, but the general
structure is always the same:

\begin{itemize}
\item The matrix $A$ has dimensions $2n\times2n$.

\item All diagonal entries of $A$ are $0$'s, since the $i$-th equation in
(\ref{sol.det.put1973B1.real.sys3}) comes from removing $a_{i}$.

\item All off-diagonal entries of $A$ are $1$'s and $-1$'s, since the $i$-th
equation in (\ref{sol.det.put1973B1.real.sys3}) involves all of our $2n+1$
numbers $a_{1},a_{2},\ldots,a_{2n+1}$ except for $a_{i}$ and $a_{2n+1}=0$.
\end{itemize}

Moreover, the vector on the right hand side of
(\ref{sol.det.put1973B1.real.mateq}) is the zero vector, since the equations
in (\ref{sol.det.put1973B1.real.sys3}) are homogeneous (i.e., have no constant
term). Thus, (\ref{sol.det.put1973B1.real.mateq}) can be rewritten as
$Av=\mathbf{0}$, where $v=\left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
\vdots\\
a_{2n}%
\end{array}
\right)  \in\mathbb{R}^{2n}$, and where $\mathbf{0}$ is the zero vector.
(Here, we use $\mathbb{R}^{2n}$ to denote the vector space of all
\textbf{column} vectors of size $2n$.)

Our goal is to show that all $2n$ numbers $a_{1},a_{2},\ldots,a_{2n}$ are $0$.
In other words, our goal is to show that the vector $v=\left(
\begin{array}
[c]{c}%
a_{1}\\
a_{2}\\
\vdots\\
a_{2n}%
\end{array}
\right)  $ satisfying $Av=\mathbf{0}$ is the zero vector. In other words, our
goal is to show that the nullspace of $A$ is trivial (i.e., consists only of
the zero vector). By the invertible matrix theorem, this will follow if we can
show that $\det A\neq0$.

So let us show this. Even better, we shall show that $\det A$ is an odd
integer. This will automatically yield $\det A\neq0$, since $0$ is even.

The Leibniz formula for $\det A$ yields%
\begin{equation}
\det A=\sum_{\sigma\in S_{2n}}\left(  -1\right)  ^{\sigma}a_{1,\sigma\left(
1\right)  }a_{2,\sigma\left(  2\right)  }\cdots a_{2n,\sigma\left(  2n\right)
}, \label{sol.det.put1973B1.real.leibA}%
\end{equation}
where $a_{i,j}$ denotes the $\left(  i,j\right)  $-th entry of $A$. Thus,
$\det A$ is an integer (since all entries of $A$ are integers). Moreover, if
we add a multiple of $2$ to some entry of $A$, then $\det A$ also changes by a
multiple of $2$ (since every addend on the right hand side of
(\ref{sol.det.put1973B1.real.leibA}) either stays the same or changes by a
multiple of $2$), and thus the parity of $\det A$ remains unchanged. Hence, on
our quest to prove that $\det A$ is odd, we can freely add multiples of $2$ to
each entry of $A$.

Recall that each off-diagonal entry of $A$ is an \textbf{odd} integer (since
it is either $1$ or $-1$). Thus, by adding appropriate multiples of $2$ to
these entries, we can ensure that they all become $1$. Let $B$ be the
resulting $2n\times2n$-matrix (with $0$'s along the diagonal and $1$'s in all
off-diagonal positions); thus, in our example, we have%
\begin{equation}
B=\left(
\begin{array}
[c]{cccc}%
0 & 1 & 1 & 1\\
1 & 0 & 1 & 1\\
1 & 1 & 0 & 1\\
1 & 1 & 1 & 0
\end{array}
\right)  . \label{sol.det.put1973B1.real.B=}%
\end{equation}
Since $B$ is obtained from $A$ by adding multiples of $2$ to some entries, we
have $\det B\equiv\det A\operatorname{mod}2$ (because if we add a multiple of
$2$ to some entry of $A$, then $\det A$ also changes by a multiple of $2$).
Thus, in order to prove that $\det A$ is odd, it suffices to prove that $\det
B$ is odd.

But we can compute $\det B$ explicitly. Indeed, the formula
(\ref{sol.det.b-off-diag.1st.claim}) that we obtained in the solution to
Exercise \ref{exe.det.b-off-diag} (applied to $4$, $1$ and $-1$ instead of
$n$, $a_{i}$ and $b$) yields%
\begin{align*}
&  \det\left(
\begin{array}
[c]{cccc}%
1+\left(  -1\right)  & 1 & 1 & 1\\
1 & 1+\left(  -1\right)  & 1 & 1\\
1 & 1 & 1+\left(  -1\right)  & 1\\
1 & 1 & 1 & 1+\left(  -1\right)
\end{array}
\right) \\
&  =\underbrace{1\cdot1\cdot\cdots\cdot1}_{=1}+\left(  -1\right)  \sum
_{i=1}^{4}\underbrace{1\cdot1\cdot\cdots\cdot\widehat{1}\cdot\cdots1}_{=1}\\
&  =1+\left(  -1\right)  \underbrace{\sum_{i=1}^{4}1}_{=4}=1+\left(
-1\right)  4=1-4=-3.
\end{align*}
Since $1+\left(  -1\right)  =0$, the matrix on the left hand side of this
equality is precisely our $B$, and thus the equality rewrites as%
\[
\det B=-3,
\]
which shows that $\det B$ is odd, and we are done. In the general case, $\det
B$ will be $1+\left(  -1\right)  2n=1-2n$, which is also odd, so the argument
still works.
\end{proof}

See also \cite[Exercise 5.3.3]{20f} for a different approach to Exercise
\ref{exe.det.put1973B1.real} (stopping short of a complete solution, but
solving the exercise in the case when $a_{1},a_{2},\ldots,a_{2n+1}$ are
\textbf{rational} numbers). Two other solutions (both using linear algebra!)
can be found in \cite[Problem 300]{GelAnd17}.

\subsubsection{Rank and nullity}

Another feature of matrices that often comes useful in contest problems (and
elsewhere) is the notion of
\emph{\href{https://en.wikipedia.org/wiki/Rank_(linear_algebra)}{\emph{rank}}%
}. The \emph{rank} of a matrix $A$ (over any field $\mathbb{F}$) is defined to
be the maximum number of linearly independent columns of $A$. Equivalently, it
can be defined as the maximum number of linearly independent rows of $A$. The
equivalence is nontrivial (see, e.g., \cite[3.57]{Axler23} or \cite[Theorem
2.5]{Camero08} or \cite[Theorem 8.12 (3)]{StoLui18} for a proof) and often
useful by itself. Another way to describe the rank of $A$ is as the largest
integer $k$ such that $A$ has a $k\times k$-submatrix with nonzero determinant
(see, e.g., \cite[Corollary 8.6.8]{Kuttle22}). Yet another is as the dimension
of the image of $A$ (that is, of the vector space of all vectors of the form
$Av$). The rank of a matrix $A$ is commonly denoted $\operatorname*{rank}A$.
The most important property of the rank is probably the \emph{rank-nullity
theorem} (\cite[Theorem 8.12]{StoLui18}; see also \cite[3.21]{Axler23} or
\cite[Theorem 3.40]{Griffi20} or \cite[Theorem 8.3]{StoLui18} for a statement
in terms of linear maps):

\begin{theorem}
\label{thm.linalg.ranknul}Let $A$ be an $n\times m$-matrix over a field
$\mathbb{F}$. Let $\mathbb{F}^{m}$ denote the vector space of all column
vectors of size $m$. Let $\operatorname*{Ker}A$ be the nullspace of $A$ (that
is, the set of all column vectors $v\in\mathbb{F}^{m}$ such that
$Av=\mathbf{0}$, where $\mathbf{0}$ denotes the zero vector of size $n$).
Then,%
\[
m=\dim\left(  \operatorname*{Ker}A\right)  +\operatorname*{rank}A.
\]

\end{theorem}

This theorem can be used to compute $\operatorname*{rank}A$ from $\dim\left(
\operatorname*{Ker}A\right)  $ and vice versa, which is often helpful. We will
see an example soon, but let us first explore a different topic.

\subsection{\label{subsec.linalg.F2}Linear algebra over $\mathbb{F}_{2}$}

\subsubsection{A brief introduction to $\mathbb{F}_{2}$}

As mentioned in Subsection \ref{subsec.linalg.fields} above, linear algebra
can be done over any field. The most popular choices are $\mathbb{Q}$,
$\mathbb{R}$ and $\mathbb{C}$, but other options should not be discounted either.

The simplest of all fields is none of $\mathbb{Q}$, $\mathbb{R}$ and
$\mathbb{C}$. It is a field called $\mathbb{F}_{2}$ or $\mathbb{Z}/2$,
consisting of just two elements. We call these elements $\overline{0}$ and
$\overline{1}$. You can think of $\overline{0}$ as the set of all even
integers, and of $\overline{1}$ as the set of all odd integers (these are
their actual definitions). The addition is defined by
\[
\overline{0}+\overline{0}=\overline{0},\ \ \ \ \ \ \ \ \ \ \overline
{0}+\overline{1}=\overline{1},\ \ \ \ \ \ \ \ \ \ \overline{1}+\overline
{0}=\overline{1},\ \ \ \ \ \ \ \ \ \ \overline{1}+\overline{1}=\overline{0};
\]
the multiplication is defined by%
\[
\overline{0}\cdot\overline{0}=\overline{0},\ \ \ \ \ \ \ \ \ \ \overline
{0}\cdot\overline{1}=\overline{0},\ \ \ \ \ \ \ \ \ \ \overline{1}%
\cdot\overline{0}=\overline{0},\ \ \ \ \ \ \ \ \ \ \overline{1}\cdot
\overline{1}=\overline{1}.
\]
These are just the standard parity rules for integers: For example,
$\overline{1}+\overline{1}=\overline{0}$ means \textquotedblleft odd plus odd
equals even\textquotedblright, whereas $\overline{1}\cdot\overline
{0}=\overline{0}$ means \textquotedblleft odd times even equals
even\textquotedblright.

The set $\mathbb{F}_{2}=\left\{  \overline{0},\overline{1}\right\}  $,
equipped with the addition and the multiplication just defined, is a field.
Its subtraction is precisely its addition (since plus and minus are the same
modulo $2$). Its division is even simpler: Division by $\overline{1}$ changes
nothing, whereas division by $\overline{0}$ is impossible (you cannot divide
by zero, and $\overline{0}$ is the zero of $\mathbb{F}_{2}$).

\subsubsection{Oddtown}

You might think that nothing interesting can be done with such a small field
as $\mathbb{F}_{2}$, but you would be mistaken. Linear algebra is not about
the field, but about vectors over the field; and of course, vectors over
$\mathbb{F}_{2}$ can carry much more information than scalars in
$\mathbb{F}_{2}$. The following exercise is a first illustration:

\begin{exercise}
\label{exe.linalg.F2.odd-even}Let $n,m\in\mathbb{N}$. In a town with $n$
inhabitants, there are $m$ clubs, each of which has an odd number of members.
Any two distinct clubs share an even number of common members. Prove that
$m\leq n$.
\end{exercise}

\begin{noncompile}
This is Theorem 1 in https://math.mit.edu/\symbol{126}fox/MAT307-lecture15.pdf .
\end{noncompile}

\begin{proof}
[Solution idea.]Again, we assume the contrary. Thus, $m>n$. We denote the $n$
inhabitants by $1,2,\ldots,n$, and we denote the $m$ clubs by $C_{1}%
,C_{2},\ldots,C_{m}$.

Let $v_{1},v_{2},\ldots,v_{m}$ be the indicator vectors of our $m$ clubs over
$\mathbb{F}_{2}$. This means that, for each $i\in\left\{  1,2,\ldots
,m\right\}  $, the vector $v_{i}$ is a row vector of size $n$ whose $j$-th
entry is%
\[%
\begin{cases}
\overline{1}, & \text{if }j\in C_{i}\text{;}\\
\overline{0}, & \text{if }j\notin C_{i}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }j\in\left\{  1,2,\ldots,n\right\}  .
\]


Thus we have defined $m$ vectors $v_{1},v_{2},\ldots,v_{m}$ in the
$n$-dimensional vector space $\mathbb{F}_{2}^{n}$ over the field
$\mathbb{F}_{2}$.

We shall use dot products again, as in the solution to Exercise
\ref{exe.linalg.php.fisher1} (but this time, they live in $\mathbb{F}_{2}$
rather than $\mathbb{R}$). Just as we proved
(\ref{sol.linalg.php.fisher1.vivj-gen}) in the latter solution, we can now see
that any $i,j\in\left\{  1,2,\ldots,m\right\}  $ satisfy%
\begin{equation}
\left\langle v_{i},v_{j}\right\rangle =\overline{\left\vert C_{i}\cap
C_{j}\right\vert }, \label{sol.exe.linalg.F2.odd-even.vivj}%
\end{equation}
where $\overline{\left\vert C_{i}\cap C_{j}\right\vert }$ means $%
\begin{cases}
\overline{0}, & \text{if }\left\vert C_{i}\cap C_{j}\right\vert \text{ is
even};\\
\overline{1}, & \text{if }\left\vert C_{i}\cap C_{j}\right\vert \text{ odd}%
\end{cases}
$ \ (since a sum of an even number of $\overline{1}$'s is $\overline{0}$,
whereas a sum of an odd number of $\overline{1}$'s is $\overline{1}$). Hence:

\begin{itemize}
\item For any two distinct elements $i,j$ of $\left\{  1,2,\ldots,m\right\}
$, we have%
\begin{equation}
\left\langle v_{i},v_{j}\right\rangle =\overline{\left\vert C_{i}\cap
C_{j}\right\vert }=\overline{0} \label{sol.exe.linalg.F2.odd-even.vivj-dist}%
\end{equation}
(since any two distinct clubs share an even number of common members).

\item For any $i\in\left\{  1,2,\ldots,m\right\}  $, we have%
\begin{equation}
\left\langle v_{i},v_{i}\right\rangle =\overline{\left\vert C_{i}\cap
C_{i}\right\vert }=\overline{\left\vert C_{i}\right\vert }=\overline{1}
\label{sol.exe.linalg.F2.odd-even.vivi}%
\end{equation}
(since each club has an odd number of members).
\end{itemize}

Our $m$ vectors $v_{1},v_{2},\ldots,v_{m}$ belong to the $n$-dimensional
vector space $\mathbb{F}_{2}^{n}$, and thus are linearly dependent (by Theorem
\ref{thm.linalg.php.1} \textbf{(a)}, since $m>n$). In other words, there exist
$m$ elements $c_{1},c_{2},\ldots,c_{m}\in\mathbb{F}_{2}$, not all zero, such
that%
\[
c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}=\mathbf{0}%
\]
(where $\mathbf{0}$ is the all-zero vector over $\mathbb{F}_{2}$, that is,
$\left(  \underbrace{\overline{0},\overline{0},\ldots,\overline{0}}_{n\text{
entries}}\right)  $). Consider these $m$ elements.

Since the dot product is linear in each argument, we now have%
\begin{align*}
&  \left\langle c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m},\ v_{1}\right\rangle
\\
&  =c_{1}\underbrace{\left\langle v_{1},v_{1}\right\rangle }%
_{\substack{=\overline{1}\\\text{(by (\ref{sol.exe.linalg.F2.odd-even.vivi}%
))}}}+\,c_{2}\underbrace{\left\langle v_{2},v_{1}\right\rangle }%
_{\substack{=\overline{0}\\\text{(by
(\ref{sol.exe.linalg.F2.odd-even.vivj-dist}))}}}+\,\cdots+\,c_{m}%
\underbrace{\left\langle v_{m},v_{1}\right\rangle }_{\substack{=\overline
{0}\\\text{(by (\ref{sol.exe.linalg.F2.odd-even.vivj-dist}))}}}\\
&  =c_{1}\overline{1}+\underbrace{c_{2}\overline{0}+\cdots+c_{m}\overline{0}%
}_{=\overline{0}}=c_{1}\overline{1}=c_{1},
\end{align*}
so that%
\[
c_{1}=\left\langle \underbrace{c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}%
}_{=\mathbf{0}},\ v_{1}\right\rangle =\left\langle \mathbf{0},\ v_{1}%
\right\rangle =\overline{0}.
\]
Similarly, we can find that $c_{i}=\overline{0}$ for all $i\in\left\{
1,2,\ldots,m\right\}  $ (since there is nothing special about the $1$-st
club). But this contradicts the fact that not all $c_{1},c_{2},\ldots,c_{m}$
are zero. This contradiction shows that our assumption was wrong. Hence,
Exercise \ref{exe.linalg.F2.odd-even} is solved.
\end{proof}

\begin{remark}
The inequality $m\leq n$ in Exercise \ref{exe.linalg.F2.odd-even} is sharp
(i.e., equality can be achieved). In fact, if each inhabitant of our town
forms a very exclusive club just by himself, then we obtain $n$ clubs that
satisfy the conditions of Exercise \ref{exe.linalg.F2.odd-even}.
\end{remark}

\subsubsection{Eventown}

Exercise \ref{exe.linalg.F2.odd-even} is one of the four famous
\emph{Oddtown/Eventown theorems} (which appear in many sources: e.g., three of
them appear in \cite[\S 1.1]{BabFra23} and in \cite[problems 59, 114 and
116]{Bollob10}); here is another:

\begin{exercise}
\label{exe.linalg.F2.even-odd}Let $n,m\in\mathbb{N}$ with $n>0$. In a town
with $n$ inhabitants, there are $m$ clubs, each of which has an even number of
members. Any two distinct clubs share an odd number of common members.

\begin{enumerate}
\item[\textbf{(a)}] Prove that $m\leq n$.

\item[\textbf{(b)}] If $n$ is even, then prove that $m\leq n-1$.
\end{enumerate}
\end{exercise}

\begin{proof}
[Solution idea.]As in the solution to Exercise \ref{exe.linalg.F2.odd-even},
we shall use row vectors of size $n$ over the field $\mathbb{F}_{2}$. Again,
let $v_{1},v_{2},\ldots,v_{m}$ be the indicator vectors of our $m$ clubs over
$\mathbb{F}_{2}$. Then, just as we proved the equalities
(\ref{sol.exe.linalg.F2.odd-even.vivj-dist}) and
(\ref{sol.exe.linalg.F2.odd-even.vivi}) in the solution to Exercise
\ref{exe.linalg.F2.odd-even}, we can now show that:

\begin{itemize}
\item For any two distinct elements $i,j$ of $\left\{  1,2,\ldots,m\right\}
$, we have%
\begin{equation}
\left\langle v_{i},v_{j}\right\rangle =\overline{1}
\label{sol.exe.linalg.F2.even-odd.vivj-dist}%
\end{equation}
(since any two distinct clubs share an odd number of common members).

\item For any $i\in\left\{  1,2,\ldots,m\right\}  $, we have%
\begin{equation}
\left\langle v_{i},v_{i}\right\rangle =\overline{0}
\label{sol.exe.linalg.F2.even-odd.vivi}%
\end{equation}
(since each club has an even number of members).
\end{itemize}

Let $W$ be the subset
\begin{align*}
&  \left\{  x\in\mathbb{F}_{2}^{n}\ \mid\ \text{the sum of all coordinates of
}x\text{ is }\overline{0}\right\} \\
&  =\left\{  \left(  x_{1},x_{2},\ldots,x_{n}\right)  \in\mathbb{F}_{2}%
^{n}\ \mid\ x_{1}+x_{2}+\cdots+x_{n}=\overline{0}\right\}
\end{align*}
of $\mathbb{F}_{2}^{n}$. Then, $W$ is a vector subspace of $\mathbb{F}_{2}%
^{n}$ (this is easy to see\footnote{\textit{Proof.} The easiest way to see
this is to argue that $W$ is the left nullspace of the matrix $\left(
\begin{array}
[c]{cccc}%
\overline{1} & \overline{1} & \cdots & \overline{1}%
\end{array}
\right)  $, and thus is a vector subspace (like any nullspace). A more
down-to-earth proof goes by arguing that if $x=\left(  x_{1},x_{2}%
,\ldots,x_{n}\right)  $ and $y=\left(  y_{1},y_{2},\ldots,y_{n}\right)  $ are
two vectors in $W$, then their sum $x+y=\left(  x_{1}+y_{1},\ x_{2}%
+y_{2},\ \ldots,\ x_{n}+y_{n}\right)  $ also belongs to $W$, since%
\begin{align*}
&  \left(  x_{1}+y_{1}\right)  +\left(  x_{2}+y_{2}\right)  +\cdots+\left(
x_{n}+y_{n}\right) \\
&  =\underbrace{\left(  x_{1}+x_{2}+\cdots+x_{n}\right)  }%
_{\substack{=\overline{0}\\\text{(since }x\in W\text{)}}}+\underbrace{\left(
y_{1}+y_{2}+\cdots+y_{n}\right)  }_{\substack{=\overline{0}\\\text{(since
}y\in W\text{)}}}=\overline{0}+\overline{0}=\overline{0}.
\end{align*}
(We would also need to show that $\mathbf{0}\in W$ and that $\lambda x\in W$
for each $\lambda\in\mathbb{F}_{2}$ and each $x\in W$. But the former is
trivial, and the latter is is automatic, since the only options for $\lambda$
are $\overline{0}$ and $\overline{1}$.)}). It is a proper subset of
$\mathbb{F}_{2}^{n}$ (since it does not contain the vector $\left(
\overline{1},\overline{0},\overline{0},\ldots,\overline{0}\right)  $, and thus
its dimension $\dim W$ is lower than the dimension of $\mathbb{F}_{2}^{n}$. In
other words,
\[
\dim W<\dim\left(  \mathbb{F}_{2}^{n}\right)  =n,
\]
so that $\dim W\leq n-1$. (Actually, $\dim W$ is exactly $n-1$, but we don't
need this fact\footnote{Nevertheless, it is easy to prove: For example, one
can argue that $W$ is carved out of $\mathbb{F}_{2}^{n}$ by the single
equation $x_{1}+x_{2}+\cdots+x_{n}=\overline{0}$, which is not a tautology and
thus decreases the dimension by $1$. Alternatively, one can easily see that
$W$ has a basis
\[
\left(  \overline{1},\overline{0},\overline{0},\ldots,\overline{0}%
,\overline{1}\right)  ,\ \ \left(  \overline{0},\overline{1},\overline
{0},\overline{0},\ldots,\overline{0},\overline{1}\right)  ,\ \ \ldots
,\ \ \left(  \overline{0},\overline{0},\overline{0},\ldots,\overline
{0},\overline{1},\overline{1}\right)
\]
(each vector of this basis has a $\overline{1}$ in its last position and at
another position, and $\overline{0}$'s everywhere else), and this basis has
$n-1$ elements, so that $\dim W=n-1$.}.)

Let $i\in\left\{  1,2,\ldots,m\right\}  $. Then, the $i$-th club has an even
number of members (by an assumption of the exercise). In other words, the
vector $v_{i}$ has an even number of coordinates equal to $\overline{1}$.
Hence, the sum of all coordinates of $v_{i}$ is $\overline{0}$ (since the sum
of an even number of $\overline{1}$'s is always $\overline{0}$). In other
words, $v_{i}\in W$ (by the definition of $W$).

Forget that we fixed $i$. We thus have shown that $v_{i}\in W$ for each
$i\in\left\{  1,2,\ldots,m\right\}  $. In other words, the $m$ vectors
$v_{1},v_{2},\ldots,v_{m}$ belong to $W$.

Now we shall prove two crucial claims:

\begin{statement}
\textit{Claim 1:} If $m$ is even, then $m\leq n-1$.
\end{statement}

\begin{proof}
[Proof of Claim 1.]Assume that $m$ is even. We must prove that $m\leq n-1$.

Assume the contrary. Thus, $m>n-1\geq\dim W$ (since $\dim W\leq n-1$). But the
$m$ vectors $v_{1},v_{2},\ldots,v_{m}$ belong to the vector space $W$, whose
dimension is $\dim W$. Hence, Theorem \ref{thm.linalg.php.1} \textbf{(a)}
(applied to $m$ and $\dim W$ instead of $k$ and $n$) yields that these $m$
vectors $v_{1},v_{2},\ldots,v_{m}$ are linearly dependent. In other words,
there exist $m$ elements $c_{1},c_{2},\ldots,c_{m}\in\mathbb{F}_{2}$, not all
zero, such that%
\[
c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}=\mathbf{0}%
\]
(where $\mathbf{0}$ is the all-zero vector over $\mathbb{F}_{2}$, that is,
$\left(  \underbrace{\overline{0},\overline{0},\ldots,\overline{0}}_{n\text{
entries}}\right)  $). Consider these $m$ elements.

Set $d:=c_{1}+c_{2}+\cdots+c_{m}$.

Since the dot product is linear in each argument, we now have%
\begin{align*}
&  \left\langle c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m},\ v_{1}\right\rangle
\\
&  =c_{1}\underbrace{\left\langle v_{1},v_{1}\right\rangle }%
_{\substack{=\overline{0}\\\text{(by (\ref{sol.exe.linalg.F2.even-odd.vivi}%
))}}}+\,c_{2}\underbrace{\left\langle v_{2},v_{1}\right\rangle }%
_{\substack{=\overline{1}\\\text{(by
(\ref{sol.exe.linalg.F2.even-odd.vivj-dist}))}}}+\,\cdots+c_{m}%
\underbrace{\left\langle v_{m},v_{1}\right\rangle }_{\substack{=\overline
{1}\\\text{(by (\ref{sol.exe.linalg.F2.even-odd.vivj-dist}))}}}\\
&  =\underbrace{c_{1}\overline{0}}_{=\overline{0}}+\underbrace{c_{2}%
\overline{1}}_{=c_{2}}+\cdots+\underbrace{c_{m}\overline{1}}_{=c_{m}%
}=\overline{0}+c_{2}+\cdots+c_{m}\\
&  =c_{2}+c_{3}+\cdots+c_{m}=\underbrace{\left(  c_{1}+c_{2}+\cdots
+c_{m}\right)  }_{=d}-\,c_{1}=d-c_{1},
\end{align*}
so that%
\[
d-c_{1}=\left\langle \underbrace{c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{m}v_{m}%
}_{=\mathbf{0}},\ v_{1}\right\rangle =\left\langle \mathbf{0},\ v_{1}%
\right\rangle =\overline{0}.
\]
Hence, $d=c_{1}$, so that $c_{1}=d$. Similarly, we can find that $c_{i}=d$ for
all $i\in\left\{  1,2,\ldots,m\right\}  $ (since there is nothing special
about the $1$-st club). In other words, all the elements $c_{1},c_{2}%
,\ldots,c_{m}$ equal $d$. Hence, $d$ is not zero (since not all $c_{1}%
,c_{2},\ldots,c_{m}$ are zero). In other words, $d\neq\overline{0}$. Since
$d\in\mathbb{F}_{2}=\left\{  \overline{0},\overline{1}\right\}  $, we thus
obtain $d=\overline{1}$.

Thus, for all $i\in\left\{  1,2,\ldots,m\right\}  $, we have $c_{i}%
=d=\overline{1}$. Adding these equations together for all $i\in\left\{
1,2,\ldots,m\right\}  $, we obtain%
\[
c_{1}+c_{2}+\cdots+c_{m}=\underbrace{\overline{1}+\overline{1}+\cdots
+\overline{1}}_{m\text{ many }\overline{1}\text{'s}}=\overline{0}%
\]
(because $m$ is even, but a sum of an even number of $\overline{1}$'s is
always $\overline{0}$). This contradicts $c_{1}+c_{2}+\cdots+c_{m}%
=d=\overline{1}$. This contradiction shows that our assumption was wrong.
Hence, Claim 1 is proved.
\end{proof}

\begin{statement}
\textit{Claim 2:} If $m$ is odd, then $m\leq n$.
\end{statement}

\begin{proof}
[Proof of Claim 2.]Assume that $m$ is odd. Thus, $m-1$ is even. Furthermore,
$m$ cannot be $0$ (since $m$ is odd), and thus $m-1\in\mathbb{N}$.

Now, let us dissolve the $m$-th club. Then, we are left with $m-1$ clubs,
which still satisfy all assumptions of the exercise (i.e., each of them has an
even number of members, but any two have an odd number of common members).
Thus, we can apply Claim 1 to these $m-1$ clubs (using $m-1$ instead of $m$),
and conclude that $m-1\leq n-1$ (since $m-1$ is even). Thus, $m\leq n$. This
proves Claim 2.
\end{proof}

Now we can easily solve the exercise: \medskip

\textbf{(a)} We must prove that $m\leq n$. If $m$ is odd, then this follows
directly from Claim 2. If $m$ is even, then this follows from Claim 1, since
Claim 1 yields $m\leq n-1\leq n$. In either case, Exercise
\ref{exe.linalg.F2.even-odd} \textbf{(a)} is solved. \medskip

\textbf{(b)} Assume that $n$ is even. We must prove that $m\leq n-1$.

Assume the contrary. Thus, $m>n-1$, so that $m\geq n$. But part \textbf{(a)}
yields $m\leq n$. Combining these two inequalities, we find $m=n$, so that $m$
is even (since $n$ is even). Hence, Claim 1 yields $m\leq n-1$, which
contradicts $m\geq n>n-1$. This contradiction shows that our assumption was
false. Exercise \ref{exe.linalg.F2.even-odd} \textbf{(b)} is thus solved.
\end{proof}

\begin{noncompile}
Part of this is also Problems from the Book Chapter 12 Example 4. See also
https://math.stackexchange.com/questions/1170336/a-variation-of-the-even-town-odd-town-problem
.
\end{noncompile}

\begin{remark}
When $n$ is even, the inequality $m\leq n-1$ in Exercise
\ref{exe.linalg.F2.even-odd} \textbf{(b)} is sharp (i.e., equality can be
achieved). In fact, let us single out an inhabitant $\alpha$. For each of the
$n-1$ remaining inhabitants $\beta\neq\alpha$, we form a club containing only
$\alpha$ and $\beta$. Thus, we obtain $n-1$ clubs that satisfy the conditions
of Exercise \ref{exe.linalg.F2.odd-even}.

When $n$ is odd, the inequality $m\leq n$ in Exercise
\ref{exe.linalg.F2.even-odd} \textbf{(a)} is sharp as well. To see it become
an equality, we construct $n-1$ clubs just as in the preceding paragraph, but
we also create an $n$-th club that contains all $n-1$ inhabitants distinct
from $\alpha$. The resulting $n$ clubs satisfy the conditions of Exercise
\ref{exe.linalg.F2.odd-even} (since $n$ is odd).
\end{remark}

\begin{remark}
There is an alternative solution to Exercise \ref{exe.linalg.F2.even-odd},
which is worth sketching since it connects it to our previous work on determinants.

Again, we let $v_{1},v_{2},\ldots,v_{m}$ be the indicator vectors of our $m$
clubs over $\mathbb{F}_{2}$. This time, we pack them into a matrix: Let $A$ be
the $n\times m$-matrix with columns $v_{1},v_{2},\ldots,v_{m}$ over
$\mathbb{F}_{2}$. Consider also the transpose $A^{T}$ of this matrix $A$.
Then, the equalities (\ref{sol.exe.linalg.F2.even-odd.vivi}) and
(\ref{sol.exe.linalg.F2.even-odd.vivj-dist}) show that $A^{T}A=R$, where $R$
is the $m\times m$-matrix%
\[
\left(
\begin{array}
[c]{ccccc}%
\overline{0} & \overline{1} & \overline{1} & \cdots & \overline{1}\\
\overline{1} & \overline{0} & \overline{1} & \cdots & \overline{1}\\
\overline{1} & \overline{1} & \overline{0} & \cdots & \overline{1}\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
\overline{1} & \overline{1} & \overline{1} & \cdots & \overline{0}%
\end{array}
\right)
\]
whose all diagonal entries equal $\overline{0}$ and whose all off-diagonal
entries equal $\overline{1}$. Again, defining $W$ to be the subset%
\[
\left\{  x\in\mathbb{F}_{2}^{n}\ \mid\ \text{the sum of all coordinates of
}x\text{ is }\overline{0}\right\}
\]
of $\mathbb{F}_{2}^{n}$, we can easily see that $W$ is a vector subspace of
dimension $\leq n-1$ (actually $=n-1$), and therefore%
\begin{align*}
n-1  &  \geq\dim W\geq\operatorname*{rank}A\ \ \ \ \ \ \ \ \ \ \left(
\text{since all columns of }A\text{ belong to }W\right) \\
&  \geq\operatorname*{rank}\left(  A^{T}A\right)  \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since }\operatorname*{rank}V\geq\operatorname*{rank}\left(  UV\right)
\text{ for}\\
\text{any two matrices }U\text{ and }V
\end{array}
\right) \\
&  =\operatorname*{rank}R\ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
A^{T}A=R\right)  .
\end{align*}
It remains to compute $\operatorname*{rank}R$. Here, it helps to observe that
$R$ is the $\mathbb{F}_{2}$-analogue of the matrix $B$ considered in our
solution to Exercise \ref{exe.det.put1973B1.real} above (see
(\ref{sol.det.put1973B1.real.B=})), and its determinant can be computed along
the same lines (or it can be obtained from $\det B$ by \textquotedblleft
projecting\textquotedblright\ onto $\mathbb{F}_{2}$). This shows that $\det
R=\overline{1}$ if $m$ is even. When $m$ is odd, we have $\det R=\overline{0}%
$, but the $\left(  m-1\right)  \times\left(  m-1\right)  $-submatrix of $R$
obtained by removing the last row and the last column has determinant
$\overline{1}$. Combining these facts, we conclude that%
\[
\operatorname*{rank}R=%
\begin{cases}
m, & \text{if }m\text{ is even;}\\
m-1, & \text{if }m\text{ is odd}%
\end{cases}
\]
(since the rank of a matrix $M$ equals the largest $k\in\mathbb{N}$ such that
$M$ has a $k\times k$-submatrix with nonzero determinant). Combining what we
have shown, we find%
\[
n-1\geq\operatorname*{rank}R=%
\begin{cases}
m, & \text{if }m\text{ is even;}\\
m-1, & \text{if }m\text{ is odd,}%
\end{cases}
\]
which yields both Claims 1 and 2 from our above solution to Exercise
\ref{exe.linalg.F2.even-odd}.
\end{remark}

\begin{noncompile}
See also https://xavier.caruso.ovh/papers/publis/combi1.pdf (also
https://xavier.caruso.ovh/papers/publis/combi2.pdf for combi) for
Oddtown/Eventown variations.
\end{noncompile}

\subsubsection{Size and dimension}

There are two more Eventown/Oddtown theorems: see Exercises
\ref{exe.linalg.F2.odd-odd} and \ref{exe.linalg.F2.even-even} below. In
preparation for their proofs, let us prove a simple property of
finite-dimensional vector spaces over $\mathbb{F}_{2}$. In \textquotedblleft
usual\textquotedblright\ linear algebra (i.e., linear algebra over
$\mathbb{Q}$, $\mathbb{R}$ or $\mathbb{C}$), you rarely have a reason to think
about the size of a vector space, since all nontrivial vector spaces are
infinite. However, when working over a finite field such as $\mathbb{F}_{2}$,
finite-dimensional vector spaces are finite sets, and it makes sense to ask
about their sizes. The answer (which we only state here for $\mathbb{F}_{2}$)
is nice and simple:

\begin{proposition}
\label{prop.linalg.F2.size}Let $n\in\mathbb{N}$. Let $V$ be a vector space
over $\mathbb{F}_{2}$ that has dimension $n$. Then, the size of $V$ (as a set)
is $\left\vert V\right\vert =2^{n}$.
\end{proposition}

\begin{proof}
The vector space $V$ has dimension $n$; thus, it has a basis $\left(
v_{1},v_{2},\ldots,v_{n}\right)  $ consisting of $n$ vectors. Consider this basis.

Each vector $w\in V$ can be uniquely expressed as a linear combination
$c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{n}v_{n}$ with coefficients $c_{1}%
,c_{2},\ldots,c_{n}\in\mathbb{F}_{2}$ (since $\left(  v_{1},v_{2},\ldots
,v_{n}\right)  $ is a basis of $V$). In other words, the map%
\begin{align*}
\mathbb{F}_{2}^{n}  &  \rightarrow V,\\
\left(  c_{1},c_{2},\ldots,c_{n}\right)   &  \mapsto c_{1}v_{1}+c_{2}%
v_{2}+\cdots+c_{n}v_{n}%
\end{align*}
is a bijection\footnote{Indeed,
\par
\begin{itemize}
\item it is surjective since each vector $w\in V$ can be expressed as a linear
combination $c_{1}v_{1}+c_{2}v_{2}+\cdots+c_{n}v_{n}$ with coefficients
$c_{1},c_{2},\ldots,c_{n}\in\mathbb{F}_{2}$;
\par
\item and it is injective since these coefficients $c_{1},c_{2},\ldots
,c_{n}\in\mathbb{F}_{2}$ are uniquely determined by $w$.
\end{itemize}
}. By the bijection principle\footnote{The \emph{bijection principle} says
that if there exists a bijection between two sets $X$ and $Y$, then
$\left\vert X\right\vert =\left\vert Y\right\vert $. This is a fundamental
fact that underlies all enumerative combinatorics.}, this entails $\left\vert
\mathbb{F}_{2}^{n}\right\vert =\left\vert V\right\vert $. Hence, $\left\vert
V\right\vert =\left\vert \mathbb{F}_{2}^{n}\right\vert =\left\vert
\mathbb{F}_{2}\right\vert ^{n}=2^{n}$ (since $\left\vert \mathbb{F}%
_{2}\right\vert =2$). This proves Proposition \ref{prop.linalg.F2.size}.
\end{proof}

\subsection{Orthogonality}

\subsubsection{Theory}

Let us now discuss a bit more linear algebra, which will help us prove two
more Eventown/Oddtown theorems.

Let $\mathbb{F}$ be any field (for example, $\mathbb{Q}$, $\mathbb{R}$,
$\mathbb{C}$ or $\mathbb{F}_{2}$), and let $n\in\mathbb{N}$ be arbitrary.
Consider the vector space $\mathbb{F}^{n}$ of all row vectors $\left(
a_{1},a_{2},\ldots,a_{n}\right)  $ of size $n$ with entries in $\mathbb{F}$.
The \emph{dot product} of two vectors $x=\left(  x_{1},x_{2},\ldots
,x_{n}\right)  \in\mathbb{F}^{n}$ and $y=\left(  y_{1},y_{2},\ldots
,y_{n}\right)  \in\mathbb{F}^{n}$ is defined to be the scalar%
\[
x_{1}y_{1}+x_{2}y_{2}+\cdots+x_{n}y_{n}=\sum_{p=1}^{n}x_{p}y_{p}\in
\mathbb{F}.
\]
This dot product is denoted by $\left\langle x,y\right\rangle $ or sometimes
by $x\cdot y$. (We have already used this dot product for $\mathbb{F}%
=\mathbb{R}$ in the solution to Exercise \ref{exe.linalg.php.fisher1}, and for
$\mathbb{F}=\mathbb{F}_{2}$ in Subsection \ref{subsec.linalg.F2}. Now we are
defining it in the general case.)

The dot product has several important properties (all of which follow easily
from its definition):

\begin{itemize}
\item \emph{Symmetry}: We have $\left\langle x,y\right\rangle =\left\langle
y,x\right\rangle $ for any $x,y\in\mathbb{F}^{n}$.

\item \emph{Bilinearity:} We have%
\begin{align*}
\left\langle x+x^{\prime},\ y\right\rangle  &  =\left\langle x,y\right\rangle
+\left\langle x^{\prime},y\right\rangle \ \ \ \ \ \ \ \ \ \ \text{for all
}x,x^{\prime},y\in\mathbb{F}^{n};\\
\left\langle x,\ y+y^{\prime}\right\rangle  &  =\left\langle x,y\right\rangle
+\left\langle x,y^{\prime}\right\rangle \ \ \ \ \ \ \ \ \ \ \text{for all
}x,y,y^{\prime}\in\mathbb{F}^{n};\\
\left\langle \lambda x,y\right\rangle  &  =\left\langle x,\lambda
y\right\rangle =\lambda\left\langle x,y\right\rangle
\ \ \ \ \ \ \ \ \ \ \text{for all }\lambda\in\mathbb{F}\text{ and }%
x,y\in\mathbb{F}^{n};\\
\left\langle \mathbf{0},x\right\rangle  &  =\left\langle x,\mathbf{0}%
\right\rangle =0\ \ \ \ \ \ \ \ \ \ \text{for all }x\in\mathbb{F}^{n},
\end{align*}
where $\mathbf{0}$ denotes the zero vector $\left(  0,0,\ldots,0\right)  $ in
$\mathbb{F}^{n}$.
\end{itemize}

For two vectors $x$ and $y$ in $\mathbb{F}^{n}$, we say that $x$ is
\emph{orthogonal} to $y$ if and only if $\left\langle x,y\right\rangle =0$.
The shorthand notation for this is \textquotedblleft$x\perp y$%
\textquotedblright. This orthogonality relation is symmetric (i.e., we have
$x\perp y$ if and only if $y\perp x$). If $\mathbb{F}=\mathbb{R}$, then it is
precisely the classical orthogonality relation from Euclidean geometry (i.e.,
two vectors are orthogonal if and only if they span perpendicular lines or one
of them is zero). But it is useful for other fields as well, even
$\mathbb{F}_{2}$ ! (Of course, when $\mathbb{F}=\mathbb{F}_{2}$, the relation
$\left\langle x,y\right\rangle =0$ means $\left\langle x,y\right\rangle
=\overline{0}$, since $\overline{0}$ plays the role of $0$ in $\mathbb{F}_{2}$.)

\begin{warning}
Not all properties known from the real case ($\mathbb{F}=\mathbb{R}$)
generalize to other fields! For $\mathbb{F}=\mathbb{R}$, the only vector
$x\in\mathbb{F}^{n}$ satisfying $x\perp x$ is the zero vector $\mathbf{0}$.
But this is not the case for $\mathbb{F}=\mathbb{F}_{2}$. For instance, the
vector $\left(  \overline{1},\overline{1}\right)  \in\mathbb{F}_{2}^{2}$ is
orthogonal to itself, since $\left\langle \left(  \overline{1},\overline
{1}\right)  ,\ \left(  \overline{1},\overline{1}\right)  \right\rangle
=\overline{1}\cdot\overline{1}+\overline{1}\cdot\overline{1}=\overline
{1}+\overline{1}=\overline{0}$. But it is not the zero vector. A similar
example exists for $\mathbb{F}=\mathbb{C}$: Here, the vector $\left(
1,i\right)  $ (with $i=\sqrt{-1}$) is orthogonal to itself but is not zero.
The reason why such vectors don't exist for $\mathbb{F}=\mathbb{R}$ is that in
$\mathbb{R}$, a sum of squares is never zero unless all addends are zero.

This, incidentally, is the reason why many authors shun the dot product for
$\mathbb{F}=\mathbb{C}$ in favor of a subtler notion of product, which
involves complex conjugation (specifically, it replaces $x_{1}y_{1}+x_{2}%
y_{2}+\cdots+x_{n}y_{n}$ by $x_{1}\overline{y_{1}}+x_{2}\overline{y_{2}%
}+\cdots+x_{n}\overline{y_{n}}$ in the definition of the inner product); this
latter product is usually called the \emph{inner product}. See \cite[Chapter
6]{Axler23} for much more about it.
\end{warning}

The following fact is easy but crucial:

\begin{lemma}
\label{lem.linalg.orth-linear}Let $n\in\mathbb{N}$, and let $\mathbb{F}$ be a
field. Let $u_{1},u_{2},\ldots,u_{n}$ and $v$ be some vectors in
$\mathbb{F}^{n}$. Assume that $v$ is orthogonal to each of the vectors
$u_{1},u_{2},\ldots,u_{n}$. Then, $v$ is also orthogonal to each linear
combination of these vectors $u_{1},u_{2},\ldots,u_{n}$.
\end{lemma}

\begin{proof}
[Proof sketch.]Let $w$ be a linear combination of $u_{1},u_{2},\ldots,u_{n}$.
Thus, $w=\lambda_{1}u_{1}+\lambda_{2}u_{2}+\cdots+\lambda_{n}u_{n}$ for some
coefficients $\lambda_{1},\lambda_{2},\ldots,\lambda_{n}\in\mathbb{F}$.
Consider these $\lambda_{1},\lambda_{2},\ldots,\lambda_{n}$. Thus,%
\begin{align*}
\left\langle v,w\right\rangle  &  =\left\langle v,\ \lambda_{1}u_{1}%
+\lambda_{2}u_{2}+\cdots+\lambda_{n}u_{n}\right\rangle \\
&  =\lambda_{1}\left\langle v,u_{1}\right\rangle +\lambda_{2}\left\langle
v,u_{2}\right\rangle +\cdots+\lambda_{n}\left\langle v,u_{n}\right\rangle \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(  \text{by the bilinearity of
the dot product}\right) \\
&  =\sum_{k=1}^{n}\lambda_{k}\underbrace{\left\langle v,u_{k}\right\rangle
}_{\substack{=0\\\text{(since }v\text{ is orthogonal}\\\text{to each of }%
u_{1},u_{2},\ldots,u_{n}\text{,}\\\text{thus in particular to }u_{k}\text{)}%
}}=\sum_{k=1}^{n}\lambda_{k}0=0.
\end{align*}
In other words, $v$ is orthogonal to $w$. Since $w$ was chosen to be an
arbitrary linear combination of $u_{1},u_{2},\ldots,u_{n}$, we thus have shown
that $v$ is orthogonal to each such combination. This proves Lemma
\ref{lem.linalg.orth-linear}.
\end{proof}

An important definition related to orthogonality is the \textquotedblleft
orthogonal space\textquotedblright. If $U$ is any subset of $\mathbb{F}^{n}$
(for some $n\in\mathbb{N}$ and some field $\mathbb{F}$), then we define a
subset $U^{\perp}$ of $\mathbb{F}^{n}$ by%
\[
U^{\perp}:=\left\{  v\in\mathbb{F}^{n}\ \mid\ v\perp u\text{ for each }u\in
U\right\}  .
\]
This is the set of all vectors $v\in\mathbb{F}^{n}$ that are orthogonal to
\textbf{all} vectors in $U$. It is called the \emph{orthogonal complement} of
$U$ in $\mathbb{F}^{n}$. (Informally, it is often called the \textquotedblleft%
\emph{perp} of $U$\textquotedblright\ or the \textquotedblleft$U$%
-perp\textquotedblright, imitating the LaTeX command \texttt{%
%TCIMACRO{\TEXTsymbol{\backslash}}%
%BeginExpansion
$\backslash$%
%EndExpansion
perp} for the $\perp$ symbol.) Its major properties are the
following:\footnote{Theorem \ref{thm.linalg.perp.main} can be generalized by
replacing $\mathbb{F}^{n}$ with an arbitrary finite-dimensional vector space,
and replacing the dot product with an arbitrary bilinear form. See, e.g.,
\cite[Corollary 7.1]{Gri-bilf} for this kind of generalization of Theorem
\ref{thm.linalg.perp.main} \textbf{(c)}.}

\begin{theorem}
\label{thm.linalg.perp.main}Let $n\in\mathbb{N}$, and let $\mathbb{F}$ be a
field. Let $U$ be a subset of $\mathbb{F}^{n}$. Then:

\begin{enumerate}
\item[\textbf{(a)}] The set $U^{\perp}$ is a vector subspace of $\mathbb{F}%
^{n}$ (even if $U$ is not!).

\item[\textbf{(b)}] We have $U\subseteq\left(  U^{\perp}\right)  ^{\perp}$.

\item[\textbf{(c)}] Assume that $U$ is a vector subspace of $\mathbb{F}^{n}$.
Then,%
\[
\dim U+\dim\left(  U^{\perp}\right)  =n.
\]


\item[\textbf{(d)}] Assume that $U$ is a vector subspace of $\mathbb{F}^{n}$.
Then, $\left(  U^{\perp}\right)  ^{\perp}=U$.
\end{enumerate}
\end{theorem}

\begin{proof}
[Proof sketch.]Part \textbf{(a)} follows from the bilinearity of the dot
product (or from Lemma \ref{lem.linalg.orth-linear}); part \textbf{(b)} from
its symmetry. \medskip

\textbf{(c)} This is the rank-nullity theorem in disguise. To wit: Let
$\left(  u_{1},u_{2},\ldots,u_{k}\right)  $ be a basis of $U$. Thus, $\dim
U=k$. Note that the $k$ vectors $u_{1},u_{2},\ldots,u_{k}$ are linearly
independent (since they form a basis of $U$), and their span is
$\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k}\right\}  =U$ (for the
same reason).

Now let $A$ be the $k\times n$-matrix (with entries in $\mathbb{F}$) whose
rows are these $k$ vectors $u_{1},u_{2},\ldots,u_{k}$. Then, the $k$ rows of
$A$ are linearly independent (since we just showed that $u_{1},u_{2}%
,\ldots,u_{k}$ are linearly independent), and thus the rank of $A$ is
$\operatorname*{rank}A=k$.

Next, we consider the nullspace $\operatorname*{Ker}A$ of $A$. This is defined
as the set of all column vectors $v\in\mathbb{F}^{n}$ such that $Av=\mathbf{0}%
$. In other words,%
\begin{equation}
\operatorname*{Ker}A=\left\{  v\in\mathbb{F}^{n}\ \mid\ Av=\mathbf{0}\right\}
. \label{pf.thm.linalg.perp.main.c.KerA=}%
\end{equation}
Being sloppy, we regard the column vectors in $\operatorname*{Ker}A$ as row
vectors (by identifying them with their transposes).

The rows of $A$ are $u_{1},u_{2},\ldots,u_{k}$. Thus, for any column vector
$v\in\mathbb{F}^{n}$, the product $Av$ is just the vector $\left(
\begin{array}
[c]{c}%
\left\langle u_{1},v\right\rangle \\
\left\langle u_{2},v\right\rangle \\
\vdots\\
\left\langle u_{k},v\right\rangle
\end{array}
\right)  $ (why?). Hence, for any $v\in\mathbb{F}^{n}$, we have the following
chain of logical equivalences:%
\begin{align*}
&  \ \left(  Av=\mathbf{0}\right) \\
&  \Longleftrightarrow\ \left(  \left(
\begin{array}
[c]{c}%
\left\langle u_{1},v\right\rangle \\
\left\langle u_{2},v\right\rangle \\
\vdots\\
\left\langle u_{k},v\right\rangle
\end{array}
\right)  =\mathbf{0}\right) \\
&  \Longleftrightarrow\ \left(  \left\langle u_{i},v\right\rangle =0\text{ for
each }i\in\left\{  1,2,\ldots,k\right\}  \right) \\
&  \Longleftrightarrow\ \left(  \left\langle u,v\right\rangle =0\text{ for
each }u\in\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k}\right\}
\right) \\
&  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since each }u\in\operatorname*{span}\left\{  u_{1},u_{2},\ldots
,u_{k}\right\}  \text{ can be written as}\\
\text{a linear combination }c_{1}u_{1}+c_{2}u_{2}+\cdots+c_{k}u_{k}\text{
with}\\
\text{coefficients }c_{1},c_{2},\ldots,c_{k}\in\mathbb{F}\text{, and thus}\\
\text{satisfies }\left\langle u,v\right\rangle =\left\langle c_{1}u_{1}%
+c_{2}u_{2}+\cdots+c_{k}u_{k},\ v\right\rangle \\
=c_{1}\left\langle u_{1},v\right\rangle +c_{2}\left\langle u_{2}%
,v\right\rangle +\cdots+c_{k}\left\langle u_{k},v\right\rangle \\
\text{(by the bilinearity of the dot product); but this latter}\\
\text{sum is }0\text{ if we have }\left\langle u_{i},v\right\rangle =0\text{
for each }i\in\left\{  1,2,\ldots,k\right\}
\end{array}
\right) \\
&  \Longleftrightarrow\ \left(  \left\langle u,v\right\rangle =0\text{ for
each }u\in U\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }%
\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k}\right\}  =U\right) \\
&  \Longleftrightarrow\ \left(  \left\langle v,u\right\rangle =0\text{ for
each }u\in U\right)  \ \ \ \ \ \ \ \ \ \ \left(  \text{since }\left\langle
u,v\right\rangle =\left\langle v,u\right\rangle \text{ for any }u\in
\mathbb{F}^{n}\right) \\
&  \Longleftrightarrow\ \left(  v\perp u\text{ for each }u\in U\right)
\ \ \ \ \ \ \ \ \ \ \left(  \text{since }v\perp u\text{ means that
}\left\langle v,u\right\rangle =0\right)  .
\end{align*}
Hence, we can rewrite (\ref{pf.thm.linalg.perp.main.c.KerA=}) as%
\begin{align*}
\operatorname*{Ker}A  &  =\left\{  v\in\mathbb{F}^{n}\ \mid\ v\perp u\text{
for each }u\in U\right\} \\
&  =U^{\perp}\ \ \ \ \ \ \ \ \ \ \left(  \text{by the definition of }U^{\perp
}\right)  .
\end{align*}


But the rank-nullity theorem (Theorem \ref{thm.linalg.ranknul}, applied to $k$
and $n$ instead of $n$ and $m$) yields%
\[
n=\dim\left(  \underbrace{\operatorname*{Ker}A}_{=U^{\perp}}\right)
+\underbrace{\operatorname*{rank}A}_{=k=\dim U}=\dim\left(  U^{\perp}\right)
+\dim U=\dim U+\dim\left(  U^{\perp}\right)  .
\]
This proves Theorem \ref{thm.linalg.perp.main} \textbf{(c)}. \medskip

\textbf{(d)} Theorem \ref{thm.linalg.perp.main} \textbf{(a)} yields that
$U^{\perp}$ is a vector subspace of $\mathbb{F}^{n}$. Theorem
\ref{thm.linalg.perp.main} \textbf{(a)} (applied to $U^{\perp}$ instead of
$U$) yields that $\left(  U^{\perp}\right)  ^{\perp}$ is a vector subspace of
$\mathbb{F}^{n}$ as well. Theorem \ref{thm.linalg.perp.main} \textbf{(c)}
yields $\dim U+\dim\left(  U^{\perp}\right)  =n$. Theorem
\ref{thm.linalg.perp.main} \textbf{(c)} (applied to $U^{\perp}$ instead of
$U$) yields $\dim\left(  U^{\perp}\right)  +\dim\left(  \left(  U^{\perp
}\right)  ^{\perp}\right)  =n$. Comparing these two equalities, we find $\dim
U+\dim\left(  U^{\perp}\right)  =\dim\left(  U^{\perp}\right)  +\dim\left(
\left(  U^{\perp}\right)  ^{\perp}\right)  $. Subtracting $\dim\left(
U^{\perp}\right)  $ from both sides of this, we obtain $\dim U=\dim\left(
\left(  U^{\perp}\right)  ^{\perp}\right)  $.

However, Theorem \ref{thm.linalg.perp.main} \textbf{(b)} yields $U\subseteq
\left(  U^{\perp}\right)  ^{\perp}$. Thus, $U$ is a vector subspace of
$\left(  U^{\perp}\right)  ^{\perp}$. As we know, it satisfies $\dim
U=\dim\left(  \left(  U^{\perp}\right)  ^{\perp}\right)  $. Hence, Theorem
\ref{thm.linalg.subset} \textbf{(b)} (applied to $\left(  U^{\perp}\right)
^{\perp}$ and $U$ instead of $V$ and $W$) yields $\left(  U^{\perp}\right)
^{\perp}=U$. This proves Theorem \ref{thm.linalg.perp.main} \textbf{(d)}.
\end{proof}

\subsubsection{Application: Odd intersections}

The best-known applications of orthogonal complements are found in geometry
(where they are used to construct, e.g., the normal vector to a plane in
space) and in representation theory (where they can be used to decompose
larger representations into smaller ones). But they also have uses in
combinatorics. The following example is another result in the vein of Oddtown
and Eventown (although we don't state it in terms of towns and clubs):

\begin{exercise}
\label{exe.linalg.F2.AB}Let $n\in\mathbb{N}$, and let $p$ and $q$ be two
positive integers.

Let $S$ be an $n$-element set. Let $A_{1},A_{2},\ldots,A_{p}$ be $p$ distinct
subsets of $S$. Let $B_{1},B_{2},\ldots,B_{q}$ be $q$ distinct subsets of $S$.
(Note that \textquotedblleft distinct\textquotedblright\ does not mean
\textquotedblleft disjoint\textquotedblright!)

Assume that $\left\vert A_{i}\cap B_{j}\right\vert $ is odd for every
$i\in\left\{  1,2,\ldots,p\right\}  $ and $j\in\left\{  1,2,\ldots,q\right\}
$. Then:

\begin{enumerate}
\item[\textbf{(a)}] There exist integers $\alpha\in\mathbb{N}$ and $\beta
\in\mathbb{N}$ such that $\alpha+\beta\leq n-1$ and $p\leq2^{\alpha}$ and
$q\leq2^{\beta}$.

\item[\textbf{(b)}] In particular, we have $pq\leq2^{n-1}$.
\end{enumerate}
\end{exercise}

\begin{noncompile}
Part \textbf{(b)} is
https://math.stackexchange.com/questions/3430982/two-families-with-odd-intersections-of-their-sets
. I think I also solved it on ML.
\end{noncompile}

\begin{proof}
[Solution idea.]We WLOG assume that $S=\left\{  1,2,\ldots,n\right\}  $
(otherwise, we rename the elements of $S$).

For each $i\in\left\{  1,2,\ldots,p\right\}  $, we let $a_{i}$ denote the
indicator vector of the subset $A_{i}$ over $\mathbb{F}_{2}$; this is the
vector of size $n$ with entries in $\mathbb{F}_{2}$ whose $k$-th coordinate
is
\[%
\begin{cases}
\overline{1}, & \text{if }k\in A_{i};\\
\overline{0}, & \text{if }k\notin A_{i}%
\end{cases}
\ \ \ \ \ \ \ \ \ \ \text{for each }k\in\left\{  1,2,\ldots,n\right\}  .
\]
Likewise, for each $j\in\left\{  1,2,\ldots,q\right\}  $, we let $b_{j}$
denote the indicator vector of the subset $B_{j}$ of $\mathbb{F}_{2}$.

The subsets $A_{1},A_{2},\ldots,A_{p}$ are distinct; thus, their indicator
vectors $a_{1},a_{2},\ldots,a_{p}$ are distinct as well. Similarly, the
vectors $b_{1},b_{2},\ldots,b_{q}$ are distinct.

Recall that $\left\vert A_{i}\cap B_{j}\right\vert $ is odd for every
$i\in\left\{  1,2,\ldots,p\right\}  $ and $j\in\left\{  1,2,\ldots,q\right\}
$. Translating this into the language of dot products, we obtain the following:

\begin{statement}
\textit{Claim 1:} We have $\left\langle a_{i},b_{j}\right\rangle =\overline
{1}$ for every $i\in\left\{  1,2,\ldots,p\right\}  $ and $j\in\left\{
1,2,\ldots,q\right\}  $.
\end{statement}

\begin{proof}
[Proof of Claim 1.]Let $i\in\left\{  1,2,\ldots,p\right\}  $ and $j\in\left\{
1,2,\ldots,q\right\}  $. Then, $\left\vert A_{i}\cap B_{j}\right\vert $ is odd
(by the assumption of the exercise). However, just as we proved
(\ref{sol.exe.linalg.F2.odd-even.vivj}) in the solution to Exercise
\ref{exe.linalg.F2.odd-even}, we can show that $\left\langle a_{i}%
,b_{j}\right\rangle =\overline{\left\vert A_{i}\cap B_{j}\right\vert }$. But
$\overline{\left\vert A_{i}\cap B_{j}\right\vert }=\overline{1}$, since
$\left\vert A_{i}\cap B_{j}\right\vert $ is odd. Thus, $\left\langle
a_{i},b_{j}\right\rangle =\overline{\left\vert A_{i}\cap B_{j}\right\vert
}=\overline{1}$. This proves Claim 1.
\end{proof}

Let
\[
\mathbf{A}:=\operatorname*{span}\left\{  a_{1},a_{2},\ldots,a_{p}\right\}
\ \ \ \ \ \ \ \ \ \ \text{and}\ \ \ \ \ \ \ \ \ \ \mathbf{B}%
:=\operatorname*{span}\left\{  b_{1},b_{2},\ldots,b_{q}\right\}  .
\]
Then, both $\mathbf{A}$ and $\mathbf{B}$ are subspaces of the vector space
$\mathbb{F}_{2}^{n}$ (since a span of a set of vectors is always a subspace).
Obviously, $a_{1},a_{2},\ldots,a_{p}\in\mathbf{A}$ and $b_{1},b_{2}%
,\ldots,b_{q}\in\mathbf{B}$.

Let furthermore
\begin{align*}
\mathbf{A}^{\prime}  &  :=\operatorname*{span}\underbrace{\left\{  a_{i}%
-a_{1}\ \mid\ i\in\left\{  1,2,\ldots,p\right\}  \right\}  }_{=\left\{
a_{1}-a_{1},\ a_{2}-a_{1},\ \ldots,\ a_{p}-a_{1}\right\}  }%
\ \ \ \ \ \ \ \ \ \ \text{and}\\
\mathbf{B}^{\prime}  &  :=\operatorname*{span}\underbrace{\left\{  b_{j}%
-b_{1}\ \mid\ j\in\left\{  1,2,\ldots,q\right\}  \right\}  }_{=\left\{
b_{1}-b_{1},\ b_{2}-b_{1},\ \ldots,\ b_{q}-b_{1}\right\}  }.
\end{align*}
Again, $\mathbf{A}^{\prime}$ and $\mathbf{B}^{\prime}$ are subspaces of
$\mathbb{F}_{2}^{n}$. Furthermore, Claim 1 easily entails the following:

\begin{statement}
\textit{Claim 2:} We have%
\begin{equation}
\mathbf{A}^{\prime}\subseteq\mathbf{B}^{\perp}. \label{sol.linalg.F2.AB.orth}%
\end{equation}

\end{statement}

\begin{proof}
[Proof of Claim 2.]Let $i\in\left\{  1,2,\ldots,p\right\}  $. For each
$j\in\left\{  1,2,\ldots,q\right\}  $, we have $a_{i}-a_{1}\perp b_{j}$, since%
\begin{align*}
\left\langle a_{i}-a_{1},\ b_{j}\right\rangle  &  =\underbrace{\left\langle
a_{i},b_{j}\right\rangle }_{\substack{=\overline{1}\\\text{(by Claim 1)}%
}}-\underbrace{\left\langle a_{1},b_{j}\right\rangle }_{\substack{=\overline
{1}\\\text{(by Claim 1)}}}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{by the bilinearity of}\\
\text{the dot product}%
\end{array}
\right) \\
&  =\overline{1}-\overline{1}=\overline{0}.
\end{align*}
In other words, the vector $a_{i}-a_{1}$ is orthogonal to each of the $q$
vectors $b_{1},b_{2},\ldots,b_{q}$. Hence, $a_{i}-a_{1}$ is also orthogonal to
each linear combination of these $q$ vectors $b_{1},b_{2},\ldots,b_{q}$ (by
Lemma \ref{lem.linalg.orth-linear}). In other words, $a_{i}-a_{1}$ is
orthogonal to each vector in $\operatorname*{span}\left\{  b_{1},b_{2}%
,\ldots,b_{q}\right\}  $. In other words, $a_{i}-a_{1}$ is orthogonal to each
vector in $\mathbf{B}$ (since $\mathbf{B}=\operatorname*{span}\left\{
b_{1},b_{2},\ldots,b_{q}\right\}  $). In other words, $a_{i}-a_{1}%
\in\mathbf{B}^{\perp}$ (by the definition of $\mathbf{B}^{\perp}$).

Now forget that we fixed $i$. We thus have shown that $a_{i}-a_{1}%
\in\mathbf{B}^{\perp}$ for each $i\in\left\{  1,2,\ldots,p\right\}  $. In
other words, the $p$ vectors $a_{i}-a_{1}$ for all $i\in\left\{
1,2,\ldots,p\right\}  $ all belong to $\mathbf{B}^{\perp}$. Thus, any linear
combination of these $p$ vectors also belongs to $\mathbf{B}^{\perp}$ (since
$\mathbf{B}^{\perp}$ is a subspace of $\mathbb{F}_{2}^{n}$ and thus is closed
under linear combination). In other words, $\operatorname*{span}\left\{
a_{i}-a_{1}\ \mid\ i\in\left\{  1,2,\ldots,p\right\}  \right\}  \subseteq
\mathbf{B}^{\perp}$. In other words, $\mathbf{A}^{\prime}\subseteq
\mathbf{B}^{\perp}$ (since $\mathbf{A}^{\prime}=\operatorname*{span}\left\{
a_{i}-a_{1}\ \mid\ i\in\left\{  1,2,\ldots,p\right\}  \right\}  $). This
proves Claim 2.
\end{proof}

Moreover, it is not hard to see the following:

\begin{statement}
\textit{Claim 3:} We have%
\begin{equation}
\dim\left(  \mathbf{A}^{\prime}\right)  =\dim\mathbf{A}-1.
\label{sol.linalg.F2.AB.dimA'}%
\end{equation}

\end{statement}

\begin{proof}
[Proof of Claim 3.]Let us first observe that $a_{1}$ is not orthogonal to
$b_{1}$ (since Claim 1 yields $\left\langle a_{1},b_{1}\right\rangle
=\overline{1}\neq\overline{0}$). Thus, $a_{1}\notin\mathbf{B}^{\perp}$ (since
$b_{1}\in\mathbf{B}$). Hence, $a_{1}\notin\mathbf{A}^{\prime}$ (since
(\ref{sol.linalg.F2.AB.orth}) shows that $\mathbf{A}^{\prime}\subseteq
\mathbf{B}^{\perp}$). But obviously, $a_{1}\in\mathbf{A}$. Hence,
$\mathbf{A}^{\prime}\neq\mathbf{A}$ (because if we had $\mathbf{A}^{\prime
}=\mathbf{A}$, then we would have $a_{1}\notin\mathbf{A}^{\prime}=\mathbf{A}$,
which would contradict $a_{1}\in\mathbf{A}$).

The vectors $a_{i}-a_{1}$ for all $i\in\left\{  1,2,\ldots,p\right\}  $
obviously are linear combinations of $a_{1},a_{2},\ldots,a_{p}$, and thus
belong to $\operatorname*{span}\left\{  a_{1},a_{2},\ldots,a_{p}\right\}
=\mathbf{A}$. Hence, all their linear combinations also belong to $\mathbf{A}$
(since $\mathbf{A}$ is a subspace of $\mathbb{F}_{2}^{n}$, and thus is closed
under linear combination). In other words, $\mathbf{A}^{\prime}\subseteq
\mathbf{A}$ (since $\mathbf{A}^{\prime}=\operatorname*{span}\left\{
a_{i}-a_{1}\ \mid\ i\in\left\{  1,2,\ldots,p\right\}  \right\}  $ is the set
of the linear combinations of the vectors $a_{i}-a_{1}$). Thus, $\mathbf{A}%
^{\prime}$ is a subspace of $\mathbf{A}$. Consequently, Theorem
\ref{thm.linalg.subset} \textbf{(a)} yields $\dim\left(  \mathbf{A}^{\prime
}\right)  \leq\dim\mathbf{A}$.

Furthermore, if we had $\dim\left(  \mathbf{A}^{\prime}\right)  =\dim
\mathbf{A}$, then Theorem \ref{thm.linalg.subset} \textbf{(b)} would yield
$\mathbf{A}=\mathbf{A}^{\prime}$ (since $\mathbf{A}^{\prime}$ is a subspace of
$\mathbf{A}$), which would contradict $\mathbf{A}^{\prime}\neq\mathbf{A}$.
Hence, $\dim\left(  \mathbf{A}^{\prime}\right)  \neq\dim\mathbf{A}$. Combined
with $\dim\left(  \mathbf{A}^{\prime}\right)  \leq\dim\mathbf{A}$, this yields
$\dim\left(  \mathbf{A}^{\prime}\right)  <\dim\mathbf{A}$, so that
$\dim\left(  \mathbf{A}^{\prime}\right)  \leq\dim\mathbf{A}-1$.

Now, let us show that $\dim\left(  \mathbf{A}^{\prime}\right)  \geq
\dim\mathbf{A}-1$ as well. Indeed, choose any basis $\left(  u_{1}%
,u_{2},\ldots,u_{k}\right)  $ of $\mathbf{A}^{\prime}$; thus, $\dim\left(
\mathbf{A}^{\prime}\right)  =k$. Then, the $k+1$ vectors $u_{1},u_{2}%
,\ldots,u_{k},a_{1}$ span the vector space $\mathbf{A}$ (this is easy to
see\footnote{\textit{Proof.} Let $i\in\left\{  1,2,\ldots,p\right\}  $. Then,
$a_{i}-a_{1}\in\mathbf{A}^{\prime}$ (since $\mathbf{A}^{\prime}$ was defined
as the span of $p$ vectors, one of which is $a_{i}-a_{1}$). Thus, $a_{i}%
-a_{1}\in\mathbf{A}^{\prime}=\operatorname*{span}\left\{  u_{1},u_{2}%
,\ldots,u_{k}\right\}  $ (since $\left(  u_{1},u_{2},\ldots,u_{k}\right)  $ is
a basis of $\mathbf{A}^{\prime}$). In other words, $a_{i}-a_{1}$ is a linear
combination of $u_{1},u_{2},\ldots,u_{k}$. That is, there exist coefficients
$c_{1},c_{2},\ldots,c_{k}\in\mathbb{F}_{2}$ satisfying $a_{i}-a_{1}=c_{1}%
u_{1}+c_{2}u_{2}+\cdots+c_{k}u_{k}$. Consider these $c_{1},c_{2},\ldots,c_{k}%
$. Solving $a_{i}-a_{1}=c_{1}u_{1}+c_{2}u_{2}+\cdots+c_{k}u_{k}$ for $a_{i}$,
we find%
\[
a_{i}=c_{1}u_{1}+c_{2}u_{2}+\cdots+c_{k}u_{k}+a_{1}\in\operatorname*{span}%
\left\{  u_{1},u_{2},\ldots,u_{k},a_{1}\right\}  .
\]
\par
Forget that we fixed $i$. We thus have shown that $a_{i}\in
\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k},a_{1}\right\}  $ for
each $i\in\left\{  1,2,\ldots,p\right\}  $. In other words, each of the $p$
vectors $a_{1},a_{2},\ldots,a_{p}$ belongs to $\operatorname*{span}\left\{
u_{1},u_{2},\ldots,u_{k},a_{1}\right\}  $. Hence, any linear combination of
these $p$ vectors also belongs to $\operatorname*{span}\left\{  u_{1}%
,u_{2},\ldots,u_{k},a_{1}\right\}  $ (since $\operatorname*{span}\left\{
u_{1},u_{2},\ldots,u_{k},a_{1}\right\}  $ is a subspace of $\mathbb{F}_{2}%
^{n}$ and thus is closed under linear combination). In other words,%
\[
\operatorname*{span}\left\{  a_{1},a_{2},\ldots,a_{p}\right\}  \subseteq
\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k},a_{1}\right\}  .
\]
Since $\mathbf{A}=\operatorname*{span}\left\{  a_{1},a_{2},\ldots
,a_{p}\right\}  $, we can rewrite this as%
\begin{equation}
\mathbf{A}\subseteq\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k}%
,a_{1}\right\}  . \label{sol.linalg.F2.AB.c3.pf.fn.4}%
\end{equation}
On the other hand, the vectors $u_{1},u_{2},\ldots,u_{k}$ belong to
$\mathbf{A}^{\prime}$ and thus to $\mathbf{A}$ (since $\mathbf{A}^{\prime
}\subseteq\mathbf{A}$). The vector $a_{1}$ belongs to $\mathbf{A}$ as well.
Hence, all $k+1$ vectors $u_{1},u_{2},\ldots,u_{k},a_{1}$ belong to
$\mathbf{A}$. Their linear combinations must therefore belong to $\mathbf{A}$
as well (since $\mathbf{A}$ is a subspace of $\mathbb{F}_{2}^{n}$ and thus is
closed under linear combination). In other words,%
\[
\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k},a_{1}\right\}
\subseteq\mathbf{A}.
\]
Combining this with (\ref{sol.linalg.F2.AB.c3.pf.fn.4}), we find
$\mathbf{A}=\operatorname*{span}\left\{  u_{1},u_{2},\ldots,u_{k}%
,a_{1}\right\}  $. In other words, the $k+1$ vectors $u_{1},u_{2},\ldots
,u_{k},a_{1}$ span the vector space $\mathbf{A}$.}). According to Theorem
\ref{thm.linalg.php.1} \textbf{(c)} (applied to $k+1$ and $\dim\mathbf{A}$
instead of $k$ and $n$), this would be impossible if $k+1$ was smaller than
$\dim\mathbf{A}$. Thus, $k+1\geq\dim\mathbf{A}$. Hence, $k\geq\dim
\mathbf{A}-1$. Since $\dim\left(  \mathbf{A}^{\prime}\right)  =k$, this
rewrites as $\dim\left(  \mathbf{A}^{\prime}\right)  \geq\dim\mathbf{A}-1$.
Combining this with $\dim\left(  \mathbf{A}^{\prime}\right)  \leq
\dim\mathbf{A}-1$, we obtain $\dim\left(  \mathbf{A}^{\prime}\right)
=\dim\mathbf{A}-1$. This proves Claim 3.
\end{proof}

Now, let us set $\alpha:=\dim\left(  \mathbf{A}^{\prime}\right)  $ and
$\beta:=\dim\left(  \mathbf{B}^{\prime}\right)  $. Thus, we can rewrite
(\ref{sol.linalg.F2.AB.dimA'}) as $\alpha=\dim\mathbf{A}-1$. Hence,
$\dim\mathbf{A}=\alpha+1$. Similarly, $\dim\mathbf{B}=\beta+1$. But Claim 2
yields $\mathbf{A}^{\prime}\subseteq\mathbf{B}^{\perp}$, so that
$\mathbf{A}^{\prime}$ is a subspace of $\mathbf{B}^{\perp}$. Thus, by Theorem
\ref{thm.linalg.subset} \textbf{(a)}, we obtain $\dim\left(  \mathbf{A}%
^{\prime}\right)  \leq\dim\left(  \mathbf{B}^{\perp}\right)  $. However,
Theorem \ref{thm.linalg.perp.main} \textbf{(c)} (applied to $\mathbb{F}%
=\mathbb{F}_{2}$ and $U=\mathbf{B}$) yields
\[
\dim\mathbf{B}+\dim\left(  \mathbf{B}^{\perp}\right)  =n.
\]
Hence, $\dim\left(  \mathbf{B}^{\perp}\right)  =n-\underbrace{\dim\mathbf{B}%
}_{=\beta+1}=n-\left(  \beta+1\right)  $. Thus,%
\[
\alpha=\dim\left(  \mathbf{A}^{\prime}\right)  \leq\dim\left(  \mathbf{B}%
^{\perp}\right)  =n-\left(  \beta+1\right)  ,
\]
so that $\alpha+\beta+1\leq n$. In other words, $\alpha+\beta\leq n-1$.

Next, we recall that the $p$ vectors $a_{1},a_{2},\ldots,a_{p}$ are distinct.
In other words, the $p$ vectors $a_{i}$ for all $i\in\left\{  1,2,\ldots
,p\right\}  $ are distinct. Hence, the $p$ vectors $a_{i}-a_{1}$ for all
$i\in\left\{  1,2,\ldots,p\right\}  $ are distinct as well (since subtracting
$a_{1}$ from a bunch of vectors does not disturb their distinctness). Since
all these $p$ vectors belong to $\mathbf{A}^{\prime}$, we thus conclude that
the set $\mathbf{A}^{\prime}$ has at least $p$ elements. In other words,
$\left\vert \mathbf{A}^{\prime}\right\vert \geq p$. On the other hand,
$\mathbf{A}^{\prime}$ is an $\alpha$-dimensional vector space (since
$\dim\left(  \mathbf{A}^{\prime}\right)  =\alpha$). Hence, Proposition
\ref{prop.linalg.F2.size} (applied to $\alpha$ and $\mathbf{A}^{\prime}$
instead of $n$ and $V$) yields $\left\vert \mathbf{A}^{\prime}\right\vert
=2^{\alpha}$. Thus, $2^{\alpha}=\left\vert \mathbf{A}^{\prime}\right\vert \geq
p$, so that $p\leq2^{\alpha}$. Similarly, $q\leq2^{\beta}$.

We have now found two integers $\alpha\in\mathbb{N}$ and $\beta\in\mathbb{N}$
such that $\alpha+\beta\leq n-1$ and $p\leq2^{\alpha}$ and $q\leq2^{\beta}$.
Thus, two such integers exist. This solves Exercise \ref{exe.linalg.F2.AB}
\textbf{(a)}. \medskip

\textbf{(b)} Multiplying the equalities $p\leq2^{\alpha}$ and $q\leq2^{\beta}%
$, we obtain $pq\leq2^{\alpha}\cdot2^{\beta}=2^{\alpha+\beta}\leq2^{n-1}$
(since $\alpha+\beta\leq n-1$). This solves Exercise \ref{exe.linalg.F2.AB}
\textbf{(b)}.
\end{proof}

Using Exercise \ref{exe.linalg.F2.AB}, we can now easily solve the remaining
two of the four Oddtown/Eventown theorems:

\begin{exercise}
\label{exe.linalg.F2.odd-odd}Let $n,m\in\mathbb{N}$. In a town with $n$
inhabitants, there are $m$ clubs, each of which has an odd number of members.
Any two distinct clubs share an odd number of common members. No two distinct
clubs have the exact same set of members. Prove that $m\leq2^{\left\lfloor
\left(  n-1\right)  /2\right\rfloor }$.
\end{exercise}

\begin{proof}
[Solution idea.]Let $S$ be the set of all the $n$ inhabitants. Let
$A_{1},A_{2},\ldots,A_{m}$ be the $m$ clubs (regarded as subsets of $S$). Let
$B_{1},B_{2},\ldots,B_{m}$ be the same $m$ clubs, listed once again. Then, the
$m$ subsets $A_{1},A_{2},\ldots,A_{m}$ are distinct (since no two distinct
clubs have the exact same set of members). Similarly, the $m$ subsets
$B_{1},B_{2},\ldots,B_{m}$ are distinct.

Moreover, the number $\left\vert A_{i}\cap B_{j}\right\vert $ is odd for every
$i\in\left\{  1,2,\ldots,m\right\}  $ and $j\in\left\{  1,2,\ldots,m\right\}
$. (Indeed, either $A_{i}$ and $B_{j}$ are two different clubs, in which case
this follows from the assumption \textquotedblleft any two distinct clubs
share an odd number of common members\textquotedblright; or $A_{i}$ and
$B_{j}$ are the same club, in which case this follows from the assumption
\textquotedblleft each club has an odd number of members\textquotedblright.)

Thus, Exercise \ref{exe.linalg.F2.AB} \textbf{(a)} (applied to $p=m$ and
$q=m$) shows that there exists integers $\alpha\in\mathbb{N}$ and $\beta
\in\mathbb{N}$ such that $\alpha+\beta\leq n-1$ and $m\leq2^{\alpha}$ and
$m\leq2^{\beta}$. Consider these $\alpha$ and $\beta$.

WLOG assume that $\alpha\leq\beta$ (since otherwise, we can achieve this by
swapping $\alpha$ with $\beta$). Hence, $2\alpha=\alpha+\underbrace{\alpha
}_{\leq\beta}\leq\alpha+\beta\leq n-1$, so that $\alpha\leq\left(  n-1\right)
/2$. Since $\alpha$ is an integer, this entails $\alpha\leq\left\lfloor
\left(  n-1\right)  /2\right\rfloor $. Thus, $m\leq2^{\alpha}\leq
2^{\left\lfloor \left(  n-1\right)  /2\right\rfloor }$ (since $\alpha
\leq\left\lfloor \left(  n-1\right)  /2\right\rfloor $). This solves Exercise
\ref{exe.linalg.F2.odd-odd}.
\end{proof}

\begin{exercise}
\label{exe.linalg.F2.even-even}Let $n,m\in\mathbb{N}$. In a town with $n$
inhabitants, there are $m$ clubs, each of which has an even number of members.
Any two distinct clubs share an even number of common members. No two distinct
clubs have the exact same set of members. Prove that $m\leq2^{\left\lfloor
n/2\right\rfloor }$.
\end{exercise}

\begin{proof}
[Solution idea.]Invite an outsider to move into town and join every existing
club. Thus,

\begin{itemize}
\item the town now has $n+1$ inhabitants and $m$ clubs;

\item each club now has an odd number of members (since it had an even number
of members before the outsider joined);

\item any two distinct clubs now share an odd number of common members (since
they shared an even number of common members before the outsider joined them both);

\item no two distinct clubs have the exact same set of members (since this
held before the outsider joined).
\end{itemize}

Thus, we can apply Exercise \ref{exe.linalg.F2.odd-odd} to the new situation
(keeping in mind that we must substitute $n+1$ for $n$). We obtain
$m\leq2^{\left\lfloor \left(  \left(  n+1\right)  -1\right)  /2\right\rfloor
}=2^{\left\lfloor n/2\right\rfloor }$ (since $\left(  n+1\right)  -1=n$). This
solves Exercise \ref{exe.linalg.F2.even-even}.
\end{proof}

\begin{remark}
In both Exercise \ref{exe.linalg.F2.odd-odd} and Exercise
\ref{exe.linalg.F2.even-even}, the inequalities are sharp (i.e., equality is
possible). Let me show how to obtain $m=2^{\left\lfloor n/2\right\rfloor }$ in
Exercise \ref{exe.linalg.F2.even-even}:

Let the $n$ inhabitants be $1,2,\ldots,n$. Call a subset $T$ of $\left\{
1,2,\ldots,n\right\}  $ \emph{blocky} if it has the property that an odd
integer $i\in\left\{  1,2,\ldots,n\right\}  $ belongs to $T$ if and only if
$i+1$ belongs to $T$. (For example, for $n=5$, the blocky subsets are
$\varnothing$, $\left\{  1,2\right\}  $, $\left\{  3,4\right\}  $ and
$\left\{  1,2,3,4\right\}  $. The name \textquotedblleft
blocky\textquotedblright\ comes from the fact that the pairs $\left(
1,2\right)  $, $\left(  3,4\right)  $, $\left(  5,6\right)  $, $\ldots$ are
treated as \textquotedblleft blocks\textquotedblright, with each block either
completely included in or completely excluded from the subset.)

There are $2^{\left\lfloor n/2\right\rfloor }$ blocky subsets of $\left\{
1,2,\ldots,n\right\}  $ (why?). If we use these blocky subsets as clubs, then
the conditions of Exercise \ref{exe.linalg.F2.even-even} are satisfied (why?),
and we have $m=2^{\left\lfloor n/2\right\rfloor }$.

Constructing a similar example for equality in Exercise
\ref{exe.linalg.F2.odd-odd} is left as an exercise.
\end{remark}

See \cite{BabFra23} and \cite[\S 13.2 and Exercises]{Stanle18} for further
results on and variants of Eventown/Oddtown as well as other combinatorial
questions that can be resolved using linear algebra over finite fields.

Further applications of linear algebra can be found in \cite[Chapter
12]{AndDos} and \cite[Chapter 12]{AndDosS}.

\subsection{Class problems}

The following problems are to be discussed during class.

\begin{exercise}
\label{exe.matrix.fib}Recall the Fibonacci sequence $\left(  f_{0},f_{1}%
,f_{2},\ldots\right)  $, defined recursively by%
\[
f_{0}=0,\ \ \ \ \ \ \ \ \ \ f_{1}=1,\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ f_{n}=f_{n-1}+f_{n-2}\text{ for all }n\geq2.
\]
We furthermore set $f_{-1}:=1$ (so that the equality $f_{n}=f_{n-1}+f_{n-2}$
also holds for $n=1$).

Let $A$ be the $2\times2$-matrix $%
\begin{pmatrix}
0 & 1\\
1 & 1
\end{pmatrix}
$.

\begin{enumerate}
\item[\textbf{(a)}] Prove that $A^{n}=f_{n}A+f_{n-1}I_{2}$ for all
$n\in\mathbb{N}$. (Here, $I_{2}$ denotes the $2\times2$ identity matrix.)

\item[\textbf{(b)}] Prove that $f_{n+m+1}=f_{n}f_{m}+f_{n+1}f_{m+1}$ for all
$n,m\in\mathbb{N}$. (This was Exercise 1.1.1 \textbf{(c)} on Worksheet 1.)

\item[\textbf{(c)}] Prove that $f_{n+1}f_{n-1}-f_{n}^{2}=\left(  -1\right)
^{n}$ for each positive integer $n$. (This was Exercise 1.1.1 \textbf{(b)} on
Worksheet 1.)

\item[\textbf{(d)}] Let $v$ be the column vector $\left(
\begin{array}
[c]{c}%
0\\
1
\end{array}
\right)  $. Prove that $A^{n}v=\left(
\begin{array}
[c]{c}%
f_{n}\\
f_{n+1}%
\end{array}
\right)  $ for each $n\in\mathbb{N}$.

\item[\textbf{(e)}] Let $n,p\in\mathbb{N}$. Prove that%
\[
\sum_{k=0}^{n}\dbinom{n}{k}f_{k+p}=f_{p+2n}.
\]


\item[\textbf{(f)}] Let $n,p\in\mathbb{N}$ be such that $p\geq n$. Prove that
\[
\sum_{k=0}^{n}\left(  -1\right)  ^{k}\dbinom{n}{k}f_{k+p}=\left(  -1\right)
^{n}f_{p-n}.
\]

\end{enumerate}

[\textbf{Hint:} For part \textbf{(e)}, take the equality $A^{2}=A+I_{2}$ to
the $n$-th power and expand the right hand side using the binomial formula.]
\end{exercise}

\begin{exercise}
\label{exe.det.vander.hyperfac-pf}Let $n\in\mathbb{N}$. Let $a_{1}%
,a_{2},\ldots,a_{n}$ be $n$ numbers (or, more generally, elements of a field
$\mathbb{F}$). Let $p_{1},p_{2},\ldots,p_{n}$ be $n$ polynomials in
$\mathbb{R}\left[  X\right]  $ (more generally, in $\mathbb{F}\left[
X\right]  $ where $\mathbb{F}$ is our field) with the property that%
\[
\deg\left(  p_{j}\right)  \leq j-1\ \ \ \ \ \ \ \ \ \ \text{for each }%
j\in\left\{  1,2,\ldots,n\right\}  .
\]
(In particular, $p_{1}$ is constant.)

\begin{enumerate}
\item[\textbf{(a)}] Prove that
\[
\det\left(  \left(  p_{j}\left(  a_{i}\right)  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}\right)  =\left(  \prod_{j=1}^{n}\left[  X^{j-1}\right]
\left(  p_{j}\right)  \right)  \cdot\det\left(  \left(  a_{i}^{j-1}\right)
_{1\leq i\leq n,\ 1\leq j\leq n}\right)  .
\]
(Recall that $\left[  X^{k}\right]  p$ means the $X^{k}$-coefficient of a
polynomial $p$.)

\item[\textbf{(b)}] Prove that%
\[
\det\left(  \left(  a_{i}^{j-1}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}\right)  =\prod_{1\leq j<i\leq n}\left(  a_{i}-a_{j}\right)  .
\]
(This is known as the \emph{Vandermonde determinant}.)

\item[\textbf{(c)}] Conclude that%
\[
\det\left(  \left(  p_{j}\left(  a_{i}\right)  \right)  _{1\leq i\leq
n,\ 1\leq j\leq n}\right)  =\left(  \prod_{j=1}^{n}\left[  X^{j-1}\right]
p_{j}\right)  \cdot\prod_{1\leq j<i\leq n}\left(  a_{i}-a_{j}\right)  .
\]


\item[\textbf{(d)}] Prove that
\[
\det\left(  \left(  \dbinom{a_{i}}{j-1}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}\right)  =\dfrac{\prod_{1\leq j<i\leq n}\left(  a_{i}-a_{j}\right)  }%
{\prod_{1\leq j<i\leq n}\left(  i-j\right)  }.
\]
(Here, $\dbinom{a_{i}}{j-1}$ is a binomial coefficient, not a column vector.)
\end{enumerate}

[\textbf{Hint:} Part \textbf{(a)} can be done in many ways, but the simplest
is probably by factoring the matrix $\left(  p_{j}\left(  a_{i}\right)
\right)  _{1\leq i\leq n,\ 1\leq j\leq n}$ as a product of two matrices. To
prove part \textbf{(b)}, apply part \textbf{(a)} to $n$ special polynomials
$p_{1},p_{2},\ldots,p_{n}$, chosen strategically to make the matrix $\left(
p_{j}\left(  a_{i}\right)  \right)  _{1\leq i\leq n,\ 1\leq j\leq n}$
triangular. This is the nicest proof of the Vandermonde determinant, in my
opinion, but there are many others that are not much worse.]
\end{exercise}

\begin{exercise}
Let $n\in\mathbb{N}$. Let $a_{1},a_{2},\ldots,a_{n}$ be $n$ integers. Prove
that%
\[
\prod_{1\leq i<j\leq n}\left(  j-i\right)  \mid\prod_{1\leq i<j\leq n}\left(
a_{j}-a_{i}\right)  .
\]

\end{exercise}

\begin{exercise}
You are given a row of $2023$ lamps, each of which is either on or off. To
\textquotedblleft flip\textquotedblright\ a lamp means to change its state
(i.e., turn it on if it was off and turn it off if it was on).

You have a tool that can flip $50$ consecutive lamps on the row; but the tool
can only be applied when the leftmost of these $50$ lamps is on. (So you can
choose any lamp that is on and has at least $49$ further lamps to its right;
then the tool turns it off and flips the next $49$ lamps to its right.) You
can use this tool as often as you want.

Prove the following:

\begin{enumerate}
\item[\textbf{(a)}] No matter how you use this tool, you will eventually run
into a state where it can no longer be used (i.e., all lamps that have at
least $49$ lamps to their right are off).

\item[\textbf{(b)}] This final state does not depend on the choices you made
(i.e., how you applied the tool), but only on the initial state.
\end{enumerate}
\end{exercise}

\begin{exercise}
A complex number $z\in\mathbb{C}$ is said to be \emph{algebraic} if there
exists a nonzero polynomial $P\in\mathbb{Q}\left[  X\right]  $ (yes, a
polynomial with rational coefficients) such that $z$ is a root of $P$. (For
instance, $\sqrt{2}$ and $\sqrt[3]{15}$ and all roots of $X^{5}-7X-1$ are algebraic.)

Let $u$ and $v$ be two algebraic complex numbers. Prove that the numbers $u+v$
and $uv$ are algebraic as well. \medskip

[\textbf{Hint:} Let $P\in\mathbb{Q}\left[  X\right]  $ and $Q\in
\mathbb{Q}\left[  X\right]  $ be nonzero polynomials satisfying $P\left(
u\right)  =0$ and $Q\left(  v\right)  =0$, and let $n=\deg P$ and $m=\deg Q$
be their degrees. Now use linear algebra over $\mathbb{Q}$, treating
$\mathbb{C}$ as an (infinite-dimensional) vector space over $\mathbb{Q}$. Let
$W$ be the vector subspace of $\mathbb{C}$ spanned by all the $nm$ products of
the form $u^{i}v^{j}$ with $i\in\left\{  0,1,\ldots,n-1\right\}  $ and
$j\in\left\{  0,1,\ldots,m-1\right\}  $ over $\mathbb{Q}$ (that is, the
elements of $W$ are the $\mathbb{Q}$-linear combinations of these products).
Prove that $W$ is preserved under multiplication by $u$ and by $v$ (meaning
that if $x\in W$, then $ux\in W$ and $vx\in W$). Conclude that the $nm+1$
powers%
\[
\left(  u+v\right)  ^{0},\ \ \left(  u+v\right)  ^{1},\ \ \ldots,\ \ \left(
u+v\right)  ^{nm}%
\]
all belong to $W$. What now?]
\end{exercise}

\subsection{Homework exercises}

This homework set is optional and not to be graded.

\begin{exercise}
\label{exe.linalg.php.lind2}Let $n\in\mathbb{N}$. Let $S$ be an $n$-element
set. Let $A_{1},A_{2},\ldots,A_{n+2}$ be $n+2$ subsets of $S$. Prove that
there exist two disjoint nonempty subsets $I$ and $J$ of $\left\{
1,2,\ldots,n+2\right\}  $ such that%
\[
\bigcup_{i\in I}A_{i}=\bigcup_{i\in J}A_{i}\ \ \ \ \ \ \ \ \ \ \text{and}%
\ \ \ \ \ \ \ \ \ \ \bigcap_{i\in I}A_{i}=\bigcap_{i\in J}A_{i}.
\]


[\textbf{Hint:} Append an extra $1$ at the end of each indicator vector.]
\end{exercise}

\begin{exercise}
\label{exe.linalg.aig-zie-9-3}Let $n>1$ be an integer. Let $S$ be an
$n$-element set. Let $d$ be a positive integer.

Let $A_{1},A_{2},\ldots,A_{m}$ be some proper subsets of $S$. Assume that
every $2$-element subset of $S$ is contained (as a subset) in exactly $d$ many
of these subsets $A_{1},A_{2},\ldots,A_{m}$.

Prove that $m\geq n$.
\end{exercise}

\begin{exercise}
Let $a_{1},a_{2},\ldots,a_{n}$ be $n$ numbers (or, more generally, elements of
a field). Compute%
\[
\det\left(  \left(  a_{\min\left\{  i,j\right\}  }\right)  _{1\leq i\leq
n,\ 1\leq j\leq n}\right)  =\det\left(
\begin{array}
[c]{ccccc}%
a_{1} & a_{1} & a_{1} & \cdots & a_{1}\\
a_{1} & a_{2} & a_{2} & \cdots & a_{2}\\
a_{1} & a_{2} & a_{3} & \cdots & a_{3}\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a_{1} & a_{2} & a_{3} & \cdots & a_{n}%
\end{array}
\right)  .
\]

\end{exercise}

\begin{exercise}
Let $\alpha_{1},\alpha_{2},\ldots,\alpha_{n},\beta_{1},\beta_{2},\ldots
,\beta_{n}$ be $2n$ reals.

\begin{enumerate}
\item[\textbf{(a)}] Compute
\[
\det\left(  \left(  \alpha_{i}+\beta_{j}\right)  _{1\leq i\leq n,\ 1\leq j\leq
n}\right)  =\det\left(
\begin{array}
[c]{cccc}%
\alpha_{1}+\beta_{1} & \alpha_{1}+\beta_{2} & \cdots & \alpha_{1}+\beta_{n}\\
\alpha_{2}+\beta_{1} & \alpha_{2}+\beta_{2} & \cdots & \alpha_{2}+\beta_{n}\\
\vdots & \vdots & \ddots & \vdots\\
\alpha_{n}+\beta_{1} & \alpha_{n}+\beta_{2} & \cdots & \alpha_{n}+\beta_{n}%
\end{array}
\right)  .
\]


\item[\textbf{(b)}] Compute%
\begin{align*}
&  \det\left(  \left(  \sin\left(  \alpha_{i}+\beta_{j}\right)  \right)
_{1\leq i\leq n,\ 1\leq j\leq n}\right) \\
&  =\det\left(
\begin{array}
[c]{cccc}%
\sin\left(  \alpha_{1}+\beta_{1}\right)  & \sin\left(  \alpha_{1}+\beta
_{2}\right)  & \cdots & \sin\left(  \alpha_{1}+\beta_{n}\right) \\
\sin\left(  \alpha_{2}+\beta_{1}\right)  & \sin\left(  \alpha_{2}+\beta
_{2}\right)  & \cdots & \sin\left(  \alpha_{2}+\beta_{n}\right) \\
\vdots & \vdots & \ddots & \vdots\\
\sin\left(  \alpha_{n}+\beta_{1}\right)  & \sin\left(  \alpha_{n}+\beta
_{2}\right)  & \cdots & \sin\left(  \alpha_{n}+\beta_{n}\right)
\end{array}
\right)  .
\end{align*}

\end{enumerate}

[\textbf{Hint:} The cases $n\leq2$ might be somewhat misleading...]
\end{exercise}

\begin{exercise}
Let $n\in\mathbb{N}$, and let $a$ and $b$ be two numbers. Prove that%
\[
\det\underbrace{\left(
\begin{array}
[c]{ccccc}%
b & -a & -a & \cdots & -a\\
a & b & -a & \cdots & -a\\
a & a & b & \cdots & -a\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a & a & a & \cdots & b
\end{array}
\right)  }_{n\times n\text{-matrix}}=\dfrac{\left(  b+a\right)  ^{n}+\left(
b-a\right)  ^{n}}{2}.
\]
(Here, all entries below the diagonal are $a$'s; all entries on the diagonal
are $b$'s; all entries above the diagonal are $-a$'s.)
\end{exercise}

\begin{exercise}
Let
\[
A=\left(  a_{i,j}\right)  _{1\leq i\leq n,\ 1\leq j\leq n}=\left(
\begin{array}
[c]{cccc}%
a_{1,1} & a_{1,2} & \cdots & a_{1,n}\\
a_{2,1} & a_{2,2} & \cdots & a_{2,n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n,1} & a_{n,2} & \cdots & a_{n,n}%
\end{array}
\right)
\]
be an $n\times n$-matrix with real entries. Assume that%
\[
a_{i,i}\geq\sum_{\substack{j\in\left\{  1,2,\ldots,n\right\}  ;\\j\neq
i}}\left\vert a_{i,j}\right\vert \ \ \ \ \ \ \ \ \ \ \text{for each }%
i\in\left\{  1,2,\ldots,n\right\}  .
\]
(Such a matrix $A$ is said to be \emph{weakly diagonally dominant}.) Prove
that%
\[
\det A\geq\prod_{i=1}^{n}\left(  a_{i,i}-\sum_{j=i+1}^{n}\left\vert
a_{i,j}\right\vert \right)  .
\]

\end{exercise}

\begin{noncompile}
https://artofproblemsolving.com/community/c7h176225p1201606
\end{noncompile}

The following exercise is a generalization of Exercise
\ref{exe.linalg.F2.odd-even}:

\begin{exercise}
\label{exe.linalg.Fp.odd-even}Let $p$ be a prime number.

Let $n,m\in\mathbb{N}$. In a town with $n$ inhabitants, there are $m$ clubs,
each of which has a number of members that is not divisible by $p$. Any two
distinct clubs have a number of common members that is divisible by $p$. Prove
that $m\leq n$.
\end{exercise}

We note that a similar generalization of Exercise \ref{exe.linalg.F2.even-odd}
does not work, as (e.g.) the example of $p=3$ and $n=5$ and $m=\dbinom{5}%
{3}=10$ shows (here, each three inhabitants form a club).

\begin{exercise}
An ornithological handbook classifies birds by $100$ attributes; each bird
either has a given attribute or does not have it. Two birds are said to be
\emph{dissimilar} if they differ in at least $51$ attributes.

\begin{enumerate}
\item[\textbf{(a)}] Show that the handbook cannot contain $51$ birds all
dissimilar from each other.

\item[\textbf{(b)}] (harder:) Can it contain $50$ such birds?
\end{enumerate}

\begin{minipage}{.9\linewidth}
\begin{flushright}
(Tournament of Towns 14.42)
\end{flushright}
\end{minipage} \medskip

[\textbf{Hint:} In part \textbf{(a)}, you can replace $100$ and $51$ by $2n$
and $n+1$, respectively, where $n$ is an even integer. In part \textbf{(b)},
you can replace $50$ by $n$, but you must additionally require that $n>4$.]
\end{exercise}

\begin{exercise}
Let $n,m\in\mathbb{N}$. In a town with $n$ inhabitants, there are $m$ red
clubs $R_{1},R_{2},\ldots,R_{m}$ and $m$ blue clubs $B_{1},B_{2},\ldots,B_{m}%
$. Assume that $\left\vert R_{i}\cap B_{i}\right\vert $ is odd for each
$i\in\left\{  1,2,\ldots,m\right\}  $. Assume further that $\left\vert
R_{i}\cap B_{j}\right\vert $ is even for each $i,j\in\left\{  1,2,\ldots
,m\right\}  $ satisfying $i<j$. Prove that $m\leq n$.
\end{exercise}

\begin{exercise}
\label{exe.linalg.F2.even-even-kl}Let $n,b,r\in\mathbb{N}$. In a town with $n$
inhabitants, there are $r$ red clubs and $b$ blue clubs. Each red club has an
even number of members, whereas each blue club has an odd number of members.
Any two distinct clubs (no matter their color) share an even number of common
members. No two distinct clubs have the exact same set of members. Prove that
$r\leq2^{\left\lfloor \left(  n-b\right)  /2\right\rfloor }$.
\end{exercise}

\bigskip

\begin{thebibliography}{999999999}                                                                                        %


\bibitem[Aluffi21]{Aluffi21}Paolo Aluffi, \textit{Algebra: Notes from the
Underground}, Cambridge University Press 2021.

\bibitem[AndDos10]{AndDos}\href{https://bookstore.ams.org/xyz-13}{Titu
Andreescu, Gabriel Dospinescu, \textit{Problems from the Book}, 2nd edition,
XYZ Press 2010}.

\bibitem[AndDos12]{AndDosS}\href{https://bookstore.ams.org/xyz-6}{Titu
Andreescu, Gabriel Dospinescu, \textit{Straight from the Book}, XYZ Press
2012}.

\bibitem[Axler23]{Axler23}\href{https://linear.axler.net/}{Sheldon Axler,
\textit{Linear Algebra Done Right}, 4th edition, Springer 2023.}

\bibitem[BabFra23]{BabFra23}L\'{a}szl\'{o} Babai, P\'{e}ter Frankl,
\textit{Linear algebra methods in combinatorics}, 7 January 2023.\newline\url{https://people.cs.uchicago.edu/~laci/babai-frankl-book2022.pdf}

\bibitem[Bollob10]{Bollob10}%
\href{https://doi.org/10.1017/CBO9780511816574}{B\'{e}la Bollob\'{a}s,
\textit{The Art of Mathematics: Coffee Time in Memphis}, Cambridge University
Press 2010.}

\bibitem[Bollob22]{Bollob22}%
\href{https://doi.org/10.1017/9781108973885}{B\'{e}la Bollob\'{a}s,
\textit{The Art of Mathematics -- Take Two: Tea Time in Cambridge}, Cambridge
University Press 2022.}

\bibitem[Camero08]{Camero08}Peter J. Cameron, \textit{Notes on Linear
Algebra}, 2008.\newline\url{https://cameroncounts.files.wordpress.com/2013/11/linalg.pdf}

\bibitem[GelAnd17]{GelAnd17}%
\href{https://doi.org/10.1007/978-3-319-58988-6}{R\u{a}zvan Gelca, Titu
Andreescu, \textit{Putnam and Beyond}, 2nd edition, Springer 2017.}

\bibitem[Griffin20]{Griffin20}Christopher Griffin, \textit{Intermediate Linear
Algebra}, Version 2.1, 13 December 2020.\newline\url{https://sites.psu.edu/griffinch/lecture_notes/}

\bibitem[Grinbe15]{detnotes}\href{https://arxiv.org/abs/2008.09862v3}{Darij
Grinberg, \textit{Notes on the combinatorial fundamentals of algebra}, 15
September 2022, arXiv:2008.09862v3.}

\bibitem[Grinbe18]{18s-hw4s}Darij Grinberg, \textit{Math 4707 Spring 2018
(Darij Grinberg): homework set 4 with solutions}.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/18s/hw4.pdf}

\bibitem[Grinbe20a]{20f}Darij Grinberg, \textit{Math 235: Mathematical Problem
Solving}, 10 August 2021.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/20f/mps.pdf}

\bibitem[Grinbe20b]{Gri-bilf}Darij Grinberg, \textit{A note on bilinear
forms}, July 9, 2020.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/algebra/bilf.pdf}

\bibitem[Grinbe21]{21s}Darij Grinberg, \textit{An Introduction to Algebraic
Combinatorics [Math 701, Spring 2021 lecture notes]}, 19 December
2022.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/21s/lecs.pdf}

\bibitem[Grinbe23a]{23wa}Darij Grinberg, \textit{An introduction to the
algebra of rings and fields (Text for Math 332 Winter 2023 at Drexel
University)}, 27 August 2023.\newline\url{https://www.cip.ifi.lmu.de/~grinberg/t/23wa/23wa.pdf}

\bibitem[Grinbe23b]{23s}\href{https://arxiv.org/abs/2308.04512v1}{Darij
Grinberg, \textit{An introduction to graph theory (Text for Math 53\textit{0}
in Spring 2022 at Drexel University)}, arXiv:2308.04512v1.}

\bibitem[Griffi20]{Griffi20}Christopher Griffin, \textit{Intermediate Linear
Algebra}, Version 2.1, 13 December 2020.\newline\url{https://sites.psu.edu/griffinch/lecture_notes/}

\bibitem[Kratte99]{Krattenthaler}%
\href{https://www.mat.univie.ac.at/~kratt/artikel/detsurv.html}{Christian
Krattenthaler, \textit{Advanced Determinant Calculus}, S\'{e}minaire
Lotharingien Combin. 42 (1999) (The Andrews Festschrift), paper B42q, 67 pp.},
\href{http://arxiv.org/abs/math/9902004v3}{arXiv:math/9902004v3}.

\bibitem[Kuttle22]{Kuttle22}Kenneth Kuttler, \textit{Elementary Linear
Algebra}, November 15, 2023.\newline\url{https://klkuttler.com/}

\bibitem[LaNaSc16]{LaNaSc16}Isaiah Lankham, Bruno Nachtergaele, Anne
Schilling, \textit{Linear Algebra As an Introduction to Abstract Mathematics},
2016.\newline\url{https://www.math.ucdavis.edu/~anne/linear_algebra/mat67_course_notes.pdf}

\bibitem[Prasol94]{Prasolov}%
\href{http://www2.math.su.se/~mleites/books/prasolov-1994-problems.pdf}{Viktor
V. Prasolov, \textit{Problems and Theorems in Linear Algebra}, Translations of
Mathematical Monographs, vol. \#134, AMS 1994}.

\bibitem[Stanle18]{Stanle18}%
\href{https://doi.org/10.1007/978-3-319-77173-1}{Richard P. Stanley,
\textit{Algebraic Combinatorics: Walks, Trees, Tableaux, and More}, 2nd
edition, Springer 2018}.\newline See
\url{http://www-math.mit.edu/~rstan/algcomb/index.html} for errata.

\bibitem[Steinb06]{Steinb06}Mark Steinberger, \textit{Algebra}, 31 August
2006.\newline\url{https://math.hawaii.edu/~tom/algebra.pdf}

\bibitem[StoLui18]{StoLui18}Michael Stoll, Ronald van Luijk, \textit{Linear
Algebra I}, 2 September 2018.\newline\url{https://websites.math.leidenuniv.nl/algebra/linalg1.pdf}

\bibitem[Strick21]{Strick21}Neil Strickland, \textit{Linear Mathematics for
Applications}, 11 February 2020.\newline\url{https://neilstrickland.github.io/linear_maths/}

\bibitem[Treil21]{Treil21}Serge Treil, \textit{Linear Algebra Done Wrong}, 11
January 2021.\newline\url{https://sites.google.com/a/brown.edu/sergei-treil-homepage/linear-algebra-done-wrong}

\bibitem[Zhao09]{Zhao09}Yufei Zhao, \textit{Determinants: Evaluation and
Manipulation}, September 22, 2009.\newline\url{https://yufeizhao.com/olympiad/det_eval_man.pdf}
\end{thebibliography}


\end{document}