[Math] How to access an element of a set

elementary-set-theorynotation

Let us say that I have a set $A=\{1,2, 3\}$. Now I need to access, say, the element $3$ of $A$. How do I achieve this?

I know that sets are unordered list of elements but I need to access the elements of a set. Can I achieve this with a tuple? Like $A=(1, 2, 3)$, should I write $A(i)$ to access the i-th element of $A$? Or is there any other notation?

If I have a list of elements, what is the best mathematical object to represent it so that I can freely access its elements and how? In programming, I would use arrays.

Best Answer

You are speaking of the index operator one often finds in programming when using arrays. Given that sets are unordered, it does not make sense to do this with sets, as $\{1,2\}=\{2,1\}$.

You probably want to use a tuple, which is just a (finite) sequence of elements, and is denoted as you wrote $A$. If $A=(1,2,3)$ is a tuple, then I think the most common way to index it is to use subscripts - so $A_1=1$ and $A_2=2$ and so on, though one sometimes sees $A(1)$ and $A(2)$ as well, since one can think of $A$ as a function from the set $\{1,2,3\}$ to $\mathbb R$. Occasionally, one even sees $A^1$ and $A^2$. Really, what matters is that you are consistent and clear in how you write indexing.