An example of a finite measure space $X$ such that $L^2(X,d\mu)$ is not separable I am stuck on one solution on one of Reed & Simon's functional analysis exercises (problem II.25):

Find a finite measure space $(M,R,\mu)$ with $\mu(M)<\infty$ and $L^2(M,d\mu)$ nonseparable.

And the solution goes as follows:
Let $M=\{f:[0,1]\to \{-1,1\}\}=2^{[0,1]}$. Let $x_1,...,x_n\in [0,1]$ and let $\epsilon_1,...,\epsilon_n\in \{-1,1\}$. Define the set
$$A(x_1,...,x_n|\epsilon_1,...,\epsilon_n)=\{f\in M: f(x_i)=\epsilon_i, i=1,...,n\}.$$
Let $R$ be the $\sigma$-algebra generated by these sets, i.e. $R$ is the smallest $\sigma$-algebra which contains all
$$\{A(x_1,...,x_n|\epsilon_1,...,\epsilon_n):n\in\mathbb{N}, x_i\in [0,1],\epsilon_i\in\{-1,1\}\}.$$
Define
$$\mu(A(x_1,...,x_n|\epsilon_1,...,\epsilon_n))=2^{-n}.$$
Then the claim is that $\mu$ is a probability measure on $M$. Now consider the Hilbert space $L^2(M,R,d\mu)$. It is not separable since if we consider the functions
$$\varphi_{x_1,...,x_n}(f)=\prod_{i=1}^n f(x_i)\qquad n\in\mathbb{N}, x_i\in[0,1],$$
then they form an orthonormal set under the inner product of $L^2$: Let $A=\{x_1,...,x_n\},B=\{y_1,...,y_m\}$
$$
(\varphi_A,\varphi_B)=\int_M \varphi_A(f)\varphi_B(f) d\mu(f)=\int_M \varphi_{A\Delta B}(f)d\mu(f)
$$
which is 1 if $A\Delta B=\emptyset$ and 0 otherwise. But this is uncountable.
My questions:

*

*Why is $\mu$ a probability measure on $M$? i.e. why does $\mu(M)=1$?

*Why is the last step true (the one about inner product of $\varphi_A,\varphi_B$)?

*This is a bit boring, but I'm not even sure if $\mu$ is a measure at all...

Thanks in advance!
 A: 
Why do we have $\mu(M)  =1$ ?

We have $M  =A\left(\frac 12\middle|1\right) \sqcup A\left(\frac 12\middle|-1\right)$. Therefore, assuming for now that $\mu$ is a measure, we have :
$$\mu(M) = \frac 12 + \frac 12  = 1$$

What is the inner product of $\varphi_A$ and $\varphi_B$ ?

We have :
\begin{align}
\varphi_A(f)\varphi_B(f) &= \prod_{x\in A}f(x) \prod_{x\in B} f(x) \\
&= \prod_{x\in A\backslash B} f(x) \prod_{x\in A\cap B} f(x)^2 \prod_{x\in B\backslash A} f(x) \\
&= \prod_{x\in A\backslash B \cup B\backslash A} f(x) \\
&= \varphi_{A\Delta B} (f)
\end{align}
since $f(x)^2 = 1$.
Therefore :
\begin{align}
(\varphi_A,\varphi_B) &= \int_M \varphi_{A\Delta B}(f) \mu(\text df) \\
&= \mu\Big(\varphi_{A\Delta B}^{-1}(\{1\} )\Big)  - \mu \Big(\varphi_{A\Delta B}^{-1}(\{-1\})\Big)
\end{align}
If $A\Delta B = \emptyset$, then $\varphi_{A\Delta B} = 1$ and the integral is equal to $1$.
If $\operatorname{Card}(A\Delta B) = n >0$, then $\varphi^{-1}_{A\Delta B}(\{1\})$ is the disjoint union of $2^{n-1}$ sets of the form $A(x_1,\ldots,x_n|\epsilon_1,\ldots,\epsilon_n)$ with $A\Delta B = \{x_1,\ldots,x_n\}$ and $\prod_{i=1}^n \epsilon_i = +1$. The same is true for $\varphi^{-1}_{A\Delta B}(\{-1\})$ but with $\prod_{i=1}^n\epsilon_i = -1$. In this case, we have : $$\int_M \varphi_{A\Delta B}(f)\mu(\text df) = \frac 12 - \frac 12 = 0$$

How is the measure $\mu$ defined ?

$\mu$ can be defined by the standard construction (used to construct the Lebesgue measure, for example), using an outer measure. We will need a version of Carathéodory's theorem which is proved in those lecture notes , specifically :

Definition 6.3.4 Let $X$ be a non-empty set and $\mathcal{R}$ a non-empty collection of subsets of $X$. We call $\mathcal{R}$ a semi-algebra if the following conditions are satisfied:(i) If $R, S \in \mathcal{R}$, then $R \cap S \in \mathcal{R}$.
(ii) If $R \in \mathcal{R}$, then $R^{c}$ is a a disjoint union of sets in $\mathcal{R}$.


Theorem 6.3.6 : Let $\mathcal R$ be a semi-algebra of subsets of $X$ and assume that $\lambda : \mathcal R\to \mathbb R_{\geq 0}$ is a function such that :
(i) if a set $R \in \mathcal{R}$ is a disjoint, finite union $R=\bigsqcup_{i=1}^{n} R_{i}$ of sets in $\mathcal{R}$, then
$$
\lambda(R)=\sum_{i=1}^{n} \lambda\left(R_{i}\right)
$$
(ii) If a set $R \in \mathcal{R}$ is a disjoint, countable union $R=\bigsqcup_{i \in \mathbb{N}} R_{i}$ of sets in $\mathcal{R}$, then
$$
\lambda(R)=\sum_{i=1}^{\infty} \lambda\left(R_{i}\right)
$$
Then $\lambda$ has an extension to a complete measure on a $\sigma$-algebra containing $\mathcal{R}$.

Let $\mathcal R$ be the collection of subsets of the form $A(x_1,\ldots,x_n|\epsilon_1,\ldots,\epsilon_n)$ (as well as $M$) and $\lambda: \mathcal R \to \mathbb R_{\geq 0}$ be defined by :
$$\lambda(A(x_1,\ldots,x_n|\epsilon_1,\ldots,\epsilon_n)) = \frac{1}{2^n}$$
and $\lambda(M) = 1$ (which is the formula above with $n=0$).
If $X,Y\subset [0,1]$ are finite subset and $\chi_1 : X\to \{-1,1\}$, $\chi_2:Y\to \{-1,1\}$ then (see edit at the end) :
$$A(X|\chi_1)\cap A(Y|\chi_2) = \left\{\begin{array}{cl} 
A(X\cup Y|\chi) & \text{if } \chi_1|_{X\cap Y} = \chi_2|_{X\cap Y}\\
\emptyset &\text{else}
\end{array}\right.$$
In the first case, $\chi: X\cup Y\to \{-1,1\}$ is defined by $\chi|_X = \chi_1$ and $\chi|_Y = \chi_2$.
So $\mathcal R$ is closed under finite intersections. Furthermore, if $X\subset[0,1]$ is finite  and $\chi:X\to \{-1,1\}$, we have :
$$A(X|\chi)^c = \bigsqcup_{\underset{\psi\neq\chi}{\psi:X\to \{-1,1\}}} A(X|\psi)$$
Let $R = \bigsqcup_{i=1}^n R_i$ with $R,R_i \in \mathcal R$. Write $R = A(X|\chi)$ and $R_i = A(X_i|\chi_i)$ with $\chi:X\to \{-1,1\}$ and $\chi_i:X_i\to \{ -1,1\}$.
First, it is clear that $X_i\subset X$ for all $i\in\mathbb N$ and that $\chi_i|_X = \chi$. Let $Y  =\bigcup_{i=1}^n X_i$ and identify the functions which are equal on $Y^c$. There are $2^{|Y|}$ equivalence classes and $2^{|Y|-|X|}$ of them are subsets of $R$. Each $R_i$ contains $2^{|Y|-|X_i|}$ equivalence classes. Because this is a partition of the equivalence classes, we have :
$$2^{|Y|-|X|} = \sum_{i=1}^n 2^{|Y|-|X_i|}$$
and therefore :
$$\lambda(X) = \sum_{i=1}^n \lambda(X_i)$$
Now, let us show that $(ii)$ is vacuously satisfied as there is no infinite countable pair-wise disjoint family $(R_i)_{i \in \mathbb N}$ of elements of $\mathcal R$ such that $R=\bigsqcup_{i \in \mathbb{N}} R_{i}$ is in $\mathcal{R}$. By contradiction, let $(R_i)$ be such a family. Write $R = A(X|\chi)$ and $R_i = A(X_i|\chi_i)$ with the $X,X_i$ finite subsets of $[0,1]$ and $\chi:X\to \{-1,1\}$, $\chi_i:  X_i\to \{-1,1\}$. Without loss of generality, we can assume $X_i\subset X_{i+1}$, because we can always write $R_{i+1}$ as a finite disjoint unions of sets of the form $A(X_i\cup X_{i+1}|\ldots)$.
Then, let us construct $f \in R\backslash \bigcup_{i\in\mathbb N} R_i$. Let $f|_X = \chi$. We have $X\subset X_0$. Consider the set of functions $\{\chi_i|_{X_0\backslash X} : i\in \mathbb N \text{ s.t. } X_i = X_0\}$. If this set is equal to $\{-1,1\}^{X_0\backslash X}$, then there is a finite number of the $R_i$ whose union is equal to $R$, which is a contradiction. Otherwise, we can extend $f$ to $X_0$ such that if $X_i = X_0$, then $\chi_i \neq f$.
Continuing this process by induction, we obtain a function $f:\bigcup_{i\in\mathbb N} X_i \to \{-1,1\}$, which we extend arbitrarily to $f:[0,1]\to \{-1,1\}$ such that for any $i\in\mathbb N$, $f|_{X_i} \neq \chi_i$, but $f|_X = \chi$. In other words, $f \in R\backslash \bigcup_{i\in\mathbb N} R_i$.
We have verified all the properties necessary to use Carathéodory's theorem above, so we see that $\mu$ is a well-defined measure on the $\sigma$-algebra generated by $\mathcal R$.
Edit : for completeness and clarity, let me give the explicit definition of the generalization of OP's notation I introduced : if $X\subset [0,1]$ is a finite subset and $\chi:X\to \{-1,1\}$, then $A(X|\chi)= M$ if $X = \emptyset$ and, if $X = \{ x_1,\ldots,x_n\}$ :
$$A(X|\chi) = A(x_1,\ldots,x_n|\chi(x_1),\ldots,\chi(x_n))$$
