reserve N for with_zero set;
reserve N for with_zero set;
reserve x,y,z,A,B for set,
  f,g,h for Function,
  i,j,k for Nat;
reserve S for IC-Ins-separated non empty
     with_non-empty_values AMI-Struct over N,
  s for State of S;
reserve N for non empty with_zero set,
 S for IC-Ins-separated non empty with_non-empty_values AMI-Struct over N,
  s for State of S;
reserve n for Nat;
reserve N for with_zero non empty set;
reserve N for with_zero non empty set,
  S for IC-Ins-separated non empty AMI-Struct over N;
reserve m,n for Nat;
reserve S for IC-Ins-separated halting
  non empty with_non-empty_values AMI-Struct over N;

theorem
  for F being Instruction-Sequence of S
  for s being State of S, k being Nat st
    F halts_on Comput(F,s,k) & 0 < LifeSpan(F,Comput(F,s,k))
  holds LifeSpan(F,s) = k+LifeSpan(F,Comput(F,s,k))
proof
  let F be Instruction-Sequence of S;
  let s be State of S, k be Nat;
  set s2 = Comput(F,s,k), c = LifeSpan(F,Comput(F,s,k));
  assume that
A1: F halts_on s2 and
A2: 0 < c;
  consider l being Nat such that
A3: c = l+1 by A2,NAT_1:6;
  reconsider l as Nat;
  F.(IC Comput(F,s2,l+1)) = halt S by A1,A3,Th31;
  then
A4: F.(IC Comput(F,s,k+(l+1))) = halt S by Th4;
  F.(IC Comput(F,s2,l)) <> halt S by A1,A3,Th31;
  then F.(IC Comput(F,s,k+l)) <> halt S by Th4;
  hence LifeSpan(F,s) = (k+l)+1 by A4,Th31
    .= k+c by A3;
end;
