  We analytically study boundary conditions of the Dirac fermion models on a
lattice, which describe the first and second order topological insulators. We
obtain the dispersion relations of the edge and hinge states by solving these
boundary conditions, and clarify that the Hamiltonian symmetry may provide a
constraint on the boundary condition. We also demonstrate the edgehinge analog
of the bulk-edge correspondence, in which the nontrivial topology of the gapped
edge state ensures gaplessness of the hinge state.
