reserve m for Nat;
reserve P for Instruction-Sequence of SCM+FSA;

theorem Th12:
  for s being State of SCM+FSA
  for P being Instruction-Sequence of SCM+FSA,
  I being really-closed Program of SCM+FSA st I is_halting_on s,P
  for k being Nat st k <= LifeSpan(P+*I,Initialize s)
   holds  Comput(P+*I, (Initialize s),k)
    =  Comput(P+*Directed I, (Initialize s),k) &
   CurInstr(P+*Directed I,
     Comput(P+*Directed I, (Initialize s),k))
      <> halt SCM+FSA
proof
  let s be State of SCM+FSA;
  let P be Instruction-Sequence of SCM+FSA;
  let I be really-closed Program of SCM+FSA;
  assume that
A1: I is_halting_on s,P;
A2: dom(P+*Directed I) = NAT by PARTFUN1:def 2;
A3: dom(P+*I) = NAT by PARTFUN1:def 2;
  set s2 = Initialize s;
  set s1 = Initialize s;
  defpred P[Nat] means $1 <= LifeSpan(P+*I,s1)
   implies  Comput(P+*I,s1,$1) =  Comput(P+*Directed I,s2,$1) &
  CurInstr(P+*Directed I,Comput(P+*Directed I,s2,$1)) <> halt SCM+FSA;
   IC s1 = 0 by MEMSTR_0:47;
   then
A4: IC s1 in dom I by AFINSQ_1:65;
A5: I c= P+*I by FUNCT_4:25;
A6: now
    let k be Element of NAT;
    dom Directed I = dom I by FUNCT_4:99;
    then
A7: IC Comput(P+*I,s1,k) in dom Directed I by AMISTD_1:21,A4,A5;
A8:  (P+*Directed I)/.IC Comput(P+*Directed I,s2,k)
      = (P+*Directed I).IC Comput(P+*Directed I,s2,k) by A2,PARTFUN1:def 6;
A9: Directed I c= P+*Directed I by FUNCT_4:25;
    assume
      Comput(P+*I,s1,k) =  Comput(P+*Directed I,s2,k);
    then CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k))
      = (P+*Directed I).IC Comput(P+*I,s1,k) by A8
      .= (Directed I).IC Comput(P+*I,s1,k) by A7,A9,GRFUNC_1:2;
    then
     A10: CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k)) in rng Directed I
         by A7,FUNCT_1:def 3;
    assume
    CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k)) = halt SCM+FSA;
    hence contradiction by A10,SCMFSA6A:1;
  end;
  now
A11: P+*I halts_on s1 by A1,SCMFSA7B:def 7;
A12: dom I c= dom Directed I by FUNCT_4:99;
    let k be Nat;
    assume
A13: k <= LifeSpan(P+*I,s1) implies
        Comput(P+*I,s1,k) =  Comput(P+*Directed I,s2,k);
A14: Comput(P+*Directed I,s2,k+1) = Following(P+*Directed I,
Comput(P+*Directed I,s2,k)) by EXTPRO_1:3
      .= Exec(CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k)),
      Comput(P+*Directed I,s2,k));
A15: IC Comput(P+*I,s1,k) in dom I by AMISTD_1:21,A4,A5;
A16: I c=P+*I by FUNCT_4:25;
A17: CurInstr(P+*I,Comput(P+*I,s1,k))
      = (P+*I).IC Comput(P+*I,s1,k) by A3,PARTFUN1:def 6
     .= I.IC Comput(P+*I,s1,k) by A15,A16,GRFUNC_1:2;
A18: k + 0 < k + 1 by XREAL_1:6;
A19:  (P+*Directed I)/.IC Comput(P+*Directed I,s2,k)
    = (P+*Directed I).IC Comput(P+*Directed I,s2,k) by A2,PARTFUN1:def 6;
A20: Directed I c= P+*Directed I by FUNCT_4:25;
    assume
A21: k + 1 <= LifeSpan(P+*I,s1);
    then k < LifeSpan(P+*I,s1) by A18,XXREAL_0:2;
    then I.IC Comput(P+*I,s1,k) <> halt SCM+FSA by A17,A11,EXTPRO_1:def 15;
    then
A22: CurInstr(P+*I,Comput(P+*I,s1,k))
 = (Directed I).IC Comput(P+*I,s1,k) by A17,FUNCT_4:105
      .= (P+*Directed I).IC Comput(P+*I,s1,k) by A15,A12,A20,GRFUNC_1:2
      .= CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k))
      by A13,A21,A18,A19,XXREAL_0:2;
 Comput(P+*I,s1,k+1) = Following(P+*I,Comput(P+*I,s1,k)) by EXTPRO_1:3
      .= Exec(CurInstr(P+*I,Comput(P+*I,s1,k)),
      Comput(P+*I,s1,k));
    hence  Comput(P+*I,s1,k+1) =  Comput(P+*Directed I,s2,k+1)
      by A13,A21,A18,A22,A14,XXREAL_0:2;
    hence CurInstr(P+*Directed I,Comput(P+*Directed I,s2,k+1)) <>
     halt SCM+FSA
      by A6;
  end;
  then
A23: for k being Nat st P[k] holds P[k + 1];
  now
    assume 0 <= LifeSpan(P+*I,s1);
    thus  Comput(P+*I,s1,0) =  Comput(P+*Directed I,s2,0);
    hence CurInstr(P+*Directed I,Comput(P+*Directed I,s2,0)) <>
     halt SCM+FSA by A6;
  end;
  then
A24: P[0];
  thus for k being Nat holds P[k] from NAT_1:sch 2(A24,A23);
end;
