# Subvarieties

## Introduction

We focus on simplicial toric varieties. Then, any closed subvariety is given as the vanishing set of a homogeneous ideal in the Cox ring of the toric variety in question (cf. proposition 5.2.4 in David A. Cox, John B. Little, Henry K. Schenck (2011)). As of now, we provide elementary support for closed subvarieties of simplicial toric varieties.

## Constructors

### General constructors

`closed_subvariety_of_toric_variety`

— Method`closed_subvariety_of_toric_variety(toric_variety::AbstractNormalToricVariety, defining_polynomials::Vector{MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}})`

Construct the closed subvariety of a simplicial normal toric variety. The defining data for the closed subvariety is a list of homogeneous polynomials, all of which must be elements of the Cox ring of the toric variety in question. The common vanishing locus of these polynomials defines the closed subvariety in question. By proposition 5.2.4 in David A. Cox, John B. Little, Henry K. Schenck (2011) every closed subvariety of a simplicial toric variety arises in this way.

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> closed_subvariety_of_toric_variety(f2, [t1])
Closed subvariety of a normal toric variety
```

`closed_subvariety_of_toric_variety`

— Method`closed_subvariety_of_toric_variety(toric_variety::AbstractNormalToricVariety, defining_ideal::MPolyIdeal)`

Construct the closed subvariety of a simplicial normal toric variety. The defining data for the closed subvariety is an ideal of the Cox ring of the toric variety in question. By proposition 5.2.4 in David A. Cox, John B. Little, Henry K. Schenck (2011) every closed subvariety of a simplicial toric variety arises in this way.

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> closed_subvariety_of_toric_variety(f2, ideal([t1]))
Closed subvariety of a normal toric variety
```

## Properties

`is_empty`

— Method`is_empty(c::ClosedSubvarietyOfToricVariety)`

Checks if a closed subvariety of a toric variety is empty. This check uses proposition 5.2.6 in David A. Cox, John B. Little, Henry K. Schenck (2011).

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> c = closed_subvariety_of_toric_variety(f2, [t1])
Closed subvariety of a normal toric variety
julia> is_empty(c)
false
julia> c2 = closed_subvariety_of_toric_variety(f2, [x1,x2])
Closed subvariety of a normal toric variety
julia> is_empty(c2)
true
```

## Attributes

`toric_variety`

— Method`toric_variety(c::ClosedSubvarietyOfToricVariety)`

When constructing a closed subvariety, a toric variety must be provided in which the closed subvariety is contained. This method returns this initially provided toric supervariety.

Note however that perse, a closed subvariety can be contained in different non-isomorphic toric varieties.

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> c = closed_subvariety_of_toric_variety(f2, [t1])
Closed subvariety of a normal toric variety
julia> toric_variety(c) == f2
true
```

`defining_ideal`

— Method`defining_ideal(c::ClosedSubvarietyOfToricVariety)`

When constructing a closed subvariety, an ideal in the Cox ring of a normal toric variety must be provided. This method returns this initially provided ideal.

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> c = closed_subvariety_of_toric_variety(f2, [t1])
Closed subvariety of a normal toric variety
julia> defining_ideal(c) == ideal([t1])
true
```

`radical`

— Method`radical(c::ClosedSubvarietyOfToricVariety)`

When constructing a closed subvariety, an ideal in the Cox ring of a normal toric variety must be provided. This method returns the radical of this initially provided ideal.

**Examples**

```
julia> f2 = hirzebruch_surface(NormalToricVariety, 2);
julia> (t1, x1, t2, x2) = gens(cox_ring(f2));
julia> c = closed_subvariety_of_toric_variety(f2, [t1])
Closed subvariety of a normal toric variety
julia> radical(c) == ideal([t1])
true
```