This theory extends Isabelle standard Finite theory. It is obsolete and should not be used for new development. Use the Finite_ZF instead.
In this section we consider various properties of Fin datatype (even though there are no datatypes in ZF set theory).
In Topology_ZF theory we consider induced topology that is obtained by taking a subset of a topological space. To show that a topology restricted to a subset is also a topology on that subset we may need a fact that if \(T\) is a collection of sets and \(A\) is a set then every finite collection \(\{ V_i \}\) is of the form \(V_i=U_i \cap A\), where \(\{U_i\}\) is a finite subcollection of \(T\). This is one of those trivial facts that require suprisingly long formal proof. Actually, the need for this fact is avoided by requiring intersection two open sets to be open (rather than intersection of a finite number of open sets). Still, the fact is left here as an example of a proof by induction. We will use Fin_induct lemma from Finite.thy. First we define a property of finite sets that we want to show.
definition
\( \text{Prfin}(T,A,M) \equiv ( (M = 0) | (\exists N\in Fin(T).\ \forall V\in M.\ \exists U\in N.\ (V = U\cap A))) \)
Now we show the main induction step in a separate lemma. This will make the proof of the theorem FinRestr below look short and nice. The premises of the ind_step lemma are those needed by the main induction step in lemma Fin_induct (see standard Isabelle's Finite.thy).
lemma ind_step:
assumes A: \( \forall V\in TA.\ \exists U\in T.\ V=U\cap A \) and A1: \( W\in TA \) and A2: \( M\in Fin(TA) \) and A3: \( W\notin M \) and A4: \( \text{Prfin}(T,A,M) \)
shows \( \text{Prfin}(T,A,cons(W,M)) \)proofNow we are ready to prove the statement we need.
theorem FinRestr0:
assumes A: \( \forall V \in TA.\ \exists U\in T.\ V=U\cap A \)
shows \( \forall M\in Fin(TA).\ \text{Prfin}(T,A,M) \)proofThis is a different form of the above theorem:
theorem ZF1FinRestr:
assumes A1: \( M\in Fin(TA) \) and A2: \( M\neq 0 \) and A3: \( \forall V\in TA.\ \exists U\in T.\ V=U\cap A \)
shows \( \exists N\in Fin(T).\ (\forall V\in M.\ \exists U\in N.\ (V = U\cap A)) \wedge N\neq 0 \)proofPurely technical lemma used in Topology_ZF_1 to show that if a topology is \(T_2\), then it is \(T_1\).
lemma Finite1_L2:
assumes A: \( \exists U V.\ (U\in T \wedge V\in T \wedge x\in U \wedge y\in V \wedge U\cap V=0) \)
shows \( \exists U\in T.\ (x\in U \wedge y\notin U) \)proofA collection closed with respect to taking a union of two sets is closed under taking finite unions. Proof by induction with the induction step formulated in a separate lemma.
lemma Finite1_L3_IndStep:
assumes A1: \( \forall A B.\ ((A\in C \wedge B\in C) \longrightarrow A\cup B\in C) \) and A2: \( A\in C \) and A3: \( N\in Fin(C) \) and A4: \( A\notin N \) and A5: \( \bigcup N \in C \)
shows \( \bigcup cons(A,N) \in C \)proofThe lemma: a collection closed with respect to taking a union of two sets is closed under taking finite unions.
lemma Finite1_L3:
assumes A1: \( 0 \in C \) and A2: \( \forall A B.\ ((A\in C \wedge B\in C) \longrightarrow A\cup B\in C) \) and A3: \( N\in Fin(C) \)
shows \( \bigcup N\in C \)proofA collection closed with respect to taking a intersection of two sets is closed under taking finite intersections. Proof by induction with the induction step formulated in a separate lemma. This is sligltly more involved than the union case in Finite1_L3, because the intersection of empty collection is undefined (or should be treated as such). To simplify notation we define the property to be proven for finite sets as a separate notion.
definition
\( \text{IntPr}(T,N) \equiv (N = 0 | \bigcap N \in T) \)
The induction step.
lemma Finite1_L4_IndStep:
assumes A1: \( \forall A B.\ ((A\in T \wedge B\in T) \longrightarrow A\cap B\in T) \) and A2: \( A\in T \) and A3: \( N\in Fin(T) \) and A4: \( A\notin N \) and A5: \( \text{IntPr}(T,N) \)
shows \( \text{IntPr}(T,cons(A,N)) \)proofThe lemma.
lemma Finite1_L4:
assumes A1: \( \forall A B.\ A\in T \wedge B\in T \longrightarrow A\cap B \in T \) and A2: \( N\in Fin(T) \)
shows \( \text{IntPr}(T,N) \)proofNext is a restatement of the above lemma that does not depend on the IntPr meta-function.
lemma Finite1_L5:
assumes A1: \( \forall A B.\ ((A\in T \wedge B\in T) \longrightarrow A\cap B\in T) \) and A2: \( N\neq 0 \) and A3: \( N\in Fin(T) \)
shows \( \bigcap N \in T \)proofThe images of finite subsets by a meta-function are finite. For example in topology if we have a finite collection of sets, then closing each of them results in a finite collection of closed sets. This is a very useful lemma with many unexpected applications. The proof is by induction. The next lemma is the induction step.
lemma fin_image_fin_IndStep:
assumes \( \forall V\in B.\ K(V)\in C \) and \( U\in B \) and \( N\in Fin(B) \) and \( U\notin N \) and \( \{K(V).\ V\in N\}\in Fin(C) \)
shows \( \{K(V).\ V\in cons(U,N)\} \in Fin(C) \) using assmsThe lemma:
lemma fin_image_fin:
assumes A1: \( \forall V\in B.\ K(V)\in C \) and A2: \( N\in Fin(B) \)
shows \( \{K(V).\ V\in N\} \in Fin(C) \)proofThe image of a finite set is finite.
lemma Finite1_L6A:
assumes A1: \( f:X\rightarrow Y \) and A2: \( N \in Fin(X) \)
shows \( f(N) \in Fin(Y) \)proofIf the set defined by a meta-function is finite, then every set defined by a composition of this meta function with another one is finite.
lemma Finite1_L6B:
assumes A1: \( \forall x\in X.\ a(x) \in Y \) and A2: \( \{b(y).\ y\in Y\} \in Fin(Z) \)
shows \( \{b(a(x)).\ x\in X\} \in Fin(Z) \)proofIf the set defined by a meta-function is finite, then every set defined by a composition of this meta function with another one is finite.
lemma Finite1_L6C:
assumes A1: \( \forall y\in Y.\ b(y) \in Z \) and A2: \( \{a(x).\ x\in X\} \in Fin(Y) \)
shows \( \{b(a(x)).\ x\in X\} \in Fin(Z) \)proofCartesian product of finite sets is finite.
lemma Finite1_L12:
assumes A1: \( A \in Fin(A) \) and A2: \( B \in Fin(B) \)
shows \( A\times B \in Fin(A\times B) \)proofWe define the characterisic meta-function that is the identity on a set and assigns a default value everywhere else.
definition
\( \text{Characteristic}(A,\text{default},x) \equiv (\text{if }x\in A\text{ then }x\text{ else }\text{default}) \)
A finite subset is a finite subset of itself.
lemma Finite1_L13:
assumes A1: \( A \in Fin(X) \)
shows \( A \in Fin(A) \)proofCartesian product of finite subsets is a finite subset of cartesian product.
lemma Finite1_L14:
assumes A1: \( A \in Fin(X) \), \( B \in Fin(Y) \)
shows \( A\times B \in Fin(X\times Y) \)proofThe next lemma is needed in the Group_ZF_3 theory in a couple of places.
lemma Finite1_L15:
assumes A1: \( \{b(x).\ x\in A\} \in Fin(B) \), \( \{c(x).\ x\in A\} \in Fin(C) \) and A2: \( f : B\times C\rightarrow E \)
shows \( \{f\langle b(x),c(x)\rangle .\ x\in A\} \in Fin(E) \)proofSingletons are in the finite powerset.
lemma Finite1_L16:
assumes \( x\in X \)
shows \( \{x\} \in Fin(X) \) using assms, emptyI, consIA special case of Finite1_L15 where the second set is a singleton. In Group_ZF_3 theory this corresponds to the situation where we multiply by a constant.
lemma Finite1_L16AA:
assumes \( \{b(x).\ x\in A\} \in Fin(B) \) and \( c\in C \) and \( f : B\times C\rightarrow E \)
shows \( \{f\langle b(x),c\rangle .\ x\in A\} \in Fin(E) \)proofFirst order version of the induction for the finite powerset.
lemma Finite1_L16B:
assumes A1: \( P(0) \) and A2: \( B\in Fin(X) \) and A3: \( \forall A\in Fin(X).\ \forall x\in X.\ x\notin A \wedge P(A)\longrightarrow P(A\cup \{x\}) \)
shows \( P(B) \)proofIn this section we define functions \(f : X\rightarrow Y\), with the property that \(f(X)\) is a finite subset of \(Y\). Such functions play a important role in the construction of real numbers in the Real_ZF series.
Definition of finite range functions.
definition
\( \text{FinRangeFunctions}(X,Y) \equiv \{f:X\rightarrow Y.\ f(X) \in Fin(Y)\} \)
Constant functions have finite range.
lemma Finite1_L17:
assumes \( c\in Y \) and \( X\neq 0 \)
shows \( \text{ConstantFunction}(X,c) \in \text{FinRangeFunctions}(X,Y) \) using assms, func1_3_L1, func_imagedef, func1_3_L2, Finite1_L16, FinRangeFunctions_defFinite range functions have finite range.
lemma Finite1_L18:
assumes \( f \in \text{FinRangeFunctions}(X,Y) \)
shows \( \{f(x).\ x\in X\} \in Fin(Y) \) using assms, FinRangeFunctions_def, func_imagedefAn alternative form of the definition of finite range functions.
lemma Finite1_L19:
assumes \( f:X\rightarrow Y \) and \( \{f(x).\ x\in X\} \in Fin(Y) \)
shows \( f \in \text{FinRangeFunctions}(X,Y) \) using assms, func_imagedef, FinRangeFunctions_defA composition of a finite range function with another function is a finite range function.
lemma Finite1_L20:
assumes A1: \( f \in \text{FinRangeFunctions}(X,Y) \) and A2: \( g : Y\rightarrow Z \)
shows \( g\circ f \in \text{FinRangeFunctions}(X,Z) \)proofImage of any subset of the domain of a finite range function is finite.
lemma Finite1_L21:
assumes \( f \in \text{FinRangeFunctions}(X,Y) \) and \( A\subseteq X \)
shows \( f(A) \in Fin(Y) \)proofassumes \( \forall V\in TA.\ \exists U\in T.\ V=U\cap A \) and \( W\in TA \) and \( M\in Fin(TA) \) and \( W\notin M \) and \( \text{Prfin}(T,A,M) \)
shows \( \text{Prfin}(T,A,cons(W,M)) \)assumes \( \forall V \in TA.\ \exists U\in T.\ V=U\cap A \)
shows \( \forall M\in Fin(TA).\ \text{Prfin}(T,A,M) \)assumes \( \forall A B.\ ((A\in C \wedge B\in C) \longrightarrow A\cup B\in C) \) and \( A\in C \) and \( N\in Fin(C) \) and \( A\notin N \) and \( \bigcup N \in C \)
shows \( \bigcup cons(A,N) \in C \)assumes \( \forall A B.\ ((A\in T \wedge B\in T) \longrightarrow A\cap B\in T) \) and \( A\in T \) and \( N\in Fin(T) \) and \( A\notin N \) and \( \text{IntPr}(T,N) \)
shows \( \text{IntPr}(T,cons(A,N)) \)assumes \( \forall A B.\ A\in T \wedge B\in T \longrightarrow A\cap B \in T \) and \( N\in Fin(T) \)
shows \( \text{IntPr}(T,N) \)assumes \( \forall V\in B.\ K(V)\in C \) and \( U\in B \) and \( N\in Fin(B) \) and \( U\notin N \) and \( \{K(V).\ V\in N\}\in Fin(C) \)
shows \( \{K(V).\ V\in cons(U,N)\} \in Fin(C) \)assumes \( \forall V\in B.\ K(V)\in C \) and \( N \in \text{FinPow}(B) \)
shows \( \{K(V).\ V\in N\} \in \text{FinPow}(C) \)assumes \( f:X\rightarrow Y \) and \( A\subseteq X \)
shows \( f(A) = \{f(x).\ x \in A\} \)assumes \( A \in Fin(X) \)
shows \( A \in Fin(A) \)assumes \( A \in Fin(A) \) and \( B \in Fin(B) \)
shows \( A\times B \in Fin(A\times B) \)assumes \( A \in Fin(X) \), \( B \in Fin(Y) \)
shows \( A\times B \in Fin(X\times Y) \)assumes \( f:X\rightarrow Y \) and \( N \in Fin(X) \)
shows \( f(N) \in Fin(Y) \)assumes \( f \in X\rightarrow Y \) and \( \forall x\in A.\ b(x) \in X \)
shows \( f(\{b(x).\ x\in A\}) = \{f(b(x)).\ x\in A\} \)assumes \( \forall y\in Y.\ b(y) \in Z \) and \( \{a(x).\ x\in X\} \in Fin(Y) \)
shows \( \{b(a(x)).\ x\in X\} \in Fin(Z) \)assumes \( c\in Y \)
shows \( \text{ConstantFunction}(X,c) : X\rightarrow Y \)assumes \( x\in X \)
shows \( \text{ConstantFunction}(X,c)(x) = c \)assumes \( x\in X \)
shows \( \{x\} \in Fin(X) \)assumes \( f \in \text{FinRangeFunctions}(X,Y) \)
shows \( \{f(x).\ x\in X\} \in Fin(Y) \)assumes \( f:X\rightarrow Y \) and \( \{f(x).\ x\in X\} \in Fin(Y) \)
shows \( f \in \text{FinRangeFunctions}(X,Y) \)assumes \( A\subseteq B \)
shows \( f(A)\subseteq f(B) \)