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

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

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

let a be read-write Int-Location ; :: thesis: ( s . a <= 0 implies ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) )
assume A1: s . a <= 0 ; :: thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P )
set i = a >0_goto 4;
set s1 = Initialize s;
set P1 = P +* (while>0 (a,I));
IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15;
then A3: IC in dom (Start-At (0,SCM+FSA)) ;
A4: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by A3, FUNCT_4:13
.= 0 by FUNCOP_1:72 ;
set loc5 = (card I) + 5;
set s5 = Comput ((P +* (while>0 (a,I))),(Initialize s),4);
set s4 = Comput ((P +* (while>0 (a,I))),(Initialize s),3);
set s3 = Comput ((P +* (while>0 (a,I))),(Initialize s),2);
set s2 = Comput ((P +* (while>0 (a,I))),(Initialize s),1);
A5: 1 in dom (while>0 (a,I)) by Th10;
A6: 2 in dom (while>0 (a,I)) by Th37;
not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102;
then A7: (Initialize s) . a = s . a by FUNCT_4:11;
A8: (P +* (while>0 (a,I))) /. (IC (Initialize s)) = (P +* (while>0 (a,I))) . (IC (Initialize s)) by PBOOLE:143;
A9: 0 in dom (while>0 (a,I)) by Th10;
then (P +* (while>0 (a,I))) . 0 = (while>0 (a,I)) . 0 by FUNCT_4:13
.= a >0_goto 4 by Th11 ;
then A10: CurInstr ((P +* (while>0 (a,I))),(Initialize s)) = a >0_goto 4 by A4, A8;
A11: Comput ((P +* (while>0 (a,I))),(Initialize s),(0 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),0))) by EXTPRO_1:3
.= Following ((P +* (while>0 (a,I))),(Initialize s)) by EXTPRO_1:2
.= Exec ((a >0_goto 4),(Initialize s)) by A10 ;
A12: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) = succ 0 by A1, A4, A11, A7, SCMFSA_2:71
.= 0 + 1 ;
A13: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by PBOOLE:143;
(P +* (while>0 (a,I))) . 1 = (while>0 (a,I)) . 1 by A5, FUNCT_4:13
.= goto 2 by Th11 ;
then A14: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) = goto 2 by A12, A13;
A15: Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by EXTPRO_1:3
.= Exec ((goto 2),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by A14 ;
A16: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2)) = 2 by A15, SCMFSA_2:69;
A17: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by PBOOLE:143;
(P +* (while>0 (a,I))) . 2 = (while>0 (a,I)) . 2 by A6, FUNCT_4:13
.= goto 3 by Th41 ;
then A18: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) = goto 3 by A16, A17;
A19: Comput ((P +* (while>0 (a,I))),(Initialize s),(2 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by EXTPRO_1:3
.= Exec ((goto 3),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by A18 ;
A20: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3)) = 3 by A19, SCMFSA_2:69;
A21: 3 in dom (while>0 (a,I)) by Th37;
A22: (card I) + 5 in dom (while>0 (a,I)) by Th38;
A23: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by PBOOLE:143;
(P +* (while>0 (a,I))) . 3 = (while>0 (a,I)) . 3 by A21, FUNCT_4:13
.= goto ((card I) + 5) by Th40 ;
then A24: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) = goto ((card I) + 5) by A20, A23;
A25: Comput ((P +* (while>0 (a,I))),(Initialize s),(3 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by EXTPRO_1:3
.= Exec ((goto ((card I) + 5)),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by A24 ;
A26: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4)) = (card I) + 5 by A25, SCMFSA_2:69;
A27: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4))) by PBOOLE:143;
(P +* (while>0 (a,I))) . ((card I) + 5) = (while>0 (a,I)) . ((card I) + 5) by A22, FUNCT_4:13
.= halt SCM+FSA by Th39 ;
then A28: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),4))) = halt SCM+FSA by A26, A27;
then P +* (while>0 (a,I)) halts_on Initialize s by EXTPRO_1:29;
hence while>0 (a,I) is_halting_on s,P by SCMFSA7B:def 7; :: thesis: while>0 (a,I) is_closed_on s,P
now
let k be Element of NAT ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
A29: ( k <= 3 or k >= 3 + 1 ) by NAT_1:13;
per cases ( k = 0 or k = 1 or k = 2 or k = 3 or k >= 4 ) by A29, NAT_1:27;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A9, A4, EXTPRO_1:2; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A12, Th10; :: thesis: verum
end;
suppose k = 2 ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A16, Th37; :: thesis: verum
end;
suppose k = 3 ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A20, Th37; :: thesis: verum
end;
suppose k >= 4 ; :: thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I))
hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A22, A26, A28, EXTPRO_1:5; :: thesis: verum
end;
end;
end;
hence while>0 (a,I) is_closed_on s,P by SCMFSA7B:def 6; :: thesis: verum