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

theorem Th25:
  for s1,s2 being State of SCM+FSA,
      I being really-closed Program of SCM+FSA, a
  being Int-Location holds (for d being read-write Int-Location st a <> d holds
  s1.d = s2.d) & (for f being FinSeq-Location holds s1.f = s2.f) & I
does not refer a &
:::I is_closed_on Initialized s1,P1 &
    I is_halting_on Initialized s1,P1
implies (for d being Int-Location st a <> d
 holds IExec(I,P1,s1).d = IExec(I,P2,s2).d) &
   (for f being FinSeq-Location holds IExec(I,P1,s1).f = IExec(I,P2,s2).f) & IC
  IExec(I,P1,s1) = IC IExec(I,P2,s2)
proof
  let s1,s2 be State of SCM+FSA;
  let I be really-closed Program of SCM+FSA;
  let a be Int-Location;
  assume that
A1: for d being read-write Int-Location st a <> d holds s1.d = s2.d and
A2: for f being FinSeq-Location holds s1.f = s2.f;
A3: now
    let d be Int-Location;
    assume
A4: a <> d;
    per cases;
    suppose
A5:   d = intloc 0;
      hence (Initialized s1).d = 1 by SCMFSA_M:9
        .= (Initialized s2).d by A5,SCMFSA_M:9;
    end;
    suppose
      d <> intloc 0;
      then
A6:   d is read-write;
      hence (Initialized s1).d = s1.d by SCMFSA_M:37
        .= s2.d by A1,A4,A6
        .= (Initialized s2).d by A6,SCMFSA_M:37;
    end;
  end;
  set S1 = Initialized s1, Q1 = P1 +* I;
  set S2 = Initialized s2, Q2 = P2 +* I;
  assume
A7: I does not refer a;
A8: S2 = Initialize Initialized s2 by MEMSTR_0:44;
  assume that
A9: I is_halting_on Initialized s1,P1;
A10: now
    let f be FinSeq-Location;
    thus (Initialized s1).f = s1.f by SCMFSA_M:37
      .= s2.f by A2
      .= (Initialized s2).f by SCMFSA_M:37;
  end;
  then I is_halting_on Initialized s2,P2 by A7,A9,A3,Th24;
  then
A11: Q2 halts_on S2 by A8,SCMFSA7B:def 7;
A12: S1 = Initialize Initialized s1 by MEMSTR_0:44;
  then
A13: Q1 halts_on S1 by A9,SCMFSA7B:def 7;
  now
    let l be Nat;
    assume l < LifeSpan(Q1,S1);
    then CurInstr(Q1,Comput(Q1,S1,l))
     <> halt SCM+FSA by A13,EXTPRO_1:def 15;
    hence CurInstr(Q2,Comput(Q2,S2,l)) <>
     halt SCM+FSA by A7,A3,A10,A12,A8,Th22;
  end;
  then
A14: for l be Nat st CurInstr(Q2,Comput(Q2,S2,l)) = halt SCM+FSA
    holds LifeSpan(Q1,S1) <= l;
  CurInstr (Q2,Comput(Q2,S2,LifeSpan(Q1,S1)))
   = CurInstr(Q1,Comput(Q1,S1,LifeSpan(Q1,S1))) by A7,A3,A10,A12,A8,Th22
    .= halt SCM+FSA by A13,EXTPRO_1:def 15;
  then
A15: LifeSpan(Q1,S1) = LifeSpan(Q2,S2) by A11,A14,EXTPRO_1:def 15;
  then
A16: Result(Q2,S2) = Comput(Q2,S2,LifeSpan(Q1,S1)) by A11,EXTPRO_1:23;
A17: Result(Q1,S1) = Comput(Q1,S1,LifeSpan(Q1,S1)) by A13,EXTPRO_1:23;
A18:  Result(P1+*I,Initialized s1) =  IExec(I,P1,s1) by Th20;
A19:  Result(P2+*I,Initialized s2) =  IExec(I,P2,s2) by Th20;
  thus for d being Int-Location st a <> d
     holds IExec(I,P1,s1).d = IExec(I,P2,s2).d
      by A19,A18,A7,A3,A10,A12,A8,A16,A17,Th22;
  thus for f being FinSeq-Location holds IExec(I,P1,s1).f= IExec(I,P2,s2).f
           by A19,A18,A7,A3,A10,A12,A8,A16,A17,Th22;
  thus IC IExec(I,P1,s1) = IC Result(Q1,S1) by SCMFSA6B:def 1
    .= IC Comput(Q1,S1,LifeSpan(Q1,S1)) by A13,EXTPRO_1:23
    .= IC Comput(Q2,S2,LifeSpan(Q2,S2)) by A7,A3,A10,A12,A8,A15,Th22
    .= IC Result(Q2,S2) by A11,EXTPRO_1:23
    .= IC IExec(I,P2,s2) by SCMFSA6B:def 1;
end;
