# Finite Factored Sets: Polynomials and Probability

In this post, given a [finite factored set](https://www.lesswrong.com/s/kxs3eeEti9ouwWFzr) $F=(S,B)$, we will show how to associate each $E\subseteq S$ with a characteristic polynomial, $Q^F_E$. We will discuss how to factor these characteristic polynomials, and use these characteristic polynomials to build up to the fundamental theorem of finite factored sets, which associates conditional orthogonality with conditional independence in probability distributions.

5.1. Characteristic Polynomials
-------------------------------

**Definition 28.** *Given a finite factored set *$F=(S,B)$*, let *$\text{Poly}^F$* denote the ring of polynomials with coefficients in *$\mathbb{R}$* and variables in *$\mathcal{P}(S)$*. *

**Definition 29.** *Given a finite factored set *$F=(S,B)$*, a *$p\in\text{Poly}^F$*, and an *$f:\mathcal{P}(S)\rightarrow \mathbb R$*, we write *$p(f)\in \mathbb{R}$* for the evaluation of *$p$* at *$f$*, computed by replacing each *$E\subseteq S$* with *$f(E)$*.*

**Definition 30.** *Given a finite factored set *$F=(S,B)$*, and a polynomial *$p\in \text{Poly}^F$*, *$\text{supp}(p)\subseteq \mathcal{P}(S)$* denotes the set of all variables *$v\in\mathcal{P}(S)$* that appear in *$p$*. *$\text{supp}(p)$* is called the support of *$p$*.*

**Definition 31.** *Given a finite factored set *$F=(S,B)$* and an *$E\subseteq S$*, let *$Q^F_E\in \text{Poly}^F$* be given by *$Q^F_E=\sum_{s\in E}\prod_{b\in B}[s]_b$*.  *$Q^F_E$* is called the characteristic polynomial of *$E$* (in *$F$*).*

We will be building up to an understanding of how to factor $Q^F_E$ into irreducibles. For that, we will first need to give some basic notation for manipulating polynomials in $\text{Poly}^F$.

**Definition 32.** *Given a finite factored set *$F=(S,B)$*, an *$s\in S$*, and a *$C\subseteq B$*, let *$\text{mono}^F_C(s)\in \text{Poly}^F$* be given by *$\text{mono}^F_C(s)=\prod_{b\in C}[s]_b$*. *

**Definition 33.** *Given a finite factored set*$F=(S,B)$*, an *$E\subseteq S$*, and a *$C\subseteq B$*, let *$\text{monos}^F_C(E)\in \mathcal{P}(\text{Poly}^F)$* be given by *$\text{monos}^F_C(E)=\{\text{mono}^F_C(s)\mid s\in E\}$*. *

**Definition 34.** *Given a finite factored set*$F=(S,B)$*, an *$E\subseteq S$*, and a *$C\subseteq B$*, let *$\text{poly}^F_C(E)\in \text{Poly}^F$* be given by *$\text{poly}^F_C(E)=\sum_{m\in \text{monos}^F_C(E)}m$*. *

**Proposition 26.** *Let *$F=(S,B)$* be a finite factored set, and let *$E\subseteq S$*. Then *$Q^F_E=\text{poly}^F_B(E)$*.*

*Proof.* We start by showing that for all $s\neq t\in S$, $\text{mono}^F_B(s)\neq \text{mono}^F_B(t)$. 

Let $s\neq t\in S$ be arbitrary. By [Proposition 3](https://www.lesswrong.com/s/kxs3eeEti9ouwWFzr/p/sZa5LQg6rrWgMR4Jx#2_2__Factorizations), if $s\neq t$, there must be some $b\in B$ such that $[s]_b\neq [t]_b$. Then, note that $[s]_b\in \text{supp}(\text{mono}^F_B(s))$. If $[s]_b$ were also in $\text{supp}(\text{mono}^F_B(t))$, then $t$ would be in both $[s]_b$ and $[t]_b$, contradicting the fact that these two sets are disjoint. Therefore $\text{mono}^F_B(s)\neq \text{mono}^F_B(t)$.

Thus $\text{monos}^F_B(E)$ has exactly one element for each element of $E$, so we have that $\sum_{m\in \text{monos}^F_B(E)}m=\sum_{s\in E}\text{mono}^F_B(s)=Q_E^F$. $\square$

**Proposition 27.** *Let *$F=(S,B)$* be a finite factored set, and let *$E_0,E_1\subseteq S$* be subsets of *$S$*. Let *$C_0,C_1\subseteq B$* be disjoint subsets of *$B$*. Let *$E_2=\chi^F_{C_0}(E_0,E_1)$*, and let *$C_2=C_0\cup C_1$*. Then *$\text{poly}^F_{C_2}(E_2)=\text{poly}^F_{C_0}(E_0)\cdot \text{poly}^F_{C_1}(E_1)$*.*

*Proof.* For $i\in \{0,1,2\}$, let $M_i=\text{monos}^F_{C_i}(E_i)$. We will start by showing that $f:M_0\times M_1\rightarrow M_2$, given by $f(m_0,m_1)=m_0m_1$, is a well-defined function and a bijection.

First, observe that it follows immediately from the definition that for all $s_0,s_1\in S$, if $s_2=\chi^F_{C_0}(s_0,s_1)$ we have that $\text{mono}^F_{C_0}(s_0)=\text{mono}^F_{C_0}(s_2)$, $\text{mono}^F_{C_1}(s_1)=\text{mono}^F_{C_1}(s_2)$, and $\text{mono}^F_{C_0}(s_2)\cdot\text{mono}^F_{C_1}(s_2)=\text{mono}^F_{C_2}(s_2)$. Combining these, we get that $\text{mono}^F_{C_0}(s_0)\cdot\text{mono}^F_{C_1}(s_1)=\text{mono}^F_{C_2}(\chi^F_{C_0}(s_0,s_1))$.

For all $(m_0,m_1)\in M_0\times M_1$, there exists some $s_0\in E_0$ such that $m_0=\text{mono}^F_{C_0}(s_0)$, and some $s_1\in E_1$ such that $m_1=\text{mono}^F_{C_1}(s_1)$, and this gives us that $m_0m_1=\text{mono}^F_{C_0}(s_0)\text{mono}^F_{C_1}(s_1)=\text{mono}^F_{C_2}(\chi^F_C(s_0,s_1))\in M_2$. Thus, $f$ is well-defined.

To see that $f$ is surjective, observe that for all $m_2\in M_2$, there exists an $s_2\in E_2$ such that $m_2=\text{mono}^F_{C_2}(s_2)$, and there exist $s_0\in E_0$ and $s_1\in E_1$ such that $s_2=\chi^F_C(s_0,s_1)$, and we have $f(\text{mono}^F_{C_0}(s_0),\text{mono}^F_{C_1}(s_1))=m_2$.

To see that $f$ is injective, observe that for $i\in\{0,1\}$, for all $m_i\in M_i$, $\text{supp}(m_i)\subseteq \bigcup_{b\in C_i} b$. Further, $\bigcup_{b\in C_0} b$ and $\bigcup_{b\in C_1} b$ are disjoint. Thus, for all $m_0\in M_0$ and $m_1\in M_1$, $\text{supp}(m_i)=\text{supp}(m_0m_1)\cap \bigcup_{b\in C_i} b$.

This means that for all $m_0,m_0^\prime\in M_0$ and $m_1,m_1^\prime\in M_1$, if $m_0m_1=m_0^\prime m_1^\prime$, then $\text{supp}(m_0)=\text{supp}(m_0^\prime)$ and $\text{supp}(m_1)=\text{supp}(m_1^\prime)$. However, every monomial in $M_0$ or $M_1$ is just equal to the product of all variables in its support. Thus $m_0=\prod_{v\in \text{supp}(m_0)}v=m_0^\prime$ and $m_1=\prod_{v\in \text{supp}(m_1)}v=m_1^\prime$. Thus $f$ is injective, and thus a bijection between $M_0\times M_1$ and $M_2$.

Now, we have that

$$
\begin{split}\text{poly}^F_{C_0}(E_0)\cdot \text{poly}^F_{C_1}(E_1) & = \left(\sum_{m_0\in M_0}m_0\right)\left(\sum_{m_1\in M_1}m_1\right) \\[6pt] & = \sum_{m_0\in M_0}\sum_{m_1\in M_1}m_0m_1\\[6pt] & = \sum_{(m_0,m_1)\in M_0\times M_1}m_0m_1\\[6pt]  & = \sum_{(m_0,m_1)\in M_0\times M_1}f(m_0,m_1)\\[6pt]    & = \sum_{m_2\in M_2}m_2\\[6pt]      & = \text{poly}^F_{C_2}(E_2).\end{split}
$$

$\square$

**Proposition 28.** *Let *$F=(S,B)$* be a finite factored set, and let *$E$* be a nonempty subset of *$S$*. If *$p$* divides *$Q^F_E$*, then *$p=r\cdot\text{poly}^F_C(E)$*, for some *$r\in \mathbb{R}$* and *$C\subseteq B$*.*

*Proof.* Let $F=(S,B)$ be a finite factored set, and let $E$ be a nonempty subset of $S$. Let $p,q\in \text{Poly}^F$ satisfy $pq=Q^F_E$. We thus must have $\text{supp}(p)\cup\text{supp}(q)=\text{supp}(Q^F_E)$. 

If there were some $T\in \text{supp}(p)\cap\text{supp}(q)$, then the degree of $T$ in $Q^F_E$ would be at least 2, contradicting the definition of $Q^F_E$ and [Corollary 1](https://www.lesswrong.com/s/kxs3eeEti9ouwWFzr/p/sZa5LQg6rrWgMR4Jx#2_3__Chimera_Functions). Thus, $\text{supp}(p)\cap\text{supp}(q)=\{\}$.

There can be no combining like terms, then, in the product $pq$. The monomial terms in $Q^F_E$ are in bijective correspondence to the pairs of monomial terms in $p$ and monomial terms in $q$.

In particular, this means that since all the coefficients in $pq$ are equal to $1$, all the coefficients in $p$ must be equal to some $r\in \mathbb{R}$, and all of the coefficients in $q$ must be equal to $1/r$.

Further, for all $b\in B$, if $b\cap \text{supp}(p)$ is nonempty, $b\cap \text{supp}(q)$ must be empty, since otherwise $Q^F_E$ would contain a term with two factors in $b$, which clearly never happens according to the definition of $Q^F_E$. 

Since $E$ is nonempty, for each $b\in B$ there must be some $T\in b\cap \text{supp}(Q^F_E)$. Thus at least one of $b\cap \text{supp}(p)$ and $b\cap \text{supp}(q)$ must be nonempty, so exactly one of $b\cap \text{supp}(p)$ and $b\cap \text{supp}(q)$ must be nonempty.

Let $C$ be the set of all $b\in B$ such that $b\cap \text{supp}(p)$ is nonempty. 

For every $b\in C$, every term of $Q^F_E$ has exactly one factor in $b$. Thus, every term in $p$ has exactly one factor in $b$. These cover all variables in the support of $p$, so each term in $p$ must have total degree $|C|$.

For each $m\in \text{monos}^F_C(E)$, $m$ divides a term in $Q^F_E$. Since $m$ has no common support with $q$, $m$ must also divide a term in $p$. Thus $r\cdot m$ must be a term in $p$. Conversely, every term in $p$ divides a term in $Q^F_E$, and thus must be in $\text{monos}^F_C(E)$. Thus every term in $p$ is of the form $r\cdot m$ for some $m\in\text{monos}^F_C(E)$. Thus $p=\sum_{m\in\text{monos}^F_C(E)}r\cdot m= r\cdot\text{poly}^F_C(E)$. $\square$

5.2. Factoring Characteristic Polynomials
-----------------------------------------

We will now show how to factor characteristic polynomials into irreducibles. 

**Definition 35.** *Given a finite factored set *$F=(S,B)$*, and a nonempty subset *$E\subseteq S$*, let *$\text{Irr}^F(E)\subseteq\mathcal{P}(B)$* denote the set of all *$C\subseteq B$* such that:*

1.  $C$* is nonempty,*
2.  $\chi^F_C(E,E)=E$*, and*
3.  *there is no nonempty strict subset *$D\subset C$* such that *$\chi^F_D(E,E)=E$*.*

**Proposition 29.** *Let *$F=(S,B)$* be a finite factored set, and let *$E$* be a nonempty subset of *$S$*. Then *$\text{Irr}^F(E)\in\text{Part}(B)$*.*

*Proof.* Let $F=(S,B)$ be a finite factored set, and let $E$ be a nonempty subset of $S$. It suffices to show that the sets in $\text{Irr}^F(E)$ are pairwise disjoint and cover $B$. 

We start by showing that the set of all $C\subseteq B$ satisfying $\chi^F_C(E,E)=E$ is closed under intersection. Indeed, if $\chi^F_{C_0}(E,E)=E$ and $\chi^F_{C_1}(E,E)=E$, then $\chi^F_{C_0\cap C_1}(E,E)=\chi^F_{C_0}(E,\chi^F_{C_1}(E,E))=\chi^F_{C_0}(E,E)=E$.

Next, observe that $\chi^F_B(E,E)=E$. Thus, for all $b\in B$, we can consider $C_b=\bigcap_{C\subseteq B,b\in C,\chi^F_C(E,E)=E}C$. Since $C_b$ is an intersection of a finite nonempty collection of sets $C$ satisfying $\chi^F_C(E,E)=E$, we have that $\chi^F_{C_b}(E,E)=E$. Further, $b\in C_b$, so $C_b$ is nonempty.

Assume for the purpose of contradiction that there is some nonempty strict subset $D\subset C_b$ such that $\chi^F_{D}(E,E)=E$. If $b\in D$, then we have a contradiction by the definition of $C_b$. If $b\notin D$, then note that $\chi^F_{B\setminus D}(E,E)=E$, so $\chi^F_{C_b\setminus D}(E,E)=E$, and $C_b\setminus D$ is a nonempty strict subset of $C_b$ that contains $b$, contradicting the definition of $C_b$.

Thus $C_b\in \text{Irr}^F(E)$ for all $b\in B$, and since $b\in C_b$, this means that the sets in $\text{Irr}^F(E)$ cover $B$.

Next, we need to show that the sets in $\text{Irr}^F(E)$ are pairwise disjoint. Let $C_0,C_1\in \text{Irr}^F(E)$ be arbitrary distinct elements. We have that $\chi^F_{C_0\cap C_1}(E,E)=E$, and $C_0\cap C_1$ is a subset of $C_0$ and $C_1$, and thus a strict subset of at least one of them. Thus $C_0\cap C_1$ is empty.

Thus $\text{Irr}^F(E)\in\text{Part}(B)$. $\square$

The following two propositions constitute a factorization of $Q^F_E$ into irreducibles.

**Proposition 30.** *Let*$F=(S,B)$* be a finite factored set, and let *$E$* be a nonempty subset of *$S$*. Then *$Q^F_E=\prod_{C\in\text{Irr}^F(E)}\text{poly}^F_C(E)$*.*

*Proof.* Let $F=(S,B)$ be a finite factored set, and let $E$ be a nonempty subset of $S$. Let $n=|\text{Irr}^F(E)|$, and let $\text{Irr}^F(E)=\{C_0,\dots, C_{n-1}\}$. For $0\leq k<n$, let $C_{\leq k}=\bigcup_{i=0}^{k} C_i$.

We will show by induction on $k$ that $\prod_{i=0}^{k}\text{poly}^F_{C_i}(E)=\text{poly}^F_{C_{\leq k}}(E)$ for all $0\leq k<n$.

If $k=0$, the result is trivial, as $\prod_{i=0}^{0}\text{poly}^F_{C_i}(E)=\text{poly}^F_{C_{0}}(E)=\text{poly}^F_{C_{\leq 0}}(E)$.

For $k>0$, observe that $C_k$ and $C_{\leq k-1}$ are disjoint, and that $E=\chi^F_{C_k}(E,E)$, thus by Proposition 27, we have $\text{poly}^F_{C_{ k}}(E)\cdot\text{poly}^F_{C_{\leq k-1}}(E)=\text{poly}^F_{C_{\leq k}}(E)$. Thus, by induction, we get $\prod_{i=0}^{k}\text{poly}^F_{C_i}(E)=\text{poly}^F_{C_{\leq k}}(E)$.

In the case where $k=n-1$, this gives that $\prod_{C\in\text{Irr}^F(E)}\text{poly}^F_C(E)=\text{poly}^F_{B}(E)=Q^F_E$. $\square$

**Proposition 31.** *Let*$F=(S,B)$* be a finite factored set, and let *$E$* be a nonempty subset of *$S$*. Then *$\text{poly}^F_C(E)$* is irreducible for all *$C\in \text{Irr}^F(E)$*.*

*Proof.* Let $F=(S,B)$ be a finite factored set, let $E$ be a nonempty subset of $S$, and let $C\in \text{Irr}^F(E)$.

Assume for the purpose of contradiction that $p_0\cdot p_1=\text{poly}^F_C(E)$, and that both $p_0$ and $p_1$ have nonempty support. By Proposition 28, we have that $p_i=r_i\cdot \text{poly}^F_{C_i}(E)$, for some $r_0,r_1\in\mathbb R$, and $C_0,C_1\subseteq B$. 

We will first need to show that $C_0$ and $C_1$ are nonempty and disjoint. They must be nonempty, because $p_0$ and $p_1$ have nonempty support. Assume for the purpose of contradiction that $b\in C_0\cap C_1$. Let $s$ be an element of $E$, and note that for $i\in\{0,1\}$, we have $[s]_b\in \text{supp }\text{poly}^F_{C_i}(E)$. Thus $[s]_b$ must be degree at least 2 in $\text{poly}^F_C(E)$, which contradicts the fact that every variable clearly has degree at most 1 in $\text{poly}^F_C(E)$.

Next, we need to show that $C_0\cup C_1=C$. We already know that

$$
\begin{split}\text{supp}(\text{poly}^F_C(E)) & =\text{supp}(r_0r_1\text{poly}^F_{C_0}(E)\text{poly}^F_{C_1}(E)) \ & =\text{supp}(\text{poly}^F_{C_0}(E))\cup \text{supp}(\text{poly}^F_{C_1}(E)).\end{split}
$$

Let $s$ be an element of $E$. Given an arbitrary $b\in B$, we have that $b\in C$ if and only if $[s]_b\in \text{supp}(\text{poly}^F_C(E))$ if and only if $[s]_b \in\text{supp}(\text{poly}^F_{C_i}(E))$ for some $i\in \{0,1\}$ if and only if $b\in C_0\cup C_1$. 

We now have that $C_0$ and $C_1$ are disjoint and that $C=C_0\cup C_1$. Thus, by Proposition 27, we have that $\text{poly}^F_{C_0}(E)\cdot \text{poly}^F_{C_1}(E)=\text{poly}^F_{C}(\chi^F_{C_0}(E,E))$. Thus $\text{poly}^F_{C}(E)=r_0r_1\text{poly}^F_{C}(\chi^F_{C_0}(E,E))$, so $\text{monos}^F_{C}(E)=\text{monos}^F_{C}(\chi^F_{C_0}(E,E))$.

Let $s_0,s_1\in E$ be arbitrary, and let $s_2=\chi_{C_0}^F(s_0,s_1)$. Note that $\text{mono}_C^F(s_2)\in \text{monos}^F_{C}(\chi^F_{C_0}(E,E))=\text{monos}^F_{C}(E)$, so there is some $s_3\in E$ such that $\text{mono}_C^F(s_2)=\text{mono}_C^F(s_3)$. Thus $s_2\sim_b s_3$ for all $b\in C$. However, we also have that $s_2\sim_b s_1$ for all $b\in B\setminus C$, so $s_2=\chi_C^F(s_3,s_1)$. Since $C\in \text{Irr}^F(E)$, $\chi_C^F(E,E)=E$, so $s_2=\chi_{C_0}^F(s_0,s_1)\in E$. Since $s_0$ and $s_1$ were arbitrary elements of $E$, we have that $\chi^F_{C_0}(E,E)=E$. Since $C_0$ is a nonempty strict subset of $C$, this contradicts the fact that $C\in \text{Irr}^F(E)$.

Thus, $\text{poly}^F_C(E)$ is irreducible for all $C\in \text{Irr}^F(E)$. $\square$

5.3. Characteristic Polynomials and Orthogonality
-------------------------------------------------

We can now give an alternate characterization of conditional orthogonality in terms of divisibility of characteristic polynomials.

**Lemma 3.** *Let *$F=(S,B)$* be a finite factored set, and let *$X,Y,Z\in \text{Part}(S)$* be partitions of *$S$*. The following are equivalent.*

1.  $X \perp ^{F} Y|Z$*.*
2.  $Q^F_{z}$* divides *$Q^F_{x\cap z} \cdot Q^F_{y\cap z}$* for all *$x\in X$*, *$y\in Y$*, and *$z\in Z$*.*
3.  $Q^F_{z} \cdot Q^F_{x\cap y\cap z}=Q^F_{x\cap z} \cdot Q^F_{y\cap z}$* for all *$x\in X$*, *$y\in Y$*, and *$z\in Z$*.*

*Proof.* Clearly condition 3 implies condition 2. We will first show that condition 1 implies condition 3, and then show that condition 2 implies condition 1.

Let $F=(S,B)$, and let $X,Y,Z\in \text{Part}(S)$ satisfy $X \perp ^{F} Y|Z$. Consider an arbitrary $x\in X$, $y\in Y$, and $z\in Z$. We want to show that $Q^F_{z} \cdot Q^F_{x\cap y\cap z}=Q^F_{x\cap z} \cdot Q^F_{y\cap z}$. 

Let $C=h^F(X|z)$. Clearly $C\vdash^F X|z$. We thus have that $\chi^F_C(z,z)=z$, so $\chi^F_{B\setminus C}(z,z)=z$. We also have that $h^F(Y|z)\subseteq B\setminus C$, so $Y|z\leq_z(\bigvee_S(B\setminus C))|z$. These two together give that $B\setminus C\vdash^F Y|z$.

Since $C\vdash^F X|z$, we have that $\chi^F_C(x\cap z,z)=x\cap z$. Thus, by Proposition 27, we have that $\text{poly}^F_C(x\cap z)\cdot \text{poly}^F_{B\setminus C}(z)=Q^F_{x\cap z}$. Similarly, since $B\setminus C\vdash^F Y|z$, we have that $\text{poly}^F_C(z)\cdot \text{poly}^F_{B\setminus C}(y\cap z)=Q^F_{y\cap z}$.

Since $\chi^F_C(x\cap z,y\cap z)\subseteq \chi^F_C(x\cap z, z)=x\cap z$, and $\chi^F_C(x\cap z,y\cap z)\subseteq \chi^F_C(z,y\cap z)=y\cap z$, we have $\chi^F_C(x\cap z,y\cap z)\subseteq x\cap y\cap z$. We also have that

$$
\begin{split} \chi^F_C(x\cap z,y\cap z) & \supseteq \chi^F_C(x\cap y\cap z,x\cap y\cap z) \ & \supseteq x\cap y\cap z. \end{split}
$$

Thus $\chi^F_C(x\cap z,y\cap z)= x\cap y\cap z$.

By Proposition 27, this gives that $\text{poly}^F_C(x\cap z)\cdot \text{poly}^F_{B\setminus C}(y\cap z)=Q^F_{x\cap y\cap z}$.

Finally, since $\chi^F_C(z,z)=z$, we have that $\text{poly}^F_C(z)\cdot \text{poly}^F_{B\setminus C}(z)=Q^F_{z}$.

Thus, $Q^F_{z}\cdot Q^F_{x\cap y\cap z}$ and $Q^F_{x\cap z} \cdot Q^F_{y\cap z}$ are both equal to $\text{poly}^F_C(x\cap z)\cdot \text{poly}^F_{B\setminus C}(y\cap z)\cdot\text{poly}^F_C(z)\cdot \text{poly}^F_{B\setminus C}(z)$.

Thus, condition 1 implies condition 3. It remains to show that condition 2 implies condition 1.

Fix $F=(S,B)$, and $X,Y,Z\in \text{Part}(S)$, and let $Q^F_z$ divide $Q^F_{x\cap z} \cdot Q^F_{y\cap z}$ for all $x\in X$, $y\in Y$, and $z\in Z$. Assume for the purpose of contradiction that it is not the case that $X \perp ^{F} Y|Z$. Thus, there exists some $z\in Z$ such that $h^F(X|z)\cap h^F(Y|z)\neq \{\}$. Let $z\in Z$ and $b\in B$ satisfy $b\in h^F(X|z)\cap h^F(Y|z)\neq \{\}$.

Let $C\subseteq B$ be such that $b\in C$ and $C\in \text{Irr}^F(z)$, and let $p=\text{poly}^F_C(z)$. Thus, $p$ is an irreducible factor of $Q^F_z$.

Either $p$ divides $Q^F_{x\cap z}$ for all $x\in X$ or $p$ divides $Q^F_{y\cap z}$ for all $y\in Y$, since otherwise there would exist an $x\in X$ and a $y\in Y$ such that $p$ divides neither $Q^F_{x\cap z}$ nor $Q^F_{x\cap z}$, but does divide their product, contradicting the fact that $p$ is irreducible, and thus prime.

Assume without loss of generality that $p$ divides $Q^F_{x\cap z}$ for all $x\in X$. Fix an $x\in X$. Let us first restrict attention to the case where $x\cap z$ is nonempty. 

Let $Q^F_{x\cap z}=p\cdot q$. By Proposition 28, $p=r_0\cdot \text{poly}^F_{C_0}(x\cap z)$ and $q=r_1\cdot \text{poly}^F_{C_1}(x\cap z)$ for some $r_0,r_1\in \mathbb R$ and $C_0,C_1\subseteq B$. We will show that $C_0=C, C_1=B\setminus C$, and $r_0=r_1=1$.

Let $s$ be an element of $x\cap z$. Then for all $b\in B$, $b\in C$ if and only if $[s]_b\in \text{supp}(p)$ if and only if $[s]_b\in \text{supp}(\text{poly}^F_{C_0}(x\cap z))$ if and only if $b\in C_0$. Thus $C_0=C$. 

For all $b\in B\setminus C$, we have $[s]_b\in \text{supp}(Q^F_{x\cap z})$ and $[s]_b\notin \text{supp}(p)$, so $[s]_b\in \text{supp}(q)$, so $b\in C_1$. Similarly, for all $b\in C_1$, $[s]_b\in \text{supp}(q)$, so $[s]_b\notin \text{supp}(p)$, so $b\in B\setminus C$. Thus $C_1=B\setminus C$.

Since $p$ and $\text{poly}^F_{C_0}(x\cap z)$ both have all coefficients equal to $1$, we have $r_0=1$. Thus, $p=\text{poly}^F_{C}(x\cap z).$

Similarly, since all the coefficients of $p$ are $1$ and all the coefficients of $Q^F_{x\cap z}$ are $1$, all the coefficients of $q$ are $1$, so $r_1=1$. Thus, $q=\text{poly}^F_{B\setminus C}(x\cap z)$.

We thus have that $Q^F_{x\cap z}= \text{poly}^F_{C}(z)\cdot \text{poly}^F_{B\setminus C}(x\cap z)$.

In the case where $x\cap z$ is empty, we also have $Q^F_{x\cap z}= \text{poly}^F_{C}(z)\cdot \text{poly}^F_{B\setminus C}(x\cap z)$, since both sides are $0$.

By Proposition 27, $Q^F_{x\cap z}=\text{poly}^F_{B}(\chi^F_{C}(z,x\cap z))$. Thus, $\text{monos}^F_B(x\cap z)=\text{monos}^F_B(\chi^F_{C}(z,x\cap z))$, so $x\cap z=\chi^F_{C}(z,x\cap z)=\chi^F_{B\setminus C}(x\cap z,z)$.

Since $x\cap z=\chi^F_{B\setminus C}(x\cap z,z)$ for all $x\in X$, we have that $B\setminus C\vdash^F X|z$. However, this contradicts the fact that $b\notin B\setminus C$, and $b\in h^F(X|z)$.

Thus, condition 2 implies condition 1. $\square$

5.4. Probability Distributions on Finite Factored Sets
------------------------------------------------------

The primary purpose of all this discussion of characteristic polynomials has been to build up to thinking about the relationship between orthogonality and probabilistic independence. We will now discuss probability distributions on finite factored sets.

Recall the definition of a probability distribution.

**Definition 36.** *Given a finite set *$S$*, a probability distribution on *$S$* is a function *$P:\mathcal{P}(S)\rightarrow\mathbb{R}$* such that *

1.  $P(E)\geq 0$* for all *$E\subseteq S$*,*
2.  $P(\{\})=0$*,*
3.  $P(S)=1$*, and*
4.  $P(E_0\cup E_1)=P(E_0)+P(E_1)$* whenever *$E_0,E_1\subseteq S$* satisfy *$E_0\cap E_1=\{\}$*.*

A probability distribution on a finite factored set $F$ is a probability distribution on its underlying set that also satisfies another condition, which represents the probability distribution coming from a product of distributions on the underlying factors.

**Definition 37.** *Given a finite factored set *$F=(S,B)$*, a probability distribution on *$F$* is a probability distribution *$P$* on *$S$* such that for all *$s\in S$*, we have *$P(\{s\})=\prod_{b\in B}P([s]_b)$*.*

**Proposition 32.** *Given a finite factored set *$F=(S,B)$*, a probability distribution on *$S$* is a probability distribution *$P$* on *$F$* if and only if *$P(E)=Q^F_E(P)$* for all *$E\subseteq S$*.*

*Proof.* If $P(E)=Q^F_E(P)$ for all $E\subseteq S$, in particular this means that $P(\{s\})=Q^F_{\{s\}}(P)=(\prod_{b\in B}[s]_b)(P)=\prod_{b\in B}P([s]_b)$ for all $s\in S$.

Conversely, if $P(\{s\})=\prod_{b\in B}P([s]_b)$ for all $s\in S$, then for all $E\subseteq S,  P(E)=\sum_{s\in E} \prod_{b\in B}P([s]_b)=(\sum_{s\in E} \prod_{b\in B}[s]_b)(P)=Q^F_E(P)$. $\square$

5.5. The Fundamental Theorem of Finite Factored Sets
----------------------------------------------------

We are now ready to state and prove the fundatmental theorem of finite factored sets.

**Theorem 3.** *Let *$F=(S,B)$* be a finite factored set, and let *$X,Y,Z\in \text{Part}(S)$* be partitions of *$S$*. Then *$X \perp ^{F} Y|Z$* if and only if for all probability distributions *$P$* on *$F$* and all *$x\in X$*, *$y\in Y$*, and *$z\in Z$*, we have *$P(x\cap z)\cdot P(y\cap z)= P(x\cap y\cap z)\cdot P(z)$*.*

*Proof.* We already have by Lemma 3 that if $X \perp ^{F} Y|Z$, then for all $x\in X$, $y\in Y$, and $z\in Z$, $Q^F_{z} \cdot Q^F_{x\cap y\cap z}=Q^F_{x\cap z} \cdot Q^F_{y\cap z}$. Thus for any probability distribution $P$ on $F$, we have

$$
\begin{split} P(z)\cdot P(x\cap y\cap z) & = Q^F_{z}(P) \cdot Q^F_{x\cap y\cap z}(P)\ & = Q^F_{x\cap z}(P) \cdot Q^F_{y\cap z}(P)\  & = P(x\cap z)\cdot P(y\cap z). \end{split}
$$

Conversely, assume that for all probability distributions $P$ on $F$, and all $x\in X$, $y\in Y$, and $z\in Z$, we have $P(x\cap z)\cdot P(y\cap z)= P(x\cap y\cap z)\cdot P(z)$.

If $S$ is empty, then $\{\}$ is the unique partition of $S$, and we have ${\{\}} \perp ^{F} {\{\}}|{\{\}}$. Thus, we can restrict our attention to the case where $S$ is nonempty. 

Fix an arbitrary $x\in X$, $y\in Y$, and $z\in Z$. Let $q=Q^F_{x\cap z}\cdot Q^F_{y\cap z}-Q^F_{x\cap y\cap z}\cdot Q^F_{z}$. We will first show that $q(f)=0$ for all $f:\mathcal{P}(S)\rightarrow \mathbb{R}^{>0}$.

Given an arbitrary $f:\mathcal{P}(S)\rightarrow \mathbb{R}^{>0}$, we can define $P_f:\mathcal{P}(S)\rightarrow \mathbb{R}$ by $P_f(E)=Q^F_E(f)/Q^F_S(f)$, and we will show that $P_f$ is a distribution on $F$.

$P_f$ is well-defined because $Q^F_S(f)$ is a nonempty sum of products of positive real numbers, and thus positive. Further, since $Q^F_E(f)$ is a sum of products of positive real numbers, $P_f(E)\geq 0$ for all $E\subseteq S$. Since $Q^F_{\{\}}=0$, we also have $P_f(\{\})=0$. Clearly $P_f(S)=1$. Finally, for all $E_0,E_1\subseteq S$ with $E_0\cap E_1=\{\}$, we have

$$
\begin{split} P_f(E_0\cup E_1) & = Q^F_{E_0\cup E_1}(f)/Q^F_{S}(f)\ & = (Q^F_{E_0}(f)+Q^F_{E_1}(f))/Q^F_{S}(f)\  & = P_f(E_0)+P_f(E_1). \end{split}
$$

Therefore $P_f$ is a distribution on $S$. We still need to show that $P_f$ is a distribution on $F$.

Observe that for all $s\in S$ and $b\in B$, since $\chi^F_{\{b\}}([s]_b,S)=[s]_b$, we have that $Q^F_{[s]_b}(f)=\text{poly}_{\{b\}}^F([s]_b)\cdot\text{poly}_{B\setminus\{b\}}^F(S)$, and since $\chi^F_{\{b\}}(S,S)=S$, we have that $Q^F_{S}(f)=\text{poly}_{\{b\}}^F(S)\cdot\text{poly}_{B\setminus\{b\}}^F(S)$. Thus, we have that

$$
\begin{split} P_f([s]_b) & = \text{poly}_{\{b\}}^F([s]_b)(f)/\text{poly}_{\{b\}}^F(S)(f)\ & = f([s]_b)/\text{poly}_{\{b\}}^F(S)(f). \end{split}
$$

Thus, for all $s\in S$, 

$$
\begin{split} \prod_{b\in B}P_f([s]_b) & = (\prod_{b\in B}f([s]_b))/(\prod_{b\in B}\text{poly}_{\{b\}}^F(S)(f))\\[4pt] & = Q^F_{\{s\}}(f)/Q^F_S(f)\\[4pt] & = P_f(\{s\}). \end{split}
$$

Thus $P_f$ is a distribution on $F$.

It follows that P$_f(x\cap z)\cdot P_f(y\cap z)= P_f(x\cap y\cap z)\cdot P_f(z)$. We therefore have that

$$
\begin{split}q(f) & = Q^F_{x\cap z}(f)\cdot Q^F_{y\cap z}(f)-Q^F_{x\cap y\cap z}(f)\cdot Q^F_{z}(f)\ & = (P_f(x\cap z)\cdot P_f(y\cap z)-P_f(x\cap y\cap z)\cdot P_f(z))\cdot Q^F_{S}(f)^2\  & = 0\cdot Q^F_{S}(f)^2\    & = 0.\end{split}
$$

Thus, $q$ is a polynomial that is zero on an open subset of inputs, so $q$ is the zero polynomial. Thus $Q^F_{x\cap z} \cdot Q^F_{y\cap z}-Q^F_{z} \cdot Q^F_{x\cap y\cap z}=0$, so $Q^F_{z} \cdot Q^F_{x\cap y\cap z}=Q^F_{x\cap z} \cdot Q^F_{y\cap z}$. Since $x\in X$, $y\in Y$, and $z\in Z$ were arbitrary, by Lemma 3, we have $X \perp ^{F} Y|Z$. $\square$

In the next two posts, we will introduce temporal inference using finite factored sets, and discuss future potential research directions.