Mathlib v3 is deprecated. Go to Mathlib v4

Theorem set.infinite_of_infinite_image

Modification history