-- Dual varieties: -- construction of the dual to a hypersurface; -- example 11.11 R = QQ[x,y,z] -- examples below are for curves in P^2, but all steps work for an arbitrary R D = (coefficientRing R)[gens R / (x->p_x)] describe D RD = (coefficientRing R)[gens R, gens D] describe RD use R d = 3 F = x^d+y^d+z^d -- F = random(d,R) -- experiment with a random hypersurface: is it smooth? is the dual smooth? grad = diff (vars R, F) -- partial derivatives I = ideal sub(F,RD) + ideal(sub(vars D,RD) - sub(grad, RD)) -- I = + n = numgens R J = sub(eliminate(take(gens RD,n), I), D) -- singular locus computation m = ideal gens R sF = ideal F + ideal grad -- defines the singular locus sFsat = saturate(sF, m) -- if this == 1 then V(F) is smooth (projective variety) mD = ideal gens D sJ = J + ideal jacobian J sJsat = saturate(sJ, mD) -- if this == 1 then the dual of V(F) is smooth decompose sJsat