# randomPointOnRationalVariety(Ideal) -- find a random point on a variety that can be detected to be rational

## Synopsis

• Function: randomPointOnRationalVariety
• Usage:
randomPointOnRationalVariety I
randomPointOnRationalVariety
• Inputs:
• I, an ideal, An ideal in a polynomial ring $S$ over a field, which defines a prime ideal
• Outputs:
• , A one row matrix over the base field of $S$, representing a randomly chosen point on the zero locus of $I$. null is returned in the case when the routine cannot determine if the variety is rational and irreducible.

## Description

As a first example, we find a random point on the Veronese surface in $\PP^5$.

 i1 : kk = ZZ/101; i2 : S = kk[a..f]; i3 : I = minors(2, genericSymmetricMatrix(S, 3)) 2 2 o3 = ideal (- b + a*d, - b*c + a*e, - c*d + b*e, - b*c + a*e, - c + a*f, - ------------------------------------------------------------------------ 2 c*e + b*f, - c*d + b*e, - c*e + b*f, - e + d*f) o3 : Ideal of S i4 : pt = randomPointOnRationalVariety I o4 = | 1 49 24 -23 -36 -30 | 1 6 o4 : Matrix kk <--- kk i5 : sub(I, pt) == 0 o5 = true
 i6 : S = kk[a..d]; i7 : F = groebnerFamily ideal"a2,ab,ac,b2" 2 2 2 o7 = ideal (a + t b*c + t a*d + t c + t b*d + t c*d + t d , a*b + t b*c + 1 3 2 4 5 6 7 ------------------------------------------------------------------------ 2 2 2 t a*d + t c + t b*d + t c*d + t d , a*c + t b*c + t a*d + t c + 9 8 10 11 12 13 15 14 ------------------------------------------------------------------------ 2 2 2 t b*d + t c*d + t d , b + t b*c + t a*d + t c + t b*d + t c*d 16 17 18 19 21 20 22 23 ------------------------------------------------------------------------ 2 + t d ) 24 o7 : Ideal of kk[t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t ][a..d] 6 5 12 2 4 11 18 24 1 3 8 10 17 23 7 9 14 16 20 22 13 15 19 21 i8 : J = groebnerStratum F o8 = ideal (- t + t - t t , - t - t t , - t + t + t t - t t 7 14 13 19 8 20 13 10 17 9 13 22 13 ------------------------------------------------------------------------ 2 - t t - t t + t t , - t t + t t t , - t + t t - t t 7 15 16 19 13 21 16 21 13 15 21 11 9 14 16 20 ------------------------------------------------------------------------ - t t - t t + t t t , t + t t - t t - t t + t t t , 23 13 8 15 14 13 21 18 9 16 16 22 10 15 16 13 21 ------------------------------------------------------------------------ - t + t t - t t - t t - t t + t t t , t t - t t - 12 17 9 23 16 24 13 11 15 17 13 21 18 9 24 16 ------------------------------------------------------------------------ 2 2 2 t t + t t t , - t - 2t t + t t , - t - t + t t , - t - 12 15 18 13 21 1 14 13 13 19 2 14 20 13 4 ------------------------------------------------------------------------ 2 t t - t t + t t - 2t t + t t - t t + t t t + t t t 7 16 14 16 3 13 17 13 22 13 1 15 7 13 15 14 13 15 ------------------------------------------------------------------------ 3 2 + t t t - t t , t - t t - t t + t t t + t t + 16 13 19 13 21 18 9 16 17 15 9 13 15 14 15 ------------------------------------------------------------------------ 2 t t t - t t t , - t + t t - 2t t - t t + t t t + 16 13 21 13 15 21 5 3 14 17 14 8 16 16 20 13 ------------------------------------------------------------------------ 2 2 2 t t - t t + t t + t t t - t t t , t t - t t - t t 23 13 2 15 14 15 8 13 15 14 13 21 3 16 10 16 17 16 ------------------------------------------------------------------------ 2 - t t + t t t - t t + t t t + t t t - t t t , - t + 18 13 16 22 13 4 15 14 16 15 10 13 15 16 13 21 6 ------------------------------------------------------------------------ 2 2 t t - t - t t - t t + t t t + t t - t t + t t t + 3 17 17 18 14 11 16 23 16 13 24 13 5 15 17 14 15 ------------------------------------------------------------------------ 2 t t t - t t t , t t - t t - t t + t t t - t t + 11 13 15 17 13 21 18 3 18 17 12 16 24 16 13 6 15 ------------------------------------------------------------------------ 2 t t t + t t t - t t t , - t - t t + t t - t t + 18 14 15 12 13 15 18 13 21 8 20 13 7 19 14 19 ------------------------------------------------------------------------ 2 t t , t t - t t + t t t , - t + t t - t t - t t + 13 19 7 20 14 20 20 13 19 11 7 9 16 20 23 13 ------------------------------------------------------------------------ 2 t t t + t t - t t + t t t + t t t + t t - t t - 20 13 15 10 19 17 19 22 13 19 7 15 19 16 19 1 21 ------------------------------------------------------------------------ 2 2 2 t t t - t t t , t + t - t t - t t + t t + t t t - 7 13 21 13 19 21 24 9 9 22 23 15 20 15 9 15 19 ------------------------------------------------------------------------ t t + t t - t t t + t t t - t t t t , t t + t t - 3 21 10 21 7 15 21 16 19 21 13 15 19 21 23 7 8 9 ------------------------------------------------------------------------ t t + t t - t t - t t + t t t + t t t + t t t + 23 14 10 20 17 20 8 22 14 20 15 16 20 19 23 13 19 ------------------------------------------------------------------------ t t t - t t - t t t - t t t t , - t + t t - t t + 8 15 19 2 21 7 14 21 14 13 19 21 12 10 9 23 16 ------------------------------------------------------------------------ t t t - t t + t t t + t t t - t t - t t t - 16 20 15 18 19 16 22 19 10 15 19 4 21 7 16 21 ------------------------------------------------------------------------ t t t t , t t - t t + t t + t t - t t - t t + 16 13 19 21 10 23 17 23 24 7 11 9 18 20 11 22 ------------------------------------------------------------------------ t t t + t t t + t t t + t t t - t t - t t t - 17 20 15 23 16 19 24 13 19 11 15 19 5 21 17 7 21 ------------------------------------------------------------------------ t t t t , t t - t t + t t - t t + t t t + t t t + 17 13 19 21 24 10 18 23 12 9 12 22 18 20 15 24 16 19 ------------------------------------------------------------------------ t t t - t t - t t t - t t t t , - t - t t - t t + 12 15 19 6 21 18 7 21 18 13 19 21 2 7 14 8 13 ------------------------------------------------------------------------ t t + t t t , - t t + t t + t t t , - t + t t - t t - 1 19 7 13 19 8 14 1 20 7 20 13 5 3 7 10 7 ------------------------------------------------------------------------ 2 t t - t t - t t + t t - t t + t t t + t t + t t t + 17 7 1 9 8 16 1 22 11 13 7 22 13 7 15 8 13 15 ------------------------------------------------------------------------ 2 t t + t t t - t t t - t t t , t - t t - t t + t t t + 4 19 7 16 19 1 13 21 7 13 21 12 10 9 11 15 7 9 15 ------------------------------------------------------------------------ 2 t t + t t + t t t - t t t - t t t t , t t - t t - t t 8 15 4 21 7 16 21 1 15 21 7 13 15 21 3 8 8 10 8 17 ------------------------------------------------------------------------ + t t - t t - t t + t t + t t t + t t t + t t t + 1 23 2 9 11 14 4 20 7 16 20 23 7 13 8 7 15 ------------------------------------------------------------------------ 2 t t t - t t t - t t t t , - t + t t - t - t t - t t - 8 14 15 1 14 21 7 14 13 21 6 3 10 10 18 7 4 9 ------------------------------------------------------------------------ t t + t t + t t t + t t t + t t t - t t t - 11 16 4 22 7 16 22 10 7 15 8 16 15 1 16 21 ------------------------------------------------------------------------ t t t t , t t + t t - t t - t t - t t + t t - t t + 7 16 13 21 24 1 11 3 18 8 11 10 11 17 4 23 5 9 ------------------------------------------------------------------------ t t t + t t t + t t t + t t t - t t t - t t t t , - 23 7 16 24 7 13 8 17 15 11 7 15 1 17 21 17 7 13 21 ------------------------------------------------------------------------ t t + t t + t t - t t - t t + t t t + t t t + t t t 11 18 4 24 12 3 12 10 6 9 24 7 16 18 8 15 12 7 15 ------------------------------------------------------------------------ - t t t - t t t t ) 18 1 21 18 7 13 21 o8 : Ideal of kk[t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t , t ] 6 5 12 2 4 11 18 24 1 3 8 10 17 23 7 9 14 16 20 22 13 15 19 21 i9 : compsJ = decompose J; i10 : compsJ = compsJ/trim; i11 : #compsJ == 2 o11 = true i12 : compsJ/dim o12 = {11, 8} o12 : List

There are 2 components. We attempt to find a point on the first component

 i13 : pt1 = randomPointOnRationalVariety compsJ_0 o13 = | -42 12 -9 -46 -17 -41 -23 -6 12 -38 21 -11 19 -29 -3 -22 -16 -13 -8 ----------------------------------------------------------------------- 19 -10 -29 -29 -24 | 1 24 o13 : Matrix kk <--- kk i14 : F1 = sub(F, (vars S)|pt1) 2 2 2 o14 = ideal (a + 12b*c - 46c - 38a*d - 17b*d + 12c*d - 42d , a*b - 3b*c + ----------------------------------------------------------------------- 2 2 2 21c - 22a*d - 11b*d - 41c*d - 9d , a*c - 10b*c - 16c - 29a*d - 13b*d ----------------------------------------------------------------------- 2 2 2 2 + 19c*d - 23d , b - 29b*c - 8c - 24a*d + 19b*d - 29c*d - 6d ) o14 : Ideal of S i15 : decompose F1 2 2 2 o15 = {ideal (a - 10b - 16c - 41d, b - 29b*c - 8c - 19b*d - 9c*d + 20d ), ----------------------------------------------------------------------- ideal (c - 29d, b + 16d, a - 20d)} o15 : List

We attempt to find a point on the second component in parameter space, and its corresponding ideal.

 i16 : pt2 = randomPointOnRationalVariety compsJ_1 o16 = | -6 -13 21 -15 -31 6 -9 -1 50 -39 -18 21 -39 31 -31 44 -18 -13 -47 21 ----------------------------------------------------------------------- 34 19 39 0 | 1 24 o16 : Matrix kk <--- kk i17 : F2 = sub(F, (vars S)|pt2) 2 2 2 o17 = ideal (a + 50b*c - 15c - 39a*d - 31b*d - 13c*d - 6d , a*b - 31b*c - ----------------------------------------------------------------------- 2 2 2 18c + 44a*d + 21b*d + 6c*d + 21d , a*c + 34b*c - 18c + 19a*d - 13b*d ----------------------------------------------------------------------- 2 2 2 2 - 39c*d - 9d , b + 39b*c - 47c + 21b*d + 31c*d - d ) o17 : Ideal of S i18 : decompose F2 2 2 2 o18 = {ideal (a*c + 34b*c - 18c + 19a*d - 13b*d - 39c*d - 9d , b + 39b*c - ----------------------------------------------------------------------- 2 2 2 47c + 21b*d + 31c*d - d , a*b - 31b*c - 18c + 44a*d + 21b*d + 6c*d + ----------------------------------------------------------------------- 2 2 2 2 21d , a + 50b*c - 15c - 39a*d - 31b*d - 13c*d - 6d )} o18 : List

It turns out that this is the ideal of 2 skew lines, just not defined over this field.

## Caveat

This routine expects the input to represent an irreducible variety