  We prove a general theorem on the relation between the bulk topological
quantum number and the edge states in two dimensional insulators. It is shown
that whenever there is a topological order in bulk, characterized by a
non-vanishing Chern number, even if it is defined for a non-conserved quantity
such as spin in the case of the spin Hall effect, one can always infer the
existence of gapless edge states under certain twisted boundary conditions that
allow tunneling between edges. This relation is robust against disorder and
interactions, and it provides a unified topological classification of both the
quantum (charge) Hall effect and the quantum spin Hall effect. In addition, it
reconciles the apparent conflict between the stability of bulk topological
order and the instability of gapless edge states in systems with open
boundaries (as known happening in the spin Hall case). The consequences of time
reversal invariance for bulk topological order and edge state dynamics are
further studied in the present framework.
