I'm studying the book Noise Sensitivity of Boolean Functions and Percolation by C. Garban and J.E. Steif and in Chapter 9, when presenting the Spectral Probability, they state that knowing that the 2-dimensional marginals of two distributions are equal is useful when applying second moment arguments. This and some calculations in the Chapter suggests me that there is some way to describe the second moment in terms of the 2-dimensional marginals, which i'm missing.
More precisely, let $A\subseteq \{1,\dots,n\}$ be a random set which we sample according to $\mathbb{P}$. If $|A|$ denotes the cardinality of the set $A$, then $$ \mathbb{E}|A|=\mathbb{E}[\sum_{i=1}^n\mathbb{1}_{A}(i)]=\sum_{i=1}^n\mathbb{P}(i\in A), $$ that is, we can describe the expectation in terms of the 1-dimensional marginals $\mathbb{P}(i\in A)$. So my question is
Is there a similar way to describe $\mathbb{E}[|A|^2]$ in terms of $\mathbb{P}(i,j\in A)$?
just noticed that $$ \mathbb{E}[|A|^2]=\mathbb{E}[\sum_{i,j}\mathbb{1}_{A\times A}(i,j)]=\sum_{i,j}\mathbb{P}((i,j)\in A\times A)=\sum_{i,j}\mathbb{P}(i,j\in A). $$