Is there a math function to find an element in a vector?

Usually this is written as "Let $i$ be such that $x_i = j$." But that's not very compact. There isn't any standard notation for this that I know of. You could use $\arg \max_i [x_i = j ]$ which uses Iverson brackets to make things compact.


If you want to talk about the $3$ in the vector $x=(1,2,3)$ then most people will just denote this element $x_3$ to indicate the third element of the vector.

If you are interested in the function that maps $x\to x_3$ then that function is denoted $\pi_3(x)$ and is called "the projection function (onto the third coordinate)". This function is pretty important in topology.

If you are interested in the function that tells you what index $k$ is, there isn't really a common notation for that because it's not necessarily a function. Besides, even when talking about it as a relation, in almost all circumstances if you know that $x$ contains a $3$, you can also just know which indices are $3$ and which are not as a consequences of knowing what x is


If you consider the vector $x$ as a function from $[1, n]$ to $\mathbb{N}$, you can use the inverse $x^{-1}$. See https://en.wikipedia.org/wiki/Inverse_function#Preimages.

In your example, if $x=(1,4,5,3)$ then $x^{-1} (\lbrace 3 \rbrace) = \lbrace 4 \rbrace$.

As Jonathan Gafar remarked, the inverse set might contain more than one element. Then you can use a minimum to get the first one.

For example, if $x=(1,2,5,7,2)$ then $x^{-1} (\lbrace 2\rbrace)= \lbrace 2, 5 \rbrace$ and $\min x^{-1} (\lbrace 2\rbrace) = 2$.

However, I don't recommend to use this notation without a proper introduction or definition, since the inverse symbol might be ambiguous.