let P be Instruction-Sequence of SCMPDS; :: thesis: for s being 0 -started 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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 0 -started 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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_Values_of SCMPDS)),NAT st ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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_Values_of SCMPDS)),NAT; :: thesis: ( ( for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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));
defpred S1[ Nat] means for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st f . 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 A1: for t being 0 -started State of SCMPDS st f . 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 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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 A2: for x being Int_position st x in X holds
s . x >= c + (s . (DataLoc ((s . a),i))) ; :: thesis: ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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 t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS 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 . (Initialize (IExec (I,Q,t))) < f . 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 )
A4: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; :: thesis: ( S1[k] implies S1[k + 1] )
assume A5: S1[k] ; :: thesis: S1[k + 1]
now :: thesis: for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st f . 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 t,Q & while>0 (a,i,I) is_halting_on t,Q )
let t be 0 -started State of SCMPDS; :: thesis: for Q being Instruction-Sequence of SCMPDS st f . 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 Instruction-Sequence of SCMPDS; :: thesis: ( f . 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 ) )

A6: Initialize t = t by MEMSTR_0:44;
assume A7: f . 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, Th18; :: 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: 0 in dom (stop (while>0 (a,i,I))) by COMPOS_1:36;
A13: while>0 (a,i,I) = ((a,i) <=0_goto ((card I) + 2)) ';' (I ';' (goto (- ((card I) + 1)))) by SCMPDS_4:15;
set Q2 = Q +* (stop I);
set Q3 = Q +* (stop (while>0 (a,i,I)));
set t4 = Comput ((Q +* (stop (while>0 (a,i,I)))),t,1);
set Q4 = Q +* (stop (while>0 (a,i,I)));
A14: stop I c= Q +* (stop I) by FUNCT_4:25;
A15: Comput ((Q +* (stop (while>0 (a,i,I)))),t,(0 + 1)) = Following ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,0))) by EXTPRO_1:3
.= Following ((Q +* (stop (while>0 (a,i,I)))),t)
.= Exec (((a,i) <=0_goto ((card I) + 2)),t) by A13, A6, SCMPDS_6:11 ;
for a being Int_position holds t . a = (Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)) . a by A15, SCMPDS_2:56;
then A16: DataPart t = DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)) by SCMPDS_4:8;
A17: while>0 (a,i,I) c= stop (while>0 (a,i,I)) by AFINSQ_1:74;
stop (while>0 (a,i,I)) c= Q +* (stop (while>0 (a,i,I))) by FUNCT_4:25;
then A18: while>0 (a,i,I) c= Q +* (stop (while>0 (a,i,I))) by A17, XBOOLE_1:1;
Shift (I,1) c= while>0 (a,i,I) by Lm4;
then A19: Shift (I,1) c= Q +* (stop (while>0 (a,i,I))) by A18, XBOOLE_1:1;
A20: IExec (I,Q,t) = Result ((Q +* (stop I)),t) by SCMPDS_4:def 5;
set m2 = LifeSpan ((Q +* (stop I)),t);
set t5 = Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)));
set Q5 = Q +* (stop (while>0 (a,i,I)));
set l1 = (card I) + 1;
A21: IC t = 0 by MEMSTR_0:def 11;
set m3 = (LifeSpan ((Q +* (stop I)),t)) + 1;
set t6 = Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1));
set Q6 = Q +* (stop (while>0 (a,i,I)));
set t7 = Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1));
set Q7 = Q +* (stop (while>0 (a,i,I)));
(card I) + 1 < (card I) + 2 by XREAL_1:6;
then A22: (card I) + 1 in dom (while>0 (a,i,I)) by Th16;
A23: I is_closed_on t,Q by A3, A8, A9, A10, A11;
A24: I is_closed_on t,Q +* (stop I) by A3, A8, A9, A10, A11;
I is_halting_on t,Q by A3, A8, A9, A10, A11;
then A25: Q +* (stop I) halts_on t by A6, SCMPDS_6:def 3;
(Q +* (stop I)) +* (stop I) halts_on t by A25;
then A26: I is_halting_on t,Q +* (stop I) by A6, SCMPDS_6:def 3;
A27: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)) = (IC t) + 1 by A11, A15, A10, SCMPDS_2:56
.= 0 + 1 by A21 ;
then A28: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) = (card I) + 1 by A14, A26, A24, A16, A19, SCMPDS_7:18;
A29: (Q +* (stop (while>0 (a,i,I)))) /. (IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)))) = (Q +* (stop (while>0 (a,i,I)))) . (IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)))) by PBOOLE:143;
A30: Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)) = Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t))) by EXTPRO_1:4;
then A31: CurInstr ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)))) = (Q +* (stop (while>0 (a,i,I)))) . ((card I) + 1) by A14, A26, A24, A27, A16, A19, A29, SCMPDS_7:18
.= (while>0 (a,i,I)) . ((card I) + 1) by A22, A18, GRFUNC_1:2
.= goto (- ((card I) + 1)) by Th17 ;
A32: Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)) = Following ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)))) by EXTPRO_1:3
.= Exec ((goto (- ((card I) + 1))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1)))) by A31 ;
then IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) = ICplusConst ((Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1))),(0 - ((card I) + 1))) by SCMPDS_2:54
.= 0 by A28, A30, SCMPDS_7:1 ;
then A33: Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) = Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)) by MEMSTR_0:46;
A34: DataPart (Comput ((Q +* (stop I)),t,(LifeSpan ((Q +* (stop I)),t)))) = DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) by A14, A26, A24, A27, A16, A19, SCMPDS_7:18;
then A35: DataPart (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) = DataPart (Result ((Q +* (stop I)),t)) by A25, EXTPRO_1:23
.= DataPart (IExec (I,Q,t)) by SCMPDS_4:def 5 ;
A36: now :: thesis: for x being Int_position st x in Y holds
(Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x = s . x
let x be Int_position; :: thesis: ( x in Y implies (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x = s . x )
assume A37: x in Y ; :: thesis: (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x = s . x
thus (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) . x by A30, A32, SCMPDS_2:54
.= (IExec (I,Q,t)) . x by A35, SCMPDS_3:3
.= t . x by A3, A8, A9, A10, A11, A37
.= s . x by A9, A37 ; :: thesis: verum
end;
InsCode (goto (- ((card I) + 1))) = 14 by SCMPDS_2:12;
then InsCode (goto (- ((card I) + 1))) in {0,4,5,6,14} by ENUMSET1:def 3;
then A38: Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) = Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1))) by A32, Th2
.= Initialize (IExec (I,Q,t)) by A35, A30, MEMSTR_0:80 ;
A39: now :: thesis: not f . (Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)))) > k
f . (Initialize (IExec (I,Q,t))) < f . (Initialize t) by A3, A8, A9, A10, A11, A6;
then A40: f . (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) < k + 1 by A7, A38, A33, A6, XXREAL_0:2;
assume f . (Initialize (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)))) > k ; :: thesis: contradiction
hence contradiction by A40, A33, INT_1:7; :: thesis: verum
end;
A41: (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) . (DataLoc ((s . a),i)) by A30, A32, SCMPDS_2:54
.= (IExec (I,Q,t)) . (DataLoc ((s . a),i)) by A35, SCMPDS_3:3 ;
A42: now :: thesis: for x being Int_position st x in X holds
(Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . (DataLoc ((s . a),i)))
let x be Int_position; :: thesis: ( x in X implies (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . (DataLoc ((s . a),i))) )
assume A43: x in X ; :: thesis: (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . (DataLoc ((s . a),i)))
(Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x = (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) . x by A30, A32, SCMPDS_2:54
.= (IExec (I,Q,t)) . x by A35, SCMPDS_3:3 ;
hence (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . x >= c + ((Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . (DataLoc ((s . a),i))) by A3, A8, A9, A10, A11, A41, A43; :: thesis: verum
end;
A44: (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),(LifeSpan ((Q +* (stop I)),t)))) . a = (Comput ((Q +* (stop I)),t,(LifeSpan ((Q +* (stop I)),t)))) . a by A34, SCMPDS_4:8
.= (Result ((Q +* (stop I)),t)) . a by A25, EXTPRO_1:23
.= s . a by A10, A3, A8, A9, A11, A20 ;
A45: (Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))) . a = (Comput ((Q +* (stop (while>0 (a,i,I)))),t,((LifeSpan ((Q +* (stop I)),t)) + 1))) . a by A32, SCMPDS_2:54
.= s . a by A44, EXTPRO_1:4 ;
then A46: while>0 (a,i,I) is_closed_on Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)),Q +* (stop (while>0 (a,i,I))) by A5, A42, A36, A39, A33;
now :: thesis: for k being Nat holds IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I)))
let k be Nat; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,b1)) in dom (stop (while>0 (a,i,I)))
per cases ( k < ((LifeSpan ((Q +* (stop I)),t)) + 1) + 1 or k >= ((LifeSpan ((Q +* (stop I)),t)) + 1) + 1 ) ;
suppose k < ((LifeSpan ((Q +* (stop I)),t)) + 1) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,b1)) in dom (stop (while>0 (a,i,I)))
then A47: k <= (LifeSpan ((Q +* (stop I)),t)) + 1 by INT_1:7;
hereby :: thesis: verum
per cases ( k <= LifeSpan ((Q +* (stop I)),t) or k = (LifeSpan ((Q +* (stop I)),t)) + 1 ) by A47, NAT_1:8;
suppose A48: k <= LifeSpan ((Q +* (stop I)),t) ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),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)))),t,k)) in dom (stop (while>0 (a,i,I)))
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I))) by A12, A21; :: thesis: verum
end;
suppose k <> 0 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I)))
then consider kn being Nat such that
A49: k = kn + 1 by NAT_1:6;
reconsider kn = kn as Nat ;
reconsider lm = IC (Comput ((Q +* (stop I)),t,kn)) as Element of NAT ;
kn < k by A49, XREAL_1:29;
then kn < LifeSpan ((Q +* (stop I)),t) by A48, XXREAL_0:2;
then (IC (Comput ((Q +* (stop I)),t,kn))) + 1 = IC (Comput ((Q +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,1)),kn)) by A14, A26, A24, A27, A16, A19, SCMPDS_7:16;
then A50: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) = lm + 1 by A49, EXTPRO_1:4;
IC (Comput ((Q +* (stop I)),t,kn)) in dom (stop I) by A23, A6, SCMPDS_6:def 2;
then lm < card (stop I) by AFINSQ_1:66;
then lm < (card I) + 1 by COMPOS_1:55;
then A51: lm + 1 <= (card I) + 1 by INT_1:7;
(card I) + 1 < (card I) + 3 by XREAL_1:6;
then lm + 1 < (card I) + 3 by A51, 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)))),t,k)) in dom (stop (while>0 (a,i,I))) by A50, AFINSQ_1:66; :: thesis: verum
end;
end;
end;
end;
suppose A52: k = (LifeSpan ((Q +* (stop I)),t)) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I)))
(card I) + 1 in dom (stop (while>0 (a,i,I))) by A22, COMPOS_1:62;
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I))) by A14, A26, A24, A27, A16, A19, A30, A52, SCMPDS_7:18; :: thesis: verum
end;
end;
end;
end;
suppose k >= ((LifeSpan ((Q +* (stop I)),t)) + 1) + 1 ; :: thesis: IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,b1)) in dom (stop (while>0 (a,i,I)))
then consider nn being Nat such that
A53: k = (((LifeSpan ((Q +* (stop I)),t)) + 1) + 1) + nn by NAT_1:10;
Comput ((Q +* (stop (while>0 (a,i,I)))),t,k) = Comput (((Q +* (stop (while>0 (a,i,I)))) +* (stop (while>0 (a,i,I)))),(Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1))),nn) by A53, EXTPRO_1:4;
hence IC (Comput ((Q +* (stop (while>0 (a,i,I)))),t,k)) in dom (stop (while>0 (a,i,I))) by A46, A33, SCMPDS_6:def 2; :: thesis: verum
end;
end;
end;
hence while>0 (a,i,I) is_closed_on t,Q by A6, SCMPDS_6:def 2; :: thesis: while>0 (a,i,I) is_halting_on t,Q
A54: (Q +* (stop (while>0 (a,i,I)))) +* (stop (while>0 (a,i,I))) = Q +* (stop (while>0 (a,i,I))) ;
while>0 (a,i,I) is_halting_on Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)),Q +* (stop (while>0 (a,i,I))) by A5, A45, A42, A36, A39, A33;
then Q +* (stop (while>0 (a,i,I))) halts_on Comput ((Q +* (stop (while>0 (a,i,I)))),t,(((LifeSpan ((Q +* (stop I)),t)) + 1) + 1)) by A33, A54, SCMPDS_6:def 3;
then Q +* (stop (while>0 (a,i,I))) halts_on t by EXTPRO_1:22;
hence while>0 (a,i,I) is_halting_on t,Q by A6, SCMPDS_6:def 3; :: thesis: verum
end;
end;
end;
hence S1[k + 1] ; :: thesis: verum
end;
set n = f . s;
A55: for x being Int_position st x in Y holds
s . x = s . x ;
A56: S1[ 0 ]
proof
let t be 0 -started State of SCMPDS; :: thesis: for Q being Instruction-Sequence of SCMPDS st f . 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 Instruction-Sequence of SCMPDS; :: thesis: ( f . 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 . 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 . t = 0 ;
then A57: t . (DataLoc ((s . a),i)) <= 0 by A1;
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 A57, Th18; :: thesis: verum
end;
for k being Nat holds S1[k] from NAT_1:sch 2(A56, A4);
then S1[f . s] ;
hence ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) by A2, A55; :: thesis: verum