I am trying to follow the proof of the Borel-Cantelli lemma as shown below:
Could you please explain me how to go from:
Thus $\sum \limits_{n = 1}^{\infty} 1_{A_n}$ is almost surely finite
to:
Hence $P(A) = 0$
In other words, could you please explain the relationship between the set $A$ and the function $\sum \limits_{n = 1}^{\infty} 1_{A_n}$ ?
Thank you very much for your help!

You have : \begin{align} \sum_{n = 0}^\infty 1_{A_n}(\omega) = \infty &\Longleftrightarrow 1_{A_n}(\omega) = 1 \text{ for infinitely many } n \\ &\Longleftrightarrow \omega\in A_n \text{ for infinitely many } n \\ &\Longleftrightarrow \omega \in A \end{align}
Therefore, if $\mathbb P(\sum_{n=0}^\infty 1_{A_n} < \infty) = 1$, you have $\mathbb P(A)= 0$.