I'd say this question is rather in the domain of computer science. I would typically address this problem like this
Let $\textbf{V} \in F^n$ be an $n$-dimensional vector of some field $F$. $\textbf{V}$ can be additionally represented as an enumerated list (AKA array), such that each dimension of $\textbf{V}$ is enumerated by an integer from $0$ to $n-1$.
Notation 0: For ever vector $\textbf{V}$, let dim($\textbf{V}$) be its dimension, that is, the number of its elements.
Notation 1: Let $\textbf{V}[i]$ be the $i$-th element of $\textbf{V}$, the element corresponding to the $i$-th enumerated dimension, such that $\textbf{V}[i] \in F$ and i $\in \mathbb{Z}$, $i \in [0, n)$
Notation 2: An index vector can be defined as $\textbf{IND}_n \in \mathbb{Z}^m$, such that $\textbf{IND}_n[i] \in [0, n) \; \; \forall i \in [0, m)$
Notation 3: We can also use index vectors as indices for other vectors. Let $\textbf{W} = \textbf{V}[\textbf{IND}_n]$ be another vector, such that $W \in F^m$, where $m = \mathrm{dim}(\textbf{IND}_n)$. In particular, $\textbf{W}[i] = \textbf{V}[\textbf{IND}_n[i]] \; \; \forall i \in [0, m)$
Finally, we need to define a function that finds unique elements. I have never seen it having a particular notation. In matlab, for example, a similar function is simply called "unique". Usually people just define a function and explain what it does. We will define a function UniqueIndex$(\textbf{V})$, which will return a vector of indices of $\textbf{V}$, which will correspond to the indices of the unique elements of $\textbf{V}$. We must also specify their order. For example, we will require that all repeating elements of $\textbf{V}$ will be skipped, but the order of the first occurrences of each element will be preserved.
Then, we can find our indices using
$\textbf{IND}_n$ = UniqueIndex$(\textbf{V})$
We can find the vector of unique elements
$\textbf{V}^* = \textbf{V}[\textbf{IND}_n]$
If we have another vector $\textbf{P}$, elements of which correspond to the elements of $\textbf{V}$ in the same order, the elements of the reduced vector $\textbf{P}^* = \textbf{P}[\textbf{IND}_n]$
This is more or less exactly what you would to in Python to actually perform this operation
Best Answer
is a very mathematical description. Don't confuse lack of formulas for lack of mathematics. Personally, I would maybe write it a little differently, but that's mostly just to remove any potential for misinterpretation. For instance, saying that the matrix is diagonal, and explicitly stating that the non-zero entries are $1$ is a bit clearer than saying "contains like the identity matrix". At least to people who are used to reading mathematical texts.
Here is my suggestion:
Alternately, if you really want some formulas, one can use matrix algebra to say