Existence of a measure with given marginals on product space Let $X_1,...,X_n$, $n\geq 2$ be Polish spaces. I have a given compatible family of probability measures $\{\pi_{ij} \in X_i\times X_j \}$ (here each measure is defined on the space of the form $X_i\times X_j$ for some pair $(i,j)\in \{1,..,n\}^2)$.
Is it always possible to construct measure $\pi$ on $X_1 \times ... \times X_n$ with given projections: $(Proj_{X_i\times X_j})_\#\pi = \pi_{ij}$? If not, are there any known sufficient conditions on a family of marginals?
Does the answer change, if we consider countable number of $X_i$ instead of a finite one?
 A: Not always possible: choose some $X_i$, $X_j$ and $X_k$ with size at least $2$, assume without loss of generality that $X_i$, $X_j$ and $X_k$ contain $\{-1,1\}$. Consider each $\pi_{nm}$ with $n\ne m$ in $\{i,j,k\}$ uniform on $\{(-1,1),(1,-1)\}$. Then every marginal of every of these $\pi_{nm}$ is the uniform distribution on $\{-1,1\}$ hence they are pairwise compatible but there exists no measure on $X_i\times X_j\times X_k$ which have them as two-dimensional marginals since no triplet $(a,b,c)$ in $\{-1,1\}^3$ is such that $a=-b$, $b=-c$ and $c=-a$.
A: There is a necessary condition you need to add: 
For each $i,j,k$ and for each $Y_i \subset X_i, Y_j \subset X_j$ and $Y_k \subset X_k$, $$\pi_{ij}(X_i \times X_j ) \leq \pi_{ik}(X_i \times X_k) + \pi_{jk}(X_j \times X_k^c) $$
This condition is necessary since the existence of $\pi$ implies 
\begin{align}
\pi_{ij}(X_i \times X_j ) 
&=  Marg_{Y_i \times Y_j \times Y_k} \ \pi( X_i \times X_j \times X_k )
 +Marg_{Y_j\times Y_j \times Y_k} \  \pi( X_i \times X_j \times X_k^c )   \\
&\leq \pi_{ik}( X_i \times X_k ) + \pi_{jk}(X_j \times X_k^c ) \\
\end{align}
I do believe that this condition is also sufficient but I do not have a proof. 
