set D = Int-Locations \/ FinSeq-Locations ;
let s be State of SCM+FSA ; :: thesis: for I being Program of SCM+FSA
for a being read-write Int-Location st I is_closed_onInit s & I is_halting_onInit s & s . a > 0 holds
( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) )

let I be Program of SCM+FSA ; :: thesis: for a being read-write Int-Location st I is_closed_onInit s & I is_halting_onInit s & s . a > 0 holds
( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) )

let a be read-write Int-Location ; :: thesis: ( I is_closed_onInit s & I is_halting_onInit s & s . a > 0 implies ( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) ) )
assume A1: I is_closed_onInit s ; :: thesis: ( not I is_halting_onInit s or not s . a > 0 or ( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) ) )
assume A2: I is_halting_onInit s ; :: thesis: ( not s . a > 0 or ( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) ) )
assume A3: s . a > 0 ; :: thesis: ( IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 & DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) )
set s0 = Initialize s;
set IA = I +* (Start-At (insloc 0 ));
set s1 = (Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )));
set s2 = Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),1;
set i = a >0_goto (insloc 4);
set sI = (Initialize s) +* (I +* (Start-At (insloc 0 )));
now end;
then A4: I is_closed_on Initialize s by SCMFSA7B:def 7;
s +* (Initialized I) is halting by A2, SCM_HALT:def 5;
then (Initialize s) +* (I +* (Start-At (insloc 0 ))) is halting by SCMFSA8A:13;
then A5: I is_halting_on Initialize s by SCMFSA7B:def 8;
A6: (Initialize s) . a > 0 by A3, SCMFSA6C:3;
A7: insloc 0 in dom (while>0 a,I) by SCMFSA_9:10;
while>0 a,I c= (while>0 a,I) +* (Start-At (insloc 0 )) by SCMFSA8A:9;
then A8: dom (while>0 a,I) c= dom ((while>0 a,I) +* (Start-At (insloc 0 ))) by GRFUNC_1:8;
IC SCM+FSA in dom ((while>0 a,I) +* (Start-At (insloc 0 ))) by SF_MASTR:65;
then A9: IC ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) = ((while>0 a,I) +* (Start-At (insloc 0 ))) . (IC SCM+FSA ) by FUNCT_4:14
.= insloc 0 by SF_MASTR:66 ;
A10: ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) . (insloc 0 ) = ((while>0 a,I) +* (Start-At (insloc 0 ))) . (insloc 0 ) by A7, A8, FUNCT_4:14
.= (while>0 a,I) . (insloc 0 ) by A7, SCMFSA6B:7
.= a >0_goto (insloc 4) by SCMFSA_9:11 ;
A11: Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(0 + 1) = Following (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),0 ) by AMI_1:14
.= Following ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) by AMI_1:13
.= Exec (a >0_goto (insloc 4)),((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) by A9, A10 ;
( not a in dom ((while>0 a,I) +* (Start-At (insloc 0 ))) & a in dom (Initialize s) ) by SCMFSA6B:12, SCMFSA_2:66;
then A12: ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) . a = (Initialize s) . a by FUNCT_4:12;
( ( for c being Int-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),1) . c = ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) . c ) & ( for f being FinSeq-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),1) . f = ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) . f ) ) by A11, SCMFSA_2:97;
then A13: DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),1) = DataPart ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) by SCMFSA6A:38
.= DataPart (Initialize s) by SCMFSA8A:11
.= DataPart ((Initialize s) +* (I +* (Start-At (insloc 0 )))) by SCMFSA8A:11 ;
defpred S1[ Nat] means ( $1 <= LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))) implies ( IC (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + $1)) = (IC (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),$1)) + 4 & DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + $1)) = DataPart (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),$1) ) );
A14: S1[ 0 ]
proof end;
A16: now
let k be Element of NAT ; :: thesis: ( S1[k] implies S1[k + 1] )
assume A17: S1[k] ; :: thesis: S1[k + 1]
now
assume A18: k + 1 <= LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))) ; :: thesis: ( IC (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + k) + 1)) = (IC (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),(k + 1))) + 4 & DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + k) + 1)) = DataPart (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),(k + 1)) )
k + 0 < k + 1 by XREAL_1:8;
then k < LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))) by A18, XXREAL_0:2;
hence ( IC (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + k) + 1)) = (IC (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),(k + 1))) + 4 & DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + k) + 1)) = DataPart (Computation ((Initialize s) +* (I +* (Start-At (insloc 0 )))),(k + 1)) ) by A4, A5, A17, SCMFSA_9:44; :: thesis: verum
end;
hence S1[k + 1] ; :: thesis: verum
end;
set s2 = Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))));
set loc4 = insloc ((card I) + 4);
set s3 = Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1);
for k being Element of NAT holds S1[k] from NAT_1:sch 1(A14, A16);
then A19: S1[ LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))] ;
A20: Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) = Following (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) by AMI_1:14
.= Exec (goto (insloc ((card I) + 4))),(Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) by A4, A5, A19, SCMFSA_9:45 ;
then ( ( for c being Int-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) . c = (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) . c ) & ( for f being FinSeq-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) . f = (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) . f ) ) by SCMFSA_2:95;
then A21: DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) = DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) by SCMFSA6A:38;
A22: insloc ((card I) + 4) in dom (while>0 a,I) by SCMFSA_9:38;
set s4 = Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1);
A23: (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) . (insloc ((card I) + 4)) = ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))) . (insloc ((card I) + 4)) by AMI_1:54
.= ((while>0 a,I) +* (Start-At (insloc 0 ))) . (insloc ((card I) + 4)) by A8, A22, FUNCT_4:14
.= (while>0 a,I) . (insloc ((card I) + 4)) by A22, SCMFSA6B:7
.= goto (insloc 0 ) by SCMFSA_9:46 ;
A24: Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1) = Following (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) by AMI_1:14
.= Exec (goto (insloc 0 )),(Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) by A20, A23, SCMFSA_2:95 ;
then ( ( for c being Int-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1)) . c = (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) . c ) & ( for f being FinSeq-Location holds (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1)) . f = (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1)) . f ) ) by SCMFSA_2:95;
then A25: DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1)) = DataPart (Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))))) by A21, SCMFSA6A:38;
A26: (((LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))) + 1) + 1) + 1 = (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 ))))) + (2 + 1) ;
A27: Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3) = Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),((LifeSpan (s +* (Initialized I))) + 3) by SCMFSA8A:13
.= Computation ((Initialize s) +* ((while>0 a,I) +* (Start-At (insloc 0 )))),(((1 + (LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) + 1) + 1) by A26, SCMFSA8A:13 ;
hence IC (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = insloc 0 by A24, SCMFSA_2:95; :: thesis: DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I))))
thus DataPart (Computation (s +* (Initialized (while>0 a,I))),((LifeSpan (s +* (Initialized I))) + 3)) = DataPart (Computation (s +* (Initialized I)),(LifeSpan ((Initialize s) +* (I +* (Start-At (insloc 0 )))))) by A19, A25, A27, SCMFSA8A:13
.= DataPart (Computation (s +* (Initialized I)),(LifeSpan (s +* (Initialized I)))) by SCMFSA8A:13 ; :: thesis: verum