Mathematically, it seems to be resulting from Stokes theorom once the 3d manifold has a 2d boundary. However, the EM response described by (2+1)d CS term requires the system to break time-reversal symmetry while the topological insulator preserves TR symmetry. What step in the derivation corresponding to breaking the TR symmetry? In more detail, the surface BZ between a topological insulator and vacuum has a Dirac-cone which has to be gapped in order to get the Hall response. How to see the gapping process in the derivation?