A Classical Interlude

So far, we have been emphasizing how our approach differs from classical algebraic geometry. In this chapter, we will sketch some ideas from classical algebraic geometry that will be useful or interesting in the following chapters. In particular, we explore curve theory in the complex projective plane.

5.1 The Projective Plane in Homogeneous Coordinates

In Chapter 1, we introduced the idea of an infinite point on a line that could be a slope {1,m,0} or a direction vector {(Subscript[u, 1]),(Subscript[u, 2]),0}. For the latter, we noted that direction vectors were homogeneous; that for any nonzero r, {r (Subscript[u, 1]),r (Subscript[u, 2]),0} is still a direction vector for the same line. For the purposes of the line algorithm, an affine point {(Subscript[x, 0]),(Subscript[y, 0])} was considered to be a triple {(Subscript[x, 0]),(Subscript[y, 0]),1} so that it would satisfy the equation a (Subscript[x, 0])+b (Subscript[y, 0])+c (Subscript[z, 0 ])=a(Subscript[x, 0])+b (Subscript[y, 0])+c=0. Then multiplying the entire triple {(Subscript[x, 0]),(Subscript[y, 0]),1} by a constant r to get z=r, point {r (Subscript[x, 0,])r (Subscript[y, 0, ])r} gives another solution to the equation a (Subscript[x, 0])+b (Subscript[y, 0])+c (Subscript[z, 0 ])=0. Classical algebraic geometers prefer to stick to rational numbers anyway, and a point {(3/5),(5/12),1}={36,25,60} seems nicer to them as an integer point. Thus we can consider the form {(Subscript[x, 0]),(Subscript[y, 0]),1} to be a homogeneous version of an affine point.

Now that we have consistency between affine and infinite points, we define the real projective plane to be the set of all homogeneous triples {(Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0])} for which (Subscript[x, 0]), (Subscript[y, 0]), (Subscript[z, 0]) are not all zero. If (Subscript[z, 0])≠0, we can, by the previous paragraph, consider this to be the (real) fractional point {((Subscript[x, 0])/(Subscript[z, 0])),((Subscript[y, 0])/(Subscript[z, 0])),1}, so the infinite line consists of all the projective real fractions with denominator 0.

Unlike affine points, projective points cannot double as vectors; they cannot be added or scalar multiplied.

The real projective plane is typically denoted by (Subscript[ℙ, ℝ]^2) or, if we allow our points to have complex coordinates, (Subscript[ℙ, ℂ]^2).

We have set up our projective plane so that lines have the equation a (Subscript[x,  0])+b (Subscript[y,  0])+c(Subscript[z,  0 ])=0. Now it makes perfect sense to talk about the line c z=0 when c≠0; it is the line at infinity.

Given two projective points p, q, we can find the line containing them with a simplification of our procedure from Chapter 1.

pLine[p_,q_,x_,y_,z_]:=Module[{a,b,c,M},
M={p,q,RandomReal[{-1,1},3]};
({a,b,c}/.(Solve[M.{a,b,c}=={0,0,1}][[1]])).{x,y,z}
];

l=pLine[{3,2,1},{2,-1,0},x,y,z]

l/.Thread[{x,y,z}->{9,6,3}]

The important idea here is that the equation of a projective line is homogeneous, that is, each monomial has the same total degree. Alternatively, if {(Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0])} is a solution, so is {r (Subscript[x, 0]),r (Subscript[y, 0]),r (Subscript[z, 0])} for any r≠0.

5.2 Homogenization and Specialization

An algebraic curve in the projective plane is now given by a homogeneous polynomial in three variables x, y, z. The total degree of a monomial (x^i)(y^j)(z^k) is i+j+k, and a polynomial in three variables is homogeneous if each monomial has the same degree. No constant terms are allowed except 0. Each affine curve f(x,y) of degree d gives rise to a projective curve F(x,y,z), called the homogenization, in one of the following ways:

1. Each monomial (x^i)(y^j) is replaced by (x^i)(y^j)(z^(d-i-j)), or

2. F(x,y,z)=(z^d)f((x/z),(y/z))

Homogenization gives a 1-1 correspondence between affine polynomials of degree d in x, y and homogeneous polynomials of degree d in x, y, z. The projective curve is the set of all projective points such that F[x,y,z]=0. Note that f[x,y]=0 is equivalent to F[x,y,1]=0, so all affine points are, in particular, points of the homogenization. On the other hand, infinite solutions of F are when F[x,y,0]=0. By the first method of homogenization, all monomials of degree less than d have z raised to a positive power so become 0 in F(x,y,0), but monomials (x^i)(y^j) for i+j=d appear in the homogenization without a power of z. In other words, the maximal form (Subscript[f, max])=F[x,y], so infinite points of F(x,y,z) are just the infinite points of f[x,y], which we calculated in Chapter 3. Therefore, the solution set of the homogenization of f(x,y) are just the affine and infinite points of f(x,y).

homog[f_,x_,y_,z_]:=Expand[z^tDeg[f,x,y](f/.Thread[{x->x/z,y->y/z}])];

F=homog[x^2-y^2-1,x,y,z]

Note that pLine is the same as homog[line[p,q,x,y],x,y,z].

The opposite of homogenization is specialization. Given a homogeneous polynomial, we can replace any one of the variables by 1 to obtain a bivariate polynomial. Points with that coordinate nonzero specialize by dividing the two remaining coordinates by the coordinate specialized.

For example, here are three common specializations:

F
f= F/.{z->1}

F/.Thread[{x,y,z}->{a,b,c}]

f/.Thread[{x,y}->{a/c,b/c}]

g= F/.{x->1}

F/.Thread[{x,y,z}->{a,b,c}]

g/.Thread[{y,z}->{b/a,c/a}]

h= F/.{y->1}

F/.Thread[{x,y,z}->{a,b,c}]

h/.Thread[{x,z}->{a/b,c/b}]

We notice in all cases that although the value of the specialization function is different from the value of the homogeneous function at the specialized point, that it is a nonzero multiple, that is, F(a,b,c)=0 if and only if f(a,b)=0 when c≠0. Note also that f=0 is the original curve, a hyperbola. g=0 (in y-z plane) is different; it is a circle. Note also that {1,1,0} is an infinite point of f=0, F(1,1,0)=0, so it is a point on the projective curve. Specializing at x sends this infinite point to the finite point {1,0} on the circle g.

In Chapter 6, we will see that we can specialize at any line. Moreover, we will be able to work entirely in the affine case, so we will not need homogeneous functions later in this book. In Chapter 7, we will discuss in more detail what happens to conics when homogenizing and specializing.

Generalizing our example above, homogenizing hyperbolas and specializing elsewhere show that, topologically, open sets around infinite points look just like open sets about affine points. This gives a topology for the projective plane that locally makes infinite points just like affine points. Globally, the topology of the projective plane is quite different from the affine plane. We will examine this in the second part of Chapter 8.

f=3+x-x^2y+y^4;
g=-1-y+x y^2-x^4;

H1=homog[f*g,x,y,z]

H2=Expand[homog[f,x,y,z]*homog[g,x,y,z]]

H1-H2

In particular, if h is irreducible, so is its homogenization and conversely.

5.3 Bézout’s Theorem

Bézout’s theorem is one of the most important and useful theorems for curves in (Subscript[ℙ, ℂ]^2); it can be considered a generalization of the fundamental theorem of algebra. In particular, the existence part of this theorem is not true in the real affine plane. The theorem was first stated by Isaac Newton in his Principia. Later, Étienne Bézout gave what is now considered a heuristic proof in 1799. Since our emphasis is not on theory, we will not prove it here, but we do need to state this theorem and explain it in this long section. The first thing is to explain the concept of intersection multiplicity.

We now want to consider the complex projective plane (Subscript[ℙ, ℂ]^2). As in the real projective plane, points are triples {(Subscript[x, 0,])(Subscript[y, 0, ])(Subscript[z, 0])}, but the components (Subscript[x, 0]),(Subscript[y, 0]),(Subscript[z, 0]) are now complex numbers, at least one of which is not zero. Two such triples are equivalent, i.e. the same point, if they differ by multiplication by a complex number. Of course, real numbers are also complex numbers, and multiplying a real triple, not all zero, by a complex number c can only be real if c is real; hence, the equivalence relation inside (Subscript[ℙ, ℂ]^2) for these points is compatible with that in (Subscript[ℙ, ℝ]^2). A curve in (Subscript[ℙ, ℂ]^2) is the zero set of a homogeneous complex polynomial in three variables that can arise as the homogenization of a two-variable complex polynomial. The main change is the topology, (Subscript[ℙ, ℂ]^2) is, from a real point of view, a 4D surface, and a complex curve is a 2D surface inside (Subscript[ℙ, ℂ]^2).

Our line-finding functions, line and pLine, work in (Subscript[ℙ, ℂ]^2). We can also use NSolve. In fact, solvers tend to work better with complex numbers rather than real numbers. Our one problem in working numerically with complex numbers is deciding if numbers are real or not, but the Wolfram Language’s solvers are generally reliable about picking out reals from a set of complex solutions.

Intersection Multiplicity

When two projective curves F=0, G=0 meet at a point p in (Subscript[ℙ, ℂ]^2), that point is a singularity, see the next plot, of the union curve FG. However, these kinds of singularities work differently from a typical singularity in an irreducible curve. Intersection multiplicity (Subscript[mult, p])(F,G) measures how complicated this intersection point is, or if we give curves names like (Subscript[𝒞, 1]), (Subscript[𝒞, 2]), (Subscript[mult, p])((Subscript[𝒞, 1, ])(Subscript[𝒞, 2])). However, each point of (Subscript[ℙ, ℂ]^2) lies in some affine complex specialization, and since intersection multiplicity is a local property, we can study the concept in the affine case (Subscript[mult, p])(f,g) where f, g are bivariate polynomials that are specializations of F, G respectively.

Fortunately, for our purposes, I along with Professor Zhonggang Zeng gave an algorithm in 2005 that solves the general intersection multiplicity problem using numerical linear algebra. This algorithm uses an idea from F. S. Macaulay in 1916 that had been largely forgotten because it involves analyzing large matrices, which was impossible in practice back then and impractical even up through the year 2000 when modern PCs began working at gigahertz speeds with gigabytes of memory. This algorithm uses numerical linear algebra and will be discussed in Appendix 1. For those using the notebook version of this book, in the Wolfram Language the code for the plane curve case is hidden below. For more information about the algorithm I suggest the introduction to our expanded 2011 paper (Dayton, Li, and Zeng).

If the two affine curves f=0, g=0 do not meet at p in the xy plane, then (Subscript[mult, p])(f,g)=0, otherwise the multiplicity is an integer greater than zero. When a numerical algorithm returns an integer, there will always be situations where the answer is ambiguous; the use of a tolerance helps resolve this problem, see Appendix 1. If f,g have small integer coefficients, then the default tolerance dTol should work. For simplicity, our software assumes the varibles are x,y.

{Labeled[ContourPlot[{y==x^2-1, y^2-x^2==5},{x,0,4},{y,1,5}],"Multiplicity 1"] ,Labeled[ContourPlot[{ y^2-x^2==5, x-1.5y==-2.5,y==-1/3x^2+2x+1/3},{x,0,4},{y,0,4},ContourStyle->{Blue,Dashed,Green}],"Multiplicity 2"],Labeled[ContourPlot[{y==x^3,y==0}, {x,-2,2},{y,-8,8}],"Multiplicity 3"]}

intersectionMultiplicity[y-x^2+1,y^2-x^2-5,{2,3},dTol]

intersectionMultiplicity[y+1/3x^2-2x-1/3,y^2-x^2-5,{2,3},dTol]

intersectionMultiplicity[y-x^3,y,{0,0},dTol]

In the first case, we have a normal crossing with multiplicity 1, but the tangent directions are different. In the second case, both curves are tangent to the same line (dashed). In the third case, the curve has an inflection point at the point of tangency.

{Labeled[ContourPlot[{y-x == x^3, y-x==y^3}, {x,-1,1},{y,-1,1}],"Multiplicity 5"], Labeled[ContourPlot[{y^2==x^3,y-3 x}, {x,-1,1},{y,-1,1}],"Multiplicity 2"], Labeled[ContourPlot[{x^2+y^2==0, y==3x},{x,-1,1},{y,-1,1}],"Multiplicity 2"]}

intersectionMultiplicity[y-x-x^3,y-x-y^3, {0,0},dTol]

intersectionMultiplicity[y^2-x^3, y-3x,{0,0},dTol]

intersectionMultiplicity[x^2+y^2,y-3x,{0,0},dTol]

In fact, determining when the intersection multiplicity is 1 is easy; f=0 and g=0 and the Jacobian determinant J(f,g)=Det[D[{f,g},{{x,y}}]]=((∂f)/(∂x))((∂g)/(∂y))-((∂f)/(∂y))((∂g)/(∂x)) is not zero at the point. If this determinant is zero, then the intersection multiplicity is higher but more complicated to calculate. Note that in the right two examples in the previous graphs, we have a line intersecting a curve at a singularity, with the rightmost singularity being an isolated point, which is invisible to a contour plot. This illustrates an important general fact:

If p is a singular point of f=0, then any line through p has intersection multiplicity ≥2 with f.

We will discuss complex projective singular points a bit later in this chapter.

Another important fact about intersection multiplicity is that if f=0, g=0 are reducible curves with a common component h=0 and p is a point on h, then the intersection multiplicity of f, g  at p is infinite. To discover common components, one takes greatest common divisors using PolynomialGCD if f, g are given by integer coefficients. Otherwise, use the nGCD algorithm in Appendix 2.

Bézout’s Theorem

We now come to the most important theorem in complex plane algebraic geometry, Bézout’s theorem:

Let F(x,y,z)=0, G(x,y,z)=0 be two projective curves, that is, two homogeneous three-variable polynomials of degrees m, n, respectively. Assume F, G have no common nonconstant component. Then

(∑_p)(Subscript[mult, p])(F,G) = m n,

where the sum ranges over all intersection points in the complex projective plane.

In simpler language, this says two curves without a common component intersect in exactly m, n points counted according to multiplicity. This is similar to the fundamental theorem of algebra in that to get all zeros, one must look at complex as well as real points. In addition, here we also have to consider infinite points. If one is only interested in the affine case, then this says there are at most m, n solutions. Newton was interested in finding more precise estimates in this latter case as he did not acknowledge complex or infinite points extending to higher dimensions, and finding algorithms for his results is a big area of modern computational algebra.

NSolve[{f,g},{x,y},Reals]

This will generally correctly answer this question although to get the correct multiplicity, one may need to count nearby points as a multiple intersection. Again, our algorithm in the appendix may be helpful. Remember that solving for multiple zeros accurately is difficult, so you might need to increase the tolerance in the code for that procedure.

Unfortunately, there are no easy proofs of Bézout’s theorem. Abhyankar’s work (1990) gives a heuristic argument; the proof in Fischer’s work (2001) is as direct as any but requires methods from an appendix. Computationally, this can be checked by computing affine intersection points in each of the three specializations above and converting to projective notation remembering that triples that are scalar multiples are the same projective point.

f=x ^2y-1;
g=y-x^2-2;
ContourPlot[{f==0,g==0},{x,-3,3},{y,-1,5}]

sol0=NSolve[{f,g}]

{x,y,1}/.sol0

fh=x^2y-z^3;
gh=y z-x^2-2z^2;

fh1=fh/.{x->1}

gh1=gh/.{x->1}

sol1 = NSolve[{fh1,gh1}]
({1,y,z}/z)/.sol1

fh2=fh/.{y->1}

gh2=gh/.{y->1}

sol2=NSolve[{fh2,gh2}]

({x,1,z}/z)/.Take[sol2,4]

These are the four previously known solutions, so counting complex and infinite solutions by multiplicity, we get six as required by Bézout’s theorem.

In general, there are specializations that contain all intersection points, although not necessarily one of the three so far described. In Chapter 6, we will find such a specialization and find all intersection points with one calculation.

If f, g are real of degree m, n, we can say a bit more. Imaginary, nonreal intersections must come in pairs with the same multiplicity. Thus the number of real intersections, including multiplicity and infinite real intersection points, must differ from mn by an even number. In particular, if m, n are both odd, there must be at least one real intersection point.

If g is a line, then one does not need the full force of Bézout’s theorem since counting intersections can be done by reduction to one variable by substitution. But Bézout makes clear that the one-variable multiplicity is the same as intersection multiplicity in this case. Hence, a line intersects a degree m curve in exactly m complex projective points counted by multiplicity. In particular, this applies to the infinite line, so a curve of degree m has m infinite points counting complex points and multiplicity. If m is odd, there must be at least one real infinite point that cannot be isolated since isolated points have even multiplicity. So, in fact, odd-degree real curves must contain infinitely many real points and, as we will see in Chapter 7, a least one asymptote.

5.4 Complex Singularities

In some situations, even if our interest is in real curves, we need information available by considering the curve in the complex affine or projective plane. Two cases are:

A plane algebraic curve is nonsingular or regular if it has no complex projective singular points.

A plane algebraic curve is irreducible if it cannot be factored as a product of nonconstant complex bivariate polynomials.

Not only does this make our definitions consistent with classical definitions, it allows us to separate out curves that may have unexpected properties.

f=4-5 (x^2)+(x^4)-5 (y^2)+2 (x^2) (y^2)+(y^4);
ContourPlot[f==0,{x,-3,3},{y,-3,3}]

g=18-24 x+12 (x^2)-8 (x^3)+2 (x^4)-24 y+32 x y-8 (x^2) y+9 (y^2)-8 x (y^2)+3 (x^2) (y^2)-4 (y^3)+(y^4);
ContourPlot[g==0, {x,-2,4},{y,-2,4}]

We will see the next section that this has four affine complex singular points, so again it is a singular curve.

Finding Complex Singular Points

From a statistics point of view, if we make the null hypothesis that a given curve is nonsingular, it is a Type II error that we want to avoid. Labeling a regular point as singular will not be as serious as labeling a singular curve as nonsingular, so in coding a probabilistic algorithm to find singular points, we will prefer to err on the side of calling a regular point singular.

Recall that in Chapter 3, we define an affine point p to be singular if point p is a solution to the system for all real a, b:

({{{, ({{f =0,  }, {a D[f,x]+b D[f,y] =0,  }})}})

We now change this to requiring it to be true for all complex a,b.

We note that, again, such a p will be a multiple zero of this system. In practice, this could show up in NSolve by p appearing more than once in the list of solutions, which is the method of discovery in Chapter 3. The problem is that for severe singularities where the intersection multiplicity at p is large, NSolve will do a poor job and list the multiple solutions as different. The other alternative is we could use two random choices of a,b and look for common solutions. In order to make sure we don’t miss singular points, we can easily combine both. We also use a very loose threshold for deciding two points are the same (For a complete list of global functions, see Appendix 2).

complexSingularPoints[f_,u_,v_]:=Module[{a,b,sol1,sol2,solz},
{a,b}=RandomComplex[{-1-I,1+I},2];
sol1={u,v}/.NSolve[{f,a D[f,u]+b D[f,v]}];
{a,b}=RandomComplex[{-1-I,1+I},2];
sol2={u,v}/.NSolve[{f,a D[f,u]+b D[f,v]}];
solz=Join[sol1,sol2];
Flatten[Take[Select[Tally[solz,Norm[#1-#2]<.001&],#[[2]]>1&],All,1],1]]

g=18-24 x+12 (x^2)-8 (x^3)+2 (x^4)-24 y+32 x y-8 (x^2) y+9 (y^2)-8 x (y^2)+3 (x^2) (y^2)-4 (y^3)+(y^4);
complexSingularPoints[g,x,y]

f=4-5 (x^2)+(x^4)-5 (y^2)+2 (x^2) (y^2)+(y^4);

fh=homog[f,x,y,z]

f1=fh/.{x->1}

c1=complexSingularPoints[f1,y,z]
{1,#[[1]],#[[2]]}&/@c1

Since we are expecting infinite points, we can assume the third coordinates of the last answer are 0.

h=-1+(x^4)+2 (x^2) (y^2)+(y^4);
ContourPlot[h==0,{x,-3,3},{y,-3,3}]

complexSingularPoints[h,x,y]

hh=(x^4)+2 (x^2) (y^2)+(y^4)-(z^4);
hh1=hh/.{x->1}

hh2=hh/.{y->1}

px={1,#[[1]],#[[2]]}&/@complexSingularPoints[hh1,y,z]

py={#[[1]],1,#[[2]]}&/@complexSingularPoints[hh2,x,z]

Again, we can check that {1,±i,0},{±i,1,0} are the actual four complex infinite points of h=0 that were discovered by our algorithm to be singular.

hh/.Thread[{x,y,z}->{1,I,0}]

It should be noted that instead of finding real singular points, we can make a tiny change in our algorithm to find nonsingular points. Compare with the above complexSingularPoints to see if you can find the difference other than we specify how many points to produce, if known.

realRegularPoints[f_,x_,y_,n_]:=Module[{a,b,c,d,k},
If[tDeg[f,x,y]<2, Echo["Degree must be > 1"]; Return[{}]];
k=0;
               Reap[While[k<n, 
{a,b}=RandomReal[{-10,10},2];
{c,d}=closestPoint[f,{a,b},x,y];
If[Abs[Det[D[{f,a x-b y},{{x,y}}]]/.Thread[{x,y}->{c,d}]]>.01,Sow[{c,d}];k++]]][[2,1]]];

f=x^4-4 x y+y^4;
realRegularPoints[f,x,y,3]

The Singularity Theorem

A famous theorem in classical algebraic geometry is the following:

Let f=0  be an irreducible curve of degree d. Then there are at most (((d-1)(d-2))/2) complex projective singular points.

It is clear that this is true in degree 1 and 2 since we know that all irreducible curves are nonsingular.

We will mostly follow the proof in Fischer’s book (2001), which is an indirect proof using Bézout’s theorem. However, since in this book I emphasize algorithms rather than proofs, I will describe instead an algorithm to do the following:

Given an algebraic plane curve f=0 of degree d≥3 with more than (((d-1)(d-2))/2) singularities, produce a nonconstant factor.

We know from Chapter 2 that given (((n+2)(n+1))/2)-1 sufficiently random points, there is a unique curve of degree n through these points, so ((d(d-1))/2)-1 points determine a curve of degree d-2.

Expand[((d)(d-1)/2-1)-((d-1)(d-2)/2+1)]

We see that if f has more than (((d-1)(d-2))/2) singularities, then taking (((d-1)(d-2))/2)+1 of them together with d-3 nonsingular points of f, we get a curve g of degree d-2 passing through these points. A technical issue is that if these points are not sufficiently random, or in algebraic geometry terms, in sufficiently general position, then the algorithm in Chapter 2 does not quite work since there could be several such curves, but we just choose one. In any case, we can get a curve of degree d-2 passing through all the (((d-1)(d-2))/2)+1 singular points we took as well as at least d-3 additional points. However, we learned previously that the intersection multiplicity of two curves meeting at a singular point of one of them is at least 2.

Expand[2((d-1)(d-2)/2+1)+(d-3)]

Bézout says the sum of the multiplicities of all complex projective intersection points of f, g is only d(d-2) =(d^(2 ))-2d, so Bézout fails because f, g have a nonconstant component since GCD[f,g] is not constant, so f, in particular, has a nonconstant component.

For degrees 3 and 4, this gives us a numerical factoring algorithm for any reducible bivariate real or complex polynomial. Unfortunately, for degree 5 and above, there are reducible curves with less than (((d-1)(d-2))/2)+1 singular points. Generally, to get more singular points, a curve of degree 5 or larger needs to be the product of more than two irreducible curves. Careful analysis of this situation leads to the conclusion that a square-free reducible curve of degree d can have no more than ((d(d-1))/2) singularities. This is achieved by a union of d lines with no more than two meeting at any one point.

We should, however, note this important corollary of Bézout’s theorem since the components of an irreducible curve meet in singular points:

A reducible curve must have at least one singular point, possibly complex and/or infinite. That means a reducible curve cannot be nonsingular even if there are no visible singularities on the plot.

f=Expand[(x^2+4y^2-4)*(4x^2+y^2-4)]

csg=complexSingularPoints[f,x,y]

rrp=realRegularPoints[f,x,y,1][[1]]

allpts=Append[csg,rrp];

Labeled[Show[ContourPlot[f==0,{x,-2,2},{y,-2,2}],ListPlot[Table[Labeled[allpts[[i]],i],{i,5}],PlotMarkers->Automatic]],"singularities"]

h= aCurve[allpts, x,y]

h=Chop[Expand[h/Coefficient[h,y^2]]]

k=PolynomialReduce[f,h,{x,y}][[1,1]]

Labeled[Show[ContourPlot[{h==0,k==0},{x,-2,2},{y,-2,2}],ListPlot[Table[Labeled[allpts[[i]],i],{i,5}],PlotMarkers->Automatic]],"intersection points"]

singularFactor[f,x,y,1.*^-10]

Before leaving this example, I need to make an important distinction about the two monst recent plots. In the first plot, the points labeled 1–4 are singularities. In the second, two irreducible components, points 1–4 are intersection points. Singularities and intersection points behave differently. If a curve with singularities is perturbed slightly, it is likely that the singularities will disappear. In other words, singularities are unstable. If the two component curves are each perturbed slightly, there will still be an intersection point nearby. More generally, the total intersection multiplicity in a small open set about the original intersection point will remain unchanged, so intersections are stable. This is why it is much easier to work with intersections numerically than to work with singularities. An important topic in classical algebraic geometry is assigning invariants to singularities. For an example, see Appendix 5 in Fischer’s book (2001) because I will not cover it in this text.

{Labeled[ContourPlot[f==-.09,{x,-2.5,2.5},{y,-2.5,2.5}],"singularities perturbed"],
Labeled[ContourPlot[{h==-.3,k==.3},{x,-2.5,2.5},{y,-2.5,2.5}],"intersections perturbed"]}

complexSingularPoints[f+.09,x,y]

5.5 Fundamental and Riemann–Roch Theorems

No book on algebraic curve theory is complete without at least mentioning the Riemann–Roch theorem, the most famous theorem in classical curve theory. The importance of this theorem is that it is basic to the notion of genus, a number that, among other things, describes the topology of a complex nonsingular projection curve. Since this book is about real curves, my main interest is to compare this theorem with my fundamental theorem of real projective plane curves.

Before we start, we need one definition. A set 𝒳 will be called a concrete topological space if it is a subset of one of (ℝ^2), (ℂ^2), (Subscript[ℙ, ℝ]^2), (Subscript[ℙ, ℂ]^2). In particular, the point set 𝒱(f) of a projective curve qualifies. With such a set, we can define continuous functions to and from the set.

A continuous function Φ from a concrete topological space to a component of a projective curve 𝒞, real or complex, will be called a complete parameterization if for each nonsingular point q in 𝒞, there exists a unique p in 𝒳 with Φ(p)=q, and if q is a singular point in 𝒞, there is a positive number of points (Subscript[p, i]) with Φ((Subscript[p, i]))=q.

Fundamental Theorem of Real Projective Curves

In the real projective plane (Subscript[ℙ, ℝ]^2), what we have called infinite points are just like any other point, especially after specializing to the x z or y z affine plane. Thus the curve inside a large circle about the origin can, in theory, be described in terms of a graph, as in Chapter 4, where the infinite point is now an interior point. In particular, if we add that point to our critical points, it becomes an interior vertex of the graph and, hence, even. More generally, the boundary points of the circle are interior points of other circles, so they also give even vertices when viewed in the projective context. We will make this more precise in Chapter 8, where we explain how to get the projective graph with all even vertices in practice. Thus we obtain our:

Fundamental Theorem: Given a real projective plane curve 𝒞, there is a graph with vertices (Subscript[v, i]) representing points (Subscript[p, i]) on 𝒞 satisfying the following:

1. For each edge e from vertex (Subscript[v, i]) to vertex (Subscript[v, j]), there is a closed continuous path contained in 𝒞 connecting the points (Subscript[p, i]) to (Subscript[p, j]) so that each interior point of this path is nonsingular.

2. Every point of 𝒞 is either a vertex (Subscript[p, k]) or an interior point of a path corresponding to a unique edge e, as in 1.

3. Every vertex is even.

A graph with every vertex even is sometimes called an Euler graph, and we will use this nomenclature. It is well known that every Euler graph has the property that each connected component is an Euler cycle; that is, there is a closed path that includes each edge of the graph exactly once.

The Gauss curves give good examples. Gauss tells us that for a monic complex polynomial p of degree n in z, the Gauss curve of p intersects a large circle about the origin of radius r in approximately 2n points, (Subscript[p, j])=r (Cos[(((2j+n-1)ℼ)/(2n))], Sin[(((2j+n-1) ℼ)/(2n))]),j=1,… ,2 n, (the indexes were changed to correspond to our indexing of the boundary points in gPoints). We can conclude that the infinite points are then (Subscript[P, j])=r {Cos[(((2j+n-1)ℼ)/(2n))], Sin[(((2j+n-1) ℼ)/(2n))],0} ,j=1,…,2n with (Subscript[P, j])=(Subscript[P, j+n]). This says that we can simply construct the projective graph of a Gauss curve by identifying the vertex (Subscript[v, j+n]) with (Subscript[v, j]) for j=1,…,n in the affine graph using the Wolfram Language function VertexReplace.

p=z^5-4z^4+9z^3-5z^2;

g= gaussCurve[p,x,y,z]

T5=Table[N[20{ Cos[(2j+9) Pi/10], Sin[(2j+9) Pi/10]}],{j,10}]

Show[ContourPlot[g==0,{x,-22,22},{y,-22,22}], ListPlot[Table[Labeled[T5[[j]],11-j],{j,1,10}]]]

cp=Chop[gPoints[g,5,x,y]]

AG= gaussGraph[g,cp,x,y,.4];

PG=Graph[VertexReplace[AG[[2]],{6->1, 7->2, 8->3,9->4,10->5}],VertexLabels->"Name"]

The commands in the above example, other than the check on Gauss’s assertion, can be collected so it is only necessary to enter a new polynomial in z and possibly change some parameters.

p=-1.768628847250528`+0.4539057530410755` z-1.0579937564992576` (z^2)-2.8339474110658296` (z^3)+0.35200766125787464` (z^4)+(z^5)

g= Chop[gaussCurve[p,x,y,z]]

cp=gPoints[g,5,x,y]

AG= gaussGraph[g,cp,x,y,.5];

PG=Graph[VertexReplace[AG[[2]],{6->1, 7->2, 8->3,9->4,10->5}],VertexLabels->"Name"]

Graph[FindEulerianCycle[PG][[1]], VertexLabels->"Name"]

For those reading the Wolfram Notebook version of this text, try other examples of polynomials p(z) in degree 5, possibly with complex coefficients. In general, one would obtain one or two connected components. In particular, you should try various placements of multiple zeros of p(z) of various multiplicities. Each multiple zero at a+bi will give a singularity at (a,b), but there may be additional singularities as well.

g1= gaussCurve[z(z^2-4)^2, x,y,z]

g2=gaussCurve[z^5,x,y,z]

In the general case, we will show in Chapter 8 how to get the projective graph of any real curve.

Riemann–Roch

In the early 1800s, Abel and Jacobi worked on indefinite integration of elliptic integrals such as

∫((dx)/(Sqrt[(x^3)+ax+b])).

As a byproduct of their work, they surmised that the topology of the complex curve (y^2)=4(x^3)-ax-b where the right-hand side does not have repeated zeros, called elliptic curve, is equivalent to a torus. In the 1850s, Weierstrass confirmed this by explicitly parameterizing this curve by a function defined on a torus. (Look up WeierstrassP in the Wolfram Language & System Documentation Center or on Wolfram|Alpha or see Chapter 6 of my Theory of Equations book. For more information check out the More to Explore section at the end of this chapter.)

wp=WeierstrassP[x,{4,-4}];
wpp=WeierstrassPPrime[x,{4,-4}];
Plt1=ContourPlot[y^2==4x^3-4 x+4,{x,-2,2},{y,-5,5}, Axes->True, ImageSize->Small];
Plt2=ParametricPlot[{wp,wpp},{x,-4,4},AspectRatio->1.25,PlotStyle->Red,ImageSize->Small];
{Plt1,Plt2, Show[Plt1,Plt2, Axes->True, ImageSize->Small]}

The results show a contour plot on the left, a parametric plot in the middle and a combined plot on the right showing that the plots coincide.

At the same time of Weierstrass’s work, Riemann and his short-lived student Roch were working on understanding meromorphic (rational) functions on what are now called Riemann surfaces. Their work became known as the Riemann–Roch theorem. In the 1870s, geometers Felix Klein, Alfred Clebsch, and Max Noether noted that Riemann’s work gave an abstract proof of the existence of not only Weierstrass’s parameterization of elliptic curves but similar parameterization of all complex algebraic curves from Riemann surfaces. They called this result the Riemann–Roch theorem. These related versions of the Riemann–Roch theorem are now considered the fundamental theorems of complex curve theory:

An irreducible complex projective curve can be completely parameterized by a continuous function from a Riemann surface of genus g for some g≥0.

I will not discuss Riemann surfaces here, but note that they are variously described topologically as a g-holed torus or a sphere with g handles. The number g is called the genus of the Riemann surface or of a complex algebraic curve parameterized by such a surface. See Fischer’s book (2001), or almost any book on algebraic curve theory, for more details. There is a well-known Clebsch–Noether genus formula for finding the genus from the degree of a curve together with certain Clebsch numbers describing each singularity. A nonsingular curve of degree d has genus g=(((d-1)(d-2))/2), a number we are already familiar with, and Clebsch numbers are subtracted from this number. Each singularity has at least one Clebsch number leading to a quick proof of the singularity theorem.

f=3 (x^4)-10 (x^3) y+6 (x^2) (y^2)-10 x (y^3)+3 (y^4);
ContourPlot[f==0, {x,-4,4},{y,-4,4}]

g=Expand[{D[f,x],D[f,y]}.RandomReal[{-1,1},2]]

NSolve[{f,g}]

We expect multiplicity 4 for the zero, but we get multiplicity 12, so something is wrong. We actually have something unseen called an embedded zero at the origin as well as the obvious intersection point. Actually, this curve is reducible so Riemann–Roch does not apply.

As mentioned above, singularities are unstable numerically, so we will not attempt further discussion in this book.

l1=3x-2y+5z;
l2= -x+3y-2z;
l3=pLine[{3,-2,5},{-1,3,-2},x,y,z]

p={Coefficient[l3,x],Coefficient[l3,y], Coefficient[l3,z]}

l1/.Thread[{x,y,z}->p]

l2/.Thread[{x,y,z}->p]