reserve p,p1,p2,h for Instruction-Sequence of SCM+FSA;
reserve k, l, n for Nat,
  j for Integer,
  i,i1 for Instruction of SCM+FSA;
reserve s, s1, s2 for State of SCM+FSA,
  a for read-write Int-Location,
  b for Int-Location,
  I, J for MacroInstruction of SCM+FSA,
  Ig for good MacroInstruction of SCM+FSA,
  i, j, k, m, n for Nat;

theorem
  for I being really-closed MacroInstruction of SCM+FSA holds
  ProperBodyWhile=0 a,I,s1,p1 & DataPart s1 = DataPart s2 implies for k
  holds DataPart StepWhile=0(a,I,p1,s1).k = DataPart StepWhile=0(a,I,p2,s2).k
proof let I be really-closed MacroInstruction of SCM+FSA;
  assume that
A1: ProperBodyWhile=0 a,I,s1,p1 and
A2: DataPart s1 = DataPart s2;
  set WH = while=0(a,I);
  set ST2 = StepWhile=0(a,I,p2,s2),
      PT2 = p2 +* while=0(a,I);
  set ST1 = StepWhile=0(a,I,p1,s1),
      PT1 = p1 +* while=0(a,I);
  defpred X[Nat] means DataPart ST1.$1 = DataPart ST2.$1;
A3: for k being Nat st X[k] holds X[k+1]
  proof
    let k;
    set ST1kI = Initialize(ST1.k),
        PT1I = PT1 +* I;
    set ST2kI = Initialize(ST2.k),
        PT2I = PT2 +* I;
A4: I c= PT1I by FUNCT_4:25;
A5: I c= PT2I by FUNCT_4:25;
    assume
A6: DataPart ST1.k = DataPart ST2.k;
    then
A7: ST1.k.a = ST2.k.a by SCMFSA_M:2;
    per cases;
    suppose
A8:   ST1.k.a <> 0;
      hence DataPart ST1.(k+1) = DataPart ST1.k by Th18
        .= DataPart ST2.(k+1) by A6,A7,A8,Th18;
    end;
    suppose
A9:   ST1.k.a = 0;
A10:   I is_halting_on ST1.k, PT1 by A1,A9;
      then
A11: I is_halting_on ST2.k, PT2  by A6,SCMFSA8B:5;
A12:  DataPart ST1.(k+1) = DataPart Comput(PT1 +* while=0(a,I),
(Initialize(ST1.k)), (
      LifeSpan(PT1I,ST1kI) + 2)) by SCMFSA_9:def 4
        .= DataPart Comput(PT1I,(ST1kI),LifeSpan(PT1I,ST1kI)) by A9,A10
,Th17;
A13:  DataPart ST2.(k+1) = DataPart Comput(PT2 +* while=0(a,I),
(Initialize(ST2.k)), (
      LifeSpan(PT2I,ST2kI) + 2)) by SCMFSA_9:def 4
        .= DataPart Comput(PT2I,(ST2kI),
          LifeSpan(PT2I,ST2kI)) by A7,A9,A11,Th17;
A14:  DataPart ST1.k = DataPart ST1kI by MEMSTR_0:79;
A15:  DataPart ST1kI = DataPart ST1.k by MEMSTR_0:79
        .= DataPart ST2kI by A6,MEMSTR_0:79;
      I is_halting_on ST1kI, PT1I by A10,A14,SCMFSA8B:5;
      then (LifeSpan(PT1I,ST1kI)) = (LifeSpan(PT2I,ST2kI))
          by A15,A4,A5,SCMFSA8C:18;
      hence thesis by A12,A13,A15,A4,A5,SCMFSA8C:17;
    end;
  end;
  DataPart ST1.0 = DataPart s1 by SCMFSA_9:def 4
    .= DataPart ST2.0 by A2,SCMFSA_9:def 4;
  then
A16: X[0];
  thus for k holds X[k] from NAT_1:sch 2(A16, A3);
end;
