theorem Th4:
  i in Seg (n+1) implies Del((n+1) |->d,i)=n |-> d
proof
  set n1=n+1;
  set n1d=n1|->d;
  set nd=n|->d;
  set Dn=Del(n1d,i);
A1: len n1d=n1 by CARD_1:def 7;
A2: dom n1d=Seg len n1d by FINSEQ_1:def 3;
A3: len nd=n by CARD_1:def 7;
  assume
A4: i in Seg (n+1);
A5: now
    let j such that
A6: 1<=j and
A7: j<=n;
    j<=n1 by A7,NAT_1:13;
    then
A8: j in Seg n1 by A6;
A9: j in Seg n by A6,A7;
    then
A10: j+1 in Seg (n+1) by FINSEQ_1:60;
    now
      per cases;
      suppose
        j<i;
        hence Dn.j = n1d.j by FINSEQ_3:110
          .= d by A8,FINSEQ_2:57
          .= nd.j by A9,FINSEQ_2:57;
      end;
      suppose
        j>=i;
        hence Dn.j = n1d.(j+1) by A4,A1,A2,A7,FINSEQ_3:111
          .= d by A10,FINSEQ_2:57
          .= nd.j by A9,FINSEQ_2:57;
      end;
    end;
    hence nd.j=Dn.j;
  end;
  len Dn=n by A4,A1,A2,FINSEQ_3:109;
  hence thesis by A3,A5;
end;
