In the book I'm reading (A modern approach to probability theory by Fristedt and Gray) there is a claim in a proof that given an $\mathbb Z^d$ valued RV there exists $\{1,...,d \} $ valued random variables $Z_1\le Z_2\le...\le Z_n$ such that $Y=\sum_{k=1}^n e_{Z_k}$ where $e_{Z_k } $ denotes the $Z_k $:th standard basis vector for $\mathbb R^d $ (or $\mathbb Z^d $).
I do not now how to motivate this. All i know is that given an $\mathbb Z^d $ valued RV it's coordinate maps are random variables (that is measurable) as well.
Any help would be appriciated!