# Rational Curves and Conics

The general tools for constructing and analysing curves are described in Chapter [Algebraic Curves](../../AlgebraicGeometry/AlgebraicCurves/index-algebraic-curves.md#crv). We do not repeat them here, but rather give some examples in Section [Rational Curve and Conic Examples](#crvgen0-subsec-examples) to demonstrate those basics that the user will need. In this section we describe the main parametrisation function for rational curves and functions which enable type change from a curve of genus zero to a rational curve.

## Rational Curve and Conic Creation

Rational curves and conics are the specialised types for nonsingular plane curves of genus zero defined by polynomials of degree 1 and 2, respectively. The condition of nonsingularity is equivalent to that of absolute irreducibility for conics, and imposes no condition on a linear equation in the plane.

### `Conic(coeffs): [RngElt] -> CrvCon`

```magma
Ambient: Sch                    Default: 
```

This creates a conic curve with the given sequence of coefficients (which should have length 3 or 6). A sequence $[a,b,c]$ designates the conic $aX^2+bY^2+cZ^2$, while a sequence $[a,b,c,d,e,f]$ designates the conic $aX^2+bY^2+cZ^2+dXY+eYZ+fXZ$.

The optional parameter `Ambient` may be used to give the specific ambient projective space in which to create the conic; otherwise a new ambient will be created for it to lie in.

### `Conic(M): Mtrx -> CrvCon`

```magma
Ambient: Sch                    Default: 
```

This creates a conic curve associated to $M$, which must be a symmetric $3 \times 3$ matrix. Explicitly, the equation of the conic is $[X,Y,Z]M[X,Y,Z]^{tr}$.

The optional parameter `Ambient` may be used to give the specific ambient projective space in which to create the conic; otherwise a new ambient will be created for it to lie in.

### `Conic(X, f): Prj, RngMPolElt -> CrvCon`

Returns the conic defined by the polynomial $f$ in the projective plane $X$.

### `IsConic(S): Sch -> BoolElt, CrvCon`

Returns `true` if and only if the scheme $S$ is a nonsingular plane curve of degree 2, in which case it also returns a curve (of type `CrvCon`) with the same defining polynomial as $S$.

### `RationalCurve(X, f): Prj, RngMPolElt -> CrvRat`

Returns the rational curve defined by the linear polynomial $f$ in the projective plane $X$.

### `IsRationalCurve(S): Sch -> BoolElt, CrvRat`

Returns `true` if and only if the scheme $S$ is defined by a linear polynomial in some projective plane ${\mathbb{P}}^2$; if so, it also returns a curve of type `CrvRat` with the same defining polynomial as $S$ in ${\mathbb{P}}^2$.

### `Example: Conic Creation (ex-e93efc)`

In the following example we create a degree two curve over the rational field, then create a new curve of conic type using `IsConic`.

```magma
> P2<x,y,z> := ProjectivePlane(Rationals());
> C0 := Curve(P2, x^2 + 3*x*y + 2*y^2 - z^2);
> C0;
Curve over Rational Field defined by
x^2 + 3*x*y + 2*x^2 - z^2
> bool, C1 := IsConic(C0);

```

This creates a new curve $C_1$ in the same ambient space $P_2$, explicitly as a conic curve.

```magma
> C1;
Conic over Rational Field defined by
x^2 + 3*x*y + 2*y^2 - z^2
> AmbientSpace(C0) eq AmbientSpace(C1);
true
> DefiningIdeal(C0) eq DefiningIdeal(C1);
true
> Type(C0), Type(C1);
CrvPln CrvCon

```

## Access Functions

The basic access functions for rational curves and conics are inherited from the general machinery for plane curves and hypersurface schemes.

### `DefiningPolynomial(C): Crv -> RngMPolElt`

Returns the defining polynomial of the conic or rational curve $C$.

### `DefiningIdeal(C): Crv -> RngMPol`

Returns the defining ideal of the conic or rational curve $C$.

### `BaseRing(C): Crv -> Rng`

### `BaseField(C): Crv -> Rng`

Returns the base ring of the curve $C$.

### `Category(C): Crv -> Cat`

### `Type(C): Crv -> Cat`

Returns the category of rational curves `CrvRat` or of conics `CrvCon`; these are special subtypes of planes curves (type `CrvPln`), which are themselves subtypes of general curves (type `Crv`).

## Rational Curve and Conic Examples

These examples illustrate how to obtain standard models of a curve of genus zero, either as a conic or as a parametrisation by the projective line.

### `Example: Rational Curve Example (ex-626aa7)`

We begin with an example of a singular curve of geometric genus zero.

```magma
> P2<x,y,z> := ProjectivePlane(FiniteField(71));
> C := Curve(P2, (x^3 + y^2*z)^2 - x^5*z);
> C;
Curve over GF(71) defined by
x^6 + 70*x^5*z + 2*x^3*y^2*z + y^4*z^2
> ArithmeticGenus(C);
10
> Genus(C);
0
> #RationalPoints(C);
73
> Z := SingularSubscheme(C);
> Degree(Z);
18

```

We see that $C$ is highly singular and that its desingularisation has genus zero. At most 18 of 73 points are singular; note that a nonsingular curve of genus zero would have 72 points. We now investigate the source of the extra points.

```magma
> cmps := IrreducibleComponents(Z);
> [ Degree(X) : X in cmps ];
[ 11, 7 ]
> [ Degree(ReducedSubscheme(X)) : X in cmps ];
[ 1, 1 ]
> [ RationalPoints(X) : X in cmps ];
[
{@ (0 : 0 : 1) @},
{@ (0 : 1 : 0) @}
]

```

Since the only singular rational points on $C$ are $(0 : 0 : 1)$ and $(0 : 1 : 0)$, the “obvious” point $(1 : 0 : 1)$ must be nonsingular and we can use it to obtain a rational parametrisation of the curve as explained in Section [Isomorphisms](crvgen0-sec:isoms.md#crvgen0-sec-isoms).

```magma
> P1<u,v> := ProjectiveSpace(FiniteField(71), 1);
> p := C![1, 0, 1];
> m := Parametrization(C, Place(p), Curve(P1));
> S1 := {@ m(q) : q in RationalPoints(P1) @};
> #S1;
72
> [ q : q in RationalPoints(C) | q notin S1 ];
[ (0 : 1 : 0) ]

```

We conclude that the extra point comes from a singularity whose resolution does not have any degree one places over it (see Section [Divisors](../../AlgebraicGeometry/AlgebraicCurves/divisors.md#crv-divisors) of Chapter [Algebraic Curves](../../AlgebraicGeometry/AlgebraicCurves/index-algebraic-curves.md#crv) for background on places of curves). We can verify this explicitly.

```magma
> [ Degree(p) : p in Places(C![0, 1, 0]) ];
[ 2 ]

```

### `Example: Conic Curve (ex-5e7c60)`

In this example we start by defining a projective curve and we check that it is rational; that is, that it has genus zero.

```magma
> P2<x,y,z> := ProjectiveSpace(Rationals(), 2);
> C0 := Curve(P2, x^2 - 54321*x*y + y^2 - 97531*z^2);
> IsNonsingular(C0);
true

```

The curve $C_0$ is defined as a degree 2 curve over the rationals. By making a preliminary type change to the type of conics, `CrvCon`, we can test whether there exists a rational point over ${\mathbb{Q}}$ and use efficient algorithms of Section [Finding Points](crvcon-sec:ratpoints.md#crvcon-subsec-point-finding) for finding rational points on curves in conic form. The existence of a point (defined over the base field) is equivalent to the existence of a parametrisation (defined over the base field) of the curve by the projective line.

```magma
> bool, C1 := IsConic(C0);
> bool;
true
> C1;
Conic over Rational Field defined by
x^2 - 54321*x*y + y^2 - 97531*z^2
> HasRationalPoint(C1);
true (398469/162001 : -118246/162001 : 1)
> RationalPoint(C1);
(398469/162001 : -118246/162001 : 1)

```

The parametrisation intrinsic requires a one-dimensional ambient space as one of the arguments. This space will be used as the domain of the parametrisation map.

```magma
> P1<u,v> := ProjectiveSpace(Rationals(), 1);
> phi := Parametrization(C1, Curve(P1));
> phi;
Mapping from: Prj: P1 to CrvCon: C1
with equations :
398469*u^2 + 944072*u*v + 559185*v^2
-118246*u^2 - 200850*u*v - 85289*v^2
162001*u^2 + 329499*u*v + 162991*v^2
and inverse
-4634102139*x + 30375658963*y + 31793350442*z
5456130497*x - 25641668406*y - 32136366969*z
and alternative inverse equations :
5456130497*x - 25641668406*y - 32136366969*z
-6424037904*x + 21645471041*y + 31600239062*z

```

The defining functions for the parametrisation may look large, but they are defined simply by a linear change of variables from the $2$-uple embedding of the projective line in the projective plane. We now do a naive search for rational points on the curve.

```magma
> time RationalPoints(C1 : Bound := 100000);
{@ @}
Time: 2.420

```

Although there were no points with small coefficients, the parametrisation provides us with any number of rational points:

```magma
> phi(P1![0, 1]);
(559185/162991 : -85289/162991 : 1)
> phi(P1![1, 1]);
(1901726/654491 : -404385/654491 : 1)
> phi(P1![1, 0]);
(398469/162001 : -118246/162001 : 1)

```

### `Example: Conic Access (ex-8b9072)`

The first part of this example illustrates how to obtain diagonal equations for conics.

```magma
> P2<x,y,z> := ProjectiveSpace(RationalField(), 2);
> f := 1134*x^2 - 28523*x*y - 541003*x*z - 953*y^2 - 3347*y*z - 245*z^2;
> C := Conic(P2, f);
> LegendrePolynomial(C);
1134*x^2 - 927480838158*y^2 - 186042605936505203884941*z^2
> ReducedLegendrePolynomial(C);
817884337*x^2 - y^2 - 353839285266278*z^2

```

Now we demonstrate how to extend the base field of the conic; that is, to create the conic with the same coefficients but in a larger field. This can be done by calling `BaseExtend`; in this instance, we move from the rationals to a particular number field.

(Note the assignment of names to $C$ in order to make the printing nicer.)

```magma
> P<t> := PolynomialRing(RationalField());
> K := NumberField(t^2 - t + 723);
> C<u,v,w> := BaseExtend(C, K);
> C;
Conic over K defined by
1134*u^2 - 28523*u*v - 953*v^2 - 541003*u*w - 3347*v*w - 245*w^2

```
