I am trying describe a recursive function with two return values. The two values are returned as a vector, and I am wondering how to notate the indexing of one element of the returned vector.
Now if my function $f(x)$ returns a vector i.e. $ [2, 1] $ and I want to receive the first element, can I write it as $ f(x)_1 $ and for the second element $ f(x)_2 $?
It seems that you consider a function $f : X \to \mathbb R^2$ defined on some unspecified set $X$. The points $y \in\mathbb R$ are usually written in the form $y = (y_1,y_2)$ with $y_1,y_2 \in \mathbb R$, thus it is okay to write $f(x) = (f(x)_1,f(x)_2)$. However, this is somewhat unusual. The standard way is to write $f(x) = (f_1(x),f_2(x))$ where $f_1, f_2 : X \to \mathbb R$ are the two coordinate functions of $f$.