# Geometrical Properties of Cones and Polyhedra

## `IsSingular(C): TorCon -> BoolElt`

Return `true` if and only if the affine variety associated with the cone $C$ is singular.

## `IsNonsingular(C): TorCon -> BoolElt`

Return `true` if and only if the affine variety associated with the cone $C$ is nonsingular.

## `IsSmooth(P): TorPol -> BoolElt`

Return `true` if and only if the polyhedron $P$ is a smooth polytope.

## `IsGorenstein(C): TorCon -> BoolElt`

Return `true` if and only if the cone $C$ has (the primitive points on its) rays contained in an affine hyperplane that is defined by an integral equation.

## `IsReflexive(P): TorPol -> BoolElt`

Return `true` if and only if the polyhedron $P$ is reflexive; i.e. $P$ and its dual $P^\vee$ are both integral polytopes.

## `IsQGorenstein(C): TorCon -> BoolElt`

Return `true` if and only if the cone $C$ has (the primitive points on its) rays contained in an affine hyperplane.

## `GorensteinIndex(C): TorCon -> RngIntElt, TorLatElt`

The Gorenstein index of the affine variety corresponding to the cone $C$ together with the dual vector determining the equation of the hyperplane. (It is an error if $C$ is not ${\mathbb{Q}}$-Gorenstein.)

## `GorensteinIndex(P): TorPol -> RngIntElt`

The Gorenstein index of the lattice polytope $P$; i.e. the smallest positive integer $k$ such that $kP^\vee$ is an integral polytope.

## `IsIsolated(C): TorCon -> BoolElt`

Return `true` if and only if the singularity of the affine variety associated to the cone $C$ is isolated.

## `IsQFactorial(C): TorCon -> BoolElt`

## `IsSimplicial(P): TorPol -> BoolElt`

Return `true` if and only if the cone $C$ or polytope $P$ is simplicial.

## `IsTerminal(C): TorCon -> BoolElt`

Return `true` if and only if the singularity of the affine variety associated to the cone $C$ is (at worst) terminal.

## `IsCanonical(C): TorCon -> BoolElt`

Return `true` if and only if the singularity of the affine variety associated to the cone $C$ is (at worst) canonical.

## `IsFano(P): TorPol -> BoolElt`

Return `true` if and only if the polyhedron $P$ is a Fano polytope (i.e. of maximum dimension in the ambient lattice, containing the origin strictly in its interior, with primitive lattice vertices).

## `Example: Toric Terminal Polytope Example (ex-ee8303)`

We make the cone corresponding to the (affine) terminal quotient singularity ${\mathbb{C}}^3/({\mathbb{Z}}/5)$ where ${\mathbb{Z}}/5$ acts as the $5$th roots of unity in the diagonal representation ${\rm diag}(1,2,3)$.

```magma
> L := ToricLattice(3);
> v := L ! [1/5,2/5,3/5];
> LL,emb := AddVectorToLattice(v);
> C := PositiveQuadrant(L);
> CC := Image(emb,C);
> CC;
Cone CC with 3 generators:
    (1, 0, 0),
    (0, 1, 0),
    (3, 1, 5)

```

We can check that this really is terminal and compute its Gorenstein index, the least positive multiple of the canonical class that is Cartier.

```magma
> IsTerminal(CC);
true
> GorensteinIndex(CC);
5 (1, 1, -3/5)

```

We can compute a resolution of singularities of this cone, the analogue of a simplicial subdivision for cones, although we must treat it as a fan to do so.

```magma
> F := Fan(CC);
> F;
Fan F with 3 rays:
    (0, 1, 0),
    (1, 0, 0),
    (3, 1, 5)
and one cone with indices:
    [ 1, 2, 3 ]
> Resolution(F);
Fan with 8 rays:
    (0, 1, 0),
    (1, 0, 0),
    (3, 1, 5),
    (2, 1, 2),
    (1, 1, 1),
    (3, 1, 3),
    (3, 1, 4),
    (2, 1, 3)
and 11 cones

```

Note that this is not a minimal resolution: such a resolution would only need to subdivide at the four additional rays at the (original) lattice points $1/5(1,2,3)$, $1/5(2,4,1)$, $1/5(3,1,4)$ and $1/5(4,3,2)$.
