Metamath Proof Explorer


Theorem algrf

Description: An algorithm is a step function F : S --> S on a state space S . An algorithm acts on an initial state A e. S by iteratively applying F to give A , ( FA ) , ( F( FA ) ) and so on. An algorithm is said to halt if a fixed point of F is reached after a finite number of iterations.

The algorithm iterator R : NN0 --> S "runs" the algorithm F so that ( Rk ) is the state after k iterations of F on the initial state A .

Domain and codomain of the algorithm iterator R . (Contributed by Paul Chapman, 31-Mar-2011) (Revised by Mario Carneiro, 28-May-2014)

Ref Expression
Hypotheses algrf.1 Z=M
algrf.2 R=seqMF1stZ×A
algrf.3 φM
algrf.4 φAS
algrf.5 φF:SS
Assertion algrf φR:ZS

Proof

Step Hyp Ref Expression
1 algrf.1 Z=M
2 algrf.2 R=seqMF1stZ×A
3 algrf.3 φM
4 algrf.4 φAS
5 algrf.5 φF:SS
6 fvconst2g ASxZZ×Ax=A
7 4 6 sylan φxZZ×Ax=A
8 4 adantr φxZAS
9 7 8 eqeltrd φxZZ×AxS
10 vex xV
11 vex yV
12 10 11 opco1i xF1sty=Fx
13 simpl xSySxS
14 ffvelcdm F:SSxSFxS
15 5 13 14 syl2an φxSySFxS
16 12 15 eqeltrid φxSySxF1styS
17 1 3 9 16 seqf φseqMF1stZ×A:ZS
18 2 feq1i R:ZSseqMF1stZ×A:ZS
19 17 18 sylibr φR:ZS