  This paper addresses two questions: (a) can we identify a sensible class of
2-parameter persistence modules on which the rank invariant is complete? (b)
can we determine efficiently whether a given 2-parameter persistence module
belongs to this class? We provide positive answers to both questions, and our
class of interest is that of rectangle-decomposable modules. Our contributions
include: on the one hand, a proof that the rank invariant is complete on
rectangle-decomposable modules, together with an inclusion-exclusion formula
for counting the multiplicities of the summands; on the other hand, algorithms
to check whether a module induced in homology by a bifiltration is
rectangle-decomposable, and to decompose it in the affirmative, with a better
complexity than state-of-the-art decomposition methods for general 2-parameter
persistence modules. Our algorithms are backed up by a new structure theorem,
whereby a 2-parameter persistence module is rectangle-decomposable if, and only
if, its restrictions to squares are. This local characterization is key to the
efficiency of our algorithms, and it generalizes previous conditions derived
for the smaller class of block-decomposable modules. It also admits an
algebraic formulation that turns out to be a weaker version of the one for
block-decomposability. By contrast, we show that general
interval-decomposability does not admit such a local characterization, even
when locality is understood in a broad sense. Our analysis focuses on the case
of modules indexed over finite grids, the more general cases are left as future
work.
