Sampling discretization of integral norms

Abstract: The paper is devoted to discretization of integral norms of functions from a given finite dimensional subspace. Even though this problem is extremely important in applications, its systematic study has begun recently. In this paper we obtain a conditional theorem for all integral norms $L_q$, $1\le q<\infty$, which is an extension of known results for $q=1$. To discretize the integral norms successfully, we introduce a new technique, which is a combination of probabilistic technique with results on the entropy numbers in the uniform norm. As an application of the general conditional theorem, we derive a new Marcinkiewicz type discretization for the multivariate trigonometric polynomials with frequencies from the hyperbolic crosses.

\section{Introduction}
\label{I}

 As it is clear from the title the two main concepts of the paper are {\it discretization} and {\it integral norms}.
Let $\Omega$ be a compact subset of ${\mathbb R}^d$ with the probability measure $\mu$. By $L_q$, $1\le q< \infty$, norm we understand
$$
\|f\|_q := \left(\int_\Omega |f|^qd\mu\right)^{1/q}.
$$
By discretization of the $L_q$ norm we understand a replacement of the measure $\mu$ by
a discrete measure $\mu_m$ with support on a set $\xi =\{\xi^\nu\}_{\nu=1}^m \subset \Omega$. This means that integration with respect to measure $\mu$ we replace by an appropriate cubature formula. Thus integration is replaced by evaluation of a function $f$ at a
finite set $\xi$ of points. This is why we call this way of discretization {\it sampling discretization}.

Discretization is
a very important step in making a continuous problem computationally feasible.
A prominent  example of a classical discretization problem is the problem of metric entropy (covering numbers, entropy numbers). The reader can find fundamental general results on metric entropy in \cite[Ch.15]{LGM},  \cite[Ch.3]{Tbook}, \cite[Ch.7]{VTbookMA}, \cite{Carl},
\cite{Schu} and in the recent papers \cite{VT156} and  \cite{HPV}.
Bounds for the entropy numbers of function classes are important by themselves and also have important connections to other fundamental problems (see, for instance, \cite[Ch.3]{Tbook} and \cite[Ch.6]{DTU}).

Another prominent example of a discretization problem is the problem of numerical integration.  Numerical integration in the mixed smoothness classes requires deep number theoretical results for constructing optimal (in the sense of order) cubature formulas (see, for instance, \cite[Ch.8]{DTU}). A typical approach to solving a continuous problem numerically -- the Galerkin method --
suggests to look for an approximate solution from a given finite dimensional subspace. A standard way to measure an error of approximation is an appropriate $L_q$ norm, $1\le q\le\infty$. Thus, the problem of   discretization of the $L_q$ norms of functions from a given finite dimensional subspace arises in a very natural way. The first results in this direction were obtained by Marcinkiewicz and
by Marcinkiewicz-Zygmund (see \cite{Z}) for discretization of the $L_q$ norms of the univariate trigonometric polynomials in 1930s. This is why we call discretization results of this kind the Marcinkiewicz-type theorems. There are different ways to discretize: use coefficients from an expansion with respect to a basis, more generally, use
linear functionals. We discuss here the way which uses function values at a fixed finite set of points.
We now proceed to the detailed presentation.

{\bf Marcinkiewicz problem.} Let $\Omega$ be a compact subset of ${\mathbb R}^d$ with the probability measure $\mu$. We say that a linear subspace $X_N$ (index $N$ here, usually, stands for the dimension of $X_N$) of $L_q(\Omega)$, $1\le q < \infty$, admits the Marcinkiewicz-type discretization theorem with parameters $m\in {\mathbb{N}}$ and $q$ if there exist a set $$\Big\{\xi^\nu \in \Omega: \nu=1,\dots,m\Big\}$$ and two positive constants $C_1(d,q)$ and $C_2(d,q)$ such that for any $f\in X_N$ we have
\begin{equation}\label{I.1}
C_1(d,q)\|f\|_q^q \le \frac{1}{m} \sum_{\nu=1}^m |f(\xi^\nu)|^q \le C_2(d,q)\|f\|_q^q.
\end{equation}
In the case $q=\infty$ we define $L_\infty$ as the space of continuous functions on $\Omega$  and ask for
\begin{equation}\label{I.2}
C_1(d)\|f\|_\infty \le \max_{1\le\nu\le m} |f(\xi^\nu)| \le  \|f\|_\infty.
\end{equation}
We will also use the following brief way to express the above properties: the $\mathcal M(m,q)$ theorem holds for  a subspace $X_N$, written $X_N \in \mathcal M(m,q)$.

The most complete results on sampling discretization are obtained in the case $q=2$.  The problem is basically solved in the case of subspaces of trigonometric polynomials. By $Q$ we denote a finite subset of $\mathbb Z^d$, and $|Q|$ stands for the number of elements in $Q$. Let
$$
\mathcal T(Q):= \left\{f: f=\sum_{\mathbf k\in Q}c_\mathbf k e^{i(\mathbf k,\mathbf x)},\  \  c_{\mathbf k}\in\mathbb{C}\right\}.
$$
In \cite{VT158} it was shown how to derive the following result from the
 recent paper by  S.~Nitzan, A.~Olevskii, and A.~Ulanovskii~\cite{NOU}, which in turn is based on the paper of A.~Marcus, D.A.~Spielman, and N.~Srivastava~\cite{MSS}.

\begin{Theorem}\label{NOUth} There are three positive absolute constants $C_1$, $C_2$, and $C_3$ with the following properties: For any $d\in {\mathbb{N}}$ and any $Q\subset \mathbb Z^d$   there exists a set of  $m \le C_1|Q| $ points $\xi^j\in \mathbb T^d$, $j=1,\dots,m$ such that for any $f\in \mathcal T(Q)$
we have
$$
C_2\|f\|_2^2 \le \frac{1}{m}\sum_{j=1}^m |f(\xi^j)|^2 \le C_3\|f\|_2^2.
$$
\end{Theorem}

 Some results are obtained under an extra condition on the system $\{u_i(x)\}_{i=1}^N$.

 We will call it Condition E to be consistent with the prior work
 (see, e.g., \cite{DPTT}).
 \\
{\bf Condition E.} There exists a constant $t$ such that for all $x\in \Omega$
\begin{equation}\label{ud5}
w(x):=\sum_{i=1}^N u_i(x)^2 \le Nt^2.
\end{equation}
The reader can find the following result, which is a slight generalization of the Rudelson's \cite{Rud} celebrated result, in \cite{VT159}.

\begin{Theorem}\label{T5.4}  Let $\{u_i\}_{i=1}^N$ be a real  orthonormal system, satisfying condition~{\bf E}.
Then for every $\epsilon>0$ there exists a set $\{\xi^j\}_{j=1}^m \subset \Omega$ with
\[
m  \le C\frac{t^2}{\epsilon^2}N\log N
\]
such that for any $f=\sum_{i=1}^N c_iu_i$ we have
\[
(1-\epsilon)\|f\|_2^2 \le \frac{1}{m} \sum_{j=1}^m f(\xi^j)^2 \le (1+\epsilon)\|f\|_2^2.
\]
\end{Theorem}

Rather complete results on sampling discretization of the $L_1$ norm are obtained in \cite{VT159}. One of the main goals of this paper is to treat the case $1<q<\infty$.   In Section \ref{CondT} we present a generalization of discretization result from \cite{VT159}, which treats the case $q=1$, to the case of $1<q<\infty$. We give a detailed proof in Section \ref{CondT}.
We note that the case $q=2$ is much better developed both in the case of trigonometric polynomials and in the general case (see \cite{VT158}, \cite{VT159}, \cite{DPTT}, and the above discussion).
We prove in Section \ref{CondT} the following conditional result. Denote
$$
X^q_N := \{f\in X_N:\, \|f\|_q \le 1\}.
$$
For the definition of the entropy numbers $\varepsilon_k$ see Section \ref{CondT}.
\begin{Theorem}\label{T2.1} Let $1\le q<\infty$. Suppose that a subspace $X_N$ satisfies the condition
\begin{equation}\label{I6}
\varepsilon_k(X^q_N,L_\infty) \le  B (N/k)^{1/q}, \quad 1\leq k\le N,
\end{equation}
where $B\ge 1$.
Then for large enough constant $C(q)$ there exists a set of
$$
m \le C(q)NB^{q}(\log_2(2BN))^2
$$
 points $\xi^j\in \Omega$, $j=1,\dots,m$,   such that for any $f\in X_N$
we have
$$
\frac{1}{2}\|f\|_q^q \le \frac{1}{m}\sum_{j=1}^m |f(\xi^j)|^q \le \frac{3}{2}\|f\|_q^q.
$$
\end{Theorem}

\begin{Remark}\label{rem:nik}

 We remark that
 the  assumption \eqref{I6} for $k=1$ implies the following Nikol'skii type inequality for $X_N$:
	\[
	\|f\|_\infty \le 4BN^{1/q}\|f\|_q\   \ \text{for any $f\in X_N$.}
	\]
This  is shown in the beginning of the proof of Theorem \ref{T2.1}.
\end{Remark}

\begin{Remark}
In the proof of Theorem \ref{T2.1} we use the technique, which we call {\textnormal{ sandwiching}}. This means that we find a mapping of the $X_N^q$ into a finite set $\{h(f,\mathbf x)\}$ of
piecewise constant functions with a property $C_1(a) h(f,\mathbf x) \le |f(\mathbf x)| \le C_2(a) h(f,\mathbf x)$, for a large set of $\mathbf x$. The idea of {\it sandwiching} is related to the idea of {\it entropy with bracketing}, which is widely used in the empirical process theory (see \cite{vdG}). We realize the sandwiching idea in the form very close to the one used in the paper by E.S. Belinsky \cite{Bel}. In the case $q=1$ Theorem \ref{T2.1} was proved in \cite{VT159} with the help of a different technique -- the chaining technique.

\end{Remark}
Applications of Theorem~\ref{T2.1} and further discussions are given in Section~3.

This paper can be considered  a natural continuation of  the recent papers~\cite{VT158}, \cite{VT159} and~\cite{DPTT}.

\section{Conditional theorem for discretization in $L_q$}
\label{CondT}

We begin with the definition of the entropy numbers.
  Let $(X,\|\cdot\|)$ be a Banach space and let $B_X$ denote the unit ball of $X$ with the center at the origin. Denote by $B_X(f,r)$ a ball with center $f$ and radius $r$: $\{g\in X:\|f-g\|\le r\}$. For a compact set $A$ and a positive number $\varepsilon$ we define the covering number $N_\varepsilon(A)$
 as follows
$$
N_\varepsilon(A) := N_\varepsilon(A,X)
:=\min \Biggl\{n : \exists f_1,\dots,f_n, f_j\in A , A\subseteq \bigcup_{j=1}^n B_X(f_j,\varepsilon)\Biggr\}.
$$
The corresponding minimal $\varepsilon$-net is denoted by $\mathcal N_\varepsilon(A,X)$. Thus, $N_\varepsilon(A,X)= |\mathcal N_\varepsilon(A,X)|$.
It is convenient to consider along with the $\varepsilon$-entropy $${\mathcal H}_\varepsilon(A,X):= \log_2 N_\varepsilon(A,X)$$ the entropy numbers $\varepsilon_k(A,X)$ of the set $A$ in $X$:
\begin{align*}
\varepsilon_k(A,X)  :&=\inf \big\{\varepsilon>0: {\mathcal H}_\varepsilon (A; X)\leq k\big\},\   \  k=1,2,\cdots.
\end{align*}
In our definition of $N_\varepsilon(A)$ and $\varepsilon_k(A,X)$ we require $f_j\in A$. In a standard definition of $N_\varepsilon(A)$ and $\varepsilon_k(A,X)$ this restriction is not imposed.
However, it is well known (see \cite[p.208]{Tbook}) that these characteristics may differ at most by a factor $2$.

{\bf Proof of Theorem \ref{T2.1}.} We begin with the proof of Remark~\ref{rem:nik}.
Without loss of generality assume that $f\in X_N$ and $\|f\|_q=1$. By our assumption $\varepsilon_1:= \varepsilon_1(X_N^q,L_\infty) \le BN^{1/q}$. Since $X_N^q$ is compact, it means that there exist two elements $f_1$ and $f_2$ in $X_N^q$ such that $X_N^q\subset B_{L_\infty}(f_1,\varepsilon_1)\cup B_{L_\infty}(f_2,\varepsilon_1)$. This implies that the zero element belongs to one of these balls, say, $B_{L_\infty}(f_1,\varepsilon_1)$  and, therefore, $\|f_1\|_\infty\le \varepsilon_1$.
Next, $(f_1+f_2)/2$ belongs to one of those balls and, therefore, $\|f_1-f_2\|_\infty\le 2\varepsilon_1$. Thus,
for any $f\in X_N^q$ we have
\begin{equation}\label{2.4}
\|f\|_\infty \le 4\varepsilon_1 \le 4BN^{1/q}.
\end{equation}

\begin{Lemma}\label{lem:entropy bound for all eps}
	The condition~\eqref{I6} implies
	\begin{equation}\label{eqn:entropy bound}
	{\mathcal H}_\varepsilon(X^q_N,L_\infty)\le 1+N
	\begin{cases}
		(B/\varepsilon)^q & \text{if } \varepsilon\ge B,\\
		\log_2(6B/\varepsilon) & \text{if } 0<\varepsilon<B.
	\end{cases}
	\end{equation}
\end{Lemma}
\begin{proof}
We begin by pointing out that the assumption \eqref{I6} for $k=N$ implies the inequality
\begin{equation}\label{eqn:k more than N}
\varepsilon_k(X_N^q, L_\infty)\le 6B2^{-k/N}  \   \  \text{ for $k>N$}.
\end{equation}
This  follows directly  from the facts that for each Banach  space $X$ (see \cite[(7.1.6), p. 323]{VTbookMA}),
$$
\varepsilon_k(A,X) \le \varepsilon_N(A,X)\varepsilon_{k-N}(B_X,X), \  \ k>N,
$$
and for each $N$-dimensional space $X$ (see \cite[Corollary 7.2.2, p. 324]{VTbookMA}),
$$
\varepsilon_m(B_X,X) \le 3(2^{-m/N}).
$$

Now we will establish~\eqref{eqn:entropy bound}. If $\varepsilon>BN^{\frac 1q}$, then ${\mathcal H}_{\varepsilon} (X_N^q, L_\infty)\leq 1$ by~(\ref{I6}). If $B<\varepsilon\leq BN^{\frac 1q}$, then taking an integer  $k\in [2,N]$ satisfying
$$
B(N/k)^{1/q} < \varepsilon \leq  B(N/(k-1))^{1/q},
$$
we get from~(\ref{I6})
\[
{\mathcal H}_\varepsilon(X_N^q,L_\infty) \le k \le N(B/\varepsilon)^q +1.
\]
Similarly, using~\eqref{eqn:k more than N}, for $\varepsilon\le 3B$ we obtain
\begin{equation*
{\mathcal H}_\varepsilon(X_N^q,L_\infty) \le  N\log_2(6B/\varepsilon) +1.
\end{equation*}
\end{proof}

Using the inequality $\ln(t)\le C(q) t^q$ for $t>1$ and~\eqref{eqn:entropy bound}, we have that for every ${\varepsilon'}>0$ and $q\in[1,\infty)$ there exists $C({\varepsilon'},q)>0$ such that
\begin{equation}\label{eqn:entropy bound eps0}
{\mathcal H}_\varepsilon(X^q_N,L_\infty)\le C({\varepsilon'},q) (B/\varepsilon)^q \quad\text{for any }\varepsilon\ge {\varepsilon'}.
\end{equation}

{\bf Sandwiching construction.} Let $a\in(0,1/2]$ be a small number, which will be chosen later.
Denote
$$
{\mathcal A}_j := \mathcal N_{a(1+a)^j}(X_N^q,L_\infty), \qquad j\in\mathbb Z.
$$

 Take a number $j_0\in \mathbb Z$, which will be specified later, and for $j\in \mathbb Z$, $j\ge j_0$,  define a mapping $A_j$ that associates with a function $f\in X_N^q$ a function $A_j(f) \in {{\mathcal A}}_j$ closest to $f$ in the $L_\infty$ norm. Then, clearly,
$$
\|f-A_j(f)\|_\infty \le a(1+a)^j.
$$
We now define a mapping of  $X_N^q$ to a finite set of piecewise constant functions.
For $f\in X_N^q$ and $j\in \mathbb Z$ denote
$$
U_j(f) := \{\mathbf x : |A_j(f)(\mathbf x)| \ge (1+a)^{j-1}\},
$$
$$
D_j(f) := U_j(f) \setminus \cup_{k>j} U_k(f),\qquad D_{j_0}(f) := \Omega \setminus \cup_{k>j_0} U_k(f).
$$
Define
$$
h(f,\mathbf x) := \sum_{j>j_0} (1+a)^j \chi_{D_j(f)}(\mathbf x),
$$
where $\chi_E(\mathbf x)$ is a characteristic function of a set $E$.

We need some properties of the above $h$-mapping. We will sandwich $|f|$
by functions $C_1(a)h(f)$ and $C_2(a)h(f)$. We do it on each $D_j(f)$, $j>j_0$. By the definition of $D_j(f)$, the  condition $\mathbf x\in D_j(f)$ implies that $\mathbf x\in U_j(f)$ and $\mathbf x \notin U_{j+1}(f)$. From the definition of the $U_j(f)$ we obtain for $\mathbf x \in U_j(f)$
\[
|f(\mathbf x)| \ge |A_j(f)| - a(1+a)^j \ge (1+a)^{j-1} - a(1+a)^j = (1+a)^j C_1(a),
\
where
$$
C_1(a):= \frac{1-a(1+a)}{1+a}.
$$
From the definition of the $U_{j+1}(f)$ we obtain for $\mathbf x \notin U_{j+1}(f)$
\begin{equation}\label{2.8}
|f(\mathbf x)| \le |A_{j+1}(f)| + a(1+a)^{j+1} \le (1+a)^{j} + a(1+a)^{j+1} = (1+a)^j C_2(a),
\end{equation}
where
$$
C_2(a):=1+a(1+a).
$$
Therefore, for all $\mathbf x \in \Omega \setminus D_{j_0}(f)$ we have
\begin{equation}\label{2.9}
C_1(a)h(f,\mathbf x) \le |f(\mathbf x)| \le C_2(a)h(f,\mathbf x).
\end{equation}
It is clear that
\begin{equation}\label{2.10}
\lim_{a\to 0} C_1(a) = \lim_{a\to 0} C_2(a) =1.
\end{equation}
In the same way as we obtained the bound (\ref{2.8}) we derive for $\mathbf x\in D_{j_0}(f)$
\begin{align}
|f(\mathbf x)|  & \le |A_{j_0+1}(f)| + a(1+a)^{j_0+1} \nonumber \\
\label{2.11}
 & \le (1+a)^{j_0} + a(1+a)^{j_0+1} = (1+a)^{j_0} C_2(a).
\end{align}

We now show that a good discretization formula for the  functions $h(f)$ is also good for the  functions $f$. For a point set $\xi=\{\xi^\nu\}_{\nu=1}^m$ and a function $f$, denote
$$
S(f,\xi) := (f(\xi^1),\dots,f(\xi^m)) \in {\mathbb R}^m,\quad \|S(f,\xi)\|_q^q:= \frac{1}{m}\sum_{\nu=1}^m |f(\xi^\nu)|^q.
$$

\begin{Lemma}\label{BL1} Let $q\in [1,\infty)$. Assume that a point set $\xi$ is such that
for a function $h(f,\mathbf x)$ we have the inequalities
\begin{equation}\label{2.12}
\|h(f)\|_q^q-\delta \le \|S(h(f),\xi)\|_q^q \le  \|h(f)\|_q^q +\delta
\end{equation}
for some constant $\delta>0$.
Then
\begin{multline*}
C_1(a)^q\Bigl (C_2(a)^{-q}\bigl(\|f\|_q^q - C_2(a)^q (1+a)^{qj_0}\bigr)-\delta\Bigr)\\ \le \|S(f,\xi)\|_q^q
\le C_2(a)^q (1+a)^{qj_0} + C_2(a)^q \Bigl(C_1(a)^{-q} \|f\|_q^q+\delta\Bigr).
\end{multline*}

\end{Lemma}
\begin{proof} First, we take care of the set $D_{j_0}(f)$. By (\ref{2.11}) we have
$$
\int_{D_{j_0}(f)} |f(\mathbf x)|^q d\mu \le C_2(a)^q (1+a)^{qj_0}
$$
and
$$
\frac{1}{m} \sum_{\nu: \xi^\nu\in D_{j_0}(f)}|f(\xi^\nu)|^q \le C_2(a)^q(1+a)^{qj_0}.
$$
Then, on the one hand, by (\ref{2.9}) we have
$$
\|S(f,\xi)\|_q^q \le C_2(a)^q (1+a)^{qj_0} + C_2(a)^q \|S(h(f),\xi)\|_q^q.
$$
Using (\ref{2.12}) and (\ref{2.9}), we continue
\begin{eqnarray*}
\|S(f,\xi)\|_q^q &\le& C_2(a)^q (1+a)^{qj_0} + C_2(a)^q (\|h(f)\|_q^q+\delta)
\\
 &\le& C_2(a)^q (1+a)^{qj_0} + C_2(a)^q (C_1(a)^{-q} \|f\|_q^q+\delta).
\end{eqnarray*}
On the other hand by (\ref{2.9}) and (\ref{2.12}) we have
\begin{eqnarray*}
\|S(f,\xi)\|_q^q &\ge& C_1(a)^q \|S(h(f),\xi)\|_q^q  \ge C_1(a)^q(\|h(f)\|_q^q -\delta)
\\
&\ge& C_1(a)^q (C_2(a)^{-q}\int_{\Omega\setminus D_{j_0}(f)} |f(\mathbf x)|^qd\mu -\delta)
\\
&\ge& C_1(a)^q (C_2(a)^{-q}(\|f\|_q^q - C_2(a)^q (1+a)^{qj_0})-\delta).
\end{eqnarray*}

\end{proof}

\begin{Remark}\label{BR1} Under the assumption $\|f\|_q^q =1/2$ and $\delta =1/8$, using (\ref{2.10}), we can choose $j_0=j_0(a)$ and $a=a(q)$ such that Lemma \ref{BL1} gives
$$
\frac{1}{2}\|f\|_q^q \le \|S(f,\xi)\|_q^q \le \frac{3}{2}\|f\|_q^q
$$
and, in addition, $C_1(a)^{-q} \le 2$.
\end{Remark}

{\bf Existence of good $\xi$.} Let $q\in [1,\infty)$ and $a$, $j_0$, be from Remark \ref{BR1}. Although $a$ and $j_0$ depend on $q$ from now on, we will keep indicating the dependence of constants on $a$ and $j_0$ for clarity.
For $j>j_0$ consider the following sets of piecewise constant functions
$$
{\mathcal F}_j^q := \left\{ (1+a)^{qj}\chi_{D_j(f)},\, f\in X_N,\, \|f\|_q^q =1/2\right\}.
$$
Our argument is based on   \cite[Lemma~2.1]{BLM}.

\begin{Lemma}\label{AL1} Let $\{g_\nu\}_{\nu=1}^m$ be independent random variables with $\mathbb E g_\nu=0$, $\nu=1,\dots,m$, which satisfy
$$
\|g_\nu\|_1\le 2,\qquad \|g_\nu\|_\infty \le M,\qquad \nu=1,\dots,m.
$$
Then for any $\eta \in (0,1)$ we have the following bound on the probability
$$
\mathbb P\left\{\left|\sum_{\nu=1}^m g_\nu\right|\ge m\eta\right\} < 2\exp\left(-\frac{m\eta^2}{8M}\right).
$$
\end{Lemma}

It is easy to see that
 Lemma \ref{AL1} implies the following result.

\begin{Lemma}\label{BL2} Let $\{{\mathcal F}_j\}_{j\in G}$ be a collection of finite sets of
functions from $L_1(\Omega,\mu)$. Assume that for each $j\in G$ and all $f\in {\mathcal F}_j$ we have
$$
\|f\|_1 \le 1,\quad \|f\|_\infty \le M_j.
$$
Suppose that positive numbers $\eta_j$ and a natural number $m$ satisfy the condition
$$
2\sum_{j\in G} |{\mathcal F}_j| \exp \left(-\frac{m\eta_j^2}{8M_j}\right) <1.
$$
Then there exists a set $\xi=\{\xi^\nu\}_{\nu=1}^m \subset \Omega$ such that for each $j\in G$ and for all $f\in {\mathcal F}_j$ we have
$$
\left|\|f\|_1 - \frac{1}{m}\sum_{\nu=1}^m |f(\xi^\nu)|\right| \le \eta_j.
$$
\end{Lemma}

We apply Lemma \ref{BL2} for a collection of the above sets ${\mathcal F}_j^q$. First of all, it is clear
from (\ref{2.9}) and the choice of parameters $a$ and $j_0$ (see Remark \ref{BR1}) that we have
$$
\|(1+a)^{qj}\chi_{D_j(f)}\|_1 \le \|h(f)\|_q^q \le C_1(a)^{-q}\|f\|_q^q \le 1.
$$
Secondly, obviously,
$$
\|(1+a)^{qj}\chi_{D_j(f)}\|_\infty \le (1+a)^{qj} =: M_j.
$$
It is clear from (\ref{2.4}) that we only need to consider those $j$, which satisfy the condition
$(1+a)^{j-1}\le 4BN^{1/q}$. Indeed, if this condition is not satisfied, then by $A_j(f)\in X^q_N$ we have $U_j(f)= \varnothing$.

Let $J\in\mathbb Z$ be the one satisfying
$$
(1+a)^{J-1}\le 4BN^{1/q} < (1+a)^J.
$$
Then
\[
J \le 1+ \log(4BN^{1/q})/\log(1+a).
\
Denote $G:= (j_0,J]\cap \mathbb{Z}$. Then $|G| = J - j_0 \le J+|j_0|$. Set $\eta_j = \frac{1}{8|G|}$. Then
\begin{equation}\label{2.14}
\sum_{j\in G} \eta_j \le 1/8.
\end{equation}
We now estimate cardinalities $|{\mathcal F}_j^q|$ for $j\in G$. From the definition of ${\mathcal F}_j^q$ and the construction of the sets $D_j(f)$, we conclude that
$$
|{\mathcal F}_j^q| \le |{\mathcal A}_j|\times\cdots\times|{\mathcal A}_J|.
$$
Therefore,
$$
\ln |{\mathcal F}_j^q| \le \sum_{k=j}^J \ln |{\mathcal A}_k|.
$$
By~\eqref{eqn:entropy bound eps0} with ${\varepsilon'}:=a(1+a)^{j_0}$ we obtain for $k\in G$
$$
\ln |{{\mathcal A}_k}| \le {\mathcal H}_{a(1+a)^k}(X_N^q,L_\infty) \le C_3(a,j_0,q)NB^q(1+a)^{-qk}.
$$
Therefore,
$$
\ln |{\mathcal F}_j^q| \le C_4(a,j_0,q) NB^q (1+a)^{-qj}.
$$

 We now choose $C(a,j_0,q)$ large enough to guarantee that for any $m\ge 2C(a,j_0,q)NB^q|G|^2$ we have
 $$
 C_4(a,j_0,q) NB^q (1+a)^{-qj}-\frac{m\eta_j^2}{8M_j} \le - C(a,j_0,q) NB^q (1+a)^{-qj}
 $$
and
$$
2\sum_{j\in G} \exp\left(- C(a,j_0,q) NB^q (1+a)^{-qj}\right) <1,
$$
where  we have used that $\exp(-t)<\frac1t$ for $t>0$ and (2.12) in the last inequality.

Then Lemma \ref{BL2} provides the existence of $\xi = \{\xi^\nu\}_{\nu=1}^m$ such that for each
$j\in G$ and all $\varphi_j \in {\mathcal F}_j^q$ we have
\begin{equation}\label{2.15}
\left| \|\varphi_j\|_1 - \frac{1}{m}\sum_{\nu=1}^m |\varphi_j(\xi^\nu)|\right| \le \eta_j.
\end{equation}

Let $f\in X_N$ be such that $\|f\|_q^q =1/2$. We now prove (\ref{2.12}) for the above chosen
$\xi$ with $\delta=1/8$. Specify $\varphi_j = (1+a)^{qj}\chi_{D_j(f)}$. Then, taking into account the fact that the sets $\{D_j(f)\}_{j\in G}$ are disjoint, we obtain
\begin{equation}\label{2.16}
\|h(f)\|_q^q = \sum_{j\in G} \|\varphi_j\|_1,\qquad \|S(h(f),\xi)\|_q^q =\sum_{j\in G} \frac{1}{m}\sum_{\nu=1}^m |\varphi_j(\xi^\nu)|.
\end{equation}
Inequalities (\ref{2.12}) follow from (\ref{2.16}), (\ref{2.15}), and (\ref{2.14}). This completes the proof of Theorem \ref{T2.1}.

\begin{Remark}
	The same technique of the proof gives a slightly more general statement. Namely, suppose $q,\alpha\in[1,\infty)$ and that a subspace $X_N$ satisfies the condition
	\[
	\varepsilon_k(X^q_N,L_\infty) \le  B (N/k)^{\alpha/q}, \quad 1\leq k\le N,
	\]
	where $B\ge 1$.
	Then for large enough constant $C(\alpha,q)$ there exists a set of
	$$
	m \le C(\alpha,q)N^\alpha B^{q}(\log_2(2BN))^2
	$$
	points $\xi^j\in \Omega$, $j=1,\dots,m$,   such that for any $f\in X_N$
	we have
	$$
	\frac{1}{2}\|f\|_q^q \le \frac{1}{m}\sum_{j=1}^m |f(\xi^j)|^q \le \frac{3}{2}\|f\|_q^q.
	$$
\end{Remark}

\section{Discussion}
\label{D}

In this section we discuss the Marcinkiewicz-type discretization theorems for the hyperbolic cross trigonometric polynomials. For $\mathbf s\in\mathbb Z^d_+$
define
$$
\rho (\mathbf s) := \big\{\mathbf k \in \mathbb Z^d : [2^{s_j-1}] \le |k_j| < 2^{s_j}, \quad j=1,\dots,d\big\},
$$
where $[x]$ denotes the integer part of $x$. We define the step hyperbolic cross
$Q_n$ as follows
$$
Q_n := \cup_{\mathbf s:\|\mathbf s\|_1\le n} \rho(\mathbf s)
$$
and the corresponding set of the hyperbolic cross polynomials as
$$
\mathcal T(Q_n) := \big\{f: f=\sum_{\mathbf k\in Q_n} c_\mathbf k e^{i(\mathbf k,\mathbf x)}\big\}.
$$
It is worth mentioning that
$|Q_n|\asymp 2^n n^{d-1}$.
The following theorem was proved in \cite{VT159}.
\begin{Theorem}\label{T3.2} For any $d\in {\mathbb{N}}$ and $n\in {\mathbb{N}}$ for large enough absolute constant $C_1(d)$ there exists a set of  $m \le C_1(d)|Q_n|n^{7/2}$ points $\xi^j\in \mathbb T^d$, $j=1,\dots,m$ such that for any $f\in \mathcal T(Q_n)$
we have
$$
C_2\|f\|_1 \le \frac{1}{m}\sum_{j=1}^m |f(\xi^j)| \le C_3\|f\|_1.
$$
\end{Theorem}
The proof of Theorem \ref{T3.2} from \cite{VT159} is based on conditional Theorem \ref{T2.1} with $q=1$ and the bounds for the entropy numbers. We note that the problem of estimating the entropy numbers in the $L_\infty$ norm is a nontrivial problem by itself. We demonstrate this on the example of the trigonometric polynomials. It is proved in \cite{VT156} that in the case $d=2$
we have
\begin{equation}\label{6.1}
\varepsilon_k(\mathcal T( Q_n)_1,L_\infty)\ll  n^{1/2} \left\{\begin{array}{ll} (| Q_n|/k) \log (4| Q_n|/k), &\quad k\le 2| Q_n|,\\
2^{-k/(2| Q_n|)},&\quad k\ge 2| Q_n|.\end{array} \right.
\end{equation}
The proof of estimate (\ref{6.1}) is based on an analog of the Small Ball Inequality for the trigonometric system proved for the wavelet type system (see \cite{VT156}). This proof uses the two-dimensional specific features of the problem and we do not know how to extend this proof to the case $d>2$. Estimate (\ref{6.1}) is used in the proof of the right order  upper bounds  for
the classes of mixed smoothness (see \cite{VT156}). This means that (\ref{6.1}) cannot be substantially improved. However, in application to the Marcinkiewich-type theorem we use the trivial inequality $\log (4| Q_n|/k) \ll n$ and the following corollary of (\ref{6.1})
\begin{equation}\label{6.2}
\varepsilon_k(\mathcal T( Q_n)_1,L_\infty)\ll  n^{3/2} \left\{\begin{array}{ll} | Q_n|/k , &\quad k\le 2| Q_n|,\\
2^{-k/(2| Q_n|)},&\quad k\ge 2| Q_n|.\end{array} \right.
\end{equation}
It turns out that the following upper bound from \cite{Bel}, which applies for all $d$, gives a better result for the Marcinkiewich-type theorem: for $1\le q\le 2$ we have
\begin{equation}\label{6.3}
\varepsilon_k(\mathcal T( Q_n)_q,L_\infty)\ll  n^{1/q} \left\{\begin{array}{ll} | Q_n|/k , &\quad k\le 2| Q_n|,\\
2^{-k/(2| Q_n|)},&\quad k\ge 2| Q_n|.\end{array} \right.
\end{equation}
A combination of (\ref{6.3}) and Theorem \ref{T2.1} gives the following Marcinkiewich-type theorem for the hyperbolic cross trigonometric polynomials.

\begin{Theorem}\label{T3.3} Let $1\le q\le 2$. There is a number $C(d,q)$ such that for any $n\in {\mathbb{N}}$ there   exists a set of $m \le C(d,q)|Q_n| n^{3}$ points $\xi^j\in \mathbb T^d$, $j=1,\dots,m$ such that for any $f\in \mathcal T(Q_n)$
we have
$$
\frac{1}{2}\|f\|_q^q \le \frac{1}{m}\sum_{j=1}^m |f(\xi^j)|^q \le \frac{3}{2}\|f\|_q^q.
$$
\end{Theorem}

We note that Belinsky \cite{Bel} obtained an analog of Theorem \ref{T3.3} with a somewhat weaker bound $m\le C(d,q)|Q_n| n^{4}$. Also, the corresponding proof in \cite{Bel} contains some inaccuracies.

 We point out that the situation with the discretization theorems in the $L_\infty$ case is fundamentally different. A  nontrivial surprising negative result was proved for the $L_\infty$ case (see \cite{KT3}, \cite{KT4}, and \cite{KaTe03}). The authors proved that the necessary condition for
$\mathcal T(Q_n)\in\mathcal M(m,\infty)$ is $m\gg |Q_n|^{1+c}$ with absolute constant $c>0$.
We refer the reader to \cite{DPTT} for further results on discretization in the $L_\infty$ norm.

  {\bf Acknowledgment.} The work was supported by the Russian Federation Government Grant N{\textsuperscript{\underline{o}}}14.W03.31.0031. The paper contains results obtained in frames of the program
 ``Center for the storage and analysis of big data'', supported by the Ministry of Science and High Education of Russian Federation (contract 11.12.2018N{\textsuperscript{\underline{o}}}13/1251/2018 between the Lomonosov Moscow State University and the Fond of support of the National technological initiative projects).
The first named author's research was partially supported by NSERC of Canada Discovery Grant RGPIN 04702-15.
The second named author's research was partially supported by NSERC of Canada Discovery Grant RGPIN 04863-15.
The fourth named author's research was supported by the Russian Federation Government Grant No. 14.W03.31.0031.
The fifth  named
author's research was partially supported by
 MTM 2017-87409-P,  2017 SGR 358, and
 the CERCA Programme of the Generalitat de Catalunya.

Classical Analysis and ODEs (math.CA); Numerical Analysis (math.NA)


On homometric sets in graphs

Abstract: For a vertex set $S\subseteq V(G)$ in a graph $G$, the {\em distance multiset}, $D(S)$, is the multiset of pairwise distances between vertices of $S$ in $G$. Two vertex sets are called {\em homometric} if their distance multisets are identical. For a graph $G$, the largest integer $h$, such that there are two disjoint homometric sets of order $h$ in $G$, is denoted by $h(G)$. We slightly improve the general bound on this parameter introduced by Albertson, Pach and Young (2010) and investigate it in more detail for trees and graphs of bounded diameter. In particular, we show that for any tree $T$ on $n$ vertices $h(T) \geq \sqrt[3]{n}$ and for any graph $G$ of fixed diameter $d$, $h(G) \geq cn^{1/ (2d-2)}$.

\section{Introduction}

For a vertex set $S\subseteq V(G)$,
the {\em distance multiset}, $D(S)$,  is the multiset of pairwise distances
between vertices of $S$ in $G$ .
 We say that two vertex sets
are {\em homometric} if their distance sets are identical.
``How large could two disjoint homometric sets be in a graph?" was a question of Albertson, Pach and Young~\cite{APY}.
Formally,  for a graph $G$, the largest integer $h$, such that there are  two disjoint homometric sets $S_1, S_2$ in $G$ with
$|S_1|=|S_2|=h$, is denoted by $h(G)$.
For a family of graphs $\mathcal{G}$, $h(\mathcal{G})$ denotes the largest
value of $h$ such that for each graph $G$ in $\mathcal{G}$, $h(G) \geq h$.
Let $h(n)$ be $h(\mathcal{G}_n)$, where $\mathcal{G}_n$ is the set of all graphs on $n$ vertices.
In  other words, $h(n) = \min \{h(G): |V(G)|=n\}$.   Albertson, Pach and Young \cite{APY}  provided the most general bounds.
\begin{thm} [\cite{APY}]
$\frac{c \log{n}}{\log{\log{n}}} < h(n) \le \frac{n}{4}$ for $n > 3$, and a constant $c$.
\end{thm}

It is an easy observation that $h(G) = \lfloor |V(G)|/2 \rfloor$ when $G$ is a path or $G$ is a cycle.
However, more is known. Note that the multisets of distances for a vertex subset of
a path corresponds to a multiset of pairwise differences between elements of a subset  of positive integers.
We shall say that two subsets of integers are homometric if their multisets of pairwise differences coincide.
Among others, Rosenblatt and Seymour~\cite{RS}
proved that  two multisets  $A$ and $B$ of integers  are homometric if and only if
there are two multisets $U, V$ of integers such that  $A= U+V$ and $B=U-V$,
where $U+V$ and $U-V$ are multisets, $U+V= \{u+v: ~ u\in U, ~ v\in V\}$,   $U-V= \{u-v: ~ u\in U, ~ v\in V\}$.
Lemke, Skiena and Smith~\cite{LSS} showed that if $G$ is a cycle of length $2n$,
then every subset of $V(G)$ with $n$ vertices and its complement are homometric sets.
Suprisingly, when the class $\mathcal{G}$  of graphs under consideration is not a path or a cycle, the problem of finding $h(\mathcal{G})$
becomes nontrivial. Even when $\mathcal{G}$  is a  class of $n$-vertex graphs that are the unions of pairs of paths sharing a single point, $h(\mathcal{G})$
is not known.   Here, we use standard graph-theoretic terminology, see for example \cite{bollobas} or \cite{west}.

The homometric set problem we consider here has its origins in Euclidean geometry,
with applications in X-ray crystallography introduced in the 1930's with later applications in restriction site mapping of DNA.
In particular, the fundamental problem that was considered  is whether one could identify a given set of points from its multiset of distances.
There are several related directions of research in the area, for example the question of
recognizing the multisets corresponding to
a multiset  of distances realized by a set of points in the Euclidean space of given dimension, see ~\cite{matousek}.

In this paper,  we provide the new bounds on  $h(\mathcal{G})$  in terms of densities and diameter,  we also investigate this function for various classes
of graphs, in particular for trees.
In Section \ref{Main-Results} we state our main results.
We give the basic constructions of homometric sets
in Section \ref{Constructions}.
We provide the proofs  of the main results in Section~\ref{Proofs}.
Finally, in Section \ref{More-Trees},  we give additional bounds for $h(T)$, when $T$ is a tree in terms of its parameters.

 \section {Main Results} \label{Main-Results}

  Let  $\mathcal{T}_n$ the set of all trees on $n$ vertices.
 A {\it spider} is a tree that is a union of vertex-disjoint paths, called {\it legs} and
a vertex that is adjacent to one of the endpoints of each leg, called the {\it head}.
Let $\mathcal{S}_{n,k}$ be the set of $n$-vertex spiders with $k$ legs and
 $\mathcal{S}_n$ be the set of all $n$-vertex spiders.
A {\em caterpillar} is a tree,  that is a union of a path, called {\it spine}, and leaves adjacent to the spine.
Let  $\mathcal{R}_n$ be the set of all caterpillars on $n$ vertices.
Finally, a {\it haircomb} is a tree, that consists of a path called the {\it spine} and a collection of vertex-disjoint
paths, called legs,  that have an endpoint on the spine.
Let $\mathcal{H}_n$ be the set of haircombs on $n$ vertices.
 Here, we slightly improve the known general bounds of $h(G)$,  provide new bounds on $h(G)$  in terms of
 density and diameter, and give several results for $h(T)$ in case when $T$ is a tree.

\begin{thm}\label{upper-bd}
For infinitely many values of $n$, and a positive constant $c$,
$h(n)\le n/4 - c\log{\log{n}}$.
\end{thm}

\begin{thm}\label{diam-kg}
Let $G$ be a graph
on $n$ vertices with $e$ edges, diameter $d$, $n\geq 5$, $d\geq 2$.
If for an integer $k$, $\binom{{k\choose 2}+d-1 }{ d-1} < n - 2k +2$,
then $$h(G) \ge \max\{k,~d/2, ~\sqrt{2e/n}\}.$$
In particular,
$$h(G)\ge \max\{0.5n^{1/(2d-2)},~d/2, ~\sqrt{2e/n}\}$$
for $n\ge c(d) = d^{2d-2}.$
\end{thm}

\noindent
Since it is well known, see \cite{bollobas}, that almost all graphs $G(n,p)$ have diameter $2$,
the above theorem implies that for almost every graph $G=G(n,p)$,  $h(G_{n,p}) = \Omega(\sqrt{n})$.

In the following theorems, we omit ceilings and floors for simplicity.

\begin{thm}\label{trees-weaker-bd}
For a positive integer $n$, $h(\mathcal{T}_n)\ge n^{1/3} -1$.
 \end{thm}

\begin{thm}\label{special}
For a positive integer $n$,   $h(\mathcal{R}_n) \geq n/6$, $h(\mathcal{H}_n) \geq \sqrt{n}/2$.
\end{thm}

\begin{thm}\label{spiders}
For positive integers $n$,  $k$,   such that $k<n$,
\begin{equation}\nonumber
 h(\mathcal{S}_{n,k}) \ge
\begin{cases}
\frac{5}{12}n,& k=3,\\
\frac {1}{3}n, &  k=4,\\
\left(\frac{1}{4} + \frac{3}{8k-12}\right)n, & k\ge 5.
\end{cases}
\end{equation}
Moreover, $h(\mathcal{S}_{n,n/2}) = (n+2)/4$, and   $h(T) = n/2$ for any $T\in \mathcal{S}_{n,3}$ with
legs on $l_1, l_2, l_3$ vertices if $l_1+1=t(l_2-l_3)$  for an odd integer $t\ge 1$ or if
$l_1 = l_2 = l_3$.
\end{thm}

 The following two theorems are corollaries of previously known number-theoretic and graph-theoretic results.

\begin{thm}\label{dense-case}
For every fixed $\alpha > 0$ and for every $\epsilon > 0$ there exists $N=N(\alpha, \epsilon)$
so that for all $n > N$, if $G$ is a graph on $n$ vertices, diameter $2$ and at most $n^{2-\alpha}$ edges or
at least $\binom{n}{2} -  n^{2-\alpha}$ edges, then
$h(G) \geq n/2-\epsilon n$.
\end{thm}

\begin{thm} \label{general-diam2}
Let $G$ be  a graph with diameter $2$ and  even number of vertices $n\geq 90$. Let  $V_i = \{v\in V: \deg(v)=i\}$.
If $G$ satisfies one of the following conditions:\\
1) $|\{i: |V_i|\, \text{ is odd}\}|>n/2$,\\
2) $|V_i|$ is even for each $i$, \\
then $h(G) = n/2$.
\end{thm}

 \section{ Constructions and definitions}\label{Constructions}

In the remaining part of the paper,
we may omit the floor and ceiling of fractions for simplicity. For a tree $T$,  and its vertex $r$, let   $P=P(T, r)$ be a partial order on the vertex set
of a tree $T$, such that $x<y$ in $P$ if the $x$,$r$-path in $T$ contains $y$.
We call this an $r$-{\it order} of $T$ and say that $T$ is $r$-ordered.
A vertex $y$  is a {\it parent} of  $x$ in $P(T, r)$,   and  a vertex $x$ is a {\it child} of $y$  if $x < y$ and there is no other element $z$
such that $x < z < y$. If neither $x< y$ nor $y< x$ for two elements $x$ and $y$ in $P(T,r)$,
then we say that $x$ and $y$ are {\it noncomparable}.  An {\it antichain} is defined as a set of pairwise noncomparable elements.
A pair of vertices $x$ and $y$ are called {\it siblings} if they have the same parent.  \\

For a vertex $x$  of degree at least $3$ in a tree $T$, the connected components of  $T-x$   that are paths are called {\it pendent } paths of $x$.
The endpoints of these paths adjacent to $x$ in $T$ are called {\it attachment} vertices.
A vertex $x$ of degree at least $3$ is called {\it bad} if it has an odd number of pendent paths.
Moreover, let a shortest pendent path corresponding to a bad vertex $x$ be called a {\it bad path}.\\

We call a tree $T'$ a {\it cleaned} $T$ if $T'$ is obtained from $T$
by removing the  vertices of all bad paths.
A tree $T''$ is called {\it trimmed} $T$ is it is obtained from $T$ by removing the
vertices of  all bad paths and  removing  all the vertices except for the attachment vertices of all remaining pendent paths of $T$.\\

Let $bad(T)$, $bad_3(T)$ be the number of bad vertices, and the number of bad vertices of degree $3$ in $T$, respectively.
Let $bad_l(T)$ be the total number of vertices in bad paths of $T$.
Let $N_i(x)$ be the set of vertices at distance $i$ from a vertex $x$.
For two disjoint sets $A',A''\subseteq V(G)$,
let $D(A',A'')$ be the multiset
of distances in $G$ between pairs $u'$ and $u''$, $u'\in A'$, $u''\in A''$.  \\

  \begin{construction} \cite{APY}\label{c-apy}
  Let $G$ be a graph and $G'=(v_1, \ldots, v_{2t})$ be a shortest $v_1$,$v_{2t}$-path in $G$, for some $t\geq 1$.
  Let $S_1= \{v_1, \ldots,  v_ t\}$, $ S_2  = \{  v_{ t +1}, \ldots, v_{2t}\}$.
  Since both $S_1$ and $S_2$ induce shortest paths of the same length, they form homometric sets.
  \end{construction}

  \begin{construction}\label{balanced-ptn}
  Let $T$ be a tree and $S$ be an antichain in $P(T,r)$  such that each vertex in $S$,
has a  sibling  in $S$.  Let   $S'_1, \ldots, S'_k$ be the maximal families of siblings in $S$.
Let $S'_i = A_i\cup B_i\cup C_i$, where $A_i, B_i, C_i$ are disjoint, $|A_i|=|B_i|$, $|C_i| \leq 1$, $i=1, \ldots, k$.
Let $S_1= A_1\cup A_2 \cup \cdots \cup A_k$, $S_2= B_1\cup B_2\cup \cdots \cup B_k$.
The sets $S_1$ and $S_2$ are homometric. See Figure~\ref{hom-set}.
\end{construction}

\begin{figure}[h]
\begin{center}
\vspace{-0.4cm}
\includegraphics[scale=0.4]{distinguishing-leveled-tree.eps}
\vspace{-.8cm}
\end{center}
\caption{{\small Example of Construction~\ref{balanced-ptn}
with $S_1$ and $S_2$ consisting of black and hollow vertices, respectively. }}
\label{hom-set}
\end{figure}

\begin{construction}\label{three-legs}
Let $T\in \mathcal{S}_{n,3}$ with head $v$ and legs $L_1, L_2, L_3$
on $l_1, l_2, l_3$ vertices,
respectively, $l_1\ge l_2.$
Let $L_3$ be a path $v_1,\dots,v_{l_3}$,
where $v_{l_3}$ is a leaf of $T$.
Let $S_1$ be the set consisting of $v$, the vertices
$v_{2i}$, $1\le i\le \lfloor l_3/2\rfloor$ and
$l_2-1$ vertices in $L_1$ closest to $v$.
Let $S_2$ be the set consisting of the vertices
$v_{2i-1}$, $1\le i\le \lfloor l_3/2\rfloor$
and $V(L_2)$.
The sets $S_1$ and $S_2$ are homometric
(see Figure~\ref{spider}(b)).
\end{construction}

\begin{construction}\label{three-legs-special}
Let $T\in \mathcal{S}_{n,3}$ with head $v=v_0$ and legs $L_1, L_2, L_3$ on
$\ell_1, \ell_2, \ell_3$ vertices, respectively, $l_1>l_2.$
Let $L_3$ be a path $v_1,\dots,v_{l_3}$,
where $v_{l_3}$ is a leaf of $T$. Let $l_1 - l_2 = x>0$, $l_3+1 = bx + r$, where $b$ and $r$ are integers, $0 \leq r  < x$.
If $b$ is odd, let $a=b-1$ and if $b$ is even, let $a=b$.
Let  $P_i = \{v_{ix},\dots,v_{ix+x-1}\}$ for $0 \le i \le a$.
Let $S_1$ be the union of  $P_{2i}$, $0\le i\le a/2$ and $V(L_2)$.
Let $S_2$ be the union of $P_{2i-1}$, $1\le i\le a/2$ and $V(L_1)$.
The sets $S_1$ and $S_2$ are homometric
(see Figure~\ref{spider}(c)).
\end{construction}

Construction~\ref{three-legs-special} is not used in any of the proofs here.
However, it hints that for a tree $T\in \mathcal{S}_{n,3}$,
$h(T)$ can be very close to $n/2$,
depending on the optimized value of $x$.

\begin{construction} \label{k-legs}
Let $T$ be a spider with head $v$ and $k$ legs
$L_1,L_2,\dots,L_k$, $k\ge 3$,
on $\ell_1 \geq \ell_2 \geq \cdots \geq \ell_k$ vertices, respectively.
Let  $A_i =V(L_{2i})$, let
$B_i$ be the set of $|A_i|$ vertices closest to $v$ in $L_{2i-1}$ , $i= 1, \ldots, \lfloor k/2 \rfloor=m$.
Then let $S_1 = A_1 \cup A_2\cup \cdots \cup A_m$, $S_2 = B_1 \cup B_2\cup \cdots \cup B_m$.
Clearly $S_1$ and $S_2$ are homometric sets (see Figure~\ref{spider}(d)).
\end{construction}

\begin{figure}[h]
\vspace{-.5cm}
\begin{center}
\centering
\includegraphics[scale=0.4]{spiders5.eps}
\end{center}
\vspace{-3.cm}
\caption{{\small Examples of homometric sets in spiders using  Constructions~\ref{c-apy}, \ref{three-legs}, \ref{three-legs-special} (with $x=2$, $a=4$) and \ref{k-legs}, respectively.
Two homometric sets consist of  black and hollow vertices, respectively. }}
\label{spider}
\end{figure}

We shall say that two integers are {\it almost equal} if they differ by $1, 0$, or $-1$.~
\begin{thm}[Karolyi~\cite{karolyi}]\label{kar}
Let $X$ be a set of $m$ integers, each between $1$ and $2m-2$.  If $m\geq 89$, then one can partition $X$ into two sets, $X_1$ and $X_2$  of almost equal sizes such that
the sum of elements in $X_1$ is almost equal to the sum of elements in $X_2$.
\end{thm}

\begin{thm}[Caro, Yuster~\cite{caroyuster}]\label{num-edges}
For every fixed $\alpha > 0$ and for every $\epsilon > 0$ there exists $N=N(\alpha, \epsilon)$
so that for all $n > N$, if $G$ is a graph on $n$ vertices and at most $n^{2-\alpha}$ edges
then there are two vertex  disjoint subgraphs of the same order and size with at least
$n/2-\epsilon n$ vertices in each of them.
\end{thm}

\section{Proofs of main results} \label{Proofs}

\begin{definition}
For a graph $H$, we say that $G$ is an {\bf $(H, m, v)$-flower}  with a path $P$ if
 $G$  is a vertex-disjoint union of $H$ and an $m$-vertex  path $P$ with endpoint $v$,
 together with all edges between $V(H)$ and $v$.
\end{definition}

  \begin{lem}\label{flower}
 Let $G$ be an $(H, m, v)$-flower with a path $P$.
If $S_1$ and $S_2$ are homometric sets of $G$, where $|S_1|=|S_2| \geq 2$,
 then  either $S_1\cup S_2 \subseteq V(P) \cup \{u\}$, $u \in V(H)$ or
 $S_1\cup S_2 \subseteq V(H) \cup \{v, v_1\}$, where $v_1$ is the neighbor of $v$ in $P$.
  \end{lem}

  \begin{proof}
Let $P$ be a path of a flower.  Let $S_1, S_2$ be homometric sets in $G$ of size at least $2$ each.
Assume that $(S_1\cup S_2)  \cap V(P) \neq \emptyset$ and $(S_1\cup S_2)  \cap V(H) \neq \emptyset$.
Note that $D(V(H))$ consists of $1$s and $2$s.

Consider the vertex $x\in (S_1\cup S_2)\cap V(P) $,  farthest  from $v$,  at a distance at least $2$ from $v$.
Without loss of generality,  $x\in S_1$.  If there is $x'\in S_1\cap V(H)$ then there is no pair of vertices in $S_2$
with the distance equal to the distance between $x$ and $x'$. Thus, $S_1\cap V(H)= \emptyset$.
Let $a$ be the largest distance in $D(S_1)$, $a\geq 3$.
Let $y \in S_2 \cap V(H) $, let $y'$ be at a distance $a$ from $y$, $y \in V(P)$.
Note that $a$ appears exactly once in $D(S_1)$ and thus it appears exactly once in $D(S_2)$.
Since all vertices from $V(H)$ are at the same distance from $y$, there is exactly one vertex $y' \in S_2 \cap V(H)$.
  \end{proof}

\begin{proof}[Proof of Theorem~\ref{upper-bd}]

For a fixed integer $k$,
let $a_0, a_1,\ldots, a_k$ be a  sequence  of integers such that
$a_0 = 1$,  $a_1\geq  5$ and each $a_i$, $i\ge 2$, is the smallest odd number satisfying
$$
a_i > 4 \left( 1+\sum_{j=1}^{i-1}{a_j+1\choose 2}\right).
$$
Let  $n=  2(a_1+\dots +a_k) - k/4$.
Let $H$ be a  vertex-disjoint union of cliques on $a_1, a_2, \ldots, a_k$ vertices, respectively.
Let the vertex sets of these cliques be $Q_1, Q_2, \ldots, Q_k$, respectively.
Note that $a_j> 4\sum_{i=0}^{j-1}a_i$ for $j\ge 1$, which implies that
\begin{equation}\label{vx-sum}
a_j\ge \frac{4}{5}(\sum_{i=0}^j a_i).
\end{equation}

Let $G$ be an $(H, n/2 - k/8,  v)$-flower with a path $P$.
Note that $k = c \log\log n$, for a constant $c$.
This construction of $G$ is inspired by an example given by Caro and Yuster in~\cite{caroyuster}.  \\

Let $S_1$, $S_2$ be largest homometric sets in $G$.  By Lemma \ref{flower},
$S_1\cup S_2 \subseteq V(P) \cup \{u\}$, $u \in V(H)$ or
 $S_1\cup S_2 \subseteq V(H) \cup \{v, v_1\}$, where $v_1$ is the neighbor of $v$ in $P$.
~\\

{\it Case 1~~}  $S_1\cup S_2 \subseteq V(P) \cup \{u\}$, $u \in V(H)$. \\
 Then $h(G) \leq  (|V(P)|+1)/2 = n/4-k/16 +1/2 = n/ 4 - c\log\log n$,  for a positive constant $c$.\\

 {\it Case 2~~}  $S_1\cup S_2 \subseteq V(H) \cup \{v, v_1\}$, where $v_1$ is the neighbor of $v$ in $P$.\\
  Let $\{v_1\} = Q_0$, then $S_1\cup S_2$ is a vertex subset of a join of vertex-disjoint cliques on sets $Q_0, \ldots, Q_k$ and $\{v\}$.
 Since $G[V(H) \cup \{v, v_1\}]$ is a graph of diameter $2$, $S_1$ and $S_2$ induce the same number of edges in $G$.
For $i =0, \ldots, k$, let $ Q_i' = Q_i \cup \{v\}$ if $v\in S_1\cup S_2$, and let $Q_i'=Q_i$ if $v\not\in S_1\cup S_2$.

 If $v\not\in S_1\cup S_2$ and  for all $j$, $|S_1\cap Q'_j|= |S_2 \cap Q'_j|$, then,
since $Q_j$ has odd size,  $ (S_1 \cup S_2) \cap Q_j  \neq Q_j$,  and
  $h(G) \leq (|V(H)|-k)/2 = n/4  + k/16 - k/2 =  n/2 - c' \log\log n$, for a positive constant $c'$.
 If $v\in S_1\cup S_2$ and  for all $j$,  $|S_1\cap Q'_j| = |S_2 \cap Q'_j|$, then  $|S_1|\neq |S_2|$, since $v\in Q'_j$ for all $j$.
So,we can assume that there is $j$, for which $|S_1\cap Q'_j|\neq |S_2 \cap Q'_j|$.
Let $j$ be the largest such index and  let $Q'_j=Q$.

Assume first that $j\le k/2-2$ and $ v\not \in S_1\cup S_2$.
For each $i>j$, $(S_1 \cup S_2) \cap Q_i \neq Q_i$. Thus $h(G)\le (n/2 + k/8 - k/2+2)/2 = n/4 - c \log\log n$,  for a positive constant $c$.

Now assume that $j\le k/2-2$ and $ v \in S_1\cup S_2$.  Without loss of generality, let $v\in S_1$.
Let  ${\bf Q}=  Q_0 \cup \cdots \cup Q_{j}$,  ${\bf Q'}=  Q_{j+1} \cup \cdots \cup Q_{k}$.
Then $|S_2\cap {\bf Q'}|-|S_1\cap {\bf Q'} |  \ge k-j-1 \ge k/2+1$.
Since $|S_1\cap ({\bf Q}\cup  {\bf Q'}\cup \{v\}) |= |S_2\cap ({\bf Q}\cup  {\bf Q'}\cup \{v\}) |$,   \quad
$|{\bf Q}| \geq -|S_2\cap {\bf Q}| +  |S_1\cap {\bf Q}|  \geq  k/2.$
Therefore, \eqref{vx-sum} implies that
$a_j/2\ge \frac{4}{10}|{\bf Q}| \geq  \frac{2}{5} (k/2)\ge k/5.$ \\
So, we have that either $a_j/2\ge k/5 $ or that $j\geq k/2+2$.
In any case, we have that $a_j/2\ge k/5$.

If $|Q- (S_1\cup S_2)| \geq a_j/2 $,
then $h(G)\le (n/2 + k/8 - a_j/2 )/2\le (n/2 +k/8 - k/5)/2\leq n/4 - c\log\log n $, for a positive constant $c$.
Otherwise,   $|Q\cap (S_1\cup S_2) | >a_j/2$.
Then,  the number of edges induced by $S_1 \cap Q$ differs from the
number of edges induced by $S_2 \cap Q$ by at least $a_j/4$.
The number of edges induced by $S_1 \cap  ({\bf Q'}\cup \{v\})$ is
the same as number of edges induced by $S_2 \cap   ({\bf Q'}\cup \{v\})$.
The total number of edges induced by ${\bf Q}\cup \{v\}$ is at most
$ 1+\sum_{i=1}^{j-1}{a_i+1\choose 2}< a_j/4$.  Thus $S_1$ and $S_2$ can not induce the same number of edges, a contradiction.
 \end{proof}

\begin{proof}[Proof of Theorem~\ref{diam-kg}]

The fact that $2h(G) \geq d$ follows from Construction \ref{c-apy}.   For positive integers $k,n$ ($k<n$),  the {\em Kneser graph} $KG(n,k)$ is a graph on the vertex set ${[n]\choose k}$
whose edge set consists of pairs of  disjoint $k$-sets.
Lov\'asz~\cite{lovasz} proved that the chromatic number of the Kneser graph $KG(n,k)$
is $n-2k+2$.
We fix $k\le n/2$ and consider the Kneser graph $\mathcal{K} = KG(n,k)$.
Considering a graph $G$ with vertex set $[n]$,
we define a coloring of $\mathcal{K}$
by letting the distance multiset of each $k$-subset of $V(G)$ be
the color of the corresponding vertex in $\mathcal{K}$.
Since any vertex pair in $G$ has distance in $\{1,\dots,d\}$,
the number of possible colors that are used on $\mathcal{K}$
is at most ${{k \choose 2}+d-1 \choose d-1}$.
If
\begin{equation}\label{kn-aim}
{{k \choose 2}+d-1 \choose d-1} < n-2k+2,
\end{equation}
then  there are
two adjacent vertices of the same color in $\mathcal{K}$ that
correspond to a pair of disjoint $k$-subsets of $V(G)$ that are homometric. \\

\noindent
Note that when $d=2$, we have ${{k \choose 2}+d-1 \choose d-1} = {k \choose 2}+1< n -2k+2$
for  $k = \sqrt{n}$.\\

\noindent
Let  $v\in V(G)$ be a vertex of a maximum degree $\Delta(G)$. The closed neighborhood
$N[v]$ induces a graph of diameter $2$. Moreover, for any two vertices in $N[v]$,
the distance between them in $G$ is the same as in $G[N[v]]$.
As before, we see that  (\ref{kn-aim}) with $d=2$ and $n= \Delta$ holds for  $k \geq \sqrt{\Delta(G)}$.
Therefore,  $h(G[N[v]]) \geq \sqrt{\Delta(G)}\geq  \sqrt{(2e/n)+1}$.
This proves the first part of the theorem.\\

\noindent
To prove the second statement of the theorem,  we  assume that $d\ge 3$ and  $n\ge d^{2d-2}$ and show
 that  for any $k$, such that $d/2 < k\le 0.5n^{1/(2d-2)}$, the inequality  \eqref{kn-aim} holds.

Since $d-1 \le k^2/2$, \;$2^{d-2}\le (d-1)!$, and  $k\le 0.5n^{1/(2d-2)}\le n/4$,  we have that
 $${{k \choose 2}+d-1 \choose d-1}<  \frac{\left({k \choose 2}+d-1\right)^{d-1}}{(d-1)!} \le    \frac{(k^2)^{d-1}}{(d-1)!  }\le \frac{(k^2)^{d-1}}{2^{d-2}}
  \le \frac{n}{2^{d-2}}\le \frac{n}{2}\le n-2k + 2. $$
Therefore, there are homometric sets of size $k$ for any $k$,
$d/2\le k\le 0.5n^{1/(2d-2)}$.
\end{proof}

 \begin{lem}\label{lem-main}
Let $T$ be a tree, $r$ be its vertex,  and $S$ be an antichain in $P(T,r)$  such that
each vertex $ S$, has a  sibling  in $S$.  Let $k'=k'(S)$
be the number of maximal odd sets of siblings in $S$.
Then
$$
2h(T) \geq \max\left\{\diam(T)+1,~ |S|-k',~ \frac{2}{3}|S|,  ~
d_1(T) - bad(T), ~\frac{n}{\diam(T)} - bad(T), ~\frac{n-  bad_l(T)}{\diam(T)}\right\}.$$
\end{lem}

 \begin{proof}
The fact that $2h(T) \geq \diam(T)+1$ and $2h(T) \geq |S|-k'$ follows immediately from Constructions \ref{c-apy} and \ref{balanced-ptn}.
Since each maximal family of siblings in $S$ has at least two elements,
$k' \leq |S|/3$, thus $2h(T) \geq 2|S|/3$. \\

\noindent
For any tree $\mathcal{T} $, Dilworth's theorem applied to $P(\mathcal{T} )$ implies that the size
of a  maximum antichain in $P(\mathcal{T} )$  is  at least $n/ \diam(\mathcal{T} ).$
The set of leaves is a maximum antichain of $P(\mathcal{T} )$, thus $d_1(\mathcal{T} ) \ge n/\diam(\mathcal{T} ).$\\

\noindent
Let $T'$ be trimmed $T$.
Since $T'\subseteq T$, $h(T) \geq h(T')$.
Let $S$ be the set of leaves of $T'$. Note that $|S|= d_1(T')= d_1(T)- bad(T)$.  Moreover,
since $T'$ has no bad vertices, $k'(S)=0$ in $T'$.   So,  $2h(T) \ge |S| - k'(S) = d_1(T)  - bad(T) \ge {n}/{\diam(T)} - bad(T).$\\

\noindent
Let $T''$ be cleaned $T$. We have that
$|V(T) \setminus V(T')| = bad_l(T)$, moreover, $T''$ has no bad vertices.
Thus $2h(T) \geq 2h(T'') \geq |d_1(T'')|\ge (n - bad_l (T))/\diam(T'')\geq (n-bad_l(T))/\diam(T)$.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{trees-weaker-bd}]
Assume that $v$ is a vertex contained in the center of $T$ and
let $t = \lceil \diam(T)/2\rceil$.  Let $P=P(T, v)$.
We define a partition
$V(T) = N_0 \cup N_1\cup N_2 \cup \dots \cup N_t$,
where $N_i=N_i(v)$.  So, $N_i$ is an antichain in $P$, $i=1, \ldots, t$.
Since $h(T)\ge t$, we can assume that $t \leq n^{1/3} -1$, and thus  $\diam(T)\le 2n^{\frac{1}{3}}-2$.
Let  $x$ be the smallest integer such that $|N_i| \le |N_{i-1}|+x-1$  for $1\le i \le t$. Then
$n = 1+ \sum_{i=1}^t |N_i| \le 1+ \sum_{i=1}^t ix\leq   x (t+1)^2/2.$

Since $t \le n^{1/3}-1$, by the above inequality we have $x \ge 2n^{1/3} $.
For some $j$, $1\le j \le t$, $|N_j| - |N_{j-1}| = x-1$.
 Let $S$ be a largest  subset of $N_j$  such that each vertex in $S$ has a sibling in $S$.
 Recall that  $k'(S)$ is  the number of maximal sets of siblings in $S$ of odd size, i.e.,
 $k'(S)$ is the number of vertices of $N_{j-1}$ with odd number of neighbors in $N_j$.

So, $|S|-k'(S) \geq |N_j|-|N_{j-1}| = x-1 \geq 2n^{1/3} -1$.
By  Lemma~\ref{lem-main}, $h(T)  \ge  n^{1/3} - 1$.
\end{proof}

\begin{proof}[Proof of Theorem \ref{special}]
Let $T$ be a caterpillar on $n$ vertices and
assume that its spine $P$ has at least $n/3$ vertices.
Then, by Theorem \ref{diam-kg}, $h(T)\ge n/6$.
If $P$ has less than $n/3$ vertices, then
there are at least $2n/3$ leaves.
Assume that there are exactly $k$ vertices on the spine with degree at least 4,
label them as $v_1,\dots,v_k$.
Apply Lemma \ref{lem-main} to a set $S$ consisting of leaves incident to a vertex in
$v_1, \ldots, v_k$.
Then $k'(S)\le k$ and
 $
2h(T)\ge  |S| - k'(S) \ge (n - |V(P)|) - k   \ge   n - 2|V(P)| \ge \frac{n}{3}.
$\\

 \noindent
 Let $T$ be a haircomb with $m$ vertices on its spine
and $k$ spinal vertices, where $k\le m$.
We denote the length of the $i$th leg of $T$ with $l_i$.
Since $(k+1)\max(l_1,\dots,l_k,m) \ge m+\sum_1^k l_i = n$,
either $k+1 \ge \sqrt{n}$ implying $m\ge k+1 \ge \sqrt{n}$ or
$l_i\ge \sqrt{n}$ for some $i$, which implies that $\diam(T)\ge \sqrt{n}$.
By Theorem \ref{diam-kg}, $2h(T) \ge \sqrt{n}$.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{spiders}]
~\\
Let $m$ be an integer such that $k=2m$ or $k=2m+1$.
Using Construction \ref{k-legs}, we see that
\begin{equation}\label{spdr-bd}
2h(G) \geq n- \left[ (l_1-l_2) + (l_3-l_4 ) + \ldots + (l_{2m-1}-l_{2m}) + x +1\right] \geq  n- l_1+l_{2m}-x-1,
\end{equation}
where $x= 0$ if $k$ is even and $x= l_k$ if $k$ is odd.
This observation is used in the following cases.

\begin{itemize}
\item{}  Let  $k=3$. Let $\min(l_1 - l_2, l_2 - l_3) = cn$ for some $c \ge 0$, where $l_1\ge l_2\ge l_3.$
By Construction \ref{three-legs},  we have $ 2h(T) \ge n - cn$.
Without loss of generality,  assume that $l_1 - l_2  =cn$.
 Then  $l_1 = l_2 + cn$ and $l_2 \ge l_3 + cn$ by our assumption and therefore,
$ n = l_1 + l_2 + l_3 +1 \ge 3l_3 + 3cn$.
This implies that $l_3\le (n - 3cn)/3$ and by Lemma \ref{lem-main},
$2h(T) \ge l_1 + l_2 + 1 = n - l_3  \ge 2n/3 + cn$.
Thus $$2h(\mathcal{S}_{n,3}) \geq
\min_{0\leq c\leq 1} \max\left\{n - cn,  \frac{2n}{3} + cn \right\}
\ge 5n/6.$$

\item{} Let  $k=4$.   We have  $ 2h(T) \ge \diam(T)+1\ge l_1 + l_2+1$ and
\eqref{spdr-bd} provides that $2h(T)\ge n - (l_1 - l_4) - 1$.
Adding these inequalities gives that
$4h(T) \ge n + l_2 + l_4. $
By letting $l_2 + l_4 = c'n$, for some $c'$, $0\leq c'\leq 1$,
we rewrite this bound as
$4h(T) \ge (1+c')n .$
On the other hand,
$2h(T) \ge \diam(T) +1 \ge l_1 + l_3 + 1 = (1 - c')n$.
Thus,
$$2h(\mathcal{S}_{n,4}) \geq \min_{0\leq c'\leq 1}
\max\left\{\frac{(1+c')n}{2},  (1 - c')n\right\}\ge 2n/3.$$

\item{} Let $k \geq 5$. Let $T$ be a spider on $n$ vertices with $k$ legs
having  $\ell_1\geq \ell_2 \geq \cdots \geq \ell_k$ vertices, respectively,  and the head  $v$.
Observe that $l_2\ge (n-l_1-1)/(k-1)$.  Assume that $2h(T) = cn$ for some $c>0$.
By Lemma \ref{lem-main},  $2h(T) = cn \ge \diam(T)+1 \ge l_1+l_2+1\ge l_1 + (n-l_1-1)/(k-1) + 1.$
Thus, $-l_1 \ge n(1-ck+c)/(k-2)+1.$  Using \eqref{spdr-bd},
$cn = 2h(T) \ge n-l_1-1 \ge n +  \frac{n(1-ck+c)}{k-2}.$
Since $k$ is fixed, this implies that $c\ge 1/2 + 3/(4k-6),$ i.e., $h(T) \ge n/4 + 3n/(8k-12).$

The bound $h(\mathcal{S}_{n,k}) \geq (n+2)/4$ for $k\ge 5$
is attained by a spider  $T$ with $n/2$ single-vertex  legs,  and one leg, $P$,  with $n/2-1$ vertices.
If $H$ is an empty graph on  $n/2$ vertices, then $T$ is an $(H,   n/2-1, v )$-flower, where $v$ is the head of $T$.
 Let $S_1, S_2$ be homometric sets of $T$.
Then by Lemma~\ref{flower},
$S_1\cup S_2 \subseteq V(H) \cup \{v, v_1\}$ or $ S_1\cup S_2 \subseteq V(P)\cup \{v, u\}$, where $u\in V(H)$, $v_1\in V(P)$ is adjacent to $v$.
In the first case, we can easily see that $v \not\in S_1\cup S_2$, so  $2h(T) \leq n/2+1$.
\end{itemize}
\end{proof}

\begin{proof}[Proof of Theorem~\ref{dense-case}]
In a graph with diameter at most $2$,
any two distinct vertices are at  distance   $1$ or $2$.
Therefore, Theorem~\ref{num-edges} implies this result.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{general-diam2}]

 First, we give a fact observed in \cite{caroyuster} stating that
 if $A\subseteq V(G)$ and $\sum_{v \in A }\deg(v) = \sum_{v \not\in A} \deg(v)$ then
$|E(G[A])|=|E(G[V-A])|$.   To see this,  note that
$|E(G[A])|=(1/2)  ((\sum_{v \in A} \deg(v)) - |E(A, V-A)|)$ and
$|E(G[V-A])|=(1/2) ((\sum_{v\in V- A} \deg(v))  - |E(A, V-A)|).$
So, the difference of these two numbers is
$ \frac{1}{2} [\, \sum_{v \in A }\deg(v) -\sum_{v \not\in A} \deg(v)\,] = 0$.

\noindent
Let $\mathcal{D} = \{0,1,\dots,\Delta(G)\}$
and $i \in \mathcal{D}$.
Let
$$V_i = \{v\in V: \deg(v)=i\}, \quad V_i = A_i\cup B_i \cup S_i,$$
where $A_i, B_i, S_i$ are disjoint,  $|S_i|\leq 1$ and $|A_i|=|B_i|$.
I.e., split $V_i$ into two equal parts if possible, and otherwise,
put a remaining vertex into a set $S_i$.

\noindent
 Let $$A' = \bigcup _{i \in \mathcal{D}} A_i,
\quad  B'= \bigcup_ {i \in \mathcal{D}} B_i,
\quad S= \bigcup_{i \in \mathcal{D}} S_i.$$
 So, $V(G) = A'\cup B'\cup S$.  Let $s(G) =|S|$.
 We shall show that there are disjoint  subsets $A, B$ of $n/2$ vertices each, such that
$\sum_{v\in A} \deg(v) = \sum_{v\notin A} \deg(v)$, i.e.,
$A$ and $B$ induce the same number of edges in $G$.

If $|V_i|$ is even for each $i$, let $A= A'$ and $B= B'.$

Now, assume that $m=|\{i: |V_i|\, \text{ is odd}\}|>n/2.$
Note that all vertices in $S$ have distinct odd degrees $a_1, a_2, \cdots, a_m $,
say $1\leq a_1 <a_2 <\cdots < a_m <n$, and since $m> n/2$, $n<2m.$
Note also that $m$ is even, since the total number of vertices of odd degree is even.
So, we could apply Theorem~\ref{kar}
and split $\{a_1, \ldots, a_m\}$ in two parts,
$U$ and $U'$  of equal sizes and with almost equal sums.
Since
$\sum _{v\in V} \deg(v) = \sum _{v\in A'} \deg(v)  +
\sum _{v\in B'} \deg(v) + \sum_{v\in S} \deg(v) =
2\sum_{v\in A'} \deg(v) + \sum_{v\in S} \deg(v)$, and
this degree-sum is even, it follows that $\sum_{v\in S} \deg(v)$ is even.
Thus $\sum_{i=1}^{m} a_i =\sum_{v\in S} \deg(v)$ is even,
and the sum of elements in $U$ is exactly equal to the sum of elements in $U'$.
Let
$$A'' = \{ v\in S: \deg(v) \in U\},\quad B'' = \{v\in S: \deg(v) \in U'\}.$$
Finally, let $A= A' \cup A''$ and $B = B'\cup B''.$
\end{proof}

\section{More results on trees}\label{More-Trees}

For a tree $T$, let $d_i=d_i(T)$ be the number of vertices of degree $i$.

\begin{lem}\label{bound-sib}
~\\
a) $ d_1 - bad(T) \ge 2+ \sum_{i\ge 4} d_i$,\\
b)  $d_1 \ge 2/3 ( n - d_2 - d_3)$,  and \\
c) $\sum_{i\ge 4} d_i \le (1/3) (n - d_2 - d_3)$.
\end{lem}
\begin{proof}
Observe first that $d_1 = 2+ \sum_{i\ge 3}d_i(i-2)$.
Thus $d_1 \ge 2 + \sum_{i\ge 4} 2d_i.$

Since bad vertices have degree at least $3$,  we have
that  $bad(T) \le  d_3 + \sum_{i\ge 4} d_i$, so $ d_1 - bad(T) \geq   2+ \sum_{i\ge 4} d_i$.
We also have that  $d_1\ge \sum_{i\ge 4} 2d_i = 2(n - d_1 - d_2 - d_3)$,  thus  $d_1 \ge 2/3 ( n - d_2 - d_3).$
To show the last inequality, observe that $\sum_{i\ge 4} d_i = n- d_1-d_2-d_3$, so using (b),
$\sum_{i\ge 4} d_i = n- d_1-d_2-d_3 \geq n- 2/3 ( n - d_2 - d_3) -(d_2 +d_3) = 1/3 ( n - d_2 - d_3).$
\end{proof}

\begin{thm}\label{general-trees}
Let $T$ be a tree on $n$ vertices.
Then  $h(T) = \Omega(\sqrt{n})$ if one of the following holds: \\
a) $bad(T) = o(\sqrt{n})$, \\
b) $bad_3(T) =o(\sqrt{n})$ and $bad(T)= \Omega(\sqrt{n})$, \\
c) $bad_l(T) = o(n)$.\\
Moreover $h(T) \geq \max\{(n- d_2 - 4 d_3)/6, (n-d_1-d_2)/(\diam(T)+1)\}.$
 \end{thm}

\begin{com}
 There are trees on $n$ vertices, such as double haircombs,
for which our proof techniques do not provide
bounds of the order of magnitude $\sqrt{n}$.
A {\it double haircomb}  is constructed  from a haircomb  by attaching
vertex-disjoint paths to the vertices of the legs, see Figure~\ref{dhcomb}.
By appropriately choosing the distances between the vertices of degree $3$,
one can construct an $n$-vertex double haircomb
$T$, such that  $bad_3(T)   \geq c\sqrt{n}$,  $bad_l(T)\geq c'n$ for some constants $c, c'>0$ and
$\diam(T) = o(\sqrt{n}).$
 \end{com}

\begin{figure}[h]
\begin{center}
\vspace{-.4cm}
\includegraphics[scale=0.4]{double-haircomb.eps}
\vspace{-2.4cm}
\caption{{\small A double haircomb.}}
\label{dhcomb}
\end{center}
\end{figure}

\begin{proof}[Proof of Theorem~\ref{general-trees}]

To prove the first part of the theorem, we assume throughout the proof that $\diam(T) = o(\sqrt{n})$,
otherwise by Lemma \ref{lem-main}, $h(T) =\Omega(\sqrt{n})$.

\begin{itemize}
\item{}  $bad(T) = o(\sqrt{n}).$
By Lemma~\ref{lem-main},
$2h(T) \ge n/\diam(T) - bad(T) = \Omega(\sqrt{n})$.

\item{}  $bad_3(T) = o(\sqrt{n})$ and $bad(T)=\Omega(\sqrt{n}).$ \\
By Lemma \ref{bound-sib}, $d_1 - bad(T)\ge \sum_{i\ge 4} d_i \ge bad(T) - bad_3(T) = \Omega(\sqrt{n}).$
Lemma  \ref{lem-main} implies that $2h(T) =  \Omega(\sqrt{n})$.

\item{} $bad_l(T) = o(n).$
By Lemma~\ref{lem-main},
$h(T) \ge (n - bad_l(T))/\diam(T) = \Omega(\sqrt{n})$.
\end{itemize}

To prove  the second part of the theorem,  we use Lemma~\ref{lem-main} and
Lemma \ref{bound-sib}-(b),(c).
We have that
$2h(T)\ge d_1 - bad(T) \ge (d_1 -\sum_{i\ge 4} d_i) - d_3
\ge 1/3 (n - d_2 - d_3) - d_3 = 1/3 (n - d_2 - 4d_3) $.

Let $S$ be the set of vertices with degree at least $3$ in $T$,   $|S| = n- (d_1+d_2)$.
Let $r$ be a leaf in $T$, $V(T) = N_0 \cup N_1\cup N_2 \cup \dots \cup N_t$,
where $N_0 = \{r\}$, $N_i=N_i(r)$ and $t = \lceil \diam(T)/2 \rceil$.
There is an $i\in [t]$  such that $|N_i(r)\cap S|  \ge |S|/t$.
Let $L=N_i(r)\cap S$.
We have $|L| \ge (n - d_1 - d_2)/t \ge 2(n-d_1-d_2)/(\diam(T)+1).$
Let the set of children of $L$ with respect to $P(T,r)$ be $L'$.
Since each vertex in $S$ and thus in $L$ has degree at least three,  $|L'|\ge 2|L|$.
Using Lemma~\ref{lem-main} and the fact that $k'(L')\le |L|$,
we have  $h(T)\ge (|L'| - k'(L'))/2 \ge (2|L| - |L|)/2 = |L|/2\ge (n-d_1-d_2)/(\diam(T)+1).$
\end{proof}

\section{Concluding Remarks}

The definition of homometric sets allows for little control over what pairs of vertices realize what distance.
This makes proving the upper bounds on $h(n)$ difficult.  One may consider another definition for two sets being homometric.
For a graph $G$,  let  $K(G)=(V(G), c)$  be a complete graph on vertex set $V(G)$ with an edge-coloring $c$, where
$c(u,v)$ is equal to the distance between $u$ and $v$ in $G$.
Let two disjoint sets $S_1,S_2\subset V(G)$ be {\it similar} if
there is an isomorphism between $K(G)[S_1]$ and $K(G)[S_2]$.
Note that there may be homometric sets that are not similar.
Let $T$ be a spider with four long legs of equal length, let
 $S_1$ consist of four vertices on distinct legs with distances 2,2,2,6
to the head of the spider, respectively,
let $S_2$ be the set of four vertices - one is the head, three other are on three distinct
legs with distance $4$ to the head.  Although $D(S_1) = D(S_2)= \{4,4,4, 8,8,8\}$,
$S_1$ and $S_2$ are not similar, since  there is a triangle  with all edges colored $4$ in $K(G)[S_1]$ and
there is a triangle with all edges  colored $8$ in $K(G)[S_2]$.

\section{Acknowledgements}
The authors thank Michael Young
for pointing out one of the special cases in Theorem~\ref{spiders}.

\bibliographystyle{amsplain}

On homometric sets in graphs