Source: https://www.maths-france.fr/MathSup/Cours/02-ensembles-relations-applications.pdf