A fomular for CNF-DNF conversion

73 Views Asked by At

I just see this nice generalisation of sets:

$$\bigcup_{(i,j) \in I \times J} (A_i \times B_j) = \bigcup_{i \in I} \bigcup_{j \in J} (A_i \times B_j) = \Biggl(\bigcup_{i \in I} A_i\Biggr) \times \Biggl(\bigcup_{j \in J} B_j\Biggr).$$

From my intuition:

$$\bigcup_{(i_1,\cdots,i_n)\in I_1\times\cdots\times I_n}\left(S_{1_{(i_1)}}\times\cdots\times S_{n_{(i_n)}}\right)=\left(\bigcup_{i_1\in I_1}S_{1_{(i_1)}}\right)\times\cdots\times\left(\bigcup_{i_n\in I_n}S_{n_{(i_n)}}\right)\tag*{(1)}$$ $$\equiv\bigcup_{i\in\overset{~n}{\underset{{k=1}}{\huge~\times}}I_k}\left(\overset{n}{\underset{{k=1}}{\huge\times}}S_{k_{(i_k)}}\right)=\overset{n}{\underset{{k=1}}{\huge\times}}\left(\bigcup_{i_k\in I_k}S_{k_{(i_k)}}\right)\tag*{(2)}$$

In logic, I think this corresponding to the fomular that does the CNF-DNF conversion:

$$\bigvee_{(i_1,\cdots,i_n)\in I_1\times\cdots\times I_n}\left(P_{1_{(i_1)}}\land\cdots\land P_{n_{(i_n)}}\right)\Leftrightarrow\left(\bigvee_{i_1\in I_1}P_{1_{(i_1)}}\right)\land\cdots\land\left(\bigvee_{i_n\in I_n}P_{n_{(i_n)}}\right)\tag*{(3)}$$ $$\equiv\boxed{\bigvee_{i\in\overset{~n}{\underset{{k=1}}{\huge~\times}}I_k}\left(\overset{n}{\underset{{k=1}}{\bigwedge}}P_{k_{(i_k)}}\right)\Leftrightarrow\overset{n}{\underset{{k=1}}{\bigwedge}}\left(\bigvee_{i_k\in I_k}P_{k_{(i_k)}}\right)}\tag*{(4)}$$

For example:

Let $I_1=\{1,2,3\},I_2=\{1,2\}$, that $n=2$, we have the following:

\begin{align} \overset{2}{\underset{{k=1}}{\bigwedge}}\left(\bigvee_{i_k\in I_k}P_{k_{(i_k)}}\right) &\equiv\bigvee_{i_1\in I_1}P_{1_{(i_1)}}\land\bigvee_{i_2\in I_2}P_{2_{(i_2)}}\\ &\equiv(P_{1_1}\lor P_{1_2}\lor P_{1_3})\land(P_{2_1}\lor P_{2_2})\tag*{CNF}\\ \end{align}

\begin{align} \bigvee_{i\in\overset{~2}{\underset{{k=1}}{\huge~\times}}I_k}\left(\overset{2}{\underset{{k=1}}{\bigwedge}}P_{k_{(i_k)}}\right) &\equiv\bigvee_{i\in\overset{~2}{\underset{{k=1}}{\huge~\times}}I_k}\left(P_{1_{(i_1)}}\land P_{2_{(i_2)}}\right)\\ &\equiv (P_{1_{1}}\land P_{2_{1}})\lor(P_{1_{1}}\land P_{2_{2}})\tag*{DNF}\\ &~\lor(P_{1_{2}}\land P_{2_{1}})\lor(P_{1_{2}}\land P_{2_{2}})\\ &~\lor(P_{1_{3}}\land P_{2_{1}})\lor(P_{1_{3}}\land P_{2_{2}})\\ \end{align}

Use the equivalence of it's negation, here is the conversion from the other side:

\begin{align} \overset{2}{\underset{{k=1}}{\bigvee}}\left(\bigwedge_{i_k\in I_k}P_{k_{(i_k)}}\right) &\equiv\bigwedge_{i_1\in I_1}P_{1_{(i_1)}}\lor\bigwedge_{i_2\in I_2}P_{2_{(i_2)}}\\ &\equiv(P_{1_1}\land P_{1_2}\land P_{1_3})\lor(P_{2_1}\land P_{2_2})\tag*{DNF}\\ \end{align}

\begin{align} \bigwedge_{i\in\overset{~2}{\underset{{k=1}}{\huge~\times}}I_k}\left(\overset{2}{\underset{{k=1}}{\bigvee}}P_{k_{(i_k)}}\right) &\equiv\bigwedge_{i\in\overset{~2}{\underset{{k=1}}{\huge~\times}}I_k}\left(P_{1_{(i_1)}}\lor P_{2_{(i_2)}}\right)\\ &\equiv (P_{1_{1}}\lor P_{2_{1}})\land(P_{1_{1}}\lor P_{2_{2}})\tag*{CNF}\\ &~\land(P_{1_{2}}\lor P_{2_{1}})\land(P_{1_{2}}\lor P_{2_{2}})\\ &~\land(P_{1_{3}}\lor P_{2_{1}})\land(P_{1_{3}}\lor P_{2_{2}})\\ \end{align}

Is this fomular correct, if so $\dots$ how do i prove it $?$
Any help would be appreciated.