I try to solve a computational problem, but its solution lives on a generalized Venn diagram statement. I was able to obtain its general formula, but now I require some necessary conditions to avoid k combinations evaluation of intersection between sets. The general formula is below, as well as its statement.
Statement: Given sets $s_1, \, \cdots, \, s_n$, let the set $S_{i,j}$ represent the set of elements exclusive of certain sets given by the $j^{th}$ combination of combination sets of cardinality $i$. Adopt the symbol $\&_{(i, j)}$ as the $j^{th}$ combination set with $i$ elements, for $j$ from $1$ to $\left(\begin{array} nn \\ i \end{array}\right)$ and index $i$ from to $n$ to $1$.
$S_{i, j} = \left\{\bigcap\limits_{\forall k \in \&_{i, j}} \, s_k \right\} \backslash \left\{\bigcup\limits_{m > i \, \wedge \, n \in \&_{m, l}, \,\, l = 1, \, \cdots, \, \left(\begin{array} nn \\ i \end{array}\right)} \, S_{m, n} \right\}$
Despite formula above, the explanation is clear:
For $i = n$ corresponds to the intersection among all sets. For $i = n-1$, each of the respective $\left(\begin{array} nn \\ n-1 \end{array}\right)=n-1$ venn regions is equivalent to the difference between current intersection of sets of the combination and the intersection of all sets. This union of previous sets regards the right hand curly brackets.
I developed a NodeJS application to perform the calculation. It is below. It works well for small number of sets (until 10 sets is fine). The tests give some hint of the desired result.
Extended venn: https://github.com/dot-quiver/dot-quiver-api/blob/b342488bb2fa6ff43081e7c37bdf873ca7530169/utils/arrays/arrays.js#L122