Proving the cumulants to moments formula and combinatorics I'm trying to prove the following Cumulants to moments transformation formula with induction and recursion relations for the Cumulants. There are other ways to prove this formula, but I would like to complete the prove the way I started it if the combinatorics is doable.
Let $(X_n)_{n\in J}$ be a collection of random variables such that all the following formulas make sense. I'm trying to prove the following Formula for the Cumulants $\kappa$
\begin{align*}
\kappa[X_1,\dots,X_{N+1}]=\sum_{\pi\in\bar{\mathfrak{P}}_{N+1}}(|\pi|-1)!(-1)^{|\pi|-1}\prod_{p\in\pi}\mathbb{E}[\prod_{i\in p}X_i],
\end{align*}
where $\bar{\mathfrak{P}}_K$ is the set of all partitions of the set $\{1,\dots,K\}$ and $|\pi|$ is the number of subsets in the partition $\pi$. Now I used the following recursion relation
\begin{align*}
\kappa[X_1,\dots,X_{N+1}]=\mathbb{E}[X_1\dots X_{N+1}]-\sum_{\pi \in \mathfrak{P}_{N+1}}\prod_{p\in \pi}\kappa[\{X_i\}_{i\in p}],
\end{align*}
where now $\mathfrak{P}_{K}$ denotes the set of proper partitions, that is, excluding the set itself as a partition with the strong induction hypothesis. This yielded
\begin{align*}
\kappa[X_1,\dots,X_{N+1}]=\mathbb{E}[X_1,\dots,X_{N+1}]-\sum_{\pi\in\mathfrak{P}_{N+1}}\prod_{p\in\pi}\sum_{\sigma\in\bar{\mathfrak{P}}_{\#\pi}}(|\sigma|-1)!(-1)^{|\sigma|-1}\prod_{s\in\sigma}\mathbb{E}[\{X_i\}_{i\in s}],
\end{align*}
where now $\# p$ denotes the number of elements in the subset $p$.
Clearly we can see that this contains all the correct forms of terms, but the problem is to show that coefficients agree with the claim.
Now it is easy to see that from the formula I have derived one can get a term corresponding to each partition by choosing from the inner sum all the terms corresponding the set itself as a factor and then the coefficient is just $-1$, because then $|\sigma|=1$ for all the factors. The problem is to identify and compute coefficients for all other ways to get a specific partitions as a sub partition for some "coarse" partition. I know that if I have a partition $\pi=\{p_1,\dots,p_n\}$,\where $p_i={j_1,\dots,j_{k_i}}$ with $j_s\in\{1,\dots,N+1\}$ and $\sum_{r=1}^n k_r=N+1$, I can get all the proper partitions that have this partition as a sub-partition by taking all possible unions of the set $p_i$ so that I don't include all of them in the unions and the collection the union with the left over sets as partitions. However I have no idea how to do this systematically so that I can also identify the corresponding coefficients.
 A: Now I know that this is far from being the simplest solution to prove the claim of the original post. As Phicar in the above comments suggest the Möbius inversion approach is probably the most elegant answer. However, I felt like completing the elementary proof by induction was a good exercise in manipulating the expressions involved here. So here goes the elementary approach of mine:
We see that first of all the first term can be written in the form required since
$|\{\{1,2,\dots,N+1\}\}|=1.$ Then let us consider the second summation term. Now we see that the inner sum only adds terms of the form that are already included in the sum over the partitions of a bigger set. Thus the problem is to reduce the coefficients into the right form. Now the  Fix a partition $P$ of the set $\{1,2,\dots,N+1\}$ which has n subsets, that is, $|\pi|=n$ and each of these sets contain $k_i$ elements so that $\sum_{i=1}^nk_i=N+1$. Thus we can write $\pi=\{p_1,\dots,p_n\}$, where $p_i={i_1,\dots,i_{k_i}}$ with $i_j\in\{1,\dots,N+1\}$. To get all the terms corresponding to a certain partition we need to consider all the ways that partition can appear as a sub-partition of some proper partition in the outer partition sum. We may then write
\begin{align*}
-\sum_{\pi\in\mathfrak{P}_{N+1}}\prod_{p\in\pi}&\left(\sum_{\sigma\in\bar{\mathfrak{P}}_{\# p}}(|\sigma|-1)!(-1)^{|\sigma|-1 }\prod_k\mathbb{E}\left[\prod_{i\in s}X_i\right]\right) \\
&=\sum_{\pi\in \mathfrak{P}_{N+1}}\left(-\sum_{\substack{\tilde{\pi}\in\mathfrak{P}_{N+1} \\ \tilde{\pi}=\{\{p_i\}_{i\in I},\bigcup_{j_1\in J_1}p_{j_1},\dots,\bigcup_{j_k\in J_k}p_{j_k}\}\\ I\cup\bigcup_{l=1}^k J_l=\{1,\dots,n\}, I\neq\emptyset}}\prod_{l=1}^k(\# J_l-1)!(-1)^{\#J_l-1}\right)\prod_{p\in P}\mathbb{E}\left[\prod_{i\in p} X_i\right],
\end{align*}
where the union $I\cup\bigcup_{l=1}^k J_l=\{1,\dots,n\}$ is disjoint and $1\leq k<n$. From the claimed formula the coefficient corresponding to the bracket in the above expression is $(n-1)!(-1)^{n-1}$. Then from the derived formula we would have to see that the coefficients of all possible ways that one can obtain this partition as a sub-partition (including the partition itself) sum up to this same number. This is exactly what is written in the bracket above.
Now this can be written as a sum of proper partitions of the set of $\{1,\dots,n\}$ (Proper, because the partition corresponding to the set $\{1,\dots,n\}$ itself would correspond to taking the union of all the subsets of the partition to $n$ subset and this in turn would correspond to the partition corresponding the full set $\{1,\dots,N+1\}$, which is excluded from outer partition sum.), that is, the coefficient obtained from the derived formula is
\begin{align*}
-\sum_{\pi\in\mathfrak{P}_n}\prod_{p\in\pi}(\# p-1)!(-1)^{\# p-1},
\end{align*}
Note that this should only hold for $n>2$, because again the two set partition cannot be obtained as a sub-partition from a proper partition of the original set.
Thus we would need to show that
\begin{align*}
(n-1)!(-1)^{n-1}=-\sum_{\pi\in\mathfrak{P}
_n}\prod_{p\in\pi}(\# p-1)!(-1)^{\# p-1}
\end{align*}
for $2<n\leq N+1$. However, since the original formula should also hold for any $N+1$ and this is seemingly independent of $N$ we can conclude that this should hold for any $n>2$. Let us try to use induction on this again. For $n=3$ we get from left simply $(3-1)!(-1)^{3-1}=2$ and from right we get the partitions $\{\{1,2\},\{3\}\},\{\{1,3\},\{2\}\},\{\{2,3\},\{1\}\}$ and $\{\{1\},\{2\},\{3\}\}$. Thus the right hand side yields
$$
-[3(2-1)!(-1)^{2-1}+(1-1)!(-1)^{1-1}]=-(-3+1)=2
$$
as expected. Then let us make the induction assumption that this holds for some $n>3$ and compute
\begin{align*}
([n+1]-1)!(-1)^{(n+1)-1}&=n[(n-1)!](-1)(-1)^{n-1}=n(-1)\left[-\sum_{\pi\in\mathfrak{P}_n}\prod_{p\in\pi}(\# p-1)!(-1)^{\# p-1}\right] \\
&=\sum_{\pi \in \mathfrak{P}_n}\left(\sum_{\tilde{p}\in \pi}\# \tilde{p}\right)\prod_{p\in\pi}(\# p-1)!(-1)^{\# p-1} \\
&=-\sum_{\pi \in \mathfrak{P}_n}\sum_{\tilde{p}\in\pi}(\#\tilde{p})!(-1)^{\#\tilde{p}}\prod_{\substack{p\in\pi \\ p\neq\tilde{p}}}(\#p-1)!(-1)^{\# p-1}
\end{align*}
Now the way to get all proper partitions of a set of $n+1$ elements from the set of $n$ elements is to add the new element into each of the subset of all the partitions. Notice that this is exactly what has happened in the derivation above. Therefore we have
\begin{align*}
n!(-1)^n=-\sum_{\pi\in\mathfrak{P}_{n+1}}\prod_{p\in\pi}(\# p-1)(-1)^{\# p-1},
\end{align*}
which completes the induction step for both inductions and thus proves the claim.
EDIT. There was an obvious error in the formula above were we summed over the partitions that $\pi$ could be the sub-partition or a quest more traditionally called refinement. Obviously there should be the possibility to have several "clusters" or unions of the sets of $\pi$ and a product over them!
