% elemlinalgsign-aa
% https://docs.google.com/document/d/1JPkOo0V9ZHTIPlJJfmKzUCSebZ3WtEIv3t5ZnmTHpaQ/edit
% !TEX encoding = UTF-8 Unicode
% pdflatex makeindex pdflatex pdflatex
% pdflatex bibtex pdflatex pdflatex
% name of the bib file: refs.bib
\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsmath,amsthm} 
\usepackage[letterpaper,top=50pt,left=60pt,right=60pt,bottom=90pt]{geometry}
%\usepackage{imakeidx}
\usepackage{datetime}
\usepackage{fancyhdr}
\usepackage{microtype}
%\usepackage{graphicx}%https://www.johndcook.com/blog/2020/11/18/rotating-symbols-in-latex/ see also patch240105g
\usepackage{tikz-cd}
\usepackage{varwidth}
%\usepackage{tikz-cd}
%\usepackage{comment}
\usepackage[pdfusetitle]{hyperref}%\texorpdfstring{$\boldsymbol{\tau_2}$}{tau2}
\usepackage{marvosym}% emoji
\setlength{\parskip}{5pt} % variable
%\renewcommand{\baselinestretch}{1.2} % variable
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{{\tiny elemlinalgsign-aa,\ \today,\ \currenttime}}
\pagestyle{fancy}
%\pagestyle{empty}
\newtheorem{thm}{Theorem}%[section]
%\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
%\theoremstyle{definition}
%\newtheorem{conv}[thm]{Convention}
%\newtheorem{set}[thm]{Setting}
%\newtheorem{dfn}[thm]{Definition}
\newcommand{\noi}{\noindent}
\begin{document}% \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge
\begin{center}
{\LARGE The dimension of a finitely generated vector space}\bigskip\\ Pierre-Yves Gaillard\footnote{ORCID https://orcid.org/0000-0002-7960-1698} 
\end{center} 

There are, in the literature and on the web, hundreds (if not thousands) of proofs of the fact that the dimension of a finitely generated vector space is a well defined invariant. We give a short proof of this fact. 

Let $V$ be a $K$-vector space, and $S$ a finite subset of $V$. We define the subspace \emph{generated} (or \emph{spanned}) by $S$ in the usual way. We also define the condition that $S$ is \emph{linearly dependent} in the usual way. We say that $V$ is \emph{finitely generated} if it is generated by a finite subset, and we assume that such is the case. We define a \emph{basis} of $V$ as a (finite) linearly independent generating subset. Our aim is to prove: 

\begin{thm}\label{T1}
Any finitely generated $K$-vector space admits a basis, and any two such basis have the same cardinality. 
\end{thm} 

Theorem~\ref{T1} will follow from Propositions \ref{P2} and \ref{P3} below. 

\begin{prop}\label{P2}
Let $V$ be a $K$-vector space, and let $F$ and $G$ be two finite subsets of $V$ such that $F$ is linearly independent, $G$ generates $V$, and $F\subset G$. Let $B$ be also a subset of $V$. (We think of $F$ and $G$ as being ``fixed'', and $B$ being ``variable''.) 

\noi\emph{(a)} Assume that $F\subset B\subset G$, that $B$ is linearly independent, and that $B$ is maximal for these two conditions, then $B$ generates $V$. 

\noi\emph{(b)} Assume that $F\subset B\subset G$, that $B$ generates $V$, and that $B$ is minimal for these two conditions, then $B$ is linearly independent. 
\end{prop} 

(The notation $F$ is supposed to suggest the word ``free''.) Proposition~\ref{P2} will follow from Lemmas \ref{basic1} and \ref{basic2} below. 

\begin{prop}\label{P3}
Let $V$ be a $K$-vector space, let $G$ be a generating subset of $V$ of finite cardinality $n\ge0$, and let $S$ be a subset of $V$ of finite cardinality $m>n$. Then $S$ is linearly dependent. 
\end{prop} 

It only remains to prove Propositions \ref{P2} and \ref{P3}. If $S$ is a finite subset of a vector space $V$, we denote by $\langle S\rangle$ the subspace spanned by $S$. The following ``high school algebra fact'' will be freely used: 

\noi(\Smiley{}) Let $n$ be an integer $\ge2$ and let $v_1,\ldots,v_n$ be vectors in $V$. Then 
$$
\langle v_2,\ldots,v_n\rangle=\langle v_1,v_2,\ldots,v_n\rangle\iff v_1\in\langle v_2,\ldots,v_n\rangle
$$ 
$$
\iff\text{there is a linear relation }\sum_{i=1}^n\lambda_i\,v_i=0\text{ with }\lambda_1\ne0. 
$$

\begin{lem}\label{basic1}
Let $S$ be a finite linearly independent subset of a vector space $V$, and let $v$ be in $V\setminus\langle S\rangle$. Then $S\cup\{v\}$ is again linearly independent. 
\end{lem} 

\begin{proof}
Let $v_1,\ldots,v_n$ (with $n\ge0$) be the distinct elements of $S$. If $S\cup\{v\}$ was linearly dependent we would get $\lambda v+\sum\lambda_i\,v_i=0$ with $(\lambda,\lambda_1,\ldots,\lambda_n)\ne(0,\ldots,0)$. This would imply $\lambda\ne0$, and thus $v\in\langle S\rangle$ by (\Smiley{}). 
\end{proof} 

\begin{lem}\label{basic2}
If $G$ is a finite nonempty linearly dependent generating subset of a vector space $V$, then there is a $g$ in $G$ such $G\setminus\{g\}$ is again generating. 
\end{lem} 

\begin{proof}
Let $g_1,\ldots,g_n$ (with $n\ge1$) be the distinct elements of $G$. We have $\sum\lambda_i\,g_i=0$ for some $(\lambda_1,\ldots,\lambda_n)\ne(0,\ldots,0)$. We may assume $\lambda_n\ne0$. Then $g_n$ is a linear combination of $g_1,\ldots,g_{n-1}$ by (\Smiley{}), and, thus, so is any vector in $V$. 
\end{proof} 

\begin{proof}[Proof of Proposition~\ref{P3}] 
Writing $|X|$ for the cardinality of $X$, we assume by contradiction that $F$ and $G$ are two finite subsets of $V$ such that $F$ is linearly independent, $G$ is generating, and we have $|F|=m>n=|G|$. We can assume that $k:=|F\cap G|$ is maximum among \emph{all} couples $(F',G')$ of subsets of $V$ such that $|F'|=m,|G'|=n$, $F'$ is linearly independent and $G'$ spans $V$. We clearly have $k<n$ (indeed, $k=n$ would imply that $f_m$ is a linear combination of $f_1,\ldots,f_k$, contradicting the linear independence of the $f_i$). Set 
$$
F=\{f_1,\ldots,f_k,\ldots,f_n,\ldots,f_m\},\quad G=\{g_1,\ldots,g_k,\ldots,g_n\},
$$ 
with $f_1=g_1,\ldots,f_k=g_k$. Since $G$ spans $V$, we have $f_m=\sum_{i=1}^n\lambda_i\,g_i$, or equivalently 
\begin{equation}\label{Efp}
-f_m+\sum_{i=1}^n\lambda_i\,g_i=0
\end{equation} 
for some $(\lambda_i)_{i=1}^n$. Since 
$
f_m\notin\langle f_1,\ldots,f_k\rangle=\langle g_1,\ldots,g_k\rangle,
$ 
there is an $r$ with $k+1\le r\le n$ and $\lambda_r\ne0$. Set $G':=(G\cup\{f_m\})\setminus\{g_r\}$. By \eqref{Efp}, the definition of $r$, and (\Smiley{}) we have 
$
\langle G'\rangle=\langle G\cup\{f_m\}\rangle=V.
$ 
The equalities $|G'|=n$ and $|F\cap G'|=k+1$ being clear, Proposition~\ref{P3} is proved. This completes the proof of Theorem~\ref{T1}. 
\end{proof} 

We end with a short unrelated observation whose goal is to define the sign homomorphism from the symmetric group to $\{\pm1\}$. Let $n$ be an integer $\ge3$, set $X:=\{1,\ldots,n\}$, let $S_n$ be the group of permutations of $X$, let $Y$ be the set of two-element subsets of $X$, and let $\sigma$ be in $S_n$. For $y\in Y$ define $\sigma y\in Y$ by $\sigma\{i,j\}=\{\sigma i,\sigma j\}$. Let $1\le i<j\le n$. Say that $\{i,j\}$ is an \textbf{inversion} for $\sigma$ if $\sigma j<\sigma i$, let $I_\sigma$ be the set of all such inversions, and define the map $\varepsilon:A_n\to\{\pm1\}$ by $\varepsilon(\sigma)=(-1)^{|I_\sigma|}$. We claim 
\begin{equation}\label{Emor}
\varepsilon(\tau\sigma)=\varepsilon(\tau)\,\varepsilon(\sigma)
\end{equation} 
for $\tau,\sigma\in S_n$. Recall that the \textbf{symmetric difference} $A\Delta B$ of two sets $A$ and $B$ is the set $(A\cup B)\setminus(A\cap B)$. We clearly have 
\begin{equation}\label{ED}
|A\Delta B|=|A|+|B|-2\,|A\cap B|
\end{equation} 
if $A$ and $B$ are finite, as well as 
\begin{equation}\label{Ei}
I_{\tau\sigma}=I_\sigma\,\Delta\,\sigma^{-1}(I_\tau),
\end{equation} 
and \eqref{Emor} follows from \eqref{ED} and \eqref{Ei}. We also claim that half the members of $S_n$ satisfy $\varepsilon(\sigma)=-1$. It suffices to show that at least one of them does. But the transposition $(12)$ swapping 1 and 2 satisfies this condition (in fact we have $I_{(12)}=\{\{1,2\}\}$). 

\end{document}