let s be State of ; :: thesis: for I being Program of
for J being shiftable Program of st I is_closed_on s & I is_halting_on s & J is_closed_on IExec I,s & J is_halting_on IExec I,s holds
( I ';' J is_closed_on s & I ';' J is_halting_on s )

let I be Program of ; :: thesis: for J being shiftable Program of st I is_closed_on s & I is_halting_on s & J is_closed_on IExec I,s & J is_halting_on IExec I,s holds
( I ';' J is_closed_on s & I ';' J is_halting_on s )

let J be shiftable Program of ; :: thesis: ( I is_closed_on s & I is_halting_on s & J is_closed_on IExec I,s & J is_halting_on IExec I,s implies ( I ';' J is_closed_on s & I ';' J is_halting_on s ) )
set sE = IExec I,s;
assume that
A1: I is_closed_on s and
A2: I is_halting_on s and
A3: J is_closed_on IExec I,s and
A4: J is_halting_on IExec I,s ; :: thesis: ( I ';' J is_closed_on s & I ';' J is_halting_on s )
set IJ = I ';' J;
set sIJ = stop (I ';' J);
set IsIJ = Initialized (stop (I ';' J));
set spI = stop I;
set IsI = Initialized (stop I);
set ss = s +* (Initialized (stop (I ';' J)));
set spJ = stop J;
set IsJ = Initialized (stop J);
set s1 = s +* (Initialized (stop I));
set m1 = LifeSpan (s +* (Initialized (stop I)));
set sm = Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))));
set s3 = (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J));
set m3 = LifeSpan ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J)));
A5: dom (DataPart (Initialized (stop J))) = (dom (Initialized (stop J))) /\ SCM-Data-Loc by RELAT_1:90, SCMPDS_2:100;
J is_halting_on Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))) by A2, A3, A4, Th42;
then A6: ProgramPart ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))) halts_on (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J)) by SCMPDS_6:def 3;
A7: J is_closed_on Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))) by A2, A3, A4, Th42;
then A8: J is_closed_on (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J)) by SCMPDS_6:38;
A9: now
let x be set ; :: thesis: ( x in dom (DataPart (Initialized (stop J))) implies (DataPart (Initialized (stop J))) . b1 = (DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))))) . b1 )
assume x in dom (DataPart (Initialized (stop J))) ; :: thesis: (DataPart (Initialized (stop J))) . b1 = (DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))))) . b1
then A10: x in (dom (Initialized (stop J))) /\ SCM-Data-Loc by RELAT_1:90, SCMPDS_2:100;
then A11: x in dom (Initialized (stop J)) by XBOOLE_0:def 4;
A12: x in SCM-Data-Loc by A10, XBOOLE_0:def 4;
per cases ( x in dom (stop J) or x = IC SCMPDS ) by A11, SCMPDS_4:28;
end;
end;
set s4 = Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))));
A14: DataPart ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))) = (DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))))) +* (DataPart (Initialized (stop J))) by FUNCT_4:75;
A15: Initialized (stop J) c= (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J)) by FUNCT_4:26;
then dom (Initialized (stop J)) c= dom ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))) by GRFUNC_1:8;
then dom (Initialized (stop J)) c= the carrier of SCMPDS by AMI_1:79;
then dom (DataPart (Initialized (stop J))) c= the carrier of SCMPDS /\ SCM-Data-Loc by A5, XBOOLE_1:26;
then dom (DataPart (Initialized (stop J))) c= (dom (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))))) /\ SCM-Data-Loc by AMI_1:79;
then dom (DataPart (Initialized (stop J))) c= dom (DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I)))))) by RELAT_1:90, SCMPDS_2:100;
then DataPart (Initialized (stop J)) c= DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) by A9, GRFUNC_1:8;
then A16: DataPart (Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) = DataPart ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))) by A14, LATTICE2:8;
s +* (Initialized (stop (I ';' J))) = s +* ((I ';' (J ';' (Stop SCMPDS ))) +* (Start-At (inspos 0 ))) by SCMPDS_4:46;
then A17: DataPart (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = DataPart ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))) by A1, A2, A16, Th38, SCMPDS_4:24;
stop (I ';' J) = I ';' (J ';' (Stop SCMPDS )) by SCMPDS_4:46
.= I +* (Shift (stop J),(card I)) ;
then A18: Shift (stop J),(card I) c= stop (I ';' J) by FUNCT_4:26;
stop (I ';' J) c= s +* (Initialized (stop (I ';' J))) by FUNCT_4:26, SCMPDS_4:57;
then Shift (stop J),(card I) c= s +* (Initialized (stop (I ';' J))) by A18, XBOOLE_1:1;
then A19: Shift (stop J),(card I) c= Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I)))) by AMI_1:81;
A20: dom (stop I) c= dom (stop (I ';' J)) by SCMPDS_5:16;
now
let k be Element of NAT ; :: thesis: IC (Computation (s +* (Initialized (stop (I ';' J)))),b1) in dom (stop (I ';' J))
per cases ( k <= LifeSpan (s +* (Initialized (stop I))) or k > LifeSpan (s +* (Initialized (stop I))) ) ;
suppose k <= LifeSpan (s +* (Initialized (stop I))) ; :: thesis: IC (Computation (s +* (Initialized (stop (I ';' J)))),b1) in dom (stop (I ';' J))
then IC (Computation (s +* (Initialized (stop (I ';' J)))),k) in dom (stop I) by A1, A2, Th17, Th40;
hence IC (Computation (s +* (Initialized (stop (I ';' J)))),k) in dom (stop (I ';' J)) by A20; :: thesis: verum
end;
suppose A21: k > LifeSpan (s +* (Initialized (stop I))) ; :: thesis: IC (Computation (s +* (Initialized (stop (I ';' J)))),b1) in dom (stop (I ';' J))
A22: IC (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) in dom (stop I) by A1, A2, Th17, Th40;
hereby :: thesis: verum
per cases ( IC (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = inspos (card I) or CurInstr (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = halt SCMPDS ) by A1, A2, Th17, Th41;
suppose A23: IC (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = inspos (card I) ; :: thesis: IC (Computation (s +* (Initialized (stop (I ';' J)))),k) in dom (stop (I ';' J))
consider ii being Nat such that
A24: k = (LifeSpan (s +* (Initialized (stop I)))) + ii by A21, NAT_1:10;
reconsider ii = ii as Element of NAT by ORDINAL1:def 13;
reconsider nn = IC (Computation ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))),ii) as Element of NAT by ORDINAL1:def 13;
(IC (Computation ((Computation (s +* (Initialized (stop I))),(LifeSpan (s +* (Initialized (stop I))))) +* (Initialized (stop J))),ii)) + (card I) = IC (Computation (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))),ii) by A15, A17, A8, A19, A23, SCMPDS_6:45;
then A25: IC (Computation (s +* (Initialized (stop (I ';' J)))),k) = (inspos nn) + (card I) by A24, AMI_1:51
.= inspos (nn + (card I)) ;
inspos nn in dom (stop J) by A7, SCMPDS_6:def 2;
then nn < card (stop J) by SCMPDS_4:1;
then nn < (card J) + 1 by SCMPDS_5:7;
then A26: (card I) + nn < (card I) + ((card J) + 1) by XREAL_1:8;
card (stop (I ';' J)) = (card (I ';' J)) + 1 by SCMPDS_5:7
.= ((card I) + (card J)) + 1 by SCMPDS_4:45 ;
hence IC (Computation (s +* (Initialized (stop (I ';' J)))),k) in dom (stop (I ';' J)) by A26, A25, SCMPDS_4:1; :: thesis: verum
end;
end;
end;
end;
end;
end;
hence I ';' J is_closed_on s by SCMPDS_6:def 2; :: thesis: I ';' J is_halting_on s
per cases ( CurInstr (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = halt SCMPDS or IC (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = inspos (card I) ) by A1, A2, Th17, Th41;
suppose CurInstr (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = halt SCMPDS ; :: thesis: I ';' J is_halting_on s
end;
suppose IC (Computation (s +* (Initialized (stop (I ';' J)))),(LifeSpan (s +* (Initialized (stop I))))) = inspos (card I) ; :: thesis: I ';' J is_halting_on s
end;
end;