Statistical notation question: How do I represent sorting variables, individually and by each other, symbolically? I'd like to write a formula for a correlation coefficient that involves sorting continuous observations, both within a variable and by another variable. For example, I'd like to say that $r$ is computed between $X$ sorted by $-Y$, and $Z$ sorted by itself, all ascending. My naïve notation for these terms is $sort(X|-Y)$ and $sort(Z)$, specifying separately that both sorts are in ascending order. But, is there a standard statistical or mathematical notation I can use?
For what it's worth, I've considered using the ranks of variables as indices in the actual correlation formula. That seems awkward, though, and still wouldn't let me refer to each variable, individually and symbolically, in the text. Thanks!

Maybe the most standard option would be:
$$X'_i = \pi_2((-Y,X)_{(i)}),\ Z'_i = Z_{(i)}, \ r = \text{corr}(X',Z')$$
where ${(i)}$ is a standard subscript for the $i^{th}$ sorted element and $\pi_2$ is standard for projection onto the second axis.
My reaction to this would be: "I guess they want $(-Y,X)$ sorted lexicographically, but why?"
