Transformation from one space to another and keep a custom sorting rule

107 Views Asked by At

I wasn't sure if this is the appropriate StackExchange site, but I feel it is the closest one to my problem.

My problem includes a transformation from a finite subset of $\mathbb Z^n$ to $\mathbb Z$ that my custom sorting rule still applies. Let me give you an example of a simplified version of $\mathbb Z^4$.

Let's say that we have a vector $(x,y,z,w)\in\mathbb Z^4$ where

  • $0\le x\le30$
  • $0\le y\le100$
  • $5\le z\le10$
  • $0\le w\le10000$

The sorting rule works like this: if

  • $a_1=(x_1,y_1,z_1,w_1)$
  • $a_2=(x_2,y_2,z_2,w_2)$
  • $a_3=(x_3,y_3,z_3,w_3)$

then $a_1\le a_2 \le a_3$ only if

  • $x_1\le x_2\le x_3$
  • $y_1\le y_2\le y_3$
  • $z_1\le z_2\le z_3$
  • $w_1\le w_2\le w_3$

Question 1

The problem looks like that: I want to find a function $f(x,y,z,w) = k \in \mathbb Z$ such that $f(a_1) \le f(a_2) \le f(a_3) \implies a_1\le a_2 \le a_3$.

In practice, if I know only the $k_1$ and $k_3$ and one gives me the $x_2,y_2,z_2,w_2$, I will use the function to get the $k_2$ and compare them with the $k_1$ and $k_3$.

Question 2

What if the sorting rule has a few parameters $=$ instead of $\le$, like

  • $x_1\le x_2\le x_3$
  • $y_1\le y_2\le y_3$
  • $z_1\le z_2\le z_3$
  • $w_1 = w_2 = w_3$

How does this affect the function?

Question 3

Can we extend the above to $\mathbb Z^n$ where $n \le 100$?

1

There are 1 best solutions below

2
On BEST ANSWER

Notice that your question is equivalent to $f(a_1)\leq f(a_2) \implies a_1 \leq a_2$.

Such an $f$ would have to be injective. Indeed, if $f(a_1) = f(a_2) \iff f(a_1)\leq f(a_2)$ and $f(a_2)\leq f(a_1)$ then $a_1 \leq a_2$ and $a_2 \leq a_1 \iff a_1 = a_2$.

Hence, whenever $a_1 \neq a_2$, $f(a_1) \neq f(a_2)$ and since $\mathbb Z$ is totally ordered we would necessarily have (relabeling if necessary) $f(a_1) < f(a_2)$. But the order you imposed on $\mathbb Z^n$ is partial, and so whenever $a_1$ and $a_2$ are incomparable, the property you wish for will fail.