  The index theorems relate the gauge field and metric on a manifold to the
solution of the Dirac equation on it. In the standard approach, the Dirac
operator must be massless in order to make the chirality operator well-defined.
In physics, however, the index theorem appears as a consequence of chiral
anomaly, which is an explicit breaking of the symmetry. It is then natural to
ask if we can understand the index theorems in a massive fermion system which
does not have chiral symmetry. In this review, we discuss how to reformulate
the chiral anomaly and index theorems with massive Dirac operators, where we
find nontrivial mathematical relations between massless and massive fermions. A
special focus is placed on the Atiyah-Patodi-Singer index, whose original
formulation requires a physicist-unfriendly boundary condition, while the
corresponding massive domain-wall fermion reformulation does not. The massive
formulation provides a natural understanding of the anomaly inflow between the
bulk and edge in particle and condensed matter physics.
