# Singular

#### D.2.4.11 ConsLevels

Procedure from library `grobcov.lib` (see grobcov_lib).

Usage:
ConsLevels(list L);
L=[[P1,Q1],...,[Ps,Qs]] is a list of lists of of pairs of ideals represening the constructible set S=V(P1)\ V(Q1) u ... u V(Ps)\ V(Qs).
To be called in a ring Q[a][x] or a ring Q[a]. But the ideals can contain only the parameters in Q[a].

Return:
The list of ideals [a1,a2,...,at] representing the closures of the canonical levels of S and its complement C wrt to the closure of S. The canonical levels of S are represented by theirs Crep. So we have: Levels of S: [a1,a2],[a3,a4],...
Levels of C: [a2,a3],[a4,a5],...
S=V(a1)\ V(a2) u V(a3)\ V(a4) u ...
C=V(a2\ V(a3) u V(a4)\ V(a5) u ...
It is used internally by locus procedure.
The expression of S can be obtained from the output of ConsLevels by the call to ConsLevelsToLevels.

Note:
Th ring can be Q[a][x] or Q[a], but the ideals can only contain parmeters in Q[a]. The algorithm is described in
J.M. Brunat, A. Montes. "Computing the canonical representation of constructible sets." Math. Comput. Sci. (2016) 19: 165-178.

Example:
 ```LIB "grobcov.lib"; if(defined(R)){kill R;} ring R=0,(x,y,z),lp; short=0; ideal P1=x*(x^2+y^2+z^2-1); ideal Q1=z,x^2+y^2-1; ideal P2=y,x^2+z^2-1; ideal Q2=z*(z+1),y,x*(x+1); list Cr1=Crep(P1,Q1); list Cr2=Crep(P2,Q2); list L=list(Cr1,Cr2); L; ==> [1]: ==> [1]: ==> _[1]=x^3+x*y^2+x*z^2-x ==> [2]: ==> _[1]=z ==> _[2]=x^2+y^2-1 ==> [2]: ==> [1]: ==> _[1]=y ==> _[2]=x^2+z^2-1 ==> [2]: ==> _[1]=z^2+z ==> _[2]=y ==> _[3]=x+z+1 ConsLevels(L); ==> [1]: ==> _[1]=x^3+x*y^2+x*z^2-x ==> [2]: ==> _[1]=z ==> _[2]=x^2+y^2-1 ==> [3]: ==> _[1]=z ==> _[2]=y ==> _[3]=x-1 ==> [4]: ==> _[1]=1 ```