The standard Isabelle distribution contains lots of facts about basic set theory. This theory file adds some more.
Here we put lemmas from the set theory that we could not find in the standard Isabelle distribution.
If one collection is contained in another, then we can say the same about their unions.
lemma collection_contain:
assumes \( A\subseteq B \)
shows \( \bigcup A \subseteq \bigcup B \)proofIf all sets of a nonempty collection are the same, then its union is the same.
lemma ZF1_1_L1:
assumes \( C\neq 0 \) and \( \forall y\in C.\ b(y) = A \)
shows \( (\bigcup y\in C.\ b(y)) = A \) using assmsThe union af all values of a constant meta-function belongs to the same set as the constant.
lemma ZF1_1_L2:
assumes A1: \( C\neq 0 \) and A2: \( \forall x\in C.\ b(x) \in A \) and A3: \( \forall x y.\ x\in C \wedge y\in C \longrightarrow b(x) = b(y) \)
shows \( (\bigcup x\in C.\ b(x))\in A \)proofIf two meta-functions are the same on a cartesian product, then the subsets defined by them are the same. I am surprised Isabelle can not handle this automatically.
lemma ZF1_1_L4:
assumes A1: \( \forall x\in X.\ \forall y\in Y.\ a(x,y) = b(x,y) \)
shows \( \{a(x,y).\ \langle x,y\rangle \in X\times Y\} = \{b(x,y).\ \langle x,y\rangle \in X\times Y\} \)proofIf two meta-functions are the same on a cartesian product, then the subsets defined by them are the same. This is similar to ZF1_1_L4, except that the set definition varies over \( p\in X\times Y \) rather than \( \langle x,y\rangle \in X\times Y \).
lemma ZF1_1_L4A:
assumes A1: \( \forall x\in X.\ \forall y\in Y.\ a(\langle x,y\rangle ) = b(x,y) \)
shows \( \{a(p).\ p \in X\times Y\} = \{b(x,y).\ \langle x,y\rangle \in X\times Y\} \)proofA lemma about inclusion in cartesian products. Included here to remember that we need the \(U\times V \neq \emptyset\) assumption.
lemma prod_subset:
assumes \( U\times V\neq 0 \), \( U\times V \subseteq X\times Y \)
shows \( U\subseteq X \) and \( V\subseteq Y \) using assmsA technical lemma about sections in cartesian products.
lemma section_proj:
assumes \( A \subseteq X\times Y \) and \( U\times V \subseteq A \) and \( x \in U \), \( y \in V \)
shows \( U \subseteq \{t\in X.\ \langle t,y\rangle \in A\} \) and \( V \subseteq \{t\in Y.\ \langle x,t\rangle \in A\} \) using assmsIf two meta-functions are the same on a set, then they define the same set by separation.
lemma ZF1_1_L4B:
assumes \( \forall x\in X.\ a(x) = b(x) \)
shows \( \{a(x).\ x\in X\} = \{b(x).\ x\in X\} \) using assmsA set defined by a constant meta-function is a singleton.
lemma ZF1_1_L5:
assumes \( X\neq 0 \) and \( \forall x\in X.\ b(x) = c \)
shows \( \{b(x).\ x\in X\} = \{c\} \) using assmsMost of the time, auto does this job, but there are strange cases when the next lemma is needed.
lemma subset_with_property:
assumes \( Y = \{x\in X.\ b(x)\} \)
shows \( Y \subseteq X \) using assmsWe can choose an element from a nonempty set.
lemma nonempty_has_element:
assumes \( X\neq 0 \)
shows \( \exists x.\ x\in X \) using assmsIn Isabelle/ZF the intersection of an empty family is empty. This is exactly lemma Inter_0 from Isabelle's equalities theory. We repeat this lemma here as it is very difficult to find. This is one reason we need comments before every theorem: so that we can search for keywords.
lemma inter_empty_empty:
shows \( \bigcap 0 = 0 \) by (rule Inter_0 )If an intersection of a collection is not empty, then the collection is not empty. We are (ab)using the fact the the intersection of empty collection is defined to be empty.
lemma inter_nempty_nempty:
assumes \( \bigcap A \neq 0 \)
shows \( A\neq 0 \) using assmsFor two collections \(S,T\) of sets we define the product collection as the collections of cartesian products \(A\times B\), where \(A\in S, B\in T\).
Definition
\( \text{ProductCollection}(T,S) \equiv \bigcup U\in T.\ \{U\times V.\ V\in S\} \)
The union of the product collection of collections \(S,T\) is the cartesian product of \(\bigcup S\) and \(\bigcup T\).
lemma ZF1_1_L6:
shows \( \bigcup \text{ProductCollection}(S,T) = \bigcup S \times \bigcup T \) using ProductCollection_defAn intersection of subsets is a subset.
lemma ZF1_1_L7:
assumes A1: \( I\neq 0 \) and A2: \( \forall i\in I.\ P(i) \subseteq X \)
shows \( ( \bigcap i\in I.\ P(i) ) \subseteq X \)proofIsabelle/ZF has a "THE" construct that allows to define an element if there is only one such that is satisfies given predicate. In pure ZF we can express something similar using the indentity proven below.
lemma ZF1_1_L8:
shows \( \bigcup \{x\} = x \)Some properties of singletons.
lemma ZF1_1_L9:
assumes A1: \( \exists ! x.\ x\in A \wedge \phi (x) \)
shows \( \exists a.\ \{x\in A.\ \phi (x)\} = \{a\} \), \( \bigcup \{x\in A.\ \phi (x)\} \in A \), \( \phi (\bigcup \{x\in A.\ \phi (x)\}) \)proofA simple version of ZF1_1_L9.
corollary singleton_extract:
assumes \( \exists ! x.\ x\in A \)
shows \( (\bigcup A) \in A \)proofA criterion for when a set defined by comprehension is a singleton.
lemma singleton_comprehension:
assumes A1: \( y\in X \) and A2: \( \forall x\in X.\ \forall y\in X.\ P(x) = P(y) \)
shows \( (\bigcup \{P(x).\ x\in X\}) = P(y) \)proofAdding an element of a set to that set does not change the set.
lemma set_elem_add:
assumes \( x\in X \)
shows \( X \cup \{x\} = X \) using assmsHere we define a restriction of a collection of sets to a given set. In romantic math this is typically denoted \(X\cap M\) and means \(\{X\cap A : A\in M \} \). Note there is also restrict\((f,A)\) defined for relations in ZF.thy.
Definition
\( M \text{ restricted to } X \equiv \{X \cap A .\ A \in M\} \)
A lemma on a union of a restriction of a collection to a set.
lemma union_restrict:
shows \( \bigcup (M \text{ restricted to } X) = (\bigcup M) \cap X \) using RestrictedTo_defNext we show a technical identity that is used to prove sufficiency of some condition for a collection of sets to be a base for a topology.
lemma ZF1_1_L10:
assumes A1: \( \forall U\in C.\ \exists A\in B.\ U = \bigcup A \)
shows \( \bigcup \bigcup \{\bigcup \{A\in B.\ U = \bigcup A\}.\ U\in C\} = \bigcup C \)proofStandard Isabelle uses a notion of \( cons(A,a) \) that can be thought of as \(A\cup \{a\}\).
lemma consdef:
shows \( cons(a,A) = A \cup \{a\} \) using cons_defIf a difference between a set and a singleton is empty, then the set is empty or it is equal to the singleton.
lemma singl_diff_empty:
assumes \( A - \{x\} = 0 \)
shows \( A = 0 \vee A = \{x\} \) using assmsIf a difference between a set and a singleton is the set, then the only element of the singleton is not in the set.
lemma singl_diff_eq:
assumes A1: \( A - \{x\} = A \)
shows \( x \notin A \)proofA basic property of sets defined by comprehension.
lemma comprehension:
assumes \( a \in \{x\in X.\ p(x)\} \)
shows \( a\in X \) and \( p(a) \) using assmsThe image of a set by a greater relation is greater.
lemma image_rel_mono:
assumes \( r\subseteq s \)
shows \( r(A) \subseteq s(A) \) using assmsA technical lemma about relations: if \(x\) is in its image by a relation \(U\) and that image is contained in some set \(C\), then the image of the singleton \(\{ x\}\) by the relation \(U \cup C\times C\) equals \(C\).
lemma image_greater_rel:
assumes \( x \in U\{x\} \) and \( U\{x\} \subseteq C \)
shows \( (U \cup C\times C)\{x\} = C \) using assms , image_Un_leftIt's hard to believe but there are cases where we have to reference this rule.
lemma set_mem_eq:
assumes \( x\in A \), \( A=B \)
shows \( x\in B \) using assmsassumes \( C\neq 0 \) and \( \forall y\in C.\ b(y) = A \)
shows \( (\bigcup y\in C.\ b(y)) = A \)assumes \( \exists ! x.\ x\in A \wedge \phi (x) \)
shows \( \exists a.\ \{x\in A.\ \phi (x)\} = \{a\} \), \( \bigcup \{x\in A.\ \phi (x)\} \in A \), \( \phi (\bigcup \{x\in A.\ \phi (x)\}) \)assumes \( \exists ! x.\ x\in A \)
shows \( (\bigcup A) \in A \)