9 #96b Inclusion–exclusion principle (alternative proof: induction) forget
From 12b.book. An alternative proof of #96: induction on the number of indices \(n\) (the opening explanation of 12b is below).
An alternative proof of #96 (inclusion–exclusion principle) of 12.book. The main theorem has the same form as in 12.book. 12.book built the bijection between pairs with an even number and pairs with an odd number at once, by the single correspondence 'for an element \(x\), move in or out the smallest index \(j\) containing it'. This book shows by induction on the number of indices \(n\) that pairs with an even number and pairs with an odd number are equinumerous: the bijection is not built at once, but at each step is reduced to a smaller case by the correspondence 'move index \(n+1\) in or out', and assembled by unions of equinumerous sets (the smallest index is not used).
Step \(n \to n+1\): the pairs not containing \(n+1\) are exactly the case \(n\); the pairs containing it correspond, by removing the index \(n+1\) and swapping the parity of the count, to pairs for \(W = \{x \in V \mid x \in A_{n+1}\}\) in the case \(n\). Since the induction hypothesis is used twice, for \(V\) and \(W\), the statement is universal over \(V\) (\(V\) is the set of elements lying in some of \(1..n\)).
Find the number of elements of a union of finite sets from the numbers of elements of the intersections (inclusion–exclusion principle). First two sets, then the case of \(n\) sets.
9.1 Two sets
\(|A \cup B| + |A \cap B| = |A| + |B|\); written with integers, \(|A \cup B| = |A| + |B| - |A \cap B|\). \(B \setminus A\) is finite, and \(A \cup B\) splits disjointly into \(A\) and \(B \setminus A\), and \(B\) into \(A \cap B\) and \(B \setminus A\).
L2s …
\(\operatorname{\#} A , \operatorname{\#} B , \operatorname{\#} ( A \cap B ) \in \mathbb{M} \Longrightarrow \operatorname{\#} ( A \cup B ) \in \mathbb{M} , \operatorname{\#} ( A \cup B ) + \operatorname{\#} ( A \cap B ) = \operatorname{\#} A + \operatorname{\#} B , \operatorname{\#} ( A \cup B ) = ( \operatorname{\#} A + \operatorname{\#} B ) - \operatorname{\#} ( A \cap B )\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ9.2 Parity and counts
Adding 1 swaps parity.
An odd number is a natural number that is not even. Adding 1 turns an even number into an odd one and an odd number into an even one.
Removing one decreases the count by one.
9.3 Finiteness
The collection of all pairs \((I, x)\), \(T\), is a subset of \(\wp(\{1..n\}) \times U\), a finite set of at most \(2^n \cdot u\) elements.
Tfin …
\(n \in \mathbb{M} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , \operatorname{\#} U \in \mathbb{M} \Longrightarrow \operatorname{\#} T \in \mathbb{M}\) \(\blacktriangleleft\) ax_s ,↑0X ,⋅0X ,\(\mathbb{W}.\) ,Axℤ9.4 Lemma on bijections
If a set of pairs \(F\) assigns to each element of \(X\) exactly one element of \(Y\), and to each element of \(Y\) exactly one element of \(X\), then \(X\) and \(Y\) are equinumerous.
9.5 Correspondence moving index n+1 in or out
For an index set \(I\) containing \(n+1\), the correspondence between the pair \((I, x)\) and the pair with \(n+1\) removed, \((I \setminus \{n+1\}, x)\). Since the counts differ by 1, the parity swaps.
9.6 Pairs containing and not containing index n+1
The pairs with indices in \(1..n+1\) split into the pairs not containing \(n+1\) (pairs with indices in \(1..n\)) and the pairs containing it, \(F\).
9.7 Union of equinumerous sets
If two disjoint sets are each equinumerous with another set, then their union is also equinumerous.
9.8 Base case (\(n=0\))
When the index set is empty (\(n=0\)), \(V\) is empty, and there are no pairs with an even number or an odd number.
9.9 Splitting the set of elements
If the set of elements \(V\) splits into disjoint \(V_0, V_1\), the set of pairs also splits in two.
9.10 Elements lying only in index n+1
An element lying in none of \(1..n\) but in some of \(1..n+1\), \(x\), lies only in \(n+1\). Its pairs are just two: \((\emptyset, x)\) (even) and \((\{n+1\}, x)\) (odd).
9.11 One step of induction (case where all elements of \(V\) lie in \(1..n\))
The pairs not containing \(n+1\) reduce to the case \(n\), where the hypothesis can be used, and the pairs containing \(n+1\) correspond, by removing one index and swapping the parity of the count, to pairs for \(W = \{x \in V \mid x \in A_{n+1}\}\) in the case \(n\).
9.12 One step of induction
Split \(V\) into \(V_0\) (elements lying in some of \(1..n\)) and \(V_1\) (elements not, lying only in \(n+1\)). The part for \(V_0\) is the case above. The part for \(V_1\) is the correspondence of \((\emptyset, x)\) and \((\{n+1\}, x)\).
9.13 Induction
By induction, it holds for every \(n\): for the set of elements lying in some of the indices \(1..n\), \(V\), the pairs with an even number and with an odd number are equinumerous.
Lind …
\(n \in \mathbb{M} \Longrightarrow \forall V , E , O \, ( \forall x \in V . \exists i \in 1 \mathinner{\ldotp\ldotp} n . \langle i , x \rangle \in A , E = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in V , \forall i \in I . \langle i , x \rangle \in A , \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} I = k \} , O = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in V , \forall i \in I . \langle i , x \rangle \in A , \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} + 1 , \operatorname{\#} I = k \} \Longrightarrow E \stackrel{\#}= O )\) \(\blacktriangleleft\) Lstep3 ,ax_s ,\(\mathbb{W}.\) ,Axℤ9.14 Pairs with an even number and with an odd number are equinumerous
Pairs with an even number of indices and with an odd number are equinumerous. We only fit the result of the induction above (\(V = U\)) to the way of speaking about the set of pairs \(T\).
BIJ …
\(n \in \mathbb{M} , U = \{ x \mid \exists i \in 1 \mathinner{\ldotp\ldotp} n . \langle i , x \rangle \in A \} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , O = \{ p \in T \mid \exists k \in \mathbb{M} . k \notin 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} \Longrightarrow E \stackrel{\#}= O\) \(\blacktriangleleft\) ax_s ,Lind ,Pn ,◁. ,pr:0 ,\(\mathbb{W}.\) ,Axℤ9.15 Pairs with 0 indices
There are as many pairs \((\emptyset, x)\) with 0 indices as elements of \(U\).
K1 …
\(T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , P = \{ p \in T \mid \operatorname{\#} ( \triangleleft p ) = 0 \} \Longrightarrow P \stackrel{\#}= U\) \(\blacktriangleleft\) ax_s ,#0 ,◁. ,pr:0 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ9.16 Inclusion–exclusion principle (relation of counts)
From the collection of all pairs with an even count, \(E\), removing the pairs with count 0 (as many as \(U\)) gives \(E_+\).
Hz …
\(T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} , \forall p ( p \in T \Longrightarrow \operatorname{\#} ( \triangleleft p ) \in \mathbb{M} ) \Longrightarrow \forall p ( p \in E \mathop\setminus Y \Longleftrightarrow p \in T , \operatorname{\#} ( \triangleleft p ) = 0 )\) \(\blacktriangleleft\) ⋅0X ,\(\mathbb{W}.\) ,AxℤAuxiliary: the number of indices of a pair in \(T\) is a natural number. \(E, E_+\) are subsets of \(T\). If \(E_+ \subset E\) then \(E = (E \setminus E_+) \cup E_+\) (disjoint).
Hc …
\(n \in \mathbb{M} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , p \in T \Longrightarrow \operatorname{\#} ( \triangleleft p ) \in \mathbb{M}\) \(\blacktriangleleft\) ⋅0X ,\(\mathbb{W}.\) ,AxℤHs …
\(E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} \Longrightarrow Y \subset E\) \(\blacktriangleleft\) \(\mathbb{W}.\)Hd …
\(Y \subset E \Longrightarrow ( E \mathop\setminus Y ) \cup Y = E , ( E \mathop\setminus Y ) \cap Y = \emptyset\) \(\blacktriangleleft\) \(\mathbb{W}.\)9.17 Inclusion–exclusion principle
The \(n\) sets \(A_1, \ldots, A_n\) are given by \(\langle i, x \rangle \in A\) (\(x \in A_i\)), and \(U = A_1 \cup \cdots \cup A_n\) has \(u\) elements. \(T\) is the collection of all pairs \((I, x)\) (\(I \subset \{1, \ldots, n\}\), \(x \in U\), and if \(i \in I\) then \(x \in A_i\); \(I = \emptyset\) is included). \(E\) is the collection of pairs with \(|I|\) even, \(E_+\) with \(|I|\) positive even, and \(O\) with \(|I|\) odd.
Then \(u + |E_+| = |O|\) (there are as many pairs with 0 indices as elements of \(U\)). Writing \(|E_+| = \sum_{k \text{ positive even}} e(k)\) and \(|O| = \sum_{k \text{ odd}} o(k)\), the inclusion–exclusion principle is \(u = |O| - |E_+|\). Both the subtraction-free form and the integer subtraction form are shown.
\(n \in \mathbb{M} , U = \{ x \mid \exists i \in 1 \mathinner{\ldotp\ldotp} n . \langle i , x \rangle \in A \} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , \operatorname{\#} U = u , u \in \mathbb{M} , E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} , O = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} + 1 , \operatorname{\#} ( \triangleleft p ) = k \} \Longrightarrow u + \operatorname{\#} Y = \operatorname{\#} O , u = \operatorname{\#} O - \operatorname{\#} Y\) \(\blacktriangleleft\) Tfin ,K1 ,Hz ,Hc ,Hs ,Hd ,BIJ ,L∪# ,L⊂# ,L#= ,ax_s ,↑s𝕄 ,↑0X ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ