reserve l, m, n for Nat,
  i,j,k for Instruction of SCM+FSA,
  I,J,K for Program of SCM+FSA;
reserve a,b for Int-Location,
  f for FinSeq-Location,
  s,s1,s2 for State of SCM+FSA;

theorem
  for s1,s2 being State of SCM+FSA, n being Nat, i being
  Instruction of SCM+FSA holds IC s1 + n = IC s2 & DataPart s1 = DataPart s2
  implies IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) & DataPart Exec(i,s1) =
  DataPart Exec(IncAddr(i,n),s2)
proof
  set D = Data-Locations SCM+FSA;
  let s1,s2 be State of SCM+FSA;
  let n be Nat;
  let i be Instruction of SCM+FSA;
  assume that
A1: IC s1 + n = IC s2 and
A2: DataPart s1 = DataPart s2;
  reconsider k1 = IC s1 as Element of NAT;
A3: IC s1 + 1 + n =  (k1 + 1) + n
    .= IC s2 + 1 by A1;
A4: now
    set I = InsCode i;
    assume that
A5: I < 6 or 8 < I and
A6: I <> 0;
    not(I = 6 or ... or I = 8) by A5;
    then not I in {6,7,8} by ENUMSET1:def 1;
    then
A7: IncAddr(i,n) = i by SCMFSA_4:4;
    not(I = 0 or (I = 6 or ... or I = 8)) by A5,A6;
    then
A8: not I in {0,6,7,8} by ENUMSET1:def 2;
    then IC Exec(i,s1) = IC s1 + 1 by Th3;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A3,A8,A7,Th3;
  end;
  InsCode i = 0 or ... or InsCode i = 12 by SCMFSA_2:16;
  then per cases;
  suppose
    InsCode i = 0;
    then
A9: i = halt SCM+FSA by SCMFSA_2:95;
    then Exec(i,s1) = s1 & Exec(i,s2) = s2 by EXTPRO_1:def 3;
    hence thesis by A1,A2,A9,COMPOS_0:4;
  end;
  suppose
A10: InsCode i = 1;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da, db being Int-Location such that
A11: i = da := db by A10,SCMFSA_2:30;
A12: IncAddr(i,n) = i by A11,COMPOS_0:4;
A13: now
      let c be Int-Location;
      per cases;
      suppose
A14:    c = da;
        hence Exec(i,s1).c = s1.db by A11,SCMFSA_2:63
          .= s2.db by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A11,A12,A14,SCMFSA_2:63;
      end;
      suppose
A15:    c <> da;
        hence Exec(i,s1).c = s1.c by A11,SCMFSA_2:63
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A11,A12,A15,SCMFSA_2:63;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A11,SCMFSA_2:63
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A11,A12,SCMFSA_2:63;
    end;
    hence thesis by A13,SCMFSA_M:2;
  end;
  suppose
A16: InsCode i = 2;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da, db being Int-Location such that
A17: i = AddTo(da, db) by A16,SCMFSA_2:31;
A18: IncAddr(i,n) = i by A17,COMPOS_0:4;
A19: now
      let c be Int-Location;
      per cases;
      suppose
A20:    c = da;
        s1.da = s2.da & s1.db = s2.db by A2,SCMFSA_M:2;
        hence Exec(i,s1).c = s2.da + s2.db by A17,A20,SCMFSA_2:64
          .= Exec(IncAddr(i,n),s2).c by A17,A18,A20,SCMFSA_2:64;
      end;
      suppose
A21:    c <> da;
        hence Exec(i,s1).c = s1.c by A17,SCMFSA_2:64
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A17,A18,A21,SCMFSA_2:64;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A17,SCMFSA_2:64
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A17,A18,SCMFSA_2:64;
    end;
    hence thesis by A19,SCMFSA_M:2;
  end;
  suppose
A22: InsCode i = 3;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da, db being Int-Location such that
A23: i = SubFrom(da, db) by A22,SCMFSA_2:32;
A24: IncAddr(i,n) = i by A23,COMPOS_0:4;
A25: now
      let c be Int-Location;
      per cases;
      suppose
A26:    c = da;
        s1.da = s2.da & s1.db = s2.db by A2,SCMFSA_M:2;
        hence Exec(i,s1).c = s2.da - s2.db by A23,A26,SCMFSA_2:65
          .= Exec(IncAddr(i,n),s2).c by A23,A24,A26,SCMFSA_2:65;
      end;
      suppose
A27:    c <> da;
        hence Exec(i,s1).c = s1.c by A23,SCMFSA_2:65
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A23,A24,A27,SCMFSA_2:65;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A23,SCMFSA_2:65
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A23,A24,SCMFSA_2:65;
    end;
    hence thesis by A25,SCMFSA_M:2;
  end;
  suppose
A28: InsCode i = 4;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da, db being Int-Location such that
A29: i = MultBy(da, db) by A28,SCMFSA_2:33;
A30: IncAddr(i,n) = i by A29,COMPOS_0:4;
A31: now
      let c be Int-Location;
      per cases;
      suppose
A32:    c = da;
        s1.da = s2.da & s1.db = s2.db by A2,SCMFSA_M:2;
        hence Exec(i,s1).c = s2.da * s2.db by A29,A32,SCMFSA_2:66
          .= Exec(IncAddr(i,n),s2).c by A29,A30,A32,SCMFSA_2:66;
      end;
      suppose
A33:    c <> da;
        hence Exec(i,s1).c = s1.c by A29,SCMFSA_2:66
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A29,A30,A33,SCMFSA_2:66;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A29,SCMFSA_2:66
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A29,A30,SCMFSA_2:66;
    end;
    hence thesis by A31,SCMFSA_M:2;
  end;
  suppose
A34: InsCode i = 5;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da, db being Int-Location such that
A35: i = Divide(da, db) by A34,SCMFSA_2:34;
A36: IncAddr(i,n) = i by A35,COMPOS_0:4;
A37: now
      let c be Int-Location;
      per cases;
      suppose
A38:    c = db;
        s1.da = s2.da & s1.db = s2.db by A2,SCMFSA_M:2;
        hence Exec(i,s1).c = s2.da mod s2.db by A35,A38,SCMFSA_2:67
          .= Exec(IncAddr(i,n),s2).c by A35,A36,A38,SCMFSA_2:67;
      end;
      suppose
A39:    c = da & c <> db;
        s1.da = s2.da & s1.db = s2.db by A2,SCMFSA_M:2;
        hence Exec(i,s1).c = s2.da div s2.db by A35,A39,SCMFSA_2:67
          .= Exec(IncAddr(i,n),s2).c by A35,A36,A39,SCMFSA_2:67;
      end;
      suppose
A40:    c <> da & c <> db;
        hence Exec(i,s1).c = s1.c by A35,SCMFSA_2:67
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A35,A36,A40,SCMFSA_2:67;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A35,SCMFSA_2:67
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A35,A36,SCMFSA_2:67;
    end;
    hence thesis by A37,SCMFSA_M:2;
  end;
  suppose
    InsCode i = 6;
    then consider loc being Nat such that
A41: i = goto loc by SCMFSA_2:35;
A42: IncAddr(i,n) = goto (loc + n) by A41,SCMFSA_4:1;
A43: now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A41,SCMFSA_2:69
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A42,SCMFSA_2:69;
    end;
    IC Exec(i,s1) = loc by A41,SCMFSA_2:69;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A42,SCMFSA_2:69;
    now
      let c be Int-Location;
      thus Exec(i,s1).c = s1.c by A41,SCMFSA_2:69
        .= s2.c by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).c by A42,SCMFSA_2:69;
    end;
    hence thesis by A43,SCMFSA_M:2;
  end;
  suppose
    InsCode i = 7;
    then consider
    loc being Nat, da being Int-Location
    such that
A44: i = da=0_goto loc by SCMFSA_2:36;
A45: IncAddr(i,n) = da=0_goto (loc + n) by A44,SCMFSA_4:2;
A46: now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A44,SCMFSA_2:70
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A45,SCMFSA_2:70;
    end;
    hereby
      per cases;
      suppose
        s1.da = 0;
        then s2.da = 0 & IC Exec(i,s1) = loc by A2,A44,SCMFSA_2:70,SCMFSA_M:2;
        hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A45,SCMFSA_2:70;
      end;
      suppose
        s1.da <> 0;
        then s2.da <> 0 & IC Exec(i,s1) = IC s1 + 1
         by A2,A44,SCMFSA_2:70,SCMFSA_M:2;
        hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A3,A45,
SCMFSA_2:70;
      end;
    end;
    now
      let c be Int-Location;
      thus Exec(i,s1).c = s1.c by A44,SCMFSA_2:70
        .= s2.c by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).c by A45,SCMFSA_2:70;
    end;
    hence thesis by A46,SCMFSA_M:2;
  end;
  suppose
    InsCode i = 8;
    then consider
    loc being Nat, da being Int-Location
    such that
A47: i = da>0_goto loc by SCMFSA_2:37;
A48: IncAddr(i,n) = da>0_goto (loc + n) by A47,SCMFSA_4:3;
A49: now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A47,SCMFSA_2:71
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A48,SCMFSA_2:71;
    end;
    hereby
      per cases;
      suppose
        s1.da > 0;
        then s2.da > 0 & IC Exec(i,s1) = loc by A2,A47,SCMFSA_2:71,SCMFSA_M:2;
        hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A48,SCMFSA_2:71;
      end;
      suppose
        s1.da <= 0;
        then s2.da <= 0 & IC Exec(i,s1) = IC s1 + 1
         by A2,A47,SCMFSA_2:71,SCMFSA_M:2;
        hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2)
         by A3,A48,SCMFSA_2:71;
      end;
    end;
    now
      let c be Int-Location;
      thus Exec(i,s1).c = s1.c by A47,SCMFSA_2:71
        .= s2.c by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).c by A48,SCMFSA_2:71;
    end;
    hence thesis by A49,SCMFSA_M:2;
  end;
  suppose
A50: InsCode i = 9;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider db, da being Int-Location, f being FinSeq-Location such that
A51: i = da := (f,db) by A50,SCMFSA_2:38;
A52: IncAddr(i,n) = i by A51,COMPOS_0:4;
A53: now
      let c be Int-Location;
      per cases;
      suppose
A54:    c = da;
        then consider m being Nat such that
A55:    m = |.s1.db.| and
A56:    Exec(da:=(f,db), s1).c = (s1.f)/.m by SCMFSA_2:72;
A57:    s1.f = s2.f by A2,SCMFSA_M:2;
        consider m2 being Nat such that
A58:    m2 = |.s2.db.| and
A59:    Exec(da:=(f,db), s2).c = (s2.f)/.m2 by A54,SCMFSA_2:72;
        m = m2 by A2,A55,A58,SCMFSA_M:2;
        hence Exec(i,s1).c = Exec(IncAddr(i,n),s2).c by A51,A56,A59,A57,
COMPOS_0:4;
      end;
      suppose
A60:    c <> da;
        hence Exec(i,s1).c = s1.c by A51,SCMFSA_2:72
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A51,A52,A60,SCMFSA_2:72;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A51,SCMFSA_2:72
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A51,A52,SCMFSA_2:72;
    end;
    hence thesis by A53,SCMFSA_M:2;
  end;
  suppose
A61: InsCode i = 10;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider db, da being Int-Location, f being FinSeq-Location such that
A62: i = (f,db):=da by A61,SCMFSA_2:39;
A63: IncAddr(i,n) = i by A62,COMPOS_0:4;
A64: now
      let g be FinSeq-Location;
      per cases;
      suppose
A65:    g = f;
A66:    s1.da = s2.da & s1.f = s2.f by A2,SCMFSA_M:2;
        consider m2 being Nat such that
A67:    m2 = |.s2.db.| and
A68:    Exec((f,db):=da, s2).f = s2.f+*(m2,s2.da) by SCMFSA_2:73;
        consider m1 being Nat such that
A69:    m1 = |.s1.db.| and
A70:    Exec((f,db):=da, s1).f = s1.f+*(m1,s1.da) by SCMFSA_2:73;
        m1 = m2 by A2,A69,A67,SCMFSA_M:2;
        hence Exec(i,s1).g = Exec(IncAddr(i,n),s2).g by A62,A65,A70,A68,A66,
COMPOS_0:4;
      end;
      suppose
A71:    g <> f;
        hence Exec(i,s1).g = s1.g by A62,SCMFSA_2:73
          .= s2.g by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).g by A62,A63,A71,SCMFSA_2:73;
      end;
    end;
    now
      let c be Int-Location;
      thus Exec(i,s1).c = s1.c by A62,SCMFSA_2:73
        .= s2.c by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).c by A62,A63,SCMFSA_2:73;
    end;
    hence thesis by A64,SCMFSA_M:2;
  end;
  suppose
A72: InsCode i = 11;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da being Int-Location, f being FinSeq-Location such that
A73: i = da :=len f by A72,SCMFSA_2:40;
A74: IncAddr(i,n) = i by A73,COMPOS_0:4;
A75: now
      let c be Int-Location;
      per cases;
      suppose
A76:    c = da;
        hence Exec(i,s1).c = len(s1.f) by A73,SCMFSA_2:74
          .= len(s2.f) by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A73,A74,A76,SCMFSA_2:74;
      end;
      suppose
A77:    c <> da;
        hence Exec(i,s1).c = s1.c by A73,SCMFSA_2:74
          .= s2.c by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).c by A73,A74,A77,SCMFSA_2:74;
      end;
    end;
    now
      let f be FinSeq-Location;
      thus Exec(i,s1).f = s1.f by A73,SCMFSA_2:74
        .= s2.f by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).f by A73,A74,SCMFSA_2:74;
    end;
    hence thesis by A75,SCMFSA_M:2;
  end;
  suppose
A78: InsCode i = 12;
    hence IC Exec(i,s1) + n = IC Exec(IncAddr(i,n),s2) by A4;
    consider da being Int-Location, f being FinSeq-Location such that
A79: i = f:=<0,...,0>da by A78,SCMFSA_2:41;
A80: IncAddr(i,n) = i by A79,COMPOS_0:4;
A81: now
      let g be FinSeq-Location;
      per cases;
      suppose
A82:    g = f;
        (ex m1 being Nat st m1 = |.s1.da.| & Exec(f
:=<0,...,0>da, s1).f = m1 |-> 0 )& ex m2 being Nat st m2 = |.s2.da
        .| & Exec(f :=<0,...,0>da, s2).f = m2 |-> 0 by SCMFSA_2:75;
        hence Exec(i,s1).g = Exec(IncAddr(i,n),s2).g
         by A2,A79,A80,A82,SCMFSA_M:2;
      end;
      suppose
A83:    g <> f;
        hence Exec(i,s1).g = s1.g by A79,SCMFSA_2:75
          .= s2.g by A2,SCMFSA_M:2
          .= Exec(IncAddr(i,n),s2).g by A79,A80,A83,SCMFSA_2:75;
      end;
    end;
    now
      let c be Int-Location;
      thus Exec(i,s1).c = s1.c by A79,SCMFSA_2:75
        .= s2.c by A2,SCMFSA_M:2
        .= Exec(IncAddr(i,n),s2).c by A79,A80,SCMFSA_2:75;
    end;
    hence thesis by A81,SCMFSA_M:2;
  end;
end;
