https://github.com/math-comp/analysis/blob/0e4fbab71717e572542e3c8069018412a954c025/classical/cardinality.v#L448