In this theory we discuss sequences defined by conditions of the form \(a_0 = x,\ a_{n+1} = f(a_n)\) and similar.
One way of defining a sequence (that is a function \(a:\mathbb{N}\rightarrow X\)) is to provide the first element of the sequence and a function to find the next value when we have the current one. This is usually called "defining a sequence by induction". In this section we set up the notion of a sequence defined by induction and prove the theorems needed to use it.
First we define a helper notion of the sequence defined inductively up to a given natural number \(n\).
definition
\( \text{InductiveSequenceN}(x,f,n) \equiv \) \( \text{The } a.\ a: succ(n) \rightarrow domain(f) \wedge a(0) = x \wedge (\forall k\in n.\ a(succ(k)) = f(a(k))) \)
From that we define the inductive sequence on the whole set of natural numbers. Recall that in Isabelle/ZF the set of natural numbers is denoted nat.
definition
\( \text{InductiveSequence}(x,f) \equiv \bigcup n\in nat.\ \text{InductiveSequenceN}(x,f,n) \)
First we will consider the question of existence and uniqueness of finite inductive sequences. The proof is by induction and the next lemma is the \(P(0)\) step. To understand the notation recall that for natural numbers in set theory we have \(n = \{0,1,..,n-1\}\) and \( succ(n) \)\( = \{0,1,..,n\}\).
lemma indseq_exun0:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \)
shows \( \exists ! a.\ a: succ(0) \rightarrow X \wedge a(0) = x \wedge ( \forall k\in 0.\ a(succ(k)) = f(a(k)) ) \)proofA lemma about restricting finite sequences needed for the proof of the inductive step of the existence and uniqueness of finite inductive seqences.
lemma indseq_restrict:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \) and A4: \( a: succ(succ(n))\rightarrow X \wedge a(0) = x \wedge (\forall k\in succ(n).\ a(succ(k)) = f(a(k))) \) and A5: \( a_r = \text{restrict}(a,succ(n)) \)
shows \( a_r: succ(n) \rightarrow X \wedge a_r(0) = x \wedge ( \forall k\in n.\ a_r(succ(k)) = f(a_r(k)) ) \)proofExistence and uniqueness of finite inductive sequences. The proof is by induction and the next lemma is the inductive step.
lemma indseq_exun_ind:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \) and A4: \( \exists ! a.\ a: succ(n) \rightarrow X \wedge a(0) = x \wedge (\forall k\in n.\ a(succ(k)) = f(a(k))) \)
shows \( \exists ! a.\ a: succ(succ(n)) \rightarrow X \wedge a(0) = x \wedge \) \( ( \forall k\in succ(n).\ a(succ(k)) = f(a(k)) ) \)proofThe next lemma combines indseq_exun0 and indseq_exun_ind to show the existence and uniqueness of finite sequences defined by induction.
lemma indseq_exun:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \)
shows \( \exists ! a.\ a: succ(n) \rightarrow X \wedge a(0) = x \wedge (\forall k\in n.\ a(succ(k)) = f(a(k))) \)proofWe are now ready to prove the main theorem about finite inductive sequences.
theorem fin_indseq_props:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \) and A4: \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)proofSince we have uniqueness we can show the inverse of fin_indseq_props: a sequence that satisfies the inductive sequence properties listed there is the inductively defined sequence.
lemma is_fin_indseq:
assumes \( n \in nat \), \( f: X\rightarrow X \), \( x\in X \) and \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)
shows \( a = \text{InductiveSequenceN}(x,f,n) \)proofA corollary about the domain of a finite inductive sequence.
corollary fin_indseq_domain:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \)
shows \( domain( \text{InductiveSequenceN}(x,f,n)) = succ(n) \)proofThe collection of finite sequences defined by induction is consistent in the sense that the restriction of the sequence defined on a larger set to the smaller set is the same as the sequence defined on the smaller set.
lemma indseq_consistent:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( i \in nat \), \( j \in nat \) and A4: \( i \subseteq j \)
shows \( \text{restrict}( \text{InductiveSequenceN}(x,f,j),succ(i)) = \text{InductiveSequenceN}(x,f,i) \)proofFor any two natural numbers one of the corresponding inductive sequences is contained in the other.
lemma indseq_subsets:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( i \in nat \), \( j \in nat \) and A4: \( a = \text{InductiveSequenceN}(x,f,i) \), \( b = \text{InductiveSequenceN}(x,f,j) \)
shows \( a \subseteq b \vee b \subseteq a \)proofThe inductive sequence generated by applying a function 0 times is just the singleton list containing the starting point.
lemma indseq_empty:
assumes \( f: X\rightarrow X \), \( x\in X \)
shows \( \text{InductiveSequenceN}(x,f,0):\{0\}\rightarrow X \), \( \text{InductiveSequenceN}(x,f,0) = \{\langle 0,x\rangle \} \)proofThe tail of an inductive sequence generated by \(f\) and started from \(x\) is the same as the inductive sequence started from \(f(x)\).
lemma indseq_tail:
assumes \( n \in nat \), \( f: X\rightarrow X \), \( x\in X \)
shows \( \text{Tail}( \text{InductiveSequenceN}(x,f,succ(n))) = \text{InductiveSequenceN}(f(x),f,n) \)proofThe first theorem about properties of infinite inductive sequences: inductive sequence is a indeed a sequence (i.e. a function on the set of natural numbers.
theorem indseq_seq:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \)
shows \( \text{InductiveSequence}(x,f) : nat \rightarrow X \)proofRestriction of an inductive sequence to a finite domain is the corresponding finite inductive sequence.
lemma indseq_restr_eq:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \)
shows \( \text{restrict}( \text{InductiveSequence}(x,f),succ(n)) = \text{InductiveSequenceN}(x,f,n) \)proofThe first element of the inductive sequence starting at \(x\) and generated by \(f\) is indeed \(x\).
theorem indseq_valat0:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \)
shows \( \text{InductiveSequence}(x,f)(0) = x \)proofAn infinite inductive sequence satisfies the inductive relation that defines it.
theorem indseq_vals:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( n \in nat \)
shows \( \text{InductiveSequence}(x,f)(succ(n)) = f( \text{InductiveSequence}(x,f)(n)) \)proofIn this section we consider the properties of sets that are images of inductive sequences, that is are of the form \(\{f^{(n)} (x) : n \in N\}\) for some \(x\) in the domain of \(f\), where \(f^{(n)}\) denotes the \(n\)'th iteration of the function \(f\). For a function \(f:X\rightarrow X\) and a point \(x\in X\) such set is set is sometimes called the orbit of \(x\) generated by \(f\).
The basic properties of orbits.
theorem ind_seq_image:
assumes A1: \( f: X\rightarrow X \) and A2: \( x\in X \) and A3: \( A = \text{InductiveSequence}(x,f)(nat) \)
shows \( x\in A \) and \( \forall y\in A.\ f(y) \in A \)proofIn algebra we often talk about sets "generated" by an element, that is sets of the form (in multiplicative notation) \(\{a^n | n\in Z\}\). This is a related to a general notion of "power" (as in \(a^n = a\cdot a \cdot .. \cdot a\) ) or multiplicity \(n\cdot a = a+a+..+a\). The intuitive meaning of such notions is obvious, but we need to do some work to be able to use it in the formalized setting. This sections is devoted to sequences that are created by repeatedly applying a binary operation with the second argument fixed to some constant.
Basic propertes of sets generated by binary operations.
theorem binop_gen_set:
assumes A1: \( f: X\times Y \rightarrow X \) and A2: \( x\in X \), \( y\in Y \) and A3: \( a = \text{InductiveSequence}(x, \text{Fix2ndVar}(f,y)) \)
shows \( a : nat \rightarrow X \), \( a(nat) \in Pow(X) \), \( x \in a(nat) \), \( \forall z \in a(nat).\ \text{Fix2ndVar}(f,y)(z) \in a(nat) \)proofA simple corollary to the theorem binop_gen_set: a set that contains all iterations of the application of a binary operation exists.
lemma binop_gen_set_ex:
assumes A1: \( f: X\times Y \rightarrow X \) and A2: \( x\in X \), \( y\in Y \)
shows \( \{A \in Pow(X).\ x\in A \wedge (\forall z \in A.\ f\langle z,y\rangle \in A) \} \neq 0 \)proofA more general version of binop_gen_set where the generating binary operation acts on a larger set.
theorem binop_gen_set1:
assumes A1: \( f: X\times Y \rightarrow X \) and A2: \( X_1 \subseteq X \) and A3: \( x\in X_1 \), \( y\in Y \) and A4: \( \forall t\in X_1.\ f\langle t,y\rangle \in X_1 \) and A5: \( a = \text{InductiveSequence}(x, \text{Fix2ndVar}(\text{restrict}(f,X_1\times Y),y)) \)
shows \( a : nat \rightarrow X_1 \), \( a(nat) \in Pow(X_1) \), \( x \in a(nat) \), \( \forall z \in a(nat).\ \text{Fix2ndVar}(f,y)(z) \in a(nat) \), \( \forall z \in a(nat).\ f\langle z,y\rangle \in a(nat) \)proofA generalization of binop_gen_set_ex that applies when the binary operation acts on a larger set. This is used in our Metamath translation to prove the existence of the set of real natural numbers. Metamath defines the real natural numbers as the smallest set that cantains \(1\) and is closed with respect to operation of adding \(1\).
lemma binop_gen_set_ex1:
assumes A1: \( f: X\times Y \rightarrow X \) and A2: \( X_1 \subseteq X \) and A3: \( x\in X_1 \), \( y\in Y \) and A4: \( \forall t\in X_1.\ f\langle t,y\rangle \in X_1 \)
shows \( \{A \in Pow(X_1).\ x\in A \wedge (\forall z \in A.\ f\langle z,y\rangle \in A) \} \neq 0 \)proofA seemingly more general form of a sequence defined by induction is a sequence generated by the difference equation \(x_{n+1} = f_{n} (x_n)\) where \(n\mapsto f_n\) is a given sequence of functions such that each maps \(X\) into inself. For example when \(f_n (x) := x + x_n\) then the equation \(S_{n+1} = f_{n} (S_n)\) describes the sequence \(n \mapsto S_n = s_0 +\sum_{i=0}^n x_n\), i.e. the sequence of partial sums of the sequence \(\{s_0, x_0, x_1, x_3,..\}\).
The situation where the function that we iterate changes with \(n\) can be derived from the simpler case if we define the generating function appropriately. Namely, we replace the generating function in the definitions of InductiveSequenceN by the function \(f: X\times n \rightarrow X\times n\), \(f\langle x,k\rangle = \langle f_k(x), k+1 \rangle\) if \(k < n\), \(\langle f_k(x), k \rangle\) otherwise. The first notion defines the expression we will use to define the generating function. To understand the notation recall that in standard Isabelle/ZF for a pair \(s=\langle x,n \rangle\) we have fst\((s)=x\) and snd\((s)=n\).
definition
\( \text{StateTransfFunNMeta}(F,n,s) \equiv \) \( \text{if }(\text{snd}(s) \in n)\text{ then }\langle F(\text{snd}(s))(\text{fst}(s)), succ(\text{snd}(s))\rangle \text{ else }s \)
Then we define the actual generating function on sets of pairs from \(X\times \{0,1, .. ,n\}\).
definition
\( \text{StateTransfFunN}(X,F,n) \equiv \{\langle s, \text{StateTransfFunNMeta}(F,n,s)\rangle .\ s \in X\times succ(n)\} \)
Having the generating function we can define the expression that we cen use to define the inductive sequence generates.
definition
\( \text{StatesSeq}(x,X,F,n) \equiv \) \( \text{InductiveSequenceN}(\langle x,0\rangle , \text{StateTransfFunN}(X,F,n),n) \)
Finally we can define the sequence given by a initial point \(x\), and a sequence \(F\) of \(n\) functions.
definition
\( \text{InductiveSeqVarFN}(x,X,F,n) \equiv \{\langle k,\text{fst}( \text{StatesSeq}(x,X,F,n)(k))\rangle .\ k \in succ(n)\} \)
The state transformation function (StateTransfFunN is a function that transforms \(X\times n\) into itself.
lemma state_trans_fun:
assumes A1: \( n \in nat \) and A2: \( F: n \rightarrow (X\rightarrow X) \)
shows \( \text{StateTransfFunN}(X,F,n): X\times succ(n) \rightarrow X\times succ(n) \)proofWe can apply fin_indseq_props to the sequence used in the definition of InductiveSeqVarFN to get the properties of the sequence of states generated by the StateTransfFunN.
lemma states_seq_props:
assumes A1: \( n \in nat \) and A2: \( F: n \rightarrow (X\rightarrow X) \) and A3: \( x\in X \) and A4: \( b = \text{StatesSeq}(x,X,F,n) \)
shows \( b : succ(n) \rightarrow X\times succ(n) \), \( b(0) = \langle x,0\rangle \), \( \forall k \in succ(n).\ \text{snd}(b(k)) = k \), \( \forall k\in n.\ b(succ(k)) = \langle F(k)(\text{fst}(b(k))), succ(k)\rangle \)proofBasic properties of sequences defined by equation \(x_{n+1}=f_n (x_n)\).
theorem fin_indseq_var_f_props:
assumes A1: \( n \in nat \) and A2: \( x\in X \) and A3: \( F: n \rightarrow (X\rightarrow X) \) and A4: \( a = \text{InductiveSeqVarFN}(x,X,F,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = F(k)(a(k)) \)proofUniqueness lemma for sequences generated by equation \(x_{n+1}=f_n (x_n)\):
lemma fin_indseq_var_f_uniq:
assumes \( n\in nat \), \( x\in X \), \( F: n \rightarrow (X\rightarrow X) \) and \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = (F(k))(a(k)) \) and \( b: succ(n) \rightarrow X \), \( b(0) = x \), \( \forall k\in n.\ b(succ(k)) = (F(k))(b(k)) \)
shows \( a=b \)proofA sequence that has the properties of sequences generated by equation \(x_{n+1}=f_n (x_n)\) must be the one generated by this equation.
theorem is_fin_indseq_var_f:
assumes \( n\in nat \), \( x\in X \), \( F: n \rightarrow (X\rightarrow X) \) and \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = (F(k))(a(k)) \)
shows \( a = \text{InductiveSeqVarFN}(x,X,F,n) \)proofA consistency condition: if we make the sequence of generating functions shorter, then we get a shorter inductive sequence with the same values as in the original sequence.
lemma fin_indseq_var_f_restrict:
assumes A1: \( n \in nat \), \( i \in nat \), \( x\in X \), \( F: n \rightarrow (X\rightarrow X) \), \( G: i \rightarrow (X\rightarrow X) \) and A2: \( i \subseteq n \) and A3: \( \forall j\in i.\ G(j) = F(j) \) and A4: \( k \in succ(i) \)
shows \( \text{InductiveSeqVarFN}(x,X,G,i)(k) = \text{InductiveSeqVarFN}(x,X,F,n)(k) \)proofOne possible application of the inductive sequences is to define the Pascal's triangle. The Pascal's triangle can be defined directly as \(P_{n,k} = {n\choose k}= \frac{n!}{k!(n-k)!}\) for \(n\geq k \geq 0\). Formalizing this definition (or explaining to a 10-years old) is quite difficult as it depends on the definition of factorial and some facts about factorizing natural numbers needed to show that the quotient in \(\frac{n!}{k!(n-k)!}\) is always a natural number. Another approach uses induction and the property that each number in the array is the sum of the two numbers directly above it.
To shorten the definition of the function generating the Pascal's trangle we first define expression for the k'th element in the row following given row \(r\). The rows are represented as lists, i.e. functions \(r:n\rightarrow \mathbb{N}\) (recall that for natural numbers we have \(n=\{ 0,1,2,...,n-1\})\). The value of the next row is 1 at the beginning and equals \(r(k-1)+r(k)\) otherwise. A careful reader might wonder why we do not require the values to be 1 on the right boundary of the Pascal's triangle. We are able to show this as a theorem (see binom_right_boundary below) using the fact that in Isabelle/ZF the value of a function on an argument that is outside of the domain is the empty set, which is the same as zero of natural numbers.
definition
\( \text{BinomElem}(r,k) \equiv \text{if }k=0\text{ then }1\text{ else }r(pred(k)) + r(k) \)
Next we define a function that takes a row in a Pascal's triangle and returns the next row.
definition
\( GenBinom \equiv \{\langle r,\{\langle k, \text{BinomElem}(r,k)\rangle .\ k\in succ(domain(r))\}\rangle .\ r\in \text{NELists}(nat)\} \)
The function generating rows of the Pascal's triangle is indeed a function that maps nonempty lists of natural numbers into nonempty lists of natural numbers.
lemma gen_binom_fun:
shows \( GenBinom: \text{NELists}(nat) \rightarrow \text{NELists}(nat) \)proofThe value of the function GenBinom at a nonempty list \(r\) is a list of length one greater than the length of \(r\).
lemma gen_binom_fun_val:
assumes \( n\in nat \), \( r:succ(n)\rightarrow nat \)
shows \( GenBinom(r):succ(succ(n)) \rightarrow nat \)proofNow we are ready to define the Pascal's triangle as the inductive sequence that starts from a singleton list \(0\mapsto 1\) and is generated by iterations of the GenBinom function.
definition
\( PascalTriangle \equiv \text{InductiveSequence}(\{\langle 0,1\rangle \},GenBinom) \)
The singleton list containing 1 (i.e. the starting point of the inductive sequence that defines the PascalTriangle) is a finite list and the PascalTriangle is a sequence (an infinite list) of nonempty lists of natural numbers.
lemma pascal_sequence:
shows \( \{\langle 0,1\rangle \} \in \text{NELists}(nat) \) and \( PascalTriangle: nat \rightarrow \text{NELists}(nat) \) using list_len1_singleton(2), gen_binom_fun, indseq_seq unfolding PascalTriangle_defThe GenBinom function creates the next row of the Pascal's triangle from the previous one.
lemma binom_gen:
assumes \( n\in nat \)
shows \( PascalTriangle(succ(n)) = GenBinom(PascalTriangle(n)) \) using assms, pascal_sequence, gen_binom_fun, indseq_vals unfolding PascalTriangle_defThe \(n\)'th row of the Pascal's triangle is a list of \(n+1\) natural numbers.
lemma pascal_row_list:
assumes \( n\in nat \)
shows \( PascalTriangle(n):succ(n)\rightarrow nat \)proofIn our approach the Pascal's triangle is a list of lists. The value at index \(n\in \mathbb{N}\) is a list of length \(n+1\) (see pascal_row_list above). Hence, the largest index in the domain of this list is \(n\). However, we can still show that the value of that list at index \(n+1\) is 0, because in Isabelle/ZF (as well as in Metamath) the value of a function at a point outside of the domain is the empty set, which happens to be the same as the natural number 0.
lemma pascal_val_beyond:
assumes \( n\in nat \)
shows \( (PascalTriangle(n))(succ(n)) = 0 \)proofFor \(n>0\) the Pascal's triangle values at \((n,k)\) are given by the BinomElem expression.
lemma pascal_row_val:
assumes \( n\in nat \), \( k\in succ(succ(n)) \)
shows \( (PascalTriangle(succ(n)))(k) = \text{BinomElem}(PascalTriangle(n),k) \)proofThe notion that will actually be used is the binomial coefficient \({n\choose k}\) which we define as the value at the right place of the Pascal's triangle.
definition
\( {{n}\choose {k}} \equiv (PascalTriangle(n))(k) \)
Entries in the Pascal's triangle are natural numbers. Since in Isabelle/ZF the value of a function at a point that is outside of the domain is the empty set (which is the same as zero of natural numbers) we do not need any assumption on \(k\).
lemma binom_in_nat:
assumes \( n\in nat \)
shows \( {{n}\choose {k}} \in nat \)proofThe top of the Pascal's triangle is equal to 1 (i.e. \({0\choose 0}=1\)). This is an easy fact that it is useful to have handy as it is at the start of a couple of inductive arguments.
lemma binom_zero_zero:
shows \( {{0}\choose {0}} = 1 \) using gen_binom_fun, pascal_sequence(1), indseq_valat0, pair_val unfolding Binom_def, PascalTriangle_defThe binomial coefficients are 1 on the left boundary of the Pascal's triangle.
theorem binom_left_boundary:
assumes \( n\in nat \)
shows \( {{n}\choose {0}} = 1 \)proofThe main recursive property of binomial coefficients: each number in the \({n\choose k}\), \(n>0, 0\neq k\leq n\) array (i.e. the Pascal's triangle except the top) is the sum of the two numbers directly above it. The statement looks like it has an off-by-one error in the assumptions, but it's ok and needed later.
theorem binom_prop:
assumes \( n\in nat \), \( k \leq n + 1 \), \( k\neq 0 \)
shows \( {{n + 1}\choose {k}} = {{n}\choose {k - 1}} + {{n}\choose {k}} \)proofA version binom_prop where we write \(k+1\) instead of \(k\).
lemma binom_prop2:
assumes \( n\in nat \), \( k \in n + 1 \)
shows \( {{n + 1}\choose {k + 1}} = {{n}\choose {k + 1}} + {{n}\choose {k}} \)proofA special case of binom_prop when \(n=k+1\) that helps with the induction step in the proof that the binomial coefficient are 1 on the right boundary of the Pascal's triangle.
lemma binom_prop1:
assumes \( n\in nat \)
shows \( {{n + 1}\choose {n + 1}} = {{n}\choose {n}} \)proofThe binomial coefficients are 1 on the right boundary of the Pascal's triangle.
theorem binom_right_boundary:
assumes \( n\in nat \)
shows \( {{n}\choose {n}} = 1 \)proofassumes \( f : \{a\}\rightarrow X \)
shows \( f = \{\langle a, f(a)\rangle \} \)assumes \( f:X\rightarrow Y \) and \( Y\subseteq Z \)
shows \( f:X\rightarrow Z \)assumes \( n \in nat \)
shows \( 0 \in succ(n) \)assumes \( n \in nat \)
shows \( \forall i \in n.\ succ(i) \in succ(n) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a: succ(succ(n))\rightarrow X \wedge a(0) = x \wedge (\forall k\in succ(n).\ a(succ(k)) = f(a(k))) \) and \( a_r = \text{restrict}(a,succ(n)) \)
shows \( a_r: succ(n) \rightarrow X \wedge a_r(0) = x \wedge ( \forall k\in n.\ a_r(succ(k)) = f(a_r(k)) ) \)assumes \( n \in nat \) and \( a: succ(n) \rightarrow X \), \( b: succ(n) \rightarrow X \) and \( \text{restrict}(a,n) = \text{restrict}(b,n) \) and \( a(n) = b(n) \)
shows \( a = b \)assumes \( a:n\rightarrow X \), \( y\in X \), \( b = a \cup \{\langle n,y\rangle \} \)
shows \( b: succ(n) \rightarrow X \), \( \forall k\in n.\ b(k) = a(k) \), \( b(n) = y \)assumes \( f: X\rightarrow X \) and \( x\in X \)
shows \( \exists ! a.\ a: succ(0) \rightarrow X \wedge a(0) = x \wedge ( \forall k\in 0.\ a(succ(k)) = f(a(k)) ) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( \exists ! a.\ a: succ(n) \rightarrow X \wedge a(0) = x \wedge (\forall k\in n.\ a(succ(k)) = f(a(k))) \)
shows \( \exists ! a.\ a: succ(succ(n)) \rightarrow X \wedge a(0) = x \wedge \) \( ( \forall k\in succ(n).\ a(succ(k)) = f(a(k)) ) \)assumes \( n\in nat \) and \( P(0) \) and \( \forall k\in nat.\ P(k)\longrightarrow P(succ(k)) \)
shows \( P(n) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \)
shows \( \exists ! a.\ a: succ(n) \rightarrow X \wedge a(0) = x \wedge (\forall k\in n.\ a(succ(k)) = f(a(k))) \)assumes \( f:A\rightarrow C \)
shows \( domain(f) = A \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)assumes \( k \in nat \), \( n \in nat \) and \( k\subseteq n \)
shows \( succ(k) \subseteq succ(n) \)assumes \( i \in nat \), \( j \in nat \)
shows \( i \subseteq j \vee j \subseteq i \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( i \in nat \), \( j \in nat \) and \( i \subseteq j \)
shows \( \text{restrict}( \text{InductiveSequenceN}(x,f,j),succ(i)) = \text{InductiveSequenceN}(x,f,i) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)assumes \( n \in nat \) and \( a: succ(n) \rightarrow X \)
shows \( \text{Tail}(a) : n \rightarrow X \), \( \forall k \in n.\ \text{Tail}(a)(k) = a(succ(k)) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \) and \( a = \text{InductiveSequenceN}(x,f,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)assumes \( n \in nat \), \( f: X\rightarrow X \), \( x\in X \) and \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = f(a(k)) \)
shows \( a = \text{InductiveSequenceN}(x,f,n) \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( i \in nat \), \( j \in nat \) and \( a = \text{InductiveSequenceN}(x,f,i) \), \( b = \text{InductiveSequenceN}(x,f,j) \)
shows \( a \subseteq b \vee b \subseteq a \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \)
shows \( domain( \text{InductiveSequenceN}(x,f,n)) = succ(n) \)assumes \( f:X\rightarrow Y \), \( x\in X \), \( y = f(x) \)
shows \( \langle x,y\rangle \in f \), \( y \in \text{range}(f) \)assumes \( \langle x,y\rangle \in f \) and \( f:X\rightarrow Y \)
shows \( x\in X \wedge y\in Y \)assumes \( f:X\rightarrow Y \) and \( \forall x\in X.\ f(x) \in Z \)
shows \( f:X\rightarrow Z \)assumes \( f: X\rightarrow X \) and \( x\in X \)
shows \( \text{InductiveSequence}(x,f) : nat \rightarrow X \)assumes \( n \in nat \)
shows \( succ(n) \subseteq nat \)assumes \( \bigcup F : X\rightarrow Y \) and \( f\in F \) and \( f:A\rightarrow B \) and \( x\in A \)
shows \( (\bigcup F)(x) = f(x) \)assumes \( f: X\rightarrow Y \), \( g: X\rightarrow Z \) and \( \forall x\in X.\ f(x) = g(x) \)
shows \( f = g \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \)
shows \( \text{restrict}( \text{InductiveSequence}(x,f),succ(n)) = \text{InductiveSequenceN}(x,f,n) \)assumes \( f:X\rightarrow Y \) and \( A\subseteq X \)
shows \( f(A) = \{f(x).\ x \in A\} \)assumes \( f: X\rightarrow X \) and \( x\in X \)
shows \( \text{InductiveSequence}(x,f)(0) = x \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \)
shows \( \text{InductiveSequence}(x,f)(succ(n)) = f( \text{InductiveSequence}(x,f)(n)) \)assumes \( f : X\times Y \rightarrow Z \) and \( y\in Y \)
shows \( \text{Fix2ndVar}(f,y) : X \rightarrow Z \)assumes \( f:X\rightarrow Y \)
shows \( f(B) \subseteq \text{range}(f) \) and \( f(B) \subseteq Y \)assumes \( f: X\rightarrow X \) and \( x\in X \) and \( A = \text{InductiveSequence}(x,f)(nat) \)
shows \( x\in A \) and \( \forall y\in A.\ f(y) \in A \)assumes \( f: X\times Y \rightarrow X \) and \( x\in X \), \( y\in Y \) and \( a = \text{InductiveSequence}(x, \text{Fix2ndVar}(f,y)) \)
shows \( a : nat \rightarrow X \), \( a(nat) \in Pow(X) \), \( x \in a(nat) \), \( \forall z \in a(nat).\ \text{Fix2ndVar}(f,y)(z) \in a(nat) \)assumes \( f : X\times Y \rightarrow Z \) and \( x\in X \), \( y\in Y \)
shows \( \text{Fix1stVar}(f,x)(y) = f\langle x,y\rangle \), \( \text{Fix2ndVar}(f,y)(x) = f\langle x,y\rangle \)assumes \( f : X\times Y \rightarrow Z \) and \( y\in Y \) and \( X_1 \subseteq X \)
shows \( \text{Fix2ndVar}(\text{restrict}(f,X_1\times Y),y) = \text{restrict}( \text{Fix2ndVar}(f,y),X_1) \)assumes \( f: X\times Y \rightarrow X \) and \( X_1 \subseteq X \) and \( x\in X_1 \), \( y\in Y \) and \( \forall t\in X_1.\ f\langle t,y\rangle \in X_1 \) and \( a = \text{InductiveSequence}(x, \text{Fix2ndVar}(\text{restrict}(f,X_1\times Y),y)) \)
shows \( a : nat \rightarrow X_1 \), \( a(nat) \in Pow(X_1) \), \( x \in a(nat) \), \( \forall z \in a(nat).\ \text{Fix2ndVar}(f,y)(z) \in a(nat) \), \( \forall z \in a(nat).\ f\langle z,y\rangle \in a(nat) \)assumes \( \forall x\in X.\ b(x) \in Y \)
shows \( \{\langle x,b(x)\rangle .\ x\in X\} : X\rightarrow Y \)assumes \( n \in nat \) and \( F: n \rightarrow (X\rightarrow X) \)
shows \( \text{StateTransfFunN}(X,F,n): X\times succ(n) \rightarrow X\times succ(n) \)assumes \( f:X\rightarrow Y \), \( x\in X \) and \( f = \{\langle x,b(x)\rangle .\ x\in X\} \)
shows \( f(x) = b(x) \) and \( b(x)\in Y \)assumes \( n \in nat \) and \( k \in succ(n) \) and \( P(0) \) and \( \forall j\in n.\ P(j) \longrightarrow P(succ(j)) \)
shows \( P(k) \)assumes \( n \in nat \) and \( F: n \rightarrow (X\rightarrow X) \) and \( x\in X \) and \( b = \text{StatesSeq}(x,X,F,n) \)
shows \( b : succ(n) \rightarrow X\times succ(n) \), \( b(0) = \langle x,0\rangle \), \( \forall k \in succ(n).\ \text{snd}(b(k)) = k \), \( \forall k\in n.\ b(succ(k)) = \langle F(k)(\text{fst}(b(k))), succ(k)\rangle \)assumes \( n\in nat \), \( A\subseteq n \), \( A\neq 0 \)
shows \( \text{Maximum}(Le,A) \in A \), \( \text{Maximum}(Le,A) \in nat \), \( \forall k\in A.\ k \leq \text{Maximum}(Le,A) \)assumes \( k\in succ(n) \), \( k\neq n \)
shows \( k\in n \)assumes \( n \in nat \) and \( n\neq 0 \)
shows \( \exists k\in nat.\ n = succ(k) \)assumes \( n \in nat \), \( succ(k) \in succ(n) \)
shows \( k\in n \)assumes \( \forall t\in X.\ \phi (t) \) and \( x\in X \)
shows \( \phi (x) \)assumes \( n \in nat \) and \( x\in X \) and \( F: n \rightarrow (X\rightarrow X) \) and \( a = \text{InductiveSeqVarFN}(x,X,F,n) \)
shows \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = F(k)(a(k)) \)assumes \( n\in nat \), \( x\in X \), \( F: n \rightarrow (X\rightarrow X) \) and \( a: succ(n) \rightarrow X \), \( a(0) = x \), \( \forall k\in n.\ a(succ(k)) = (F(k))(a(k)) \) and \( b: succ(n) \rightarrow X \), \( b(0) = x \), \( \forall k\in n.\ b(succ(k)) = (F(k))(b(k)) \)
shows \( a=b \)assumes \( x\in X \)
shows \( \{\langle x,b(x)\rangle .\ x\in X\}(x)=b(x) \)assumes \( x\in X \)
shows \( \{\langle 0,x\rangle \} : 1 \rightarrow X \) and \( \{\langle 0,x\rangle \} \in \text{NELists}(X) \)assumes \( x\in X \)
shows \( \{\langle 0,x\rangle \} : 1 \rightarrow X \) and \( \{\langle 0,x\rangle \} \in \text{NELists}(X) \)assumes \( n\in nat \), \( r:succ(n)\rightarrow nat \)
shows \( GenBinom(r):succ(succ(n)) \rightarrow nat \)assumes \( n\in nat \)
shows \( PascalTriangle(n):succ(n)\rightarrow nat \)assumes \( n\in nat \)
shows \( PascalTriangle(succ(n)) = GenBinom(PascalTriangle(n)) \)assumes \( n\in nat \), \( k\in succ(succ(n)) \)
shows \( (PascalTriangle(succ(n)))(k) = \text{BinomElem}(PascalTriangle(n),k) \)assumes \( n\in nat \)
shows \( k \lt n \longleftrightarrow k\in n \) and \( k\leq n \longleftrightarrow k \in succ(n) \)assumes \( n\in nat \), \( n\neq 0 \)
shows \( n - 1 = pred(n) \)assumes \( n \in nat \) and \( k\in n \)
shows \( k \lt n \), \( k \in nat \), \( k \leq n \), \( \langle k,n\rangle \in Le \)assumes \( n \in nat \), \( k \in n + 1 \)
shows \( k + 1 \leq n + 1 \) and \( k\leq n \)assumes \( n\in nat \), \( k \leq n + 1 \), \( k\neq 0 \)
shows \( {{n + 1}\choose {k}} = {{n}\choose {k - 1}} + {{n}\choose {k}} \)assumes \( n\in nat \)
shows \( (PascalTriangle(n))(succ(n)) = 0 \)assumes \( n\in nat \)
shows \( n + 1 = succ(n) \), \( n + 1 \in nat \), \( \{0\} + n = succ(n) \), \( n + \{0\} = succ(n) \), \( succ(n) \in nat \), \( 0 \in n + 1 \), \( n \subseteq n + 1 \)assumes \( n\in nat \)
shows \( n + 1 = succ(n) \), \( n + 1 \in nat \), \( \{0\} + n = succ(n) \), \( n + \{0\} = succ(n) \), \( succ(n) \in nat \), \( 0 \in n + 1 \), \( n \subseteq n + 1 \)assumes \( m\in nat \)
shows \( (m + n) - n = m \)assumes \( n\in nat \)
shows \( {{n + 1}\choose {n + 1}} = {{n}\choose {n}} \)