defpred S1[ set ] means $1 = NAT ;
deffunc H1( set ) -> Element of NAT = il;
consider s being State of SCM ;
defpred S2[ set , set ] means ( ex n being Element of NAT st
( $1 = ps + n & n < len I & $2 = I . n ) or ( $2 = halt SCM & ( for n being Element of NAT holds
( not $1 = ps + n or not n < len I ) ) ) );
deffunc H2( set ) -> set = s . $1;
consider s1 being Function such that
A1:
( dom s1 = SCM-Memory & ( for x being set st x in SCM-Memory holds
( ( S1[x] implies s1 . x = H1(x) ) & ( not S1[x] implies s1 . x = H2(x) ) ) ) )
from PARTFUN1:sch 1();
defpred S3[ set ] means ex n being Element of NAT st $1 = n;
A2:
for x being set st x in SCM-Memory holds
ex y being set st
( y in SCM-Instr & S2[x,y] )
consider I1 being Function such that
A6:
( dom I1 = SCM-Memory & rng I1 c= SCM-Instr & ( for x being set st x in SCM-Memory holds
S2[x,I1 . x] ) )
from WELLORD2:sch 1(A2);
reconsider I1 = I1 as Function of SCM-Memory ,the Instructions of SCM by A6, FUNCT_2:def 1, RELSET_1:11;
defpred S4[ set , set ] means ( ex n being Element of NAT st
( $1 = dl. (ds + n) & n < len D & $2 = D . (n + 1) ) or ( $2 = 0 & ( for n being Element of NAT holds
( not $1 = dl. (ds + n) or not n < len D ) ) ) );
A7:
0 in INT
by INT_1:def 2;
consider D1 being Function such that
A11:
( dom D1 = SCM-Memory & rng D1 c= INT & ( for x being set st x in SCM-Memory holds
S4[x,D1 . x] ) )
from WELLORD2:sch 1(A8);
reconsider D1 = D1 as Function of SCM-Memory ,INT by A11, FUNCT_2:def 1, RELSET_1:11;
deffunc H3( set ) -> set = I1 . $1;
reconsider s1 = s1 as State of SCM by A1, A13, FUNCT_1:def 20, PARTFUN1:def 4, RELAT_1:def 18;
deffunc H4( set ) -> set = s1 . $1;
consider s2 being Function such that
A14:
( dom s2 = SCM-Memory & ( for x being set st x in SCM-Memory holds
( ( S3[x] implies s2 . x = H3(x) ) & ( not S3[x] implies s2 . x = H4(x) ) ) ) )
from PARTFUN1:sch 1();
then reconsider s2 = s2 as State of SCM by A14, FUNCT_1:def 20, PARTFUN1:def 4, RELAT_1:def 18;
deffunc H5( set ) -> set = s2 . $1;
defpred S5[ set ] means ex n being Element of NAT st $1 = dl. n;
deffunc H6( set ) -> set = D1 . $1;
consider s3 being Function such that
A17:
( dom s3 = SCM-Memory & ( for x being set st x in SCM-Memory holds
( ( S5[x] implies s3 . x = H6(x) ) & ( not S5[x] implies s3 . x = H5(x) ) ) ) )
from PARTFUN1:sch 1();
then reconsider s3 = s3 as State of SCM by A17, FUNCT_1:def 20, PARTFUN1:def 4, RELAT_1:def 18;
take
s3
; ( IC s3 = il & ( for k being Element of NAT st k < len I holds
s3 . (ps + k) = I . k ) & ( for k being Element of NAT st k < len D holds
s3 . (dl. (ds + k)) = D . (k + 1) ) )
thus IC s3 =
s2 . NAT
by A17, AMI_3:4, Th7
.=
s1 . NAT
by A14, AMI_3:4, Th7
.=
il
by A1, AMI_2:30
; ( ( for k being Element of NAT st k < len I holds
s3 . (ps + k) = I . k ) & ( for k being Element of NAT st k < len D holds
s3 . (dl. (ds + k)) = D . (k + 1) ) )
let k be Element of NAT ; ( k < len D implies s3 . (dl. (ds + k)) = D . (k + 1) )
assume
k < len D
; s3 . (dl. (ds + k)) = D . (k + 1)
then consider k9 being Element of NAT such that
A21:
dl. (ds + k) = dl. (ds + k9)
and
k9 < len D
and
A22:
D1 . (dl. (ds + k)) = D . (k9 + 1)
by A11;
ds + k = ds + k9
by A21, AMI_3:52;
hence
s3 . (dl. (ds + k)) = D . (k + 1)
by A17, A22; verum