# Points on Riemann Surfaces

A point on a Riemann surface belongs to type `RieSrfPt`. At this point it is necessary to describe the representation of such points

**(i)**
In the superelliptic case where $X : y^m = p(x)$ and $\deg(p)=n$, every finite point is uniquely represented by a pair $(x,y) \in {\bf C}^2$ of complex numbers. Points at infinity are represented by an index, an integer $s \in \{ 1,..\delta = \gcd(m,n) \}$, in accordance with [[Neurohr, 2018](../../references.md#cite-neurohr-phd), §5.4.3].

**(ii)**
For general Riemann surfaces the situation is a little different. Let $X : f(x,y) = 0$ with $m = \deg(f,y)$ and denote by $\phi : X \rightarrow {\bf P}^1$ the corresponding holomorphic ramified map to the projective line defined by $x$. Algorithmically $X$ is constructed via analytic continuation of $f(x,y(x))=0$ around the discriminant points of $f$ with respect to $y$. This construction relies on the choice of a base point and an ordering of the sheets (the set of preimages under $\phi$, indexed by $I_m = \lbrace1 \ldots m\rbrace$). Now, every point on $X$ is represented by a $2$-tuple $\langle x,\ s \rangle$ where $x \in {\bf P}^1 = {\bf C}\cup \{ \infty \}$ and $s \in I_m$.

## Points

A number of ways of creating points on a Riemann surface will be described. Some functions returning points have already been met: BasePoint(X), RamificationPoints(X) and InfinitePoints(X). The most important way of creating a point on a Riemann surface is to coerce a sequence/tuple into the surface.

### `IsCoercible(X, S): RieSrf, Any -> BoolElt, .`

Attempt to create a point on the Riemann surface $X$ from the sequence or tuple $S$. In order to succeed $S$ has to be a sequence or tuple of length 2 (resp. 3) that is coercible into a complex field and satisfies the affine (resp. projective) defining equation for $X$. A special case is the points at infinity of a superelliptic Riemann surfaces which may be defined by $[k]$ where $k$ is an integer. If successful, the intrinsic returns `true` and the point on $X$. Otherwise `false` is returned.

### `Point(X, S): RieSrf, SeqEnum -> RieSrfPt`

Attempt to create a point on the Riemann surface $X$ from the sequence $S$ by calling `IsCoercible(X,S)`. In order to succeed, $S$ has to be a sequence of length 2 (resp. 3) that is coercible into a complex field and satisfies the affine (resp. projective) defining equation for $X$. A special case is that of the points at infinity of superelliptic Riemann surfaces which may be defined by $[k]$ where $k$ is an integer.

### `Point(X, S): RieSrf, Tup -> RieSrfPt`

If $X$ is a non-superelliptic Riemann surface and $S$ is a tuple defining a possible point of $X$, the intrinsic `IsCoercible(X,S` is called to test if $S$ defines a valid point and if so, produce the point of $X$ corresponding to $S$. The tuple $S$ has to be of the form $<x,\ s>$ where $x$ is either coercible into a complex field or `Infinity()` and $s \in \{1,..,m\}$. If successful the intrinsic returns `true` and the point on $X$. Otherwise `false` is returned.

### `Example: Rie Points (ex-6a04d2)`

A point on the Riemann surface defined by $f = -x^7 + 2x^3y + y^3$ will be created.

```magma
> Qxy<x,y> := PolynomialRing(Rationals(),2);
> f := -x^7 + 2*x^3*y + y^3;
> X := RiemannSurface(f);
> X;
Riemann surface of genus 2 defined by: 0 = -x^7 + 2*x^3*y + y^3
and prescribed precision 30

```

The point of $X$ defined by $x = [-2.000000000, -6.085518827]$ and $s = 2$ will be defined.

```magma
> b, pt := IsPoint(X, < [-2.000000000, -6.085518827], 2 >);
> b;
true
> pt;
(-2.000000000 - 6.085518827*I, -23.68417228 + 74.84801836*I)

```

## Access Functions

### `RiemannSurface(P): RieSrfPt -> RieSrf`

Given a point $P$ belonging to the Riemann surface $X$, return $X$.

### `Representation(P): RieSrfPt -> Tup`

Given a point $P$ belonging to a Riemann surface $X$ a representation of $P$ is returned. If $P$ can be uniquely represented by a pair $(x,y) \in {\bf C}^2$, a sequence containing these numbers is returned. In other cases, such as for infinite points or singular points of the underlying affine (projective) curve, the representation is a $2$-tuple $\langle x,S \rangle$ where $x \in {\bf C}\cup \{ \infty \}$ and $S \subset \{1,..,m\}$ is an indexed subset. The only special case is for points at infinity for superelliptic Riemann surfaces, which are represented by $\langle \infty, k \rangle$ where $k$ in an integer.

### `Coordinates(P): RieSrfPt -> SeqEnum[FldComElt]`

Given a point $P$ belonging to a Riemann surface $X$, the coordinates of $P$ in the projective closure of the affine curve are returned. Note that these coordinates are not necessarily unique, as they may correspond to singular points.

### `RamificationIndex(P): RieSrfPt -> RngIntElt`

The ramification index of the point $P$ belonging to a Riemann surface is returned.

### `PointsOverDiscriminantPoint(X, k): RieSrf, RngIntElt -> SeqEnum[RieSrfPt]`

Given a Riemann surface $X$ and an integer $k$ in the range $[0 \ldots t]$, where $t$ is the number of discriminant points for $X$, the points lying over the $k$-th discriminant point are returned. If $k$ is zero, the points lying over infinity are returned.

### `RandomPoint(X): RieSrf -> RieSrfPt`

```magma
Ht    : RngIntElt                    Default: 10^5
Finite: BoolElt                      Default: true
```

A randomly generated point on the Riemann surface $X$ is returned. If the parameter `Finite` is set to `false` a random infinite point is returned. The second parameter `Ht`, allows the user to bound the absolute value of the $x$-coordinate.

### `Example: Create Pts 1 (ex-cb6770)`

The various intrinsics dealing with points will be demonstrated.

```magma
> Qxy<x,y> := PolynomialRing(Rationals(),2);
> f := -4*x^4 - 5*x^3*y + x^3 + 2*x^2*y^2 - 5*x^2*y + 3*x^2
>        + 3*x*y^3 + x*y - 5*x - 8*y^3 - 3;
> X := RiemannSurface(f);

```

An easy way of defining a point on a Riemann surface $X$ is via a pair of coordinates, using the fiber attribute of $X$.

```magma
> L := X`Fiber(0);
> Pts := [ X![0,L[i]]: i in [1..#L] ];
> Pts;
[
    (0.0000000000, -0.7211247851),
    (0.0000000000, 0.3605623926 - 0.6245123832*I),
    (0.0000000000, 0.3605623926 + 0.6245123832*I)
]

```

Using the Riemann surface `Print` command it is easy to control the precision used when printing objects. The various ways of printing the infinite points will also be demonstrated.

```magma
> Print(Pts[1] : Precision := Precision(X));
(0.000000000000000000000000000000, -0.721124785153704191160819155390)
> Representation(Pts[1]);
[ 0.000000000000000000000000000000000000000000000000000000,
-0.721124785153704191160819155390054794195934626749675288 ]

```

Next the various ways of printing the infinite points are shown.

```magma
> InfinitePoints(X);
[
    Point at infinity on sheets {@ 1 @},
    Point at infinity on sheets {@ 2, 3 @},
    Y-infinite point over x = 2.666666667 on sheets {@ 2 @}
]
> < Representation(P): P in InfinitePoints(X) >;
<<Infinity, {@ 1 @}>, <Infinity, {@ 2, 3 @}>,
<2.66666666666666666666666666666666666666666666666666667, {@ 2 @}>>

> X!<Infinity(),1> eq InfinitePoints(X)[1];
true
> X!<Infinity(),2> eq X!<Infinity(),3>;
true
> X!<8/3,2> eq InfinitePoints(X)[3];
true

```

Using the intrinsic `Coordinates`, the projective coordinates of the points can be retrieved.

```magma
> [ Coordinates(Pt): Pt in InfinitePoints(X) ];
[
    [ 0.750000000000000000000000000000, 1.00000000000000000000000000000,
    0.000000000000000000000000000000 ],
    [ -1.00000000000000000000000000000, 1.00000000000000000000000000000,
    0.000000000000000000000000000000 ],
    [ 0.000000000000000000000000000000, 1.00000000000000000000000000000,
    0.000000000000000000000000000000 ]
]
> X![3/4,1,0] eq InfinitePoints(X)[1];
true
> X![-1,1,0] eq InfinitePoints(X)[2];
true
> X![0,1,0] eq InfinitePoints(X)[3];
true

```

Next the ramification points will be printed.

```magma
> RamificationPoints(X);
[
    (-0.9945334268 - 0.01315512874*I, 0.05451089484 - 0.1643916971*I),
    (-0.9945334268 + 0.01315512874*I, 0.05451089484 + 0.1643916971*I),
    (-0.5252377944 + 0.03223401255*I, 0.01450803309 - 0.2043107259*I),
    (-0.5252377944 - 0.03223401255*I, 0.01450803309 + 0.2043107259*I),
    (0.8365927809 + 0.5016034840*I, -0.4936743728 + 0.5748084711*I),
    (0.8365927809 - 0.5016034840*I, -0.4936743728 - 0.5748084711*I),
    (0.6518240243 - 0.8906693804*I, -1.581225731 - 0.3052027833*I),
    (2.549953730, 19.14988442),
    (0.6518240243 + 0.8906693804*I, -1.581225731 + 0.3052027833*I),
    Point at infinity on sheets {@ 2, 3 @}
]

The discriminant points and the points lying over them will be examined.

> DiscriminantPoints(X)[1];
-0.994533426780725243594285430344169336513181415875424160 -
0.0131551287359799949411725445257194879581749598493457862*I

> PointsOverDiscriminantPoint(X,1);
[
    (-0.9945334268 - 0.01315512874*I, 0.05451089484 - 0.1643916971*I),
    (-0.9945334268 - 0.01315512874*I, 0.07106577813 + 0.3329009545*I)
]

```

Points lying over Infinity() are obtained as follows:

```magma
> PointsOverDiscriminantPoint(X,0);
[
    Point at infinity on sheets {@ 1 @},
    Point at infinity on sheets {@ 2, 3 @}
]

```

Random finite or infinite points on $X$ can be obtained as follows:

```magma
> P1 := RandomPoint(X: Finite);
> P1;
(-2.285969242 + 16.06877365*I, -1.575257283 + 21.29854014*I)

> P2 := RandomPoint(X: Finite := false);
> P2;
Y-infinite point over x = 2.666666667 on sheets {@ 2 @}

```
