# Multiplicities

This section contains some useful invariants for an isolated singularity at the origin of a hypersurface given by a multivariate polynomial $f$.

## `MilnorNumber(f): RngMPolElt -> RngElt`

Given a polynomial $f\in K[x_1, \ldots, x_n]$, where $K$ is a field, return the Milnor number of $f$ at the origin. This is the dimension of the quotient by the ideal generated by the partials of $f$ in the localization of $K[x_1, \ldots, x_n]$ at the origin. See [[Cox *et al.*, 1998](../../references.md#cite-uag-clo), p. 147] or [[Decker and Lossen, 2006](../../references.md#cite-deckerlossen), Remark 9.37].

## `TjurinaNumber(f): RngMPolElt -> RngElt`

Given a polynomial $f\in K[x_1, \ldots, x_n]$, where $K$ is a field, return the Tjurina number of $f$ at the origin. This is the dimension of the quotient by the ideal generated by $f$ and the partials of $f$ in the localization of $K[x_1, \ldots, x_n]$ at the origin. See [[Cox *et al.*, 1998](../../references.md#cite-uag-clo), p. 148] or [[Decker and Lossen, 2006](../../references.md#cite-deckerlossen), Def. 9.35].

## `Example: Variety (ex-e4a04f)`

We compute some Milnor and Tjurina numbers, based on Exercise 12 of [[Cox *et al.*, 1998](../../references.md#cite-uag-clo), p. 177].

```magma
> P<x,y> := PolynomialRing(RationalField(), 2);
> MilnorNumber((x^2 + y^2)^3 - 4*x^2*y^2); // 4-leaved rose
13
> [MilnorNumber(y^2 - x^n): n in [1 .. 5]];
[ 0, 1, 2, 3, 4 ]
> P<x,y,z> := PolynomialRing(RationalField(), 3);
> [MilnorNumber(x*y*z + x^n + y^n + z^n): n in [1 .. 10]];
[ 0, 1, 8, 11, 14, 17, 20, 23, 26, 29 ]
> [TjurinaNumber(x*y*z + x^n + y^n + z^n): n in [1 .. 10]];
[ 0, 1, 8, 10, 13, 16, 19, 22, 25, 28 ]

```

A much larger example is given in [[Decker and Lossen, 2006](../../references.md#cite-deckerlossen), p. 254].

```magma
> P<x,y> := PolynomialRing(RationalField(), 2);
> f := y^2 - 2*x^28*y - 4*x^21*y^17 + 4*x^14*y^33 - 8*x^7*y^49 +
>      x^56 + 20*y^65 + 4*x^49*y^16;
> time TjurinaNumber(f);
2260
Time: 0.010

```
