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

theorem Th13:
  for s being State of SCM+FSA,
      I,J being really-closed MacroInstruction of SCM+FSA,
      a being read-write Int-Location st s.a > 0 &
:::     I is_closed_on s,P&
I is_halting_on s,P
  holds
:::if>0(a,I,J) is_closed_on s,P &
    if>0(a,I,J) is_halting_on s,P
proof
  let s be State of SCM+FSA;
  let I,J be really-closed MacroInstruction of SCM+FSA;
  let a be read-write Int-Location;
  set I1 = I ";" Stop SCM+FSA;
  set s1 = Initialize s,
      P1 = P +* I1;
  set s3 = Initialize s,
      P3 = P +* if>0(a,I,J);
  set s4 = Comput(P3, s3,1);
  set i = a >0_goto  (card J + 3);
A1: I1 c= P1 by FUNCT_4:25;
A2: not a in dom Start-At(0,SCM+FSA) by SCMFSA_2:102;
A3:  0 in dom if>0(a,I,J) by AFINSQ_1:65;
A4: P3. 0 = if>0(a,I,J). 0 by A3,FUNCT_4:13
    .= i by Lm2;
  IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
  then
A5: IC s3 = IC Start-At(0,SCM+FSA) by FUNCT_4:13
    .=  0 by FUNCOP_1:72;
A6: if>0(a,I,J) c= P3 by FUNCT_4:25;
A7: if>0(a,I,J) = i ";" J ";" Goto  (card I + 1) ";" I1 by SCMFSA6A:25;
  card (i ";" J ";" Goto  (card I + 1))
     = card (Macro i ";" J) + card Goto  (card I + 1) by SCMFSA6A:21
    .= card (Macro i ";" J) + 1 by SCMFSA8A:15
    .= card Macro i + card J + 1 by SCMFSA6A:21
    .= card J + 2 + 1 by COMPOS_1:56
    .= card J + (2 + 1);
  then
A8: Reloc(I1,card J + 3) c= if>0(a,I,J) by A7,SCMFSA6A:38;
A9: Reloc(I1,card J + 3) c= P3 by A8,A6,XBOOLE_1:1;
A10: Comput(P3, s3,0 + 1) = Following(P3,Comput(P3,s3,0)) by EXTPRO_1:3
    .= Following(P3,s3)
    .= Exec(i,s3) by A5,A4,PBOOLE:143;
A11: for f being FinSeq-Location holds s1.f = s4.f by A10,SCMFSA_2:71;
  for a being Int-Location holds s1.a = s4.a by A10,SCMFSA_2:71;
  then
A12: DataPart s1 = DataPart s4 by A11,SCMFSA_M:2;
  assume s.a > 0;
  then s3.a > 0 by A2,FUNCT_4:11;
  then
A13: IC Comput(P3,s3,1) =  (card J + 3) by A10,SCMFSA_2:71;
  assume
A14: I is_halting_on s,P;
  I1 is_halting_on s,P by A14,SCMFSA8A:30;
  then
A15: P1 halts_on s1 by SCMFSA7B:def 7;
  CurInstr(P3,
  Comput(P3,s3,LifeSpan(P1,s1)+1))
   = CurInstr(P3,
   Comput(P3,s4,LifeSpan(P1,s1))) by EXTPRO_1:4
    .= IncAddr(CurInstr(P1,
    Comput(P1,s1,LifeSpan(P1,s1))),(card J + 3)) by A13,A12,Th2,A9,A1
    .= IncAddr(halt SCM+FSA,(card J + 3)) by A15,EXTPRO_1:def 15
    .= halt SCM+FSA by COMPOS_0:4;
  then P3 halts_on s3 by EXTPRO_1:29;
  hence thesis by SCMFSA7B:def 7;
end;
