let P be the Instructions of SCMPDS -valued ManySortedSet of NAT ; :: thesis: for s being State of SCMPDS
for I being halt-free shiftable Program of SCMPDS
for a being Int_position
for i, c being Integer
for X, Y being set
for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let s be State of SCMPDS; :: thesis: for I being halt-free shiftable Program of SCMPDS
for a being Int_position
for i, c being Integer
for X, Y being set
for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let I be halt-free shiftable Program of SCMPDS; :: thesis: for a being Int_position
for i, c being Integer
for X, Y being set
for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let a be Int_position ; :: thesis: for i, c being Integer
for X, Y being set
for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let i, c be Integer; :: thesis: for X, Y being set
for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let X, Y be set ; :: thesis: for f being Function of (product the Object-Kind of SCMPDS),NAT st card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) holds
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )

let f be Function of (product the Object-Kind of SCMPDS),NAT; :: thesis: ( card I > 0 & ( for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ) & ( for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ) & ( for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) implies ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )

set b = DataLoc ((s . a),i);
set WHL = while>0 (a,i,I);
set pWHL = stop (while>0 (a,i,I));
set pI = stop I;
set i1 = (a,i) <=0_goto ((card I) + 2);
set i2 = goto (- ((card I) + 1));
assume card I > 0 ; :: thesis: ( ex t being State of SCMPDS st
( f . (Dstate t) = 0 & not t . (DataLoc ((s . a),i)) <= 0 ) or ex x being Int_position st
( x in X & not s . x >= c + (s . (DataLoc ((s . a),i))) ) or ex t being State of SCMPDS ex Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st
( ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 & not ( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) or ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )

defpred S1[ Element of NAT ] means for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st f . (Dstate t) <= $1 & ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a holds
( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q );
assume A2: for t being State of SCMPDS st f . (Dstate t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0 ; :: thesis: ( ex x being Int_position st
( x in X & not s . x >= c + (s . (DataLoc ((s . a),i))) ) or ex t being State of SCMPDS ex Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st
( ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 & not ( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) or ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )

assume A3: for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ; :: thesis: ( ex t being State of SCMPDS ex Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st
( ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 & not ( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ) or ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )

assume A4: for t being State of SCMPDS
for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) & ( for x being Int_position st x in X holds
(IExec (I,Q,t)) . x >= c + ((IExec (I,Q,t)) . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
(IExec (I,Q,t)) . x = t . x ) ) ; :: thesis: ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
A5: for k being Element of NAT st S1[k] holds
S1[k + 1]
proof
let k be Element of NAT ; :: thesis: ( S1[k] implies S1[k + 1] )
assume A6: S1[k] ; :: thesis: S1[k + 1]
now
let t be State of SCMPDS; :: thesis: for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st f . (Dstate t) <= k + 1 & ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a holds
( while>0 (a,i,I) is_closed_on b2,b3 & while>0 (a,i,I) is_halting_on b2,b3 )

let Q be the Instructions of SCMPDS -valued ManySortedSet of NAT ; :: thesis: ( f . (Dstate t) <= k + 1 & ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a implies ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 ) )

assume A7: f . (Dstate t) <= k + 1 ; :: thesis: ( ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a implies ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 ) )

assume A8: for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ; :: thesis: ( ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a implies ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 ) )

assume A9: for x being Int_position st x in Y holds
t . x = s . x ; :: thesis: ( t . a = s . a implies ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 ) )
assume A10: t . a = s . a ; :: thesis: ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 )
per cases ( t . (DataLoc ((s . a),i)) <= 0 or t . (DataLoc ((s . a),i)) > 0 ) ;
suppose t . (DataLoc ((s . a),i)) <= 0 ; :: thesis: ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 )
hence ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) by A10, Th20; :: thesis: verum
end;
suppose A11: t . (DataLoc ((s . a),i)) > 0 ; :: thesis: ( while>0 (a,i,I) is_closed_on b1,b2 & while>0 (a,i,I) is_halting_on b1,b2 )
A12: dom (ProgramPart t) = NAT by COMPOS_1:34;
A13: not a in dom (t | NAT) by A12, SCMPDS_2:53;
A14: (IExec (I,Q,t)) . a = t . a by A4, A8, A9, A10, A11;
A15: 0 in dom (stop (while>0 (a,i,I))) by COMPOS_1:135;
A16: dom (ProgramPart t) = NAT by COMPOS_1:34;
A17: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
A18: while>0 (a,i,I) = ((a,i) <=0_goto ((card I) + 2)) ';' (I ';' (goto (- ((card I) + 1)))) by SCMPDS_4:51;
set t2 = Initialize t;
set Q2 = Q +* (stop I);
set t3 = Initialize t;
set Q3 = Q +* (stop (while>0 (a,i,I)));
set t4 = Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1);
set Q4 = Q +* (stop (while>0 (a,i,I)));
A21: stop I c= Q +* (stop I) by FUNCT_4:26;
B21: Start-At (0,SCMPDS) c= Initialize t by FUNCT_4:26;
A22: Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(0 + 1)) = Following ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),0))) by EXTPRO_1:4
.= Following ((Q +* (stop (while>0 (a,i,I)))),(Initialize t)) by EXTPRO_1:3
.= Exec (((a,i) <=0_goto ((card I) + 2)),(Initialize t)) by A18, SCMPDS_6:22 ;
now
let a be Int_position ; :: thesis: (Initialize t) . a = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)) . a
thus (Initialize t) . a = (Initialize t) . a
.= (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)) . a by A22, SCMPDS_2:68 ; :: thesis: verum
end;
then A24: DataPart (Initialize t) = DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)) by SCMPDS_4:23;
XX: while>0 (a,i,I) c= stop (while>0 (a,i,I)) by AFINSQ_1:78;
stop (while>0 (a,i,I)) c= Q +* (stop (while>0 (a,i,I))) by FUNCT_4:26;
then A25: while>0 (a,i,I) c= Q +* (stop (while>0 (a,i,I))) by XBOOLE_1:1, XX;
Shift (I,1) c= while>0 (a,i,I) by Lm4;
then Shift (I,1) c= Q +* (stop (while>0 (a,i,I))) by A25, XBOOLE_1:1;
then A26: Shift (I,1) c= Q +* (stop (while>0 (a,i,I))) ;
A27: IExec (I,Q,t) = (Result ((Q +* (stop I)),(Initialize t))) +* (t | NAT) by SCMPDS_4:def 8;
set m2 = LifeSpan ((Q +* (stop I)),(Initialize t));
set t5 = Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))));
set Q5 = Q +* (stop (while>0 (a,i,I)));
set l1 = (card I) + 1;
A28: IC (Initialize t) = 0 by COMPOS_1:def 16;
set m3 = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1;
set t6 = Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1));
set Q6 = Q +* (stop (while>0 (a,i,I)));
set t7 = Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1));
set Q7 = Q +* (stop (while>0 (a,i,I)));
(card I) + 1 < (card I) + 2 by XREAL_1:8;
then A29: (card I) + 1 in dom (while>0 (a,i,I)) by Th18;
A30: I is_closed_on t,Q by A4, A8, A9, A10, A11;
then A31: I is_closed_on Initialize t,Q +* (stop I) by SCMPDS_6:38;
I is_halting_on t,Q by A4, A8, A9, A10, A11;
then A32: Q +* (stop I) halts_on Initialize t by SCMPDS_6:def 3;
Q +* (stop I) = (Q +* (stop I)) +* (stop I) by A21, FUNCT_4:104;
then (Q +* (stop I)) +* (stop I) halts_on Initialize (Initialize t) by A32;
then A34: I is_halting_on Initialize t,Q +* (stop I) by SCMPDS_6:def 3;
not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
then (Initialize t) . (DataLoc (((Initialize t) . a),i)) = (Initialize t) . (DataLoc ((s . a),i)) by A10, FUNCT_4:12
.= t . (DataLoc ((s . a),i)) by A17, FUNCT_4:12 ;
then A35: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)) = succ (IC (Initialize t)) by A11, A22, SCMPDS_2:68
.= 0 + 1 by A28 ;
then A36: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = (card I) + 1 by A21, B21, A34, A31, A24, A26, SCMPDS_7:36;
A37: (Q +* (stop (while>0 (a,i,I)))) /. (IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (while>0 (a,i,I)))) . (IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by PBOOLE:158;
A38: Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)) = Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t)))) by EXTPRO_1:5;
then A39: CurInstr ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (while>0 (a,i,I)))) . ((card I) + 1) by A21, B21, A34, A31, A35, A24, A26, A37, SCMPDS_7:36
.= (Q +* (stop (while>0 (a,i,I)))) . ((card I) + 1)
.= (Q +* (stop (while>0 (a,i,I)))) . ((card I) + 1)
.= (while>0 (a,i,I)) . ((card I) + 1) by A29, A25, GRFUNC_1:8
.= goto (- ((card I) + 1)) by Th19 ;
A41: Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) = Following ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by EXTPRO_1:4
.= Exec ((goto (- ((card I) + 1))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by A39 ;
then IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) = ICplusConst ((Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))),(0 - ((card I) + 1))) by SCMPDS_2:66
.= 0 by A36, A38, SCMPDS_7:1 ;
then A42: Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) = Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) by COMPOS_1:84;
A43: DataPart (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) by A21, B21, A34, A31, A35, A24, A26, SCMPDS_7:36;
then A44: DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = DataPart (Result ((Q +* (stop I)),(Initialize t))) by A32, EXTPRO_1:23
.= DataPart ((Result ((Q +* (stop I)),(Initialize t))) +* (t | NAT)) by A16, AMI_2:29, FUNCT_4:76, SCMPDS_2:100
.= DataPart (IExec (I,Q,t)) by SCMPDS_4:def 8 ;
A45: now
let x be Int_position ; :: thesis: ( x in Y implies (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = s . x )
assume A46: x in Y ; :: thesis: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = s . x
thus (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x by A38, A41, SCMPDS_2:66
.= (IExec (I,Q,t)) . x by A44, SCMPDS_3:4
.= t . x by A4, A8, A9, A10, A11, A46
.= s . x by A9, A46 ; :: thesis: verum
end;
InsCode (goto (- ((card I) + 1))) = 0 by SCMPDS_2:21;
then InsCode (goto (- ((card I) + 1))) in {0,4,5,6} by ENUMSET1:def 2;
then A47: Dstate (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) = Dstate (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) by A41, Th3
.= Dstate (IExec (I,Q,t)) by A44, A38, Th2 ;
A48: now
f . (Dstate (IExec (I,Q,t))) < f . (Dstate t) by A4, A8, A9, A10, A11;
then A49: f . (Dstate (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) < k + 1 by A7, A47, XXREAL_0:2;
assume f . (Dstate (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) > k ; :: thesis: contradiction
hence contradiction by A49, INT_1:20; :: thesis: verum
end;
A50: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . (DataLoc ((s . a),i)) by A38, A41, SCMPDS_2:66
.= (IExec (I,Q,t)) . (DataLoc ((s . a),i)) by A44, SCMPDS_3:4 ;
A51: now
let x be Int_position ; :: thesis: ( x in X implies (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i))) )
assume A52: x in X ; :: thesis: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i)))
(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x by A38, A41, SCMPDS_2:66
.= (IExec (I,Q,t)) . x by A44, SCMPDS_3:4 ;
hence (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i))) by A4, A8, A9, A10, A11, A50, A52; :: thesis: verum
end;
A53: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a by A43, SCMPDS_4:23
.= (Result ((Q +* (stop I)),(Initialize t))) . a by A32, EXTPRO_1:23
.= s . a by A10, A14, A27, A13, FUNCT_4:12 ;
A55: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . a = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) . a by A41, SCMPDS_2:66
.= s . a by A53, EXTPRO_1:5 ;
then A56: while>0 (a,i,I) is_closed_on Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)),Q +* (stop (while>0 (a,i,I))) by A6, A51, A45, A48;
now
let k be Element of NAT ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),b1)) in dom (stop (while>0 (a,i,I)))
per cases ( k < ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 or k >= ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ) ;
suppose k < ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),b1)) in dom (stop (while>0 (a,i,I)))
then A57: k <= (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 by INT_1:20;
hereby :: thesis: verum
per cases ( k <= LifeSpan ((Q +* (stop I)),(Initialize t)) or k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 ) by A57, NAT_1:8;
suppose A58: k <= LifeSpan ((Q +* (stop I)),(Initialize t)) ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I)))
hereby :: thesis: verum
per cases ( k = 0 or k <> 0 ) ;
suppose k = 0 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I)))
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I))) by A15, A28, EXTPRO_1:3; :: thesis: verum
end;
suppose k <> 0 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I)))
then consider kn being Nat such that
A59: k = kn + 1 by NAT_1:6;
reconsider kn = kn as Element of NAT by ORDINAL1:def 13;
reconsider lm = IC (Comput ((Q +* (stop I)),(Initialize t),kn)) as Element of NAT ;
kn < k by A59, XREAL_1:31;
then kn < LifeSpan ((Q +* (stop I)),(Initialize t)) by A58, XXREAL_0:2;
then (IC (Comput ((Q +* (stop I)),(Initialize t),kn))) + 1 = IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),1)),kn)) by A21, B21, A34, A31, A35, A24, A26, SCMPDS_7:34;
then A61: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) = lm + 1 by A59, EXTPRO_1:5;
IC (Comput ((Q +* (stop I)),(Initialize t),kn)) in dom (stop I) by A30, SCMPDS_6:def 2;
then lm < card (stop I) by AFINSQ_1:70;
then lm < (card I) + 1 by SCMPDS_5:7;
then A62: lm + 1 <= (card I) + 1 by INT_1:20;
(card I) + 1 < (card I) + 3 by XREAL_1:8;
then lm + 1 < (card I) + 3 by A62, XXREAL_0:2;
then lm + 1 < card (stop (while>0 (a,i,I))) by Lm3;
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I))) by A61, AFINSQ_1:70; :: thesis: verum
end;
end;
end;
end;
suppose A63: k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I)))
(card I) + 1 in dom (stop (while>0 (a,i,I))) by A29, SCMPDS_6:18;
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I))) by A21, B21, A34, A31, A35, A24, A26, A38, A63, SCMPDS_7:36; :: thesis: verum
end;
end;
end;
end;
suppose k >= ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),b1)) in dom (stop (while>0 (a,i,I)))
then consider nn being Nat such that
A64: k = (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + nn by NAT_1:10;
A66: nn in NAT by ORDINAL1:def 13;
Q +* (stop (while>0 (a,i,I))) = (Q +* (stop (while>0 (a,i,I)))) +* (stop (while>0 (a,i,I))) by FUNCT_4:99;
then Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k) = Comput (((Q +* (stop (while>0 (a,i,I)))) +* (stop (while>0 (a,i,I)))),(Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))),nn) by A42, A64, EXTPRO_1:5, A66;
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),k)) in dom (stop (while>0 (a,i,I))) by A56, A66, SCMPDS_6:def 2; :: thesis: verum
end;
end;
end;
hence while>0 (a,i,I) is_closed_on t,Q by SCMPDS_6:def 2; :: thesis: while>0 (a,i,I) is_halting_on t,Q
RR: (Q +* (stop (while>0 (a,i,I)))) +* (stop (while>0 (a,i,I))) = Q +* (stop (while>0 (a,i,I))) by FUNCT_4:99;
while>0 (a,i,I) is_halting_on Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)),Q +* (stop (while>0 (a,i,I))) by A6, A55, A51, A45, A48;
then Q +* (stop (while>0 (a,i,I))) halts_on Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) by A42, SCMPDS_6:def 3, RR;
then Q +* (stop (while>0 (a,i,I))) halts_on Comput ((Q +* (stop (while>0 (a,i,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) ;
then Q +* (stop (while>0 (a,i,I))) halts_on Initialize t by EXTPRO_1:22;
hence while>0 (a,i,I) is_halting_on t,Q by SCMPDS_6:def 3; :: thesis: verum
end;
end;
end;
hence S1[k + 1] ; :: thesis: verum
end;
set n = f . (Dstate s);
A67: for x being Int_position st x in Y holds
s . x = s . x ;
A68: S1[ 0 ]
proof
let t be State of SCMPDS; :: thesis: for Q being the Instructions of SCMPDS -valued ManySortedSet of NAT st f . (Dstate t) <= 0 & ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a holds
( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q )

let Q be the Instructions of SCMPDS -valued ManySortedSet of NAT ; :: thesis: ( f . (Dstate t) <= 0 & ( for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ) & ( for x being Int_position st x in Y holds
t . x = s . x ) & t . a = s . a implies ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) )

assume f . (Dstate t) <= 0 ; :: thesis: ( ex x being Int_position st
( x in X & not t . x >= c + (t . (DataLoc ((s . a),i))) ) or ex x being Int_position st
( x in Y & not t . x = s . x ) or not t . a = s . a or ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) )

then f . (Dstate t) = 0 ;
then A69: t . (DataLoc ((s . a),i)) <= 0 by A2;
assume for x being Int_position st x in X holds
t . x >= c + (t . (DataLoc ((s . a),i))) ; :: thesis: ( ex x being Int_position st
( x in Y & not t . x = s . x ) or not t . a = s . a or ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) )

assume for x being Int_position st x in Y holds
t . x = s . x ; :: thesis: ( not t . a = s . a or ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) )
assume t . a = s . a ; :: thesis: ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q )
hence ( while>0 (a,i,I) is_closed_on t,Q & while>0 (a,i,I) is_halting_on t,Q ) by A69, Th20; :: thesis: verum
end;
for k being Element of NAT holds S1[k] from NAT_1:sch 1(A68, A5);
then S1[f . (Dstate s)] ;
hence ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) by A3, A67; :: thesis: verum