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

theorem Th9:
  for s being State of SCM+FSA,
:::      I being Program of SCM+FSA,
      I,J being really-closed MacroInstruction of SCM+FSA,
      a being read-write Int-Location st s.a <> 0 &
:::J is_closed_on s,P &
    J 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;
  reconsider JI2 = J ";" Goto  (card I + 1) ";" I ";" Stop SCM+FSA
     as really-closed Program of SCM+FSA by Lm3;
  set s2 = Initialize s,
      P2 = P +* JI2;
A1: JI2 c= P2 by FUNCT_4:25;
  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);
  IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
  then
A2: IC s3 = IC Start-At(0,SCM+FSA) by FUNCT_4:13
    .=  0 by FUNCOP_1:72;
A3: if=0(a,I,J) c= P3 by FUNCT_4:25;
 if=0(a,I,J) = i ";" J ";" Goto  (card I + 1) ";" I1 by SCMFSA6A:25
    .= i ";" J ";" (Goto  (card I + 1) ";" I1) by SCMFSA6A:25
    .= i ";" (J ";" (Goto  (card I + 1) ";" I1)) by SCMFSA6A:29
    .= i ";" (J ";" Goto  (card I + 1) ";" I1) by SCMFSA6A:25
    .= Macro i ";" JI2 by SCMFSA6A:25;
  then Reloc(JI2,card Macro i) c= if=0(a,I,J) by SCMFSA6A:38;
  then
A4: Reloc(JI2,2) c= if=0(a,I,J) by COMPOS_1:56;
A5: Reloc(JI2,2) c= P3 by A4,A3,XBOOLE_1:1;
A6: not a in dom Start-At(0,SCM+FSA) by SCMFSA_2:102;
A7:  0 in dom if=0(a,I,J) by AFINSQ_1:65;
A8: if=0(a,I,J) c= P3 by FUNCT_4:25;
A9: P3. 0 = if=0(a,I,J). 0 by A7,FUNCT_4:13
    .= i by Lm2;
A10:  1 in dom if=0(a,I,J) by Lm1;
A11: Comput(P3, s3,0 + 1) = Following(P3,
Comput(P3,s3,0)) by EXTPRO_1:3
    .= Following(P3,s3)
    .= Exec(i,s3) by A2,A9,PBOOLE:143;
  assume s.a <> 0;
  then s3.a <> 0 by A6,FUNCT_4:11;
  then
A12: IC Comput(P3,s3,1) = 0+1 by A2,A11,SCMFSA_2:70;
A13: P3. 1 = if=0(a,I,J). 1 by A10,A8,GRFUNC_1:2
    .= goto  2 by Lm2;
A14: Comput(P3, s3,1 + 1) = Following(P3,s4) by EXTPRO_1:3
    .= Exec(goto  2,s4) by A12,A13,PBOOLE:143;
A15: now
    let f be FinSeq-Location;
    thus s2.f = Comput(P3,s3,1).f by A11,SCMFSA_2:70
      .= s5.f by A14,SCMFSA_2:69;
  end;
  now
    let a be Int-Location;
    thus s2.a = Comput(P3,s3,1).a by A11,SCMFSA_2:70
      .= s5.a by A14,SCMFSA_2:69;
  end;
  then
A16: DataPart s2 = DataPart s5 by A15,SCMFSA_M:2;
  assume
A17: J is_halting_on s,P;
A18: P2 halts_on s2 by A17,SCMFSA8A:38;
A19: IC s5 =  2 by A14,SCMFSA_2:69;
  CurInstr(P3,
  Comput(P3,s3,LifeSpan(P2,s2)+2))
   = CurInstr(P3,Comput(P3,s5,LifeSpan(P2,s2))) by EXTPRO_1:4
    .= IncAddr(CurInstr(P2,
    Comput(P2,s2,LifeSpan(P2,s2))),2) by A19,A16,Th2,A5,A1
    .= IncAddr(halt SCM+FSA,2) by A18,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;
