I know the Sigma Algebra generated by a random variable $X: (\Omega, \mathcal{F}) \to (I, \mathcal{A})$, can be defined as $\{ Y \in \mathcal{F} \mid \exists B \in \mathcal{A}(Y = X^{-1}(B)) \}$. However, I think my professor has somewhat implicitly mentioned that when I is a countable space, and $\mathcal{A} = P(I)$, the generated Sigma Algebra is $\sigma(\cup_{i \in \mathbb{N}} \{ X =i \})$, where $\{ X = i\}$ is all the s in $\Omega$ s.t $X(s) = i$
This is what I recalled of how he defined it as he never really write down the exact definition, and I'm not sure if it's even true or not. If it is, I cannot really see why would these two definition coincide, as the latter is not really considering all event. I guess it might be true in the case of I is a countable space, but I doubt it would be true in general. So are these definitions equal in this case, and in general?