# Projective Varieties

A projective variety over an algebraically closed field is an irreducible projective algebraic set. See Projective Algebraic Sets.

In practice we work over non-closed fields. To be called a variety an algebraic set $V$ must stay irreducible when viewed over the algebraic closure.

In Oscar projective varieties are Projective schemes and more formally defined as follows.

`AbsProjectiveVariety`

— Type`AbsProjectiveVariety <: AbsProjectiveAlgebraicSet`

A geometrically integral subscheme of a projective space over a field.

## Constructors

`variety`

— Method`variety(I::MPolyIdeal{<:MPolyDecRingElem}; check::Bool=true, is_radical::Bool=false) -> ProjectiveVariety`

Return the projective variety defined by the homogeneous prime ideal $I$.

Since in our terminology varieties are irreducible over the algebraic closure, we check that $I$ stays prime when viewed over the algebraic closure. This is an expensive check that can be disabled. Note that the ideal $I$ must live in a standard graded ring.

```
julia> P3 = projective_space(QQ,3)
Projective space of dimension 3
over rational field
with homogeneous coordinates [s0, s1, s2, s3]
julia> (s0,s1,s2,s3) = homogeneous_coordinates(P3);
julia> X = variety(s0^3 + s1^3 + s2^3 + s3^3)
Projective variety
in projective 3-space over QQ with coordinates [s0, s1, s2, s3]
defined by ideal (s0^3 + s1^3 + s2^3 + s3^3)
julia> dim(X)
2
julia> Y = variety(ideal([s0^3 + s1^3 + s2^3 + s3^3, s0]))
Projective variety
in projective 3-space over QQ with coordinates [s0, s1, s2, s3]
defined by ideal (s0^3 + s1^3 + s2^3 + s3^3, s0)
julia> dim(Y)
1
```

`variety`

— Method`variety(X::AbsProjectiveScheme; is_reduced::Bool=false, check::Bool=true) -> ProjectiveVariety`

Convert $X$ to a projective variety by considering its reduced structure

`variety`

— Method`variety(R::GradedRing; check::Bool=true)`

Return the projective variety defined by the $\mathbb{Z}$ standard graded ring $R$.

We require that $R$ is a finitely generated algebra over a field $k$ and moreover that the base change of $R$ to the algebraic closure $\bar k$ is an integral domain.

`variety`

— Method`variety(f::MPolyDecRingElem; check=true)`

Return the projective variety defined by the homogeneous polynomial `f`

.

This checks that `f`

is absolutely irreducible.

## Attributes

In addition to what is inherited from Projective Algebraic Sets and Projective schemes, we currently have:

`sectional_genus`

— Method`sectional_genus(X::AbsProjectiveVariety)`

Given a subvariety `X`

of some $\mathbb P^n$, return the arithmetic genus of the intersection of `X`

with a general linear subspace of $\mathbb P^n$ of dimension $c+1$.

**Examples**

```
julia> X = bordiga()
Projective variety
in projective 4-space over GF(31991) with coordinates [x, y, z, u, v]
defined by ideal with 4 generators
julia> dim(X)
2
julia> codim(X)
2
julia> degree(X)
6
julia> sectional_genus(X)
3
```

## Properties

In addition to what is inherited from Projective Algebraic Sets and Projective schemes, we currently have:

`is_linearly_normal`

— Method`is_linearly_normal(X::AbsProjectiveVariety)`

Return `true`

if `X`

is linearly normal, and `false`

otherwise.

**Examples**

```
julia> X = bordiga()
Projective variety
in projective 4-space over GF(31991) with coordinates [x, y, z, u, v]
defined by ideal with 4 generators
julia> dim(X)
2
julia> codim(X)
2
julia> is_linearly_normal(X)
true
```

## Methods

In addition to what is inherited from Projective Algebraic Sets and Projective schemes, we currently have:

`canonical_bundle`

— Method`canonical_bundle(X::AbsProjectiveVariety)`

Given a smooth projective variety `X`

, return a module whose sheafification is the canonical bundle of `X`

.

The function does not check smoothness. If you are uncertain, enter `is_smooth(X)`

first.

**Examples**

```
julia> R, x = graded_polynomial_ring(QQ, :x => (1:6));
julia> I = ideal(R, [x[1]*x[6] - x[2]*x[5] + x[3]*x[4]]);
julia> GRASSMANNIAN = variety(I);
julia> Omega = canonical_bundle(GRASSMANNIAN)
Graded submodule of R^1 with 1 generator
1: e[1]
represented as subquotient with no relations
julia> degrees_of_generators(Omega)
1-element Vector{FinGenAbGroupElem}:
[4]
```

```
julia> R, (x, y, z) = graded_polynomial_ring(QQ,[:x, :y, :z]);
julia> I = ideal(R, [y^2*z + x*y*z - x^3 - x*z^2 - z^3]);
julia> ELLCurve = variety(I);
julia> Omega = canonical_bundle(ELLCurve)
Graded submodule of R^1 with 1 generator
1: e[1]
represented as subquotient with no relations
julia> degrees_of_generators(Omega)
1-element Vector{FinGenAbGroupElem}:
[0]
```

```
julia> X = bordiga()
Projective variety
in projective 4-space over GF(31991) with coordinates [x, y, z, u, v]
defined by ideal with 4 generators
julia> dim(X)
2
julia> codim(X)
2
julia> Omega = canonical_bundle(X);
julia> typeof(Omega)
SubquoModule{MPolyDecRingElem{fpFieldElem, fpMPolyRingElem}}
```