[proofplan]
The proof uses only the defining pointwise values of an indicator. First, the expectation of $X=\mathbb{1}_A$ is the integral of an indicator over the [probability space](/page/Probability%20Space), hence equals $\mathbb P(A)$. Next, the identity $r^2=r$ for $r\in\{0,1\}$ gives $X^2=X$ pointwise, so the second moment is the same as the first. Finally, substituting these two moments into the variance identity gives the stated formula.
[/proofplan]
custom_env
admin
[step:Compute the expectation by integrating the indicator over $A$]Define $p \in [0,1]$ by $p:=\mathbb P(A)$. Since $A\in\mathcal F$, the indicator map $X=\mathbb{1}_A: (\Omega,\mathcal F)\to(\mathbb R,\mathcal B(\mathbb R))$ is measurable and bounded. Hence $X$ is integrable with respect to $\mathbb P$. By [citetheorem:10139], applied to the [measure space](/page/Measure%20Space) $(\Omega,\mathcal F,\mathbb P)$ and the measurable set $A$, we have
\begin{align*}
\mathbb E[X]=\int_\Omega \mathbb{1}_A\,d\mathbb P=\mathbb P(A)=p.
\end{align*}[/step]
custom_env
admin
[guided]Define $p \in [0,1]$ by $p:=\mathbb P(A)$. The event $A$ belongs to $\mathcal F$, so the indicator $X=\mathbb{1}_A$ is the measurable map
\begin{align*}
X: (\Omega,\mathcal F) \to (\mathbb R,\mathcal B(\mathbb R))
\end{align*}
given by $X(\omega)=1$ when $\omega\in A$ and $X(\omega)=0$ when $\omega\notin A$. Since $0\le X\le 1$ pointwise, $X$ is bounded and therefore integrable with respect to the [probability measure](/page/Probability%20Measure) $\mathbb P$.
Expectation of a real-valued integrable [random variable](/page/Random%20Variable) is its integral over the probability space. Thus
\begin{align*}
\mathbb E[X]=\int_\Omega X\,d\mathbb P=\int_\Omega \mathbb{1}_A\,d\mathbb P.
\end{align*}
Now [citetheorem:10139] applies because $(\Omega,\mathcal F,\mathbb P)$ is a measure space and $A\in\mathcal F$. It gives
\begin{align*}
\int_\Omega \mathbb{1}_A\,d\mathbb P=\mathbb P(A).
\end{align*}
Therefore
\begin{align*}
\mathbb E[X]=\mathbb P(A)=p.
\end{align*}[/guided]
custom_env
admin
[step:Use the pointwise idempotence of indicators to compute the second moment]
Define $X^2: \Omega\to\mathbb R$ by $X^2(\omega):=X(\omega)^2$. For every $\omega\in\Omega$, the value $X(\omega)$ belongs to $\{0,1\}$, so $X(\omega)^2=X(\omega)$. Hence $X^2=X$ pointwise, and therefore
\begin{align*}
\mathbb E[X^2]=\mathbb E[X]=p.
\end{align*}
[/step]
custom_env
admin
[step:Substitute the two moments into the variance identity]
Since $X$ is bounded, $X$ is square-integrable. By the definition of variance,
\begin{align*}
\operatorname{Var}(X)=\mathbb E[X^2]-(\mathbb E[X])^2.
\end{align*}
Using $\mathbb E[X^2]=p$ and $\mathbb E[X]=p$, we obtain
\begin{align*}
\operatorname{Var}(X)=p-p^2=p(1-p)=\mathbb P(A)(1-\mathbb P(A)).
\end{align*}
Together with the first two moment computations, this proves all three asserted identities.
[/step]