An inertia theory for operators on a Hilbert space