reserve i,j,m,n,k for Nat,
  x,y for set,
  K for Field,
  a,a1,a2 for Element of K,
  D for non empty set,
  d,d1,d2 for Element of D,
  M,M1,M2 for (Matrix of D),
  A,A1,A2,B1,B2 for (Matrix of K),
  f,g for FinSequence of NAT;

theorem Th3:
  for f,g be FinSequence of D st i in dom g holds Del(f^g,i+len f)= f^Del(g,i)
proof
  let f,g be FinSequence of D such that
A1: i in dom g;
  set Dg=Del(g,i);
  consider m such that
A2: len g = m + 1 and
A3: len Dg = m by A1,FINSEQ_3:104;
  set fD=f^Dg;
  set iL=i+len f;
  set fg=f^g;
  set Dfg=Del(fg,iL);
A4: dom fg=Seg len fg by FINSEQ_1:def 3;
A5: len fg=len f+len g by FINSEQ_1:22;
  then
A6: len fg=m+len f+1 by A2;
A7: i in Seg len g by A1,FINSEQ_1:def 3;
  then
A8: i>0;
A9: now
    let j such that
A10: 1<=j and
A11: j<=m+len f;
    now
      per cases;
      suppose
A12:    j<=len f;
        then
A13:    j in dom f by A10,FINSEQ_3:25;
        0+len f<iL by A8,XREAL_1:8;
        then j<iL by A12,XXREAL_0:2;
        hence Dfg.j = fg.j by FINSEQ_3:110
          .= f.j by A13,FINSEQ_1:def 7
          .= fD.j by A13,FINSEQ_1:def 7;
      end;
      suppose
A14:    j>len f;
        then reconsider jL=j-len f as Element of NAT by NAT_1:21;
A15:    1<=jL+1 by NAT_1:14;
        jL+len f<=m+len f by A11;
        then
A16:    jL<=m by XREAL_1:6;
        then jL+1<=len g by A2,XREAL_1:7;
        then
A17:    jL+1 in dom g by A15,FINSEQ_3:25;
        jL<>0 by A14;
        then
A18:    jL>=1 by NAT_1:14;
        then
A19:    jL in dom Dg by A3,A16,FINSEQ_3:25;
        jL<=len g by A2,A16,NAT_1:13;
        then
A20:    jL in dom g by A18,FINSEQ_3:25;
        now
          per cases;
          suppose
A21:        jL<i;
            then jL+len f<iL by XREAL_1:8;
            hence Dfg.j = fg.(jL+len f) by FINSEQ_3:110
              .= g.jL by A20,FINSEQ_1:def 7
              .= Dg.jL by A21,FINSEQ_3:110
              .= fD.(jL+len f) by A19,FINSEQ_1:def 7
              .= fD.j;
          end;
          suppose
A22:        jL>=i;
            then jL+len f>=iL by XREAL_1:7;
            hence Dfg.j = fg.(jL+len f+1) by A5,A7,A4,A6,A11,FINSEQ_1:60
,FINSEQ_3:111
              .= fg.((jL+1)+len f)
              .= g.(jL+1) by A17,FINSEQ_1:def 7
              .= Dg.jL by A1,A2,A16,A22,FINSEQ_3:111
              .= fD.(jL+len f) by A19,FINSEQ_1:def 7
              .=fD.j;
          end;
        end;
        hence fD.j=Dfg.j;
      end;
    end;
    hence fD.j=Dfg.j;
  end;
A23: len fD=len f+len Dg by FINSEQ_1:22;
  len Dfg=m+len f by A5,A7,A4,A6,FINSEQ_1:60,FINSEQ_3:109;
  hence thesis by A3,A23,A9;
end;
