The Atiyah-Patodi-Singer index theorem describes the bulk-edge correspondence of symmetry protected topological insulators. The mathematical set-up for this theorem is, however, not directly related to the physical fermion system, as it imposes on the fermion fields a non-local and unnatural boundary condition known as the "APS boundary condition" by hand. In 2017, we showed that the same integer as the APS index can be obtained from the eta invariant of the domain-wall Dirac operator in four-dimensional flat space. Recently we gave a mathematical proof that the equivalence is not a conincidence but generally true on any even-dimensional curved manifold. This talk is based on the papers, Fukaya, Onogi, Yamaguchi, PRD96(2017) no.12, 125004, Fukaya, Furuta, Matsuo, Onogi, Yamaguchi, Yamashita, arXiv:1910.01987, and Fukaya, Kawai, Matsuki, Mori, Nakayama, Onogi, Yamaguchi, arXiv:1910.09675.