Source: https://mathsptbenjam.pagesperso-orange.fr/resources/TD/TD_alg1_cor.pdf