Metric-space approach to potentials and its relevance to density-functional theory