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

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

let a be read-write Int-Location ; :: thesis: ( s . a <> 0 implies ( while=0 a,I is_halting_on s & while=0 a,I is_closed_on s ) )
assume A1: s . a <> 0 ; :: thesis: ( while=0 a,I is_halting_on s & while=0 a,I is_closed_on s )
set i = a =0_goto (insloc 4);
set s1 = s +* ((while=0 a,I) +* (Start-At (insloc 0 )));
A2: IC SCM+FSA in dom ((while=0 a,I) +* (Start-At (insloc 0 ))) by SF_MASTR:65;
A3: IC (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) = (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (IC SCM+FSA ) by AMI_1:def 15
.= ((while=0 a,I) +* (Start-At (insloc 0 ))) . (IC SCM+FSA ) by A2, FUNCT_4:14
.= insloc 0 by SF_MASTR:66 ;
set loc5 = insloc ((card I) + 5);
set s5 = Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),4;
set s4 = Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3;
set s3 = Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2;
set s2 = Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1;
A4: insloc 1 in dom (while=0 a,I) by Th10;
A5: insloc 2 in dom (while=0 a,I) by Th12;
not a in dom ((while=0 a,I) +* (Start-At (insloc 0 ))) by SCMFSA6B:12;
then A6: (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . a = s . a by FUNCT_4:12;
while=0 a,I c= (while=0 a,I) +* (Start-At (insloc 0 )) by SCMFSA8A:9;
then A7: dom (while=0 a,I) c= dom ((while=0 a,I) +* (Start-At (insloc 0 ))) by GRFUNC_1:8;
A8: insloc 0 in dom (while=0 a,I) by Th10;
then (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (insloc 0 ) = ((while=0 a,I) +* (Start-At (insloc 0 ))) . (insloc 0 ) by A7, FUNCT_4:14
.= (while=0 a,I) . (insloc 0 ) by A8, SCMFSA6B:7
.= a =0_goto (insloc 4) by Th11 ;
then A9: CurInstr (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) = a =0_goto (insloc 4) by A3, AMI_1:def 17;
A10: Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),(0 + 1) = Following (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),0 ) by AMI_1:14
.= Following (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) by AMI_1:13
.= Exec (a =0_goto (insloc 4)),(s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) by A9, AMI_1:def 18 ;
A11: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) = (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) . (IC SCM+FSA ) by AMI_1:def 15
.= Next (insloc 0 ) by A1, A3, A10, A6, SCMFSA_2:96
.= insloc (0 + 1) ;
(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) . (insloc 1) = (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (insloc 1) by AMI_1:54
.= ((while=0 a,I) +* (Start-At (insloc 0 ))) . (insloc 1) by A7, A4, FUNCT_4:14
.= (while=0 a,I) . (insloc 1) by A4, SCMFSA6B:7
.= goto (insloc 2) by Th11 ;
then A12: CurInstr (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) = goto (insloc 2) by A11, AMI_1:def 17;
A13: Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),(1 + 1) = Following (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) by AMI_1:14
.= Exec (goto (insloc 2)),(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),1) by A12, AMI_1:def 18 ;
A14: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) = (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) . (IC SCM+FSA ) by AMI_1:def 15
.= insloc 2 by A13, SCMFSA_2:95 ;
(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) . (insloc 2) = (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (insloc 2) by AMI_1:54
.= ((while=0 a,I) +* (Start-At (insloc 0 ))) . (insloc 2) by A7, A5, FUNCT_4:14
.= (while=0 a,I) . (insloc 2) by A5, SCMFSA6B:7
.= goto (insloc 3) by Th16 ;
then A15: CurInstr (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) = goto (insloc 3) by A14, AMI_1:def 17;
A16: Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),(2 + 1) = Following (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) by AMI_1:14
.= Exec (goto (insloc 3)),(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),2) by A15, AMI_1:def 18 ;
A17: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) = (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) . (IC SCM+FSA ) by AMI_1:def 15
.= insloc 3 by A16, SCMFSA_2:95 ;
A18: insloc 3 in dom (while=0 a,I) by Th12;
A19: insloc ((card I) + 5) in dom (while=0 a,I) by Th13;
(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) . (insloc 3) = (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (insloc 3) by AMI_1:54
.= ((while=0 a,I) +* (Start-At (insloc 0 ))) . (insloc 3) by A7, A18, FUNCT_4:14
.= (while=0 a,I) . (insloc 3) by A18, SCMFSA6B:7
.= goto (insloc ((card I) + 5)) by Th15 ;
then A20: CurInstr (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) = goto (insloc ((card I) + 5)) by A17, AMI_1:def 17;
A21: Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),(3 + 1) = Following (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) by AMI_1:14
.= Exec (goto (insloc ((card I) + 5))),(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),3) by A20, AMI_1:def 18 ;
A22: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),4) = (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),4) . (IC SCM+FSA ) by AMI_1:def 15
.= insloc ((card I) + 5) by A21, SCMFSA_2:95 ;
(Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),4) . (insloc ((card I) + 5)) = (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))) . (insloc ((card I) + 5)) by AMI_1:54
.= ((while=0 a,I) +* (Start-At (insloc 0 ))) . (insloc ((card I) + 5)) by A7, A19, FUNCT_4:14
.= (while=0 a,I) . (insloc ((card I) + 5)) by A19, SCMFSA6B:7
.= halt SCM+FSA by Th14 ;
then A23: CurInstr (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),4) = halt SCM+FSA by A22, AMI_1:def 17;
then s +* ((while=0 a,I) +* (Start-At (insloc 0 ))) is halting by AMI_1:def 20;
hence while=0 a,I is_halting_on s by SCMFSA7B:def 8; :: thesis: while=0 a,I is_closed_on s
now
let k be Element of NAT ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
A24: ( 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 A24, NAT_1:28;
suppose k = 0 ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
hence IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),k) in dom (while=0 a,I) by A8, A3, AMI_1:13; :: thesis: verum
end;
suppose k = 1 ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
hence IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),k) in dom (while=0 a,I) by A11, Th10; :: thesis: verum
end;
suppose k = 2 ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
hence IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),k) in dom (while=0 a,I) by A14, Th12; :: thesis: verum
end;
suppose k = 3 ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
hence IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),k) in dom (while=0 a,I) by A17, Th12; :: thesis: verum
end;
suppose k >= 4 ; :: thesis: IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),b1) in dom (while=0 a,I)
hence IC (Computation (s +* ((while=0 a,I) +* (Start-At (insloc 0 )))),k) in dom (while=0 a,I) by A19, A22, A23, AMI_1:52; :: thesis: verum
end;
end;
end;
hence while=0 a,I is_closed_on s by SCMFSA7B:def 7; :: thesis: verum