It is a common trick in proofs that we divide a set into non-overlapping subsets. The first case is when we split the set into two nonempty disjoint sets. Here this is modeled as an ordered pair of sets and the set of such divisions of set \(X\) is called \( \text{Bisections}(X) \). The second variation on this theme is a set-valued function (aren't they all in ZF?) whose values are nonempty and mutually disjoint.
This section is about dividing sets into two non-overlapping subsets.
The set of bisections of a given set \(A\) is a set of pairs of nonempty subsets of \(A\) that do not overlap and their union is equal to \(A\).
definition
\( \text{Bisections}(X) = \{p \in Pow(X)\times Pow(X).\ \) \( \text{fst}(p)\neq 0 \wedge \text{snd}(p)\neq 0 \wedge \text{fst}(p)\cap \text{snd}(p) = 0 \wedge \text{fst}(p)\cup \text{snd}(p) = X\} \)
Properties of bisections.
lemma bisec_props:
assumes \( \langle A,B\rangle \in \text{Bisections}(X) \)
shows \( A\neq 0 \), \( B\neq 0 \), \( A \subseteq X \), \( B \subseteq X \), \( A \cap B = 0 \), \( A \cup B = X \), \( X \neq 0 \) using assms, Bisections_defKind of inverse of bisec_props: a pair of nonempty disjoint sets form a bisection of their union.
lemma is_bisec:
assumes \( A\neq 0 \), \( B\neq 0 \), \( A \cap B = 0 \)
shows \( \langle A,B\rangle \in \text{Bisections}(A\cup B) \) using assms, Bisections_defBisection of \(X\) is a pair of subsets of \(X\).
lemma bisec_is_pair:
assumes \( Q \in \text{Bisections}(X) \)
shows \( Q = \langle \text{fst}(Q), \text{snd}(Q)\rangle \) using assms, Bisections_defThe set of bisections of the empty set is empty.
lemma bisec_empty:
shows \( \text{Bisections}(0) = 0 \) using Bisections_defThe next lemma shows what can we say about bisections of a set with another element added.
lemma bisec_add_point:
assumes A1: \( x \notin X \) and A2: \( \langle A,B\rangle \in \text{Bisections}(X \cup \{x\}) \)
shows \( (A = \{x\} \vee B = \{x\}) \vee (\langle A - \{x\}, B - \{x\}\rangle \in \text{Bisections}(X)) \)proofA continuation of the lemma bisec_add_point that refines the case when the pair with removed point bisects the original set.
lemma bisec_add_point_case3:
assumes A1: \( \langle A,B\rangle \in \text{Bisections}(X \cup \{x\}) \) and A2: \( \langle A - \{x\}, B - \{x\}\rangle \in \text{Bisections}(X) \)
shows \( (\langle A, B - \{x\}\rangle \in \text{Bisections}(X) \wedge x \in B) \vee \) \( (\langle A - \{x\}, B\rangle \in \text{Bisections}(X) \wedge x \in A) \)proofAnother lemma about bisecting a set with an added point.
lemma point_set_bisec:
assumes A1: \( x \notin X \) and A2: \( \langle \{x\}, A\rangle \in \text{Bisections}(X \cup \{x\}) \)
shows \( A = X \) and \( X \neq 0 \)proofYet another lemma about bisecting a set with an added point, very similar to point_set_bisec with almost the same proof.
lemma set_point_bisec:
assumes A1: \( x \notin X \) and A2: \( \langle A, \{x\}\rangle \in \text{Bisections}(X \cup \{x\}) \)
shows \( A = X \) and \( X \neq 0 \)proofIf a pair of sets bisects a finite set, then both elements of the pair are finite.
lemma bisect_fin:
assumes A1: \( A \in \text{FinPow}(X) \) and A2: \( Q \in \text{Bisections}(A) \)
shows \( \text{fst}(Q) \in \text{FinPow}(X) \) and \( \text{snd}(Q) \in \text{FinPow}(X) \)proofThis sections covers the situation when we have an arbitrary number of sets we want to partition into.
We define a notion of a partition as a set valued function such that the values for different arguments are disjoint. The name is derived from the fact that such function "partitions" the union of its arguments. Please let me know if you have a better idea for a name for such notion. We would prefer to say ''is a partition'', but that reserves the letter ''a'' as a keyword(?) which causes problems.
definition
\( P \text{ is partition } \equiv \forall x \in domain(P).\ \) \( P(x) \neq 0 \wedge (\forall y \in domain(P).\ x\neq y \longrightarrow P(x) \cap P(y) = 0) \)
A fact about lists of mutually disjoint sets.
lemma list_partition:
assumes A1: \( n \in nat \) and A2: \( a : succ(n) \rightarrow X \), \( a \text{ is partition } \)
shows \( (\bigcup i\in n.\ a(i)) \cap a(n) = 0 \)proofWe can turn every injection into a partition.
lemma inj_partition:
assumes A1: \( b \in \text{inj}(X,Y) \)
shows \( \forall x \in X.\ \{\langle x, \{b(x)\}\rangle .\ x \in X\}(x) = \{b(x)\} \) and \( \{\langle x, \{b(x)\}\rangle .\ x \in X\} \text{ is partition } \)proofassumes \( A - \{x\} = \emptyset \)
shows \( A = \emptyset \vee A = \{x\} \)assumes \( A - \{x\} = A \)
shows \( x \notin A \)assumes \( Q \in \text{Bisections}(X) \)
shows \( Q = \langle \text{fst}(Q), \text{snd}(Q)\rangle \)assumes \( \langle A,B\rangle \in \text{Bisections}(X) \)
shows \( A\neq 0 \), \( B\neq 0 \), \( A \subseteq X \), \( B \subseteq X \), \( A \cap B = 0 \), \( A \cup B = X \), \( X \neq 0 \)assumes \( X\neq \emptyset \)
shows \( \exists x.\ x\in X \)assumes \( f:A\rightarrow C \)
shows \( domain(f) = A \)assumes \( \forall x\in X.\ b(x) \in Y \)
shows \( \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y \)assumes \( f:X\rightarrow Y \) and \( f = \{\langle x,b(x)\rangle .\ x\in X\} \)
shows \( \forall x\in X.\ f(x) = b(x) \)