A Lefschetz fixed point theorem in gravitational lensing