Description: Define a generalpurpose operation that builds a recursive sequence (i.e., a function on an upper integer set such as NN or NN0 ) whose value at an index is a function of its previous value and the value of an input sequence at that index. This definition is complicated, but fortunately it is not intended to be used directly. Instead, the only purpose of this definition is to provide us with an object that has the properties expressed by seq1 and seqp1 . Typically, those are the main theorems that would be used in practice.
The first operand in the parentheses is the operation that is applied to the previous value and the value of the input sequence (second operand). The operand to the left of the parenthesis is the integer to start from. For example, for the operation + , an input sequence F with values 1, 1/2, 1/4, 1/8,... would be transformed into the output sequence seq 1 ( + , F ) with values 1, 3/2, 7/4, 15/8,.., so that ( seq 1 ( + , F )1 ) = 1 , ( seq 1 ( + , F )2 ) = 3/2, etc. In other words, seq M ( + , F ) transforms a sequence F into an infinite series. seq M ( + , F ) ~> 2 means "the sum of F(n) from n = M to infinity is 2." Since limits are unique ( climuni ), by climdm the "sum of F(n) from n = 1 to infinity" can be expressed as ( ~>seq 1 ( + , F ) ) (provided the sequence converges) and evaluates to 2 in this example.
Internally, the rec function generates as its values a set of ordered pairs starting at <. M , ( FM ) >. , with the first member of each pair incremented by one in each successive value. So, the range of rec is exactly the sequence we want, and we just extract the range (restricted to omega) and throw away the domain.
This definition has its roots in a series of theorems from om2uz0i through om2uzf1oi , originally proved by Raph Levien for use with dfexp and later generalized for arbitrary recursive sequences. Definition dfsum extracts the summation values from partial (finite) and complete (infinite) series. (Contributed by NM, 18Apr2005) (Revised by Mario Carneiro, 4Sep2013)
Ref  Expression  

Assertion  dfseq   seq M ( .+ , F ) = ( rec ( ( x e. _V , y e. _V > <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. ) , <. M , ( F ` M ) >. ) " _om ) 
Step  Hyp  Ref  Expression 

0  cM   M 

1  c.pl   .+ 

2  cF   F 

3  1 2 0  cseq   seq M ( .+ , F ) 
4  vx   x 

5  cvv   _V 

6  vy   y 

7  4  cv   x 
8  caddc   + 

9  c1   1 

10  7 9 8  co   ( x + 1 ) 
11  6  cv   y 
12  10 2  cfv   ( F ` ( x + 1 ) ) 
13  11 12 1  co   ( y .+ ( F ` ( x + 1 ) ) ) 
14  10 13  cop   <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. 
15  4 6 5 5 14  cmpo   ( x e. _V , y e. _V > <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. ) 
16  0 2  cfv   ( F ` M ) 
17  0 16  cop   <. M , ( F ` M ) >. 
18  15 17  crdg   rec ( ( x e. _V , y e. _V > <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. ) , <. M , ( F ` M ) >. ) 
19  com   _om 

20  18 19  cima   ( rec ( ( x e. _V , y e. _V > <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. ) , <. M , ( F ` M ) >. ) " _om ) 
21  3 20  wceq   seq M ( .+ , F ) = ( rec ( ( x e. _V , y e. _V > <. ( x + 1 ) , ( y .+ ( F ` ( x + 1 ) ) ) >. ) , <. M , ( F ` M ) >. ) " _om ) 