reserve x,y for set;
reserve C,C9,D,E for non empty set;
reserve c,c9,c1,c2,c3 for Element of C;
reserve B,B9,B1,B2 for Element of Fin C;
reserve A for Element of Fin C9;
reserve d,d1,d2,d3,d4,e for Element of D;
reserve F,G for BinOp of D;
reserve u for UnOp of D;
reserve f,f9 for Function of C,D;
reserve g for Function of C9,D;
reserve H for BinOp of E;
reserve h for Function of D,E;
reserve i,j for Nat;
reserve s for Function;
reserve p,q for FinSequence of D;
reserve T1,T2 for Element of i-tuples_on D;

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;
