# PlaneCurveSingularities -- Using the Rees Algebra to resolve plane curve singularities

## Description

The Rees Algebra of an ideal I appeared classically as the bihomogeneous coordinate ring of the blow up of the ideal I, used in resolution of singularities. Though the general case is still out of reach, we illustrate with some simple examples of plane curve singularities.

First the cusp in the affine plane

 ```i1 : R = ZZ/32003[x,y] o1 = R o1 : PolynomialRing``` ```i2 : cusp = ideal(x^2-y^3) 3 2 o2 = ideal(- y + x ) o2 : Ideal of R``` ```i3 : mm = radical ideal singularLocus cusp o3 = ideal (y, x) o3 : Ideal of R```

The cusp is singular at the maximal ideal (x,y), so we blow that up, and examine the “total transform”, that is, the ideal generated by the x2-y3 in the Rees algebra.

 ```i4 : B = first flattenRing reesAlgebra(mm) o4 = B o4 : QuotientRing```

Application of first flattenRing serves to make B a quotient of the polynomial ring T in 4 variables; otherwise it would be a quotient of R[w0,w1], which Macaulay2 treats as a polynomial ring in 2 variables, and the calculation of the singular locus later on would be wrong.

 ```i5 : vars B o5 = | w_0 w_1 x y | 1 4 o5 : Matrix B <--- B``` ```i6 : proj = map(B,R,{x,y}) o6 = map(B,R,{x, y}) o6 : RingMap B <--- R``` ```i7 : totalTransform = proj cusp 3 2 o7 = ideal(- y + x ) o7 : Ideal of B``` ```i8 : D = decompose totalTransform 3 2 2 2 2 o8 = {ideal (y - x , w y - w x, w y - w ), ideal (y, x)} 0 1 0 1 o8 : List``` ```i9 : D/codim o9 = {1, 1} o9 : List```

We see that the reduced preimage consists of two codimension 1 components, the ‘exceptional divisor’, which is the pullback of the point we blew up, (x,y), and the ‘strict transform’. The two components meet in a double point in the 2 dimensional variety B ⊂ A2×P1. We have to saturate with respect to the irrelevant ideal to understand what’s going on.

 ```i10 : irrelB = ideal(B_0,B_1) o10 = ideal (w , w ) 0 1 o10 : Ideal of B``` ```i11 : intersection = saturate(D_0+D_1, irrelB) 2 o11 = ideal (y, x, w ) 1 o11 : Ideal of B``` ```i12 : codim intersection o12 = 2``` ```i13 : degree intersection o13 = 2```

We can see the multiplicities of these components by comparing their degrees to the degrees of the reduced components

 ```i14 : divisors = primaryDecomposition totalTransform 3 2 2 2 2 2 2 o14 = {ideal (y - x , w y - w x, w y - w ), ideal (y , x*y, x )} 0 1 0 1 o14 : List``` ```i15 : strictTransform = divisors_0 3 2 2 2 2 o15 = ideal (y - x , w y - w x, w y - w ) 0 1 0 1 o15 : Ideal of B``` ```i16 : exeptional = divisors_1 2 2 o16 = ideal (y , x*y, x ) o16 : Ideal of B``` ```i17 : divisors/(i-> degree i/degree radical i) o17 = {1, 2} o17 : List```

That is, the exceptional component occurs with multiplicity 2 (in general we’d get the exceptional component with multiplicity equal to the multiplicity of the singular point we blew up.)

We next investigate the singularity of the strict transform. We want to see it as a curve in P1 x A2, that is, as an ideal of T = kk[w0,w1,x,y]

 ```i18 : T = ring ideal B o18 = T o18 : PolynomialRing``` ```i19 : irrelT = ideal(w_0,w_1) o19 = ideal (w , w ) 0 1 o19 : Ideal of T``` ```i20 : sing = saturate(ideal singularLocus strictTransform, irrelT) o20 = ideal 1 o20 : Ideal of T```

We see that the singular locus of the strict transform is empty; that is, the curve is smooth.

We could have made the computation in B as well:

 ```i21 : jacobianMatrix = diff(vars B, transpose gens strictTransform) o21 = {0, -3} | 0 0 -2x 3y2 | {-1, -3} | y2 -x -w_1 2w_0y | {-2, -3} | 2w_0y -2w_1 0 w_0^2 | 3 4 o21 : Matrix B <--- B``` ```i22 : codim strictTransform o22 = 1``` ```i23 : jacobianIdeal = strictTransform+ minors(1,jacobianMatrix) 3 2 2 2 2 2 o23 = ideal (y - x , w y - w x, w y - w , y , 2w y, -x, -2w , -2x, -w , 0 1 0 1 0 1 1 ----------------------------------------------------------------------- 2 2 3y , 2w y, w ) 0 0 o23 : Ideal of B``` ```i24 : sing1 = saturate(jacobianIdeal, irrelB) o24 = ideal 1 o24 : Ideal of B```

Next we look at the desingularization of a tacnode; it will take two blowups.

 ```i25 : R = ZZ/32003[x,y] o25 = R o25 : PolynomialRing``` ```i26 : tacnode = ideal(x^2-y^4) 4 2 o26 = ideal(- y + x ) o26 : Ideal of R``` ```i27 : sing = ideal singularLocus tacnode 4 2 3 o27 = ideal (- y + x , 2x, -4y ) o27 : Ideal of R``` ```i28 : mm = radical sing o28 = ideal (y, x) o28 : Ideal of R``` ```i29 : B1 = first flattenRing reesAlgebra mm o29 = B1 o29 : QuotientRing``` ```i30 : proj1 = map(B1,R,{x,y}) o30 = map(B1,R,{x, y}) o30 : RingMap B1 <--- R``` ```i31 : irrelB1 = ideal(w_0,w_1) o31 = ideal (w , w ) 0 1 o31 : Ideal of B1``` ```i32 : totalTransform1 = proj1 tacnode 4 2 o32 = ideal(- y + x ) o32 : Ideal of B1``` ```i33 : netList (D1 = decompose totalTransform1) +------------------------+ o33 = |ideal (y, x) | +------------------------+ | 2 | |ideal (y + x, w y + w )| | 0 1 | +------------------------+ | 2 | |ideal (y - x, w y - w )| | 0 1 | +------------------------+``` ```i34 : strictTransform1 = saturate(totalTransform1,proj1 mm ) 4 2 3 2 2 2 o34 = ideal (y - x , w y - w x, w y - w ) 0 1 0 1 o34 : Ideal of B1```

Here proj1 mm is the ideal of the exceptional divisor. The strict transform is, by definition, obtained by saturating it away, The strict transform of the tacnode is not yet smooth: it consists of two smooth branches, meeting transversely at a point:

 ```i35 : strictTransform1 == intersect(D1_1,D1_2) o35 = true``` ```i36 : degree (D1_1+D1_2) o36 = 1```

We compute the singular point of the strict transform:

 ```i37 : mm1 = sub(radical ideal singularLocus strictTransform1, B1) o37 = ideal (y, x, w ) 1 o37 : Ideal of B1```

...and blow up B1, getting a variety in P2 x P1 x A2

 ```i38 : B2 = first flattenRing reesAlgebra(mm1, Variable => p) o38 = B2 o38 : QuotientRing``` ```i39 : vars B2 o39 = | p_0 p_1 p_2 w_0 w_1 x y | 1 7 o39 : Matrix B2 <--- B2``` ```i40 : proj2 = map(B2,B1,{w_0,w_1,x,y}) o40 = map(B2,B1,{w , w , x, y}) 0 1 o40 : RingMap B2 <--- B1``` ```i41 : irrelB2 = ideal(p_0,p_1,p_2) o41 = ideal (p , p , p ) 0 1 2 o41 : Ideal of B2``` ```i42 : irrelTot = (proj2 irrelB1) *irrelB2 o42 = ideal (p w , p y, p w , p y, p x, p w ) 0 0 2 2 0 2 2 2 1 o42 : Ideal of B2``` ```i43 : totalTransform2 = saturate(proj2 proj1 tacnode, irrelTot) 4 2 3 2 2 2 2 4 o43 = ideal (y - x , p p y - p x, p p y - p ) 0 1 1 0 1 1 o43 : Ideal of B2``` ```i44 : exceptional2 = saturate(proj2 proj1 mm, irrelTot) o44 = ideal (y, x, p ) 1 o44 : Ideal of B2``` ```i45 : netList(D2 = decompose totalTransform2) +---------------------------------------------+ o45 = |ideal (y, x, w , p ) | | 1 1 | +---------------------------------------------+ |ideal (y, x, p , p ) | | 1 0 | +---------------------------------------------+ | 2 | |ideal (y + x, w y + w , p y + p , p w + p )| | 0 1 0 1 0 0 2 | +---------------------------------------------+ | 2 | |ideal (y - x, w y - w , p y - p , p w - p )| | 0 1 0 1 0 0 2 | +---------------------------------------------+``` ```i46 : netList(E2 = decompose exceptional2) +--------------------+ o46 = |ideal (y, x, p , p )| | 1 0 | +--------------------+ |ideal (y, x, w , p )| | 1 1 | +--------------------+``` ```i47 : strictTransform2 = saturate(totalTransform2, exceptional2) 4 2 3 2 2 2 3 2 2 o47 = ideal (y - x , w y - w x, w y - w , p y - p x, p w y - p x, p w y 0 1 0 1 0 1 0 0 2 0 0 ----------------------------------------------------------------------- 2 2 2 2 2 2 2 - p w , p y - p , p w y - p p , p w - p ) 2 1 0 1 0 0 1 2 0 0 2 o47 : Ideal of B2```

We compute the singular locus once again:

 ```i48 : time sing2 = ideal singularLocus strictTransform2; -- used 1.46402 seconds ZZ o48 : Ideal of -----[p , p , p , w , w , x, y] 32003 0 1 2 0 1``` ```i49 : saturate(sing2, sub(irrelTot, ring sing2)) o49 = ideal 1 ZZ o49 : Ideal of -----[p , p , p , w , w , x, y] 32003 0 1 2 0 1```

The answer, ideal 1 shows that the second blowup desingularizes the tacnode.

It is not necessary to repeatedly blow up closed points: there is always a single ideal that can be blown up to desingularize (Hartshorne, Algebraic Geometry,Thm II.7.17). In this case, blowing-up (x,y2) desingularizes the tacnode x2-y4 in a single step.

 `i50 : R = ZZ/32003[x,y];` ```i51 : tacnode = ideal(x^2-y^4); o51 : Ideal of R``` ```i52 : mm = ideal(x,y^2); o52 : Ideal of R``` `i53 : B = first flattenRing reesAlgebra mm;` ```i54 : irrelB = ideal(w_0,w_1); o54 : Ideal of B``` ```i55 : proj = map(B,R,{x,y}); o55 : RingMap B <--- R``` ```i56 : totalTransform = proj tacnode 4 2 o56 = ideal(- y + x ) o56 : Ideal of B``` ```i57 : netList (D = decompose totalTransform) +-----------------------+ o57 = |ideal (y, x) | +-----------------------+ | 2 | |ideal (y + x, w + w )| | 0 1 | +-----------------------+ | 2 | |ideal (y - x, w - w )| | 0 1 | +-----------------------+``` ```i58 : exceptional = proj mm 2 o58 = ideal (x, y ) o58 : Ideal of B``` ```i59 : strictTransform = saturate(totalTransform, exceptional); o59 : Ideal of B``` ```i60 : netList decompose strictTransform +-----------------------+ | 2 | o60 = |ideal (y + x, w + w )| | 0 1 | +-----------------------+ | 2 | |ideal (y - x, w - w )| | 0 1 | +-----------------------+``` ```i61 : sing0 = sub(ideal singularLocus strictTransform, B); o61 : Ideal of B``` ```i62 : sing = saturate(sing0,irrelB) o62 = ideal 1 o62 : Ideal of B```

So this single blowup is already nonsingular.

## For the programmer

The object PlaneCurveSingularities is .