reserve x for set,
  i for Instruction of SCM+FSA,
  a,b for Int-Location,
  f for FinSeq-Location,
  l, l1 for Nat,
  s,s1,s2 for State of SCM+FSA,
  P,P1,P2 for Instruction-Sequence of SCM+FSA;

theorem Th4:
  for i being sequential Instruction of SCM+FSA
   holds  Exec(i,Initialized s) =  IExec(Macro i,P,s)
proof
  let i be sequential Instruction of SCM+FSA;
  set Mi = Macro i;
  set sI = s+*Initialize((intloc 0).-->1),
      pI = P+*Mi;
A1:  Mi c= pI by FUNCT_4:25;
  set Is = Initialized s;
  set IC1 = IC Comput(P+*Mi,sI,1);
  reconsider Mi as parahalting Program of SCM+FSA;
  IC sI = 0 by MEMSTR_0:def 11;
  then IC sI in dom Mi by AFINSQ_1:65;
  then
A2: IC1 in dom Mi by A1,AMISTD_1:21;
A3:  1 in dom Mi by COMPOS_1:60;
A4:  0 in dom Mi by COMPOS_1:60;
A5: Mi. 0 = i by COMPOS_1:58;
A6:  IC sI = 0 by MEMSTR_0:def 11;
A7: Comput(P+*Mi,sI,0+1) = Following(P+*Mi,Comput(P+*Mi,sI,0)) by EXTPRO_1:3
    .= Exec(pI. 0, sI) by A6,PBOOLE:143
    .= Exec(i, sI) by A5,A1,A4,GRFUNC_1:2;
  per cases by A2,COMPOS_1:60;
  suppose
A8: IC1 =  0;
    then
A9: CurInstr(P+*Mi,Comput(P+*Mi,sI,1)) = (P+*Mi). 0 by PBOOLE:143
      .= i by A5,A4,FUNCT_4:13;
    IC sI =  0 by A6;
    then
A10: InsCode i in {0, 6, 7, 8} by A7,A8,SCMFSA6A:3;
    hereby
      per cases by A10,ENUMSET1:def 2;
      suppose
        InsCode i = 0;
        then
A11:    i = halt SCM+FSA by SCMFSA_2:95;
        then P+*Mi halts_on sI by A9,EXTPRO_1:29;
        hence thesis by A7,A9,A11,EXTPRO_1:def 9;
      end;
      suppose
A12:    InsCode i = 6 or InsCode i = 7 or InsCode i = 8;
A13:    now
          let a;
          per cases by A12;
          suppose
            InsCode i = 6;
            then ex l st i = goto l by SCMFSA_2:35;
            hence sI.a = Exec(i, sI).a;
          end;
          suppose
            InsCode i = 7;
            then ex l, b st i = b=0_goto l by SCMFSA_2:36;
            hence sI.a = Exec(i, sI).a;
          end;
          suppose
            InsCode i = 8;
            then ex l, b st i = b>0_goto l by SCMFSA_2:37;
            hence sI.a = Exec(i, sI).a;
          end;
        end;
A14:    now
          let f;
          per cases by A12;
          suppose
            InsCode i = 6;
            then ex l st i = goto l by SCMFSA_2:35;
            hence sI.f = Exec(i, sI).f;
          end;
          suppose
            InsCode i = 7;
            then ex l, a st i = a=0_goto l by SCMFSA_2:36;
            hence sI.f = Exec(i, sI).f;
          end;
          suppose
            InsCode i = 8;
            then ex l, a st i = a>0_goto l by SCMFSA_2:37;
            hence sI.f = Exec(i, sI).f;
          end;
        end;
A15:    Following(P+*Mi,sI)
           = Following(P+*Mi,Comput(P+*Mi,sI,0))
          .= Exec(i, sI) by A7,EXTPRO_1:3;
A16:      InsCode halt SCM+FSA = 0 by COMPOS_1:70;
        for n being Nat holds
         CurInstr(P+*Mi,Comput(P+*Mi,sI,n)) <> halt SCM+FSA
          by A9,A12,A13,A14,A7,A8,A6,A15,A16,AMISTD_2:11,SCMFSA_2:104;
        then
A17:      not P+*Mi halts_on sI;
         Mi c= P+*Mi by FUNCT_4:25;
        hence Exec(i,Initialized s) = IExec(Macro i,P,s)
          by A17,AMISTD_1:def 11;
      end;
    end;
  end;
  suppose
A18:    IC1 = 1;
A19: Mi.1 = halt SCM+FSA by COMPOS_1:59;
A20: CurInstr(P+*Mi,Comput(P+*Mi,sI,1))
       = (P+*Mi). 1 by A18,PBOOLE:143
      .= halt SCM+FSA by A19,A1,A3,GRFUNC_1:2;
    then P+*Mi halts_on sI by EXTPRO_1:29;
    hence thesis by A7,A20,EXTPRO_1:def 9;
  end;
end;
