reserve i, j, k, c, m, n for Nat,
  a, x, y, z, X, Y for set,
  D, E for non empty set,
  R for Relation,
  f, g for Function,
  p, q for FinSequence;

theorem Th4:
  p+*(i,a) = q+*(i,a) implies Del(p,i) = Del(q,i)
proof
  set x = p, y = q;
  assume
A1: x+*(i,a) = y+*(i,a);
  set xi = x+*(i,a), yi = y+*(i,a);
  set dx = Del(x,i), dy = Del(y,i);
A2: dom xi = dom x by FUNCT_7:30;
A3: dom yi = dom y by FUNCT_7:30;
A4: Seg len y = dom y by FINSEQ_1:def 3;
A5: Seg len x = dom x by FINSEQ_1:def 3;
  per cases;
  suppose
A6: i in dom x;
A7: dom Del(x,i) = Seg len dx by FINSEQ_1:def 3;
    now
      thus len dx = len dx;
      x <> {} by A6;
      then consider m being Nat such that
A8:   len x = m+1 by NAT_1:6;
      reconsider m as Element of NAT by ORDINAL1:def 12;
A9:  len dx = m by A6,A8,FINSEQ_3:109;
      hence len dy = len dx by A1,A2,A3,A5,A4,A6,A8,FINSEQ_1:6,FINSEQ_3:109;
      let j be Nat;
      assume j in dom Del(x,i);
      then
A10:  j <= m by A7,A9,FINSEQ_1:1;
      per cases;
      suppose
A11:    j < i;
        hence dx.j = x.j by FINSEQ_3:110
          .= yi.j by A1,A11,FUNCT_7:32
          .= y.j by A11,FUNCT_7:32
          .= dy.j by A11,FINSEQ_3:110;
      end;
      suppose
A12:    i <= j;
        then
A13:    j+1 > i by NAT_1:13;
        thus dx.j = x.(j+1) by A6,A8,A10,A12,FINSEQ_3:111
          .= yi.(j+1) by A1,A13,FUNCT_7:32
          .= y.(j+1) by A13,FUNCT_7:32
          .= dy.j by A1,A2,A3,A5,A4,A6,A8,A10,A12,FINSEQ_1:6,FINSEQ_3:111;
      end;
    end;
    hence thesis by FINSEQ_2:9;
  end;
  suppose
A14: not i in dom x;
    then xi = x by FUNCT_7:def 3;
    hence thesis by A1,A3,A14,FUNCT_7:def 3;
  end;
end;
