The variance of a random variable $X$ is defined as:
$$ \text{var}(X) = \mathbb{E}[(X - \mathbb{E}[X])^2] $$
And the definition of expectation for a discrete random variable is:
$$ \mathbb{E}[X] = \sum_{i=1}^{n} x_i \cdot \mathbb{P}(\{X=x_i\}) $$
Combining these two equations and letting $\mathbb{E}[X] = \mu$, I would have said that variance for a discrete random variable $X$ is:
$$ \begin{align} \text{var}(X) &= \mathbb{E}[(X - \mathbb{E}[X])^2] \\ &= \sum_{i=1}^{n} (x_i - \mu)^2 \cdot \mathbb{P}(\{X = (x_i - \mu)^2\}) \\ \end{align} $$
But Wikipedia states that the correct formulation is:
$$ = \sum_{i=1}^{n} (x_i - \mu)^2 \cdot \mathbb{P}(\{X = x_i) $$
What am I missing? Assuming my thinking is correct, this would suggest that:
$$ \mathbb{P}(\{X = (x_i - \mu)^2\}) = \mathbb{P}(\{X = x_i) $$
My inclination is that the above equation is true since $\mu$ and squaring are both non-random.