Solution (source code)

= Solution

Treat $G_i$ as the entire <phase-known genotype> of individual $i$ at the <genetic loci> being studied, and let $\overline F$ denote the nonfounders. Assume unrelated <pedigree founders> have independent <genotype> priors, each nonfounder's <genotype> depends only on its parents' <genotypes>, and the observed <phenotypes> are conditionally independent given the <genotypes>. These are the standard assumptions behind the <pedigree likelihood>; shared environmental effects or related <pedigree founders> would require additional factors.

The directed ancestry graph is acyclic, even when there is <inbreeding>. Order individuals with parents preceding offspring and apply the <chain rule for probabilities>. The parental <conditional independence> assumption gives
$$
P(G_1,\ldots,G_n)=\prod_{i\in F}P(G_i)\prod_{i\in\overline F}P(G_i\mid G_{m(i)},G_{f(i)}).
$$
Conditional <phenotype> <independence> gives $P(X_1,\ldots,X_n\mid G_1,\ldots,G_n)=\prod_iP(X_i\mid G_i)$. Multiplying these two expressions and summing over every possible latent <genotype> configuration proves
$$
\boxed{P(X_1,\ldots,X_n)=\sum_{G_1}\cdots\sum_{G_n}
\prod_iP(X_i\mid G_i)\prod_{i\in F}P(G_i)
\prod_{i\in\overline F}P(G_i\mid G_{m(i)},G_{f(i)}).}
$$
This is the <law of total probability>, not a claim that relatives have independent unconditional <genotypes>.