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

theorem Th22:
  for s1,s2 being State of SCM+FSA, I being really-closed Program of SCM+FSA,
      a being Int-Location
   st I does not refer a &
     (for b being Int-Location st a <> b holds s1.b = s2.b) &
     (for f being FinSeq-Location holds s1.f = s2.f)
:::&     I is_closed_on s1,P1
holds
  for k being Nat holds
   (for b being Int-Location st a <> b
    holds Comput(P1+*I,(Initialize s1),k).b
     = Comput(P2+*I, (Initialize s2),k).b) &
  (for f being FinSeq-Location holds
   Comput(P1+*I,(Initialize s1),k).f
    = Comput(P2+*I, (Initialize s2),k).f) &
 IC Comput(P1+*I, (Initialize s1),k)
  = IC Comput(P2+*I, (Initialize s2),k) &
  CurInstr(P1+*I,Comput(P1+*I, (Initialize s1),k))
   = CurInstr(P2+*I,Comput(P2+*I, (Initialize s2),k))
proof
  let s1,s2 be State of SCM+FSA;
  let I be really-closed Program of SCM+FSA;
  let a be Int-Location;
  assume
A1: I does not refer a;
  set S2 = Initialize s2,
      Q2 = P2 +* I;
  set S1 = Initialize s1,
      Q1 = P1 +* I;
A2: I c= Q1 by FUNCT_4:25;
A3: I c= Q2 by FUNCT_4:25;
  defpred S[State of SCM+FSA,State of SCM+FSA] means (for b being Int-Location
  st a <> b holds $1.b = $2.b) & for f being FinSeq-Location holds $1.f = $2.f;
  assume that
A4: for b being Int-Location st a <> b holds s1.b = s2.b and
A5: for f being FinSeq-Location holds s1.f = s2.f;
A6:  IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
A7: now
    let f be FinSeq-Location;
A8: not f in dom Start-At(0,SCM+FSA) by SCMFSA_2:103;
    hence S1.f = s1.f by FUNCT_4:11
      .= s2.f by A5
      .= S2.f by A8,FUNCT_4:11;
  end;
  defpred P[Nat] means S[ Comput(Q1,S1,$1), Comput(Q2,S2,$1)] &
  IC Comput(Q1,S1,$1) = IC Comput(Q2,S2,$1) &
    CurInstr(Q1,Comput(Q1,S1,$1)) = CurInstr(Q2,Comput(Q2,S2,$1));
A9: IC Comput(Q1,S1,0) = IC S1
    .= IC Start-At(0,SCM+FSA) by A6,FUNCT_4:13
    .= IC S2 by A6,FUNCT_4:13
    .= IC Comput(Q2,S2,0);
A10: now
    let b be Int-Location;
    assume
A11: a <> b;
A12:  not b in dom Start-At(0,SCM+FSA) by SCMFSA_2:102;
    hence S1.b = s1.b by FUNCT_4:11
      .= s2.b by A4,A11
      .= S2.b by A12,FUNCT_4:11;
  end;
    IC S1 = 0 by MEMSTR_0:def 11;
    then
A13:   IC S1 in dom I by AFINSQ_1:65;
    then
A14: IC Comput(Q1,S1,0) in dom I;
A15: for k being Nat holds P[k] implies P[k + 1]
  proof
    let k be Nat;
A16: Comput(Q1,S1,k+1) = Following(Q1,Comput(Q1,S1,k)) by EXTPRO_1:3
      .= Exec(CurInstr(Q1,Comput(Q1,S1,k)),
      Comput(Q1,S1,k));
A17: IC Comput(Q1,S1,k) in dom I by A2,A13,AMISTD_1:21;
A18: Comput(Q2,S2,k+1) = Following(Q2,Comput(Q2,S2,k)) by EXTPRO_1:3
      .= Exec(CurInstr(Q2,Comput(Q2,S2,k)),
      Comput(Q2,S2,k));
A19:  Q1/.IC Comput(Q1,S1,k)
 = Q1.IC Comput(Q1,S1,k) by PBOOLE:143;
    CurInstr(Q1,Comput(Q1,S1,k))
     = I.IC Comput(Q1,S1,k) by A17,A19,A2,GRFUNC_1:2;
    then CurInstr(Q1,Comput(Q1,S1,k)) in rng I by A17,FUNCT_1:def 3;
    then
A20: CurInstr(Q1,Comput(Q1,S1,k)) does not refer a
 by A1,SCMFSA7B:def 2;
    assume
A21: P[k];
    hence S[ Comput(Q1,S1,k+1), Comput(Q2,S2,k+1)]
by A16,A18,A20,Th21;
    thus
A22: IC Comput(Q1,S1,k+1) = IC Comput(Q2,S2,k+1) by A21,A16,A18,A20,Th21;
A23: IC Comput(Q1,S1,k+1) in dom I by A2,A13,AMISTD_1:21;
A24:  Q1/.IC Comput(Q1,S1,k+1)
 = Q1.IC Comput(Q1,S1,k+1) by PBOOLE:143;
A25:  Q2/.IC Comput(Q2,S2,k+1)
 = Q2.IC Comput(Q2,S2,k+1) by PBOOLE:143;
    thus CurInstr(Q1,Comput(Q1,S1,k+1))
     = I.IC Comput(Q1,S1,k+1) by A23,A24,A2,GRFUNC_1:2
      .= CurInstr(Q2,Comput(Q2,S2,k+1))
       by A22,A23,A25,A3,GRFUNC_1:2;
  end;
  CurInstr(Q1,Comput(Q1,S1,0))
   = Q1.IC Comput(Q1,S1,0) by PBOOLE:143
    .= I.IC Comput(Q1,S1,0) by A14,A2,GRFUNC_1:2
    .= Q2.IC Comput(Q2,S2,0) by A9,A14,A3,GRFUNC_1:2
    .= CurInstr(Q2,Comput(Q2,S2,0)) by PBOOLE:143;
  then
A26: P[0] by A10,A7,A9;
  for k being Nat holds P[k] from NAT_1:sch 2(A26,A15);
  hence thesis;
end;
