
theorem Th2:
for L being add-associative right_zeroed right_complementable
            right-distributive non empty doubleLoopStr
for f being FinSequence of L
for i,j being Element of NAT
st i in dom f & j = i-1 holds Ins(Del(f,i),j,f/.i) = f
proof
let L be add-associative right_zeroed right_complementable
         right-distributive non empty doubleLoopStr;
let f be FinSequence of L;
let i,j be Element of NAT;
set g = Ins(Del(f,i),j,f/.i);
assume A1: i in dom f & j = i-1;
then consider n being Nat such that
A2: len f = n+1 & len Del(f,i) = n by FINSEQ_3:104;
dom f = Seg(n+1) by A2,FINSEQ_1:def 3;
then consider ii being Nat such that
A3: i = ii & 1 <= ii & ii <= n + 1 by A1;
i-1 < i-0 by XREAL_1:15;
then j < n+1 by A1,A3,XXREAL_0:2;
then A4: j <= n by NAT_1:13;
A5: len g = len Del(f,i) + 1 by FINSEQ_5:69;
now let k be Nat;
  assume A6: 1 <= k & k <= len g;
  now per cases by XXREAL_0:1;
  suppose A8: k < i;
    then k+1 <= i by NAT_1:13;
    then k+1-1 <= i - 1 by XREAL_1:9;
    then 1 <= k & k <= len(Del(f,i)|j) by A6,A1,A4,A2,FINSEQ_1:59;
    then k in Seg(len(Del(f,i)|j));
    then k in dom(Del(f,i)|j) by FINSEQ_1:def 3;
    hence g.k = Del(f,i).k by FINSEQ_5:72
             .= f.k by A8,FINSEQ_3:110;
    end;
  suppose A11: k = i;
S:  f/.i = f.i by A1,PARTFUN1:def 6;
    k = j + 1 by A1,A11;
    then g.k = f.i by S,A2,A4,FINSEQ_5:73;
    hence g.k = f.k by A11;
    end;
  suppose A13: k > i;
    then reconsider k1 = k-1 as Element of NAT by A3,INT_1:5,XXREAL_0:2;
    A14: k-1 <= n+1-1 by A6,A2,A5,XREAL_1:9;
    i < k1 + 1 by A13;
    then A16: j+1 <= k-1 by A1,NAT_1:13;
    then g.(k1+1) = Del(f,i).k1 by A14,A2,FINSEQ_5:74
                 .= f.(k1+1) by A16,A14,A2,A1,FINSEQ_3:111;
    hence f.k = g.k;
    end;
  end;
  hence g.k = f.k;
  end;
hence thesis by A2,FINSEQ_5:69;
end;
