Given events $\{ A_i \}_{i = 1} ^k$. They are mutually independent or $k$-wise independent if $\forall I \subseteq \{ 1, \cdots, k \}$ $$ \mathbb{P}(\bigcap_{i \in I} A_i \cap \bigcap_{i \in I^c} A_i^c) = \prod_{i \in I} \mathbb{P}(A_i) \prod_{i \in I^c} \mathbb{P}(A_i^c). $$
It is claimed equivalently,$A_1, \cdots, A_k$ are mutually independent or $k$-wise independent if $\forall I \subseteq \{ 1, \cdots, k \}$ $$ \mathbb{P}(\bigcap_{i \in I} A_i) = \prod_{i \in I}\mathbb{P}(A_i) $$ Proof is given in the lecture note and I will present only the piece that I do not understand:
Fix any non-empty $I \subseteq \{ 1, \cdots, k \}$. Let $\mathcal{L}$ be the set of all subsets of indices $J$ s.t. $I \subseteq J \subseteq \{ 1, \cdots, k \}$: \begin{align*} \sum_{J \in \mathcal{L}} \mathbb{P}(\bigcap_{i \in I} A_i \cap \bigcap_{i \in J \setminus I} A_i \cap \bigcap_{i \in J^c} A_i^c) &= \sum_{J \in \mathcal{L}} \prod_{i \in I} \mathbb{P}(A_i) \prod_{i \in J \setminus I} \mathbb{P}(A_i) \prod_{i \in J^c} \mathbb{P}(A_i^c) \\ &= \prod_{i \in I} \mathbb{P}(A_i) \sum_{J \in \mathcal{L}} \prod_{i \in J \setminus I} \mathbb{P}(A_i) \prod_{i \in J^c} \mathbb{P}(A_i^c) \\ &= \prod_{i \in I} \mathbb{P}(A_i) \prod_{i \in I^c}(\mathbb{P}(A_i) + \mathbb{P}(A_i^c)) \\ &= \prod_{i \in I} \mathbb{P}(A_i) \cdot 1 \\ &= \prod_{i \in I} \mathbb{P}(A_i). \end{align*}
I do not understand $$ \sum_{J \in \mathcal{L}} \prod_{i \in J \setminus I} \mathbb{P}(A_i) \prod_{i \in J^c} \mathbb{P}(A_i^c) = \prod_{i \in I^c}(\mathbb{P}(A_i) + \mathbb{P}(A_i^c)) $$ appearing in the third equation above. Why is this true?
$\newcommand{\P}{\mathbb{P}}$Expand: $$\prod_{i\in I^c}(\P(A_i)+\P(A_i^c))$$You will get a sum of products of form $\P(A_{k_1})\P(A_{k_2})\cdots\P(A_{k_a})\P(A_{m_1}^c)\P(A_{m_2}^c)\cdots\P(A^c_{m_b})$ where the indices $k_\bullet,m_\bullet$ may be any indices not in $I$, with the only restrictions being that $k_x$ is distinct from every $m_y$ and that the $\{k_1,\cdots,k_a,m_1,\cdots,m_b\}$ enumerate $I^c$.
There are no repeats: each summand has a unique associated set of $k_\bullet,m_\bullet$.
To each summand we can associate the index set $J=I\sqcup\{k_1,\cdots,k_a\}$. Then necessarily we have $\{m_1,\cdots,m_b\}=J^c$. $J\in\mathcal{L}$ of course, and we find each sumamnd equal to $\prod_{i\in J\setminus I}\P(A_i)\prod_{i\in J^c}\P(A_i^c)$ for a unique such $J$. Conversely, for every possible $J\in\mathcal{L}$, there is such a summand. This gives the desired equality.