Atomic lenses and ideal single-photon detections