We establish several results combining discrete Morse theory and microlocal sheaf theory in the setting of finite posets and simplicial complexes. Our primary tool is a computationally tractable description of the bounded derived category of sheaves on a poset with the Alexandrov topology.
We prove that each bounded complex of sheaves on a finite poset admits a unique (up to isomorphism of complexes) minimal injective resolution, and we provide algorithms for computing minimal injective resolutions, as well as several useful functors between derived categories of sheaves. For the constant sheaf on a simplicial complex, we give asymptotically tight bounds on the complexity of computing the minimal injective resolution with this algorithm.
Our main result is a novel definition of the discrete microsupport of a bounded complex of sheaves on a finite poset. We detail several foundational properties of the discrete microsupport, as well as a microlocal generalization of the discrete homological Morse theorem and Morse inequalities.

§ INTRODUCTION

A motif of twentieth-century mathematics is the investigation of global structures via local inquiry. Here, we build on two instances of this global-local theme.

The first instance is Morse theory. Classically, Morse theory studies the global topological structure of a manifold by (locally) analyzing critical points of a real-valued smooth function on the manifold [32, 34]. Morse theory has since been generalized to stratified spaces [17] and applied to many areas of mathematics. Recently, Forman applied these ideas to study cell complexes, and in doing so initiated the study of discrete Morse theory  [15, 14]. Forman's reformulation has since led to many advances in applied and computational topology [36, 38, 13, 21, 33, 44].

The second instance is sheaf theory, the poster child of the global-local motif. Introduced by Leray [31] and modernized by Grothendieck (with numerous contributions from Cartan, Serre, Verdier, Deligne, and many others), sheaf theory is a general framework combining homological algebra and topology (see `A Short History: Les débuts de la théorie des faisceaux' by Houzel in [26] for a beautiful synopsis of the historical development of sheaf theory). Analogous to the recent expansion of discrete Morse theory, a growing body of research studies sheaves on cell complexes with applications in applied and computational topology [35, 37, 10, 9, 12, 8, 11]. However, the utility of sheaf theory is most fully realized when working in the setting of derived categories. Computational aspects of derived cellular sheaf theory are explored in [4, 6, 5, 11, 42]. Despite these advances, algorithms for many useful computations within derived cellular sheaf theory remain (to the best of our knowledge) underdeveloped.

At the intersection of Morse theory and derived sheaf theory lies microlocal geometry. The `microlocal' perspective of sheaf theory originates from Sato's study of singularities within systems of linear differential equations [43, 40]. This perspective considers the propagation of various local structures (such as local solutions of differential equations or homological vanishing properties of sheaves) along different directions within (the cotangent bundle of) a manifold. Microlocal geometry (and its relatives) have far-reaching applications throughout modern mathematics, including intersection cohomology and perverse sheaf theory [18, 16], enumerative geometry [3], symplectic geometry [39], and representation theory [1] (to name a few).

This paper introduces a discrete analog of two important concepts of microlocal geometry, originally introduced by Kashiwara–Schapira for manifolds. The first is the notion of microsupport, which quantifies the cohomological vanishing properties of sheaves on `local half-spaces' [25, 24]. The second is a microlocal generalization of the Morse theorem and inequalities, which exchanges singular homology and Euler characteristics with hypercohomology and the Euler–Poincare index [45, 23, 16]. Before concluding this introduction with a summary of these results, we first give a brief sketch of an indispensable prerequisite: a systematic treatment of computational derived sheaf theory.

Computational Derived Sheaf Theory. Sheaves use algebra to model relationships between local and global properties of a topological space. When the topological space is a poset with the Alexandrov topology, a sheaf (of finite-dimensional vector spaces), $F$, is defined by associating a finite-dimensional vector space, $F(\sigma)$, to each element, $\sigma$, and a linear map, $F(\sigma\le\tau):F(\sigma)\rightarrow F(\tau)$, to each relation, $\sigma\le \tau$ (subject to commutativity requirements, see Definition <ref>). The utility of this definition is also its foil: the high level of generality encompasses many pathologies.
A common strategy for analyzing such a complicated mathematical structure is to approximate or represent it with a collection of simpler, or at least more familiar, objects; the goal is to reframe questions concerning the complex structure as questions about the building blocks which represent it. Illustrations of this strategy permeate mathematics. The first tool of this paper is a particular instance of this phenomenon: injective resolutions. An injective resolution represents a given sheaf (much like a Fourier series represents a periodic function) with an exact sequence of injective sheaves, which admit many desirable properties. Efficient algorithms for computing injective resolutions are a first step toward applying well-established and powerful theoretical results from derived sheaf theory to computational topology. In this paper, we aim to present this theory in an explicit and computationally amenable framework.

An injective sheaf  (Definition <ref>), $I$, is a sheaf such that each morphism of sheaves $G\rightarrow I$ (Definition <ref>) can be extended to a morphism $F\rightarrow I$, whenever $G\subset F$. Injective sheaves admit many beneficial features which general sheaves lack (see, for example, Lemma <ref>, Proposition <ref>, and Lemma <ref>). From the perspective of homological algebra, injective sheaves are the `basic' objects with which we aim to represent a general sheaf. However, standard operations in linear algebra are insufficient for such a representation. For example, if a sheaf is not already injective, then it does not decompose into a direct sum of injective sheaves. Instead, we will represent a given sheaf $F$ with an injective resolution (Definition <ref>): an exact sequence, $0\rightarrow F\rightarrow I^0\rightarrow I^1\rightarrow I^2\rightarrow  \cdots$,
such that each $I^j$ is an injective sheaf.

Injective resolutions, a fundamental ingredient for homological algebra, are used to study sheaves from the ‘derived’ perspective, i.e. as objects in a derived category (Definition <ref>).
These derived categories unify and generalize many variants of (co)homology, such as simplicial cohomology, Borel–Moore homology, intersection cohomology, etc. For example, simplicial cohomology (and level-set persistent cohomology, see [5]) can be computed from an injective resolution of the constant sheaf (see Example <ref> and Section <ref>), illustrating that even an injective resolution of the constant sheaf contains subtle topological information. Several recent works point to the potential benefits of applying derived sheaf theory to the study of persistent homology  [6, 5, 4, 11, 27, 28]. We approach this subject from a computational perspective to help bridge gaps between applied topology and derived sheaf theory. With this goal in mind, we aim to limit the mathematical prerequisites of our approach whenever possible (a choice that often comes at the cost of brevity).

*Main Results.
Broadly, this paper develops computational methods for the bounded derived category sheaves of finite-dimensional vector spaces on finite posets with the Alexandrov topology. Our main contributions are:

* We establish the existence and uniqueness of a minimal injective resolution of a given complex of sheaves (Theorem <ref>, Corollary <ref>, Theorem <ref>). We give an inductive algorithm for computing minimal injective resolutions (Algorithm <ref>), and prove correctness of the algorithm (Section <ref>).

* For the constant sheaf on a simplicial complex, we give an asymptotically tight bound on the complexity of Algorithm <ref> (Proposition <ref> and Corollary <ref>).

* We give an explicit description of the set of objects and morphisms for (a skeleton of) the bounded derived category of sheaves on a finite poset (Definition <ref>).

* We give algorithms for computing right derived (proper) pushforward and (proper) pullback functors along order preserving maps of posets (Section <ref>).

* We give a novel definition of the discrete microsupport for a complex of sheaves in the derived category of sheaves on a finite poset (Definition <ref>).

* We prove a microlocal generalization of the discrete Morse theorem and inequalities (Theorem <ref> and <ref>).

* A python software package implementing the algorithms developed in this paper is freely available at <https://github.com/OnDraganov/desc> [2].

One pedagogical benefit of our approach is that while sheaf theory is an indispensable component of our proofs, the computations we describe make no fundamental use of sheaves or category theory, hopefully making these calculations more accessible to anyone with knowledge of linear algebra and elementary poset combinatorics.

Comparison to Prior Work. Both derived sheaf theory and Morse theory are rich subjects that have been thoroughly studied for several decades. There are many textbooks on sheaf theory [7, 26, 22] and several publications which study sheaves on finite topological spaces. In [42], Shepard relates sheaves on finite cell complexes (viewed as posets) to the classical setting of constructible sheaves on stratified topological spaces. In [29, 30], Ladkani studies the homological properties of finite posets and introduces combinatorial criteria guaranteeing derived equivalences between categories of sheaves. In [11], Curry establishes a connection between sheaf theory and persistent homology. More recently, several publications expand on the work initiated by Curry on applications of derived sheaf theory to persistent homology [4, 6, 28, 5, 27]. In a set of lecture notes, Goresky beautifully explains derived and perverse sheaf theory in both the Whitney stratified and cellular settings [19].
There are also several closely related works on discrete Morse theory. Notably, Nanda [36] describes a categorical localization procedure for Morse-theoretic cellular simplification which relates to sheaf propagation and our definition of microsupport (Definition  <ref>). Additionally, Sköldberg gives an algebraic approach to discrete Morse theory by studying reductions of chain complexes that preserve the homotopy type of the complex [44]. This work is reminiscent of the derived category approach we take in Section <ref>. Motivated by these advances and the potential to develop new techniques for computational topology, we aim to establish preliminary results on computational aspects of derived sheaf theory for finite topological spaces. The contributions of this paper are the first of our knowledge to use discrete Morse theory to study the microsupport of derived sheaves from a computational perspective.

Acknowledgements. We thank François Petit for the useful discussions and helpful feedback on an earlier version of the manuscript. We thank Herbert Edelsbrunner and Sebastiano Cultrera di Montesano for teaching a course on discrete Morse theory at the Institute of Science and Technology Austria in the spring of 2022, during which much of this work was completed.

Funding. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme, grant no. 788183, from the Wittgenstein Prize, Austrian Science Fund (FWF), grant no. Z 342-N31, and from the DFG Collaborative Research Center TRR 109, `Discretization in Geometry and Dynamics', Austrian Science Fund (FWF), grant no. I 02979-N35.

§ BACKGROUND AND PRELIMINARY RESULTS

In this paper we study finite-dimensional vector space valued sheaves on finite posets and simplicial complexes. We begin by recalling preliminary definitions and results, drawing heavily from [11, 12, 42, 29, 19]. Throughout the paper we fix a field $k$. In the examples we usually choose $k=\mathbb{Z}_2$.

For elements $\pi,\tau$ in a poset $\Pi$, we write $\pi<_1\tau$ if $\pi\lneq\tau$ and there is no other element between $\pi$ and $\tau$.

We use some of the standard terminology from simplicial complexes for general posets: the star of an element $\sigma$ is $\St\sigma=\setdef{\tau\in\Pi}{\sigma\leq\tau}$, the boundary is $\textrm{bnd}(\sigma)=\setdef{\tau\in\Pi}{\tau<_1\sigma}$, and the coboundary is $\textrm{cobnd}(\sigma)=\setdef{\tau\in\Pi}{\sigma<_1\tau}$. A chain $\pi_0<\dots<\pi_n$ has length $n$, and the height of a poset is the greatest length over all its chains. This corresponds to dimension if $\Pi=(\Sigma,\subseteq)$ is the face poset of a simplicial complex. An abstract simplicial complex $\Sigma$ on a vertex set $V$ is a system of subsets of $V$ such that $A\subseteq B\in \Sigma$ implies $A\in\Sigma$.

Let $\Pi$ be a finite poset. Then $\Pi$ is a $T_0$-topological space with the Alexandrov topology, where open sets are those with upward closure in the partial relation:
\[U\subset\Pi \text{ is open if and only if } \tau\in U\text{ implies }\gamma\in U\text{ for each }\gamma\ge \tau.\]

A sheaf $F$ on a finite poset $\Pi$ is an assignment of a finite-dimensional $k$-vector space $F(\pi)$ to each element $\pi\in\Pi$, and an assignment of a linear map

\[
F(\tau\le\gamma):F(\tau)\rightarrow F(\gamma)
\]

to each face relation $(\tau\le\gamma)\in\Pi$, such that

* $F(\tau\le\tau)=\id_{F(\tau)}$, and

* $F(\tau\le\gamma)\circ F(\sigma\le\tau) = F(\sigma\le\gamma)$, for each triple $\sigma\le\tau\le\gamma\in\Pi$.

The constant sheaf, denoted $k_\Pi$, on a poset $\Pi$, assigns to each element $\pi\in\Pi$ the one-dimensional vector space, $k$, and to each relation, $(\pi\le \tau)\in\Pi$, the identity map $\id_k$.

A natural transformation, $\eta:F\rightarrow G$, between two sheaves on $\Pi$, is a collection of linear maps
\eta(\pi):F(\pi)\rightarrow G(\pi)
for each $\pi\in\Pi$, such that

\[
G(\tau\le\gamma)\circ \eta(\tau) = \eta(\gamma)\circ F(\tau\le\gamma),
\]

for each $(\tau\le\gamma)\in \Pi$. For a natural transformation $\eta:F\rightarrow G$, the kernel, cokernel, image, and coimage are taken point-wise, defining sheaves on $\Pi$:

\[(\ker\eta)(\pi):=\ker (\eta(\pi)),\qquad (\ker\eta)(\pi\le\tau):=F(\pi\le\tau)\vert_{\ker\eta(\pi)}.\]

Moreover, if $\ker\eta(\pi)=0$ for each $\pi\in\Pi$, we say that $\eta$ is injective. We write $G/F \coloneqq\coker\eta$ if $\eta$ is an injection clear from the context.

A sheaf $I$ is called injective if for each injective natural transformation $A\hookrightarrow B$, any given natural transformation $A\rightarrow I$ can be extended to $B\rightarrow I$:

0 r     A r dr[swap]∀     B [dashed]d∃

This condition is always satisfied for sheaves over a single point space (i.e., the assignment of a single vector space to a point): we can extend any linear map on a subspace to the whole space by mapping a complement space to 0. This property does not hold in general for sheaves. The following two examples show sheaves that are not injective.

We describe a sheaf $F$ on a poset with two elements $\sigma\leq\tau$ which is not injective. Fix any vector space $W\neq 0$, and let $F(\sigma) = 0$ and $F(\tau) = W$. This sheaf injects in a sheaf $G$ given by $G(\sigma) = W = G(\tau)$ with $\smap G{\sigma}{\tau} = \id$. We claim that $F\overset{\id}{\rightarrow} F$ can not be extended to $G\rightarrow F$.

0 r     F r dr[swap]𝕀     G [dashed]d?

[-18pt] F     G     F

τ    W r𝕀 [bend left]rr𝕀     W r?     W

σ    0 u0 r0 [bend right]rr0     W u𝕀 r?     0 u0

Indeed, the triangle on the left diagram commutes iff the right diagram commutes. The only way to make the right square commute is to set both horizontal maps to $0$. But then the top triangle does not commute.

The same reasoning applies for any sheaf on any poset with a non-zero vector space one step above a zero vector space. Below we demonstrate one other obstruction to injectivity.

We consider a three-element “V” shaped poset, a vector space $W\neq 0$, and two different endomorphisms $f,g: W\rightarrow W$. We define sheaves $A$, $B$ and $F$ as follows:

[column sep = 7pt]

W         W

0 lu ru

[column sep = 7pt]

W         W

W luf [swap]rug

[column sep = 7pt]

W         W

W lu𝕀 [swap]ru𝕀

We claim that $F$ is not injective. The sheaf $A$ embeds into both $B$ and $F$ with identity maps. We ask whether we can extend the embedding $A\rightarrow F$ to a natural transformation $\beta: B\rightarrow F$, while respecting the embedding $A\rightarrow B$. The only choice we have is the bottom map $\beta_0: W\rightarrow W$, as the other two must be the identity. However, commutativity requires $f = \beta_0 = g$, which is impossible to satisfy, since $f\neq g$.

Below we give a definition of the simplest building blocks of injective sheaves. Note how they avoid the obstructions above.

For each $\pi\in\Pi$, we define an indecomposable injective sheaf $[\pi]$ as

\begin{align*}
[\pi](\sigma) \coloneqq
\begin{cases}
k &\text{ if $\sigma\leq \pi$,} \\
0 &\text{ otherwise,}
\end{cases}
\end{align*}

\begin{align*}
[\pi](\sigma\le \tau) \coloneqq
\begin{cases}
\id &\text{ if $\sigma\le\tau\leq \pi$,} \\
0 &\text{ otherwise.}
\end{cases}
\end{align*}

For $n\in\mathbb{Z}_{\ge 0}$, we denote by $[\pi]^n$, the direct sum $\bigoplus_{j=1}^n[\pi]$. For a vector space $V$, we denote by $[\pi]^V$, the sheaf $[\pi]^{\dim V}$, with an implicitly fixed isomorphism between $k^{\dim V}$ and $V$.

The following results can be found in [11] and [42] for sheaves on cell complexes. We give a straightforward generalization of the results to sheaves on any finite poset.

Indecomposable injective sheaves are injective.

We show that, for a fixed poset $\Pi$ and $\pi\in \Pi$, $I=[\pi]$ satisfies Definition <ref>. Given an inclusion $A\xhookrightarrow{f} B$ and a natural transformation $\alpha: A\rightarrow I$, we need to find an extension $\beta: B\rightarrow I$. For the linear map $A(\pi)\xhookrightarrow{f(\pi)} B(\pi)$, there is a projection $A(\pi)\xleftarrow{g}B(\pi)$ such that $g f(\pi)=\id_{A(\pi)}$.
We define

\begin{align*}
\beta(\sigma) \coloneqq
\begin{cases}
\alpha(\pi)\circ g\circ B(\sigma\leq \pi) &\text{ if $\sigma\leq \pi$,} \\
0 &\text{ otherwise.}
\end{cases}
\end{align*}

For every $\sigma$, this satisfies $\beta(\sigma) f(\sigma)=\alpha(\sigma)$, because if $\sigma\leq\pi$, then
\[
\beta(\sigma) f(\sigma) = \alpha(\pi)\, g\, B(\sigma\leq \pi) f(\sigma) = \alpha(\pi)\, g\, f(\pi) A(\sigma\leq \pi) = \alpha(\pi) A(\sigma\leq \pi) = \alpha(\sigma),
\]

and otherwise both sides are 0.
For the commutativity conditions, consider $\sigma\leq\tau\leq\pi$. Then
\[
\beta(\tau) \smap B \sigma \tau = \alpha(\pi)\, g\, \smap B \tau \pi \smap B \sigma \tau = \alpha(\pi)\, g\, \smap B \sigma \pi = \beta(\sigma) = \smap I \sigma \tau \beta(\sigma).
\]

If $\sigma\leq\tau\not\leq\pi$, then both sides are $0$.

A direct sum of injective sheaves is injective. Additionally, if $I\xhookrightarrow{\alpha} J$ is an injective natural transformation with $I,J$ injective sheaves, then $J\cong I\oplus \coker\alpha  $, and $\coker\alpha$ is an injective sheaf.

This proof is standard for any abelian category, we include a sketch for completeness. Suppose $I=A\oplus B$, with $A,B$ injective sheaves. Suppose $F\hookrightarrow G$ and $F\rightarrow I$. Then composition with projection gives maps $F\rightarrow A$ and $F\rightarrow B$. By injectivity of $A$ and $B$, each map extends to $G\rightarrow A$ and $G\rightarrow B$, respectively. The sum of these maps defines an extension $G\rightarrow I$, proving that $I$ is injective. The second claim follows by extending the identity map $I\rightarrow I$ to $J\rightarrow I$ by $\alpha$ and the injectivity of $J$. Then, the sum of the extension and the quotient map define an isomorphism $J\rightarrow I\oplus\coker\alpha$. The final claim follows by composing a given map $F\rightarrow\coker\alpha$ with the extension by zero map, $\coker\alpha\hookrightarrow J$, to get $F\rightarrow J$. Then, for $F\hookrightarrow G$, we define (by the injectivity of $J$) an extension $G\rightarrow J$. By post-composing with the projection map, we get the desired extension $G\rightarrow\coker\alpha$.

Every injective sheaf is isomorphic to a direct sum of indecomposable injective sheaves.

We adapt the proof of <cit.> to the setting of finite posets on $n$ elements (rather than cell complexes). We fix some linear extension of the partial order, $(\pi_1,\dots,\pi_n)$, and let $\Pi_d=\left\{\pi_j\,\middle|\, j\leq d\right\}$. We will proceed with the proof by working inductively through this filtration of $\Pi$. We define support of a sheaf $I$ as
\[
\supp I \coloneqq \setdef{\pi\in\Pi}{I(\pi)\neq 0}.
\]

Assume that the result holds for injective sheaves supported on $\Pi_{d-1}$. Suppose $I$ is an injective sheaf with support contained in $\Pi_{d}$. If $\supp I\subseteq \Pi_{d-1}$, then the inductive assumption implies the result. Therefore, we are left to prove the result for $I$ such that $I(\pi_d)\neq 0$. Set $F_{\pi_d}$ to be the functor which assigns $I(\pi_d)$ to $\pi_d$ and the zero vector space to each other poset element (and the zero linear map to each poset relation). Then the identity map induces injective natural transformations

\[
F_{\pi_d}\xhookrightarrow{\alpha} I\qquad\text{and}\qquad F_{\pi_d}\hookrightarrow \bigoplus_{v\in B}[\pi_d],
\]

where $B$ is some basis of $I(\pi_d)$. Because $I$ is injective, we can extend $\alpha$ to a natural transformation
\beta:  \bigoplus_{v\in B}[\pi_d]\rightarrow I.
It is injective, because for every $\sigma\leq\pi_d$, the linear map $I(\sigma\leq\pi_d)\beta(\sigma)=\beta(\pi_d)=\alpha(\pi_d)$ is injective.
By Lemma <ref>, this implies that

\[
I\cong \coker \beta\oplus\bigoplus_{v\in B}[\pi_d],
\]

and that $\coker \beta$ is injective. Because $\supp\coker \beta\subseteq \Pi_{d-1}
$, the inductive hypothesis completes the proof.

§.§ Natural transformations between injective sheaves

Before we introduce injective resolutions, we take a brief detour to discuss natural transformations between injective sheaves. We introduce an efficient way of describing them as one labeled matrix, which proves useful throughout the paper to explicitly describe various computations. In general, a natural transformation between two sheaves on a poset is given by a linear map for each $\pi\in\Pi$. Much of the information is often redundant in such a description, as it can be derived from the commutativity conditions, but it is difficult to give a more concise general descriptions. For two injective sheaves, however, the situation is simpler.

Given a natural transformation $\eta: I\rightarrow J$ between two injective sheaves, and a decomposition into indecomposable injective sheaves as in Proposition <ref>,

\[
I = \bigoplus_{i=1}^m [\pi_i]^{p_i}\hspace{15pt}\text{ and }\hspace{15pt}
J = \bigoplus_{j=1}^n [\sigma_j]^{s_j},
\]

$\eta$ can be uniquely described by a collection of linear maps $f_{ij}: k^{p_i}\rightarrow k^{s_j}$, for each pair $i,j$ such that $\sigma_j\le\pi_i$. On the other hand, each such collection of linear maps defines a natural transformation. In other words,

\[\Hom(I,J) \ \ \cong\ \  \bigoplus_{\mathclap{\substack{i,j:\\ \sigma_j\le\pi_i}}} \Hom(k^{p_i},k^{s_j})\cong \bigoplus_{\mathclap{\substack{i,j:\\ \sigma_j\le\pi_i}}}k^{p_i s_j}, \]

where $\Hom(I,J)$ denotes the set of natural transformations from $I$ to $J$ and $\Hom(k^{p_i},k^{s_j})$ denotes the set of linear transformations from $k^{p_i}$ to $k^{s_j}$.

Using projection and inclusion maps of the direct sum, $\Proj$, $\Incl$, a map $\eta: I\rightarrow J$ can be decomposed as a sum of maps $\eta_{ij}=\Proj_{[\sigma_j]^{s_j}}\circ\, \eta \circ \Incl_{[\pi_i]^{p_i}}$ between the powers of indecomposable injective sheaves. Consider $\tau\in\Pi$. If $\tau\not\leq\sigma_j$, then $\eta_{ij}(\tau)=0$.
Otherwise, $
\eta_{ij}(\tau)
= [\sigma_j]^{s_j}(\tau\leq\sigma_j) \circ \eta_{ij}(\tau)
= \eta_{ij}(\sigma_j) \circ [\pi_i]^{p_i}(\tau\leq\sigma_j)$, which is $\eta_{ij}(\sigma_j)$ if $\sigma_j\leq\pi_i$, and $0$ otherwise. This shows that the natural transformation $\eta_{ij}$ is determined by the single linear map $f_{ij}\coloneqq\eta_{ij}(\sigma_j)$. Moreover, this map is necessarily $0$ whenever $\sigma_j\not\leq \pi_i$, and it can be any linear map otherwise.

§.§ Poset labeled matrices

The above observation motivates describing natural transformations between injective sheaves as a block matrix with blocks representing the linear maps $f_{ij}$.

For a poset $\Pi$, a $\Pi$-labeled matrix, or just labeled matrix if $\Pi$ is clear from the context, is a matrix $M$ together with a labeling of each column and each row by some element of $\Pi$, such that an entry on the intersection of a column labeled by $\pi$ and a row labeled by $\sigma$ is non-zero only if $\sigma\leq\pi$. Columns and rows are labeled independently, the labels can be repeated, and not all labels need to be used.

If $M$ is a $\Pi$-labeled matrix and $\pi,\sigma\in\Pi$, we denote by $M[\sigma,\pi]$ the submatrix of $M$ obtained by deleting all rows not labeled by $\sigma$ and all columns not labeled by $\pi$. The same way for $S,P\subseteq\Pi$ we denote by $M[S,P]$ the submatrix obtained by deleting rows and columns labeled by simplices not in $S$ and $P$, respectively.

A $\Pi$-labeled matrix $M$ represents a natural transformation $\eta:I\rightarrow J$ between two injective sheaves if the following conditions hold:

* $I \cong \bigoplus_{i=1}^m [\pi_i]^{p_i}$, where $\pi_1,\dots,\pi_m$ with multiplicities $p_1,\dots,p_m$ are exactly the labels of columns of $M$,

* $J \cong \bigoplus_{j=1}^n [\sigma_j]^{s_j}$, where $\sigma_1,\dots,\sigma_n$ with multiplicities $s_1,\dots,s_n$ are exactly the labels of rows of $M$,

* Fixing bases as implied by the above decompositions, $M[\sigma_i,\pi_j]$ is the matrix representing the map $f_{ij}$ as described in Lemma <ref> for each $1\leq i\leq m$, $1\leq j \leq n$.

If $M$ represents $\eta$, then the submatrix $M[\St\tau,\St\tau]$ describes $\eta(\tau)$ for each $\tau\in\Pi$.

Every $\Pi$-labeled matrix represents some natural transformation between injective sheaves over $\Pi$. Up to an isomorphism, the domain and codomain is completely described by the column and row labels, respectively. See Figure <ref> for an example of a labeled matrix.

Picking a particular representation for a natural transformation means fixing particular decompositions of $I$ and $J$ into indecomposable injective sheaves—including the order of the individual summands, which corresponds to the order of the labels in the matrix. This, in other words, means fixing particular bases for the vector spaces in $I$ and $J$. Within one sheaf these bases are consistent in the following sense: Let us fix the decomposition of $I$ according to the column labels of $M$, which we denote by $(\pi_1, \dots, \pi_m)$. Suppose that for some $\pi\in\Pi$, $(\pi_{i_1},\dots,\pi_{i_d})$ is the subtuple consisting of all the labels $\pi_{i_j}\geq\pi$. Let $\pi'\geq\pi$ and without loss of generality assume that $(\pi_{i_1},\dots,\pi_{i_l})$, $l\leq k$, is the subtuple of all labels $\pi_{i_j}\geq\pi'$. Then the restriction map $I(\pi\leq\pi')$ is the projection of a $d$-dimensional vector onto its first $l$ coordinates. Whenever we talk about a basis of an injective sheaf, we mean the collection of the bases of its vector spaces coming from one fixed decomposition into indecomposible injective sheaves as described here.

Note that if $M$ represents $\eta:I\rightarrow J$ and $N$ represents $\lambda: J\rightarrow K$ such that the rows of $M$ are expressed with respect to the same choice of bases in $J$ as the columns of $N$, then the matrix $N\!\cdot\! M$ represents the composition $\lambda\circ\eta$. This is due to the fact that $N[\sigma,\pi]$ can be non-zero only if $\sigma\leq\pi$, which means that $N[\St\tau,\Pi\setminus\St\tau]$ is a zero matrix. This implies that $(NM)[\St\tau,\St\tau] = N[\St\tau,\St\tau]\cdot M[\St\tau,\St\tau]$ for all $\tau\in\Pi$, which is what we claim. In particular, $N\!\cdot\! M$ is still a labeled matrix: $(N\!\cdot\! M)[\sigma,\pi]=0$ whenever $\sigma\not\leq\pi$.

Change of bases for labeled matrix representations. Given two sets of bases for $I$ of the form described above, we can represent the identity as a labeled matrix, $R$, with respect to the two choices of bases. If $M,N$ are labeled matrix representations of $\eta:I\rightarrow J$ with respect to those two choices of bases in $I$, then $N\!\cdot\! R=M$. Analogously, if we changed the bases in $J$, we would multiply a given labeled matrix representation by a matrix from the left. Therefore, choosing different bases corresponds to column or row operations in the labeled matrix representations. Since $R$ is itself a labeled matrix, $R[\sigma,\pi]$ is non-zero only if $\sigma\leq\pi$. This restricts the set of operations that are allowed.

For a $\Pi$-labeled matrix, the allowed elementary row operations are

* adding a multiple of a row labeled by $\pi$ to a row labeled by $\sigma$ for $\sigma\leq\pi$,

* multiplying a row by a non-zero constant,

* swapping two rows,

and allowed elementary column operations are

* adding a multiple of a column labeled by $\sigma$ to a column labeled by $\pi$ for $\sigma\leq\pi$,

* multiplying a column by a non-zero constant,

* swapping two columns.

The allowed elementary row (column) operations correspond to a multiplication from left (right) by a labeled matrix with identical column (row) labeling, that is an elementary matrix in the standard sense.

Any change of bases $R$ is a composition of allowed elementary row operations, or column operations, because we can reduce $R$ to the identity matrix using allowed row or column operations: with either option, we first reduce the square “diagonal” blocks $R[\pi,\pi]$ to identity matrices, since we impose no restrictions on operations on those blocks, and then we can clear the rest of the matrix, since $R[\sigma,\pi]$ can be non-zero only if $\sigma\leq\pi$, in which case we can clear this block by adding rows labeled by $\pi$ or by adding columns labeled by $\sigma$.

Notation. To simplify notation, in the rest of the paper, we use the same symbol both for a natural transformation and for a labeled matrix representation of it.

Complex of Labeled Matrices.

A sequence $\eta^\bullet=(\dots,\eta^d,\eta^{d+1},\dots)$ of labeled matrices is a complex of labeled matrices if

* columns of $\eta^{d+1}$ have the same labeling as the rows of $\eta^d$ (including order) for all $d$,

* $\eta^{d+1}\cdot\eta^d=0$ for all $d$.

Note that $\eta^{d+1}\cdot\eta^d=0$ iff $\eta^{d+1}(\tau)\cdot \eta^d(\tau)=0$ for all $\tau\in\Pi$.

Let $I^\bullet$ be a complex of sheaves as defined below in Definition <ref> such that each sheaf in it is injective. We say that $I^\bullet$ is represented by a complex of labeled matrices $\eta^\bullet$, when the following hold:

* $I^d$ is isomorphic to the sum of indecomposables given by the labeling of the columns of $\eta^d$ for every $d$,

* $\eta^{d-1}$ and $\eta^{d}$ are representations of the natural transformations $I^{d-1}\rightarrow I^d$ and $I^d\rightarrow I^{d+1}$ with respect to the same choice of bases in $I^d$, for every $d$.

Changing bases in $I^d$ means performing column operations on $\eta^d$, and at the same time corresponding row operations on $\eta^{d-1}$. If $\alpha$ is the labeled matrix representing the change of bases in $I^d$, then the new matrices with codomain and domain $I^d$ are $\alpha\cdot\eta^{d-1}$ and $\eta^{d}\cdot\alpha^{-1}$, respectively. In particular, if we add the $i$-th column to the $j$-th in $\eta^d$, we need to subtract the $j$-th row from the $i$-th in $\eta^{d-1}$.

§ INJECTIVE RESOLUTIONS

In this section we give definitions of injective hull and resolution, and present our main theoretical results about the minimal injective resolutions.

An injective hull of a sheaf $F$ is an injective sheaf $I$ together with an injective natural transformation $F\hookrightarrow I$.

A (bounded) complex of sheaves, denoted $A^\bullet$, is a sequence of sheaves $A^d$ and natural transformations $\mu^d$

\[
\cdots\rightarrow A^d\xrightarrow{\mu^d}A^{d+1}\xrightarrow{\mu^{d+1}}A^{d+2}\xrightarrow{\mu^{d+2}}\cdots
\]

such that $\mu^{d+1}\circ\mu^d=0$ for each $d$, and $A^d=0$ for $|d|$ sufficiently large. A complex is exact if $\im\mu^d=\ker\mu^{d+1}$ for each $d$. A morphism $\alpha^\bullet:A^\bullet\rightarrow B^\bullet$ between complexes of sheaves is a collection of natural transformations $\alpha^d:A^d\rightarrow B^d$ such that the diagrams commute:

A^drμ^d dα^d     A^d+1 dα^d+1

B^d rν^d     B^d+1

We assume throughout the paper that each of our complexes is bounded, dropping explicit references to boundedness in what follows.

For a complex of sheaves $(A^\bullet,\mu^\bullet)$, define, for each $d\in\mathbb{Z}$, the cohomology sheaf $H^d(A^\bullet)$ by

\[
H^d(A^\bullet)(\sigma) \coloneqq \ker\mu^d(\sigma)/\im\mu^{d-1}(\sigma).
\]

Because $\mu^\bullet$ is assumed to be a morphism of complexes, we have that $A^d(\sigma\le\tau)$ maps $\ker\mu^d(\sigma)$ to $\ker\mu^d(\tau)$, and $\im\mu^{d-1}(\sigma)$ to $\im\mu^{d-1}(\tau)$. Therefore, the linear maps $A^d(\sigma\le\tau)$ induce linear maps
\[H^d(A^\bullet)(\sigma\le\tau): H^d(A^\bullet)(\sigma)\rightarrow H^d(A^\bullet)(\tau).\]

These linear maps give $H^d(A^\bullet)$ the structure of a sheaf on $\Sigma$, by the assumed commutativity of the natural transformations $\mu^d$.

An injective resolution of a sheaf $F$
is an exact sequence

\[0\rightarrow F\xrightarrow{\alpha} I^{0}\xrightarrow{\eta^0} I^{1}\xrightarrow{\eta^{1}} I^{2} \xrightarrow{\eta^{2}} \dots\]

where $I^j$ is an injective sheaf for each $j$. We denote by $I^\bullet$ the complex

\[
\cdots\rightarrow 0\rightarrow I^0\xrightarrow{\eta^0}I^1\xrightarrow{\eta^1}\cdots.
\]

A classical result of sheaf theory is that each sheaf admits an injective resolution (though it need not be unique) [22]. In the remainder of this section, we will study explicit algorithms for computing injective resolutions of a given sheaf $F$.

§.§ Minimal Injective Resolutions of Sheaves

We will now define minimal injective resolutions, and show that they are unique up to isomorphism of complexes. We fix a sheaf $F$ on a finite poset $\Pi$.

A vector $s\in F(\pi)$ is maximal if $F(\pi\le\tau)(s)=0$ for each $\tau > \pi$. Let $M_F(\pi)$ be the subspace of maximal vectors in $F(\pi)$, i.e.
\[M_F(\pi)\coloneqq\bigcap_{\pi< \sigma}\ker F(\pi\leq\sigma).\]

Note that it is sufficient to take only the intersection of $\ker F(\pi\le\sigma)$ for each $\pi<_1\sigma$.

An injective resolution $I^\bullet$ of $F$ is minimal if for every injective resolution $J^\bullet$ of $F$, and for every $d$, the number of indecomposable summands of $I^d$ is less than or equal to the number of indecomposable summands of $J^d$.

Let $I^\bullet$ be an injective resolution of a sheaf $F$. The following are equivalent:

* $I^\bullet$ is minimal.

* For any injective resolution $J^\bullet$ of $F$, there exists a morphism of complexes $\delta^\bullet:I^\bullet\rightarrow J^\bullet $ such that $\delta^d$ is injective for each $d$.

* For each $d>0$, each $\pi\in\Pi$, and each maximal vector $s\in I^d(\pi)$, $s\in\im \eta^{d-1}(\pi)$. For each $\pi\in\Pi$ and each maximal vector $s\in I^0(\pi)$, $s\in\im \alpha(\pi)$.

* For each $d$, each $\pi\in\Pi$, and each maximal vector $s\in I^d(\pi)$, $\eta^d(\pi)(s)=0$.

Once we begin working in the setting of derived categories in Section <ref>, we will prove a generalization of the above theorem (Theorem <ref>). However, because several useful corollaries follow from the proof of the above theorem, we choose to include it here.

$1\Rightarrow 4$: Assume there exists a maximal vector $s\in I^d(\pi)$ such that $\eta^d(\pi)(s)\neq 0$. Let $[\pi]_s$ be an indecomposable injective subsheaf supported on the down-set of $\pi$ with $s\in[\pi]_s(\pi)$, and $ \hat{I}^d:= I^d/[\pi]_s$ the quotient, with quotient map $q_i$. Similarly, let $\hat{I}^{d+1}:= I^{d+1}/[\pi]_{\eta^d(\pi)(s)}$. By Lemma <ref>, $I^d\cong \hat{I}^d\oplus [\pi]_s$, $I^{d+1}\cong \hat{I}^{d+1}\oplus [\pi]_{\eta^d(\pi)(s)}$, and $\hat{I}^d$, $\hat{I}^{d+1}$ are injective sheaves. Then

0d   0d

0 r d

I^d-1rη^d-1d 𝕀

I^d-1r η̂^d-1d
Î^drη̂^d d
Î^d+1rη̂^d+1 d

0   0   0   0

with columns and the top two rows exact. Then the bottom row also has to be exact due to the long exact sequence theorem.

\[
0\rightarrow F \rightarrow I^0\rightarrow \cdots\rightarrow I^{d-1}\xrightarrow{\tilde\eta^{d-1}}\hat{I}_{d}\xrightarrow{\hat{\eta}^{d}}\hat{I}_{d+1}\xrightarrow{\hat\eta^{d+1}}I^{d+2}\rightarrow \cdots
\]

is an injective resolution of $F$, with fewer indecomposable injective summands than $I^\bullet$, which shows that $I^\bullet$ is not minimal.

$4\Leftrightarrow 3$: Follows from the exactness of the injective resolution $I^\bullet$.

$3\Rightarrow 2$: Let

\[
0\rightarrow F\xrightarrow{\alpha} I^0\xrightarrow{\eta^0}I^1\xrightarrow{\eta^1}\cdots
\]

be an injective resolution of $F$ which satisfies criteria 3, and

\[
0\rightarrow F\xrightarrow{\beta} J^0\xrightarrow{\lambda^0}J^1\xrightarrow{\lambda^1}\cdots
\]

be any injective resolution of $F$. We will inductively construct a morphism of complexes $\delta^\bullet:I^\bullet\rightarrow J^\bullet$ such that $\delta^d:I^d\rightarrow J^d$ is an injective natural transformation for each $d$. We begin by extending the natural transformation $\beta:F\rightarrow J^0$ through the injection $0\rightarrow F\xrightarrow{\alpha} I^0$, by the injectivity of $J^0$, resulting in the commutative diagram

0r   Frαd𝕀   I^0r[dashed]dδ^0   ⋯

0r   F rβ    J^0r   ⋯

Similarly, we can extend the map $\alpha:F\rightarrow I^0$ to a map $\gamma^0:J^0\rightarrow I^0$, resulting in a commutative diagram

0r   Frα   I^0r   ⋯

0r   F u𝕀rβ    J^0r[dashed]uγ^0   ⋯

We claim that $\ker\gamma^0\circ\delta^0=0$.

By assumption on $I^\bullet$, for each maximal vector $s\in I^0(\sigma)$, there exists $x\in F(\sigma)$ such that $\alpha(\sigma)(x)=s$. Because the above diagrams commute, $\beta(\sigma)(x)=\delta^0(\sigma)(s)$. Moreover, again by commutativity,

\[\gamma^0(\sigma)\circ \delta^0(\sigma)(s)= \gamma^0(\sigma)\circ \beta(\sigma)(x)=\alpha(\sigma)(x)=s,\]
which proves that $\ker \gamma^0\circ\delta^0=0$, because every non-zero vector maps to some non-zero multiple of a maximal vector via the sheaf maps. In particular, $\delta^0$ is injective.

We continue inductively. Suppose we have defined $\delta^0$ through $\delta^d$ and $\gamma^0$ through $\gamma^d$ such that

0r   Frαd𝕀
I^0r[swap, bend right = 30]dδ^0
I^dr[swap, bend right = 30]dδ^d
I^d+1r   ⋯

0r   F rβ
J^0r[swap, bend right = 30]uγ^0
J^dr[swap, bend right = 30]uγ^d
J^d+1r   ⋯

commutes for each square and $\ker\gamma^j\circ\delta^j=0$ for each $j$.

Then $\delta^d$ and $\gamma^d$ induce natural transformations $\delta^d:\coker\eta^{d-1}\rightarrow \coker \lambda^{d-1}$ and $\gamma^d:\coker\lambda^{d-1}\rightarrow \coker \eta^{d-1}$, respectively. Using the injectivity of $I^{d+1}$ and $J^{d+1}$, we extend the maps from $\coker\eta^{d-1}\rightarrow J^{d+1}$ and $\coker\lambda^{d-1}\rightarrow I^{d+1}$, respectively:

I^drrη^d[hookrightarrow, swap, bend right = 15]dddδ^d[two heads]dr
I^d+1[bend right = 15, swap, dashed]dddδ^d+1

η^d-1[ swap, bend right = 30]dδ^d[hookrightarrow]ur

λ^d-1[swap, bend right = 30]uγ^d[hookrightarrow]dr

J^drrλ^d[two heads]ur[swap, bend right = 15]uuuγ^d
J^d+1[swap, bend right = 15, dashed]uuuγ^d+1

By diagram chasing, $\gamma^{d}\circ\delta^{d}(\im\eta^{d-1})\subset \im\eta^{d-1}$. By the inductive assumption, $\ker \gamma^{d}\circ\delta^{d}=0$. Since $I^d(\pi)$ is finite-dimensional for every $\pi\in\Pi$, this implies that as a map on $\coker\eta^{d-1}$, $ \gamma^{d}\circ\delta^{d}$ is injective.
By an argument analogous to the above proof that $\ker \gamma^{0}\circ\delta^{0}=0$, we have that $\ker \gamma^{d+1}\circ\delta^{d+1}=0$. This implies that $\delta^{d+1}$ is injective.

$2\Rightarrow 1$: By condition 2, for each injective resolution $J^\bullet$, there are injective maps $\delta^d:I^d\hookrightarrow J^d$ for each $d$. The injectivity of $\delta^d$ implies that the number of indecomposable injective summands of $J^d$ is greater than that of $I^d$, which proves that $I^\bullet$ is minimal.

The proof of the theorem yields several immediate corollaries.

For each sheaf $F$ on a finite poset $\Pi$, there exists a unique (up to an isomorphism of complexes) minimal injective resolution.

Notice that the proof of $1\Rightarrow 4$ in Theorem <ref> shows that from any injective resolution $J^\bullet$ of $F$, and any maximal vector $s\in J^d(\pi)$ such that $\eta^d(\pi)(s)\neq 0$, we can construct an injective resolution $I^\bullet$ of $F$ by taking a quotient of $J^d$ and $J^{d+1}$ by $[\pi]_s$ and $[\pi]_{\eta^d(\pi)(s)}$, respectively. Therefore, by applying this procedure inductively, we can construct from any injective resolution $J^\bullet$, a minimal injective resolution $I^\bullet$. Existence of a minimal injective resolution then follows from the existence of injective resolutions. By Theorem <ref> property 2, any two minimal injective resolutions must be isomorphic as complexes.

We also explicitly illustrate the existence of the minimal injective resolution in Section <ref>, where we provide an algorithm to construct it.

The minimal injective resolution of a sheaf $F$ on a finite poset $\Pi$ of height $h$ consists of at most $h+1$ non-zero injective sheaves.

The length of the longest chain of non-zero vector spaces in $I^d$ is strictly decreasing in $d$ in the minimal injective resolution. This is implied by properties 3 and 4: If $I^d(\pi)=0$, then property 3 implies that there are no maximal vectors in $I^{d+1}(\pi)$. Therefore, if $I^d(\tau)=0$ for all $\tau\geq\pi$, then also $I^{d+1}(\tau)=0$ for all $\tau\geq\pi$. Moreover, if $I^d(\pi)\neq 0$ and $I^d(\tau)=0$ for all $\tau>\pi$, then all vectors in $I^d(\pi)$ are maximal, and by property 4 and the argument above, $I^{j}(\pi)=0$ for all $j>d$.

If $F\xrightarrow{\alpha} I$ is an injective hull such that for all $\pi\in\Pi$, all maximal vectors of $I(\pi)$ are in $\im\alpha(\pi)$, then it is the minimal injective hull.

The inductive construction in the proof of $3\Rightarrow 2$ in Theorem <ref> only depends on the initial segments of the resolution. Therefore, if the property $3$ is satisfied in an initial segment, then this initial segment injects in any injective resolution. In particular, this shows that if $F\xrightarrow{\alpha} I$ is an injective hull such that for all $\pi\in\Pi$ the maximal vectors in $I(\pi)$ are in $\im\alpha(\pi)$, then it is the minimal injective hull of $F$.

§.§ Indecomposable multiplicities of the minimal injective resolution

Because the minimal injective resolution of a sheaf $F$ is unique, the multiplicity of an indecomposable injective sheaf in the minimal injective resolution is a well-defined invariant of $F$. It is natural to ask what topological information is captured with these multiplicities. Below we answer this question for the constant sheaf on a finite simplicial complex.

Let $I^\bullet$ be the minimal injective resolution of $F$. By $m^d_F(\sigma)$ we denote the multiplicity of $[\sigma]$ in $I^d$:

\[
I^d \cong \bigoplus_{\sigma\in\Pi}[\sigma]^{m^d_F(\sigma)}.
\]

Equivalently, we can define
$m^d_F(\sigma):=\dim M_{I^d}(\sigma)$,
where $M_{I^d}(\sigma)$ is as in Definition <ref>.

Let $\Sigma$ be a finite simplicial complex, $k_\Sigma$ the constant sheaf on $\Sigma$ (viewed as a poset with the face relation), and $H_c^\bullet (|\St\sigma|;k)$ be the singular cohomology with compact support of the geometric realization of $\St\sigma$. Then

\[
m^d_{k_\Sigma}(\sigma)= \dim H_c^{d+\dim\sigma}(|\St\sigma|;k).
\]

See Appendix <ref> for a proof of the above theorem.

§ DERIVED CATEGORIES

In this section we study minimal injective resolutions of complexes of sheaves on finite posets and describe a convenient definition for the derived category of sheaves on finite posets.

§.§ Minimal Injective Resolutions of Complexes of Sheaves

A morphism $\alpha^\bullet:F^\bullet\rightarrow G^\bullet$ of complexes of sheaves is a quasi-isomorphism if the induced map

\[
H^d(\alpha^\bullet): H^d(F^\bullet)\rightarrow H^d(G^\bullet)
\]

between cohomology sheaves is an isomorphism for each $n\in\mathbb{Z}$.

An injective resolution of a complex of sheaves $F^\bullet$ is a quasi-isomorphism

\[
\alpha^\bullet:F^\bullet\rightarrow I^\bullet
\]

from $F^\bullet$ to a complex $I^\bullet$ of injective sheaves.

We define minimal complexes of injective sheaves, and show that every complex of injective sheaves has a minimal complex of injective sheaves quasi-isomorphic to it, and this minimal complex is unique up to isomorphism of complexes.

A complex of injective sheaves $I^\bullet$ is minimal if for every complex of injective sheaves $J^\bullet$ which is quasi-isomorphic to $I^\bullet$ and for every $d$, the number of indecomposable summands of $I^d$ is less than or equal to the number of indecomposable summands of $J^d$.

In the remainder of this section, we show a result analogous to Theorem <ref> for injective resolutions of single sheaves. In particular, the result justifies the above definition.

Let $(I^\bullet, \eta^\bullet)$ be a complex of injective sheaves on $\Pi$. The following are equivalent:

* $I^\bullet$ is minimal.

* For any quasi-isomorphic complex $(J^\bullet, \lambda^\bullet)$ of injective sheaves, there exists a morphism of complexes $r^\bullet:J^\bullet\rightarrow I^\bullet $ such that $r^d$ is surjective for each $d$.

* For any quasi-isomorphic complex $(J^\bullet, \lambda^\bullet)$ of injective sheaves, there exists a morphism of complexes $q^\bullet:I^\bullet\rightarrow J^\bullet $ such that $q^d$ is injective for each $d$.

*  For each $d$, $\pi\in\Pi$, and maximal vector $s\in I^d(\pi)$, $\eta^d(\pi)(s)=0$.

Moreover, for a given complex of sheaves there exists a unique (up to isomorphism of complexes) injective resolution by a minimal complex of injective sheaves.

The implications $2\Rightarrow 1$ and $3\Rightarrow 1$ are immediate as both imply that $\dim I^d(\pi) \leq \dim J^d(\pi)$ for every complex $J^\bullet$ quasi-isomorphic to $I^\bullet$, and every $d\in\Z$, $\pi\in\Pi$.

We show implication $1\Rightarrow 4$, proof of which also yields an argument for existence of minimal injective complexes, and then we show $4\Rightarrow 3$ and $4\Rightarrow 2$, which will also yield the uniqueness.

$1\Rightarrow 4$: We show that if $4$ does not hold, then $1$ does not hold either. If $s$ is a maximal vector in $I^d(\pi)$ which does not vanish when we apply $\eta^d$, we can define $\hat I$ as in the proof of Theorem <ref>:

0d   0d

0 r d

I^d-1rη^d-1d q^d-1=𝕀

I^d-1r η̂^d-1d
Î^drη̂^d d
Î^d+1rη̂^d+1 d

0   0   0   0

Since the top row has trivial cohomology, the long exact sequence theorem implies that
\[0\rightarrow H^j(I^\bullet) \overset{q^j}{\rightarrow} H^j(\hat I^\bullet) \rightarrow 0\]
is exact, that is, $q^\bullet$ induces an isomorphism on the homology. We have found a complex $\hat I^\bullet$ quasi-isomorphic to $I^\bullet$ with fewer indecomposable summands in places $d$ and $d+1$, so $I^\bullet$ is not minimal.

By iterating this process, we can produce, from any bounded complex of injective sheaves $J^\bullet$, a minimal complex of injective sheaves $I^\bullet$, which proves the existence of minimal injective complexes.

$4\Rightarrow 2, 3$:
Since $I^\bullet$, $J^\bullet$ are quasi-isomorphic, there is a quasi-isomorphism $q^\bullet: I^\bullet\rightarrow J^\bullet$. Because both complexes consist of injective sheaves, $q^\bullet$ is a homotopy equivalence. Therefore, let $q^\bullet: I^\bullet \rightarrow J^\bullet$ and $r^\bullet: J^\bullet \rightarrow I^\bullet$ form a homotopy equivalence. We show that if $I^\bullet$ satisfies the condition $4$, then $q^d$ is injective and $r^d$ is surjective for each $d$.

We inductively prove that $r^d \circ q^d$ is injective and that $r^d \circ q^d (\ker\eta^d) = \ker\eta^d$. As the base case, choose any $d$ such that $I^j=0$ for each $j\le d$, where the induction hypothesis holds trivially. We show the induction step.

By assumption, $r^d \circ q^d=\id + h^{d+1}\circ \eta^d + \eta^{d-1}\circ h^d$ for a collection of morphisms

\[
h^d:I^d\rightarrow I^{d-1}.\]

We begin by showing that the restriction of $r^d \circ q^d$ to $\ker\eta^d$ is injective.

I^d-1 rrη^d-1 [dd,swap, shift right, "q^d-1"] [ll, swap, bend right = 60, "h^d-1"]
I^d rrη^d [dd,swap, shift right, "q^d"] [ll, swap, bend right = 60, "h^d"]
I^d+1 [dd,swap, shift right, "q^d+1"] [ll, swap, bend right = 60, "h^d+1"] rrη^d+1
⋯[ll, swap, bend right = 60, "h^d+2"]

J^d-1 [rr,swap,"λ^d-1"] [uu,swap, shift right, "r^d-1"]
J^d [rr,swap,"λ^d"] [uu,swap, shift right, "r^d"]
J^d+1 [rr,swap,"λ^d+1"][uu,swap, shift right, "r^d+1"]

Assume $\pi\in\Pi$, $x\in\ker\eta^d(\pi)$, and $x\in\ker (r^d\circ q^d)(\pi)$. Then

\[0 = (r^d\circ q^d)(\pi) (x) = x + 0 + (\eta^{d-1} \circ h^d)(\pi) (x).\]

That is, $x=(\eta^{d-1}\circ h^d)(\pi)(-x)$. Set $y\coloneqq h^d(\pi)(-x)$.

Because $q^\bullet$ is a morphism of complexes,  $\lambda^{d-1}\circ q^{d-1} = q^d\circ \eta^{d-1}$. Because $\eta^{d-1}(\pi)(y)=x$, we have that $(\lambda^{d-1}\circ q^{d-1})(\pi)(y) = q^d(\pi)(x)$. Because $(r^d\circ q^d)(\pi)(x)=0$, we have that

\[
(r^d\circ \lambda^{d-1}\circ q^{d-1})(\pi) (y)  =0.
\]

Because $r^\bullet$ is a morphism of complexes, $r^d\circ \lambda^{d-1}=  \eta^{d-1}\circ r^{d-1}$.  Therefore,

\[
(\eta^{d-1}\circ r^{d-1}\circ q^{d-1})(\pi) (y)  =0.
\]

We have therefore shown that $ (r^{d-1}\circ q^{d-1})(\pi)(y)\in \ker \eta^{d-1}(\pi)$.

By the induction assumption, we have that
\[(r^{d-1}\circ q^{d-1})(\ker\eta^{d-1})=\ker\eta^{d-1}.\]

Therefore, there exists $z \in \ker\eta^{d-1}(\pi)$ such that $(r^{d-1}\circ q^{d-1})(\pi)(z)=(r^{d-1}\circ q^{d-1})(\pi)(y)$. By the induction assumption that $ r^{d-1}\circ q^{d-1}$ is injective, we have that $z=y$. Therefore, $y\in\ker \eta^{d-1}(\pi)$, and $x=\eta^{d-1}(\pi) (y) = 0$. Altogether we showed that the restriction of $r^d\circ q^d$ to $\ker\eta^d$ is injective.

For each non-zero vector $u\in I^d(\tau)$, there exists $(\tau\le\pi)\in\Pi$ and a non-zero maximal vector $s\in I^d(\pi)$ such that $I^d(\tau\le\pi)(u)=s$. By the condition 4 for $I^\bullet$, all maximal vectors in $I^d(\pi)$ are elements of $\ker\eta^d(\pi)$. Because the restriction of $r^d\circ q^d$ to $\ker\eta^d$ is injective, $(r^d\circ q^d)(\pi)(s)\neq 0$. By the commutativity assumed in the definition of a natural transformation (Definition <ref>),
\[
I^{d+1}(\tau\le\pi)\big((r^d\circ q^d)(\tau)(u)\big) = (r^d\circ q^d)(\pi)\big( I^{d}(\tau\le\pi)(u)\big) = (r^d\circ q^d)(\pi)(s)\neq 0.
\]

Therefore, $(r^d\circ q^d)(\tau)(u) \neq 0$. That is, $r^d \circ q^d$ is injective. Moreover, because $r^\bullet$ and $q^\bullet$ are morphisms of complexes, $(r^d \circ q^d) (\ker\eta^d) \subseteq \ker\eta^d$. Because the restriction of $r^d\circ q^d$ to $\ker\eta^d$ is injective, we have the desired equality: $(r^d \circ q^d) (\ker\eta^d) = \ker\eta^d$.

Since $r^d\circ q^d(\pi)$, for $\pi\in\Pi$, is an endomorphism of finite-dimensional vector spaces, it is injective iff it is surjective. Therefore, $q^d$ is injective and $r^d$ is surjective, as claimed.

Finally, if both complexes satisfy condition $4$, then by a symmetric argument, also $r^d$ is injective, and $q^d$ is surjective. In particular, $q^d$ is an isomorphism of sheaves, i.e., $q^\bullet$ is an isomorphism of complexes.

§.§ The Derived Category of Sheaves

We will now (finally) define the derived category of sheaves on a finite poset. It is in this language that our main results will be stated. Our primary motivation for adopting this perspective is to treat (co)chain complexes (rather than (co)homology groups, for example) as the fundamental objects on which our algorithms will operate. The remaining technicality which we now need to address is when two morphisms of complexes aught to be viewed as the same.

A morphism $\alpha^\bullet:F^\bullet\rightarrow G^\bullet$ between two complexes, $(F^\bullet,\eta^\bullet)$ and $(G^\bullet,\delta^\bullet)$, is null-homotopic if there exists morphisms of sheaves $h^d:F^d\rightarrow G^{d-1}$:

F^d-1 rrη^d-1 [dd,swap, shift right, "α^d-1"] [ddll, swap, "h^d-1"]
F^d rrη^d [dd,swap, shift right, "α^d"] [ddll, swap, "h^d"]
F^d+1 [dd,swap, shift right, "α^d+1"] [ddll, swap, "h^d+1"] rrη^d+1
⋯[ddll, swap, "h^d+2"]

G^d-1 [rr,swap,"δ^d-1"]
G^d [rr,swap,"δ^d"]
G^d+1 [rr,swap,"δ^d+1"]

such that $\alpha^d=\delta^{d-1}h^d+h^{d+1}\eta^d$, for each $d$.

To get a better intuition about null-homotopic maps, we state an alternate definition. We need to first introduce the mapping cone of a morphism of complexes, which will also be useful in later sections.

The mapping cone, of a morphism $\alpha^\bullet:F^\bullet\rightarrow G^\bullet$ between two complexes, $(F^\bullet,\eta^\bullet)$ and $(G^\bullet,\delta^\bullet)$, is a complex $C(\alpha^\bullet) = (C^\bullet, \gamma^\bullet)$ given by
\[
C^d \coloneqq F^{d+1}\oplus G^{d},\hspace{20mm} \gamma^d = \begin{pmatrix} -\eta^{d+1} & 0 \\ \alpha^{d+1} & \delta^d \end{pmatrix}.
\]

every matrix/.append style=name=mtx,
execute at end picture=
[blue, dashed, opacity=.5] (mtx-1-3.north west) – (mtx-1-3.north east) – (mtx-1-3.south east) – (mtx-2-2.south east) – (mtx-2-2.south west) – (mtx-2-2.north west) – cycle;
[blue, opacity=.5] (mtx-2-2.south east) node[label=[label distance=1mm]200:$C^{d-1}$];

[blue, dashed, opacity=.5] (mtx-1-4.north west) – (mtx-1-4.north east) – (mtx-1-4.south east) – (mtx-2-3.south east) – (mtx-2-3.south west) – (mtx-2-3.north west) – cycle;
[blue, opacity=.5] (mtx-2-3.south east) node[label=[label distance=1mm]200:$C^{d}$];

[blue, dashed, opacity=.5] (mtx-1-5.north west) – (mtx-1-5.north east) – (mtx-1-5.south east) – (mtx-2-4.south east) – (mtx-2-4.south west) – (mtx-2-4.north west) – cycle;
[blue, opacity=.5] (mtx-2-4.south east) node[label=[label distance=1mm]200:$C^{d+1}$];

column sep=17mm,
cells=text width=width("$G^{d+2}$"),
⋯r    [-10mm] F^d-1 rη^d-1 dα^d-1
F^d rη^d dα^d
F^d+1 rη^d+1 dα^d+1
F^d+2 r dα^d+2    [-10mm] ⋯

⋯r    [-10mm] G^d-1 [swap]rδ^d-1
G^d [swap]rδ^d
G^d+1 [swap]rδ^d+1
G^d+2 r    [-10mm] ⋯

The following is a useful fact which we need in later sections.

A morphism $\alpha^\bullet:F^\bullet\rightarrow G^\bullet$ between two complexes is a quasi-isomorphism if and only if its mapping cone, $C(\alpha^\bullet)$, is exact.

A morphism $\alpha^\bullet:F^\bullet\rightarrow G^\bullet$ between two complexes, $(F^\bullet,\eta^\bullet)$ and $(G^\bullet,\delta^\bullet)$,
is null-homotopic if and only if $\alpha^\bullet$ factors through the mapping cone of the identity map on the complex $(G^{\bullet-1},-\delta^{\bullet-1})$ (with indices shifted by $-1$):

F^∙[swap]rα̃^∙ [bend left=30]rrα^∙
C(𝕀_(G^∙-1,-δ^∙-1)) [swap]rproj

Note that, by Lemma <ref>, the mapping cone of an identity map is an exact complex. Hence, the above proposition immediately implies that all null-homotopic maps induce trivial morphisms on cohomology sheaves. This gives some intuition for the following definition, which, on a high level, states that null-homotopic maps should be treated as zero maps for the purposes of homological algebra.

The bounded derived category of sheaves on $\Pi$, $D^b(\Pi)$, consists of a set of objects

\[
\Ob D^b(\Pi) = \{(I^\bullet,\eta^\bullet)\text{ a minimal complex of injective sheaves}\}
\]

and a vector space of morphisms between any two objects

\[
\Hom_{D^b(\Pi)}(I^\bullet, J^\bullet)
\]

which is defined to be the quotient space of the (finite-dimensional) vector space of all morphisms (of complexes) from $I^\bullet$ to $J^\bullet$ modulo the subspace of null-homotopic morphisms.

It follows from Theorem <ref> that the above definition of the bounded derived category of sheaves is in fact a skeleton of the category which is traditionally referred to as the bounded derived category of sheaves [26, 7]. We choose this definition in order to streamline and simplify the computational perspective of derived categories considered below.

§.§ Computations in the Derived Category of Sheaves

§.§.§ Computing Minimal Injective Resolutions of Complexes

With labeled matrix representations we can easily recognise whether a complex of injective sheaves is minimal, and obtain a minimal complex in case it is not. We fix a complex of injective sheaves $(I^\bullet,\eta^\bullet)$ and assume it is represented by labeled matrices $\eta^\bullet$.

Recognising minimality. The complex $I^\bullet$ is minimal iff $\eta^d[\pi,\pi]$ is either empty or a zero matrix for all $d$ and all $\pi\in\Pi$. This is a reformulation of the condition <ref> in Theorem <ref>: if $I^d = \bigoplus_{i=1}^m [\pi_i]^{p_i}$, then the maximal vectors in $I^d(\pi_i)$ are exactly vectors in the subsheaf $[\pi_i]^{p_i}(\pi_i)$. Natural transformations map maximal vectors either to zero or again to a maximal vector, therefore, a maximal vector from $I^d$ gets sent to a non-zero vector by $\eta^d$ iff there is a non-zero coefficient at the intersection of a column and a row both labeled by the same simplex.

Computing minimal complex: the peeling procedure. To construct a labeled matrix representation $\hat\eta^\bullet$ of the minimal complex of injective sheaves quasi-isomorphic to $(I^\bullet,\eta^\bullet)$, we follow the peeling process used to show the existence in Section <ref>. As described above, if $I^\bullet$ is not minimal, there is some $d$ and $\pi$ such that $\eta^d[\pi,\pi]$ is a non-zero matrix. Following standard Gaussian elimination and further reduction, we reduce $\eta^d[\pi,\pi]$ so that every row and every column has at most one $1$ and otherwise zeros. We perform the reduction on the whole matrix $\eta^d$, using allowed elementary row and column operations. For every row and column in $\eta^d[\pi,\pi]$ that contains $1$, we then also clear out the rest of that row or column in $\eta^d$. For every operation we perform on $\eta^d$, we perform the corresponding operations on $\eta^{d-1}$ and $\eta^{d+1}$, as described above for change of bases in complexes.

If $\eta^d$ has $1$ on an intersection of a row and a column both labeled by $\pi$, and both having $0$ as all other entries, then the corresponding $\pi$-labeled column in $\eta^{d-1}$ and $\pi$-labeled row in $\eta^{d+1}$ must both be zero, as $\eta^d\!\cdot\!\eta^{d-1}=0=\eta^{d+1}\!\cdot\!\eta^d$. Therefore, we have identified a sequence $0\rightarrow [\pi] \rightarrow [\pi] \rightarrow 0$ that splits from the complex, and removing it produces a quasi-isomorphic complex. If the discussed entry in $\eta^d$ is at position $(i,j)$, then we remove the $j$-th row from $\eta^{d-1}$, the $j$-th column and the $i$-th row from $\eta^d$, and the $i$-th column from $\eta^{d+1}$.

To obtain the minimal injective complex, we iterate this procedure until we have matrices $\hat\eta^\bullet$ such that $\hat\eta^d[\pi,\pi]$ is either empty or a zero matrix for every $d$ and $\pi\in\Pi$. The process is summarised as Algorithm <ref>.

Computing minimal complex: Peeling
Input: $\eta^0,\dots,\eta^n$ labeled matrices representing a complex of injective sheaves $(I^\bullet,\eta^\bullet)$ on $\Pi$

Output: $\hat\eta^0,\dots,\hat\eta^n$ labeled matrices representing the minimal complex of injective sheaves quasi-isomorphic to $(I^\bullet,\eta^\bullet)$

[1]
$\exists d\in\{0,\dots,n\} \ \exists \pi\in \Pi$ such that $\eta^d[\pi,\pi]$ is a non-zero matrix
find labeled matrices $L,R$ such that:

* $(L\!\cdot\! \eta^d\!\cdot\! R)[\pi,\pi]$ is a $01$-matrix

* every $\pi$-labeled column of $L\!\cdot\! \eta^d\!\cdot\! R$ contains at most one $1$

* every $\pi$-labeled row of $L\!\cdot\! \eta^d\!\cdot\! R$ contains at most one $1$

Extended Gaussian elimination on $\eta^d[\pi,\pi]$ and further reduction on $\eta^d$.
$\eta^{d\phantom{+1}}\gets L \cdot\!\eta^{d}\cdot\! R$
$\eta^{d-1}\gets R^{-1}\cdot\eta^{d-1}$
$\eta^{d+1}\gets \eta^{d+1} \cdot L^{-1}$

$\exists$ $i$-th row, $j$-th column in $\eta^d$ labeled by $\pi$ such that $\eta^d[i,j]=1$
delete the $i$-th row and the $j$-th column from $\eta^d$
delete the $j$-th row from $\eta^{d-1}$
delete the $i$-th column from $\eta^{d+1}$

Note that unlike in the proof of Theorem <ref>, here we show that the sequence that we peel off, $0 \rightarrow [\pi] \rightarrow [\pi] \rightarrow 0$, actually splits from $I^\bullet$. Applying the argument iteratively, we get the following.

Let $J^\bullet$ be any complex of injective sheaves, and $I^\bullet$ its minimal injective resolution. Then there exists an exact complex of injective sheaves $E^\bullet$, and an isomorphism of complexes

\[
J^\bullet\cong I^\bullet\oplus E^\bullet.
\]

In other words, the short exact sequence

\[
0\rightarrow I^\bullet\xrightarrow{q^\bullet} J^\bullet\rightarrow E^\bullet\rightarrow 0
\]

splits (in the category of complexes of sheaves), where $q^\bullet$ is the injective morphism from Theorem <ref>.

§.§.§ Computing a Basis for the Space of Morphisms

We describe the spaces of all morphisms and all null-homotopic morphisms between two complexes of injective sheaves as solutions to systems of linear equations. Those systems of equations are smaller compared to the case of general sheaves, because for injective sheaves, we can take advantage of the labeled matrix representations of natural transformations. This said, the size of the systems of linear equations which define these morphisms are impractically large; the goal of this exposition is to give an explicit description of the space morphisms between two objects in the derived category of sheaves, including a way (albeit impractical) to compute their basis.

We fix two complexes of injective sheaves, $(I^\bullet,\eta^\bullet)$, $(J^\bullet,\lambda^\bullet)$, and denote by $m(I^d)$ and $m(J^d)$ the number of indecomposable injective summands in $I^d$ and $J^d$, respectively. We assume that both complexes are represented by labeled matrices as described above, and we denote the matrices by the same symbols as the natural transformations they represent, e.g., $\eta^d$ is a $m(I^{d+1})\times m(I^{d})$ labeled matrix.

We can describe every morphism $\alpha^\bullet:I^\bullet\rightarrow J^\bullet$ as another collection of labeled matrices. The dimensions are fixed: $\alpha^d$ is a $m(J^d)\times m(I^d)$ matrix with columns labeled as columns of $\eta^d$, and rows labeled as columns of $\lambda^d$. Therefore, we have $\sum_k m(J^d)\cdot m(I^d)$ variables which will be used to define $
\alpha^\bullet$. We observe that the definition for $\alpha^\bullet$ to represent a morphism yields two sets of linear constrains:

* poset constrains: $\alpha^d[i,j]=0$ whenever $\sigma\not\leq\pi$ for $\sigma$ the label of the $i$-th row and $\pi$ the label of the $j$-th column of $\alpha^d$,

* commutativity constrains: $\alpha^{d+1}\cdot \eta^d - \lambda^d\cdot\alpha^d = 0$ yields $m(J^{d+1})$ linear constrains for each $d$.

The system of linear equations for null-homotopic morphisms is the one above together with new variables and new constrains. We have $\sum_k m(I^d)\cdot m(J^{d-1})$ new variables for the matrices $h^d$ representing the natural transformations $I^d\rightarrow J^{d-1}$ as in Definition <ref>. Again, we label each $h^d$ accordingly to fit with the labeling of $\eta^\bullet$, $\lambda^\bullet$. We get the following two new sets of linear constrains:

* poset constrains: $h^d[i,j]=0$ whenever $\sigma\not\leq\pi$ for $\sigma$ the label of the $i$-th row and $\pi$ the label of the $j$-th column of $h^d$,

* homotopy constrains: $\alpha^{d} - h^{d+1}\cdot\eta^d - \lambda^d\cdot h^{d-1} = 0$ yields $m(J^d)$ linear constrains for each $d$.

Altogether, computing a basis for the space of morphisms $\Hom_{D^b(\Pi)}(I^\bullet,J^\bullet)$ (see Definition <ref>) reduces to computing a basis for the space of solutions to the above system of linear equations.

§ DERIVED FUNCTORS

A fundamental application of derived sheaf theory is the study of continuous maps. To illustrate these applications, we will recall several functors between categories of sheaves which are induced by continuous maps between topological spaces.

§.§ Pushforward

Suppose $f:\Pi\rightarrow \Lambda $ is an order preserving map of posets, and $F$ is a sheaf on $\Pi$. Then the pushforward of $F$ by $f$ is defined by

\begin{align*}
f_\ast F (\lambda)&\coloneqq \varprojlim_{\pi\in f^{-1}(\St\lambda)} F(\pi)\\
&= \bigg\{v\in \bigoplus_{\pi\in f^{-1}(\St\lambda)}F(\pi):\\
& \hspace{.5in} F(\gamma\le \tau)\left(\Proj_{F(\gamma)} (v)\right)=\Proj_{F(\tau)}(v)\text{ for all }(\gamma\le\tau)\in f^{-1}(\St\lambda)\bigg\},
\end{align*}

where $\Proj_{F(\gamma)}:\bigoplus_{\pi\in f^{-1}(\St\lambda)}F(\pi)\rightarrow F(\gamma)$ denotes projection onto $F(\gamma)$, and the linear maps $f_\ast F (\kappa\le \lambda)$ are restrictions of the projections $\bigoplus_{\pi\in f^{-1}(\St\kappa)}F(\pi) \rightarrow \bigoplus_{\pi\in f^{-1}(\St\lambda)}F(\pi)$.

The pushforward is functorial; that is, if $\eta: F\rightarrow G$ is a natural transformation between sheaves $F$ and $G$ on $\Pi$, then

\[
f_\ast \eta: f_\ast F\rightarrow f_\ast G,
\]

is a natural transformation, where $f_\ast\eta(\lambda)$ is obtained by restricting the domain of the sum of linear maps

\[\sum_{\pi\in f^{-1}(\St\lambda)} \eta(\pi):\bigoplus_{\pi\in f^{-1}(\St\lambda)}F(\pi)\rightarrow \bigoplus_{\pi\in f^{-1}(\St\lambda)}G(\pi).\]

Notice that if $\eta:F\rightarrow G$ is injective, then $f_\ast \eta$ is injective. However, the same is not necessarily true for surjectivity. In the language of category theory, $f_\ast $ is a left exact functor. It is useful to observe that in our finite setting, pushforwards of finite resolutions have a straightforward structure.

If $I\cong \bigoplus_{0\leq j\leq n} [\pi_j]$ is an injective sheaf on $\Pi$, then $f_\ast I$ is an injective sheaf on $\Lambda$ given by
\[f_\ast I \cong \bigoplus_{0\leq j\leq n} [f(\pi_j)].\]

Because $f_\ast\left(\bigoplus_j F_j \right) = \bigoplus_j f_\ast F_j$, it is enough to observe that $f_\ast[\pi] \cong [f(\pi)]$ for any $\pi\in\Pi$. Indeed, by definition
\[
f_\ast[\pi](\sigma) = \begin{cases}
k \text{ if $\pi\in f^{-1}(\St\sigma)$} \\
0 \text{ otherwise,}
\end{cases}
\]

and $\pi\in f^{-1}(\St\sigma)$ if and only if $f(\pi)\in \St\sigma$.

§.§ Pullback

Suppose $f:\Pi\rightarrow \Lambda $ is an order preserving map of posets, and $F$ is a sheaf on $\Lambda$. Then the pullback of $F$ by $f$ is defined by

\begin{align*}
f^\ast F (\pi)&\coloneqq F(f(\pi)),
\end{align*}

with linear maps $f^\ast F (\pi\le \tau) = F(f(\pi)\le f(\tau))$.

As with the pushforward, the pullback is functorial: if $\eta: F\rightarrow G$ is a natural transformation between sheaves $F$ and $G$ on $\Lambda$, then $\eta$ defines a natural transformation

\[
f^\ast \eta: f^\ast F\rightarrow f^\ast G,
\]

where $f^\ast\eta(\pi)\coloneqq \eta(f(\pi))$.

Unlike the pushforward, the pullback preserves both the injectivity and surjectivity of natural transformations, and defines an exact functor. However, (again in contrast to the pushforward) the pullback does not necessarily preserve injectivity of sheaves.

Let $\Pi=(a\leq b,c)$, $\Lambda=(a'\leq b',c'\leq d')$ and $f:\Pi\rightarrow\Lambda$ sends $a,b,c$ to $a',b',c'$, respectively. Then the constant sheaf on $\Lambda$, is injective: $k_\Lambda=[d']$. By the definition, its pullback is $f^\ast k_\Lambda = k_\Pi$, which is not an injective sheaf on $\Pi$.

[column sep = 7pt]

k         k

k lu ru

$\xleftarrow{\qquad f^\ast \qquad}$
[column sep = 7pt]

k ru         k lu

k lu ru

In Section <ref> we give a description of a pushforward of injective sheaves as a restriction of an injective sheaf over a modified poset.

§.§ Proper Pushforward

Now we define a proper pushforward associated to the inclusion $i:Z\hookrightarrow \Pi$.

\[
i_!F (\sigma )\coloneqq\begin{cases}
F(\sigma)\text{ if }\sigma\in Z\\
0\text{ else.}
\end{cases}
\]

As above, it is straightforward to show that $i_!$ is functorial, and that $i_!(\eta)$ preserves the injectivity of $\eta$ as well as the surjectivity, aka $i_!$ is exact.

Unless $Z$ is closed, a proper pushforward, $(i_Z)_! I$, of an injective sheaf is not injective, because it has zero spaces below non-zero spaces. However, it is a subsheaf of an injective sheaf. Indeed, if $I\cong \bigoplus_{0\leq j\leq n} [\pi_j]$ is an injective sheaf on $Z$, and $\hat I\coloneqq (i_Z)_\ast I \cong \bigoplus_{0\leq j\leq n} [\pi_j]$ is an injective sheaf on $\Pi$, then $(i_Z)_! I (\pi) = \hat I (\pi)$ for every $\pi\in Z$.

§.§ Proper Pullback

Let $Z$ be a locally closed subset of $\Pi$ (the intersection of an open and a closed subset). In this section we define the proper pullback, $i_Z^!$, of the inclusion map $i_Z:Z\hookrightarrow\Pi$.

Let $Z$ be a locally closed subset of $\Pi$. Given a sheaf $F$ on $\Pi$, let $i_Z^!F$ be the sheaf on $Z$ defined by

\[
i_Z^!F(\zeta) := \bigg\{v\in F(\zeta) : F(\zeta\le\tau)(v) = 0\text{ for all }\tau\in \St_\Pi \zeta-Z\bigg\},
\]

where $\zeta\in Z$ and $\St_\Pi \zeta$ is the star of $\zeta$ in $\Pi$.

As above, it is straightforward to show that $i^!$ is functorial, and that $i^!(\eta)$ preserves the injectivity of $\eta$ but not necessarily surjectivity. Computing proper pullbacks of injective sheaves is straightforward.

Let $Z$ be a locally closed subset of $\Pi$. If $I\cong \bigoplus_{0\leq j\leq n} [\pi_j]$ is an injective sheaf on $\Pi$, then $i_Z^! I$ is an injective sheaf on $Z$ with a decomposition
\[i_Z^! I \cong \bigoplus_{\substack{0\leq j\leq n: \\ \pi_j\in Z}} [\pi_j].\]

The functor $i^!_Z$ is additive, so it is enough to consider $i^!_Z[\pi]$ for an indecomposable injective sheaf $[\pi]$.

Assume first that $\pi\notin Z$. Let $\zeta\in Z$. Either $\zeta\le\pi$, and then $i^!_Z[\pi](\zeta) = 0$, because $[\pi](\zeta\le \pi) = \id_k$; or $\zeta\not\le\pi$, and then also $i^!_Z[\pi](\zeta) = 0$, because $[\pi](\zeta)=0$. Therefore, $i^!_Z[\pi]= 0$ for $\pi\notin Z$.

Now we consider the case when $\pi\in Z$. If $\zeta\in Z$ with $\zeta\not\le \pi$, then $i^!_Z[\pi](\zeta) = 0$ because $[\pi](\zeta)=0$. If $\zeta\le \pi$, then the intersection

\[
\{\gamma\in\Pi:\gamma \le \pi\}\cap \St_\Pi \zeta
\]

is a subset of $Z$ (because $Z$ is locally closed). Therefore, if $\tau\in \St_\Pi\zeta - Z$ then $\tau\not\le \pi$, and hence $[\pi](\zeta\leq\tau)=0$. It follows that $i^!_Z[\pi](\zeta) = k$. Altogether, we have shown that $i^!_Z([\pi]_\Pi)$ is isomorphic to $[\pi]_Z$ (we add the subscripts $\Pi$ and $Z$ to emphasize that $[\pi]_\Pi$ is a sheaf on $\Pi$ and $[\pi]_Z$ is a sheaf on $Z$).

Combining this with Lemma <ref>, we see that $i_\ast i_Z^! I$ is the subsheaf of $I$ containing only the indecomposable injective summands $[\pi]$ on $\Pi$ for $\pi \in Z$.

For a natural transformation $\eta:I\rightarrow J$ between two injective sheaves and $\pi\in Z$, the map $i_Z^! \eta (\pi)$ is just a restriction of $\eta (\pi)$. Combined with a simple observation that maximal vectors in $i_Z^! I (\pi)$ are the same as maximal vectors in $I (\pi)$, the maximal vector condition in Theorem <ref> implies that if $I^\bullet$ is minimal, then also $i_Z^! I^\bullet$ is minimal. This is particularly useful when we consider a singleton $Z=\{\pi\}$:

§.§ Derived Functors and Hypercohomology

We now apply the above operations to complexes of injective sheaves.

Let $f:\Sigma\rightarrow\Lambda$ be an order preserving map of posets and $(I^\bullet,\eta^\bullet)\in D^b(\Sigma)$ be a minimal injective complex of sheaves on $\Sigma$. Let $F$ be one of the functors $f_\ast$, $f^\ast$, $f_!$, or $f^!$, defined above (we assume $f$ is an inclusion in the proper cases).  Define $RF (I^\bullet)\in D^b(\Lambda)$ to be the minimal injective resolution of the complex

\[
\cdots\rightarrow F(I^d)\xrightarrow{F\eta^d}F(I^{d+1})\xrightarrow{F\eta^{d+1}}F(I^{d+2})\rightarrow \cdots.
\]

As with other functors, we usually write $RFI^\bullet=RF(I^\bullet)$ for brevity.

Let $p:\Sigma \rightarrow \{\star\}$ be the projection map to the single point poset. Let $I^\bullet$ be a complex of injective sheaves on $\Sigma$. Define the hypercohomology of $I^\bullet$ to be

\[
\mathbb{H}^d( I^\bullet) \coloneqq H^dRp_\ast I^\bullet.
\]

Notice that $Rp_\ast(I^\bullet)$ is simply a complex of vector spaces. As such, the minimality condition forces all maps to be zero maps, which implies that $H^dRp_\ast I^\bullet = (Rp_\ast I^\bullet)^d$ when we view the right-hand side as the vector space over the single element.

Assume $I^\bullet\in D^b(\Sigma)$ is a minimal complex. Let $m_{I^\bullet}^d(\pi)$ be the multiplicity of the indecomposable summand $[\pi]$ in $I^d$. If $i_\pi:\{\pi\}\hookrightarrow \Sigma$, then

\[
\dim \mathbb{H}^dR i_\pi^! I^\bullet = m_{I^\bullet}^d(\pi).
\]

This follows directly from Lemma <ref>.

In the setting of simplicial complexes (or, more generally, cellular complexes) the cohomology sheaves of the derived pushforward of a constant sheaf are closely related to singular cohomology groups of level-sets. This allows us to give some intuition behind derived pushforwards with the following proposition.

Suppose $f:\Sigma\rightarrow \Lambda$ is a simplicial map. As sheaves on $\Lambda$,

\begin{align*}
H^dRf_\ast k_\Sigma  &\cong H^d(|f^{-1}(\St\blank)|;k)
\end{align*}

where $H^d(|f^{-1}(\St\blank)|;k)$ is the sheaf defined by associating the simplex $\lambda$ to the singular cohomology of the geometric realization of $f^{-1}(\St\lambda)$ (with linear maps induced by inclusion).

Let $I^\bullet$ be the injective resolution described in Section <ref>. Then $Rf_\ast I^\bullet (\lambda)$ is the complex consisting of only the linear combinations of generators for indecomposable sheaves $[\pi]\subset I^\bullet$ such that $\pi\in f^{-1}(\St\lambda)$ and chain maps $\eta^\bullet(f^{-1}(\St\lambda))$. After forgetting the matrix labels representing $Rf_\ast I^\bullet (\lambda)$, we obtain the simplicial cochain complex of $K(f^{-1}(\St\lambda))$. The cohomology groups of this cochain complex are isomorphic to the singular cohomology of the geomtric realization of $f^{-1}(\St\lambda)$:
\[H^dRf_\ast k_\Sigma(\lambda) \cong H^d(|f^{-1}(\St\lambda)|;k),\]
and the linear maps $H^dRf_\ast(\kappa\le\lambda)$ are the usual cohomology maps
\[H^d(|K(f^{-1}(\St\kappa))|;k)\rightarrow H^d(|K(f^{-1}(\St\lambda))|;k)\]
induced by inclusion (cf. <cit.>).

§.§ Algorithms for computing derived functors

In this section we describe how to compute injective resolutions of the introduced derived functors applied to injective complexes. Concrete examples of the computations are presented in Section <ref>. We assume $f:\Pi\rightarrow\Lambda$ is an order preserving map of posets, $(I^\bullet,\eta^\bullet)$ is a complex of injective sheaves represented by labeled matrices $\eta^\bullet$. We will assume each $I^\bullet$ to start in degree $0$ – if it is not the case, we can shift the degrees. Note that this means that we start with a zero matrix $\eta^{-1}$ with rows labeled according to a decomposition of $I^0$, and no columns.

For the discussions we also fix $I=\bigoplus_i[\pi_i]$, $J=\bigoplus_j[\sigma_j]$ and $\eta:I\rightarrow J$ a natural transformation represented by a labeled matrix $\eta$.

§.§.§ Pushforward

For labeled matrices, computing pushforwards is very simple. To obtain a representation of $f_\ast\eta$, we only need to relabel $\eta$: replace every label $\pi$ by $f(\pi)$, both for rows and columns. Indeed, by Lemma <ref>, both $f_\ast I$ and $f_\ast J$ are injective, so $f_\ast \eta$ can be represented by a labeled matrix, and by the same lemma the labeling we described is correct. The only thing left to check is that the map $(f_\ast\eta)_{dp}:[f(\pi_d)]\rightarrow [f(\sigma_p)]$ is determined by the same scalar as $\eta_{dp}$, which is clear from the definitions and the following diagram:

[π_d] [swap]rincl [bend left=15]rrrrη_dp
⊕_i[π_i] rrη
[squiggly, shorten > = 1mm, shorten < = 1mm]df_∗
⊕_j[σ_j] [swap]rproj

f_∗[π_d] [swap]rf_∗incl [equal]d
f_∗⊕_i[π_i] [swap]rrf_∗η [equal]d

f_∗⊕_j[σ_j] [swap]rf_∗proj [equal]d
f_∗[σ_p] [equal]d

[f(π_d)] rincl [bend right=15, swap]rrrr(f_∗η)_dp
⊕_i[f(π_i)] rrf_∗η

⊕_j[f(σ_j)] rproj

When $f$ is not injective, $f_\ast\eta$ might send some maximal vectors to non-zero vectors even if $\eta$ did not. Therefore, we compute $Rf_\ast I^\bullet$ in two steps:

* change all labels $\pi$ to $f(\pi)$ in all matrices $\eta^d$,

* perform the peeling procedure described in Section <ref> to get the minimal complex.

Note that for computations, $I^\bullet$ does not need to be minimal to start with: since $f$ preserves order, all operations allowed before relabeling are still allowed after relabeling, and therefore performing peeling-relabeling-peeling allows for exactly the same set of reductions as just relabeling-peeling.

§.§.§ Mapping cylinder of an order preserving map

To be able to easily compute certain derived functors, it is convenient to describe natural transformations using the labeled matrices. Some functors do not preserve injectivity, e.g., the pullback, as described in Example <ref>. However, we can still describe them with labeled matrices—we pass to injective sheaves over a bigger poset that we introduce in this section, and then restrict those back to the poset of interest.

Given an order preserving map between two posets, $f:\Pi\rightarrow\Lambda$, the mapping cylinder of $f$ is the poset $\Pi\sqcup_f\Lambda$ with the underlying set the disjoint union $\Pi\sqcup\Lambda$, and the order defined as follows: $\pi\leq \tau$ in $\Pi\sqcup_f\Lambda$ if and only if one of the following conditions is satisfied

* $\pi,\tau\in\Pi$ and $\pi\leq \tau$ in $\Pi$,

* $\pi,\tau\in\Lambda$ and $\pi\leq \tau$ in $\Lambda$, or

* $\pi\in\Pi$, $\tau\in\Lambda$ and $f(\pi)\leq \tau$ in $\Lambda$.

In other words, the order relation in $\Pi\sqcup_f\Lambda$ is generated by new relations $\pi\leq f(\pi)$ for every $\pi\in\Pi$ together with the order relations on $\Pi$ and $\Lambda$. Note that every chain in $\Pi\sqcup_f\Lambda$ decomposes into a prefix of elements from $\Pi$ and suffix of elements from $\Lambda$ (either possibly empty). The following is an important property of this construction.

For $\pi\in\Pi$, the star of $\pi$ in $\Pi\sqcup_f\Lambda$ is the union of stars of $\pi$ in $\Pi$ and $f(\pi)$ in $\Lambda$:
\[ \St_{\Pi\sqcup_f\Lambda}\pi =  \St_{\Pi}\pi \cup \St_{\Lambda} f(\pi).
\]

The inclusion “$\supseteq$” is immediate since $\pi\leq f(\pi)$ in $\Pi\cup_f\Lambda$. For “$\subseteq$”, let $\pi\leq\tau$ in $\Pi\cup_f\Lambda$. Then by definition either $\tau\in\Pi$ and $\tau\in\St_{\Pi}\pi$; or $\tau\in\Lambda$ and then $f(\pi)\leq \tau$ in $\Lambda$, i.e., $\tau\in\St_{\Lambda} f(\pi)$.

In particular, the lemma implies that if $\eta$ is a labeled matrix representing a natural transformation between two injective sheaves on $\Pi\sqcup_f \Lambda$, and if all its labels are in $\Lambda$, then $\eta(\pi)=\eta(f(\pi))$ for all $\pi\in\Pi$.

§.§.§ Pullback

The pullback $f^\ast I$ of an injective sheaf $I=\bigoplus_j[\lambda_j]$ on $\Lambda$ might not be injective, but we can describe it as a restriction of an injective sheaf on $\Pi\sqcup_f\Lambda$, given by $\hat I\coloneqq \bigoplus_j[\lambda_j]$. Note that we now use the same symbol $[\lambda_j]$ for two different sheaves: once on $\Lambda$, once on $\Pi\sqcup_f\Lambda$. We claim that $\hat I$ restricted to $\Pi$ is $f^\ast I$. This is clear from the definition and Lemma <ref>.

The same construction works for the pullback of a natural transformation $\eta:I\rightarrow J$ of injective sheaves on $\Lambda$. We construct $\hat J$ analogously to $\hat I$, and we take $\hat\eta$ as the natural transformation described by the same labeled matrix as $\eta$. Then $\hat\eta(\pi)=\eta(f(\pi))=f^\ast\eta(\pi)$.

In the rest of this section, we describe how to compute a labeled matrix representation of $Rf^\ast I^\bullet$, given a labeled matrix representation of $(I^\bullet,\eta^\bullet)$, a complex of injective sheaves on $\Lambda$. We use the description of $f^\ast I^\bullet$ as a complex of injective sheaves over $\Pi\sqcup_f\Lambda$, to find $(J^\bullet,\delta^\bullet)$, a complex of injective sheaves on $\Pi$ quasi-isomorphic to $f^\ast I^\bullet$. Recalling Definition <ref>, we exploit Lemma <ref>.

Our goal is, therefore, to construct an exact complex $(C^\bullet,\gamma^\bullet)$ on $\Pi$ which will describe a quasi-isomorphism $\alpha^\bullet:f^\ast I^\bullet \rightarrow J^\bullet$. The construction is a modification of the construction of injective resolutions described in Section <ref>. The procedure is described in Algorithm <ref>. We remark that on line <ref> we can be adding $r$ instead of $-r$, since complexes given by $\eta^\bullet$ and $-\eta^\bullet$ are quasi-isomorphic—we switch the sign only to be consistent with our choice of signs in the definition of the mapping cone.

Computing $R f^\ast I^\bullet$

* $\eta^{-1},\dots,\eta^n$ labeled matrices representing a complex of injective sheaves $(I^\bullet,\eta^\bullet)$ on $\Lambda$

* $f:\Pi\rightarrow\Lambda$ order preserving map, with $\Pi$ and $\Lambda$ disjoint

Output: $\delta^{-1},\dots,\delta^m$ labeled matrices representing complex $R f^\ast (I^\bullet)$ on $\Pi$

* $I^d$ denotes the tuple of labels of columns of $\eta^d$, or equivalently rows of $\eta^{d-1}$.

* $C^d$ denotes the tuple of labels of columns of $\gamma^d$, or equivalently rows of $\gamma^{d-1}$.

[1]
$\gamma^{-2} \gets$ labeled matrix with no columns, and row labels $I^0$

We are building complex $(C^\bullet,\gamma^\bullet)$ on $\Pi\sqcup_f \Lambda$
$k\gets -1$
$C^d\neq 0$ or $d < n$
$\gamma^{d} \gets$ labeled matrix with columns labeled by $C^d$
$r$ row in $\eta^{d+1}$
add a row $-r$ to $\gamma^d$
Including the label; with $0$ in columns not labeled by $\Lambda$

$\pi\in\Pi$ in non-increasing order
$\gamma^d \gets$$(\gamma^{d-1},\gamma^d,\pi)$
Algorithm <ref>
$d \gets d+1$
$m\gets \max\left\{ m \, \middle| \, C^m\neq 0 \right\}$
$\gamma^{-1}[\Pi,\Pi], \dots, \gamma^m[\Pi,\Pi]$
Note that $\gamma^{-2}[\Pi,\Pi]$ has no columns and no rows.

Correctness of Algorithm <ref>
We argue that the sequence $(C^\bullet,\gamma^\bullet)$ of sheaves on $\Pi\sqcup_f\Lambda$ that we produce in Algorithm <ref> is a complex, and that its restriction to $\Pi$ is a mapping cone of a quasi-isomorphism between $f^\ast I^\bullet$ and a complex of injective sheaves $J^\bullet$ that is represented by labeled matrices $\gamma^d[\Pi,\Pi]$. First of all, note that $\gamma^d$ is a block matrix
\[
\gamma^d = \
\begin{pNiceArray}[first-row,first-col]{c|c}
& \Lambda & \Pi \\
\Lambda & -\eta^{d+1} & 0 \\
\hline\noalign{\vspace{2pt}}
\Pi & \alpha^{d+1} & \delta^{d}
\end{pNiceArray},
\]

where $-\hat\eta^{d+1} = \gamma^d[\Lambda, \Lambda]$, $\alpha^{d+1} = \gamma^d[\Pi,\Lambda]$, and $\delta^d = \gamma^d[\Pi, \Pi]$. The composition of two adjacent transformations is

\begin{equation}\label{eq:pullback_correctness_gamma_composition}
\gamma^d \cdot \gamma^{d-1} = \
\begin{pNiceArray}[first-row,first-col]{c|c}
& \Lambda & \Pi \\
\Lambda & \eta^{d+1} \cdot \eta^d & 0 \\
\hline\noalign{\vspace{2pt}}
\Pi & -\alpha^{d+1}\cdot\eta^{d} + \delta^d\cdot\alpha^d & \delta^{d} \cdot \delta^{d-1}
\end{pNiceArray}.
\end{equation}

This evaluates to zero: the top-left block is zero because $(I^\bullet,\eta^\bullet)$ is a complex, and the two bottom blocks are zero by construction, as we only add a $\Pi$-labeled row $r$ to $\gamma^d$ if $r\cdot\gamma^{d-1}=0$. Therefore, $(C^\bullet,\gamma^\bullet)$ is a complex of injective sheaves on $\Pi\sqcup_f\Lambda$.

The matrix labels give us a particular decomposition of each $C^d$ into indecomposable injective sheaves. We write $C^d=\hat I^{d+1} \oplus J^d$, with $\hat I^{d+1}$ consisting of the indecomposable injective summands generated by elements in $\Lambda$, and $J^d$ consisting of those generated by elements in $\Pi$. Then we can view $C^\bullet$ as a mapping cone of a morphism $\hat\alpha^\bullet: (\hat I^\bullet, \hat\eta^\bullet) \rightarrow (J^\bullet, \delta^\bullet)$ of complexes on $\Pi\sqcup_f\Lambda$:

every matrix/.append style=name=mtx,
execute at end picture=
[blue, dashed, opacity=.5] (mtx-1-3.north west) – (mtx-1-3.north east) – (mtx-1-3.south east) – (mtx-2-2.south east) – (mtx-2-2.south west) – (mtx-2-2.north west) – cycle;
[blue, opacity=.5] (mtx-2-2.south east) node[label=[label distance=1mm]200:$C^{d-1}$];

[blue, dashed, opacity=.5] (mtx-1-4.north west) – (mtx-1-4.north east) – (mtx-1-4.south east) – (mtx-2-3.south east) – (mtx-2-3.south west) – (mtx-2-3.north west) – cycle;
[blue, opacity=.5] (mtx-2-3.south east) node[label=[label distance=1mm]200:$C^{d}$];

[blue, dashed, opacity=.5] (mtx-1-5.north west) – (mtx-1-5.north east) – (mtx-1-5.south east) – (mtx-2-4.south east) – (mtx-2-4.south west) – (mtx-2-4.north west) – cycle;
[blue, opacity=.5] (mtx-2-4.south east) node[label=[label distance=1mm]200:$C^{d+1}$];

column sep=17mm,
cells=text width=width("$G^{d+2}$"),
⋯r    [-10mm] Î^d-1 rη̂^d-1 dα̂^d-1
Î^d rη̂^d dα̂^d
Î^d+1 rη̂^d+1 dα̂^d+1
Î^d+2 r dα̂^d+2    [-10mm] ⋯

⋯r    [-10mm] J^d-1 [swap]rδ^d-1
J^d [swap]rδ^d
J^d+1 [swap]rδ^d+1
J^d+2 r    [-10mm] ⋯

The matrix (<ref>) being zero implies that $J^\bullet$ is a complex and that $\hat\alpha^{d+1}\circ\hat\eta^d$ and $\delta^d\circ\hat\alpha^d$ commute.

Now we restrict $C^\bullet$ to $\Pi$. As we argued at the start of this section, the restriction of $\hat I^\bullet$ to $\Pi$ is $f^\ast I^\bullet$. The support of $J^\bullet$ is already in $\Pi$, so the restricting $J^\bullet$ to $\Pi$ we only forget trivial vector spaces. Therefore, $\alpha^\bullet$, the restriction of $\hat\alpha^\bullet$ to $\Pi$, is a morphism of complexes from $f^\ast I^\bullet$ to $J^\bullet$. We claim that $\alpha^\bullet$ is a quasi-isomorphism. By Lemma <ref> we need to check that the restriction of $C^\bullet$ to $\Pi$ is exact, i.e., that
\[
\ker(\gamma^d[\St\pi, \St\pi])=\im(\gamma^{d-1}[\St\pi, \St\pi])\]
for every $d\in\Z$ and $\pi\in\Pi$. This is true by Lemma <ref>.

Minimality of the resulting complex. We claim that no mater whether $I^\bullet$ was minimal, the complex resulting from Algorithm <ref> is minimal. According to Section <ref>, we need $\delta^d[\pi,\pi]$ to be zero (or empty) for every element $\pi\in\Pi$ and degree $d$. Since $\delta^d[\pi,\pi]=\gamma^d[\pi,\pi]$, we can prove this for $\gamma^d$ and $\pi\in\Pi$. All rows labeled by $\pi$ were added by calling . By Lemma <ref>, if we added a row labeled by $\pi$ in $\gamma^{d-1}$ as the $j$-th row of $\gamma^{d-1}(\pi)$, then the canonical vector $e_j$ is in the image of $\gamma^{d-1}(\pi)$. Since we have a complex, this implies $\gamma^d(\pi)\cdot e_j=0$, which means that the $j$-th column of $\gamma^d(\pi)$ is $0$. This argument is true for all columns labeled by $\pi$ in $\gamma^d$, so we have $\gamma^d[\St\pi,\pi]=0$, and in particular $\gamma^d[\pi,\pi]=0$.

Alternative minimization algorithm. As an alternative to Algorithm <ref> for turning a complex of injective sheaves into the minimal one, we can perform the minimization by computing $R\,\id^*I^\bullet$. This complex is minimal, because Algorithm <ref> always returns a minimal complex, and it is quasi-isomorphic to $I^\bullet$ by the functoriality of (derived) pullback.

§.§.§ Proper Pushforward

We fix a locally closed subset $Z\xhookrightarrow{i_Z} \Pi$ and a complex $(I^\bullet,\eta^\bullet)$ of injective sheaves on $Z$. We denote by $\bar Z$ the downwards closure of $Z$ in $\Pi$. In Algorithm <ref> we give a construction of $R(i_Z)_!I^\bullet$. The construction is very similar to Algorithm <ref>. We again start with some prefilled labeled matrices, and add new rows to force exactness of the complex on a subset of $\Pi$. However, the interpretation of the constructed matrices is different – whereas the constructed matrices in Algorithm <ref> describe a mapping cone, in Algorithm <ref> they describe directly the complex of injective sheaves we are looking for.

Computing $R ({i_Z})_! I^\bullet$

* $\eta^{-1},\dots,\eta^n$ labeled matrices representing a complex of injective sheaves $(I^\bullet,\eta^\bullet)$ on $Z$

* $\Pi$ a poset, and $Z\subseteq\Pi$ locally closed

Output: $\delta^{-1},\dots,\delta^m$ labeled matrices representing complex $R ({i_Z})_! I^\bullet$ on $\Pi$

* $I^d$ denotes the tuple of labels of columns of $\eta^d$, or equivalently rows of $\eta^{d-1}$.

* $J^d$ denotes the tuple of labels of columns of $\delta^d$, or equivalently rows of $\delta^{d-1}$.

[1]
$\delta^{-1}\gets$ labeled matrix with no column and row labels $I^0$
$d\gets 0$
$J^d\neq 0$ or $d \leq n$
$\delta^{d} \gets$ labeled matrix with columns labeled by $J^d$
$r$ row in $\eta^{d}$
add a row $r$ to $\delta^d$
Including the label; with $0$ in columns not labeled by $Z$

$\pi\in \bar Z \setminus Z$ in non-increasing order
$\delta^d \gets$$(\delta^{d-1},\delta^d,\pi)$
Algorithm <ref>
$d \gets d+1$
$m\gets \max\left\{ m \, \middle| \, J^m\neq 0 \right\}$
$\delta^{-1}, \dots, \delta^{m}$

Correctness of Algorithm <ref>.
We show that the complex $(J^\bullet,\delta^\bullet)$ constructed in Algorithm <ref> is quasi-isomorphic to the proper pushforward $(i_Z)_! I^\bullet$. To this extent, we again use Lemma <ref>: we describe an injective morphism between complexes $\alpha^\bullet: (i_Z)_! I^\bullet \rightarrow J^\bullet$, and argue that its mapping cone is exact.

We start the construction of each matrix $\delta^{d-1}$ by inserting all ($Z$-labeled) rows from $\eta^{d-1}$, and after this, no more lines labeled by $Z$ are inserted. Therefore, for every $d$ and every $\pi\in Z$, we have $J^d(\pi) = I^d(\pi) = (i_Z)_! I^d(\pi)$. This allows us to define
\[
\alpha^d(\pi) =
\begin{cases}
\id \text{ if $\pi\in Z$,} \\
0 \text{ otherwise.}
\end{cases}
\]

This is clearly a morphism of complexes—recall that $(i_Z)_! I^d(\pi)=0$ for all $\pi\in\bar{Z}\setminus Z$.

Now let $(C^\bullet, \gamma^\bullet)$ be the mapping cone of $\alpha^\bullet$. We need to check that $C^\bullet(\pi)$ is an exact sequence for every $\pi\in \Pi$. This is straightforward for $\pi\in Z$, because in that case $(i_Z)_! I^\bullet(\pi)=J^\bullet(\pi)$, and $\alpha^\bullet(\pi)$ acts identically. It is also immediate for $\pi\in \Pi\setminus \bar Z$, because all spaces are zero in that case.

The remaining elements are $\pi\in \bar Z \setminus Z$, which we loop through on line $8$. Since $(i_Z)_! I^\bullet (\pi)$ is the zero complex, $\gamma^d(\pi) = \delta^d(\pi)$ for all $d$.
But exactness of the complex given by $\delta^\bullet (\pi)$ is forced by the construction—see Lemma <ref>.

The minimality of the resulting complex follows by the same argument as for Algorithm <ref> above.

An interesting formula. To illustrate the utility of our algorithmic treatment of derived categories of sheaves, we make the following observation, which leads to an interesting formula for finite posets. We noted that Algorithm <ref> and Algorithm <ref> are essentially performing the same procedure. One difference is, that in the former we start the construction of the $d$-th matrix matrix by adding rows from $\eta^{d+1}$, and in the latter we add rows from $\eta^d$. Therefore, all matrices are shifted by one. The second difference is that in Algorithm <ref> we take submatrices at the end. This can be interpreted as taking a proper pullback of the complex. Together, this yields an interesting relation between derived functors on posets.

Let $f:\Pi\rightarrow \Lambda$ be an order preserving map, $p:\Pi\hookrightarrow \Pi\sqcup_f\Lambda$ and $\ell:\Lambda\hookrightarrow \Pi\sqcup_f\Lambda$ be the natural inclusions to the mapping cylinder of $f$, and let $I^\bullet$ be a complex of injective sheaves on $\Lambda$. Then
\[
Rf^* I^\bullet = (Rp^! R\ell_! I^\bullet)^{\bullet+1},
\]

where $J^{\bullet+1}$ denotes the complex with $(J^{\bullet+1})^d = J^{d+1}$.

§.§.§ Proper Pullback

The proper pullback of a complex of injective sheaves represented by labeled matrices $\eta^d$, with respect to an inclusion $i: Z\hookrightarrow \Pi$, is represented by submatrices $\eta^d[Z,Z]$. This is an immediate corollary of Lemma <ref> and the discussion below it. Moreover, if the matrices $\eta^d$ represent a minimal complex on $\Pi$, then the submatrices $\eta^d[Z,Z]$ represent a minimal complex on $Z$, so no further minimisation process is necessary.

§.§ Long Exact Sequences of Hypercohomology

Suppose $\Pi=C\sqcup U$ is a partition of the finite poset $\Pi$ into a closed set $C$ and an open set $U$ (relative to the Alexandrov topology). Let $i_C:C\hookrightarrow \Pi$, $j_U:U\hookrightarrow \Pi$, and $p,q,r$ denote projections to the single element poset $\{\star\}$:

C ri_C[swap]drp
Πdq    U[swap]lj_Udlr

If $I^\bullet\in D^b(\Pi)$, then there are long exact sequences of hypercohomology groups (recalling Definitions <ref> and <ref>)

\begin{align}
\cdots\rightarrow& \mathbb{H}^d(R i_C^! I^\bullet)\rightarrow \mathbb{H}^d( I^\bullet)\rightarrow
\mathbb{H}^d(R  j_U^\ast I^\bullet)\\
&\rightarrow \mathbb{H}^{d+1}(R i_C^!I^\bullet)\rightarrow\cdots\nonumber
\end{align}

\begin{align}
\cdots\rightarrow& \mathbb{H}^d(R j_{U!}Rj_U^\ast I^\bullet)\rightarrow \mathbb{H}^d( I^\bullet)\rightarrow
\mathbb{H}^d(Ri_C^\ast I^\bullet)\\
&\rightarrow \mathbb{H}^{d+1}(R j_{U!}Rj_U^\ast I^\bullet)\rightarrow\cdots\nonumber
\end{align}

For any injective sheaf $I$ on $\Pi$, there are short exact sequence of sheaves:

\[
0\rightarrow i_{C\ast}i_{C}^! I\rightarrow I\rightarrow j_{U\ast}j_U^\ast I\rightarrow 0,
\]

\[
0\rightarrow j_{U!}j^\ast_U I\rightarrow I\rightarrow i_{C\ast}i^\ast_C I\rightarrow 0.
\]

These exact sequences define distinguished triangles in $D^b(\Pi)$, which then yield the desired long exact sequence of hypercohomology (see <cit.>).

§ MICROLOCAL SHEAF THEORY AND DISCRETE MORSE THEORY

In this section we establish a microlocal generalization of two classical results of discrete Morse theory (Theorem <ref> and Theorem <ref>). These generalizations show that the fibers of an order preserving map between posets which lie in the discrete microsupport of a given sheaf correspond to non-isomorphisms between sheaf hypercohomology groups of adjacent sub/super-level sets. We begin by introducing the discrete microsupport of a complex of sheaves and illustrating some of its basic properties.

§.§ Discrete Microsupport

Let $\Pi$ be a finite poset, $I^\bullet\in D^b(\Pi)$, and $i_\tau:\tau\hookrightarrow \Pi $ be the inclusion map. The $\ast$-support of $I^\bullet\in D^b(\Pi)$ is defined as

\[
\supp^\ast I^\bullet \coloneqq  \{\tau\in \Pi: H^j Ri_\tau^\ast I^\bullet\neq0\text{ for some }j\in\mathbb{Z}\}.
\]

The $!$-support of $I^\bullet\in D^b(\Pi)$ is defined as

\[
\supp^! I^\bullet \coloneqq  \{\tau\in \Pi: H^j Ri_\tau^! I^\bullet\neq0\text{ for some }j\in\mathbb{Z}\}.
\]

Let $I^\bullet\in D^b(\Pi)$, and $n_{I^\bullet}^d(\pi)$ be the multiplicity of the indecomposable injective sheaf $[\pi]$ in $I^d$.

\[
\pi\notin \supp^!I^\bullet \text{ if and only if } n_{I^\bullet}^d(\pi)=0\text{ for all }d\in\mathbb{Z}.
\]

Let $\Cl\supp^\ast I^\bullet$ denote the closure of $\supp^\ast I^\bullet$, and $\Cl\supp^! I^\bullet$ denote the closure of $\supp^! I^\bullet$ (with respect to the Alexandrov topology, Definition <ref>). Then

\[
\Cl\supp^!I^\bullet =  \Cl\supp^\ast I^\bullet.
\]

The first statement is a direct consequence of Corollary <ref>. We begin the proof of the second statement by showing that $\supp^!I^\bullet \subseteq \Cl\supp^\ast I^\bullet$.
Suppose that $n^d_{I^\bullet}(\pi)\neq 0$ for some $d\in \mathbb{Z}$. If $\pi\in\supp^\ast I^\bullet$, then there is nothing to prove. Assume that $\pi\notin\supp^\ast I^\bullet$. Because $n^d_{I^\bullet}(\pi)\neq 0$, $I^d(\pi)$ contains a nonzero maximal vector, which we denote by $x$. Because $\pi\notin\supp^\ast I^\bullet$, $H^d(I^\bullet(\pi))=0$. Therefore, there exists a vector $v\in I^{d-1}(\pi)$ which maps onto $x$. Because $I^\bullet$ is assumed to be minimal, $v$ is not maximal. Choose a simplex $\tau\ge \pi$ such that $I^{d-1}(\pi\le\tau)(v)$ is a maximal vector. Then $n^{d-1}_{I^\bullet}(\tau)\neq 0$. If $\tau\in \supp^\ast I^\bullet$, then $\pi\in\Cl\supp^\ast I^\bullet$. Otherwise, we can apply the same argument as above to produce a new simplex $\sigma\ge \tau$ such that $n^{d-2}_{I^\bullet}(\sigma)\neq 0$. Because the complex is bounded (and the poset $\Sigma$ is finite), this process must terminate with an element $\omega\ge \pi$ such that $n^{d}_{I^\bullet}(\omega)\neq 0$ and $\omega\in\supp^\ast I^\bullet$, which proves that $\pi\in\Cl\supp^\ast I^\bullet$.

Second, we prove the inclusion $\supp^\ast I^\bullet \subseteq   \Cl\supp^! I^\bullet$. Suppose $\tau\in \supp^\ast I^\bullet$. By the definition of $i_\tau^\ast$, if $H^d Ri_\tau^\ast I^\bullet\neq 0$ for some $d\in \mathbb{Z}$, then there exists $\sigma\ge \tau$ such that $n^d_{I^\bullet}(\sigma)\neq 0$. Therefore, $\sigma\in \supp^! I^\bullet$, and $\tau\in\Cl\supp^! I^\bullet$.

The support is traditionally defined to be $\Cl\supp^\ast I^\bullet$, and is therefore, by definition, closed. As a consequence, there is usually no distinction between the $!$-support and the $\ast$-support. However, for the Morse theoretic results below, we find it useful to keep track of these differences.

We now introduce a novel definition of discrete microsupport, which is a finer invariant than the support(s) defined above.

Let $\Pi$ be a finite poset. For a locally closed subset $Z$ of $\Pi$, denote the inclusion map by $i_Z:Z\hookrightarrow\Pi$. The discrete $\ast$-microsupport of $I^\bullet\in D^b(\Pi)$ is a subset of the set of all locally closed subsets of $\Pi$, defined by

\begin{align*}
\mu\supp^\ast I^\bullet \coloneqq&\left\{ Z\text{ locally closed in }\Pi: \mathbb{H}^d \left(R{i_Z}_!R i_Z^\ast I^\bullet\right)\neq 0\text{ for some }d\in\mathbb{Z}\right\}.
\end{align*}

The discrete $!$-microsupport of $I^\bullet$ is a subset of the set of all locally closed subsets of $\Pi$, defined by

\begin{align*}
\mu\supp^! I^\bullet \coloneqq&\left\{Z\text{ locally closed in }\Pi:\mathbb{H}^d\left(R i_Z^! I^\bullet\right)\neq 0\text{ for some }d\in\mathbb{Z}\right\}.
\end{align*}

By Lemma <ref>, we can equivalently define the discrete microsupport by

\begin{align*}
\mu\supp^\ast I^\bullet \coloneqq&\left\{Z\text{ locally closed in }\Pi:\mathbb{H}^d\left(R i_{\Cl Z}^\ast I^\bullet\right)\xrightarrow{\not{\sim}}\mathbb{H}^d\left(R i_{\Cl Z-Z}^\ast I^\bullet\right)\text{ for some }d\in\mathbb{Z}\right\}\text{ and }\\
\mu\supp^! I^\bullet \coloneqq&\left\{ Z\text{ locally closed in }\Pi: \mathbb{H}^d \left(R{i^\ast_{\St Z}} I^\bullet\right)\xrightarrow{\not{\sim}} \mathbb{H}^d \left(R{i^\ast_{\St Z-Z}} I^\bullet\right)\text{for some }d\in\mathbb{Z}\right\}.
\end{align*}

In a recent work [41], Schapira introduces the propagation-set of a derived sheaf as a means of generalizing the microsupport to presheaves on presites and ind-sheaves. In our setting, the propagation-set admits a simple definition

\[
\text{Prop }I^\bullet =\{\sigma\le\tau\in \Pi: \St\sigma - \St\gamma\text{ and }\St\gamma - \St \tau \text{ are not contained in $\mu\supp^!I^\bullet$ for all } \sigma\le \gamma\le\tau\}.
\]

This definition suggests that a more restrictive version of the discrete microsupport might have more desirable theoretical properties (at the expense of increased computational complexity). The more restrictive definition would consider a locally closed set $Z\not\in\mu\supp^! I^\bullet$ if and only if $\mathbb{H}^d \left(R{i^!_{W}} I^\bullet\right)=0$ for each locally closed subset $W$ of $Z$ (similarly for $\mu\supp^\ast I^\bullet$). However, we choose to continue with the less restrictive definition of discrete microsupport, which is sufficient for our results on computational sheaf theory and discrete microlocal Morse theory.

It is immediate that $\pi\in\supp^! I^\bullet$ if and only if $\{\pi\}\in\mu\supp^! I^\bullet$. Therefore, the discrete $!$-microsupport generalizes the $!$-support in an obvious way. However, the discrete $\ast$-microsupport is strictly a generalization of the $\ast$-support only if $\Pi$ has the following property: for each $\pi\in \Pi$, if the boundary, $\Cl\pi-\pi$, of $\pi$ is non-empty, then the hypercohomology of the injective resolution of the constant sheaf on the boundary is non-zero. This happens, for example, whenever $\Pi$ is a simplicial complex. In general, $ \{\pi\in\Pi:\{\pi\}\in\mu\supp^\ast I^\bullet\}\subset \supp^\ast I^\bullet$ (for an example, consider the constant sheaf on a totally ordered poset with two elements).

If $\St\sigma - \St\tau\notin \mu\supp^! I^\bullet$, for $\sigma\le\tau\in \Pi$, then the linear maps $H^d(I^\bullet)
(\sigma\le\tau)$ are isomorphisms for each $d\in \mathbb{Z}$.

Let $\sigma\le\tau\in\Pi$.
The linear map $H^d(I^\bullet)(\sigma\le\tau)$ is, by definition,

\[
H^d(I^\bullet)(\sigma\le\tau):\mathbb{H}^d(i_\sigma^*I^\bullet)\rightarrow  \mathbb{H}^d(i_\tau^*I^\bullet),
\]

where $i_\gamma:\St\gamma\hookrightarrow \Pi$. Because $\St\tau$ is an open subset of $\St\sigma$ for $\sigma\le \tau$, we can apply Lemma <ref> to get a long exact sequence

\begin{align*}
\cdots\rightarrow& \mathbb{H}^d(R i_Z^! I^\bullet)\rightarrow \mathbb{H}^d( i_\sigma^\ast I^\bullet)\rightarrow
\mathbb{H}^d(R  i_\tau^\ast  I^\bullet)\\
&\rightarrow \mathbb{H}^{d+1}(R i_Z^!I^\bullet)\rightarrow\cdots
\end{align*}

where $Z=\St\sigma-\St\tau$. Because $Z\notin \mu\supp^!I^\bullet$, $\mathbb{H}^d(R i_Z^! I^\bullet)=0$ for all $d\in\mathbb{Z}$. Therefore, $ H^d(I^\bullet)(\sigma\le\tau)$ is an isomorphism for each $d\in\mathbb{Z}$.

An immediate consequence of the above theorem is that if $\mu\supp^! I^\bullet$ contains no sets of the form $\St\sigma-\St\tau$, then the cohomology sheaves $H^d(I^\bullet)$ are locally constant.

§.§ The Discrete Microlocal Morse Theorem and Inequalities

The results of this section are discrete analogues of work by Kashiwara [23], Schapira–Tose [45], and Witten [46]. In fact, the proofs of Theorem <ref> and Theorem <ref> closely follow the main ideas presented in [23] and [45].

Suppose that $f:\Lambda\rightarrow\Pi$
is an order preserving map of finite posets. Let $I^\bullet\in D^b(\Lambda)$. An element $\pi\in\Pi$ is $(I^\bullet, f,\ast)$-critical if $f^{-1}(\pi)\in \mu\supp^\ast I^\bullet$.
An element $\pi\in\Pi$ is $(I^\bullet, f,!)$-critical if $f^{-1}(\pi)\in \mu\supp^! I^\bullet$.

Let $f:\Lambda\rightarrow\Pi$ be an order preserving map of finite posets.
For $\pi\in \Pi$, let
\[i_{\le \pi}:\{\sigma\in\Lambda:f(\sigma)\le \pi\}\hookrightarrow \Lambda, \quad i_{\ge \pi}:\{\sigma\in\Lambda:f(\sigma)\ge \pi\}\hookrightarrow \Lambda\]
be inclusion maps of sublevel-sets and superlevel-sets of $f$. For $a\le b\in\Pi$, let
\[(a,b]=\{z\in\Pi:a< z\le b\}.\]

For $I^\bullet\in D^b(\Lambda)$, if $(a,b]$ contains no $(I^\bullet,f,!)$-critical elements, then the natural morphisms

\begin{align}
\mathbb{H}^d\left( R i_{\le b}^!I^\bullet \right)&\rightarrow \mathbb{H}^d \left(R  i_{\le a}^!I^\bullet \right)\text{ and }\label{eqn:first-iso}\\
\mathbb{H}^d\left(R i_{\ge a}^\ast I^\bullet \right)&\rightarrow \mathbb{H}^d \left(R i_{\ge b}^\ast I^\bullet \right)\label{eqn:second-iso}
\end{align}

are isomorphisms for each $d\in\mathbb{Z}$.  If $(a,b]$ contains no $(I^\bullet,f,\ast)$-critical elements, then the natural morphisms

\begin{align}
\mathbb{H}^d\left( R i_{\le b}^\ast I^\bullet \right)&\rightarrow \mathbb{H}^d \left(R i_{\le a}^\ast I^\bullet \right)\label{eqn:third-iso}
\end{align}

are isomorphisms for each $d\in\mathbb{Z}$.

We can give the poset $\Pi$ a total order which refines the given partial order. Each morphism of the theorem is a composition of morphisms corresponding to intervals of the form $(a,b]=\{b\}$ in the total order of $\Pi$.
Therefore, without loss of generality, we assume that $(a,b]=\{b\}$.

Each of the isomorphisms of the theorem follow from similar arguments. We begin with equation <ref>. Because $f^{-1}_{\le a}$ is a closed subset of $f^{-1}_{\le b}$, by Lemma <ref>, and the fact that $Ri^\ast_{\le a}Ri^\ast_{\le b}I^\bullet = Ri^\ast_{\le a}I^\bullet$, we have a long exact sequence of cohomology groups

\begin{align*}
\cdots\rightarrow& \mathbb{H}^d\left(Ri_{\le a}^!I^\bullet\right)\rightarrow \mathbb{H}^d\left(Ri_{\le b}^!I^\bullet\right)\rightarrow
\mathbb{H}^d\left(Ri_{f^{-1}(b)}^! I^\bullet\right)\\
&\rightarrow \mathbb{H}^{d+1}\left(Ri_{\le a}^!I^\bullet\right)\rightarrow\cdots
\end{align*}

By the definition of $(I^\bullet,f,!)$-critical elements and $\mu\supp^!I^\bullet$, $\mathbb{H}^d\left(Ri_{f^{-1}(b)}^!I^\bullet\right)=0$. Therefore,

\[\mathbb{H}^d\left(Ri_{\le a}^!I^\bullet\right)\rightarrow \mathbb{H}^d\left(Ri_{\le b}^!I^\bullet\right)\]

is an isomorphism for each $d\in\mathbb{Z}$.

We now turn to equation <ref>. Because $f^{-1}_{\ge a}$ is an open subset of $\Lambda$,

\[Ri_{f^{-1}(b)}^!Ri_{\ge a}^\ast I^\bullet = Ri_{f^{-1}(b)}^!Ri_{\ge a}^! I^\bullet =Ri_{f^{-1}(b)}^!I^\bullet, \]

where $i_{f^{-1}(b)}:f^{-1}(b)\hookrightarrow f^{-1}_{\ge a}$. Moreover, because $f^{-1}_{\ge b}$ is an open subset of $f^{-1}_{\ge a}$, Lemma <ref> yields

\begin{align*}
\cdots\rightarrow& \mathbb{H}^d\left(Ri_{f^{-1}(b)}^!I^\bullet \right)\rightarrow \mathbb{H}^d\left(Ri_{\ge a}^\ast I^\bullet\right)\rightarrow
\mathbb{H}^d\left(Ri_{\ge b}^\ast I^\bullet\right)\\
&\rightarrow \mathbb{H}^{d+1}\left(Ri_{f^{-1}(b)}^!I^\bullet\right)\rightarrow\cdots
\end{align*}

Again, by the definition of $(I^\bullet,f,!)$-critical elements and $\mu\supp^!I^\bullet$, $\mathbb{H}^d\left(Ri_{f^{-1}(b)}^!I^\bullet\right)=0$, and equation <ref> follows.

Finally we turn to equation <ref>. Because $f^{-1}(b)$ is open in $f^{-1}_{\le b}$, Lemma <ref> gives us the long exact sequence

\begin{align}
\cdots\rightarrow& \mathbb{H}^d(R i_{f^{-1}(b)!}Ri_{f^{-1}(b)}^\ast I^\bullet)\rightarrow \mathbb{H}^d(Ri^\ast_{\le b} I^\bullet)\rightarrow
\mathbb{H}^d(Ri_{\le a}^\ast I^\bullet)\\
&\rightarrow \mathbb{H}^{d+1}(R i_{f^{-1}(b)!}Ri_{f^{-1}(b)}^\ast I^\bullet)\rightarrow\cdots\nonumber
\end{align}

where $i_{f^{-1}(b)}:f^{-1}(b)\hookrightarrow f^{-1}_{\le b}$. By the definition of $(I^\bullet,f,\ast)$-critical elements and $\mu\supp^\ast I^\bullet$,
\[\mathbb{H}^d(R j_{f^{-1}(b)!}Rj_{f^{-1}(b)}^\ast I^\bullet)=0,\]
and equation <ref> follows.

Let $\kappa^!\subset \Pi$ (and $\kappa^\ast \subset \Pi$) denote the set of $(I^\bullet,f,!)$-critical elements in $\Pi$ (and $(I^\bullet,f,\ast)$-critical elements, respectively). For each $\ell\in\mathbb{Z}$,

\begin{align}
(-1)^\ell \sum_{j\le\ell} (-1)^j\dim \mathbb{H}^j(I^\bullet)&\le (-1)^\ell \sum_{\pi\in \kappa^!}\sum_{j\le\ell} (-1)^j\dim \mathbb{H}^j\left(Ri_{f^{-1}(\pi)}^! I^\bullet\right),\text{ and}\\
(-1)^\ell \sum_{j\le\ell} (-1)^j\dim \mathbb{H}^j(I^\bullet)&\le (-1)^\ell \sum_{\pi\in \kappa^\ast}\sum_{j\le\ell} (-1)^j\dim \mathbb{H}^j\left(Ri_{f^{-1}(\pi)!}Ri_{f^{-1}(\pi)}^\ast I^\bullet\right).
\end{align}

\begin{align}
\chi I^\bullet&= \sum_{\pi\in\kappa^!} \chi Ri^!_{f^{-1}(\pi)} I^\bullet= \sum_{\pi\in\kappa^\ast} \chi Ri_{f^{-1}(\pi)!}Ri^\ast_{f^{-1}(\pi)} I^\bullet.
\end{align}

\[
\cdots \rightarrow V_C^{d-1}\rightarrow V_A^{d}\rightarrow V^d_B\rightarrow V^d_C\rightarrow V_A^{d+1}\rightarrow V_B^{d+1}\rightarrow V_C^{d+1}\rightarrow V_A^{d+2}\rightarrow  \cdots
\]

is a long exact sequence of vector spaces. Because the sequence is exact,

\begin{align*}
\sum_{j\in\mathbb{Z}}(-1)^j (\dim V_A^j-\dim V_B^j+\dim V_C^j)=0.
\end{align*}

Moreover, the sequence

\[
\cdots \rightarrow V_C^{\ell-1}\rightarrow V_A^{\ell}\rightarrow V^\ell_B\xrightarrow{\delta} V^\ell_C\rightarrow \coker\delta \rightarrow 0\rightarrow  \cdots
\]

is exact, and therefore

\begin{align*}
(-1)^{\ell}\sum_{j\le \ell}(-1)^j (\dim V_A^j-  \dim V_B^j+  \dim V_C^j)= \dim \coker\delta\ge 0.
\end{align*}

Rearranging the above equations gives

\begin{align*}
(-1)^\ell \sum_{j\le \ell}(-1)^j \dim V_B^j&\le (-1)^\ell  \sum_{j\le \ell}(-1)^j (\dim V_A^j+  \dim V_C^j), \text{ and }\\
\sum_{j\in\mathbb{Z}}(-1)^j \dim V_B^j&=  \sum_{j\in\mathbb{Z}}(-1)^j (\dim V_A^j+  \dim V_C^j).
\end{align*}

Substituting the long exact sequences of Lemma <ref> to the above inequalities,  we have, for each $a\le b \in \Pi$ such that $(a,b]=\{b\}$,

\begin{align*}
(-1)^\ell \sum_{j\le \ell }&(-1)^j \dim \mathbb{H}^j(Ri^!_{\le b} I^\bullet) \le(-1)^\ell
\sum_{j\le \ell}(-1)^j (\dim \mathbb{H}^j(Ri^!_{\le a} I^\bullet)+  \dim \mathbb{H}^j(Ri^\ast_{f^{-1}( b)} I^\bullet) ),\\
\text{ and } \sum_{j\in\mathbb{Z} }&(-1)^j \dim \mathbb{H}^j(Ri^!_{\le b} I^\bullet) = \sum_{j\in\mathbb{Z}}(-1)^j (\dim \mathbb{H}^j(Ri^!_{\le a} I^\bullet)+  \dim \mathbb{H}^j(Ri^\ast_{f^{-1}( b)} I^\bullet) ).
\end{align*}

If $b\in \Pi$ is not $(I^\bullet,f,!)$-critical, then $ \dim \mathbb{H}^j(Ri^\ast_{f^{-1}( b)} I^\bullet) )=0$, which implies

\begin{align*}
(-1)^\ell \sum_{j\le \ell}(-1)^j \dim \mathbb{H}^j(Ri^!_{\le b} I^\bullet) &\le (-1)^\ell
\sum_{j\le \ell}(-1)^j \dim \mathbb{H}^j(Ri^!_{\le a} I^\bullet),\text{ and }\\
\sum_{j\in\mathbb{Z}}(-1)^j \dim \mathbb{H}^j(Ri^!_{\le b} I^\bullet) &=
\sum_{j\in\mathbb{Z}}(-1)^j \dim \mathbb{H}^j(Ri^!_{\le a} I^\bullet).
\end{align*}

By choosing a total order on $\Pi$ which respects the given partial order, and inductively applying the previous inequalities, we get

\begin{align*}
(-1)^\ell \sum_{j\le \ell}(-1)^j \dim \mathbb{H}^j( I^\bullet)& \le
\sum_{\pi \in \kappa^!} (-1)^\ell \sum_{j\le \ell}(-1)^j  \dim \mathbb{H}^j(Ri^\ast_{f^{-1}( \pi)} I^\bullet), \text{ and }\\
\chi I^\bullet&= \sum_{\pi\in\kappa^!}\chi Ri^\ast_{f^{-1}(\pi)}I^\bullet.
\end{align*}

The remaining (in)equalities follow from similar arguments.

§.§ Reduction to Classical Discrete Morse Theory

We will conclude this section by illustrating how the prior results generalize classical discrete Morse theory.
Let $\Sigma$ be a finite simplicial complex, and $I^\bullet\in D^b(\Sigma)$ the minimal injective resolution of the constant sheaf on $\Sigma$. Let $\phi:\Sigma\rightarrow \mathbb{R}$ be an order preserving map such that each fiber $\phi^{-1}(x)$ is an interval $[a,b]=\{z\in\Sigma:a\le z\le b\}$. Let $\Pi$ be the set of fibers of $\phi$, with partial order obtained by formally adding the relation $a\ge b$ for each pair of elements $a\le b$ in each fiber $\phi^{-1}(x)$, and taking the transitive closure of the new set of relations. By construction, $\phi$ factors through $\Pi$. Let $f:\Sigma\rightarrow \Pi$ be that factorization, and $\preceq$ the total order on $\Pi$ induced by the total order on $\mathbb{R}$. Let $f^{-1}_{\preceq c}\coloneqq \{\sigma\in\Sigma:f(\sigma)\preceq c\}$.

The element $\pi\in\Pi$ is $(I^\bullet,f,\ast)$-critical if and only if $f^{-1}(\pi)$ is a singleton.

By assumption $f^{-1}(\pi)=[a,b]$. Let $\Cl b$ denote the closure of $b$ in $\Sigma$. Because $I^\bullet$ is an injective resolution of the constant sheaf on $\Pi$, then $ Ri_{f^{-1}(\pi)}^\ast I^\bullet$ is an injective resolution of the constant sheaf on $f^{-1}(\pi)$ and we have the following isomorphisms
\[\mathbb{H}^dRi_{f^{-1}(\pi)!}Ri_{f^{-1}(\pi)}^\ast I^\bullet\cong H_c^d([a,b];k)\cong  H_d(\Cl b,\Cl b-\St a;k)\]

between hypercohomology, compactly supported cohomology, and relative homology for each $d$. Because $\Cl b$ is a closed simplex, the hypercohomology groups vanish if and only if $a\neq b$.

The right derived pullback $Ri^\ast_{{\preceq c}}I^\bullet$ of the injective resolution of the constant sheaf on $\Sigma$ by the inclusion map $i_{{\preceq c}}:f^{-1}_{{\preceq c}}\hookrightarrow \Sigma$, is isomorphic to the injective resolution of the constant sheaf on $f^{-1}_{\preceq c}$, and the hypercohomology groups are isomorphic to the usual simplicial cohomology groups:

\[
\mathbb{H}^d\left(Ri^\ast_{{\preceq c}}I^\bullet\right)\cong H^d\left(f^{-1}_{\preceq c};k\right).
\]

Therefore, in this context, Theorem <ref> states that if $ \#f^{-1}(\pi)>1$ for each element $\pi\in \Pi$ with $a\prec \pi\preceq b$, then the natural morphisms between simplicial cohomology groups

\begin{align*}
H^d\left(f^{-1}_{\preceq b};k\right)&\rightarrow H^j \left(f^{-1}_{\preceq a};k \right)
\end{align*}

are isomorphisms for each $d\in\mathbb{Z}$.

§ EXAMPLES

In this section we compute simple examples which illustrate the benefits of working with the derived and microlocal perspectives. We will compute three different complexes of sheaves, each obtained via a triangulated (simplicial) map, $g$, $h$, and $l$, from $S^2\lor S^1$ and $D^2$ to $S^2$. We will then illustrate the discrete microlocal Morse theorem for each of these complexes of sheaves, relative to a discrete Morse function, $f$, on the triangulation poset $\Lambda$ of $S^2$. All computations in this section are done over $k=\Z_2$.

We consider triangulations of two maps on the wedge sum of a sphere and a circle, with values in a sphere. Both maps send $S^2$ identically to $S^2$. The first map, $g$, sends the circle to the point where it touches the sphere, and $h$ sends it to the equator. We start by triangulating the spaces as shown in Figure <ref>. This gives us two posets, and two order preserving maps, $g,h: \Sigma \rightarrow \Lambda$. Both maps are determined by mapping vertices. Both send $0,1,2,3,4$ identically, and then $g$ sends $5,6 \overset{g}{\mapsto} 4$, whereas $h$ sends $5\overset{h}{\mapsto} 1$ and $6\overset{h}{\mapsto} 3$. The third map we consider, $l$, from the closed disk to the sphere, is obtained by identifying all points along the boundary of the closed disk. We triangulate the closed disk according to Figure <ref>. Then, the map $l$ is the identity map on the vertices 0, 1, 2, 3, and 4, and $5,6 \overset{l}{\mapsto} 4$.

(a) Triangulations of $S^2\lor S^1$, the closed disk $D^2$, and $S^2$. The face relations give rise to the posets $\Sigma$, $\Gamma$, and $\Lambda$, respectively. (b) The poset $\Sigma$ when both solid and dashed lines are considered, the poset $\Lambda$ when only solid lines are considered.

Following the approach of traditional discrete Morse theory, we choose a partition of $\Lambda$ into intervals, and choose a total order (which we denote by $\preceq$) on the quotient poset $\Pi$ by taking the alphabetical order of the labelling in Figure <ref>.  When we view $\Pi$ as a totally ordered set, we interpret the corresponding quotient map $f:\Lambda\rightarrow \Pi$ as a discrete Morse function, i.e. an order preserving map from $\Lambda$ to the real line.

(a) the Hasse diagram of $\Lambda$, with partition by locally closed sets. Each locally closed set has cardinality two, and is illustrated by a blue edge connecting its elements. (b) the Hasse diagram of the corresponding quotient poset $\Pi$.

(a) sublevel set $f^{-1}_{\preceq A}$. (b) sublevel set $f^{-1}_{\preceq B}$. (c) sublevel set $f^{-1}_{\preceq I}$. (d) sublevel set $f^{-1}_{\preceq K}$.

From now on we work with the posets, and we only refer back to the original spaces when interpreting the results. We denote the elements in the posets by the string of vertices that define the given simplex, e.g., $014$ is the triangle with edges $01$, $04$, $14$ and vertices $0$, $1$, $4$. The notation does not distinguish whether we talk about elements in $\Sigma$, $\Gamma$, or $\Lambda$; in cases where the distinction is not clear from the context, we use subscripts, e.g., $014_\Sigma\in\Sigma$ and $014_\Lambda\in\Lambda$.

We start by computing injective resolutions of the constant sheaves $k_\Sigma$ and $k_\Gamma$, which, in an abuse of notation, we denote again by $k_\Sigma$ and $k_\Gamma$. Then we compute $Rg_\ast k_\Sigma$, $Rh_\ast k_\Sigma$, and $Rl_\ast k_\Gamma$. We give a visualization of several intervals in $\mu\supp^!Rh_\ast k_\Sigma$ and $\mu\supp^\ast Rh_\ast k_\Sigma$. We compute various sets of critical elements of the Morse function $f$ (relative to each of the above complexes of sheaves), and finally compute Betti numbers for hypercohomology groups corresonding to filtrations induced by $f$.

The injective resolution of $k_\Sigma$. We compute the minimal injective resolution of $k_\Sigma$ iteratively using Algorithm <ref>, starting with a labeled matrix with one column labeled by a virtual element larger than everything in $\Sigma$, nine rows labeled by the maximal elements of $\Sigma$, and all entries $1$ (which will, however, not be a part of the complex). Alternatively, we can view the same computation as Algorithm <ref> computing the pullback $Rp^\ast(\dots\rightarrow 0 \rightarrow k \rightarrow 0 \rightarrow \dots)$ with respect to the constant map $p: \Sigma\rightarrow \mathrm{pt}$. Either way this yields a minimal complex of injective sheaves
\[
\cdots\rightarrow 0\rightarrow I^0 \xrightarrow{\eta^0} I^1 \xrightarrow{\eta^1} I^2\rightarrow 0 \rightarrow \cdots
\]

with the maps represented by the following two labeled matrices:

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{ccccccccc}
\eta^0 & 013   & 014   & 034   & 123   & 124   & 234   & 45    & 46    & 56    \\
01     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
03     & 1     & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
04     & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
12     & \cdot & \cdot & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot \\
13     & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot \\
14     & \cdot & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot & \cdot \\
23     & \cdot & \cdot & \cdot & 1     & \cdot & 1     & \cdot & \cdot & \cdot \\
24     & \cdot & \cdot & \cdot & \cdot & 1     & 1     & \cdot & \cdot & \cdot \\
34     & \cdot & \cdot & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot \\
4      & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & 1     & \cdot & \cdot \\
4      & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & \cdot \\
5      & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & \cdot & 1     \\
6      & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & 1
\CodeAfter
\begin{tikzpicture}
\node () [fit=(3-2) (3-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(3-5) (3-8), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-2) (6-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-5) (6-8), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-2) (11-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-5) (11-8), draw=magenta!80!black, rounded corners] {};
\end{tikzpicture}
\end{pNiceArray}
\]

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{ccccccccccccc}
\eta^1 & 01    & 03    & 04    & 12    & 13    & 14    & 23    & 24    & 34    & 4     & 4     & 5     & 6     \\
0      & 1     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
1      & 1     & \cdot & \cdot & 1     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
2      & \cdot & \cdot & \cdot & 1     & \cdot & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot \\
3      & \cdot & 1     & \cdot & \cdot & 1     & \cdot & 1     & \cdot & 1     & \cdot & \cdot & \cdot & \cdot \\
4      & \cdot & \cdot & 1     & \cdot & \cdot & 1     & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot
\CodeAfter
\begin{tikzpicture}
\node () [fit=(5-3) (5-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(5-6) (5-6), draw=magenta!80!black, rounded corners] {};
\node () [fit=(5-8) (5-11), draw=magenta!80!black, rounded corners] {};
\end{tikzpicture}
\end{pNiceArray}
\]

Notice first that the complex is, indeed, minimal – the only non-empty matrix of the form $\eta^d[\sigma,\sigma]$ is $\eta^1[4,4]=0$. We highlighted the submatrices $\eta^0(4)=\eta^0[\St 4, \St 4]$, as the vertex $4$ is a particularly interesting part of the example.

The derived pushforward $Rg_\ast k_\Sigma$. To compute $Rg_\ast k_\Sigma$, we only need to relabel the matrices and minimize (see Section <ref>). To relabel $\eta^0$, $\eta^1$ according to $g$, we need to perform the following changes:

* The columns $45$, $46$, $56$ in $\eta^0$ are all relabeled to $4$,

* the rows $5$, $6$ in $\eta^0$ are both relabeled to $4$,

* the columns $5$, $6$ in $\eta^1$ are both relabeled to $4$.

For a moment, we denote the new labeled matrices (which do not necessarily represent a minimal complex) by $\tilde\eta^d$. We perform Algorithm <ref> on the matrices $\tilde\eta^d$ to minimize the complex. The above changes created a new non-empty $4$-block within $\tilde\eta^0$. We still have $\tilde{\eta}^1[4,4]=0$, but $\tilde\eta^0[4,4]$ is now a non-trivial matrix. We reduce $\tilde\eta^0[4,4]$, which is the $4\times 3$ submatrix in the bottom-right corner of $\tilde\eta^0$:
\[
\begin{pmatrix}
1 & \cdot & \cdot \\
\cdot & 1 & \cdot \\
1 & \cdot & 1 \\
\cdot & 1 & 1 \\
\end{pmatrix}
\hspace{1cm}
\rightsquigarrow
\hspace{1cm}
\begin{pmatrix}
\cdot & \cdot & \cdot \\
1 & \cdot & \cdot \\
\cdot & 1 & \cdot \\
\cdot & \cdot & 1 \\
\end{pmatrix}
\]

For the last three rows that are non-zero in the reduced submatrix, we perform further column operations to clear out all remaining places with $1$ in the whole matrix. Note that even though it is not necessary, the first of the four rows labeled by $4$ is now also zero, because the operations used to reduce the submatrix were performed on the whole matrix. We should now perform corresponding operations also on $\tilde\eta^{-1}$ and $\tilde\eta^{1}$. However, $\tilde\eta^{-1}=0$, and all column operations on $\tilde\eta^{1}$ only act on a zero submatrix, so nothing changes. Finally, we remove the last three columns and last three rows in $\tilde\eta^0$, and the last three columns in $\tilde\eta^1$. The derived pushforward $Rg_\ast k_\Sigma$ is represented by the resulting labelled matrices.

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{cccccc}
Rg_\ast\eta^0 & 013   & 014   & 034   & 123   & 124   & 234   \\
01            & 1     & 1     & \cdot & \cdot & \cdot & \cdot \\
03            & 1     & \cdot & 1     & \cdot & \cdot & \cdot \\
04            & \cdot & 1     & 1     & \cdot & \cdot & \cdot \\
12            & \cdot & \cdot & \cdot & 1     & 1     & \cdot \\
13            & 1     & \cdot & \cdot & 1     & \cdot & \cdot \\
14            & \cdot & 1     & \cdot & \cdot & 1     & \cdot \\
23            & \cdot & \cdot & \cdot & 1     & \cdot & 1     \\
24            & \cdot & \cdot & \cdot & \cdot & 1     & 1     \\
34            & \cdot & \cdot & 1     & \cdot & \cdot & 1     \\
4             & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot
\CodeAfter
\begin{tikzpicture}
\node () [fit=(3-2) (3-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(3-5) (3-6), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-2) (6-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-5) (6-6), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-2) (10-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-5) (10-6), draw=magenta!80!black, rounded corners] {};
\end{tikzpicture}
\end{pNiceArray}
\]

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{cccccccccc}
Rg_\ast\eta^1 & 01    & 03    & 04    & 12    & 13    & 14    & 23    & 24    & 34    & 4     \\
0             & 1     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
1             & 1     & \cdot & \cdot & 1     & 1     & 1     & \cdot & \cdot & \cdot & \cdot \\
2             & \cdot & \cdot & \cdot & 1     & \cdot & \cdot & 1     & 1     & \cdot & \cdot \\
3             & \cdot & 1     & \cdot & \cdot & 1     & \cdot & 1     & \cdot & 1     & \cdot \\
4             & \cdot & \cdot & 1     & \cdot & \cdot & 1     & \cdot & 1     & 1     & \cdot
\CodeAfter
\begin{tikzpicture}
\node () [fit=(5-3) (5-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(5-6) (5-6), draw=magenta!80!black, rounded corners] {};
\node () [fit=(5-8) (5-10), draw=magenta!80!black, rounded corners] {};
\end{tikzpicture}
\end{pNiceArray}
\]

The derived pushforward $Rh_\ast k_\Sigma$. We compute $Rh_\ast k_\Sigma$ analogously to above. The relabeling is now as follows:

* The columns $45$, $46$, and $56$ in $\eta^0$ are relabeled to $14$, $34$, and $13$, respectively,

* the rows $5$ and $6$ in $\eta^0$ are relabeled to $1$ and $3$, respectively,

* the columns $5$ and $6$ in $\eta^1$ are relabeled to $1$ and $3$, respectively.

There is now several new non-empty submatrices labeled by a single element, but all of them are zero matrices. This is guaranteed, because none of the faces that $h$ identifies are in a poset relation in $\Sigma$. The relabeled matrices, therefore, represent the minimal complex of injective sheaves $Rh_\ast k_\Sigma$:

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{ccccccccc}
Rh_\ast\eta^0 & 013   & 014   & 034   & 123   & 124   & 234   & 14    & 34    & 13    \\
01     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
03     & 1     & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
04     & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
12     & \cdot & \cdot & \cdot & 1     & 1     & \cdot & \cdot & \cdot & \cdot \\
13     & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot \\
14     & \cdot & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot & \cdot \\
23     & \cdot & \cdot & \cdot & 1     & \cdot & 1     & \cdot & \cdot & \cdot \\
24     & \cdot & \cdot & \cdot & \cdot & 1     & 1     & \cdot & \cdot & \cdot \\
34     & \cdot & \cdot & 1     & \cdot & \cdot & 1     & \cdot & \cdot & \cdot \\
4      & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & 1     & \cdot & \cdot \\
4      & \cdot & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & \cdot \\
1      & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & \cdot & 1     \\
3      & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & 1     & 1
\CodeAfter
\begin{tikzpicture}
\node () [fit=(3-2) (3-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(3-5) (3-8), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-2) (6-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(6-5) (6-8), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-2) (11-3), draw=magenta!80!black, rounded corners] {};
\node () [fit=(8-5) (11-8), draw=magenta!80!black, rounded corners] {};
\end{tikzpicture}
\end{pNiceArray}
\]

\[
\begin{pNiceArray}[first-row,first-col, margin=.5em]{ccccccccccccc}
Rh_\ast\eta^1 & 01    & 03    & 04    & 12    & 13    & 14    & 23    & 24    & 34    & 4     & 4     & 1     & 3     \\
0      & 1     & 1     & 1     & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\