An affine variety is an algebraic set such that $X(K)$ is irreducible for $k \subseteq K$ an algebraic closure. See Affine Algebraic Sets.
In Oscar varieties are implemented as special instances of Affine schemes and more formally defined as follows.
AbsAffineVariety <: AbsAffineAlgebraicSet
An affine, geometrically integral subscheme of an affine space over a field.
Functionality which is not (yet) provided by a variety-specific implementation, falls back to the appropriate functionality of schemes.
variety(I::MPolyIdeal; check=true) -> AffineVariety
Return the affine variety defined by the ideal $I$.
By our convention, varieties are absolutely irreducible. Hence we check that the radical of $I$ is prime and stays prime when viewed over the algebraic closure. This is an expensive check that can be disabled.
julia> R, (x,y) = QQ[:x,:y] (Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y]) julia> variety(ideal([x,y])) Affine variety in affine 2-space over QQ with coordinates [x, y] defined by defined by ideal(x, y)
Over fields different from
julia> R, (x,y) = GF(2)[:x,:y]; julia> variety(x^3+y+1, check=false) Affine variety in affine 2-space over GF(2) with coordinates [x, y] defined by defined by ideal(x^3 + y + 1)
variety(X::AbsSpec; is_reduced::false, check::Bool=true) -> AffineVariety
Convert $X$ to an affine variety.
is_reduced is set, assume that
X is already reduced.
Return the affine variety with coordinate ring
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.
julia> R, (x,y) = QQ[:x,:y]; julia> Q,_ = quo(R,ideal([x,y])); julia> variety(Q) Affine variety in affine 2-space over QQ with coordinates [x, y] defined by defined by ideal(x, y)