mapStratify(f,X,Y)
For a polynomial map $f:X\to Y$ this command computes a Whitney stratification of $f$, that is a Whitney stratification of $X$ and of $Y$ (in the same output format as the whitneyStatify command), such that for each (open, connected) strata $M$ of $X$ there is an (open, connected) strata $N$ of $Y$ such that $f(M) \subset N$ and such that the restriction of $f$ to $M$ is a submersion. When $f$ is a proper map this stratification turns $f$ into a locally trivial fiber bundle by Thom's isotopy lemma. More generally when $f$ is a dominant map between varieties of the same dimension a stratification which further stratifies by nonproperness locus is also implemented (as described in Section 3.3 of [2], M. Helmer, V. Nanda, Effective Whitney Stratification of Real Algebraic Varieties . Arxiv: 2307.05427). This can be used to, for example, solve the real root classification problem (see Section 5 of [2]), that is to stratify the parameter space of a parametric system of polynomials with generically finitely many complex solutions into regions where the number of real solutions is fixed.
We illustrate this on the quadratic equation $ax^2+bx+c$ by stratifying the parameter space, $(a,b,c)\in \RR^3$, into regions where the number of real roots is constant.
Here we stratify the projection map $X\to \RR^3$ where $X=V(ax^2+bx+c)$.







For this and other root classification examples the option isProper=>false should be used, as the corresponding projection maps are in general not proper. Note that the top dimensional strata in this case are the four connected components of $\RR^3V(a(b^24ac))$, and so on for the lower dimensional strata.
Another root classification example, this time we find the regions of the parameter space $\{(a,b)\in \RR^2\}$ where the number of real roots to the system $x^2y^2+b = ax+x^2+by=0$ is constant; this is Example 1.2 in Reference [2].






Another broad class of interesting examples is parameterized projective varieties, as the projection map to the parameter space is induced by the projection $\PP^n\times \CC^m\to \CC^m$ and is hence always proper. Again we seek to understand how the topology of the variety changes with parameters. The following example is a special case of an example from the study of Feynman integrals in mathematical physics (in particular is arises from the "one loop bubble" for the case of equal masses). Note that for any fixed value of parameters M1, P, the resulting polynomial Gh is homogeneous.









Finally we remark that the option: StratsToFind, may be used with this function, but should only be used with care. The default setting is StratsToFind=>"all", and this is the only value of the option which is guaranteed to compute the complete stratification, the other options may fail to find all strata but are provided to allow the user to obtain partial information on larger examples which may take too long to run on the default "all" setting. The other possible values are StratsToFind=>"singularOnly", and StratsToFind=>"most". The option StratsToFind=>"singularOnly" is the fastest, but also the most likely to return incomplete answers, and hence the output of this command should be treated as a partial answer only. The option StratsToFind=>"most" will most often get the full answer, but can miss strata, so again the output should be treated as a partial answer. In the example below all options return the complete answer, but only the output with StratsToFind=>"all" should be considered complete; StratsToFind=>"all" is run when no option is given.






The object mapStratify is a method function with options.