
theorem NF120:
  for a being non empty FinSequence of REAL,
      p being set, i being Nat st
  (p \/ {i}) c= dom a &
  (for m being Nat st m in p holds m < i) holds
  Seq (a | (p \/ {i})) = Seq (a | p) ^ <* a . i *>
  proof
    let a be non empty FinSequence of REAL, p be set, i be Nat;

    assume that
    A00: p \/ {i} c= dom a and
    A05: for m being Nat st m in p holds m < i;

    A20: dom (a | (p \/ {i})) = p \/ {i} by A00,RELAT_1:62;

    reconsider api = a | (p \/ {i}) as FinSubsequence;

    A32: p c= dom a by A00,XBOOLE_1:11;

    i in dom a by A00,XBOOLE_1:11,ZFMISC_1:31;
    then A34: 1 <= i & i <= len a by FINSEQ_3:25;

    p c= Seg len a by A32,FINSEQ_1:def 3;
    then
a35: p is included_in_Seg;

    i in Seg i by A34;
    then {i} c= Seg i by ZFMISC_1:31;
    then a36: {i} is included_in_Seg;

    A40: for m, n being Nat st m in p & n in {i} holds m < n
    proof
      let m, n be Nat;

      assume that
      B00: m in p and
      B10: n in {i};
      n = i by B10,TARSKI:def 1;

      hence m < n by B00,A05;
    end;

    A41: for z being object holds not z in p /\ {i}
    proof
      let z be object;

      now assume z in p /\ {i};
        then C10: z in p & z in {i} by XBOOLE_0:def 4;
        then z = i by TARSKI:def 1;
        hence contradiction by C10,A05;
      end;
      hence not z in p /\ {i};
    end;

    A50: Sgm (p \/ {i})
     = (Sgm p) ^ (Sgm {i}) by a35,a36,A40,FINSEQ_3:42
    .= (Sgm p) ^ <* i *> by A34,FINSEQ_3:44;

    set sgmp = Sgm p, poi = p \/ {i};

    i in {i} by ZFMISC_1:31;
    then reconsider i as Element of poi by XBOOLE_0:def 3;

    A57: rng sgmp = p by a35,FINSEQ_1:def 14;

    reconsider sgmp as FinSequence of poi by XBOOLE_1:7,A57,FINSEQ_1:def 4;

    A58: rng a c= REAL;

    rng api c= rng a by RELAT_1:70;
    then rng api c= REAL by A58;
    then reconsider api as Function of poi,REAL by A20,FUNCT_2:2;

    A60: (a | (p \/ {i})) * (Sgm (p \/ {i})) = (api * sgmp) ^ <* api . i *>
    by A50,FINSEQOP:8;

    A65: api = (a | p) \/ (a | {i}) by RELAT_1:78;

    reconsider api as PartFunc of NAT,REAL;

    set apai = (a | p) \/ (a | {i});

    A70: api * (Sgm p) = (((a | p) * (Sgm p)) \/ ((a | {i}) * (Sgm p)))
    by A65,RELAT_1:32;

    A75: dom (a | p) = p by A00,XBOOLE_1:11,RELAT_1:62;

    A82: p misses {i} by A41,XBOOLE_0:def 1;

    dom (a | {i}) = {i} by A00,XBOOLE_1:11,RELAT_1:62;
    then (a | {i}) * (Sgm p) = {} by A57,A82,RELAT_1:44;

    hence thesis by A20,A60,A70,A75,FUNCT_1:49;
  end;
