theorem
  rng [#](p,d) = rng p \/ {d}
proof
  now
    let y be object;
    thus y in rng [#](p,d) implies y in rng p \/ {d}
    proof
      assume y in rng [#](p,d);
      then consider x being object such that
A1:   x in dom [#](p,d) and
A2:   y = [#](p,d).x by FUNCT_1:def 3;
      reconsider i = x as Element of NAT by A1;
      now
        per cases;
        case
A3:       i in dom p;
          then y = p.i by A2,Th20;
          hence y in rng p by A3,FUNCT_1:def 3;
        end;
        case
          not i in dom p;
          then y = d by A2,Th20;
          hence y in {d} by TARSKI:def 1;
        end;
      end;
      hence thesis by XBOOLE_0:def 3;
    end;
    assume
A4: y in rng p \/ {d};
    now
      per cases by A4,XBOOLE_0:def 3;
      suppose
        y in rng p;
        then consider i being Nat such that
A5:     i in dom p and
A6:     y = p.i by FINSEQ_2:10;
        y = [#](p,d).i by A5,A6,Th20;
        hence y in rng [#](p,d) by A5,FUNCT_2:4;
      end;
      suppose
A7:     y in {d};
        dom p = Seg len p by FINSEQ_1:def 3;
        then
A8:     not len p + 1 in dom p by Lm2;
        y = d by A7,TARSKI:def 1;
        then y = [#](p,d).(len p + 1) by A8,Th20;
        hence y in rng [#](p,d) by FUNCT_2:4;
      end;
    end;
    hence y in rng [#](p,d);
  end;
  hence thesis by TARSKI:2;
end;
