  Topological invariants for the 4D gapped system are discussed with
application to the quantum vacua of relativistic quantum fields. Expression
$\tilde{\cal N}_3$ for the 4D systems with mass gap defined in
\cite{Volovik2010} is considered. It is demonstrated that $\tilde{\cal N}_3$
remains the topological invariant when the interacting theory in deep
ultraviolet is effectively massless. We also consider the 5D systems and
demonstrate how 4D invariants emerge as a result of the dimensional reduction.
In particular, the new 4D invariant $\tilde{\cal N}_5$ is suggested. The index
theorem is proved that defines the number of massless fermions $n_F$ in the
intermediate vacuum, which exists at the transition line between the massive
vacua with different values of $\tilde{\cal N}_5$. Namely, $ 2 n_F$ is equal to
the jump $\Delta\tilde{\cal N}_5$ across the transition. The jump
$\Delta\tilde{\cal N}_3$ at the transition determines the number of only those
massless fermions, which live near the hypersurface $\omega=0$. The considered
invariants are calculated for the lattice model with Wilson fermions.
