  This paper concerns Fredholm theory in several variables, and its
applications to Hilbert spaces of analytic functions. One feature is the
introduction of ideas from commutative algebra to operator theory.
Specifically, we introduce a method to calculate the Fredholm index of a pair
of commuting operators. To achieve this, we define and study the Hilbert space
analogs of Samuel multiplicities in commutative algebra. Then the theory is
applied to the symmetric Fock space. In particular, our results imply a
satisfactory answer to Arveson's program on developing a Fredholm theory for
pure $d$-contractions when $d=2$, including both the Fredholmness problem and
the calculation of indices. We also show that Arveson's curvature invariant is
in fact always equal to the Samuel multiplicity for an arbitrary pure
d-contraction with finite defect rank. It follows that the curvature is a
similarity invariant.
