\section{Introduction}
This paper is about vector spaces and integer lattices of cuts and
flows associated with a finite cell complex.
Our primary motivation is the study of critical groups of cell
complexes and related group invariants.  The critical group of a graph
 is a finite abelian group whose order
is the number of spanning forests.  The definition was introduced
independently in several different settings, including arithmetic
geometry~\cite{Lor}, physics \cite{Dhar}, and algebraic
geometry~\cite{BHN} (where it is also known as the Picard group or
Jacobian group).  It has received considerable recent attention for
its connections to discrete dynamical systems, tropical geometry, and
linear systems of curves; see, e.g.,~\cite{BN,Biggs-Chip,BL,HMY}.

In previous work~\cite{Critical}, the authors extended the definition
of the critical group to a cell complex~$\Sigma$ of arbitrary
dimension.  To summarize, the critical group $K(\Sigma)$ can be
calculated using a reduced combinatorial Laplacian, and its order is a
weighted enumeration of the cellular spanning trees of~$\Sigma$. 
Moreover, the action of the critical group on cellular $(d-1)$-cochains
gives a model of discrete flow on~$\Sigma$, generalizing the
chip-firing and sandpile models; see, e.g., \cite{Biggs-Chip,Dhar}.

Bacher, de la Harpe, and Nagnibeda first defined the lattices $\mathcal{C}$
and $\mathcal{F}$ of integral cuts and flows for a graph~\cite{BHN}.  By
regarding a graph as an analogue of a Riemann surface, they
interpreted the discriminant groups $\mathcal{C}^\sharp/\mathcal{C}$ and
$\mathcal{F}^\sharp/\mathcal{F}$ respectively as the Picard group of divisors and as
the Jacobian group of holomorphic forms.  In particular, they showed
that the critical group $K(G)$ is isomorphic to both $\mathcal{C}^\sharp/\mathcal{C}$
and $\mathcal{F}^\sharp/\mathcal{F}$.  Similar definitions and results appear in the work of
Biggs~\cite{Biggs-Chip}.


In the present paper, we define the \emph{cut and flow spaces} and
\emph{cut and flow lattices} of a cell complex $\Sigma$ by
\begin{align*}
\Cut(\Sigma) &= \im_\mathbb{R}\partial^*, & \Flow(\Sigma) &= \ker_\mathbb{R}\partial,\\
\mathcal{C}(\Sigma) &= \im_\mathbb{Z}\partial^*, & \mathcal{F}(\Sigma) &= \ker_\mathbb{Z}\partial,
\end{align*}
where $\partial$ and $\partial^*$ are the top cellular boundary and coboundary
maps of $\Sigma$.  In topological terms, cut- and flow-vectors are
cellular coboundaries and cycles, respectively.  Equivalently, the
vectors in $\Cut(\Sigma)$ support sets of facets whose deletion
increases the codimension-1 Betti number, and the vectors in
$\Flow(\Sigma)$ support nontrivial rational
homology classes.
  In the language of matroid theory, cuts and flows
correspond to cocircuits and circuits, respectively, of the \emph{cellular
matroid} represented by the columns of~$\partial$.


In the higher-dimensional setting, the groups $\mathcal{C}^\sharp/\mathcal{C}$ and $\mathcal{F}^\sharp/\mathcal{F}$
are not necessarily isomorphic to each other.  Their precise relationship involves
several other groups: the critical group $K(\Sigma)$, a dually defined \emph{cocritical
  group} $K^*(\Sigma)$, and the \emph{cutflow group}
$\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})$.  We show that
the critical and cocritical groups are respectively isomorphic to the discriminant groups of the
cut lattice and flow lattice, and that the cutflow group mediates between them
with an ``error term'' given by homology.
Specifically, if $\dim \Sigma = d$, then we have the short exact sequences
\begin{align*}
&0 \to \mathbb{Z}^n / (\mathcal{C}\oplus\mathcal{F}) \to K(\Sigma) \cong \mathcal{C}^\sharp/\mathcal{C} \to \tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))\to 0,\\
&0 \to \tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z})) \to \mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})\to K^*(\Sigma) \cong \mathcal{F}^\sharp/\mathcal{F} \to 0
\end{align*}
(Theorems~\ref{new-cut-theorem} and~\ref{new-flow-theorem})
where $\tor$ denotes the torsion summand.  The sizes of these groups are then given by
\begin{alignat*}{2} 
|\mathcal{C}^\sharp/\mathcal{C}| = |K(\Sigma)| &=  \tau(\Sigma)  & &= \tau^*(\Sigma)\cdot{\bf t}^2,\\
|\mathcal{F}^\sharp/\mathcal{F}| = |K^*(\Sigma)| &=  \tau^*(\Sigma) & &= \tau(\Sigma)/{\bf t}^2,\\
|\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})| &=  \tau(\Sigma)/{\bf t}  & &= \tau^*(\Sigma)\cdot{\bf t},
\end{alignat*}
(Theorems~\ref{all-counts} and~\ref{cocritical-count}),
where ${\bf t}=|\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))|$ and $\tau(\Sigma)$ and $\tau^*(\Sigma)$
are the weighted enumerators
\begin{align*}
\tau(\Sigma)&=\sum_\Upsilon|\tor(\tilde{H}_{d-1}(\Upsilon;\mathbb{Z}))|^2,&
\tau^*(\Sigma)&=\sum_\Upsilon|\tor(\tilde{H}_d(\Omega,\Upsilon;\mathbb{Z}))|^2,
\end{align*}
where both sums run over all cellular spanning forests $\Upsilon\subseteq\Sigma$
(see equation~\eqref{complexity})
and $\Omega$ is an acyclization of $\Upsilon$
(see Definition~\ref{acyclization}).


Before proving these results, we study the cut space (Section~\ref{cutspace-section}),
the flow space (Section~\ref{flowspace-section}), and the cut and flow lattices
(Section~\ref{integral-bases-section}) in some detail.  In order to do this, we
begin in Section~\ref{cellular-forest} by describing and enumerating cellular spanning forests of an arbitrary cell complex, generalizing our earlier work \cite{Simplicial,Cellular}.  The methods and results are very close to those of Lyons~\cite{Lyons}, but our technical emphasis is slightly different.  For every cellular spanning forest
$\Upsilon\subseteq \Sigma$, the fundamental bonds of $\Upsilon$ give rise
to a basis of the cut
space (Theorem~\ref{cut-basis}).  Likewise, the fundamental circuits of~$\Upsilon$
induce a basis of the flow space (Theorem~\ref{flow-basis}).
Moreover, under certain conditions on $\Upsilon$,
these bases are in fact integral bases for the cut and flow lattices
(Theorems~\ref{integral-basis-cut} and~\ref{integral-basis-flow}).


In the graphic case, these basis vectors are signed
characteristic vectors of
fundamental bonds and fundamental circuits; in particular,
their entries are all $0$ and $\pm1$.  In higher dimension,
the supports of basis elements are still fundamental bonds and fundamental circuits,
but there is the additional subtlety that their entries may not scale to $\pm1$,
making it less clear how to associate a canonical cut- or flow-vector
with a bond or circuit. 
We prove that the characteristic vectors which form the constructed bases of both the cut and flow spaces can
be scaled so that their entries are torsion
coefficients of homology groups of certain subcomplexes (Theorems~\ref{calibration} and~\ref{charflow}).

The idea of studying cuts and flows of matroids goes back to
Tutte~\cite{Tutte}.  More recently, Su and Wagner~\cite{SW} define
cuts and flows of a regular matroid (i.e., one represented by a
totally unimodular matrix~$M$); when $M$ is the boundary matrix of a
cell complex, this is the case where
the torsion coefficients are all trivial.
Su and Wagner's definitions
coincide with ours; their focus, however, is on recovering the
structure of a matroid from the metric data of its flow lattice.

In the final section of the paper, we generalize a theorem of Kotani
and Sunada~\cite{KS}, who observed that a classical inequality for
integer lattices, involving Hermite's constant (see, e.g.,
\cite{Lag}), could be applied to the flow lattice of a graph to give a
bound for girth and complexity.  We prove the corresponding result for cell
complexes (Theorem~\ref{Hermite-relations}), where ``girth'' means the
size of a smallest circuit in the cellular matroid (or, topologically,
the minimum number of facets supporting a nonzero homology class) and
``complexity'' is the torsion-weighted count of cellular spanning
trees.

\section{Preliminaries} \label{prelims}
In this section we review the tools needed throughout the
paper: cell complexes, cellular spanning trees and forests, integer
lattices, and matroids.

\subsection{Cell complexes} \label{cell}

We assume that the reader is familiar with the basic topology of cell complexes; for a general reference, see~\cite{Hatcher}.

Throughout the paper, $\Sigma$ will denote a finite CW complex
(which we refer to simply as a cell complex) of
dimension~$d$.  We adopt the convention that~$\Sigma$
has a unique cell of dimension~$-1$ (as though it were an abstract
simplicial complex); this will allow our results to
specialize correctly to the case $d=1$ (i.e., that~$\Sigma$ is a
graph).  We write~$\Sigma_i$ for the set of~$i$-dimensional cells
in~$\Sigma$, and $\Sigma_{(i)}$ for the $i$-dimensional skeleton of
$\Sigma$, i.e., $\Sigma_{(i)}=\Sigma_i\cup\Sigma_{i-1}\cup\cdots\cup\Sigma_0$.
A cell of dimension $d$ is called a \emph{facet}.

Unless otherwise stated, every $d$-dimensional subcomplex
$\Gamma\subseteq\Sigma$ will be assumed to have a full codimension-1
skeleton, i.e., $\Gamma_{(d-1)}=\Sigma_{(d-1)}$.  Accordingly, for
simplicity of notation, we will often make no distinction between the
subcomplex $\Gamma$ itself and its set $\Gamma_d$ of facets.

The symbol $C_i(\Sigma)=C_i(\Sigma;R)$ denotes the group of~$i$-dimensional
cellular chains with coefficients in a ring~$R$.  The
$i$-dimensional cellular boundary and coboundary maps are
respectively
$\partial_i(\Sigma;R)\colon C_i(\Sigma;R) \to C_{i-1}(\Sigma;R)$
and $\partial^*_i(\Sigma;R)\colon C_{i-1}(\Sigma;R) \to C_i(\Sigma;R)$;
we will write simply $\partial_i$ and $\partial^*_i$ whenever possible.


The $i^{th}$ reduced cellular homology and cohomology groups of $\Sigma$ are
respectively $\tilde{H}_i(\Sigma;R)=\ker\partial_i/\im\partial_{i+1}$ and
$\tilde{H}^i(\Sigma;R)=\ker\partial^*_{i+1}/\im\partial^*_i$.  We say that $\Sigma$ is
\emph{$R$-acyclic in codimension~one} if $\tilde{H}_{d-1}(\Sigma;R)=0$.  For a
graph ($d=1$), both $\mathbb{Q}$- and $\mathbb{Z}$-acyclicity in codimension~one are
equivalent to connectedness.  The $i^{th}$ reduced Betti number is
$\tilde\beta_i(\Sigma)=\dim\tilde{H}_i(\Sigma;\mathbb{Q})$, and the $i^{th}$ torsion
coefficient ${\bf t}_i(\Sigma)$ is the cardinality of the torsion subgroup $\tor(\tilde{H}_i(\Sigma;\mathbb{Z}))$.

A pair of complexes $\Gamma\subseteq\Sigma$
induces a relative complex $(\Sigma,\Gamma)$, with relative homology and cohomology
$\tilde{H}_i(\Sigma,\Gamma;R)$ and $\tilde{H}^i(\Sigma,\Gamma;R)$ and torsion coefficients
${\bf t}_i(\Sigma,\Gamma)=|\tor(\tilde{H}_i(\Sigma,\Gamma;\mathbb{Z}))|$.

We will frequently use the fact that
\begin{equation} \label{UCTC}
\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z})) \cong \tor(\tilde{H}^d(\Sigma;\mathbb{Z}))
\end{equation}
which is a special case of the universal coefficient theorem for cohomology \cite[p.~205, Corollary~3.3]{Hatcher}.

\subsection{Spanning Forests and Laplacians} \label{tree-Lap-subsection}
Our work on cuts and flows will use the theory of spanning forests
in arbitrary dimensions.  
Define a \emph{cellular spanning forest} (CSF) of $\Sigma$ to be a subcomplex
$\Upsilon\subseteq \Sigma$ such that $\Upsilon_{(d-1)}=\Sigma_{(d-1)}$ and
  \begin{subequations}
  \begin{align}
  \label{acyc-condn}  & \tilde{H}_d(\Upsilon;\mathbb{Z}) = 0,\\
  \label{conn-condn}  & \rank\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})=\rank\tilde{H}_{d-1}(\Sigma;\mathbb{Z}), \quad\text{and}\\
  \label{count-condn} & |\Upsilon_d| = |\Sigma_d| - \tilde\beta_d(\Sigma) + \tilde\beta_{d-1}(\Sigma).
  \end{align}
  \end{subequations}
These conditions generalize the definition
of a spanning forest\footnote{That is, a maximal acyclic subgraph of $G$, not merely an acyclic subgraph containing all vertices.}
 of a graph~$G$: respectively, it is acyclic, connected, and has
$n-c$ edges, where $n$ and $c$ are the numbers of vertices and components of~$G$.
Just as in the graphic case, any two of the
conditions (\ref{acyc-condn}), (\ref{conn-condn}), (\ref{count-condn})
together imply the third.  An equivalent definition is that
a subcomplex $\Upsilon\subseteq\Sigma$ is a cellular spanning forest if and only if its $d$-cells correspond to a column basis for the cellular boundary matrix $\partial=\partial_d(\Sigma)$.

In the case that $\Sigma$ is $\mathbb{Q}$-acyclic in codimension~one, this
definition specializes to our earlier definition of a cellular
spanning tree~\cite[Definition~2.2]{Cellular}.

There are two main reasons that enumeration of spanning forests of
cell complexes is more complicated than for graphs.  First, many
properties of graphs can be studied component by component, so that
one can usually make the simplifying assumption of connectedness; on
the other hand, a higher-dimensional cell complex cannot in general be
decomposed into disjoint pieces that are all acyclic in codimension
one.  Second, for complexes of dimension greater than or equal to two,
the possibility of torsion homology affects enumeration.

Define the $i^{th}$ \textit{up-down},
\textit{down-up} and \textit{total} Laplacian operators\footnote{These
    are discrete versions of the Laplacian operators on
    differential forms of a Riemannian manifold.  The interested
    reader is referred to \cite{Eckmann} and \cite{Dodziuk} for their
    origins in differential geometry and, e.g.,
    \cite{Denham,Friedman,Merris} for more recent appearances in
    combinatorics.}
on~$\Sigma$ by
\begin{align*}
L^{\mathrm{ud}}_i&=\partial_{i+1}\partial^*_{i+1}\colon C_i(\Sigma;R) \to C_i(\Sigma;R),\\
L^{\mathrm{du}}_i&=\partial^*_i\partial_i\colon C_i(\Sigma;R) \to C_i(\Sigma;R),\\
L^{\textrm{tot}}_i&= L^{\mathrm{ud}}_i + L^{\mathrm{du}}_i.
\end{align*}
Moreover, define the \emph{complexity} of~$\Sigma$ as
\begin{equation} \label{complexity}
\tau(\Sigma)=\tau_d(\Sigma)=\sum_{\text{CSFs }\Upsilon\subseteq \Sigma}|\tor(\tilde{H}_{d-1}(\Upsilon;\mathbb{Z}))|^2.
\end{equation}
The \emph{cellular matrix-tree theorem}~\cite[Theorem~2.8]{Cellular}
states that if $\Sigma$ is $\mathbb{Q}$-acyclic in codimension~one
and
$L_{\bar{\Upsilon}}$ is the submatrix of $L^{\mathrm{ud}}_{d-1}(\Sigma)$ obtained by deleting the
rows and columns corresponding to the facets of a $(d-1)$-spanning tree
$\Upsilon$, then
\begin{equation*} \label{CMTT}
\tau(\Sigma)=\frac{|\tor(\tilde{H}_{d-2}(\Sigma;\mathbb{Z}))|^2}{|\tor(\tilde{H}_{d-2}(\Upsilon;\mathbb{Z}))|^2}\det L_{\bar{\Upsilon}}.
\end{equation*}
In Section~\ref{cellular-forest}, we will generalize this formula to
arbitrary cell complexes (i.e., not requiring that~$\Sigma$ be
$\mathbb{Q}$-acyclic in codimension~one).  This has previously been done by
Lyons~\cite{Lyons} in terms of slightly different invariants.  If~$G$
is a connected graph, then $\tau(G)$ is just the number of spanning
trees, and we recover the classical matrix-tree theorem of Kirchhoff.

\subsection{Lattices} \label{lattice-subsection}

Starting in Section~\ref{integral-bases-section},
we will turn our attention to lattices
of integer cuts and flows.   We review
some of the general theory of integer lattices; see, e.g.,
\cite[Chapter~12]{Artin}, 
\cite[Chapter 14]{GodRoy},
\cite[Chapter IV]{Hungerford}.

A \emph{lattice} $\mathcal{L}$ is a discrete subgroup of a finite-dimensional
vector space~$V$; that is, it is the integer linear combinations of some
basis of~$V$.  Every lattice $\mathcal{L}\subseteq\mathbb{R}^n$ is isomorphic to
$\mathbb{Z}^r$ for some integer $r\leq n$, called the \emph{rank} of~$\mathcal{L}$.
The elements of $\mathcal{L}$ span a vector space denoted by $\mathcal{L}\otimes\mathbb{R}$.  
For $\mathcal{L}\subseteq\mathbb{Z}^n$, the \emph{saturation} of $\mathcal{L}$ is defined 
as $\hat\mathcal{L}=(\mathcal{L}\otimes\mathbb{R})\cap\mathbb{Z}^n$.
An \emph{integral basis} of $\mathcal{L}$ is a set of linearly independent
vectors $v_1,\dots,v_r\in\mathcal{L}$ such that $\mathcal{L}=\{c_1v_1+\cdots+c_rv_r
\colon c_i\in\mathbb{Z}\}$.
We will need the following fact about integral bases of lattices;
the equivalences are easy consequences of the theory of free modules
(see, e.g., \cite[Chapter~12]{Artin}, \cite[Chapter IV]{Hungerford}):
\begin{proposition}\label{TFAE-lattices}
For any lattice $\mathcal{L}\subseteq\mathbb{Z}^n$, the following are equivalent:
\begin{enumerate}
\item Every integral basis of $\mathcal{L}$ can be extended to an integral basis of $\mathbb{Z}^n$.
\item Some integral basis of $\mathcal{L}$ can be extended to an integral basis of $\mathbb{Z}^n$.
\item $\mathcal{L}$ is a summand of $\mathbb{Z}^n$, i.e., $\mathbb{Z}^n$ can be written as an internal direct sum $\mathcal{L}\oplus\mathcal{L}'$.
\item $\mathcal{L}$ is the kernel of some group homomorphism $\mathbb{Z}^n\to\mathbb{Z}^m$.
\item $\mathcal{L}$ is saturated, i.e., $\mathcal{L}=\hat\mathcal{L}$.
\item $\mathbb{Z}^n/\mathcal{L}$ is a free $\mathbb{Z}$-module, i.e., its torsion submodule is zero.
\end{enumerate}
\end{proposition}

Fixing the standard inner product $\langle\cdot,\cdot\rangle$ on $\mathbb{R}^n$,
we define the \emph{dual lattice} of $\mathcal{L}$ by
$$\mathcal{L}^\sharp = \{v\in\mathcal{L}\otimes\mathbb{R} \colon \scp{v,w}\in\mathbb{Z} \ \ \forall
w\in\mathcal{L}\}.$$
Note that $\mathcal{L}^\sharp$ can be identified with the dual
$\mathbb{Z}$-module $\mathcal{L}^*=\Hom(\mathcal{L},\mathbb{Z})$, and that $(\mathcal{L}^\sharp)^\sharp =
\mathcal{L}$.  A lattice is called \emph{integral} if it is contained in its
dual; for instance, any subgroup of $\mathbb{Z}^n$ is an integral lattice.
The \emph{discriminant group} (or \emph{determinantal group})
of an integral lattice $\mathcal{L}$ is $\mathcal{L}^\sharp / \mathcal{L}$; its cardinality
can be calculated as $\det M^TM$,
for any matrix~$M$ whose columns form an integral basis of $\mathcal{L}$.
We will need the following facts about bases and duals of lattices.
\begin{proposition}\label{lattice-projection}\cite[Section~14.6]{GodRoy}
Let $M$ be an $n\times r$ integer matrix.
\begin{enumerate}
\item If the columns of $M$ form an integral basis for the lattice $\mathcal{L}$, 
then the columns of $M(M^TM)^{-1}$ form the corresponding dual basis for $\mathcal{L}^\sharp$.
\item The matrix $P=M(M^TM)^{-1}M^T$ represents orthogonal projection from $\mathbb{R}^n$ 
onto the column space of $M$.
\item If the greatest common divisor of the 
$r \times r$ minors of $M$ is 1, then $\mathcal{L}^\sharp$ is generated by the columns of~$P$.
\end{enumerate}
\end{proposition}

\subsection{The cellular matroid}  \label{matroid-subsection}
Many results of the paper may be expressed efficiently using
the language of matroids.  For a general reference on matroids, see, e.g., \cite{Oxley}.
We will primarily consider cellular matroids. The
\emph{cellular matroid} of~$\Sigma$ is the matroid $\mathcal{M}(\Sigma)$ represented
over~$\mathbb{R}$ by the columns of the boundary matrix~$\partial$.  Thus the ground set of $\mathcal{M}(\Sigma)$
naturally corresponds to the $d$ dimensional cells~$\Sigma_d$, and $\mathcal{M}(\Sigma)$ records which sets of
columns of~$\partial$ are linearly independent.  If~$\Sigma$ is a graph, then
$\mathcal{M}(\Sigma)$ is its usual graphic matroid, while if $\Sigma$ is a simplicial
complex then $\mathcal{M}(\Sigma)$ is its simplicial matroid (see~\cite{CorLin}).

The bases of $\mathcal{M}(\Sigma)$ are the collections of facets of cellular
spanning forests of $\Sigma$. If $r$ is the rank function of the
matroid $\mathcal{M}(\Sigma)$, then for each set of facets $B\subseteq \Sigma_d$,
we have $r(B) =
\rank \partial_B$, where $\partial_B$ is the submatrix consisting of the columns
indexed by the facets in~$B$. Moreover, we have
$$r(\Sigma) := r(\Sigma_d) = \rank \mathcal{M}(\Sigma) = \rank \partial = |\Sigma_d|-\tilde\beta_d(\Sigma)$$
by the definition of Betti number.

A set of facets $B\subseteq \Sigma_d$ is called a \emph{cut} if deleting
$B$ from $\Sigma$ increases its codimension-one homology, i.e.,
$\tilde\beta_{d-1}(\Sigma\setminus B)>\tilde\beta_{d-1}(\Sigma)$.  A cut $B$ is a \emph{bond} if
$r(\Sigma \setminus B) = r(\Sigma)-1$, but $r((\Sigma \setminus B) \cup\sigma)=r(\Sigma)$ for every
$\sigma\in B$.  That is, a bond is a minimal cut.  In matroid terminology, a bond
of $\Sigma$ is precisely a cocircuit of $\mathcal{M}(\Sigma)$, i.e., a minimal set that
meets every basis of $\mathcal{M}(\Sigma)$.  Equivalently, a bond is the complement
of a flat of rank $r(\Sigma)-1$.  If $\Upsilon$ is a cellular spanning forest (i.e., a basis of $\mathcal{M}(\Sigma)$)
and $\sigma\in\Upsilon_d$ is a facet, then the \emph{fundamental bond}
of the pair $(\Upsilon,\sigma)$ is
\begin{equation} \label{fund-bond}
\bond(\Upsilon,\sigma) = \sigma \cup \left\{\rho\in \Sigma_d\setminus\Upsilon\colon \Upsilon\setminus\sigma\cup\rho\text{ is a CSF}\right\}.
\end{equation}
This is the fundamental cocircuit of the pair $(\Upsilon,\sigma)$ of $\mathcal{M}(\Sigma)$
\cite[p.~78]{Oxley}.


While we will frequently adopt a matroid-theoretic perspective, it is
important to point out that the cut and flow spaces and lattices of a
complex~$\Sigma$ are not matroid invariants, i.e., they are not determined by
the cellular matroid $\mathcal{M}(\Sigma)$.  (See \cite{SW} for more on
this subject.)
Below is a table collecting some of the
standard terminology from linear algebra, graph theory, and matroid
theory, along with the analogous concepts that we will be using for
cell complexes.

\begin{center}
\begin{scriptsize}
\begin{tabular}{|cccc|}\hline
\bf Linear algebra & \bf Graph & \bf Matroid & \bf Cell complex\\ \hline
Column vectors & Edges & Ground set & Facets\\
Independent set & Acyclic subgraph & Independent set & Acyclic subcomplex\\
Min linear dependence & Cycle & Circuit & Circuit\\
Basis & Spanning forest & Basis & CSF\\
Set meeting all bases & Disconnecting set & Codependent
set & Cut\\
Min set meeting all bases & Bond & Cocircuit & Bond\\
Rank & \# edges in spanning forest & Rank & \# facets in CSF\\\hline
\end{tabular}
\end{scriptsize}
\end{center}

Here ``codependent'' means dependent in the dual matroid.

\section{Enumerating Cellular Spanning Forests}\label{cellular-forest}

In this section, we study the enumerative properties of cellular spanning forests
of an arbitrary cell complex $\Sigma$.  Our setup is essentially the same as that
of Lyons \cite[\S6]{Lyons}, but the combinatorial formulas we will need later, namely Propositions~\ref{det-is-homology} and~\ref{relative-tor-formula}, are somewhat different.
As a corollary, we obtain an enumerative result, Proposition~\ref{CMFT}, which generalizes the simplicial and cellular matrix-tree theorems
of~\cite{Simplicial} and~\cite{Cellular} (in which we required that $\Sigma$ be $\mathbb{Q}$-acyclic
in codimension~one).  The result is closely related, but not quite equivalent, to Lyons' generalization of the cellular matrix-tree theorem \cite[Corollary 6.2]{Lyons}.

The arguments require some tools from homological algebra,
in particular the long exact sequence for relative homology and some facts
about the torsion-subgroup functor.  The details of the proofs are not
necessary to understand the constructions of cut and flow spaces in the
later sections.

Let $\Sigma$ be a $d$-dimensional cell complex with rank~$r$.
Let $\Gamma\subseteq\Sigma$ be a 
subcomplex of dimension less than or equal to $d-1$ such that  $\Gamma_{(d-2)}=\Sigma_{(d-2)}$.
Thus the inclusion map $i\colon \Gamma\to \Sigma$ induces isomorphisms 
$i_*\colon \tilde{H}_k(\Gamma;\mathbb{Q})\to\tilde{H}_k(\Sigma;\mathbb{Q})$ for all $k<d-2$.

\begin{definition} \label{rel-acyclic}
The subcomplex $\Gamma\subseteq\Sigma$ is called \emph{relatively acyclic} if in fact
the inclusion map 
$i\colon \Gamma\to \Sigma$ induces isomorphisms 
$i_*\colon \tilde{H}_k(\Gamma;\mathbb{Q})\to\tilde{H}_k(\Sigma;\mathbb{Q})$ for all $k<d.$
\end{definition}

By the long exact sequence for relative homology, $\Gamma$ is relatively acyclic if and only if
$\tilde{H}_d(\Sigma;\mathbb{Q})\to\tilde{H}_d(\Sigma,\Gamma;\mathbb{Q})$ is an isomorphism and $\tilde{H}_k(\Sigma,\Gamma;\mathbb{Q})=0$ for all $k<d$.
These conditions can occur only if $|\Gamma_{d-1}|=|\Sigma_{d-1}|-r$.  This quantity may be zero
(in which case the only relatively acyclic subcomplex is $\Sigma_{(d-2)}$).  A relatively acyclic subcomplex is precisely the complement of a $(d-1)$-cobase (a basis of the matroid represented over~$\mathbb{R}$ by the rows of the boundary matrix~$\partial$)
in the terminology of Lyons \cite{Lyons}.

Two special cases are worth noting.  First, if $d=1$, then a relatively acyclic
complex consists of one vertex in each connected component.
Second, if $\tilde{H}_{d-1}(\Sigma;\mathbb{Q})=0$, then $\Gamma$ is relatively acyclic if and only if
it is a cellular spanning forest of $\Sigma_{(d-1)}$.

For a matrix $M$, we write $M_{A,B}$ for the restriction of
$M$ to rows indexed by $A$ and columns indexed by $B$. 

\begin{proposition} \label{det-is-homology}
Let $\Gamma\subseteq\Upsilon\subseteq\Sigma$ be subcomplexes
such that $\dim\Upsilon=d$; $\dim\Gamma=d-1$; $|\Upsilon_d|=r$;
$|\Gamma_{d-1}|=|\Sigma_{d-1}|-r$;
$\Upsilon_{(d-1)}=\Sigma_{(d-1)}$; and $\Gamma_{(d-2)}=\Sigma_{(d-2)}$.
Also, let $R=\Sigma_{d-1} \setminus \Gamma$.  Then the following are equivalent:
\begin{enumerate}
\item The $r\times r$ square matrix $\hat\partial=\partial_{R,\Upsilon}$ is nonsingular.
\item $\tilde{H}_d(\Upsilon,\Gamma;\mathbb{Q})=0$ and $\tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Q})=0$.
\item $\tilde{H}_d(\Upsilon,\Gamma;\mathbb{Q})=0$ or $\tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Q})=0$.
\item $\Upsilon$ is a cellular spanning forest of $\Sigma$ and $\Gamma$ is relatively acyclic.
\end{enumerate}
\end{proposition}

\begin{proof}
The cellular chain complex of the relative complex $(\Upsilon,\Gamma)$ is
$$0 \to C_d(\Upsilon,\Gamma;\mathbb{Q})=\mathbb{Q}^r \xrightarrow{\hat\partial} C_{d-1}(\Upsilon,\Gamma;\mathbb{Q})=\mathbb{Q}^r \to 0$$
with other terms zero.  If $\hat\partial$ is nonsingular, then $\tilde{H}_d(\Upsilon,\Gamma;\mathbb{Q})$ and $\tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Q})$ are both zero;
otherwise, both are nonzero.  This proves the equivalence of (a), (b) and (c).

Next, note that $\tilde{H}_d(\Gamma;\mathbb{Q})=0$ (because $\Gamma$ has no cells in dimension~$d$) and that
$\tilde{H}_{d-2}(\Upsilon,\Gamma;\mathbb{Q})=0$ (because $\Gamma_{(d-2)}=\Upsilon_{(d-2)}$). 
Accordingly, the long exact sequence for relative homology of $(\Upsilon,\Gamma)$ is
\begin{equation} \label{LES-relative}
\begin{aligned}
0 &\to \tilde{H}_d(\Upsilon;\mathbb{Q}) \to \tilde{H}_d(\Upsilon,\Gamma;\mathbb{Q})\\
 &\to \tilde{H}_{d-1}(\Gamma;\mathbb{Q}) \to \tilde{H}_{d-1}(\Upsilon;\mathbb{Q}) \to \tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Q})\\
 &\to \tilde{H}_{d-2}(\Gamma;\mathbb{Q}) \to \tilde{H}_{d-2}(\Upsilon;\mathbb{Q}) \to 0.
\end{aligned}
\end{equation}
If $\tilde{H}_d(\Upsilon,\Gamma;\mathbb{Q})=\tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Q})=0$, then
$\tilde{H}_d(\Upsilon;\mathbb{Q})=0$ (which says that~$\Upsilon$ is a cellular spanning forest) and the rest of~\eqref{LES-relative}
splits into two isomorphisms that assert precisely that~$\Gamma$ is relatively acyclic (recall that $\tilde{H}_{d-1}(\Upsilon;\mathbb{Q})=\tilde{H}_{d-1}(\Sigma;\mathbb{Q})$
when~$\Upsilon$ is a cellular spanning forest).  This implication is reversible,
completing the proof.
\end{proof}

The \emph{torsion subgroup} of a finitely generated abelian group $A$ is
defined as the subgroup
$$\tor(A)=\{x\in A \colon kx=0\text{ for some } k\in\mathbb{Z}\}.$$
Note that $A=\tor(A)$ if and only if $A$ is finite.  The torsion functor
$\tor$
is left-exact~\cite[ p.~179]{Hungerford}.
Moreover, if $A\to B\to C\to 0$ is exact and $A=\tor(A)$, then
$\tor(A) \to \tor(B) \to \tor(C) \to 0$ is exact.  We will need the following additional fact about the torsion functor.

\begin{lemma} \label{exactness-of-tor}
Suppose we have a commutative diagram of finitely generated abelian groups
\begin{equation} \label{first-comm-diag}
\xymatrix{
0\rto& A\rto^f\dto_\alpha& B\rto^g\dto^\beta& C\rto^h\dto& D\rto^j\dto& E\rto\dto& 0\\
0\rto& A'\rto^{f'}& B'\rto^{g'}& C'\rto^{h'}& D'\rto^{j'}& E'\rto& 0
}
\end{equation}
such that both rows are exact;  $A,A'$ are free; $\alpha$ is an isomorphism; $\beta$ is surjective; and $C,C'$ are finite.
Then there is an induced commutative diagram
\begin{equation} \label{induced-comm-diag}
\xymatrix @C=0.2in @R=0.2in{
0\rto& \tor B\oplus G\rto\dto&\tor C\rto\dto& \tor D\rto\dto& \tor E\rto\dto& 0\\
0\rto& \tor B'\oplus G\rto& \tor C'\rto& \tor D'\rto& \tor E'\rto& 0
}
\end{equation}
such that $G$ is finite and both rows are exact.  Consequently
\begin{equation} \label{card-formula}
|\tor B|\cdot |\tor C'|\cdot |\tor D| \cdot |\tor E'|=|\tor B'|\cdot |\tor C|\cdot|\tor D'|\cdot |\tor E|.
\end{equation}
\end{lemma}

\begin{proof}
First, let $Z$ be a maximal-rank free summand of $D$, i.e., $D=Z\oplus\tor D$.  Then $\im(h)\subseteq\tor D$.
By exactness at $E$, the map $j$ must map $Z$ isomorphically onto a free summand of $E$.
Hence $\ker j\subseteq\tor D$ as well, and replacing $D,E$ with their torsion summands
preserves exactness.  The same argument implies that we can replace $D',E'$ with $\tor D',\tor E'$.

Second, note that $A,A',B,B'$ all have the same rank (since the rows are exact, $C,C'$ are finite,
and $\alpha$ is an isomorphism).  Hence $f(A)$ is a maximal-rank
free submodule of $B$; we can write $B=\tor B\oplus F$, where
$F$ is a free summand of $B$ containing $f(A)$.  Likewise,
write $B'=\tor B'\oplus F'$, where
$F'$ is a free summand of $B'$ containing $f'(A')$.  Meanwhile, $\beta$ is surjective, hence
must restrict to an isomorphism $F\to F'$,
which induces an isomorphism $F/f(A)\to F'/f'(A')$.  Abbreviating this last group by $G$, we obtain
the desired diagram~\eqref{induced-comm-diag} .  Since $\ker g=\im f\subseteq F$, the map $g\colon\tor B\oplus G\to \tor C$
is injective, proving exactness of the first row; the second row is exact by the same argument.
Exactness of each row implies that the alternating product of the cardinalities of the groups is 1,
from which the formula~\eqref{card-formula} follows.
\end{proof}

\begin{proposition} \label{relative-tor-formula}
Let $\Sigma$ be a $d$-dimensional cell complex,
let $\Upsilon\subseteq\Sigma$ be a cellular spanning forest, and let $\Gamma\subseteq\Sigma$ be a relatively acyclic $(d-1)$-subcomplex.
Then
$${\bf t}_{d-1}(\Upsilon)\, {\bf t}_{d-1}(\Sigma,\Gamma)={\bf t}_{d-1}(\Sigma)\, {\bf t}_{d-1}(\Upsilon,\Gamma).$$
\end{proposition}

\begin{proof}
The inclusion $\Upsilon\subseteq\Sigma$ induces a commutative diagram
$$
\xymatrix@C=0.15in{
0 \rto& \tilde{H}_{d-1}(\Gamma;\mathbb{Z}) \rto^{i_*}\dto^{\cong}& \tilde{H}_{d-1}(\Upsilon;\mathbb{Z})\rto^{j_*}\dto& \tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Z}) \rto\dto& \tilde{H}_{d-2}(\Gamma;\mathbb{Z}) \rto\dto^{\cong}& \tilde{H}_{d-2}(\Upsilon;\mathbb{Z}) \rto\dto^{\cong}& 0\\
0 \rto& \tilde{H}_{d-1}(\Gamma;\mathbb{Z}) \rto^{i_*}& \tilde{H}_{d-1}(\Sigma;\mathbb{Z}) \rto^{j_*} & \tilde{H}_{d-1}(\Sigma,\Gamma;\mathbb{Z}) \rto& \tilde{H}_{d-2}(\Gamma;\mathbb{Z}) \rto& \tilde{H}_{d-2}(\Sigma;\mathbb{Z}) \rto& 0
}$$
whose rows come from the long exact sequences
for relative homology.  (For the top row,
the group $\tilde{H}_d(\Upsilon,\Gamma;\mathbb{Z})$ is free because $\dim \Upsilon = d$,
and on the other hand is purely torsion by Proposition~\ref{det-is-homology},
so it must be zero.  For the bottom row, 
the condition that $\Gamma$ is relatively
acyclic implies that $i_*$ is an isomorphism over $\mathbb{Q}$; therefore,
it is one-to-one over $\mathbb{Z}$.)
The groups $\tilde{H}_{d-1}(\Upsilon,\Gamma;\mathbb{Z})$ and
$\tilde{H}_{d-1}(\Sigma,\Gamma;\mathbb{Z})$ are purely torsion.
The first, fourth and fifth vertical maps are isomorphisms (the last
because $\Upsilon_{(d-1)}=\Sigma_{(d-1)}$) and the second is a surjection by the relative homology sequence of
the pair $(\Sigma,\Upsilon)$ (since the relative complex has no cells in dimension $d-1$.)
The result now follows by applying Lemma~\ref{exactness-of-tor} and canceling like terms.
\end{proof}

As a consequence, we obtain a version of the cellular matrix-forest
theorem that applies to all cell complexes (not only those that are
$\mathbb{Q}$-acyclic in codimension~one).

\begin{proposition} \label{CMFT}
Let $\Sigma$ be a $d$-dimensional cell complex and
let $\Gamma\subseteq\Sigma$ be a relatively acyclic $(d-1)$-dimensional subcomplex, and let
$L_\Gamma$ be the restriction of $L^{\mathrm{ud}}_{d-1}(\Sigma)$ to the $(d-1)$-cells of~$\Gamma$.  Then
$$\tau_d(\Sigma) = \frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Sigma,\Gamma)^2}\det L_\Gamma.$$
\end{proposition}

\begin{proof}
By the Binet-Cauchy formula and Propositions~\ref{det-is-homology}
and~\ref{relative-tor-formula}, we have
\begin{align*}
\det L_\Gamma &= \det \partial_\Gamma\partial^*_\Gamma = \sum_{\Upsilon\subseteq \Sigma_d\colon |\Upsilon|=r(\Sigma)} (\det\partial_{\Gamma,\Upsilon})^2
~=~ \sum_{\text{CSFs\ }\Upsilon\subseteq \Sigma_d} {\bf t}_{d-1}(\Upsilon,\Gamma)^2\\
&= \frac{{\bf t}_{d-1}(\Sigma,\Gamma)^2}{{\bf t}_{d-1}(\Sigma)^2}\sum_{\text{CSFs\ }\Upsilon\subseteq \Sigma_d} {\bf t}_{d-1}(\Upsilon)^2
~=~ \frac{{\bf t}_{d-1}(\Sigma,\Gamma)^2}{{\bf t}_{d-1}(\Sigma)^2}\tau_d(\Sigma)
\end{align*}
and solving for $\tau_d(\Sigma)$ gives the desired formula.
\end{proof}
If $\tilde{H}_{d-1}(\Sigma;\mathbb{Z})=\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))$, then the
relative homology sequence of the pair $(\Sigma,\Gamma)$ gives rise to the exact sequence
$$0\to\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))\to\tor(\tilde{H}_{d-1}(\Sigma,\Gamma;\mathbb{Z}))\to\tor(\tilde{H}_{d-2}(\Gamma;\mathbb{Z}))\to\tor(\tilde{H}_{d-2}(\Sigma;\mathbb{Z}))\to0$$
which implies that
${\bf t}_{d-1}(\Sigma)/{\bf t}_{d-1}(\Sigma,\Gamma)={\bf t}_{d-2}(\Sigma)/{\bf t}_{d-2}(\Gamma)$, so
Proposition~\ref{CMFT} becomes the formula
$\tau_d(\Sigma) = \frac{{\bf t}_{d-2}(\Sigma)^2}{{\bf t}_{d-2}(\Gamma)^2}\det L_\Gamma$.  This was one of the original versions of the
cellular matrix-tree theorem~\cite[Theorem~2.8(2)]{Cellular}.


\begin{remark} \label{lyons-remark}
Lyons \cite[Corollary 6.2]{Lyons} proves a similar matrix-forest theorem in terms of an invariant ${\bf t}'$ defined below.  He shows that each row of~\eqref{first-comm-diag} induces the corresponding row of~\eqref{induced-comm-diag}.  This does not quite imply Lemma~\ref{exactness-of-tor}, since one still needs to identify the ``error terms'' $G$ in the top and bottom rows of \eqref{induced-comm-diag}.  Doing so would amount to showing that $\tilde{H}_{d-1}(\Upsilon)/\ker(j_*)\cong\tilde{H}_{d-1}(\Sigma)/\ker(j_*)$ in~\eqref{first-comm-diag}.  Alternatively, Proposition~\ref{relative-tor-formula} would follow from \cite[Lemma 6.1]{Lyons} together with the equation
$${\bf t}_{d-2}(\Gamma) {\bf t}'_{d-1}(\bar\Gamma) / {\bf t}_{d-2}(\Sigma) = {\bf t}_{d-1}(\Sigma,\Gamma) / {\bf t}_{d-1}(\Sigma)$$
where $\bar\Gamma=X_{(d-1)}\setminus\Gamma$ and ${\bf t}'_{d-1}(\bar\Gamma)=
\big\vert \ker\partial_{d-1}(\Sigma;\mathbb{Z}) / 
  \big( (\ker\partial_{d-1}(\Sigma;\mathbb{Z})\cap\im\partial_d(\Sigma;\mathbb{Q})) + \ker\partial_{d-1}(\Gamma;\mathbb{Z}) \big)
\big\vert$.
\end{remark}



\section{The Cut Space}\label{cutspace-section}

Throughout this section, let $\Sigma$ be a cell complex of dimension~$d$ and rank~$r$
(that is, every cellular spanning forest of~$\Sigma$ has $r$ facets).
For each~$i\leq d$, the \textit{$i$-cut space} and \textit{$i$-flow space} of $\Sigma$ are defined
respectively as the spaces of cellular coboundaries and cellular cycles:
\begin{align*}
\Cut_i(\Sigma) &= \im( \partial^*_i\colon C_{i-1}(\Sigma,\mathbb{R}) \to C_i(\Sigma,\mathbb{R})),\\
\Flow_i(\Sigma) &= \ker( \partial_i\colon C_i(\Sigma,\mathbb{R}) \to C_{i-1}(\Sigma,\mathbb{R})).
\end{align*}
We will primarily be concerned with the case $i=d$.
For $i=1$, these are the standard graph-theoretic cut and
flow spaces of the 1-skeleton of $\Sigma$.

There are two natural ways to construct bases of the cut space of a graph, 
in which the basis elements correspond to either (a) vertex stars or (b)
the fundamental circuits of a spanning forest (see, e.g.~\cite[Chapter~14]{GodRoy}).
The former is easy to
generalize to cell complexes, but the latter takes more work.

First, if $G$ is a graph on vertex set $V$ and $R$ is a set of (``root'')
vertices, one in each connected component, then the rows of $\partial$ corresponding
to the vertices $V\setminus R$ form a basis for $\Cut_1(G)$.  This
observation generalizes easily to cell complexes:

\begin{proposition} \label{star-basis}
A set of $r$ rows of~$\partial$ forms a
row basis if and only if the corresponding set of $(d-1)$-cells is the
complement of a relatively acyclic $(d-1)$-subcomplex.
\end{proposition}

This is immediate from Proposition~\ref{det-is-homology}.  Recall that
if $\tilde{H}_{d-1}(\Sigma;\mathbb{Q})=0$, then ``relatively acyclic
$(d-1)$-subcomplex'' is synonymous with ``spanning tree of the
$(d-1)$-skeleton''.  In this case, Proposition~\ref{star-basis} is
also a consequence of the fact that the matroid represented by the
rows of~$\partial_d$ is dual to the matroid represented by the columns
of~$\partial_{d-1}$~\cite[Proposition~6.1]{Cellular}.

The second way to construct a basis of the cut space of a graph is to
fix a spanning tree and take the signed characteristic vectors of its
fundamental bonds.  In the cellular setting, it is not hard to show
that each bond supports a unique (up to scaling) vector in the cut
space (Lemma~\ref{one-dim}) and that the fundamental bonds of a fixed
cellular spanning forest give rise to a vector space basis
(Theorem~\ref{cut-basis}).  (Recall from Section~\ref{prelims} that a
bond in a cell complex is a minimal collection of facets whose removal
increases the codimension-one homology, or equivalently a cocircuit of
the cellular matroid.)  The hard part is to identify the entries of
these cut-vectors.  For a graph, these entries are all 0 or $\pm1$.
In higher dimension, this need not be the case, but the entries can be
interpreted as the torsion coefficients of certain subcomplexes
(Theorem~\ref{calibration}).  In Section~\ref{flowspace-section}, we
will prove analogous results for the flow space.

\subsection{A basis of cut-vectors}

Recall that the \emph{support} of a vector $v=(v_1,\dots,v_n)\in\mathbb{R}^n$ is the set
$$\supp(v)=\{i\in[n] \colon v_i\neq 0\}.$$

\begin{proposition}\label{bond-is-minimal} \cite[Proposition 9.2.4]{Oxley}.
Let $M$ be a $r\times n$ matrix with rowspace $V\subseteq\mathbb{R}^n$, and
let $\mathcal{M}$ be the matroid represented by the columns of $M$.  Then the
 cocircuits of $\mathcal{M}$ are the inclusion-minimal elements of the
family $\Supp(V) := \{\supp(v) \colon v\in V\setminus\{0\}\}$.
\end{proposition}

\begin{lemma}\label{one-dim}
Let $B$ be a bond of~$\Sigma$.  Then the set
$$\Cut_B(\Sigma)=\{0\}\cup\{v \in \Cut_d(\Sigma) \colon \supp(v) = B\}$$
is a one-dimensional subspace of $\Cut_d(\Sigma)$.
That is, up to scalar multiple, there is a unique cut-vector
whose support is exactly $B$.  

\end{lemma}

\begin{proof}
Suppose that $v,w$ are vectors in the cut space, both supported on
$B$, that are not scalar multiples of each other.  Then there is a
linear combination of $v,w$ with strictly smaller support; this
contradicts Proposition~\ref{bond-is-minimal}.  On the other hand,
Proposition~\ref{bond-is-minimal} also implies that $\Cut_B(\Sigma)$ is not the zero
space; therefore, it has dimension~1.
\end{proof}

We now know that for every bond~$B$, there is a cut-vector supported
on~$B$ that is uniquely determined up to a scalar multiple.  As we
will see, there is a choice of scale so that the coefficients of this
cut-vector are given by certain minors of the down-up Laplacian
$L=L^{\mathrm{du}}_d(\Sigma)=\partial^*\partial$ (Lemma~\ref{cut-vector-formula}); these minors (up to sign) can be interpreted
as the cardinalities of torsion homology groups (Theorem~\ref{calibration}).

In choosing a scale, the first step is to realize the elements of $\Cut_B(\Sigma)$ explicitly as images
of the map $\partial^*$.   Fix an inner product
$\scp{\cdot,\cdot}$ on each chain group $C_i(\Sigma;\mathbb{R})$ by declaring
the $i$-dimensional cells to be an orthonormal basis.  (This amounts
to identifying each cell with the cochain that is its characteristic
function.)  Thus, for $\alpha\in C_i(\Sigma;\mathbb{R})$, we have
$\supp(\alpha)=\{\sigma\in\Sigma_i \colon \scp{\sigma,\alpha}\neq 0\}$.
Moreover, for all $\beta\in C_{i-1}(\Sigma;\mathbb{R})$, we have by basic linear algebra
\begin{equation} \label{scalar-product-identity}
\scp{\partial\alpha,\beta}=\scp{\alpha,\partial^*\beta}.
\end{equation}

\begin{lemma} \label{cbd-of-what}
Let $B$ be a bond of $\Sigma$ and let $U$ be the space spanned by $\{\partial \sigma \colon \sigma\in \Sigma_d\setminus B\}$.
In particular, $U$ is a subspace of $\im\partial$ of codimension one.
Let $V$ be the orthogonal complement of $U$ in $\im\partial$, and let
$v$ be a nonzero element of $V$.  Then $\supp(\partial^* v)=B$.
\end{lemma}

\begin{proof}
First, we show that $\partial^* v\neq 0$.  To see this, observe that
the column space of~$\partial$ is $U + \mathbb{R} v$, so
the column space of~$\partial^*\partial$ is $\partial^* U + \mathbb{R} \partial^* v$.  However,
$\rank(\partial^*\partial)=\rank\partial=r$, and $\dim U=r-1$;
therefore, $\partial^* v$ cannot be the zero vector.  Second, if
$\sigma \in \Sigma_d \setminus B$, then $\partial \sigma \in U$, so
$\scp{\partial^* v,\sigma} = \scp{v,\partial \sigma} = 0.$
It follows that $\supp(\partial^* v)\subseteq B$, and in fact
$\supp(\partial^* v)=B$ by Proposition~\ref{bond-is-minimal}.
\end{proof}

Given a bond $B$, let $A=\{\sigma_1,\dots,\sigma_{r-1}\}$ be a
cellular spanning forest of~$\Sigma\setminus B$.  Fix a facet
$\sigma=\sigma_r\in B$, so that $A\cup\sigma$ is a cellular spanning
forest of~$\Sigma$.  Define a vector
$$v=v_{A,\sigma}
=\sum_{j=1}^r (-1)^j (\det L^{\mathrm{du}}_{A,A\cup \sigma\setminus \sigma_j}) \partial \sigma_j
~\in~ C_{d-1}(\Sigma;\mathbb{Z})$$
so that
\begin{equation} \label{cbdv}
\partial^* v=\sum_{j=1}^r (-1)^j (\det L^{\mathrm{du}}_{A,A\cup \sigma\setminus \sigma_j}) L^{\mathrm{du}} \sigma_j ~\in~ \Cut_d(\Sigma).
\end{equation}

\begin{lemma} \label{cut-vector-formula}
For the cut-vector $\partial^* v$ defined in equation~\eqref{cbdv},
$$\partial^* v=\sum_{\rho\in B} (\det L^{\mathrm{du}}_{A\cup \rho,A\cup \sigma}) \rho.$$
In particular, $\supp(\partial^* v)=B$.
\end{lemma}

\begin{proof}
For each $\rho\in B$, 
\begin{align*}
\scp{\partial^* v,\rho}
 &= \sum_{j=1}^r (-1)^j \det L^{\mathrm{du}}_{A,A\cup \sigma\setminus \sigma_j} \scp{L^{\mathrm{du}} \sigma_j,\rho}\\
 &= \sum_{j=1}^r (-1)^j \det L^{\mathrm{du}}_{A,A\cup \sigma\setminus \sigma_j} \scp{\partial \sigma_j,\partial \rho}\\
 &= \sum_{j=1}^r (-1)^j \det L^{\mathrm{du}}_{A,A\cup \sigma\setminus \sigma_j} L^{\mathrm{du}}_{\rho,\sigma_j}\\
 &= \det L^{\mathrm{du}}_{A\cup \rho,A\cup \sigma},
\end{align*}
where the last equality comes from expanding the row corresponding
to~$\rho$.  Note that $\det L^{\mathrm{du}}_{A\cup \rho,A\cup \sigma}\neq0$
for
$\rho=\sigma$, so $\partial^* v\neq 0$.  On the other hand, by Cramer's
rule, $v$ is orthogonal to $\partial \sigma_1,\dots, \partial \sigma_{r-1}$, so in fact $\scp{\partial^* v,\rho}=0$ for all $\rho\in \Sigma_d \setminus B$.
This establishes the desired formula for $\partial^* v$, and then $\supp(\partial^* v)=B$ by Lemma~\ref{cbd-of-what}.
\end{proof}

Equation~\eqref{cbdv} does not provide a canonical cut-vector
associated to a given bond~$B$, because $\partial^* v$ depends on the choice of~$A$
and~$\sigma$.  On the other hand, the bond~$B$ can always be expressed as a fundamental
bond $\bond(\Upsilon,\sigma)$
(equivalently, fundamental cocircuit; see equation~\eqref{fund-bond} in Section~\ref{matroid-subsection}) by 
taking~$\sigma$ to be an arbitrary facet of~$B$ and taking
$\Upsilon=A\cup\sigma$, where~$A$ is a maximal acyclic subset of
$\Sigma\setminus B$.  This observation suggests that the underlying combinatorial data
that gives rise to a cut-vector is really the pair $(\Upsilon,\sigma)$.



\begin{definition} \label{uncal-bond-vector}
Let $\Upsilon = \{\sigma_1, \sigma_2, \ldots, \sigma_r\}$ be a cellular spanning forest of~$\Sigma$, and let $\sigma=\sigma_i\in\Upsilon$.
The \emph{(uncalibrated) characteristic vector} of the bond $\bond(\Upsilon, \sigma)$ is:
$$\uncalcut(\Upsilon,\sigma) = \sum_{j=1}^r (-1)^j (\det L^{\mathrm{du}}_{\Upsilon\setminus\sigma, \Upsilon\setminus\sigma_j}) L^{\mathrm{du}}\sigma_j$$
By Lemma~\ref{cut-vector-formula}, taking $A=\Upsilon\setminus \sigma$, we have
$$
\uncalcut(\Upsilon,\sigma) = \sum_{\rho\in\bond(\Upsilon,\sigma)} (\det L^{\mathrm{du}}_{\Upsilon\setminus \sigma\cup \rho,\Upsilon}) \rho,
$$
a cut-vector supported on $\bond(\Upsilon,\sigma)$.
\end{definition}

The next result is the cellular analogue of~\cite[Lemma~14.1.3]{GodRoy}.

\begin{theorem} \label{cut-basis}
The family $\{\uncalcut(\Upsilon,\sigma) \colon \sigma\in \Upsilon\}$
is a $\mathbb{R}$-vector space basis for the cut space of $\Sigma$.
\end{theorem}

\begin{proof}
Let $\sigma\in\Upsilon$.  Then $\supp\uncalcut(\Upsilon,\sigma)=\bond(\Upsilon,\sigma)$ contains $\sigma$, but no other facet
of~$\Upsilon$.  Therefore, the set of characteristic vectors
is linearly independent,
and its cardinality is $|\Upsilon_d|=r=\dim\Cut_d(\Sigma)$.
\end{proof}

\begin{example}\label{bipyramid-cut}
The \emph{equatorial bipyramid} is the two-dimensional
simplicial complex $\Theta$ with facet set $\{123,124,125,134,135,234,235\}$
(Figure~\ref{BipyramidFigure}(a)).
Let $\Upsilon$ be the simplicial spanning tree with facets $\{123,124,234,135,235\}$ (unfolded in Figure~\ref{BipyramidFigure}(b)).  Then
\begin{align*}
\bond(\Upsilon,123)&=\{123,125,134\}, & \bond(\Upsilon,124)&=\{124,134\},\\
\bond(\Upsilon,135)&=\{135,125\}, & \bond(\Upsilon,234)&=\{234,134\},\\
\bond(\Upsilon,235)&=\{235,125\}.
\end{align*}
In each case, the removal of the bond leaves a 1-dimensional hole (as shown for the bond $\{123, 125, 134\}$ in Figure~\ref{BipyramidFigure}(c)).
By Theorem~\ref{cut-basis}, we have
\begin{align*}
\uncalcut(\Upsilon,123) &= 75([123]+[125]-[134]), &
\uncalcut(\Upsilon,124) &= 75([124]+[134]),\\
\uncalcut(\Upsilon,135) &= 75([125]+[135]), &
\uncalcut(\Upsilon,234) &= 75([134]+[234]),\\
\uncalcut(\Upsilon,235) &= 75([235]-[125]),
\end{align*}
which indeed form a basis for $\Cut_2(\Theta)$.
\begin{figure}[tb]
\includefigure{5.44in}{1.88in}{bipyramid-figures-newer.pdf}
\caption{\label{BipyramidFigure}
(a) The bipyramid $\Theta$. (b) A simplicial spanning tree
(unfolded). (c) Deleting the bond $\{123,134,125\}$.}
\end{figure}
\end{example}

\subsection{Calibrating the characteristic vector of a bond}

The term ``characteristic vector'' suggests that the coefficients of
$\uncalcut(\Upsilon,\sigma)$ should all be~0 or~1, 
but this is not necessarily possible, even by scaling, as Example~\ref{double-ravioli} below will show.
We would like to define the characteristic vector of a bond so that
it carries combinatorial or topological information,
avoiding extra factors such as the 
75 in Example~\ref{bipyramid-cut}.
We will show that the number
\begin{equation} \label{calfactor}
\mu_\Upsilon :=
{\bf t}_{d-1}(\Upsilon)\sum_\Gamma \frac{{\bf t}_{d-1}(\Sigma,\Gamma)^2}{{\bf t}_{d-1}(\Sigma)^2},
\end{equation}
where the sum runs over all relatively acyclic $(d-1)$-subcomplexes $\Gamma\subseteq \Sigma$,
divides every coefficient of the characteristic
vector.  Moreover, we will show that the entries of $\frac{1}{\mu_\Upsilon}
\uncalcut(\Upsilon,\sigma)$ are (up to sign) the torsion coefficients
of the cellular forests $\{\Upsilon\setminus\sigma\cup\rho\}$ for $\rho\in\bond(\Upsilon,\sigma)$.

Let $\varepsilon^A_{\sigma,\sigma'}$ be the relative sign of $\partial \sigma,\partial \sigma'$ with respect to $\partial A$; that is, it is $+1$ or $-1$ according to whether
$\partial \sigma$ and $\partial \sigma'$ lie on the same or the opposite sides of the hyperplane in $\im\partial$ spanned by $\partial A$.  In the language of oriented matroids, this sign is simply a product of the entries corresponding to $\partial \sigma$ and $\partial \sigma'$ in one of the cocircuits corresponding to the hyperplane and determines the relative signs of a basis orientation on $A \cup \sigma$ and $A \cup \sigma'$~\cite[Section 3.5]{RedBook}.

\begin{proposition} \label{calculate-L}
Let $\Sigma$ be a cell complex of rank~$r$.
Let $\Upsilon=A\cup \sigma$ and $\Upsilon'=A\cup \sigma'$ be $d$-dimensional cellular spanning forests of $\Sigma$.
Let $L^{\mathrm{du}}_{\Upsilon,\Upsilon'}$ be the restriction of the down-up Laplacian $L^{\mathrm{du}}=\partial^*\partial$ to the rows indexed by $\Upsilon$
and the columns indexed by $\Upsilon'$.
Then
$$\det L^{\mathrm{du}}_{\Upsilon,\Upsilon'} = \det\partial^*_\Upsilon\partial_{\Upsilon'} = \varepsilon \mu_\Upsilon {\bf t}_{d-1}(\Upsilon')$$
where $\varepsilon=\varepsilon^A_{\sigma,\sigma'}$.
\end{proposition}

\begin{proof}
By the Binet-Cauchy formula, we have
\begin{equation} \label{detL}
\det L^{\mathrm{du}}_{\Upsilon,\Upsilon'} = \sum_S (\det \partial^*_{\Upsilon,S})(\det\partial_{S,\Upsilon'}) = \sum_S (\det \partial_{S,\Upsilon})(\det\partial_{S,\Upsilon'}),
\end{equation}
where the sum runs over all sets $S\subseteq \Sigma_{d-1}$ with
$|S|=r$, and $\partial_{S,\Upsilon}$ is the corresponding $r\times r$ submatrix
of~$\partial$.  By Proposition~\ref{det-is-homology}, $\det\partial_{S,\Upsilon}$ is nonzero if and only if $\Gamma_S=\Sigma_{d-1}\setminus S$ is relatively acyclic, and for those summands 
Proposition~\ref{relative-tor-formula} implies
$|\det\partial_{S,\Upsilon}|={\bf t}_{d-1}(\Upsilon,\Gamma_S)={\bf t}_{d-1}(\Upsilon){\bf t}_{d-1}(\Sigma,\Gamma_S)/{\bf t}_{d-1}(\Sigma)$.
The sign of each summand in equation~\eqref{detL} is just
$\varepsilon$, so
\begin{align*}
\det L^{\mathrm{du}}_{\Upsilon,\Upsilon'}
&= \sum_S (\det \partial_{S,\Upsilon})(\det\partial_{S,\Upsilon'})\\
&= \sum_S \varepsilon \left(\frac{{\bf t}_{d-1}(\Upsilon)  {\bf t}_{d-1}(\Sigma,\Gamma_S)}{{\bf t}_{d-1}(\Sigma)}\right)
  \left(\frac{{\bf t}_{d-1}(\Upsilon')  {\bf t}_{d-1}(\Sigma,\Gamma_S)}{{\bf t}_{d-1}(\Sigma)}\right)\\
&= \varepsilon\frac{{\bf t}_{d-1}(\Upsilon){\bf t}_{d-1}(\Upsilon')}{{\bf t}_{d-1}(\Sigma)^2} \sum_\Gamma {\bf t}_{d-1}(\Sigma,\Gamma)^2\\ 
&= \varepsilon \mu_\Upsilon {\bf t}_{d-1}(\Upsilon').\qedhere
\end{align*}
\end{proof}

\begin{theorem}\label{calibration}
Let $B$ be a bond.  Fix a facet $\sigma\in B$ and a cellular forest $A\subseteq \Sigma_d\setminus B$,
so that in fact $B=\bond(A\cup \sigma,\sigma)$.  Define
the \emph{characteristic vector of $B$ with respect to $A$} as
$$\calcut{A}{B} := \frac{1}{\mu_\Upsilon}\uncalcut(A\cup \sigma,\sigma)
=\sum_{\rho\in B} \varepsilon^A_{\sigma,\rho} {\bf t}_{d-1}(A\cup \rho) \,\, \rho.$$
Then $\calcut{A}{B}$ is in the cut space of $\Sigma$, and has integer coefficients.
Moreover, it depends on the choice of $\sigma$ only up to sign.
\end{theorem}

\begin{proof}
Apply the formula of Proposition~\ref{calculate-L} to the 
formula of Definition~\ref{uncal-bond-vector} for the characteristic vector, and
factor the integer $\mu_\Upsilon$ out of every coefficient.
Meanwhile, replacing $\sigma$ with a different facet $\sigma'\in B$ merely
multiplies all coefficients by
$\varepsilon^A_{\sigma',\rho}/\varepsilon^A_{\sigma,\rho}=\varepsilon^A_{\sigma,\sigma'}\in\{\pm1\}$.
\end{proof}

If $\Upsilon$ is a cellular spanning forest of $\Sigma$
and $\sigma\in\Upsilon_d$, then we define
the \emph{characteristic vector} of the pair $(\Upsilon,\sigma)$ by
\begin{equation} \label{calcut-upsilon-sigma}
\calcutta{\Upsilon}{\sigma} := \calcut{\Upsilon\setminus\sigma}{\bond(\Upsilon,\sigma)} = \frac{1}{\mu_\Upsilon}\uncalcut(\Upsilon,\sigma).
\end{equation}

\begin{example} \label{ta-da}
Let $\Theta$ be the bipyramid of Example~\ref{bipyramid-cut}.
Every cellular spanning forest $\Upsilon\subseteq \Theta$ is torsion-free.
Moreover, the relatively acyclic subcomplexes $\Gamma$ that appear in equation~\eqref{calfactor}
are the spanning trees of the 1-skeleton $\Theta_{(1)}$ (see Section~\ref{cellular-forest}), which is the graph $K_5$ with one edge removed;
Accordingly, we have $\mu_\Upsilon=\tau(\Theta_{(1)})=75$, so the calibrated characteristic vectors
are as in Example~\ref{bipyramid-cut}, with all factors of 75 removed.
\end{example}

On the other hand, $\mu_\Upsilon$ is not necessarily the \emph{greatest} common factor of the
entries of each uncalibrated characteristic vector, as the following example illustrates.

\begin{example}\label{double-ravioli}
Consider the cell complex $\Sigma$ with a single vertex $v$, 
two 1-cells $e_1$ and $e_2$ attached at $v$, and four 2-cells
attached via the boundary matrix
$$
\partial=\bordermatrix{&\sigma_2&\sigma_3&\sigma_5&\sigma_7\cr
e_1&2&3&0&0\cr e_2&0&0&5&7}.
$$
Let $B$ be the bond $\{\sigma_2,\sigma_3\}$, so that the obvious candidate for
a cut-vector supported on~$B$ is the row vector $\begin{bmatrix}2&3&0&0\end{bmatrix}$.
On the other hand, taking $A=\{\sigma_5\}$ (a cellular spanning forest of $\Sigma \setminus B$),
the calibrated characteristic vector of Theorem~\ref{calibration} is
$$\calcut{A}{B}=\begin{bmatrix}10&15&0&0\end{bmatrix}.$$
For $\Upsilon=A\cup\{\sigma_2\}$, the uncalibrated characteristic vector of Definition~\ref{uncal-bond-vector} is
$$\uncalcut(\Upsilon,\sigma_2)=\begin{bmatrix}100&150&0&0\end{bmatrix}.$$
On the other hand, the calibration
factor $\mu_\Upsilon$ is not $\gcd(100,150)=50$, but rather 10, since ${\bf t}_1(\Upsilon)=10$ and the summation of equation~\eqref{calfactor} has only one term,
namely $\Gamma=\Sigma_{(0)}$.  Similarly, for $A'=\{\sigma_7\}$ and $\Upsilon'=A'\cup\{\sigma_2\}$, we have
$$\calcut{A'}{B}=\begin{bmatrix}14&21&0&0\end{bmatrix},\quad
\uncalcut(\Upsilon',\sigma_2)=\begin{bmatrix}196&294&0&0\end{bmatrix},\quad
\mu_{\Upsilon'}=14.$$
\end{example}

\begin{remark} \label{torsion-in-simplicial-case}
Torsion plays a role in the characteristic vectors of bonds,
even when $\Sigma$ is a simplicial complex.  For example, let $\Sigma$ be the
the complete $2$-dimensional simplicial complex on $6$ vertices and let
$\Upsilon$ be the triangulation of $\mathbb{R}\mathbb{P}^2$ obtained
by identifying opposite faces in an icosahedron.  Then $\Upsilon$ is a cellular spanning forest of
$\Sigma$ (and in fact $\Sigma$ has twelve spanning forests of this kind).  For any facet $\sigma\in\Upsilon$, we have
$\bond(\Upsilon,\sigma)=\Sigma_2\setminus\Upsilon_2\cup\{\sigma\}$,
and the entries of the calibrated cut-vector include both $\pm2$ (in position $\sigma$)
as well as $\pm1$'s (in positions $\Sigma\setminus\Upsilon$).
\end{remark}

\begin{remark} \label{graph-mu}
When $\Sigma$ is a graph and $\Upsilon$ is a spanning forest, $\mu_\Upsilon$ is just the number of vertices of~$\Sigma$.  Then, for any edge~$\sigma$ in~$\Upsilon$, the vector $\calcut{\Upsilon}{\sigma}$ is the usual characteristic vector of the fundamental bond $\bond(\Upsilon,\sigma)$.
\end{remark}

\begin{remark} \label{dual-CMTT}
Taking $\Upsilon=\Upsilon'$ in the calculation of Proposition~\ref{calculate-L}
gives the equality
$$\sum_\Gamma{\bf t}_{d-1}(\Sigma,\Gamma)^2
 =\frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Upsilon)^2}\det L^{\mathrm{du}}_\Upsilon$$
which can be viewed as a dual form of Proposition~\ref{CMFT}, 
enumerating relatively acyclic $(d-1)$-subcomplexes, rather than cellular spanning forests.
\end{remark}

\section{The Flow Space}\label{flowspace-section}
In this section we describe the flow space of a cell complex.  We begin by observing that the cut and flow spaces are orthogonal to each other. 

\begin{proposition} \label{cut-flow-ortho}
The cut and flow spaces are orthogonal complements under the standard inner product on $C_d(\Sigma;\mathbb{R})$.
\end{proposition}

\begin{proof}
First, we show that the cut and flow spaces are orthogonal.
Let $\alpha\in\Cut_d=\im\partial^*_d$ and $\beta\in\Flow_d=\ker\partial_d$.  Then $\alpha = \partial^* \gamma$ for some ($d-1$)-chain $\gamma$, and
$\langle \alpha,\beta\rangle = \langle \partial^*\gamma,\beta\rangle = \langle \gamma,\partial\beta\rangle = 0$
by equation~\eqref{scalar-product-identity}.

It remains to show that $\Cut_d$ and $\Flow_d$ have complementary
dimensions.  Indeed, let $n=\dim C_d(\Sigma;\mathbb{R})$; then $\dim\Flow_d =
\dim\ker\partial_d = n-\dim\im\partial_d = n-\dim\im\partial^*_d = n-\dim\Cut_d$.
\end{proof}

Next we construct a basis of the flow space whose elements correspond to fundamental circuits of a given cellular spanning forest.  Although cuts and flows are in some sense dual constructions, it is easier in this case to work with kernels than images, essentially because of Proposition~\ref{TFAE-lattices}.  As a consequence, we can much more directly obtain a characteristic flow vector whose coefficients carry topological meaning.

We need one preliminary result from linear algebra.

\begin{proposition} \label{flow}
Let $N$ be a matrix with $c$ columns and $r$ rows
such that $\rank N = c-1$.  In particular, $r\geq c-1$ and $\dim\ker N=1$.
Then $\ker N$ has a spanning vector $v=(v_1,\dots,v_c)$ such that
  $$v_i=\pm|\tor(\coker N_{\bar{\imath}})|$$
where $N_{\bar{\imath}}$ denotes the submatrix of $N$ obtained by deleting
the $i^{th}$ column.  In particular, $v_i\neq 0$ for all~$i$.
\end{proposition}

\begin{proof}
Let $Q$ be a $r\times r$ matrix whose first $r-(c-1)$ rows form a $\mathbb{Z}$-module basis
for $\ker(N^T)$, and whose remaining $c-1$ rows extend it to a basis
of $\mathbb{Z}^r$ (see Proposition \ref{TFAE-lattices}).  Then $Q$ is invertible over $\mathbb{Z}$, and the matrix
$P=QN=(N^TQ^T)^T$ has the form
  $$P = \left[\begin{array}{c}0\\\hline M\end{array}\right]$$
where $M$ is a $(c-1)\times c$ matrix whose column matroid
is the same as that of $N$.  Then $\ker N = \ker P = \ker M$.
Meanwhile, by Cramer's rule, $\ker M$ is the one-dimensional space
spanned by $v=(v_1,\dots,v_c)$, where
$v_i=(-1)^i\det M_{\bar{\imath}}=\pm|\coker M_{\bar{\imath}}|=\pm|\tor(\coker P_{\bar{\imath}})|$.
For each $i$, we have a commutative diagram
$$\xymatrix{
0\rto& \im N_{\bar{\imath}} \dto_Q\rto & \widehat{\im N_{\bar{\imath}}} \dto_Q\rto & \tor(\coker N_{\bar{\imath}})\dto\rto & 0\\
0\rto& \im P_{\bar{\imath}} \rto & \widehat{\im P_{\bar{\imath}}} \rto & \tor(\coker P_{\bar{\imath}})\rto & 0
}$$
where the hat denotes saturation (see Section~\ref{lattice-subsection}).
Since $Q$ is invertible, it induces isomorphisms as labeled, so by the snake lemma, the third
vertical arrow is an isomorphism as well.  Hence $|\tor(\coker P_{\bar{\imath}})|=|\tor(\coker N_{\bar{\imath}})|$, completing the proof.
\end{proof}


Recall that a set of facets $C\subseteq \Sigma_d$ is a circuit of the cellular matroid $\mathcal{M}(\Sigma)$ if and only if it corresponds to a minimal linearly dependent set of columns of~$\partial_d$.
Applying Proposition~\ref{flow} with $N=\partial_C$
(i.e., the restriction of $\partial$ to the columns indexed by~$C$), we obtain a flow vector whose support is exactly~$C$.
We call this the \emph{characteristic vector} $\uncalflow(C)$.

\begin{theorem}\label{charflow}
Let $C$ be a circuit of the cellular matroid $\mathcal{M}(\Sigma)$, and let $\Delta\subseteq\Sigma$ be the subcomplex $\Sigma_{(d-1)}\cup C$.  Then
$$\uncalflow(C)=\sum_{\sigma \in C} \pm {\bf t}_{d-1}(\Delta\setminus\sigma) \, \sigma.$$
\end{theorem}

\begin{proof}
For $\sigma\in C$, let $N_{\bar\sigma}$ denote $N$ with the column~$\sigma$ removed.
By Proposition~\ref{flow}, it suffices to show that the two groups
$$\tilde{H}_{d-1}(\Delta\setminus\sigma;\mathbb{Z})=\frac{\ker \partial_{d-1}}{\im N_{\bar{\sigma}}},\qquad
\coker N_{\bar{\sigma}} = \frac{C_{d-1}(\Sigma;\mathbb{Z})}{\im N_{\bar{\sigma}}}$$
have the same torsion summands.  But this is immediate because $\ker\partial_{d-1}$ is a summand of $C_{d-1}(\Sigma;\mathbb{Z})$
as a free $\mathbb{Z}$-module.
\end{proof}


\begin{example}
Consider the cell complex $\Sigma$ with two vertices $v_1$ and $v_2$,
three one-cells $e_1$, $e_2$, and $e_3$, each one with endpoints $v_1$ and $v_2$, 
and three two-cells 
$\sigma_1$, $\sigma_2$, and $\sigma_3$ attached to the 2-cells so that 
the 2-dimensional boundary matrix is
$$
\partial = \bordermatrix{&\sigma_1 & \sigma_2 & \sigma_3 \cr
e_1 & 2 &  2 &  0 \cr
e_2 & -2 &  0 &  1 \cr
e_3 & 0 & -2 & -1
}.
$$
The only circuit in $\Sigma$ is the set $C$ of all three 2-cells; then
$\uncalflow(C) = 2\sigma_1 + 2\sigma_2 + 4\sigma_3$, because
$\tilde{H}_2(\Delta\setminus \sigma_1;\mathbb{Z}) = \tilde{H}_2(\Delta\setminus\sigma_2;\mathbb{Z}) = \mathbb{Z} \oplus \mathbb{Z}_2$, but
$\tilde{H}_2(\Delta\setminus \sigma_3;\mathbb{Z}) = \mathbb{Z} \oplus \mathbb{Z}_2 \oplus \mathbb{Z}_2$.
\end{example}

For a cellular spanning forest $\Upsilon$ and facet $\sigma\not\in\Upsilon$, 
let $\circuit(\Upsilon,\sigma)$ denote 
the \emph{fundamental circuit of $\sigma$ with respect to $\Upsilon$}, 
that is, the unique circuit in $\Upsilon\cup\sigma$.

\begin{theorem} \label{flow-basis}
Let $\Sigma$ be a cell complex and $\Upsilon\subseteq\Sigma$ a cellular spanning forest.  Then the set
$$ \{\uncalflow(\circuit(\Upsilon,\sigma)) \colon \sigma \not\in \Upsilon \}$$
forms a $\mathbb{R}$-vector space basis for the flow space of $\Sigma$.
\end{theorem}

\begin{proof}
The flow space is the kernel
of a matrix with $|\Sigma_d|$ columns and rank $|\Upsilon_d|$,
so its dimension is $|\Sigma_d|-|\Upsilon_d|$.  Therefore, it is enough to show that
the $\uncalflow(\circuit(\Upsilon,\sigma))$ are linearly independent.  Indeed, consider the matrix $W$ whose
rows are the vectors $\uncalflow(\circuit(\Upsilon,\sigma))$; its maximal square submatrix $W'$ whose columns correspond to $\Sigma\setminus\Upsilon$
has nonzero entries on the diagonal but zeroes elsewhere.
\end{proof}

\begin{example}
Recall the bipyramid of Example~\ref{bipyramid-cut}, and its spanning tree $\Upsilon$.
Then $\circuit(\Upsilon, 125) = \{125, 123, 135, 235\}$, and 
$\circuit(\Upsilon, 134) = \{134, 123, 124, 234\}$.
If we instead consider the spanning tree $\Upsilon' = \{124, 125, 134, 135, 235\}$, 
then $\circuit(\Upsilon', 123) = \{123, 125, 135, 235\}$, and 
$\circuit(\Upsilon', 234) = \{234, 124, 125, 134, 135, 235\}$.
Each of these circuits is homeomorphic to a 2-sphere,
and the corresponding flow vectors are the homology classes they
determine.  
Furthermore, each of $\{\circuit(\Upsilon, 125), \circuit(\Upsilon, 134)\}$ and 
$\{\circuit(\Upsilon', 123), \circuit(\Upsilon', 234)\}$ is a basis of the flow space.
\end{example}

\section{Integral Bases for the Cut and Flow Lattices} \label{integral-bases-section}

Recall that the \emph{cut lattice} and \emph{flow lattice} of~$\Sigma$ are defined as
$$
\mathcal{C} = \mathcal{C}(\Sigma) = \im_\mathbb{Z}\partial^*_d \subseteq \mathbb{Z}^n, \qquad \mathcal{F} = \mathcal{F}(\Sigma) = \ker_\mathbb{Z}\partial_d \subseteq \mathbb{Z}^n.
$$
In this section, we study the conditions under which the vector space bases of Theorems~\ref{calibration}
and~\ref{flow-basis} are integral bases for the cut and flow lattices respectively.

\begin{theorem} \label{integral-basis-cut}
Suppose that $\Sigma$ has a cellular spanning forest~$\Upsilon$
such that $\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})$ is torsion-free.  Then
$$\{\calcutta{\Upsilon}{\sigma}\colon \sigma\in\Upsilon\}$$
is an integral basis for the cut lattice~$\mathcal{C}(\Sigma)$,
where $\calcutta{\Upsilon}{\sigma}$ is defined as in equation~\eqref{calcut-upsilon-sigma}.
\end{theorem}

\begin{proof}
Consider the $n\times r$ matrix with columns $\calcutta{\Upsilon}{\sigma}$
for $\sigma\in\Upsilon_d$.
Its restriction to the rows $\Upsilon_d$ is diagonal, and by Theorem~\ref{cut-basis}
and the hypothesis on $\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})$, its entries are all $\pm1$.  Therefore, the $\calcutta{\Upsilon}{\sigma}$
form an integral basis for the lattice $\Cut_d(\Sigma)\cap\mathbb{Z}^n$.
Meanwhile,
$$(\Cut_d(\Sigma)\cap\mathbb{Z}^n)/\mathcal{C}_d(\Sigma)=\tor(\tilde{H}^d(\Sigma;\mathbb{Z}))\cong\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))$$
where the first equality is because $\Cut_d(\Sigma)\cap\mathbb{Z}^n$ is a summand of $\mathbb{Z}^n$, 
and the second one is equation~\eqref{UCTC}.
On the other hand, $\tilde{H}_{d-1}(\Sigma;\mathbb{Z})$ is a quotient of $\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})$ of equal rank; 
in particular, $\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))=0$ and
in fact $\Cut_d(\Sigma)\cap\mathbb{Z}^n=\mathcal{C}_d(\Sigma)$.
\end{proof}

Next we consider integral bases of the flow lattice.
For a circuit~$C$, define
$$\calflow(C)=\frac1g\uncalflow(C)$$
where $\uncalflow(C)$ is the characteristic vector
defined in Section~\ref{flowspace-section}
and $g$ is the gcd of its coefficients.  Thus $\calflow(C)$
generates the rank-1 free $\mathbb{Z}$-module of flow vectors supported
on $C$.

\begin{theorem}\label{integral-basis-flow}
Suppose that $\Sigma$ has a cellular spanning forest $\Upsilon$ such that $\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})=\tilde{H}_{d-1}(\Sigma;\mathbb{Z})$.
Then $\{\calflow(\circuit(\Upsilon,\sigma))\colon \sigma\not\in\Upsilon\}$ is an integral basis for the
flow lattice~$\mathcal{F}(\Sigma)$.
\end{theorem}

\begin{proof}
By the hypothesis on~$\Upsilon$, the columns of~$\partial$ indexed by the facets in~$\Upsilon$ form a $\mathbb{Z}$-basis for the column space.
That is, for every $\sigma\not\in\Upsilon$, the column~$\partial_\sigma$ is
a $\mathbb{Z}$-linear combination of the columns of~$\Upsilon$; equivalently, there is an
element $w_\sigma$ of the flow lattice, with support
$\circuit(\Upsilon,\sigma)$, whose coefficient in the~$\sigma$ position is $\pm 1$.  But then~$w_\sigma$ and
$\calflow(\circuit(\Upsilon,\sigma))$ are integer vectors with the same linear span, both of which have the gcd of their entries equal to 1;
therefore, they must be equal up to sign.  Therefore, retaining the notation of Theorem~\ref{flow-basis}, the matrix~$W'$
is in fact the identity matrix, and it follows that the lattice spanned by the $\calflow(\circuit(\Upsilon,\sigma))$ is saturated, so it must equal
the flow lattice of~$\Sigma$.
\end{proof}

If $\Sigma$ is a graph, then all its subcomplexes and relative complexes are torsion-free
(equivalently, its incidence matrix is totally unimodular).  Therefore, Theorems~\ref{integral-basis-cut} and~\ref{integral-basis-flow}
give integral bases for the cut and flow lattices respectively.  These are, up to sign, the integral bases
constructed combinatorially in, e.g., \cite[Chapter~14]{GodRoy}.

\section{Groups and Lattices} \label{groups-lattices}

In this section, we define the critical, cocritical, and cutflow groups of a cell complex.  We identify
the relationships between these groups and to the discriminant groups of the cut and flow lattices.  The case of a graph was studied in detail by
Bacher, de~la~Harpe and Nagnibeda~\cite{BHN} and Biggs~\cite{Biggs-Chip},
and is presented concisely in~\cite[Chapter~14]{GodRoy}.

Throughout this section, let~$\Sigma$ be a cell complex of dimension~$d$ with $n$ facets,
and identify both $C_d(\Sigma;\mathbb{Z})$ and $C^d(\Sigma;\mathbb{Z})$ with $\mathbb{Z}^n$.

\begin{definition}
The \emph{critical group} of~$\Sigma$ is
\begin{equation*} 
K(\Sigma):=\tor(\ker\partial_{d-1}/\im\partial_{d}\partial^*_{d})=\tor(\coker(\im\partial_{d}\partial^*_{d})).
\end{equation*}
Here and henceforth, all kernels and images are taken over~$\mathbb{Z}$.
\end{definition}
Note that the second and third terms in the definition are equivalent because
$\ker\partial_{d-1}$ is a summand of $C_{d-1}(\Sigma;\mathbb{Z})$ as a free $\mathbb{Z}$-module.
This definition coincides with the usual definition of the critical group of a graph in the case $d=1$, and with
the authors' previous definition in \cite{Critical} in the case that $\Sigma$ is $\mathbb{Q}$-acyclic in codimension~one
(when $\ker\partial_{d-1}/\im\partial_{d}\partial^*_{d}$ is its own torsion summand).

\begin{definition}
The \emph{cutflow group} of $\Sigma$ is $\mathbb{Z}^n/(\mathcal{C}(\Sigma)\oplus\mathcal{F}(\Sigma))$.
\end{definition}

Note that the cutflow group is finite because the cut and flow spaces are orthogonal
complements in~$\mathbb{R}^n$ (Proposition~\ref{cut-flow-ortho}), so in particular $\mathcal{C}\oplus\mathcal{F}$ spans~$\mathbb{R}^n$ as a vector space.
Observe also that the cutflow group does not decompose into separate cut and flow pieces; that is, it is not isomorphic to
the group $G=((\Flow_d\cap \mathbb{Z}^n)/\ker\partial_d)\oplus((\Cut_d\cap \mathbb{Z}^n)/\im\partial^*_d),$
even when $\Sigma$ is a graph.  For example, if $\Sigma$ is the complete graph on three vertices, whose boundary map can be written as
$$\partial=\begin{pmatrix} 1&-1&0\\-1&0&1\\emptyset&1&-1\end{pmatrix},$$
then $\ker\partial=\Span\{(1,1,1)^T\}$ and $\im\partial=\Span\{(1,-1,0)^T,(1,0,-1)^T\}$.
So $G$ is the trivial group, while $\mathbb{Z}^n / ( \ker\partial_d\oplus\im\partial^*_d )=K_1(\Sigma)\cong\mathbb{Z}_3$.

In order to define the cocritical group of a cell complex, we first need to introduce the notion of acyclization.

\begin{definition} \label{acyclization}
An \emph{acyclization} of~$\Sigma$ is a ($d+1)$-dimensional
complex $\Omega$ such that $\Omega_{(d)}=\Sigma$ and
$\tilde{H}_{d+1}(\Omega;\mathbb{Z})=\tilde{H}_d(\Omega;\mathbb{Z})=0$.
\end{definition}

Algebraically, this construction corresponds to
finding an integral basis for $\ker\partial_d(\Sigma)$ and declaring its elements to be the columns
of $\partial_{d+1}(\Omega)$ (so in particular $|\Omega_{(d+1)}|=\tilde\beta_d(\Sigma)$).  The definition of
acyclization and equation~\eqref{UCTC} together imply
that $\tilde{H}^{d+1}(\Omega;\mathbb{Z}) = 0$; that is, $\partial^*_{d+1}(\Omega)$ is surjective.

\begin{definition}
The \emph{cocritical group} $K^*(\Sigma)$ is
\begin{equation*}
K^*(\Sigma) := C_{d+1}(\Omega;\mathbb{Z})/\im\partial^*_{d+1}\partial_{d+1}=\cokerL^{\mathrm{du}}_{d+1}.
\end{equation*}
\end{definition}

It is not immediate that the group $K^*(\Sigma)$ is independent of the choice of~$\Omega$;
we will prove this independence as part of Theorem~\ref{new-flow-theorem}.
For the moment, it is at least clear that $K^*(\Sigma)$ is finite, since $\rank\partial^*_{d+1}=\rankL^{\mathrm{du}}_{d+1}=\rank C_{d+1}(\Omega;\mathbb{Z})$.  In the special case of a graph, the cocritical group coincides with the discriminant group of the lattice generated by the columns of the ``intersection matrix'' defined by Kotani and Sunada~\cite{KS}.
(See also~\cite[Sections 2, 3]{Biggs-Crypto}.) 

\begin{remark} \label{poincare}
As in \cite{Critical}, one can define critical and cocritical groups in every dimension by
$K_i(\Sigma)=\tor(C_i(\Sigma;\mathbb{Z})/\im\partial_{i+1}\partial^*_{i+1})$ 
and
$K^*_i(\Sigma)= \tor(C_i(\Sigma;\mathbb{Z})/\im\partial^*_i\partial_i)$.
If the cellular chain complexes of $\Sigma$ and $\Psi$ are algebraically dual (for example, if $\Sigma$ and $\Psi$  are Poincar\'e dual cell structures on a compact orientable $d$-manifold),
then $K_i(\Psi)=K_{d-i}^*(\Sigma)$ for all $i$.
\end{remark}


We now come to the main results of the second half of the paper:
the critical and cocritical groups are isomorphic to the discriminant groups
of the cut and flow lattices respectively, and the cutflow group mediates between the
critical and cocritical groups, with an ``error term'' given by homology.

\begin{theorem} \label{new-cut-theorem}
Let~$\Sigma$ be a cell complex of dimension~$d$ with $n$ facets.  Then there is a commutative diagram
\begin{equation} \label{cut-CD}
\xymatrix{
0 \rto & \mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F}) \dto^{\alpha}\rto^{\psi} & \mathcal{C}^\sharp/\mathcal{C}\dto^{\beta}\rto & \tor(\tilde{H}^d(\Sigma;\mathbb{Z}))\dto^{\gamma}\rto & 0 \\
0 \rto & \im \partial_d /\im \partial_d\partial^*_d  \rto & K(\Sigma)\rto & \tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))\rto & 0 }
\end{equation}
in which all vertical maps are isomorphisms. In particular, $K(\Sigma) \cong \mathcal{C}^\sharp/\mathcal{C}$.
\end{theorem}

\begin{proof}
\emph{Step 1: Construct the bottom row of~\eqref{cut-CD}.}
The inclusions $\im\partial_d\partial^*_d\subseteq\im\partial_d\subseteq\ker\partial_{d-1}$
give rise to the short exact sequence
\begin{equation*} 
0 \to \im \partial_d/\im \partial_d\partial^*_d \to \ker \partial_{d-1}/\im \partial_d\partial^*_d \to \ker\partial_{d-1}/\im\partial_d\to 0.
\end{equation*}
The first term is finite (because $\rank\partial_d=\rank\partial_d\partial^*_d$), so taking torsion summands yields the desired short exact sequence.

\emph{Step 2: Construct the top row of~\eqref{cut-CD}.}
Let $r=\rank\partial_d$, let $\{v_1,\dots,v_r\}$ be an integral
basis of~$\mathcal{C}$, and let $V$ be the matrix with columns $v_1,\dots,v_r$.
By Proposition~\ref{lattice-projection}, 
the dual basis $\{v_1^*,\dots,v_r^*\}$ for~$\mathcal{C}^\sharp$ consists of the columns of
the matrix $W=V(V^TV)^{-1}$.  Let $\psi$ be the orthogonal projection $\mathbb{R}^n\to\Cut(\Sigma)$,
which is given by the matrix $P=WV^T=V(V^TV)^{-1}V^T$ (see Proposition~\ref{lattice-projection}).  Then
  $$\im\psi=\colspace\left(\underbrace{\big[v_1^*\cdots v_r^*\big]}_{W}\ \underbrace{\big[v_1\cdots v_r\big]^T}_{V^T}\right).$$
The $i^{th}$ column of $P$ equals $W$ times the $i^{th}$ column of $V^T$.
If we identify $\mathcal{C}^\sharp$ with $\mathbb{Z}^r$ via the basis
$\{v_1^*,\dots,v_r^*\}$, then $\im(\psi)$ is just the column space of $V^T$.
So $\mathcal{C}^\sharp/\im\psi\cong\mathbb{Z}^r/\colspace(V^T)$,
which is a finite group because $\rank V=r$.  Since the matrices $V$ and $V^T$ have the same invariant factors,
we have
  $$\mathbb{Z}^r/\colspace(V^T)\cong\tor(\mathbb{Z}^n/\colspace(V))=\tor(C^d(\Sigma;\mathbb{Z})/\im\partial^*_d)=\tor(\tilde{H}^d(\Sigma;\mathbb{Z})).$$
Meanwhile, $\im \psi \supseteq\mathcal{C}$ because $PV=V$.
Since $\ker \psi =\mathcal{F}$, we have
$(\im \psi)/\mathcal{C}=(\mathbb{Z}^n/\mathcal{F})/\mathcal{C}=\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})$.
Therefore, the inclusions
$\mathcal{C}\subseteq\im \psi \subseteq\mathcal{C}^\sharp$ give rise to the short exact sequence
in the top row of~\eqref{cut-CD}.

\emph{Step 3: Describe the vertical maps in~\eqref{cut-CD}.}
The maps $\alpha$ and $\beta$ are each induced by $\partial_d$ in the following ways.
First, the image of the cutflow group under~$\partial_d$ is
$$\partial_d\left(\mathbb{Z}^n/(\mathcal{F}\oplus\mathcal{C})\right)
=\partial_d\left(\mathbb{Z}^n/(\ker\partial_d\oplus\im\partial^*_d)\right)
= \im\partial_d/\im\partial_d\partial^*_d.$$
On the other hand, $\partial_d$ acts injectively on the cutflow group (since the latter is a subquotient of $\mathbb{Z}^n/\ker\partial_d$).
So the map labeled $\alpha$ is an isomorphism.

The cellular boundary map $\partial_d$ also gives rise to the map $\beta\colon \mathcal{C}^\sharp/\mathcal{C}\to K(\Sigma)$, as we now explain.
First, note that $\partial_d\,\mathcal{C}^\sharp\subseteq\im_\mathbb{R}\partial_d\subseteq\ker_\mathbb{R}\partial_{d-1}$.
Second, observe that for every $w\in\mathcal{C}^\sharp$ and $\rho\in C_{d-1}(\Sigma;\mathbb{Z})$, we have $\scp{\partial w,\rho}=\scp{w,\partial^*\rho}\in\mathbb{Z}$,
by equation~\eqref{scalar-product-identity} and the definition of dual lattice.
Therefore, $\partial_d\,\mathcal{C}^\sharp\subseteq C_{d-1}(\Sigma;\mathbb{Z})$.  It follows that
$\partial_d$ maps $\mathcal{C}^\sharp$ to $(\ker_\mathbb{R}\partial_{d-1})\cap C_{d-1}(\Sigma;\mathbb{Z})=\ker_\mathbb{Z}\partial_{d-1}$,
hence defines a map $\beta\colon \mathcal{C}^\sharp/\mathcal{C}\to\ker_\mathbb{Z}\partial_{d-1}/\im_\mathbb{Z} \partial_d\partial^*_d$.
Since $\mathcal{C}^\sharp/\mathcal{C}$ is finite, the image of $\beta$ is purely torsion, hence contained in $K(\Sigma)$.
Moreover, $\beta$ is injective because $(\ker\partial_d)\cap\mathcal{C}^\sharp=\mathcal{F}\cap\mathcal{C}^\sharp=0$ by Proposition~\ref{cut-flow-ortho}.

Every element of $\mathbb{R}^n$ can be written uniquely as $c+f$ with
$c\in\Cut(\Sigma)$ and $f\in\Flow(\Sigma)$.  The map $\psi$ is
orthogonal projection onto $\Cut(\Sigma)$, so $\partial_d(c+f)=\partial_d
c=\partial_d(\psi(c+f))$.  Hence the left-hand square commutes.  The map
$\gamma$ is then uniquely defined by diagram-chasing.


The snake lemma now implies that $\ker\gamma=0$.  Since the groups
$\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))$ and $\tor(\tilde{H}^d(\Sigma;\mathbb{Z}))$ are
abstractly isomorphic by equation~\eqref{UCTC}, in fact $\gamma$ must be an isomorphism and
$\coker\gamma=0$ as well.  Applying the snake lemma again, we see
that all the vertical maps in~\eqref{cut-CD} are isomorphisms.
\end{proof}

\begin{theorem} \label{new-flow-theorem}
Let~$\Sigma$ be a cell complex of dimension~$d$ with $n$ facets.  Then there is a short exact sequence
\begin{equation} \label{flow-SES}
0 \to \tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z})) \to \mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})\to \mathcal{F}^\sharp/\mathcal{F}\to 0.
\end{equation}
Moreover, $K^*(\Sigma)\cong\mathcal{F}^\sharp/\mathcal{F}$.
\end{theorem}
\begin{proof}
Let $\Omega$ be an acyclization of $\Sigma$.  By construction, the columns of the matrix $A$ representing $\partial_{d+1}(\Omega)$
form an integral basis for $\mathcal{F}=\ker\partial_d$.  Again,
the matrix $Q=A(A^TA)^{-1}A^T$ represents orthogonal projection
$\mathbb{R}^n\to\Flow(\Sigma)$.  The maximal minors of $A$ have gcd 1 (because $\mathcal{F}$ is a summand of $\mathbb{Z}^n$, 
so the columns of $A$ are part of an integral basis), so by 
Proposition~\ref{lattice-projection}, 
the columns of $Q$ generate the lattice $\mathcal{F}^\sharp$.  Therefore,
if we regard $Q$ as a map of $\mathbb{Z}$-modules, it defines a surjective homomorphism $\mathbb{Z}^n\to\mathcal{F}^\sharp$.
This map fixes~$\mathcal{F}$ pointwise and its kernel is the saturation~$\hat\mathcal{C}:=(\mathcal{C}\otimes\mathbb{R})\cap\mathbb{Z}^n$.
So we have short exact sequences
$0 \to \hat\mathcal{C} \to \mathbb{Z}^n/\mathcal{F}\to\mathcal{F}^\sharp/\mathcal{F} \to 0$ and
$$
0 \to \hat\mathcal{C}/\mathcal{C} \to \mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})\to\mathcal{F}^\sharp/\mathcal{F} \to 0.
$$
Since $\hat\mathcal{C}$ is a summand of $\mathbb{Z}^n$ by Proposition~\ref{TFAE-lattices}, we can identify $\hat\mathcal{C}/\mathcal{C}$ with $\tor(\tilde{H}^d(\Sigma;\mathbb{Z}))
\cong\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))$,
 which gives the short exact sequence~\eqref{flow-SES}.

We will now show that $\mathcal{F}^\sharp/\mathcal{F}\cong K^*(\Sigma)$.  To see this, observe that
$\partial^*_{d+1}(\mathcal{F}^\sharp)=\partial^*_{d+1}(\colspace(Q))=\colspace(A^TQ)=\colspace(A^T)=\im\partial^*_{d+1}=C_{d+1}(\Omega)$
(by the construction of an acyclization).
In addition,
$\ker\partial^*_{d+1}$ is orthogonal to $\mathcal{F}^\sharp$, hence their intersection is zero.
Therefore, $\partial^*_{d+1}$ defines an isomorphism $\mathcal{F}^\sharp\to C_{d+1}(\Omega)$.
Moreover, the same map $\partial^*_{d+1}$ maps $\mathcal{F}=\ker\partial_d=\im\partial_{d+1}$ surjectively onto 
$\im\partial^*_{d+1}\partial_{d+1}$.
\end{proof}

\begin{corollary} \label{if-no-torsion}
If $\tilde{H}_{d-1}(\Sigma;\mathbb{Z})$ is torsion-free, then the groups
$K(\Sigma)$, $K^*(\Sigma)$, $\mathcal{C}^\sharp/\mathcal{C}$, $\mathcal{F}^\sharp/\mathcal{F}$,
and $\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})$ are all isomorphic to each other.
\end{corollary}

Corollary~\ref{if-no-torsion} includes the case that $\Sigma$ is a
graph, as studied by Bacher, de~la~Harpe and Nagnibeda~\cite{BHN} and
Biggs~\cite{Biggs-Chip}.  It also includes the combinatorially important
family of Cohen-Macaulay simplicial complexes, as well as
cellulations of compact orientable manifolds.

\begin{example}
Suppose that $\tilde{H}_d(\Sigma;\mathbb{Z})=\mathbb{Z}$ and that $\tilde{H}_{d-1}(\Sigma;\mathbb{Z})$
is torsion-free.  Then the flow lattice is generated by a single
element, and it follows from Corollary~\ref{if-no-torsion} that
$K(\Sigma)\cong K^*(\Sigma)\cong\mathcal{F}^\sharp/\mathcal{F}$ is a cyclic group.
For instance, if $\Sigma$ is homeomorphic to a cellular sphere or torus,
then the critical group is cyclic of order equal to the number of
facets.  (The authors had previously proved this fact for simplicial
spheres~\cite[Theorem~3.7]{Critical}, but this approach
using the cocritical group makes the statement more general
and the proof transparent.)
\end{example}

\begin{example} \label{RPtwo}
Let $\Sigma$ be the standard cellulation $e^0\cup e^1\cup e^2$
of the real projective plane,
whose cellular chain complex is
$$\mathbb{Z}~\xrightarrow{\partial_2=2}~\mathbb{Z}~\xrightarrow{\partial_1=0}~\mathbb{Z}.$$
Then $\mathcal{C}=\im\partial^*_2=2\mathbb{Z}$, $\mathcal{C}^\sharp=\frac12\mathbb{Z}$, and
$K(\Sigma)=\mathcal{C}^\sharp/\mathcal{C}=\mathbb{Z}_4$.  Meanwhile,
$\mathcal{F}=\mathcal{F}^\sharp=\mathcal{F}^\sharp/\mathcal{F}=K^*(\Sigma)=0$.
The cutflow group is $\mathbb{Z}_2$.  Note that the rows of Theorem~\ref{new-cut-theorem} are not split in this case.
\end{example}

\begin{example} \label{Vic}
Let $a,b\in\mathbb{Z}\setminus\{0\}$.
Let $\Sigma$ be the cell complex whose cellular chain complex is
$$\mathbb{Z}~\xrightarrow{\partial_2=[a\ b]}~\mathbb{Z}~\xrightarrow{\partial_1=0}~\mathbb{Z}.$$
Topologically, $\Sigma$ consists of a vertex $e^0$, a loop $e^1$, and two facets
of dimension~2 attached along $e^1$ by maps of degrees~$a$ and $b$.
Then
$$\mathcal{C}^\sharp/\mathcal{C}=\mathbb{Z}_\tau,\qquad \mathbb{Z}^2/(\mathcal{C}\oplus\mathcal{F})=\mathbb{Z}_{\tau/g},\qquad
\mathcal{F}^\sharp/\mathcal{F}=\mathbb{Z}_{\tau/g^2},$$
where $\tau=a^2+b^2$ and $g=\gcd(a,b)$. Note that $\tau=\tau_2(\Sigma)$ is the complexity of $\Sigma$ (see equation~\eqref{complexity})
and that $g=|\tilde{H}_1(\Sigma;\mathbb{Z})|$.
The short exact sequence of Theorem~\ref{new-flow-theorem}
is in general not split (for example, if $a=6$ and $b=2$).
\end{example}

\section{Enumeration}\label{sec:sizes}

For a connected graph, the cardinality of the critical group equals the number of spanning trees.
In this section, we calculate the cardinalities of the
various group invariants of~$\Sigma$.

Examples~\ref{RPtwo} and~\ref{Vic} both
indicate that $K(\Sigma)\cong\mathcal{C}^\sharp/\mathcal{C}$ should have cardinality
equal to the complexity $\tau(\Sigma)$.
Indeed, in Theorem~4.2 of~\cite{Critical}, the authors proved that $|K(\Sigma)|=\tau(\Sigma)$ whenever $\Sigma$ has a cellular spanning tree $\Upsilon$ such that $\tilde{H}_{d-1}(\Upsilon;\mathbb{Z})=\tilde{H}_{d-1}(\Sigma;\mathbb{Z})=0$ (in particular, $\Sigma$ must be not merely
$\mathbb{Q}$-acyclic, but actually $\mathbb{Z}$-acyclic, in codimension~one).
Here we prove that this condition is actually not necessary: for any cell complex,
the order of the critical group $K(\Sigma)$
equals the torsion-weighted complexity $\tau(\Sigma)$.  Our approach is to determine the size of the discriminant group
$\mathcal{C}^\sharp/\mathcal{C}$ directly, then use the short exact sequences of Theorems~\ref{new-cut-theorem} and~\ref{new-flow-theorem} to calculate
the sizes of the other groups.

\begin{theorem} \label{all-counts}
Let $\Sigma$ be a $d$-dimensional cell complex and 
let ${\bf t}={\bf t}_{d-1}(\Sigma)=|\tor(\tilde{H}_{d-1}(\Sigma;\mathbb{Z}))|$.  Then
\begin{align*}
|\mathcal{C}^\sharp/\mathcal{C}| = |K(\Sigma)| &= \tau_d(\Sigma),\\
|\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})| &= \tau_d(\Sigma)/{\bf t}, \ \ \text{and}\\
|\mathcal{F}^\sharp/\mathcal{F}| = |K^*(\Sigma)| &= \tau_d(\Sigma)/{\bf t}^2.
\end{align*}
\end{theorem}

\begin{proof}
By Theorems~\ref{new-cut-theorem} and~\ref{new-flow-theorem}, it is enough to prove that $|\mathcal{C}^\sharp/\mathcal{C}|=\tau_d(\Sigma)$.

Let $R$ be a set of $(d-1)$-cells corresponding to a row basis for $\partial$
(hence a vector space basis for $\Cut(\Sigma)$); let $\mathcal{R}$ be the lattice spanned by those rows (which is a full-rank integral sublattice of $\mathcal{C}$);
and let $\Gamma=(\Sigma_{d-1}\setminus R)\cup\Sigma_{(d-2)}$.
The inclusions $\mathcal{R}\subseteq\mathcal{C}\subseteq C^d(\Sigma)$ give rise to a short exact sequence
$0\to\mathcal{C}/\mathcal{R}\to\tilde{H}^d(\Sigma,\Gamma;\mathbb{Z})\to\tilde{H}^d(\Sigma;\mathbb{Z})\to0$.
Since $\mathcal{C}/\mathcal{R}$ is finite, the torsion summands form
a short exact sequence (see Section~\ref{cellular-forest}).
Taking cardinalities and using equation~\eqref{UCTC}, we get
\begin{equation} \label{CC-LL}
|\mathcal{C}/\mathcal{R}|=
\frac{|\tor(\tilde{H}^d(\Sigma,\Gamma;\mathbb{Z}))|}{|\tor(\tilde{H}^d(\Sigma;\mathbb{Z}))|}=\frac{{\bf t}_{d-1}(\Sigma,\Gamma)}{{\bf t}_{d-1}(\Sigma)}.
\end{equation}
The inclusions $\mathcal{R}\subseteq\mathcal{C}\subseteq\mathcal{C}^\sharp\subseteq\mathcal{R}^\sharp$ give
$|\mathcal{R}^\sharp/\mathcal{R}| = |\mathcal{R}^\sharp/\mathcal{C}^\sharp| \cdot|\mathcal{C}^\sharp/\mathcal{C}| \cdot|\mathcal{C}/\mathcal{R}|$.
Moreover, $\mathcal{R}^\sharp/\mathcal{C}^\sharp\cong\mathcal{C}/\mathcal{R}$.  By equation~\eqref{CC-LL} and Binet-Cauchy, we have
\begin{align*}
|\mathcal{C}^\sharp/\mathcal{C}| &= \frac{|\mathcal{R}^\sharp/\mathcal{R}|}{|\mathcal{R}^\sharp/\mathcal{C}^\sharp| \cdot|\mathcal{C}/\mathcal{R}|}
= \frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Sigma,\Gamma)^2}\ |\mathcal{R}^\sharp/\mathcal{R}|\\
&= \frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Sigma,\Gamma)^2}\ \det(\partial_R\partial^*_R)\\
&= \sum_{\Upsilon\subseteq \Sigma_d\colon |\Upsilon|=r} \frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Sigma,\Gamma)^2}\ \det(\partial_{R,\Upsilon})^2.
\end{align*}
By Proposition~\ref{det-is-homology}, the summand is nonzero if and only if $\Upsilon$ is a cellular spanning forest.
In that case, the matrix $\partial_{R,\Upsilon}$ is the cellular boundary matrix of the relative complex $(\Upsilon,\Gamma)$,
and its determinant is (up to sign) ${\bf t}_{d-1}(\Upsilon,\Gamma)$, so
by Proposition~\ref{relative-tor-formula} we have
$$
|\mathcal{C}^\sharp/\mathcal{C}|
~= \sum_\Upsilon \frac{{\bf t}_{d-1}(\Sigma)^2}{{\bf t}_{d-1}(\Sigma,\Gamma)^2}\ {\bf t}_{d-1}(\Upsilon,\Gamma)^2 
~= \sum_\Upsilon {\bf t}_{d-1}(\Upsilon)^2
$$
with the sums over all cellular spanning forests $\Upsilon\subseteq \Sigma$.
\end{proof}

Dually, we can interpret the cardinality of the cocritical group as
enumerating cellular spanning forests by relative torsion (co)homology,
as follows.

\begin{theorem} \label{cocritical-count}
Let $\Omega$ be an acyclization of $\Sigma$.  Then
$$|K^*(\Sigma)| = \sum_{ \Upsilon} |\tilde{H}^{d+1}(\Omega,\Upsilon;\mathbb{Z})|^2
= \sum_{ \Upsilon} |\tilde{H}_d(\Omega,\Upsilon;\mathbb{Z})|^2$$
with the sums over all cellular spanning forests $\Upsilon\subseteq \Sigma$.
\end{theorem}

Note that the groups $\tilde{H}^{d+1}(\Omega,\Upsilon;\mathbb{Z})$ and $\tilde{H}_d(\Omega,\Upsilon;\mathbb{Z})$
are all finite, by definition of acyclization.

\begin{proof}
Let $\partial_{d+1}=\partial_{d+1}(\Omega)$.
Note that $\rank\partial_{d+1}=\tilde\beta_d(\Sigma)$; abbreviate this number as $b$.
By Binet-Cauchy, we have
$$|K^*(\Sigma)| = |\det\partial^*_{d+1}\partial_{d+1}|
= \sum_{B\subseteq\Omega_d\colon |B|=b} (\det\partial^*_B)^2$$
where $\partial_B$ denotes the submatrix of $\partial$ with rows $B$.
Letting $\Upsilon=\Sigma\setminus B$, 
we can regard $\partial_B$ as the cellular boundary map
of the relative complex $(\Omega,\Upsilon)$, which consists
of~$b$ cells in each of dimensions~$d$ and $d+1$.
By Proposition~\ref{det-is-homology}, the summand is nonzero
if and only if $\Upsilon$ is a cellular spanning tree
of $\Omega_{(d)}=\Sigma$.  (Note that the $d+1,B,\Upsilon,\Omega_{(d)}$
in the present context correspond respectively to the $d,R,\Gamma,\Upsilon$ of
Proposition~\ref{det-is-homology}.)  For these summands,
$H^{d+1}(\Omega,\Upsilon;\mathbb{Z})=H_d(\Omega,\Upsilon;\mathbb{Z})$
is a finite group of order $|\det\partial_B|$.
\end{proof}

\begin{remark}
Let $\tau^*(\Sigma)=\sum_\Upsilon |\tilde{H}_d(\Omega,\Upsilon;\mathbb{Z})|^2$, as in
Theorem~\ref{cocritical-count}.  Then combining Theorems~\ref{all-counts} and Theorems~\ref{cocritical-count} gives
\begin{alignat*}{2} 
|\mathcal{C}^\sharp/\mathcal{C}| = |K(\Sigma)| &=  \tau(\Sigma)  & &= \tau^*(\Sigma)\cdot{\bf t}^2,\\
|\mathcal{F}^\sharp/\mathcal{F}| = |K^*(\Sigma)| &=  \tau^*(\Sigma) & &= \tau(\Sigma)/{\bf t}^2,\\
|\mathbb{Z}^n/(\mathcal{C}\oplus\mathcal{F})| &=  \tau(\Sigma)/{\bf t}  & &= \tau^*(\Sigma)\cdot{\bf t},
\end{alignat*}
highlighting the duality between the cut and flow lattices.
\end{remark}

\section{Bounds on combinatorial invariants from lattice geometry} \label{Hermite}

Let $n\geq 1$ be an integer.  The \emph{Hermite constant} $\gamma_n$
is defined as the maximum value of
\begin{equation} \label{herm}
\left(\min_{x\in\mathcal{L}\setminus\{0\}}\langle x,x\rangle\right) (|\mathcal{L}^\sharp/\mathcal{L}|)^{-1/n}
\end{equation}
over all lattices $\mathcal{L}\subseteq\mathbb{R}^n$.  The Hermite constant arises both
in the study of quadratic forms and in sphere packing;
see~\cite[Section~4]{Lag}.  It is known that $\gamma_n$ is finite for every
$n$, although the precise values are known only for $1\leq n\leq 8$
and $n=24$~\cite{CK}.

As observed by Kotani and Sunada \cite{KS}, if $\mathcal{L}=\mathcal{F}$ is the flow
lattice of a connected graph, then the shortest vector in $\mathcal{F}$ is the
characteristic vector of a cycle of minimum length; therefore, the
numerator in equation~\eqref{herm} is the girth of $G$.  Meanwhile,
$|\mathcal{F}^\sharp/\mathcal{F}|$ is the number of spanning trees.  We now generalize
this theorem to cell complexes.

\begin{definition}
Let $\Sigma$ be a cell complex.  The \emph{girth} and the
\emph{connectivity} are defined as the cardinalities of, respectively
the smallest circuit and the smallest cocircuit of the cellular
matroid of $\Sigma$.
\end{definition}

\begin{theorem}\label{Hermite-relations}
Let $\Sigma$ be a cell complex of dimension~$d$ with girth $g$
and connectivity $k$, and top boundary map of rank~$r$.  Let $b=\rank\tilde{H}_{d-1}(\Sigma;\mathbb{Z})$.  Then
$$k \tau(\Sigma)^{-1/r} \leq \gamma_r\qquad\text{and}\qquad g \tau^*(\Sigma)^{-1/b} \leq \gamma_b.$$
\end{theorem}

\begin{proof}
Every nonzero vector of the cut lattice $\mathcal{C}$ contains a cocircuit in
its support, so $\min_{x\in\mathcal{C}\setminus\{0\}}\langle x,x\rangle\geq k$.  Likewise,
every nonzero vector of the flow lattice $\mathcal{F}$ of $\Sigma$ contains a
circuit in its support, so $\min_{x\in\mathcal{F}\setminus\{0\}}(x\cdot x)\geq g$.
Meanwhile, $|\mathcal{C}^\sharp/\mathcal{C}|=\tau$ and $|\mathcal{F}^\sharp/\mathcal{F}|=\tau^*$
by Theorem~\ref{all-counts}.
The desired inequalities now follow from applying the definition of
Hermite's constant to the cut and flow lattices respectively.
\end{proof}

\bibliographystyle{alpha}
