let P be the Instructions of SCM+FSA -valued ManySortedSet of NAT ; :: thesis: for s being State of SCM+FSA
for I being Program of SCM+FSA
for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds
( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) )

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_on s,P & I is_halting_on s,P & s . a = 0 holds
( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) )

let I be Program of SCM+FSA; :: thesis: for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds
( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) )

let a be read-write Int-Location ; :: thesis: ( I is_closed_on s,P & I is_halting_on s,P & s . a = 0 implies ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) ) )

assume A1: I is_closed_on s,P ; :: thesis: ( not I is_halting_on s,P or not s . a = 0 or ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) ) )

A2: ProgramPart I = I by RELAT_1:209;
set sI = s +* (Initialize I);
set PI = P +* I;
set s1 = s +* (Initialize (while=0 (a,I)));
set P1 = P +* (while=0 (a,I));
defpred S1[ Nat] means ( $1 <= LifeSpan ((P +* I),(s +* (Initialize I))) implies ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + $1))) = (IC (Comput ((P +* I),(s +* (Initialize I)),$1))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + $1))) = DataPart (Comput ((P +* I),(s +* (Initialize I)),$1)) ) );
assume A3: I is_halting_on s,P ; :: thesis: ( not s . a = 0 or ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) ) )

A4: now
let k be Element of NAT ; :: thesis: ( S1[k] implies S1[k + 1] )
assume A5: S1[k] ; :: thesis: S1[k + 1]
now
A6: k + 0 < k + 1 by XREAL_1:8;
assume k + 1 <= LifeSpan ((P +* I),(s +* (Initialize I))) ; :: thesis: ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + k) + 1))) = (IC (Comput ((P +* I),(s +* (Initialize I)),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Initialize I)),(k + 1))) )
then k < LifeSpan ((P +* I),(s +* (Initialize I))) by A6, XXREAL_0:2;
hence ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + k) + 1))) = (IC (Comput ((P +* I),(s +* (Initialize I)),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Initialize I)),(k + 1))) ) by A1, A3, A5, Th19; :: thesis: verum
end;
hence S1[k + 1] ; :: thesis: verum
end;
reconsider l = LifeSpan ((P +* I),(s +* (Initialize I))) as Element of NAT ;
set loc4 = (card I) + 4;
set i = a =0_goto 4;
set s2 = Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1);
A7: IC in dom (Initialize (while=0 (a,I))) by COMPOS_1:141;
A8: IC (s +* (Initialize (while=0 (a,I)))) = IC (Initialize (while=0 (a,I))) by A7, FUNCT_4:14
.= 0 by COMPOS_1:142 ;
not a in dom (Initialize (while=0 (a,I))) by SCMFSA6B:12;
then A9: (s +* (Initialize (while=0 (a,I)))) . a = s . a by FUNCT_4:12;
assume A10: s . a = 0 ; :: thesis: ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ) )

A11: 0 in dom (while=0 (a,I)) by Th10;
A12: (P +* (while=0 (a,I))) /. (IC (s +* (Initialize (while=0 (a,I))))) = (P +* (while=0 (a,I))) . (IC (s +* (Initialize (while=0 (a,I))))) by PBOOLE:158;
(P +* (while=0 (a,I))) . 0 = (while=0 (a,I)) . 0 by A11, FUNCT_4:14
.= (while=0 (a,I)) . 0
.= a =0_goto 4 by Th11 ;
then A13: CurInstr ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I))))) = a =0_goto 4 by A8, A12;
A14: Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(0 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),0))) by EXTPRO_1:4
.= Following ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I))))) by EXTPRO_1:3
.= Exec ((a =0_goto 4),(s +* (Initialize (while=0 (a,I))))) by A13 ;
then ( ( for c being Int-Location holds (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1)) . c = (s +* (Initialize (while=0 (a,I)))) . c ) & ( for f being FinSeq-Location holds (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1)) . f = (s +* (Initialize (while=0 (a,I)))) . f ) ) by SCMFSA_2:96;
then A15: DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1)) = DataPart (s +* (Initialize (while=0 (a,I)))) by SCMFSA6A:38
.= DataPart s by SCMFSA8A:11
.= DataPart (s +* (Initialize I)) by SCMFSA8A:11 ;
A16: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1)) = (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),1)) . (IC )
.= 4 by A10, A14, A9, SCMFSA_2:96 ;
A17: S1[ 0 ]
proof
assume 0 <= LifeSpan ((P +* I),(s +* (Initialize I))) ; :: thesis: ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + 0))) = (IC (Comput ((P +* I),(s +* (Initialize I)),0))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + 0))) = DataPart (Comput ((P +* I),(s +* (Initialize I)),0)) )
A18: IC in dom (Initialize I) by COMPOS_1:141;
IC (Comput ((P +* I),(s +* (Initialize I)),0)) = IC (s +* (Initialize I)) by EXTPRO_1:3
.= IC (Initialize I) by A18, FUNCT_4:14
.= 0 by COMPOS_1:142 ;
hence ( IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + 0))) = (IC (Comput ((P +* I),(s +* (Initialize I)),0))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + 0))) = DataPart (Comput ((P +* I),(s +* (Initialize I)),0)) ) by A16, A15, EXTPRO_1:3; :: thesis: verum
end;
A19: for k being Element of NAT holds S1[k] from NAT_1:sch 1(A17, A4);
set s4 = Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1) + 1));
set s3 = Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1));
A20: (card I) + 4 in dom (while=0 (a,I)) by Th13;
set s2 = Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + (LifeSpan ((P +* I),(s +* (Initialize I))))));
S1[l] by A19;
then A21: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + (LifeSpan ((P +* I),(s +* (Initialize I)))))))) = goto ((card I) + 4) by A1, A3, Th20;
A22: Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + (LifeSpan ((P +* I),(s +* (Initialize I)))))))) by EXTPRO_1:4
.= Exec ((goto ((card I) + 4)),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + (LifeSpan ((P +* I),(s +* (Initialize I)))))))) by A21 ;
A23: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1))) = (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1))) . (IC )
.= (card I) + 4 by A22, SCMFSA_2:95 ;
A24: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)))) by PBOOLE:158;
(P +* (while=0 (a,I))) . ((card I) + 4) = (P +* (while=0 (a,I))) . ((card I) + 4)
.= (while=0 (a,I)) . ((card I) + 4) by A20, FUNCT_4:14
.= (while=0 (a,I)) . ((card I) + 4)
.= goto 0 by Th21 ;
then A25: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)))) = goto 0 by A23, A24;
A26: Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1) + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)))) by EXTPRO_1:4
.= Exec ((goto 0),(Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1)))) by A25 ;
A27: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1) + 1))) = (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(((1 + (LifeSpan ((P +* I),(s +* (Initialize I))))) + 1) + 1))) . (IC )
.= 0 by A26, SCMFSA_2:95 ;
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),((LifeSpan ((P +* I),(s +* (Initialize I)))) + 3))) = 0 ; :: thesis: for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I))

A28: (((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1) + 1 = (LifeSpan ((P +* I),(s +* (Initialize I)))) + (2 + 1) ;
A29: now
let k be Element of NAT ; :: thesis: ( k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 & k <> 0 implies IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I)) )
assume A30: k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 ; :: thesis: ( k <> 0 implies IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I)) )
assume k <> 0 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
then consider n being Nat such that
A31: k = n + 1 by NAT_1:6;
( k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 1 or k >= ((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1 ) by NAT_1:13;
then A32: ( k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 1 or k = ((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1 or k > ((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1 ) by XXREAL_0:1;
reconsider n = n as Element of NAT by ORDINAL1:def 13;
per cases ( k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 1 or k = ((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1 or k >= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 ) by A28, A32, NAT_1:13;
suppose k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 1 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
then n <= LifeSpan ((P +* I),(s +* (Initialize I))) by A31, XREAL_1:8;
then A33: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),(1 + n))) = (IC (Comput ((P +* I),(s +* (Initialize I)),n))) + 4 by A19;
reconsider m = IC (Comput ((P +* I),(s +* (Initialize I)),n)) as Element of NAT ;
m in dom I by A1, SCMFSA7B:def 7, A2;
then m < card I by AFINSQ_1:70;
then A34: m + 4 < (card I) + 6 by XREAL_1:10;
card (while=0 (a,I)) = (card I) + 6 by Th4;
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) by A31, A33, A34, AFINSQ_1:70; :: thesis: verum
end;
suppose k = ((LifeSpan ((P +* I),(s +* (Initialize I)))) + 1) + 1 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) by A23, Th13; :: thesis: verum
end;
suppose k >= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
then k = (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 by A30, XXREAL_0:1;
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) by A27, Th10; :: thesis: verum
end;
end;
end;
now
let k be Element of NAT ; :: thesis: ( k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 implies IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I)) )
assume A35: k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
per cases ( k = 0 or k <> 0 ) ;
suppose k = 0 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) by A11, A8, EXTPRO_1:3; :: thesis: verum
end;
suppose k <> 0 ; :: thesis: IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),b1)) in dom (while=0 (a,I))
hence IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) by A29, A35; :: thesis: verum
end;
end;
end;
hence for k being Element of NAT st k <= (LifeSpan ((P +* I),(s +* (Initialize I)))) + 3 holds
IC (Comput ((P +* (while=0 (a,I))),(s +* (Initialize (while=0 (a,I)))),k)) in dom (while=0 (a,I)) ; :: thesis: verum