- Usage:
`isWellDefined X`

- Function: isWellDefined
- Inputs:
`X`, a normal toric variety

- Outputs:
- a Boolean value, that is true if the lists of rays and maximal cones associated to
`X`determine a strongly convex rational polyhedral fan

- a Boolean value, that is true if the lists of rays and maximal cones associated to

A pair `(rayList, coneList)` of lists correspond to a well-defined normal toric variety if the following conditions hold:

- the union of the elements of
`coneList`equals the set of indices of elements of`rayList`, - no element of
`coneList`is properly contained in another element of`coneList`, - the rays indexed by an element of
`coneList`generate a strongly convex cone, - the rays indexed by an element of
`coneList`are the unique minimal lattice points for the cone they generate, - the intersection of the cones associated to two elements of
`coneList`is a face of each cone.

The first examples illustrate that small projective spaces are well-defined.

i1 : assert all (5, d -> isWellDefined toricProjectiveSpace (d+1)) |

The second examples show that a randomly selected Kleinschmidt toric variety and a weighted projective space are also well-defined.

i2 : setRandomSeed (currentTime ()); |

i3 : a = sort apply (3, i -> random (7)) o3 = {0, 1, 4} o3 : List |

i4 : assert isWellDefined kleinschmidt (4,a) |

i5 : q = sort apply (5, j -> random (1,9)); |

i6 : while not all (subsets (q,#q-1), s -> gcd s === 1) do q = sort apply (5, j -> random (1,9)); |

i7 : q o7 = {1, 3, 4, 8, 8} o7 : List |

i8 : assert isWellDefined weightedProjectiveSpace q |

The next eight examples illustrate various ways that two lists can fail to define a normal toric variety. By making the current debugging level greater than one, one gets some addition information about the nature of the failure.

i9 : X = new MutableHashTable; |

i10 : coneList = max toricProjectiveSpace 2; |

i11 : X#1 = normalToricVariety ({{-1,-1},{1,0},{0,1},{-1,0}}, coneList); |

i12 : isWellDefined X#1 o12 = false |

i13 : debugLevel = 1; |

i14 : isWellDefined X#1 -- some ray does not appear in maximal cone o14 = false |

i15 : coneList' = {{0,1},{0,3},{1,2},{2,3},{3}}; |

i16 : X#2 = normalToricVariety ({{-1,0},{0,-1},{1,-1},{0,1}}, coneList'); |

i17 : isWellDefined X#2 -- some cone is not maximal o17 = false |

i18 : X#3 = normalToricVariety ({{-1,-1},{1,0},{0,1,1}},coneList); |

i19 : isWellDefined X#3 -- expected `rays' to be a list of equal length lists o19 = false |

i20 : X#4 = normalToricVariety ({{-1,-1/1},{1,0},{0,1}},coneList); |

i21 : isWellDefined X#4 -- expected `rays' to be a list of lists of integers o21 = false |

i22 : X#5 = normalToricVariety ({{1,0},{0,1},{-1,0}},{{0,1,2}}); |

i23 : isWellDefined X#5 -- not all maximal cones are strongly convex o23 = false |

i24 : X#6 = normalToricVariety ({{1,0,0},{0,1,0},{0,0,2}},{{0,1,2}}); |

i25 : isWellDefined X#6 -- the rays are not the primitive generators o25 = false |

i26 : X#7 = normalToricVariety ({{1,0},{0,1},{1,1}},{{0,1},{1,2}}); |

i27 : isWellDefined X#7 -- intersection of cones is not a cone o27 = false |

i28 : debugLevel = 0; |

i29 : assert all (keys X, k -> not isWellDefined X#k) |

This method also checks that the following aspects of the data structure:

- the underlying HashTable has the expected keys, namely
`rays`,`max`, and`cache`, - the value of the
`rays`key is a List, - each entry in the
`rays`list is a List, - each entry in an entry of the
`rays`list is an ZZ, - each entry in the
`rays`list as the same number of entries, - the value of the
`max`key is a List, - each entry in the
`max`list is a List, - each entry in an entry of the
`max`list is an ZZ, - each entry in an entry of the
`max`list corresponds to a ray, - the value of the
`cache`key is a CacheTable.

- Making normal toric varieties
- normalToricVariety(List,List) -- make a normal toric variety
- debugLevel -- current level debugging