reserve a, b, c, a1, a2, b1, b2 for Int-Location,
  l, l1, l2 for Nat,
  f, g, f1, f2 for FinSeq-Location,
  i, j for Instruction of SCM+FSA,
  X, Y for set;
reserve p, r for preProgram of SCM+FSA,
  I, J for Program of SCM+FSA,
  k, m, n for Nat;
reserve L for finite Subset of Int-Locations;
reserve L for finite Subset of FinSeq-Locations;
reserve s, t for State of SCM+FSA;
reserve P for Instruction-Sequence of SCM+FSA;

theorem
 for P,Q being Instruction-Sequence of SCM+FSA
  st I c= P & I c= Q &
   Start-At(0,SCM+FSA) c= s & Start-At(0,SCM+FSA) c= t &
   s | UsedILoc I = t | UsedILoc I &
   s | UsedI*Loc I = t | UsedI*Loc I &
   (for m st m < n holds IC Comput(P,s,m) in dom I)
  holds
   (for m st m < n holds IC Comput(Q,t,m) in dom I) &
   for m st m <= n holds IC Comput(P,s,m) = IC Comput(Q,t,m) &
    (for a st a in UsedILoc I holds Comput(P,s,m).a = Comput(Q,t,m).a) &
     for f st f in UsedI*Loc I holds Comput(P,s,m).f = Comput(Q,t,m).f
proof
 let P,Q be Instruction-Sequence of SCM+FSA such that
A1: I c= P & I c= Q;
 assume that
A2: Start-At(0,SCM+FSA) c= s and
A3: Start-At(0,SCM+FSA) c= t and
A4: s | UsedILoc I = t | UsedILoc I and
A5: s | UsedI*Loc I = t | UsedI*Loc I and
A6: for m st m < n holds IC Comput(P,s,m) in dom I;
  defpred P[Nat] means $1 < n implies IC Comput(Q,t,$1) in dom I
  & IC Comput(P,s,$1) = IC Comput(Q,t,$1) & (for a st
a in UsedILoc I
holds Comput(P,s,$1).a = Comput(Q,t,$1).a) & for f st
f in UsedI*Loc I
  holds Comput(P,s,$1).f = Comput(Q,t,$1).f;
A7: now
    let m;
    assume
A8: P[m];
    thus P[m+1]
    proof
      set i = P.IC Comput(P,s,m);
     dom P = NAT by PARTFUN1:def 2;
     then
A9:   P/.IC Comput(P,s,m) = P.IC Comput(P,s,m) by PARTFUN1:def 6;
      set m1 = m+1;
A10:  Comput(P,s,m1) = Following(P,Comput(P,s,m)) by EXTPRO_1:3
        .= Exec(P.IC Comput(P,s,m),Comput(P,s,m))
         by A9;
      assume
A11:  m1 < n;
      now
        thus dom ( Comput(P,s,m) | UsedI*Loc I) = dom ( Comput(
P,s,m))
        /\ UsedI*Loc I by RELAT_1:61
          .= (the carrier of SCM+FSA) /\ UsedI*Loc I
           by PARTFUN1:def 2
          .= dom ( Comput(Q,t,m)) /\ UsedI*Loc I by PARTFUN1:def 2;
        let x be object;
        assume x in dom ( Comput(P,s,m) | UsedI*Loc I);
        then
A12:    x in UsedI*Loc I by RELAT_1:57;
        then x in FinSeq-Locations;
        then reconsider x9 = x as FinSeq-Location by SCMFSA_2:def 5;
        thus ( Comput(P,s,m) | UsedI*Loc I).x = Comput(
P,s,m).x9 by A12,FUNCT_1:49
          .= Comput(Q,t,m).x by A8,A11,A12,NAT_1:13;
      end;
      then
A13:  Comput(P,s,m) | UsedI*Loc I = Comput(Q,t,m) | UsedI*Loc I
      by FUNCT_1:46;
A14:  P.IC Comput(P,s,m) = I.IC Comput(P,s,m)
        by A8,A11,A1,GRFUNC_1:2,NAT_1:13;
      then
A15:  P.IC Comput(P,s,m) = Q.IC Comput(Q,t,m)
          by A8,A11,A1,GRFUNC_1:2,NAT_1:13;
      now
        thus dom ( Comput(P,s,m) | UsedILoc I) = dom ( Comput(
P,s,m))
        /\ UsedILoc I by RELAT_1:61
          .= (the carrier of SCM+FSA) /\ UsedILoc I
          by PARTFUN1:def 2
          .= dom ( Comput(Q,t,m)) /\ UsedILoc I by PARTFUN1:def 2;
        let x be object;
        assume x in dom ( Comput(P,s,m) | UsedILoc I);
        then
A16:    x in UsedILoc I by RELAT_1:57;
        then x in Int-Locations;
        then reconsider x9 = x as Int-Location by AMI_2:def 16;
        thus ( Comput(P,s,m) | UsedILoc I).x = Comput(
P,s,m).x9 by A16,FUNCT_1:49
          .= Comput(Q,t,m).x by A8,A11,A16,NAT_1:13;
      end;
      then
A17:  Comput(P,s,m) | UsedILoc I = Comput(Q,t,m) | UsedILoc I
      by FUNCT_1:46;
     dom Q = NAT by PARTFUN1:def 2;
     then
A18:  Q/.IC Comput(Q,t,m) = Q.IC Comput(Q,t,m) by PARTFUN1:def 6;
A19:  Comput(Q,t,m1) =
Following(Q,Comput(Q,t,m)) by EXTPRO_1:3
        .= Exec(Q.IC Comput(Q,t,m),Comput(Q,t,m))
         by A18;
      m < n by A11,NAT_1:13;
      then IC Comput(P,s,m) in dom I by A6;
      then
A20:  i in rng I by A14,FUNCT_1:def 3;
      then
A21:  Comput(P,s,m) | UsedInt*Loc i = ( Comput(P,s,m)
| UsedI*Loc
      I) | UsedInt*Loc i by Th35,RELAT_1:74
        .= Comput(Q,t,m) | UsedInt*Loc i by A20,A13,Th35,RELAT_1:74;
A22:  Comput(P,s,m) | UsedIntLoc i = ( Comput(P,s,m)
| UsedILoc I
      ) | UsedIntLoc i by A20,Th19,RELAT_1:74
        .= Comput(Q,t,m) | UsedIntLoc i by A20,A17,Th19,RELAT_1:74;
      then
A23:  Exec(i, Comput(P,s,m)) | UsedInt*Loc i
      = Exec(i, Comput(Q,t,m)) | UsedInt*Loc i
       by A8,A11,A21,Th64,NAT_1:13;
A24:  IC Exec(i, Comput(P,s,m)) = IC Exec(i, Comput(Q,t,m))
           by A8,A11,A22,A21,Th64,NAT_1:13;
      hence IC Comput(Q,t,m1) in dom I by A6,A11,A10,A19,A15;
      thus IC Comput(P,s,m1) = IC Comput(Q,t,m1) by A8,A11,A10,A19,A14,A24,A1,
GRFUNC_1:2,NAT_1:13;
A25:  Exec(i, Comput(P,s,m)) | UsedIntLoc i = Exec(i, Comput(
Q,t,m)
      ) | UsedIntLoc i by A8,A11,A22,A21,Th64,NAT_1:13;
      hereby
        let a;
        assume
A26:    a in UsedILoc I;
        per cases;
        suppose
A27:      a in UsedIntLoc i;
          hence
          Comput(P,s,m1).a = (Exec(i, Comput(P,s,m))
| UsedIntLoc i
          ).a by A10,FUNCT_1:49
            .= Comput(Q,t,m1).a by A19,A15,A25,A27,FUNCT_1:49;
        end;
        suppose
A28:      not a in UsedIntLoc i;
          hence Comput(P,s,m1).a = Comput(P,s,m).a
by A10,Th60
            .= Comput(Q,t,m).a by A8,A11,A26,NAT_1:13
            .= Comput(Q,t,m1).a by A19,A15,A28,Th60;
        end;
      end;
      let f;
      assume
A29:  f in UsedI*Loc I;
      per cases;
      suppose
A30:    f in UsedInt*Loc i;
        hence
        Comput(P,s,m1).f = (Exec(i, Comput(P,s,m)) |
UsedInt*Loc i)
        .f by A10,FUNCT_1:49
          .= Comput(Q,t,m1).f by A19,A15,A23,A30,FUNCT_1:49;
      end;
      suppose
A31:    not f in UsedInt*Loc i;
        hence Comput(P,s,m1).f = Comput(P,s,m).f by A10,Th62
          .= Comput(Q,t,m).f by A8,A11,A29,NAT_1:13
          .= Comput(Q,t,m1).f by A19,A15,A31,Th62;
      end;
    end;
  end;
A32: P[0]
  proof
A33: IC Comput(Q,t,0) = IC t
      .= 0 by A3,MEMSTR_0:39;
A34: IC Comput(P,s,0) = IC s
      .=  0 by A2,MEMSTR_0:39;
    assume 0 < n;
    hence IC Comput(Q,t,0) in dom I by A6,A34,A33;
    thus IC Comput(P,s,0) = IC Comput(Q,t,0) by A34,A33;
    hereby
      let a;
      assume
A35:  a in UsedILoc I;
      thus Comput(P,s,0).a = s.a
        .= (s | UsedILoc I).a by A35,FUNCT_1:49
        .= t.a by A4,A35,FUNCT_1:49
        .= Comput(Q,t,0).a;
    end;
    let f;
    assume
A36: f in UsedI*Loc I;
    thus Comput(P,s,0).f = s.f
      .= (s | UsedI*Loc I).f by A36,FUNCT_1:49
      .= t.f by A5,A36,FUNCT_1:49
      .= Comput(Q,t,0).f;
  end;
A37: for m holds P[m] from NAT_1:sch 2(A32, A7);
  hence for m st m < n holds IC Comput(Q,t,m) in dom I;
  let m;
  assume
A38: m <= n;
  per cases by NAT_1:6;
  suppose
A39: m = 0;
A40: IC Comput(Q,t,0) = IC t
      .=  0 by A3,MEMSTR_0:39;
    IC Comput(P,s,0) = IC s
      .=  0 by A2,MEMSTR_0:39;
    hence IC Comput(P,s,m) = IC Comput(Q,t,m) by A39,A40;
    hereby
      let a;
      assume
A41:  a in UsedILoc I;
      thus Comput(P,s,m).a = s.a by A39
        .= (s | UsedILoc I).a by A41,FUNCT_1:49
        .= t.a by A4,A41,FUNCT_1:49
        .= Comput(Q,t,m).a by A39;
    end;
    let f;
    assume
A42: f in UsedI*Loc I;
    thus Comput(P,s,m).f = s.f by A39
      .= (s | UsedI*Loc I).f by A42,FUNCT_1:49
      .= t.f by A5,A42,FUNCT_1:49
      .= Comput(Q,t,m).f by A39;
  end;
  suppose
    ex p being Nat st m = p+1;
    then consider p being Nat such that
A43: m = p+1;
    reconsider p as Nat;
A44: p < n by A38,A43,NAT_1:13;
    then
A45: IC Comput(P,s,p) in dom I by A6;
    now
      thus dom ( Comput(P,s,p) | UsedI*Loc I) = dom ( Comput(
P,s,p))
      /\ UsedI*Loc I by RELAT_1:61
        .= (the carrier of SCM+FSA) /\ UsedI*Loc I by PARTFUN1:def 2
        .= dom ( Comput(Q,t,p)) /\ UsedI*Loc I by PARTFUN1:def 2;
      let x be object;
      assume x in dom ( Comput(P,s,p) | UsedI*Loc I);
      then
A46:  x in UsedI*Loc I by RELAT_1:57;
      then x in FinSeq-Locations;
      then reconsider x9 = x as FinSeq-Location by SCMFSA_2:def 5;
      thus ( Comput(P,s,p) | UsedI*Loc I).x
         = Comput(P,s,p).x9 by A46,FUNCT_1:49
        .= Comput(Q,t,p).x by A37,A44,A46;
    end;
    then
A47: Comput(P,s,p) | UsedI*Loc I = Comput(Q,t,p) |
UsedI*Loc I
    by FUNCT_1:46;
    set i = P.IC Comput(P,s,p);
    set p1 = p+1;
     dom P = NAT by PARTFUN1:def 2;
     then
A48:  P/.IC Comput(P,s,p) = P.IC Comput(P,s,p) by PARTFUN1:def 6;
A49: Comput(P,s,p1) = Following(P,Comput(P,s,p)) by EXTPRO_1:3
      .= Exec(P.IC Comput(P,s,p), Comput(P,s,p))
              by A48;
    now
      thus dom ( Comput(P,s,p) | UsedILoc I) = dom ( Comput(
P,s,p)) /\
      UsedILoc I by RELAT_1:61
        .= (the carrier of SCM+FSA) /\ UsedILoc I by PARTFUN1:def 2
        .= dom ( Comput(Q,t,p)) /\ UsedILoc I by PARTFUN1:def 2;
      let x be object;
      assume x in dom ( Comput(P,s,p) | UsedILoc I);
      then
A50:  x in UsedILoc I by RELAT_1:57;
      then x in Int-Locations;
      then reconsider x9 = x as Int-Location by AMI_2:def 16;
      thus ( Comput(P,s,p) | UsedILoc I).x
       = Comput(P,s,p).x9 by A50,FUNCT_1:49
        .= Comput(Q,t,p).x by A37,A44,A50;
    end;
    then
A51: Comput(P,s,p) | UsedILoc I = Comput(Q,t,p) |
UsedILoc I by FUNCT_1:46;
A52: IC Comput(P,s,p) = IC Comput(Q,t,p) by A37,A44;
A53: P.IC Comput(P,s,p) = I.IC Comput(P,s,p) by A45,A1,GRFUNC_1:2;
     dom Q = NAT by PARTFUN1:def 2;
     then
A54:  Q/.IC Comput(Q,t,p) = Q.IC Comput(Q,t,p) by PARTFUN1:def 6;
A55: Comput(Q,t,p1) = Following(Q,Comput(Q,t,p)) by EXTPRO_1:3
      .= Exec(Q.IC Comput(Q,t,p), Comput(Q,t,p))
              by A54;
A56: P.IC Comput(P,s,p) = Q.IC Comput(Q,t,p) by A52,A45,A53,A1,GRFUNC_1:2;
    IC Comput(P,s,p) in dom I by A6,A44;
    then
A57: i in rng I by A53,FUNCT_1:def 3;
    then
A58: Comput(P,s,p) | UsedInt*Loc i = ( Comput(P,s,p)
| UsedI*Loc I
    ) | UsedInt*Loc i by Th35,RELAT_1:74
      .= Comput(Q,t,p) | UsedInt*Loc i by A57,A47,Th35,RELAT_1:74;
A59: Comput(P,s,p) | UsedIntLoc i = ( Comput(P,s,p) |
UsedILoc I)
    | UsedIntLoc i by A57,Th19,RELAT_1:74
      .= Comput(Q,t,p) | UsedIntLoc i by A57,A51,Th19,RELAT_1:74;
    hence IC Comput(P,s,m) = IC Comput(Q,t,m) by A43,A49,A55,A52,A56,A58,Th64;
A60: Exec(i, Comput(P,s,p)) | UsedIntLoc i = Exec(i, Comput(
Q,t,p))
    | UsedIntLoc i by A52,A59,A58,Th64;
    hereby
      let a;
      assume
A61:  a in UsedILoc I;
      per cases;
      suppose
A62:    a in UsedIntLoc i;
        hence
        Comput(P,s,m).a = (Exec(i, Comput(P,s,p)) |
UsedIntLoc i).a
        by A43,A49,FUNCT_1:49
          .= Comput(Q,t,m).a by A43,A55,A56,A60,A62,FUNCT_1:49;
      end;
      suppose
A63:    not a in UsedIntLoc i;
        hence Comput(P,s,m).a = Comput(P,s,p).a by A43,A49,Th60
          .= Comput(Q,t,p).a by A37,A44,A61
          .= Comput(Q,t,m).a by A43,A55,A56,A63,Th60;
      end;
    end;
A64: Exec(i, Comput(P,s,p)) | UsedInt*Loc i = Exec(i, Comput(Q,t,p))
    | UsedInt*Loc i by A52,A59,A58,Th64;
    hereby
      let f;
      assume
A65:  f in UsedI*Loc I;
      per cases;
      suppose
A66:    f in UsedInt*Loc i;
        hence
        Comput(P,s,m).f = (Exec(i, Comput(P,s,p)) |UsedInt*Loc i).f
         by A43,A49,FUNCT_1:49
          .= Comput(Q,t,m).f by A43,A55,A56,A64,A66,FUNCT_1:49;
      end;
      suppose
A67:    not f in UsedInt*Loc i;
        hence Comput(P,s,m).f = Comput(P,s,p).f by A43,A49,Th62
          .= Comput(Q,t,p).f by A37,A44,A65
          .= Comput(Q,t,m).f by A43,A55,A56,A67,Th62;
      end;
    end;
  end;
end;
