let P be Instruction-Sequence of SCM+FSA; :: thesis: for s being State of SCM+FSA
for I, J being Program of SCM+FSA
for a being read-write Int-Location st s . a <= 0 & J is_closed_on s,P & J is_halting_on s,P holds
( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P )

let s be State of SCM+FSA; :: thesis: for I, J being Program of SCM+FSA
for a being read-write Int-Location st s . a <= 0 & J is_closed_on s,P & J is_halting_on s,P holds
( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P )

let I, J be Program of SCM+FSA; :: thesis: for a being read-write Int-Location st s . a <= 0 & J is_closed_on s,P & J is_halting_on s,P holds
( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P )

let a be read-write Int-Location ; :: thesis: ( s . a <= 0 & J is_closed_on s,P & J is_halting_on s,P implies ( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P ) )
set I1 = I ';' (Stop SCM+FSA);
set JI2 = ((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA);
set s2 = Initialize s;
set P2 = P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA));
A1: ((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA) c= P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) by FUNCT_4:25;
set s3 = Initialize s;
set P3 = P +* (if>0 (a,I,J));
set s4 = Comput ((P +* (if>0 (a,I,J))),(Initialize s),1);
set s5 = Comput ((P +* (if>0 (a,I,J))),(Initialize s),2);
set i = a >0_goto ((card J) + 3);
IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15;
then A5: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by FUNCT_4:13
.= 0 by FUNCOP_1:72 ;
A8: if>0 (a,I,J) c= P +* (if>0 (a,I,J)) by FUNCT_4:25;
A9: if>0 (a,I,J) = (((a >0_goto ((card J) + 3)) ';' J) ';' (Goto ((card I) + 1))) ';' (I ';' (Stop SCM+FSA)) by SCMFSA6A:25
.= ((a >0_goto ((card J) + 3)) ';' J) ';' ((Goto ((card I) + 1)) ';' (I ';' (Stop SCM+FSA))) by SCMFSA6A:25
.= (a >0_goto ((card J) + 3)) ';' (J ';' ((Goto ((card I) + 1)) ';' (I ';' (Stop SCM+FSA)))) by SCMFSA6A:29
.= (a >0_goto ((card J) + 3)) ';' ((J ';' (Goto ((card I) + 1))) ';' (I ';' (Stop SCM+FSA))) by SCMFSA6A:25
.= (Macro (a >0_goto ((card J) + 3))) ';' (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) by SCMFSA6A:25 ;
then A10: Reloc ((((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)),(card (Macro (a >0_goto ((card J) + 3))))) c= if>0 (a,I,J) by Lm1;
card (Macro (a >0_goto ((card J) + 3))) = 2 by COMPOS_1:56;
then A12: Reloc ((((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)),2) c= P +* (if>0 (a,I,J)) by A8, A10, XBOOLE_1:1;
B13: not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102;
A14: 0 in dom (if>0 (a,I,J)) by Lm2;
A15: (P +* (if>0 (a,I,J))) . 0 = (if>0 (a,I,J)) . 0 by A14, FUNCT_4:13
.= a >0_goto ((card J) + 3) by Lm3 ;
A16: 1 in dom (if>0 (a,I,J)) by Lm2;
A17: Comput ((P +* (if>0 (a,I,J))),(Initialize s),(0 + 1)) = Following ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),0))) by EXTPRO_1:3
.= Following ((P +* (if>0 (a,I,J))),(Initialize s)) by EXTPRO_1:2
.= Exec ((a >0_goto ((card J) + 3)),(Initialize s)) by A5, A15, PBOOLE:143 ;
assume s . a <= 0 ; :: thesis: ( not J is_closed_on s,P or not J is_halting_on s,P or ( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P ) )
then (Initialize s) . a <= 0 by B13, FUNCT_4:11;
then A18: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),1)) = succ 0 by A5, A17, SCMFSA_2:71
.= 0 + 1 ;
A19: (P +* (if>0 (a,I,J))) . 1 = (if>0 (a,I,J)) . 1 by A16, FUNCT_4:13
.= goto 2 by Lm3 ;
assume A20: J is_closed_on s,P ; :: thesis: ( not J is_halting_on s,P or ( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P ) )
A21: Comput ((P +* (if>0 (a,I,J))),(Initialize s),(1 + 1)) = Following ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),1))) by EXTPRO_1:3
.= Exec ((goto 2),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),1))) by A18, A19, PBOOLE:143 ;
A23: now
let f be FinSeq-Location ; :: thesis: (Initialize s) . f = (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) . f
thus (Initialize s) . f = (Comput ((P +* (if>0 (a,I,J))),(Initialize s),1)) . f by A17, SCMFSA_2:71
.= (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) . f by A21, SCMFSA_2:69 ; :: thesis: verum
end;
now
let a be Int-Location ; :: thesis: (Initialize s) . a = (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) . a
thus (Initialize s) . a = (Comput ((P +* (if>0 (a,I,J))),(Initialize s),1)) . a by A17, SCMFSA_2:71
.= (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) . a by A21, SCMFSA_2:69 ; :: thesis: verum
end;
then A24: DataPart (Initialize s) = DataPart (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) by A23, SCMFSA6A:7;
assume A25: J is_halting_on s,P ; :: thesis: ( if>0 (a,I,J) is_closed_on s,P & if>0 (a,I,J) is_halting_on s,P )
then A26: ((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA) is_closed_on s,P by A20, SCMFSA8A:37;
then A27: ((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA) is_closed_on Initialize s,P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) by Th10;
A28: P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) halts_on Initialize s by A20, A25, SCMFSA8A:38;
A29: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)) = 2 by A21, SCMFSA_2:69;
now
let k be Element of NAT ; :: thesis: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),b1)) in dom (if>0 (a,I,J))
( k = 0 or 0 + 1 < k + 1 ) by XREAL_1:6;
then A30: ( k = 0 or 1 <= k ) by NAT_1:13;
per cases ( 1 < k or k = 0 or k = 1 ) by A30, XXREAL_0:1;
suppose A31: 1 < k ; :: thesis: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),b1)) in dom (if>0 (a,I,J))
then consider k1 being Nat such that
A32: k1 + 1 = k by NAT_1:6;
0 + 1 < k1 + 1 by A31, A32;
then consider k2 being Nat such that
A33: k2 + 1 = k1 by NAT_1:6;
reconsider k1 = k1, k2 = k2 as Element of NAT by ORDINAL1:def 12;
reconsider m = IC (Comput ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Initialize s),k2)) as Element of NAT ;
A34: card (if>0 (a,I,J)) = (card (Macro (a >0_goto ((card J) + 3)))) + (card (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))) by A9, SCMFSA6A:21
.= 2 + (card (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))) by COMPOS_1:56 ;
m in dom (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) by A26, SCMFSA7B:def 6;
then m < card (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA)) by AFINSQ_1:66;
then A35: m + 2 < card (if>0 (a,I,J)) by A34, XREAL_1:6;
IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),k)) = IC (Comput ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),1)),k1)) by A32, EXTPRO_1:4
.= IC (Comput ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),1)),1)),k2)) by A33, EXTPRO_1:4
.= IC (Comput ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),(1 + 1))),k2)) by EXTPRO_1:4
.= m + 2 by A27, A29, A24, Th11, A12, A1 ;
hence IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),k)) in dom (if>0 (a,I,J)) by A35, AFINSQ_1:66; :: thesis: verum
end;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),b1)) in dom (if>0 (a,I,J))
hence IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),k)) in dom (if>0 (a,I,J)) by A14, A5, EXTPRO_1:2; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),b1)) in dom (if>0 (a,I,J))
hence IC (Comput ((P +* (if>0 (a,I,J))),(Initialize s),k)) in dom (if>0 (a,I,J)) by A18, Lm2; :: thesis: verum
end;
end;
end;
hence if>0 (a,I,J) is_closed_on s,P by SCMFSA7B:def 6; :: thesis: if>0 (a,I,J) is_halting_on s,P
CurInstr ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),((LifeSpan ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Initialize s))) + 2)))) = CurInstr ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Comput ((P +* (if>0 (a,I,J))),(Initialize s),2)),(LifeSpan ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Initialize s)))))) by EXTPRO_1:4
.= IncAddr ((CurInstr ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Comput ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Initialize s),(LifeSpan ((P +* (((J ';' (Goto ((card I) + 1))) ';' I) ';' (Stop SCM+FSA))),(Initialize s))))))),2) by A27, A12, A29, A24, Th11, A1
.= IncAddr ((halt SCM+FSA),2) by A28, EXTPRO_1:def 15
.= halt SCM+FSA by COMPOS_1:11 ;
then P +* (if>0 (a,I,J)) halts_on Initialize s by EXTPRO_1:29;
hence if>0 (a,I,J) is_halting_on s,P by SCMFSA7B:def 7; :: thesis: verum