Source: https://www.math.u-bordeaux.fr/~ayger/TP5-2012.pdf