reserve m for Nat;
reserve P,PP,P1,P2 for Instruction-Sequence of SCM+FSA;

theorem
  for s being State of SCM+FSA, I,J being MacroInstruction of SCM+FSA, a
  being read-write Int-Location st s.intloc 0 = 1 & s.a <= 0 & Directed J
  is_pseudo-closed_on s,P holds
   DataPart IExec(if>0(a,I,J),P,s) = DataPart IExec(J
  ";" Stop SCM+FSA,P,s)
proof
  let ss be State of SCM+FSA;
  set D = Data-Locations SCM+FSA;
  let I,J be MacroInstruction of SCM+FSA;
  let a be read-write Int-Location;
  set J0 = Directed J;
  set s = Initialized ss;
  set s0 = Initialized s;
  set J9 = J ";" (Goto  (card I + 1) ";" (I ";" Stop SCM+FSA));
  set s00 = Initialize s,
      P00 = P+*J0;
  set s3 = Initialize s,
      P3 = P +* if>0(a,I,J);
  set s4 = Comput(P3, s3,1);
  set s5 = Comput(P3, s3,2);
  set i = a >0_goto  (card J + 3);
A1: if>0(a,I,J) c= P3 by FUNCT_4:25;
A2: J0 c= P00 by FUNCT_4:25;
  assume
A3: ss.intloc 0 = 1;
  set s1 = Initialize s,
     P1 = P +* (J ";" Stop SCM+FSA);
  assume ss.a <= 0;
  then
A4: s0.a <= 0 by SCMFSA_M:37;
A5:  0 in dom if>0(a,I,J) by AFINSQ_1:65;
A6: P3. 0 = (if>0(a,I,J)). 0
by A5,FUNCT_4:13
    .= i by Th18;
  s +*Initialize((intloc 0).-->1) = Initialize Initialized s
  by MEMSTR_0:44;
  then
A7: s +*Initialize((intloc 0).-->1) = s3;
A8: J0 ";" Stop SCM+FSA = J ";" Stop SCM+FSA;
A9: IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
A10: IC s3 = IC(Initialize s)
      .= IC Start-At(0,SCM+FSA) by A9,FUNCT_4:13
      .=  0 by FUNCOP_1:72;
  if>0(a,I,J) = Macro i ";" J ";" Goto  (card I + 1) ";" (I ";"
  Stop SCM+FSA) by SCMFSA6A:25;
  then if>0(a,I,J) = Macro i ";" J ";" (Goto  (card I + 1) ";" (I ";"
  Stop SCM+FSA)) by SCMFSA6A:25;
  then
A11: if>0(a,I,J) = Macro i ";" (J ";" (Goto  (card I + 1) ";" (I ";"
  Stop SCM+FSA))) by SCMFSA6A:25;
  card Macro i = 2 by COMPOS_1:56;
  then
A12: Reloc(J9,2) c= if>0(a,I,J) by A11,SCMFSA6A:38;
A13: Reloc(J0,2) c= Reloc(J9,2) by COMPOS_1:44,SCMFSA6A:16;
   Reloc(J0,2) c= if>0(a,I,J) by A12,A13,XBOOLE_1:1;
   then
A14: Reloc(J0,2) c= P3 by A1,XBOOLE_1:1;
A15: Comput(P3, s3,0+1) = Following(P3,Comput(P3,s3,0)) by EXTPRO_1:3
    .= Following(P3,s3)
    .= Exec(i,s3) by A10,A6,PBOOLE:143;
  assume J0 is_pseudo-closed_on ss,P;
  then
A16: J0 is_pseudo-closed_on s,P by A3,Th16;
  then J ";" Stop SCM+FSA is_halting_on s,P by Th21;
  then
A17: P1 halts_on s1;
A18: J0 is_pseudo-closed_on s00,P00 by A16;
  s +* Initialize((intloc 0).-->1)
   = Initialize Initialized s
           by MEMSTR_0:44;
  then
A19: s +* Initialize((intloc 0).-->1) = s1;
  card if>0(a,I,J) = card I + card J + (2 + 2) by SCMFSA8B:12
    .= card J + 2 + (card I + 2);
  then card J + 2 + 0 < card if>0(a,I,J) by XREAL_1:8;
  then
A20:  (card J + 2) in dom if>0(a,I,J) by AFINSQ_1:66;
  card if>0(a,I,J) = card I + card J + (3 + 1) by SCMFSA8B:12
    .= card I + card J + 3 + 1;
  then card I + card J + 3 < card if>0(a,I,J) by NAT_1:13;
  then
A21:  (card I + card J + 3) in dom if>0(a,I,J) by AFINSQ_1:66;
  set s9 = Comput(P3, s3,pseudo-LifeSpan(s00,P00,
J0) + 2);
  LifeSpan(P1,s1) = pseudo-LifeSpan(s,P,J0) by A16,Th21;
  then
A22: DataPart Comput(P00, s00,pseudo-LifeSpan(s,P
,J0)) = DataPart
Comput(P1, s1,LifeSpan(P1,s1)) by A16,A8,Th21;
A23:  1 in dom if>0(a,I,J) by Th17;
A24:  a <> IC SCM+FSA by SCMFSA_2:56;
    not a in dom Start-At(0,SCM+FSA) by A24,TARSKI:def 1;
   then
 not a in dom Start-At(0,SCM+FSA);
  then  s3.a = s0.a by FUNCT_4:11;
  then
A25: IC s4 = IC s3 + 1 by A4,A15,SCMFSA_2:71
    .=  (0 + 1) by A10;
A26: P3. 1
    = (if>0(a,I,J)). 1
    by A23,FUNCT_4:13
    .= goto  2 by Th18;
A27: Comput(P3, s3,1+1) = Following(P3,s4) by EXTPRO_1:3
    .= Exec(goto  2,s4) by A25,A26,PBOOLE:143;
  then
A28: IC s5 =  2 by SCMFSA_2:69;
A29: now
    let f be FinSeq-Location;
    thus s00.f = s4.f by A15,SCMFSA_2:71
      .= s5.f by A27,SCMFSA_2:69;
  end;
  now
    let a be Int-Location;
    thus s00.a = s4.a by A15,SCMFSA_2:71
      .= s5.a by A27,SCMFSA_2:69;
  end;
  then
A30: DataPart s00 = DataPart s5 by A29,SCMFSA_M:2;
A31: IC s9 = IC Comput(P3, s5,pseudo-LifeSpan(
s00,P00,J0)) by EXTPRO_1:4
    .= IC Comput(P00, s00,pseudo-LifeSpan(s00,P00
,J0)) + 2 by A18,A28,A30,Th14,A2,A14
    .= IC Comput(P00, s00,pseudo-LifeSpan(s,P,J0)
) + 2 by A16,Th13
    .=  card J0 + 2 by A16,SCMFSA8A:def 4
    .=  (card J + 2) by SCMFSA6A:36;
  then
A32: CurInstr(P3,s9) = P3. (card J + 2) by PBOOLE:143
    .= if>0(a,I,J). (card J + 2) by A20,A1,GRFUNC_1:2
    .= goto  (card I + card J + 3) by Th27;
  IC Comput(P3, s3,pseudo-LifeSpan(s00,P00,J0) + 2 + 1)
     = IC Following(P3,s9) by EXTPRO_1:3
    .= card I + card J + 3 by A32,SCMFSA_2:69;
  then
A33: CurInstr(P3,
  Comput(P3, s3,pseudo-LifeSpan(s00,P00,J0) + 2 + 1))
     = P3. (card I + card J + 3) by PBOOLE:143
    .= if>0(a,I,J). (card I + card J + 3) by A21,A1,GRFUNC_1:2
    .= halt SCM+FSA by Th25;
  then
A34: P3 halts_on s3 by EXTPRO_1:29;
A35: CurInstr(P3,s3) = i by A10,A6,PBOOLE:143;
  now
A36: 0 + 2 < card I + card J + 3 by XREAL_1:8;
    then
A37:  2 in dom if>0(a,I,J) by Th20;
A38: CurInstr(P3,Comput(P3,s3,2)) = P3. 2 by A28,PBOOLE:143
      .= if>0(a,I,J). 2 by A37,A1,GRFUNC_1:2;
    let k be Nat;
    assume
A39: CurInstr(P3,Comput(P3,s3,k)) = halt SCM+FSA;
A40: k <> 0 by A39,A35;
A41:    k <> 1 by A25,A26,A39,PBOOLE:143;
    2 <> k by A39,A36,Th20,A38;
    then k <> 0 & ... & k <> 2 by A40,A41;
    then 2 < k;
    then consider k2 being Nat such that
A42: 2 + k2 = k by NAT_1:10;
    reconsider k2 as Element of NAT by ORDINAL1:def 12;
    reconsider n = IC Comput(P00, s00,k2) as Element of NAT;
    assume not pseudo-LifeSpan(s00,P00,J0) + (1 + 2) <= k;
    then k < pseudo-LifeSpan(s00,P00,J0) + 1 + 2;
    then k2 < pseudo-LifeSpan(s00,P00,J0) + 1 by A42,XREAL_1:6;
    then
A43: k2 <= pseudo-LifeSpan(s00,P00,J0) by NAT_1:13;
    then
A44: k2 <= pseudo-LifeSpan(s,P,J0) by A16,Th13;
A45: now
      per cases by A44,XXREAL_0:1;
      suppose
A46:    k2 = pseudo-LifeSpan(s,P,J0);
        card I + card J + (2 + 1) = card J + 2 + 1 + card I;
        then
A47:    card J + 2 + 1 <= card I + card J + 3 by NAT_1:11;
        IC Comput(P00, s00,k2) =  card J0 by A16,A46,SCMFSA8A:def 4;
        then n = card J by SCMFSA6A:36;
        hence n + 2 < card I + card J + 3 by A47,NAT_1:13;
      end;
      suppose
        k2 < pseudo-LifeSpan(s,P,J0);
        then  n in dom J0 by A16,SCMFSA8A:17;
        then n < card J0 by AFINSQ_1:66;
        then n + 2 < card J0 + 2 by XREAL_1:6;
        then
A48:    n + 2 < card J + 2 by SCMFSA6A:36;
        card I + card J + (1 + 2) = card J + 2 + (card I + 1);
        then card J + 2 <= card I + card J + 3 by NAT_1:11;
        hence n + 2 < card I + card J + 3 by A48,XXREAL_0:2;
      end;
    end;
    then
A49:  (n + 2) in dom if>0(a,I,J) by Th20;
A50: IC Comput(P3, s3,k) = IC Comput(P3, s5,k2) by A42,EXTPRO_1:4
      .=  (n + 2) by A18,A28,A30,A43,Th14,A2,A14;
    CurInstr(P3,Comput(P3,s3,k))
     = P3.IC Comput(P3, s3,k) by PBOOLE:143
      .= if>0(a,I,J).IC Comput(P3, s3,k) by A50,A49,A1,GRFUNC_1:2;
    hence contradiction by A39,A50,A45,Th20;
  end;
  then
A51: LifeSpan(P3,s3) = pseudo-LifeSpan(s00,P00,J0)
+ 2 + 1 by A33,A34,EXTPRO_1:def 15;
  CurInstr(P3,s9) = P3. (card J + 2) by A31,PBOOLE:143
    .= if>0(a,I,J). (card J + 2) by A20,A1,GRFUNC_1:2
    .= goto  (card I + card J + 3) by Th27;
  then InsCode CurInstr(P3,s9) = 6 by SCMFSA_2:23;
  then InsCode CurInstr(P3,s9) in {0,6,7,8} by ENUMSET1:def 2;
  then
A52: DataPart s9 = DataPart Following(P3,s9) by Th6;
A53: DataPart s9 = DataPart Comput(P3, s5,pseudo-LifeSpan(
s00,P00,J0)
) by EXTPRO_1:4
    .= DataPart Comput(P00, s00,pseudo-LifeSpan(
s00,P00,J0)) by A18,A28,A30,Th14,A2,A14;
  thus DataPart IExec(if>0(a,I,J),P,ss)
   = DataPart IExec(if>0(a,I,J),P,s)
    .= DataPart(Result(P3,s3)) by A7
    .= DataPart Comput(P3, s3,LifeSpan(P3,s3)) by A34,EXTPRO_1:23
    .= DataPart Following(P3,s9) by A51,EXTPRO_1:3
    .= DataPart Comput(P00, s00,pseudo-LifeSpan(s,P,J0)) by A16,A53,A52,Th13
    .= DataPart Result(P1,s1) by A17,A22,EXTPRO_1:23
    .= DataPart IExec(J ";" Stop SCM+FSA,P,s) by A19
    .= DataPart IExec(J ";" Stop SCM+FSA,P,ss);
end;
