Source: https://www-igm.univ-mlv.fr/~cdavid/fr/cours/2015-bdL2/cours2.pdf