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 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
IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))

let s be State of SCMPDS; :: thesis: for I being halt-free shiftable Program of SCMPDS
for 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
IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))

let I be halt-free shiftable Program of SCMPDS; :: thesis: for 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
IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))

let 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
IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))

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
IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))

let k1 be Integer; :: thesis: ( s . (DataLoc ((s . a),k1)) > 0 & I is_closed_on s,P & I is_halting_on s,P implies IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) )
set b = DataLoc ((s . a),k1);
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)));
set i = (a,k1) <=0_goto ((card I) + 2);
set SAl = Start-At ((((card I) + (card J)) + 2),SCMPDS);
A3: IC (Initialize s) = 0 by COMPOS_1:223;
A4: not DataLoc ((s . a),k1) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:59;
then A5: (Initialize s) . (DataLoc (((Initialize s) . a),k1)) = (Initialize s) . (DataLoc ((s . a),k1)) by FUNCT_4:12
.= s . (DataLoc ((s . a),k1)) by A4, FUNCT_4:12 ;
A6: dom (ProgramPart s) = NAT by COMPOS_1:34;
A7: 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 A8: Shift ((stop ((I ';' (Goto ((card J) + 1))) ';' J)),1) c= P +* (stop (if>0 (a,k1,I,J))) by Lm6;
A9: 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 A7, Th22 ;
assume s . (DataLoc ((s . a),k1)) > 0 ; :: thesis: ( not I is_closed_on s,P or not I is_halting_on s,P or IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) )
then A10: IC (Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),1)) = succ (IC (Initialize s)) by A9, A5, SCMPDS_2:68
.= 0 + 1 by A3 ;
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 A9, SCMPDS_2:68 ; :: thesis: verum
end;
then A12: DataPart (Initialize s) = DataPart (Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),1)) by SCMPDS_4:23;
assume A13: I is_closed_on s,P ; :: thesis: ( not I is_halting_on s,P or IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) )
assume A14: I is_halting_on s,P ; :: thesis: IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))
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;
(I ';' (Goto ((card J) + 1))) ';' J is_closed_on s,P by A13, A14, Th44;
then A16: ( 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;
UU: stop ((I ';' (Goto ((card J) + 1))) ';' J) c= P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J)) by FUNCT_4:26;
A18: 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;
A21: 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 A18
.= 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 A16, A8, A10, A12, Th45, UU
.= halt SCMPDS by A15, EXTPRO_1:def 14 ;
then A22: P +* (stop (if>0 (a,k1,I,J))) halts_on Initialize s by EXTPRO_1:30;
A23: CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s)) = (a,k1) <=0_goto ((card I) + 2) by A7, Th22;
now
let l be Element of NAT ; :: thesis: ( l < (LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1 implies CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),b1))) <> halt SCMPDS )
assume A24: l < (LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1 ; :: thesis: CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),b1))) <> halt SCMPDS
A25: Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),0) = Initialize s by EXTPRO_1:3;
per cases ( l = 0 or l <> 0 ) ;
suppose l = 0 ; :: thesis: CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),b1))) <> halt SCMPDS
then CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),l))) = CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s)) by A25;
hence CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),l))) <> halt SCMPDS by A23; :: thesis: verum
end;
suppose l <> 0 ; :: thesis: not CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),b1))) = halt SCMPDS
then consider n being Nat such that
A26: l = n + 1 by NAT_1:6;
reconsider n = n as Element of NAT by ORDINAL1:def 13;
A27: n < LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)) by A24, A26, XREAL_1:8;
assume A28: CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),l))) = halt SCMPDS ; :: thesis: contradiction
A32: Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),(n + 1)) = Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),1)),n) by EXTPRO_1:5;
CurInstr ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Comput ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s),n))) = 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)),n))) by A16, A8, A10, A12, Th45, UU
.= halt SCMPDS by A26, A28, A32 ;
hence contradiction by A15, A27, EXTPRO_1:def 14; :: thesis: verum
end;
end;
end;
then for l being Element of NAT st CurInstr ((P +* (stop (if>0 (a,k1,I,J)))),(Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),l))) = halt SCMPDS holds
(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1 <= l ;
then A33: LifeSpan ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s)) = (LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1 by A21, A22, EXTPRO_1:def 14;
A35: DataPart (Result ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) = DataPart (Comput ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s),(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))))) by A15, EXTPRO_1:23
.= DataPart (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 A16, A8, A10, A12, Th45, UU
.= DataPart (Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),((LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1))) by EXTPRO_1:5
.= DataPart (Result ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s))) by A22, A33, EXTPRO_1:23 ;
A36: now
let x be set ; :: thesis: ( x in dom (IExec ((if>0 (a,k1,I,J)),P,s)) implies (IExec ((if>0 (a,k1,I,J)),P,s)) . b1 = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . b1 )
A37: dom (Start-At ((((card I) + (card J)) + 2),SCMPDS)) = {(IC )} by FUNCOP_1:19;
assume A38: x in dom (IExec ((if>0 (a,k1,I,J)),P,s)) ; :: thesis: (IExec ((if>0 (a,k1,I,J)),P,s)) . b1 = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . b1
per cases ( x is Int_position or x = IC or x is Element of NAT ) by A38, SCMPDS_4:20;
suppose A39: x is Int_position ; :: thesis: (IExec ((if>0 (a,k1,I,J)),P,s)) . b1 = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . b1
then x <> IC by SCMPDS_2:52;
then A40: not x in dom (Start-At ((((card I) + (card J)) + 2),SCMPDS)) by A37, TARSKI:def 1;
A41: not x in dom (s | NAT) by A6, A39, SCMPDS_2:53;
hence (IExec ((if>0 (a,k1,I,J)),P,s)) . x = (Result ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s))) . x by FUNCT_4:12
.= (Result ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) . x by A35, A39, SCMPDS_4:23
.= (IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) . x by A41, FUNCT_4:12
.= ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . x by A40, FUNCT_4:12 ;
:: thesis: verum
end;
suppose A42: x = IC ; :: thesis: (IExec ((if>0 (a,k1,I,J)),P,s)) . b1 = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . b1
A43: not x in dom (s | NAT) by A6, A42, COMPOS_1:3;
then A44: IC (Result ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) = IC (IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) by A42, FUNCT_4:12
.= ((card I) + (card J)) + 1 by A13, A14, Th46 ;
A45: x in dom (Start-At ((((card I) + (card J)) + 2),SCMPDS)) by A37, A42, TARSKI:def 1;
thus (IExec ((if>0 (a,k1,I,J)),P,s)) . x = (Result ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s))) . x by A43, FUNCT_4:12
.= (Comput ((P +* (stop (if>0 (a,k1,I,J)))),(Initialize s),((LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s))) + 1))) . x by A22, A33, EXTPRO_1:23
.= IC (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 A42, EXTPRO_1:5
.= (IC (Comput ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s),(LifeSpan ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)))))) + 1 by A16, A8, A10, A12, Th45, UU
.= (IC (Result ((P +* (stop ((I ';' (Goto ((card J) + 1))) ';' J))),(Initialize s)))) + 1 by A15, EXTPRO_1:23
.= IC (Start-At (((((card I) + (card J)) + 1) + 1),SCMPDS)) by A44, FUNCOP_1:87
.= ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . x by A42, A45, FUNCT_4:14 ; :: thesis: verum
end;
suppose x is Element of NAT ; :: thesis: (IExec ((if>0 (a,k1,I,J)),P,s)) . b1 = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . b1
hence (IExec ((if>0 (a,k1,I,J)),P,s)) . x = ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) . x by Th26; :: thesis: verum
end;
end;
end;
dom (IExec ((if>0 (a,k1,I,J)),P,s)) = the carrier of SCMPDS by PARTFUN1:def 4
.= dom ((IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS))) by PARTFUN1:def 4 ;
hence IExec ((if>0 (a,k1,I,J)),P,s) = (IExec (((I ';' (Goto ((card J) + 1))) ';' J),P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) by A36, FUNCT_1:9
.= ((IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 1),SCMPDS))) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) by A13, A14, Th47
.= (IExec (I,P,s)) +* (Start-At ((((card I) + (card J)) + 2),SCMPDS)) by COMPOS_1:199 ;
:: thesis: verum