let P be the Instructions of SCMPDS -valued ManySortedSet of NAT ; :: thesis: for s being State of SCMPDS
for I, J being shiftable Program of SCMPDS
for a being Int_position
for k1 being Integer st s . (DataLoc ((s . a),k1)) = 0 & I is_closed_on s,P & I is_halting_on s,P holds
( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P )

let s be State of SCMPDS; :: thesis: for I, J being shiftable Program of SCMPDS
for a being Int_position
for k1 being Integer st s . (DataLoc ((s . a),k1)) = 0 & I is_closed_on s,P & I is_halting_on s,P holds
( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P )

let I, J be shiftable Program of SCMPDS; :: thesis: for a being Int_position
for k1 being Integer st s . (DataLoc ((s . a),k1)) = 0 & I is_closed_on s,P & I is_halting_on s,P holds
( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P )

let a be Int_position ; :: thesis: for k1 being Integer st s . (DataLoc ((s . a),k1)) = 0 & I is_closed_on s,P & I is_halting_on s,P holds
( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P )

let k1 be Integer; :: thesis: ( s . (DataLoc ((s . a),k1)) = 0 & I is_closed_on s,P & I is_halting_on s,P implies ( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P ) )
set b = DataLoc ((s . a),k1);
assume A1: s . (DataLoc ((s . a),k1)) = 0 ; :: thesis: ( not I is_closed_on s,P or not I is_halting_on s,P or ( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P ) )
set i = (a,k1) <>0_goto ((card I) + 2);
set G = Goto ((card J) + 1);
set I2 = (I ';' (Goto ((card J) + 1))) ';' J;
set IF = if=0 (a,k1,I,J);
set pIF = stop (if=0 (a,k1,I,J));
set pI2 = stop ((I ';' (Goto ((card J) + 1))) ';' J);
set s2 = Initialize s;
set P2 = P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J));
set s3 = Initialize s;
set P3 = P +* (stop (if=0 (a,k1,I,J)));
set s4 = Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1);
set P4 = P +* (stop (if=0 (a,k1,I,J)));
A4: IC (Initialize s) = 0 by COMPOS_1:223;
A5: not DataLoc ((s . a),k1) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
A6: if=0 (a,k1,I,J) = (((a,k1) <>0_goto ((card I) + 2)) ';' (I ';' (Goto ((card J) + 1)))) ';' J by SCMPDS_4:50
.= ((a,k1) <>0_goto ((card I) + 2)) ';' ((I ';' (Goto ((card J) + 1))) ';' J) by SCMPDS_4:50 ;
then A7: Shift ((stop ((I ';' (Goto ((card J) + 1))) ';' J)),1) c= P +* (stop (if=0 (a,k1,I,J))) by Lm6;
A8: Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),0))) by EXTPRO_1:4
.= Following ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s)) by EXTPRO_1:3
.= Exec (((a,k1) <>0_goto ((card I) + 2)),(Initialize s)) by A6, Th22 ;
now
let a be Int_position ; :: thesis: (Initialize s) . a = (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)) . a
thus (Initialize s) . a = (Initialize s) . a
.= (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)) . a by A8, SCMPDS_2:67 ; :: thesis: verum
end;
then A10: DataPart (Initialize s) = DataPart (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)) by SCMPDS_4:23;
not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
then (Initialize s) . (DataLoc (((Initialize s) . a),k1)) = (Initialize s) . (DataLoc ((s . a),k1)) by FUNCT_4:12
.= 0 by A1, A5, FUNCT_4:12 ;
then A11: IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)) = succ (IC (Initialize s)) by A8, SCMPDS_2:67
.= 0 + 1 by A4 ;
A12: 0 in dom (stop (if=0 (a,k1,I,J))) by COMPOS_1:135;
assume A13: I is_closed_on s,P ; :: thesis: ( not I is_halting_on s,P or ( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P ) )
assume A14: I is_halting_on s,P ; :: thesis: ( if=0 (a,k1,I,J) is_closed_on s,P & if=0 (a,k1,I,J) is_halting_on s,P )
then (I ';' (Goto ((card J) + 1))) ';' J is_halting_on s,P by A13, Th44;
then A15: P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J)) halts_on Initialize s by Def3;
A16: (I ';' (Goto ((card J) + 1))) ';' J is_closed_on s,P by A13, A14, Th44;
then A17: ( Start-At (0,SCMPDS) c= Initialize s & (I ';' (Goto ((card J) + 1))) ';' J is_closed_on Initialize s,P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J)) ) by Th38, FUNCT_4:26;
A18: card (stop (if=0 (a,k1,I,J))) = (card (if=0 (a,k1,I,J))) + 1 by SCMPDS_5:7
.= ((card ((I ';' (Goto ((card J) + 1))) ';' J)) + 1) + 1 by A6, Th15 ;
UU: stop ((I ';' (Goto ((card J) + 1))) ';' J) c= P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J)) by FUNCT_4:26;
now
let k be Element of NAT ; :: thesis: IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),b1)) in dom (stop (if=0 (a,k1,I,J)))
per cases ( 0 < k or k = 0 ) ;
suppose 0 < k ; :: thesis: IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),b1)) in dom (stop (if=0 (a,k1,I,J)))
then consider k1 being Nat such that
A19: k1 + 1 = k by NAT_1:6;
reconsider k1 = k1 as Element of NAT by ORDINAL1:def 13;
reconsider m = IC (Comput ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s),k1)) as Element of NAT ;
A20: card (stop (if=0 (a,k1,I,J))) = (card (stop ((I ';' (Goto ((card J) + 1))) ';' J))) + 1 by A18, SCMPDS_5:7;
m in dom (stop ((I ';' (Goto ((card J) + 1))) ';' J)) by A16, Def2;
then m < card (stop ((I ';' (Goto ((card J) + 1))) ';' J)) by AFINSQ_1:70;
then A21: m + 1 < card (stop (if=0 (a,k1,I,J))) by A20, XREAL_1:8;
IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),k)) = IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)),k1)) by A19, EXTPRO_1:5
.= m + 1 by A17, A7, A11, A10, Th45, UU ;
hence IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),k)) in dom (stop (if=0 (a,k1,I,J))) by A21, AFINSQ_1:70; :: thesis: verum
end;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),b1)) in dom (stop (if=0 (a,k1,I,J)))
hence IC (Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),k)) in dom (stop (if=0 (a,k1,I,J))) by A12, A4, EXTPRO_1:3; :: thesis: verum
end;
end;
end;
hence if=0 (a,k1,I,J) is_closed_on s,P by Def2; :: thesis: if=0 (a,k1,I,J) is_halting_on s,P
A24: Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),((LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1)) = Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)),(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)))) by EXTPRO_1:5;
CurInstr ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),((LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1)))) = CurInstr ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Comput ((P +* (stop (if=0 (a,k1,I,J)))),(Initialize s),1)),(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)))))) by A24
.= CurInstr ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Comput ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s),(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)))))) by A17, A7, A11, A10, Th45, UU
.= halt SCMPDS by A15, EXTPRO_1:def 14 ;
then P +* (stop (if=0 (a,k1,I,J))) halts_on Initialize s by EXTPRO_1:30;
hence if=0 (a,k1,I,J) is_halting_on s,P by Def3; :: thesis: verum