The local version of the Lorentzian index theorem