Independence: Discrete Random Variables I am taking my first course in Measure Theory and I am struggling with the following problem:

Consider the following random variables $X_1,\dots,X_k$ for which countable subsets $A_1,\dots,A_k$ are defined such that:
$P(X_j \in A_j)=1\ \  \forall j$
Show that $X_1,\dots,X_k$ are independent iff for all $a_j \in A_j$
$P(X_j=a_j,\forall j)=\prod_{i=1}^{k}P(X_j=a_j)$

I know that the independence of random variables can be written as:
$P(X_j\leq x_j,\forall j)=\prod_{i=1}^{k}P(X_j \leq x_j)$ for $x_j \in \mathbb{R}$
However, I am having trouble taking this into a discrete universe. Thanks in advance for any advice.
Let $Y_j=1_{(X_j=a_j)},j=1(1)k$, then $E(Y_j)=P(X_j=a_j)$. Note that since $X_1, X_2, \dots ,X_k$ are independent then $Y_1, Y_2, \dots , Y_k$ are too.

Now $E(Y_1Y_2\dots Y_k)=E(Y_1)E(Y_2)\dots E(Y_k)$ gives the proof of "only if" part.

Let $B_{ij}=\{X_i=a_j\}$, $a_j\in A_i$. From the expression given, we can conclude that the $\sigma$-algebra generated by $A_j$ are also independent. Then $X_1, X_2, \dots ,X_k$ are independent.
Let $Y_j=1_{(X_j=a_j)},j=1(1)k$, then $E(Y_j)=P(X_j=a_j)$. Note that since $X_1, X_2, \dots ,X_k$ are independent then $Y_1, Y_2, \dots , Y_k$ are too.

Now $E(Y_1Y_2\dots Y_k)=E(Y_1)E(Y_2)\dots E(Y_k)$ gives the proof of "only if" part.

Let $B_{ij}=\{X_i=a_j\}$, $a_j\in A_i$. From the expression given, we can conclude that the $\sigma$-algebra generated by $A_j$ are also independent. Then $X_1, X_2, \dots ,X_k$ are independent.