We explain the meaning of the argument p.
Suppose R looks like this:
R = k[ ... vars_0 ... ][ ... vars_1 ... ]...[ ... vars_(n-1) ... ] |
and suppose that I_k = { i | p#i = k }. Then, the target ring S looks like this:
S = k[ ... vars_(I_1) ... ][ ... vars_(I_2) ... ]...[ ... vars_(I_m) ... ] where vars_I = { vars_i | i \in I } |
The length of p must not exceed the number of levels of the ring tower R.
This is because its entries correspond to these levels. The first entry, p#0, tells where to send the The meaning of the argument p is as follows. Recall that m is the largest value that appears in p, appearing, say, in positions {i_1, ..., i_k}. Then, the outermost variables in the target ring S will be those that were adjoined
Here's an example restacking a ring that is four levels deep.
i1 : A=QQ[x,y, Degrees => {{1,2},{1,2}}]/(x^2+y^2); |
i2 : B=A[b]; |
i3 : C=B[p,q]/(p^3-2*q^3); |
i4 : D=C[d]; |
i5 : restackRing({2,3,4,1}, D) QQ[d][x, y] -----------[b][p, q] 2 2 x + y o5 = map(--------------------,D,{d, p, q, b, x, y}) 3 3 p - 2q QQ[d][x, y] -----------[b][p, q] 2 2 x + y o5 : RingMap -------------------- <--- D 3 3 p - 2q |
The following command flattens D completely. (The same can be accomplished with flattenRing.)
i6 : restackRing({1,1,1,1}, D) QQ[x, y, b, p, q, d] o6 = map(--------------------,D,{d, p, q, b, x, y}) 2 2 3 3 (x + y , p - 2q ) QQ[x, y, b, p, q, d] o6 : RingMap -------------------- <--- D 2 2 3 3 (x + y , p - 2q ) |
If the list is shorter than length four, then deeper levels are preserved in the coefficient ring
i7 : restackRing({1,1}, D) B[p, q, d] o7 = map(----------,D,{d, p, q, b, x, y}) 3 3 p - 2q B[p, q, d] o7 : RingMap ---------- <--- D 3 3 p - 2q |
A more complicated surjection
i8 : restackRing({2,1,2,1}, D) QQ[b, d][x, y, p, q] o8 = map(--------------------,D,{d, p, q, b, x, y}) 2 2 3 3 (x + y , p - 2q ) QQ[b, d][x, y, p, q] o8 : RingMap -------------------- <--- D 2 2 3 3 (x + y , p - 2q ) |
Each stage of R may only introduce relations among the most-recent variables. So, in the example, C=B[p,q]/(p^3-2*q^3) was allowed, but C=B[p,q]/(x*p^3-2*y*q^3) would not be.
The object restackRing is a method function.