Freeks/12b.book(保存済みの内容) … 編集へ / ファイル一覧へ

Inclusion–exclusion principle (alternative proof: induction)
import /Freeks/5.book

An alternative proof of #96 (inclusion–exclusion principle) in 12.book. The main theorem has the same form as in 12.book. Book 12 built, in one stroke, a bijection between even-size and odd-size tuples by a single correspondence that toggles, for \(x\), the smallest index \(j\) containing it. This book shows by induction on the number \(n\) of indices that there are equally many even-size and odd-size tuples: we do not build the bijection at once, but at each step move to a smaller case by the correspondence "toggle index \(n+1\)" and assemble the result by unions of equinumerous sets (the smallest index is not used).
The step \(n \to n+1\): the tuples not containing \(n+1\) are exactly the case \(n\); the tuples containing \(n+1\) correspond, with the parity of the size swapped, to the tuples of the case \(W = \{x \in V \mid x \in A_{n+1}\}\) for \(n\), obtained by removing the index. The induction hypothesis is used twice, for \(V\) and for \(W\), so the statement is universal over \(V\) (\(V\) is the set of elements lying in some one of \(1..n\)).

1 Preliminaries: parity

A natural number is even or odd (by induction on \(n\)). An even number is not odd. Doubling, \(2\) times, is an injection.
Lpar𝕄 … \(n \in \mathbb{M} \Longrightarrow \exists k \in \mathbb{M} . n = 2 \cdot k \mathbin{\rm o\!r} n = 2 \cdot k + 1\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ
Lodd … \(a , b \in \mathbb{M} \Longrightarrow 2 \cdot a \neq 2 \cdot b + 1\) \(\blacktriangleleft\) \(\mathbb{W}.\) ,Axℤ

2 #96 Inclusion–exclusion principle forget

We compute the size of a union of finite sets from the sizes of the intersections (inclusion–exclusion principle), first for two sets, then for \(n\) sets.

2.1 Two sets

\(|A \cup B| + |A \cap B| = |A| + |B|\), or in integers, \(|A \cup B| = |A| + |B| - |A \cap B|\). \(B \setminus A\) is finite; \(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\) L∪# ,L⊂# ,\(\mathbb{W}.\) ,Axℤ

2.2 Parity and size

Adding 1 swaps the parity.
An odd number is a natural number that is not even. After adding 1, the successor of an even number is odd and the successor of an odd number is even.
Removing one element decreases the size by 1.

2.3 Finiteness

The set of all pairs \((I, x)\), call it \(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 ,L℘# ,Lprod ,L⊂# ,↑s𝕄 ,↑0X ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ

2.4 Lemma on bijections

If a set \(F\) of pairs 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\) have the same size.

2.5 The correspondence toggling the index n+1

A correspondence for an index set \(I\) containing \(n+1\): the tuples \((I, x)\) correspond to the tuples with \(n+1\) removed, \((I \setminus \{n+1\}, x)\). The sizes differ by 1, so the parity is swapped.

2.6 Tuples containing the index n+1 and those not containing it

The tuples with indices in \(1..n+1\) split into those not containing \(n+1\) (tuples with indices in \(1..n\)) and those containing it, \(F\).

2.7 Union of equinumerous sets

If two disjoint sets are each equinumerous with another set, then their union is also equinumerous.

2.8 Base case (\(n=0\))

When the index set is empty (\(n=0\)), \(V\) is empty, and there are neither even-size nor odd-size tuples.

2.9 Splitting the set of elements

If the set \(V\) of elements splits into disjoint \(V_0, V_1\), then the set of tuples also splits into two.

2.10 Elements lying only in the index n+1

An element that lies in none of \(1..n\) but in some one of \(1..n+1\), call it \(x\), lies only in \(n+1\). Its tuples are just two: \((\emptyset, x)\) (even size) and \((\{n+1\}, x)\) (odd size).

2.11 One inductive step (when every element of \(V\) lies in some one of \(1..n\))

The tuples not containing \(n+1\) reduce to the case \(n\), where the hypothesis applies; the tuples containing \(n+1\) correspond, with the parity of the size swapped, to the tuples of the case \(W = \{x \in V \mid x \in A_{n+1}\}\) for \(n\), obtained by removing one index.

2.12 One inductive step

Split \(V\) into \(V_0\) (the elements lying in some one of \(1..n\)) and \(V_1\) (the elements not lying in any, i.e. lying only in \(n+1\)). The part for \(V_0\) is the case above. The part for \(V_1\) is the correspondence between \((\emptyset, x)\) and \((\{n+1\}, x)\).

2.13 Induction

By induction, for every \(n\): among the elements lying in some one of the indices \(1..n\), forming a set \(V\), there are equally many even-size and odd-size tuples.
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\) Lbase ,Lstep3 ,ax_s ,\(\mathbb{W}.\) ,Axℤ

2.14 Even-size and odd-size tuples are equinumerous

The tuples with an even number of indices and those with an odd number are equinumerous. We only match the phrasing, by the result of the induction above (\(V = U\)), to the set \(T\) of tuples.
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ℤ

2.15 Tuples of size 0

There are as many tuples \((\emptyset, x)\) with 0 indices as there are 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ℤ

2.16 Inclusion–exclusion (relation of sizes)

Let \(E\) be the set of all tuples of even size; removing the tuples of size 0 (equinumerous with \(U\)) leaves \(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\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ
Auxiliary facts: the number of indices of a tuple 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\) L⊂# ,◁. ,⋅𝕄:D ,⋅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}.\)

2.17 Inclusion–exclusion principle

Give \(n\) sets \(A_1, \ldots, A_n\) by \(\langle i, x \rangle \in A\) (\(x \in A_i\)), and let \(U = A_1 \cup \cdots \cup A_n\) have \(u\) elements. \(T\) is the set of all tuples \((I, x)\) (\(I \subset \{1, \ldots, n\}\), \(x \in U\), and when \(i \in I\), \(x \in A_i\); \(I = \emptyset\) is included). \(E\) is the set of tuples with \(|I|\) even, \(E_+\) those with \(|I|\) a positive even number, and \(O\) those with \(|I|\) odd.
Then \(u + |E_+| = |O|\) (there are as many tuples of size 0 as elements of \(U\)). Writing \(|E_+| = \sum_{k \text{ positive even}} e(k)\) and \(|O| = \sum_{k \text{ odd}} o(k)\), we get the inclusion–exclusion principle \(u = |O| - |E_+|\). We prove both the subtraction-free form and the integer-subtraction form.
\(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ℤ

イベント 29 件