# Affine Algebraic Sets

## Introduction

Let $\mathbb{A}^n(k)=k^n$ be the affine space of dimension $n$ over a field $k$. For finitely many multivariate polynomials $f_1, \dots f_r \in k[x_1,\dots x_n]$ and $I = (f_1, \dots f_r) \subseteq k[x_1,\dots x_n]$ the ideal they generate, we denote by $X = V(I)$ the (affine) algebraic set defined by the ideal $I$ and call $k$ its base field.

If $k \subseteq K$ is any field extension, we denote the set of $K$-points of $X$ by

\[\begin{aligned}X(K) &= \{ P \in \mathbb{A}^n(K) \mid f_1(P)=\dots = f_n(P)=0\}\\&=\{P \in \mathbb{A}^n(K) \mid \forall f\in I : f(P)=0\}.\end{aligned}\]

Most properties of the algebraic set $X$ refer to $X(K)$ where $K$ is an algebraically closed field. For instance `is_empty`

returns whether $X(K) = \emptyset$.

Exceptions to the rule, that we refer to $X(K)$, are documented in the respective methods. For example the property of being irreducible depends on $k$: The algebraic set $X = V(x^2+y^2) \subseteq \mathbb{A}^2$ is irreducible over $k = \mathbb{R}$. But it is the union of two lines over $K = \mathbb{C}$, i.e. $X$ is irreducible but geometrically reducible. See `is_irreducible(X::AbsSpec{<:Field, <:MPolyAnyRing})`

for details.

## Rational points

To study the $k$-points, also called $k$-rational points, of the algebraic set $X$ one first considers the solutions $X(K)$ over an algebraically closed field extension $K$ of $k$. Then in a second step one studies $X(k)$ as a subset of $X(K)$.

The first step involves calculations with ideals. For instance Hilbert's Nullstellensatz implies that $X(K)$ is empty if and only if the ideal $I=(1)$. This is decided by an ideal membership test relying on a Gröbner basis computation of $I$ and can be carried out in $k[x_1,\dots x_n]$ without taking any field extensions.

The second step involves methods from number theory (if $k$ is a number field) or from real algebraic geometry (if $k = \mathbb{R}$).

Algebraic sets in Oscar are designed for the first step. Most of their properfties should be interpreted as properties of the set $X(K)$ of their $K$-points over an algebraic closure $K$.

## Relation to Schemes

One may view an (affine) algebraic set as a geometrically reduced (affine) scheme over a field $k$.

Many constructions involving varieties lead naturally to schemes. For instance the intersection of $X = V(x^2 - y)$ and $Y = V(y)$ as sets is the point ${(0,0)}=V(x,y)$. As a scheme the intersection is defined by the ideal $(x^2, y)$ which can be interpreted as a point of multiplicity $2$ and contains the information that the intersection of $X$ and $Y$ is tangential in $(0,0)$.

Therefore we have two methods

`set_theoretic_intersection(::AbsAffineAlgebraicSet)`

which can be thought of as $X(K)\cap Y(K)$`intersection(::AbsAffineAlgebraicSet)`

which is the scheme theoretic intersection

If a construction returns a scheme $Z$, but you want to ignore the scheme structure, call the function `algebraic_set(Z)`

to convert the scheme $Z$ to an affine algebraic set.

For example `algebraic_set(intersection(X, Y))`

is equivalent to `set_theoretic_intersection(X, Y)`

.

Internally an `AffineAlgebraicSet`

is constructed from a possibly non-reduced affine scheme, which we call the `fat_scheme`

of `X`

as opposed to the `reduced_scheme`

of `X`

which we refer to as the `underlying_scheme`

.

`fat_ideal`

— Method`fat_ideal(X::AbsAffineAlgebraicSet) -> Ideal`

Return an ideal whose radical is the vanishing ideal of `X`

.

If `X`

is constructed from an ideal `I`

this returns `I`

.

```
julia> A2 = affine_space(QQ, [:x,:y])
Affine space of dimension 2
over rational field
with coordinates [x, y]
julia> (x, y) = coordinates(A2);
julia> I = ideal([x^2, y]);
julia> X = algebraic_set(I)
Affine algebraic set
in affine 2-space over QQ with coordinates [x, y]
defined by ideal(x^2, y)
julia> fat_ideal(X) === I
true
```

`fat_scheme`

— Method`fat_scheme(X::AffineAlgebraicSet) -> AbsSpec`

Return a scheme whose reduced subscheme is $X$.

This does not trigger any computation and is therefore cheap. Use this instead of `underlying_scheme`

when possible.

`underlying_scheme`

— Method`underlying_scheme(X::AffineAlgebraicSet) -> AbsSpec`

Return the underlying reduced scheme defining $X$.

This is used to forward the `AbsSpec`

functionality to $X$, but may trigger the computation of a radical ideal. Hence this can be expensive.

### More general affine algebraic sets

By abuse of terminology we say that a scheme is an affine algebraic set if it is isomorphic to one. For example a hypersurface complement is an affine algebraic set. In particular, we allow affine algebraic sets which are not necessarily Zariski closed in their ambient affine space.

`AbsAffineAlgebraicSet`

— Type`AbsAffineAlgebraicSet <: AbsSpec`

An affine, geometrically reduced subscheme of an affine space over a field.

## Constructors

One can create an algebraic set from an ideal or a multivariate polynomial.

`algebraic_set`

— Method`algebraic_set(I::MPolyIdeal; is_radical::Bool=false, check::Bool=true)`

Return the affine algebraic set defined $I$.

If `is_radical`

is set, assume that $I$ is a radical ideal.

```
julia> R, (x,y) = GF(2)[:x,:y];
julia> X = algebraic_set(ideal([y^2+y+x^3+1,x]))
Affine algebraic set
in affine 2-space over GF(2) with coordinates [x, y]
defined by ideal(x^3 + y^2 + y + 1, x)
```

`algebraic_set`

— Method`algebraic_set(p::MPolyRingElem)`

Return the affine algebraic set defined by the multivariate polynomial `p`

.

```
julia> R, (x,y) = QQ[:x,:y];
julia> X = algebraic_set((y^2+y+x^3+1)*x^2)
Affine algebraic set
in affine 2-space over QQ with coordinates [x, y]
defined by ideal(x^5 + x^2*y^2 + x^2*y + x^2)
julia> R, (x,y) = GF(2)[:x,:y];
julia> X = algebraic_set((y^2+y+x^3+1)*x^2)
Affine algebraic set
in affine 2-space over GF(2) with coordinates [x, y]
defined by ideal(x^5 + x^2*y^2 + x^2*y + x^2)
```

Convert an affine scheme to an affine algebraic set in order to ignore its (non-reduced) scheme structure.

`algebraic_set`

— Method`algebraic_set(X::Spec; is_reduced=false, check=true) -> AffineAlgebraicSet`

Convert `X`

to an `AffineAlgebraicSet`

by considering its reduced structure.

If `is_reduced`

is set, assume that `X`

is already reduced. If `is_reduced`

and `check`

are set, check that `X`

is actually geometrically reduced as claimed.

`set_theoretic_intersection`

— Method`set_theoretic_intersection(X::AbsAffineAlgebraicSet, Y::AbsAffineAlgebraicSet)`

Return the set theoretic intersection of `X`

and `Y`

as an algebraic set.

```
julia> A = affine_space(QQ, [:x,:y])
Affine space of dimension 2
over rational field
with coordinates [x, y]
julia> (x, y) = coordinates(A)
2-element Vector{QQMPolyRingElem}:
x
y
julia> X = algebraic_set(ideal([y - x^2]))
Affine algebraic set
in affine 2-space over QQ with coordinates [x, y]
defined by ideal(-x^2 + y)
julia> Y = algebraic_set(ideal([y]))
Affine algebraic set
in affine 2-space over QQ with coordinates [x, y]
defined by ideal(y)
julia> Zred = set_theoretic_intersection(X, Y)
Affine algebraic set
in affine 2-space over QQ with coordinates [x, y]
defined by ideal(-x^2 + y, y)
```

Note that the set theoretic intersection forgets the intersection multiplicities which the scheme theoretic intersection remembers. Therefore they are different.

```
julia> Z = intersect(X, Y) # a non reduced scheme
Spectrum
of quotient
of multivariate polynomial ring in 2 variables over QQ
by ideal(x^2 - y, y)
julia> Zred == Z
false
julia> Zred == reduced_scheme(Z)[1]
true
```

`closure`

— Method`closure(X::AbsAffineAlgebraicSet)`

Return the closure of $X$ in its ambient affine space.

## Attributes

In addition to the attributes inherited from Affine schemes the following are available.

`irreducible_components`

— Method`irreducible_components(X::AbsAffineAlgebraicSet) -> Vector{AffineVariety}`

Return the irreducible components of $X$ defined over the base field of $X$.

Note that they may be reducible over the algebraic closure. See also `geometric_irreducible_components`

.

`geometric_irreducible_components`

— Method`geometric_irreducible_components(X::AbsAffineAlgebraicSet)`

Return the geometrically irreducible components of $X$.

They are the irreducible components $V_{ij}$ of $X$ seen over an algebraically closed field and given as a vector of tuples $(A_i, V_{ij}, d_{ij})$, say, where $A_i$ is an algebraic set which is irreducible over the base field of $X$ and $V_{ij}$ represents a corresponding class of galois conjugated geometrically irreducible components of $A_i$ defined over a number field of degree $d_{ij}$ whose generator prints as `_a`

.

This is expensive and involves taking field extensions.

`vanishing_ideal`

— Method`vanishing_ideal(X::AbsAffineAlgebraicSet) -> Ideal`

Return the ideal of all polynomials vanishing in $X$.

By Hilbert's Nullstellensatz this is a radical ideal.

This triggers the computation of a radical, which is expensive.

## Methods

Inherited from Affine schemes

## Properties

Inherited from Affine schemes