# Operations on Point Sets

Each elliptic curve $E$ has associated with it a family of *point sets* of $E$ indexed by coefficient rings. These point sets, not $E$, are the objects in which points lie. If $K$ is the base ring of $E$ and $L$ is some extension of $K$ then the elements of the point set $E(L)$ comprise all points lying on $E$ whose coordinates are in $L$.

There is a distinguished point set $E(K)$ of $E$ which is called the *base point set* of $E$. Many intrinsics (such as `#`, or `TorsionSubgroup`), strictly speaking, only make sense when applied to point sets; as a convenience, when $E$ is passed to these functions the behaviour is the same as if the base point set $E(K)$ were passed instead. It is important to remember, however, that $E$ and $E(K)$ are different objects and will not always behave in the same manner.

The above statements are equally valid if the elliptic curve $E$ is replaced by some subgroup scheme $G$. Moreover, the types of the point sets of $G$ and $E$ are the same, and similarly for points. (They may be distinguished by checking the type of the scheme of which they are point sets.)

## Creation of Point Sets

### `E(L): CrvEll, Rng -> SetPtEll`

### `PointSet(E, L): CrvEll, Rng -> SetPtEll`

Given an elliptic curve $E$ (or a subgroup scheme thereof) and an extension $L$ of its base ring, this function returns a point set whose elements are points on $E$ with coefficients in $L$.

### `E(m): CrvEll, Map -> SetPtEll`

### `PointSet(E, m): CrvEll, Map -> SetPtEll`

Given an elliptic curve $E$ (or a subgroup scheme thereof) and a map $m$ from the base ring of $E$ to a field $L$, this function returns a point set whose elements are points on $E$ with coefficients in $L$. The map is retained to permit coercions between point sets.

## Associated Structures

### `Category(H): SetPtEll -> Cat`

### `Type(H): SetPtEll -> Cat`

Given a point set $H$ of an elliptic curve, returns the category `SetPtEll` of point sets of elliptic curves.

### `Scheme(H): SetPtEll -> CrvEll`

Returns the associated scheme (either an elliptic curve or a subgroup scheme) of which $H$ is a point set.

### `Curve(H): SetPtEll -> CrvEll`

Returns the associated elliptic curve that contains `Scheme(H)`.

### `Ring(H): SetPtEll -> Rng`

Returns the ring that contains the coordinates of points in $H$.

## Predicates on Point Sets

### `H1 eq H2: SetPtEll, SetPtEll -> BoolElt`

Returns whether the two point sets are equal. That is, whether the point sets have equal coefficient rings and elliptic curves (subgroup schemes).

### `H1 ne H2: SetPtEll, SetPtEll -> BoolElt`

The logical negation of `eq`.

### `Example: Point Sets (ex-127ba4)`

We create an elliptic curve $E$ over GF(5) and then construct two associated point sets:

```magma
> K := GF(5);
> E := EllipticCurve([K | 1, 0]);
> H := E(K);
> H;
Set of points of E with coordinates in GF(5)
> H2 := E(GF(5, 2));
> H2;
Set of points of E with coordinates in GF(5^2)

```

We note that although these are point sets of the same curve, they are not equal because the rings are not equal.

```magma
> Scheme(H) eq Scheme(H2);
true
> Ring(H) eq Ring(H2);
false
> H eq H2;
false

```

Similarly, we see that a point set of a subgroup scheme is not the same object as the point set of the curve because the schemes are different.

```magma
> P<t> := PolynomialRing(K);
> G := SubgroupScheme(E, t - 2);
> HG := G(K);
> Scheme(HG) eq Scheme(H);
false
> Ring(HG) eq Ring(H);
true
> HG eq H;
false

```

Also note that the scheme and the parent curve of point sets of G are different:

```magma
> Scheme(HG);
Subgroup scheme of E defined by x + 3
> Curve(HG);
Elliptic Curve defined by y^2 = x^3 + x over GF(5)

```
