$f : [N] \to {\mathbb{C}}$ onto $\mathcal{B}$ by $$\label{conditional expectation}
\Pi_{\mathcal{B}} f(x) = \frac{\sum_{B \in \mathcal{B}} 1_B(x) \sum_{y \in B} f(y)}{\sum_{B \in \mathcal{B}} 1_B(x) \sum_{y \in B} 1_{[N]}(y)}.$$ Notice that $\Pi_{\mathcal{B}} f$ is $\mathcal{B}$-measurable, and is just the conditional expectation of $f$ with respect to the $\sigma$-algebra generated by the elements of $\mathcal{B}$.

We record some well-known properties of the projection operator $\Pi_{\mathcal{B}}$ (that is, properties of conditional expectation) in the next lemma.

\[properties\] [ ]{}

1.  \[projection part\] The operator $\Pi_{\mathcal{B}}$ linearly projects onto the space of $\mathcal{B}$-measurable functions.

2.  \[adjoint part\] $\Pi_{\mathcal{B}}$ is self-adjoint with respect to the inner product $${\left\langlef, g\right\rangle} := \sum_x f(x) \overline{g(x)} \qquad (f, g : [N] \to {\mathbb{C}}),$$ so that ${\left\langlef, \Pi_{\mathcal{B}}g\right\rangle} = {\left\langle\Pi_{\mathcal{B}} f, g\right\rangle}$.

3.  If $\mathcal{B}'$ is a refinement of $\mathcal{B}$ then $$\Pi_{\mathcal{B}'}\Pi_{\mathcal{B}}f  = \Pi_{\mathcal{B}}f. $$

4.  \[orthog part\] If $\mathcal{B}'$ refines $\mathcal{B}$ then $\Pi_{\mathcal{B}}f $ is orthogonal to $\Pi_{\mathcal{B}'}f  - \Pi_{\mathcal{B}}f $.

Inspecting the formula reveals that $\Pi_{\mathcal{B}}$ is linear, that $\Pi_{\mathcal{B}}f$ is constant on elements of $\mathcal{B}$, and that if $f$ itself is constant on elements of $\mathcal{B}$, then $\Pi_{\mathcal{B}}f = f$. This establishes .

Interchanging the order of summation gives $$\begin{split}
{\left\langlef, \Pi_{\mathcal{B}}g\right\rangle} = \sum_{B \in \mathcal{B}} 