TITLE: Set of a random variable's range is an event in the sample space?
QUESTION [5 upvotes]: My book has the following definition for the range of a random variable.

Since a random variable is defined on a probability space, we can calculate these probabilities given the probabilities of the sample points. Let $a$ be any number in the range of a random variable $X$. Then the set $\{\omega \in \Omega :X(\omega)=a\}$ is an event in the sample space (simply because it is a subset of $\Omega$).

I think I'm misunderstanding the provided notation but to me this expression:
$$\{\omega \in \Omega :X(\omega)=a\}$$
seems to be saying "For each sample point $\omega$ in the sample space $\Omega$, compute $X(\omega)$ and store the result $a$ in the set". If the above expression is saying what I think it says how can we say that a set of $\{X(\omega_1), X(\omega_2),\ldots,X(\omega_{|\Omega|})\}$ is an event in the sample space? Aren't events a subset $\{ \omega_1, \omega_2, \ldots\}$ of $\Omega$ ?

REPLY [2 votes]: In the question, the expression
$$\{\omega \in \Omega :X(\omega)=a\}$$
is interpreted as follows:

For each sample point $\omega$ in the sample space $\Omega$, compute $X(\omega)$ and store the result $a$ in the set.

One fundamental misunderstanding here is the notion that the expression on the right-hand side of the colon contributes any values to the set at all. The only values that can be placed in the set are the values named $\omega$ on the left side of the colon.
The formula $\omega \in \Omega$ says that every value $\omega$ that is a member of the set $\{\omega \in \Omega :X(\omega)=a\}$
must also be a member of $\Omega.$ That is practically the definition of a subset.
What the expression on the right-hand side does is to select the subset of $\Omega$ as follows:

For each sample point $\omega$ in the sample space $\Omega$, compute $X(\omega),$ compare it to the value $a$,
  and if the two values match then that value of $\omega$
  belongs to the set $\{\omega \in \Omega :X(\omega)=a\}.$

In this procedure,  $a$ is value that was already selected from the range of $X$ before we even started to write
$\{\omega \in \Omega :X(\omega)=a\}$; 
during the entire definition of an particular subset $\{\omega \in \Omega :X(\omega)=a\}$ of $\Omega$
only that one single value of $a$ is ever used.