Geometry of a Set and its Random covers

Abstract: Let $E$ be a bounded open subset of $\mathbb{R}^n$. We study the following questions: For i.i.d. samples $X_1, \dots, X_N$ drawn uniformly from $E$, what is the probability that $\cup_i \mathbf{B}(X_i, \delta)$, the union of $\delta$-balls centered at $X_i$, covers $E$? And how does the probability depend on sample size $N$ and the radius of balls $\delta$? We present geometric conditions of $E$ under which we derive lower bounds to this probability. These lower bounds tend to $1$ as a function of $\exp{(-\delta^n N)}$.The basic tool that we use to derive the lower bounds is a good partition of $E$, i.e., one whose partition elements have diameters that are uniformly bounded from above and have volumes that are uniformly bounded from below. We show that if $E^c$, the complement of $E$, has positive reach then we can construct a good partition of $E$. This partition is motivated by the Whitney decomposition of $E$. On the other hand, we identify a class of bounded open subsets of $\mathbb{R}^n$ that do not satisfy this positive reach condition but do have good partitions.In 2D when $E^c\subset \mathbb{R}^2$ does not have positive reach, we show that the mutliscale flat norm can be used to approximate $E$ with a set that has a good partition under certain conditions. In this case, we provide a lower bound on the probability that the union of the balls almost covers $E$.

\section{Discussion}

Our work opens up several computational and theoretical questions for further exploration.
Given the reliance of our results on good partitions, can we design an efficient algorithm to compute a finite partition $\{R_i\}$ of given closed bounded set $E$ with nonempty interior where each $R_i$ is a union of dyadic cubes of a certain diameter such that $\mathcal{L}^n\myell E(R_i) \geq \epsilon$ and $\mathrm{diam}(R_i\cap E) \leq \delta$ for given $\epsilon, \delta > 0$?

The bound $\displaystyle P(B(\mathbb{X}, \delta) \supset E) \geq 1 - \sum_{R \in \mathcal{R}} \exp(-\mathcal{L}^n(R)N)$ in Equation (\ref{eq:probLB}) motivates the development of methods to find minimizers of
$\displaystyle \sum_{R \in \mathcal{R}} \exp(-\mathcal{L}^n(R)N)$
over all partitions $\mathcal{R}$ of $E$ with $\mathrm{diam}(R) \leq \delta$ and $\mathcal{L}^n(R) \geq \epsilon$ for all $R \in \mathcal{R}$.
We also want to use dyadic grids of $\mathbb{R}^n$ to obtain our allowed partitions of $E$.

Our results on $\alpha$-almost partitions of $E$ that allow samples to \emph{almost} cover $E$ with high probability lead to the natural question of computing estimates of $\mathcal{L}^n(E\setminus E\circ B_r)$ as a function of $r$.
Relating the geometry of $E$ to the size of $\mathcal{L}^n(E\setminus E \circ B_r)$ would give us conditions under which an $\alpha$-almost cover can be guaranteed to exist.

\section{Introduction}
We investigate relationships between the geometry of bounded open subsets $E$ of $\mathbb{R}^\dmn$ and the probability
\begin{align}\label{eq:probability}
P(\mathbf{B}(\mathbb{X}, \delta) \supset E)
\end{align}
that the $\delta$-neighborhood $\mathbf{B}(\mathbb{X}, \delta) := \{y \in \mathbb{R}^\dmn : \mathrm{dist}(y, \mathbb{X}) \leq \delta\}$ (for $\delta > 0$) of a random sample $\mathbb{X} = \{X_j\}_{j=1}^N$ of $E$ will cover $E$.
How does this probability increase as we increase $N$ or $\delta$?
Ideally, we seek results that hold without any restrictive assumptions on $E$ being ``nice'', e.g., it being convex.
We derive new lower bounds on $P(\mathbf{B}(\mathbb{X}, \delta) \supset E)$ under the assumption that $E^c$, the complement of $E$, has positive \emph{reach}.
The reach of a subset $A$ of Euclidean space is a measure of geometric regularity of $A$.
It has played an indispensable role in areas such as signal processing and machine learning~\cite{niyogi2008finding, verma2012distance}.
In our work, the importance of reach is evident in Lemma \ref{lem:opening},
where assuming that the reach of $E^c$ is positive allows us to construct a partition $\mathcal{R}$ of $E$ whose elements are not too small in measure and not too large in diameter.

This Lemma is used in Theorem \ref{thm:reach} to provide a lower bound to the probability in Equation (\ref{eq:probability}), which depends on $\delta$, the cardinality of our partition, and the number of samples $N$.
In practice, knowledge of the cardinality of $\mathcal{R}$ can be used to determine the number of samples needed to ensure a high probability that $\mathbf{B}(\mathbb{X}, \delta)$ covers $E$.

We now state the Lemma and Theorem for convenience of the reader.
{
\renewcommand{\thetheorem}{\ref{lem:opening}}
  \begin{lemma}
Let $E$ be a bounded open subset of $\mathbb{R}^\dmn$.
	If
	\[\mathrm{reach}(E^c) > \rho > 0,\]
	then for any $0 < \delta < \rho$, there exists a finite partition $\mathcal{R}$ of $E$ such that
	\begin{align*}
		\mathcal{L}^\dmn(R) \geq \frac{\delta^\dmn}{\dmn^{\dmn/2}}\quad \mathrm{and} \quad \mathrm{diam}(R) \leq 3\delta\quad \mathrm{for\ all}\ R \in \mathcal{R}.
	\end{align*}
  \end{lemma
}

{
\renewcommand{\thetheorem}{\ref{thm:reach}}
  \begin{theorem}
If $E$ is a compact subset of $\mathbb{R}^\dmn$ with $\mathrm{reach}(E^c) > \rho > 0$, then for any $\delta \in (0, \rho)$ there exists a natural number $M = M(\delta, E)$ such that for any independently and identically distributed sampling $\mathbb{X}_N = (X_i)_{i = 1}^N$ of $E$,
\begin{align*}
P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) \geq 1 - M\exp\left(\frac{-\delta^\dmn}{\dmn^{\dmn/2}\mathcal{L}^\dmn(E)} N\right),
\end{align*}
and therefore,
\begin{align*}
P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) \to 1 \qquad \text{ as } \qquad N\to \infty.
\end{align*}
  \end{theorem
}

\vspace*{-0.07in}
\noindent Note that $P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) \to 1$ also when $\delta$ increases by the factor of $\exp{(-\delta^\dmn)}$.

Although Lemma~\ref{lem:opening} and Theorem~\ref{thm:reach} only apply to bounded open subsets whose complements has positive reach, we study certain classes of open sets that admit lower bounds for the covering probability~(\ref{eq:probability}) but do not necessarily have complements with positive reach (Section \ref{sec:beyondwhitney}).
The first class of open sets are used in Corollary~\ref{cor:UminusA}, where we consider open subsets $E = F\setminus A$ of $\mathbb{R}^\dmn$ where $\mathcal{L}^\dmn(A)$, the $\dmn$-dimensional Lebesgue measure of $A$,
is small and $F^c$ has positive reach.
Intuitively, one should be able to use the partition elements of $F$ obtained in the proof of Lemma~\ref{lem:opening} to get the partition elements of $E$.
The only change to the lower bound of the covering probability~(\ref{eq:probability}) is due to the fact that any partition element from the construction in Lemma~\ref{lem:opening} will be missing $\mathcal{L}^\dmn(A)$ amount of its volume.

We obtain a class of open subsets in $\mathbb{R}^2$ that admit lower bounds to a probability closely related to the covering probability~(\ref{eq:probability}) using the \emph{multiscale flat norm} \cite{IbKrVi2013} from Geometric Measure Theory (Section \ref{sec:flatnormR2}).
Theorem~\ref{prop:flatnormsufficient} states that if $E \subset \mathbb{R}^2$ is a set of finite perimeter and if a minimizer $S_\lambda$ of the multiscale flat norm $\mathscr{F}_\lambda(\partial E)$ satisfies certain properties, then $E$ has a high probability of \emph{almost} being covered by the neighborhood of the samples.
{
\renewcommand{\thetheorem}{\ref{prop:flatnormsufficient}}
  \begin{theorem}
Let $E \subset \mathbb{R}^2$ be an open set of finite perimeter.
If $\lambda > \Lambda_E$ and $\delta > 0$ are picked such that
\[\mathcal{L}^2(S_\lambda) < \frac{\delta^2}{2}\quad \text{ and } \quad 0 < \delta < \frac{1}{5\lambda} \quad \text{ for } \quad S_\lambda \in \mathscr{F}_\lambda(\partial E),\]
then for $A := E\cap (E- S_\lambda)$ and $\alpha_\delta := \delta^2/2\mathcal{L}^2(E)$ there exists a good $\alpha_\delta$-almost partition $\mathcal{R}_{A}$ of $E$ where
\begin{align*}
P\left(\frac{\mathcal{L}^2(\mathbf{B}(\mathbb{X}, 3\delta) \cap E)}{\mathcal{L}^2(E)} \geq 1 - \alpha_\delta\right) \geq 1 - M\exp\left(\frac{-(\delta^2 2^{-1} - \mathcal{L}^2(S_\lambda))}{\mathcal{L}^2(A)} N\right)
\end{align*}
where $N$ is the number of samples in $\mathbb{X}$ and $M$ is the cardinality of $\mathcal{R}_{A}$.
\end{theorem}
}

In the case that $E = F \setminus A$ where $F^c$ has positive reach, $\mathcal{L}^\dmn(A)$ is small, and $A$ is supported away from the boundary of $E$ (similar to the $E$ in Corollary~\ref{cor:UminusA}), in Theorem~\ref{thm:fnreach} we prove that for a certain range of scales, the \emph{flat norm minimizer} $S_\lambda$ of $\mathscr{F}_\lambda(\partial E)$ is equal to $A$, and in particular can be used to ``fill'' $E$ back in with $F = E + S_\lambda$.
{
\renewcommand{\thetheorem}{\ref{thm:fnreach}}
  \begin{theorem}
Let $E = \mathbf{E}^2\myell (U \setminus A)$ where $U$ is a bounded, open subset of $\mathbb{R}^2$ with $\mathrm{reach}(\partial U)$ $> \rho > 0$, and let $W$ be an open, compactly supported subset of $U$.
If
\begin{align*}
0 < 2/\lambda < \rho,
\end{align*}
then
\begin{align*}
\exists \delta > 0\ \text{such that if } A \subset\subset W \text{ with } \mathcal{L}^2(A) < \delta,\ \text{ then } \partial (\mathbf{E}^2 \myell U) \in \mathrm{arg\,}\mathscr{F}_\lambda(\partial E).
\end{align*}
  \end{theorem
}
In the context of the previous results, we note that $\mathrm{reach}(U^c) \geq \mathrm{reach}(\partial U)$, and that Theorem~\ref{thm:fnreach} requires the stronger assumption that $\mathrm{reach}(\partial U) > \rho > 0$.
We also note that this result is not a corollary of Theorem~\ref{prop:flatnormsufficient},
but is a result that presents an important example of how the multiscale flat norm works on the first class of open sets studied in Section \ref{sec:beyondwhitney}.

\subsection{Related work}

Problems on coverage by balls centered at random points are well studied in stochastic geometry \cite{ChStKeMe2013}.
The related topic of topology of random \v{C}ech or geometric complexes is an active area of research \cite{BoKa2018,BoWe2017}.

Janson studied a version of the problem where the sample $\mathbb{X}$ is drawn from a larger set $F$ such that $E \subset F^o$, its interior, thus avoiding the need to deal with boundary issues \cite{Ja1986}.
Finding the expected Hausdorff distance between random samples of uniform distributions and their support is closely related to our problem, and has been studied in general metric measure spaces.
Reznikov and Saff~\cite[Theorem 2.1]{reznikov2016covering} gave a result for a finite positive Borel measure $\mu$ supported on a metric space $(\mathscr{X}, m)$ that also satisfies
$\mu(\mathbf{B}(x, r)) \geq \Phi(r)$ for all $x \in \mathscr{X}$ and all $r < r_0$
for some $r_0 > 0$, and for some non-negative, strictly increasing, continuous function $\Phi : (0, \infty) \to \mathbb{R}$ satisfying $\lim_{r \to 0}\Phi(r) = 0$.
Their result states that if $\mu$ satisfies the above criteria, there exists constants $c_1, c_2, c_3$ and $\alpha_0$ such that for any $\alpha > \alpha_0$,
\begin{align}\label{eq:probpaper}
P\left[\sup_{y \in E} \mathrm{dist}(y, \mathbb{X}_N) \geq c_1\,\Phi^{-1}\left( \frac{\alpha \log N}{N}\right)\right] &\leq c_2\,N^{1 - c_3\alpha}.
\end{align}
As stated, their theorem requires $\Phi(r)$ to be positive \emph{for all} $x \in \mathscr{X}$.

We describe how our two main theorems relate to this work.
Our Lemma~\ref{lem:opening} applies to $\mu = \mathcal{L}^\dmn\myell E$ for a set $E$ such that its complement $E^c$ has positive reach.
Indeed this implies that $E$ may not, also, contain isolated points.
However, our proof is simple enough to easily see how removing any set of small $\mathcal{L}^\dmn$-measure from $E$ will effect our analogous bound~(\ref{eq:problowerbound}) of Theorem~\ref{thm:reach}.
The effect of removing such a set of small measure is discussed after the proof of Theorem~\ref{thm:reach}, and is stated with inequality~(\ref{eq:problowerbound2}).
In Theorem~\ref{thm:fnreach}, we show how we may use the multi-scale flat norm on certain types of ``badly behaved'' sets $E\subset \mathbb{R}^2$ (the metric measure space $(E, ||\cdot||_2, \mathcal{L}^2\myell E)$ may not admit a strictly decreasing $\Phi$ such that $\mathcal{L}^2\myell E(\mathbf{B}(x, r)) \leq \Phi(r)$ for all $x \in E$)
to identify a nice enough set that can partition with the method of Lemma~\ref{lem:opening}.

Our work is related to the following {\it random coverage problem}.
For a compact region $E$ in $\mathbb{R}^\dmn$, what is the probability that $E$ is fully covered by a union of balls of radius $r$ centered on $N$ points placed independently and uniformly on $E$ in the limit as $N \to \infty$ and as $r(N) \to 0$ in an appropriate manner?
Penrose~\cite{penrose2021random} gives a limiting behavior of the probability $P\left[R_{N, k} < r(N)\right]$
for any $k \in \mathbb{N}$ as one increases the number of sample points $\mathbb{X}_N$ and for any decreasing sequence $r(N) \to 0$ as $N\to \infty$, where $R_{N, k}$ denotes the smallest radius necessary for $\{\mathbf{B}(x, R_{N, k})\}_{x \in \mathbb{X}_N}$ to cover $E$ $k$-times.
These results hold when $E$ has {\it smooth boundary} for $n \geq 2$, or when $E$ is a polytope for $n \leq 3$.
In our work, we give quantitative results on the probability~(\ref{eq:probability}) where, in contrast, we do not consider covering $E$ more than a single time and where $\delta$ is \emph{independent} of $N$.
Furthermore, our general dimensional results hold for bounded open subsets of $\mathbb{R}^\dmn$ with complements of \emph{positive reach}.
There are several classes of sets that have complements of positive reach but do not have smooth boundary,
e.g., when $E$ consists of two disks with intersecting interiors.
And unlike most previous work, we also study sets that may not satisfy the positive reach condition, but could be \emph{almost} covered.

\section{Background}

Since we use only elementary results on probability, most of this section provides relevant background from geometric measure theory.
For the concepts that are closely related to \emph{reach}, we use the notation from Federer's seminar paper~\cite{federer-1959-1} on \emph{curvature measures}.
For concepts related to \emph{currents}, we use the notation in Federer's comprehensive treatise on \emph{Geometric Measure Theory}~\cite{federer-1969-1} as well as Vixie's paper on properties of flat norm minimizers~\cite{Vi2007}.

\noindent We denote open balls of radius $r$$>$$0$ centered at $x \in \mathbb{R}^\dmn$ as $\mathbf{U}(x, r)$ and closed balls as $\mathbf{B}(x, r)$.

\setcounter{theorem}{0}

\begin{definition}
  Let $E$ be an open bounded subset of $\mathbb{R}^\dmn$ and suppose that $\mathbb{X} = (X_i)_{i = 1}^N$ are independently and identically distributed random variables with respect to the uniform distribution of $\Omega$.
i.e., $X_i\sim \mathrm{Unif}(\Omega)$ for all $i = 1,\dots, N$.
\end{definition}

\subsection{Sets of positive reach}

Let us now go over some definitions and properties about sets with positive reach.
While we may not use all of these properties in our proofs, we nevertheless state them since they give helpful intuition to the reader.

\begin{definition}\label{def:reach}
We define the {\bfseries distance function} $\delta_A :\mathbb{R}^\dmn\to \mathbb{R}$ of a subset $A$ of $\mathbb{R}^\dmn$ as
\[\delta_A(x) = \mathrm{dist}(x, A) := \inf_{a \in A} |x - a| \, \text{ for } x \in \mathbb{R}^\dmn.\]
In addition, we define
\[\mathrm{Unp}(A)\]
to be the set of all points $x \in \mathbb{R}^\dmn$ such that there exists a unique point of $A$ nearest to $x$, and the {\bfseries nearest point map} $\xi_A: \mathrm{Unp}(A) \to A$ as the one
mapping $x\in \mathrm{Unp}(A)$ to the unique $a \in A$ such that $\delta_A(x) = |x - a|$.

If $a \in A$, then
\[\mathrm{reach}(A, a) = \sup\{r : \mathbf{U}(a, r) \subset \mathrm{Unp}(A)\}.\]
In addition, we define the {\bfseries reach} of $A$ to be
\[\mathrm{reach}(A) = \inf\{\mathrm{reach}(A, a) : a \in A\}.\]
\end{definition}

\begin{definition}
Let $A\subset \mathbb{R}^\dmn$ and $a \in A$.
We define the {\bfseries tangent cone}
\[\mathrm{Tan}(A, a)\]
{\bfseries  of $A$ at $a \in A$}
to consist of all {\bfseries tangent vectors} $u \in \mathbb{R}^\dmn$ where either $u = 0$, or for every $\epsilon > 0$ there exists a point $b \in A$ such that
\[0 < |b - a| < \epsilon \quad \text{ and } \quad \left| \frac{b - a}{|b - a|} - \frac{u}{|u|}\right| < \epsilon.\]

\noindent We will also consider the {\bfseries normal cone of $A$ at $a \in A$} defined as
\[\mathrm{Nor}(A, a) = \{v \in \mathbb{R}^\dmn : v \cdot u \leq 0,\text{ for any } u \in \mathrm{Tan}(A, a)\},\]
whose elements are called {\bfseries normal vectors of $A$ at $a\in A$}.
\end{definition}

The following fact was stated by Federer~\cite[\text{Remark 4.20}]{federer-1959-1}, and was proven by Lytchak~\cite[\text{Proposition 1.4}]{lytchak2005almost}.
If $A\subset \mathbb{R}^\dmn$ is a topological manifold of dimension $0 < k < n$ and $\mathrm{reach}(A) > 0$ then $A$ is a $k$-dimensional $C^{1,1}$ submanifold of $\mathbb{R}^\dmn$.
That is, it can be locally represented as the graph of a $C^1$ function whose differential is Lipschitz.

We will use the following property of reach to prove Theorem~\ref{thm:fnreach}.
Its proof may be found in Federer's paper on \emph{Curvature Measures}~\cite{federer-1959-1}, along with the proofs of many other useful properties of reach.

\smallskip
\noindent {\bfseries Theorem 4.8.(2)~\cite{federer-1959-1}.}
If $a \in A$ and $\mathrm{reach}(A, a) > r > 0$, then
\[\mathrm{Nor}(A, a) = \{\lambda v : \lambda \geq 0, |v| = r,\ \xi(a + v) = a\}.\]

\begin{remark}
Let $\Gamma$ be an embedded $C^1$ closed curve in $\mathbb{R}^2$ parameterized by a differentiable injection $\gamma : S^1 \to \mathbb{R}^2$ such that $\gamma(S^1) = \Gamma$ and $\dot{\gamma}(t) \neq 0$ for all $t \in S^1$.
Then for any $t \in S^1$,
\[\mathrm{Tan}(\Gamma, \gamma(t)) = \{\lambda \dot{\gamma}(t) : \lambda \in \mathbb{R}\},\]
and for any $v \in \mathbb{R}^2$ with $v\cdot \dot{\gamma}(t) = 0$,
\[\mathrm{Nor}(\Gamma, \gamma(t)) = \{\lambda v : \lambda \in \mathbb{R}\}.\]
From the above result and Theorem 4.8.(2) of Federer~\cite{federer-1959-1}, we get that if $\mathrm{reach}(\Gamma) > \rho > 0$ then for any $t \in S^1$, $0 < r < \rho$, and for any $v \in \mathbf{U}(0, r) \cap \mathrm{Nor}(\Gamma, \gamma(t))$,
\[\xi(\gamma(t) + v) = \gamma(t).\]
\end{remark}

\begin{definition}\label{def:opening}
We use the following concepts from mathematical morphology.
Let $E, F\subset \mathbb{R}^\dmn$.
The {\bfseries erosion} of $E$ by $F$ is defined as $E\ominus F = \{x \in E : x + F \subset E\}$ and the {\bfseries opening} of $E$ by $F$ is defined as $E\circ F = (E\ominus F) + F$.
See Figure~\ref{fig:erosionandopening} for an illustration.
\end{definition}

\begin{figure}[htp!]
  \centering
  \includegraphics[width=1\linewidth]{erosion_and_opening.pdf}
  \caption{On the left we have a closed cube $Q$.
    The darker region inside $Q$ in the center is $Q \ominus \mathbf{B}(0, r)$, the erosion of $Q$ with the closed ball $\mathbf{B}(0, r)$.
    On the right we have the opening of $Q$ with $\mathbf{B}(0, r)$, which is obtained by taking the Minkowski sum of the dark region from the center figure and $\mathbf{B}(0, r)$.
  \label{fig:erosionandopening}
  }
\end{figure}

\subsection{Currents and the flat norm}

We will be working with $\mathcal{L}^\dmn$-measurable sets $A\subset \mathbb{R}^\dmn$ of finite perimeter with finite $\mathcal{L}^\dmn$-measure.
In the language of \emph{currents}, these are sets where the $\dmn$-dimensional current
\[\mathbf{E}^\dmn\myell A\]
is rectifiable, and where its boundary, $\partial(\mathbf{E}^\dmn\myell A)$ is also rectifiable.
Currents of this type are {\bfseries integral currents} in $\mathbb{R}^\dmn$ and are denoted by $\mathbf{I}_n(\mathbb{R}^\dmn)$.
Here,
\[\mathbf{E}^\dmn = \mathcal{L}^\dmn\wedge \mathbf{e}_1 \wedge \dots \wedge \mathbf{e}_\dmn\]
is the constant $\dmn$-vectorfield on $\mathbb{R}^\dmn$ defined by $\mathbf{E}^\dmn(x) = e_1 \wedge \dots \wedge e_\dmn$ for all $x \in \mathbb{R}^\dmn$, where $\{e_i\}_{i = 1}^\dmn$ forms a standard orthonormal basis of $\mathbb{R}^\dmn$.
For an $\mathcal{L}^\dmn$-measurable subset $A\subset \mathbb{R}^\dmn$, the current $\mathbf{E}^\dmn\myell A$ is defined so that
\[\mathbf{E}^\dmn(\phi) = \int_A \langle e_1 \wedge \dots \wedge e_\dmn, \phi(x)\rangle\, d\mathcal{L}^\dmn x \]
for any differential form $\phi$ of degree $\dmn$ and class $\infty$ that is compactly supported in $\mathbb{R}^\dmn$.

We now define the \emph{multi-scale flat norm}, a tool that we will use in Theorem~\ref{thm:fnreach} to ``fix'' certain types of sets $E^c$ that do not have positive reach.

The \emph{flat norm} was originally introduced by Whitney~\cite{whitney2015geometric} and was later used by Federer and Fleming~\cite{federer-1960-1} as a way to endow currents with a metric with the aim of showing the existence of solutions to what is now called \emph{the oriented Plateau's problem}.
The definition of the flat norm can be found in Federer's book on geometric measure theory~\cite[\S4.1.7.]{federer-1969-1}.
Morgan and Vixie~\cite{MoVi2007} realized that the \emph{$L^1$-Total Variation}
\[F(u) = \int_{\mathbb{R}^\dmn} |\nabla u(x)|\, dx + \lambda \int_{\mathbb{R}^\dmn} |f(x) - u(x)|\, dx\]
for functions $u, f : \mathbb{R}^\dmn\to \mathbb{R}$ of bounded variation is equal to the flat norm on $\partial A$.
In particular, by letting $f$ be the characteristic function of $A$, i.e., $1_A : \mathbb{R}^\dmn\to \mathbb{R}$ is defined to be $1$ when $x \in A$ and $0$ otherwise, minimizing $F(u)$ over functions of bounded variation is equivalent to minimizing
\begin{align}\label{eq:fnfiniteperimeter}
\{\mathrm{Per}(\Sigma) + \lambda\,\mathcal{L}^\dmn(\Sigma \Delta A)\}
\end{align}
over sets of finite perimeter $\Sigma$.
Here, $\Sigma \Delta A = (\Sigma \setminus A) \cup (A\setminus \Sigma)$.
This observation motivated their introduction of the following \emph{multiscale flat norm}, which we will now state in the context of both~(\ref{eq:fnfiniteperimeter}) and Federer's book~\cite[\S4.1.24.]{federer-1969-1}.

\begin{definition}{\bf~\cite{MoVi2007}} \label{def:MFN}
  Let $T$ be an $m$-dimensional current in $\mathbb{R}^\dmn$ and let $\lambda \geq 0$.
  The {\bfseries multiscale flat norm} of $T$ is given by
  \[\mathscr{F}_\lambda(T) = \inf \{\mathbf{M}(T - \partial S) + \lambda\, \mathbf{M}(S)\} \]
  over $(m+1)$-dimensional currents in $\mathbb{R}^\dmn$.

  In the special case that $A\subset \mathbb{R}^\dmn$ is an $\mathcal{L}^\dmn$-measurable set of finite perimeter and $T = \partial (\mathbf{E}^\dmn\myell A)$, it follows by Corollary 4.2.18.~in Federer's book~\cite{federer-1969-1}
  that $\mathscr{F}_\lambda(T)$ is the least number in the set $\{\mathbf{M}(T - \partial S) + \lambda\, \mathbf{M}(S)\}$ taken over $(m+1)$-dimensional rectifiable currents $S$ in $\mathbb{R}^\dmn$ and $m$-dimensional rectifiable currents $T - \partial S$ in $\mathbb{R}^\dmn$.
  In this case, $\mathscr{F}_\lambda(\partial(\mathbf{E}^\dmn\myell A))$ is equal to
  \begin{align}\label{eq:fn2}
    \inf \{\mathrm{Per}(\Sigma) + \lambda\,\mathcal{L}^\dmn(\Sigma \Delta A)\}
  \end{align}
  over sets of finite perimeter $\Sigma \subset \mathbb{R}^\dmn$.

  The class of solutions to $\mathscr{F}_\lambda(T)$ is denoted by $\mathrm{arg}\,\mathscr{F}_\lambda(T)$, and its members will be denoted as $S_\lambda$.
  The class of solutions to~(\ref{eq:fn2}) is
  \[\{\mathrm{spt}(A - S_\lambda) : S_\lambda \in \mathrm{arg}\,\mathscr{F}_\lambda(T)\},\]
  and its members will be denoted by $\Sigma_\lambda$.
\end{definition}

We previously studied  \cite{IbKrVi2013} the multiscale flat norm in the simplicial setting where the currents $T$ and $S$ are represented by $m$- and $(m+1)$-dimensional chains, respectively, in a simplicial complex embedded in $\mathbb{R}^\dmn$.
We showed that the multiscale simplicial flat norm can be computed efficiently for the setting relevant to this paper---where we want to cover an $\dmn$-dimensional set $E$ in $\mathbb{R}^\dmn$---using linear programming.

\section{Whitney-type Decompositions for Probabilistic Covers}\label{sec:whitney}

We start with the following observation about how partitioning $E$ into a finite number of pieces $\mathcal{R} = \{R_i\}_{i = 1}^M$ with a uniform lower bound on the mass of each piece and a uniform upper bound on their diameters allows for a lower bound on the probability that the the neighborhood of our sampling covers $E$.

\begin{definition}
We call a partition $\mathcal{R}_E$ of $E$ a {\bfseries good partition} if for some $\delta > 0$ and $\epsilon > 0$
\begin{align}
\mathrm{diam}(R) &\leq \delta\ \mathrm{for\ all}\ R\in \mathcal{R}_E,\ \mathrm{and}\label{prop:diamupperbound}\\
\mathcal{L}^\dmn(R) &\geq \epsilon\ \mathrm{for\ all}\ R\in \mathcal{R}_E. \label{prop:masslowerbound}
\end{align}
\end{definition}

For simplicity, let us for now assume that $\mathcal{L}^\dmn(E) = 1$.
If we take i.i.d.~samples $\mathbb{X} = X_1, \dots, X_N \sim \mathrm{Unif}(E)$ from $E$, then for any sample point $X \in \mathbb{X}$ and any partition element $R \in \mathcal{R}$, we have that $P(X \notin R) = 1 - \mathcal{L}^\dmn(R)$ and hence $P(\mathbb{X} \cap R = \emptyset) = (1 - \mathcal{L}^\dmn(R))^N \leq \exp(-\mathcal{L}^\dmn(R)N)$.

Subadditivity then tells us that
\begin{align}\label{eq:probLB}
P(\mathbf{B}(\mathbb{X}, \delta) \supset E) &\geq 1 - \sum_{R\in \mathcal{R}}\exp(-\mathcal{L}^\dmn(R)N)\\
&\geq 1 - M\exp(-\epsilon N).
\end{align}

With the goal of bringing geometry into the picture, we aim to derive sufficient and/or necessary geometric conditions on $E$ that will allow us to find a partition $\mathcal{R}$ of $E$ that will satisfy a diameter upper bound property~(\ref{prop:diamupperbound}), and a volume lower bound property~(\ref{prop:masslowerbound}).

Our procedure to find a partition $\mathcal{R}$ of interest initially follows the first parts of the procedure to find the \emph{Whitney decomposition}~\cite[Chapter I\ \S 3.1]{stein1970singular} of $E$.
The Whitney decomposition of $E$ gives us a family $\mathcal{Q}$ of closed cubes that satisfy
\begin{align}
    &E\subset \bigcup_{Q \in \mathcal{Q}} Q;\\
    &\mathbf{int}(Q_i) \cap \mathbf{int}(Q_j) = \emptyset\ \mathrm{for}\ i\neq j;\ \mathrm{and}\\
    &\mathrm{diam}(Q) \leq \mathrm{dist}(Q, E^c) \leq 4\,\mathrm{diam}(Q) \ \mathrm{for\ all}\ Q \in \mathcal{Q},
\end{align}
where $\mathbf{int}(Q)$ denotes the interior of the cube $Q$ and $\mathrm{diam}(Q)$ denotes the diameter of $Q$.

While following Whitney's procedure, we need to make sure that the diameter of each cube is not larger than $\delta$ and that the volume of each cube is larger than $\epsilon$, i.e., does not get too small.
Obtaining the cubes in $\mathcal{Q}$ that satisfy criteria~(\ref{prop:diamupperbound}) is easy since we may further subdivide the large cubes into smaller ones.
The second criteria, however, is a bit harder to satisfy since the diameters, and hence volumes, of the cubes get arbitrarily small as they approach the boundary of $E$.

The next thing we must do is to obtain the cubes $\mathcal{Q}_\delta \subset \mathcal{Q}$ whose diameters are larger than or equal to $\delta > 0$.
Although the union of all cubes in $\mathcal{Q}_\delta$ contains all the points in $E$ which are no less than $5\delta$ away from $E^c$,
we do not have any control over
\[\sup_{y \in E}\mathrm{dist}(y, \cup_{Q \in \mathcal{Q}_\delta} Q)\]
(see Figure~\ref{fig:dumbell_whitney}).
This implies that we might have to consider substantially large neighborhoods around each cube in $Q_\delta$ in order to cover an arbitrary compact subset $E$ of $\mathbb{R}^\dmn$.

\begin{figure}[htp!]
  \centering \includegraphics[width=.8\linewidth]{dumbell_whitney_3.png}
  \caption{The set $E$ as the dumbbell shape with a step in its Whitney decomposition on the right.
  Elongating the neck region would not change the cubes, however, the largest distance $\sup_{y \in E}\mathrm{dist}(y, \cup_{Q\in \mathcal{Q}_\delta}Q)$ from points in $E$ to the cubes becomes larger.
  \label{fig:dumbell_whitney}
  }
\end{figure}

We look to provide sufficient conditions on $E$ so that $\sup_{y \in E} \mathrm{dist}(y, \mathcal{Q}_\delta)$ is small enough.
In particular, if $E$ is equal to the \emph{opening} (see Definition~\ref{def:opening}) of $E$ by the open ball of radius $\delta$, i.e.,
\[E = E \circ \mathbf{U}(0, \delta),\]
we may do the following.
First, consider the lattice $\ell \mathbb{Z}^\dmn$ that defines a family of cubes $\Delta_\ell$, and choose $\ell$ so that the diameter of each cube in $\Delta_\ell$ is $\delta$.
We will know that the union of the $\delta$-neighborhoods of each cube in $\Delta_\ell$ that intersects the \emph{erosion} (see Definition~\ref{def:opening}) of $E$ by $\mathbf{B}(0, \delta)$ will cover $E$.

Although these fattened cubes are not pairwise disjoint anymore, their diameters are bounded above by $3\delta$ and we are easily able to turn them into a partition $\mathcal{R}$ of $E$ with the same diameter bound, and with a lower bound of $\delta^\dmn/(\dmn^{\dmn/2})$ on their volumes.
This argument is detailed in the proof of Lemma~\ref{lem:opening}, where we assume a related condition called \emph{reach}; a concept that was introduced in Federer's seminal paper~\cite{federer-1959-1}.
This relationship is given by the following fact, which follows from~\cite[Lemma 4.8]{rataj2019curvature}.
\emph{If $\mathrm{reach}(E^c) > \rho > 0$, then $E = E\circ \mathbf{U}(0, \rho)$.}
The converse of this fact is, however, not true as can be seen in the following example.

\begin{example}\label{ex:reachandopening}
  Although $\mathrm{reach}(E) = \delta > 0$ implies that $E = E\circ \mathbf{U}(0, \rho)$, the converse is not true.
  For example, let $x, y \in \mathbb{R}^2$ such that $|x - y| = 2R$.
  Then for any $\delta > R$, $E := \mathbf{U}(x, \delta) \cup \mathbf{U}(y, \delta)$ has $\mathrm{Int}\,\mathrm{Reach} < \delta$ but $E = E\circ \mathbf{U}(0, \delta)$.
\end{example}

\begin{remark}
  Although the sufficiency of $E = E\circ \mathbf{U}(0)$ implies that positive reach is also sufficient, reach will still serve an important role in this paper due to reach properties of flat norm minimizers in $\mathbb{R}^2$.
\end{remark}

\begin{lemma}\label{lem:opening}
	Let $E$ be a bounded open subset of $\mathbb{R}^\dmn$.
	If
	\[\mathrm{reach}(E^c) > \rho > 0,\]
	then for any $0 < \delta < \rho$, there exists a finite partition $\mathcal{R}$ of $E$ such that
	\begin{align}
		\mathcal{L}^\dmn(R) \geq \frac{\delta^\dmn}{\dmn^{\dmn/2}}\quad \mathrm{and} \quad \mathrm{diam}(R) \leq 3\delta\quad \mathrm{for\ all}\ R \in \mathcal{R}.
	\end{align}
\end{lemma}
\begin{proof}

  To use the Whitney decomposition on $E$, we first note that since $\mathrm{reach}(E^c) > \rho > \delta > 0$, we have $E = E\circ \mathbf{U}(E, \delta)$.
  By definition, this means that $E$ is the $\delta$-neighborhood of $E^\ast = \{x \in E : \mathrm{dist}(x, \partial E) \geq \delta\}$, the points in $E$ that are at least $\delta$ away from the boundary, i.e., $\mathbf{B}(E^\ast, \delta) = E$.
  This implies that if we are able to find a family $\mathcal{Q}$ of cubes of side lengths $\ell \geq 0$ which covers $E^\ast$, then the collection of all neighborhoods $\mathbf{B}(\mathcal{Q}, \delta) := \{\mathbf{B}(Q, \delta)\}_{Q \in \mathcal{Q}}$ will be a cover of $E$.
  Since the neighborhoods in $\mathbf{B}(\mathcal{Q}, \delta)$ might not be pairwise disjoint, if in addition, our family $\mathcal{Q}$ satisfies
  \begin{align*}
    Q &\subset E \quad \mathrm{and}\quad \mathbf{int}(Q)\cap \mathbf{int}(Q') = \emptyset\quad \mathrm{for\ all}\quad Q\neq Q' \in \mathcal{Q},
  \end{align*}
  then the collection of $\mathbf{B}(\mathcal{Q}, \delta)$ may be used to construct the desired partition $\mathcal{R}$ of $E$ such that its partitioning elements have a uniform upper bound in diameter and lower bound in volume.
  In particular, $\mathcal{R}$ will satisfy
  \begin{align*}
    \mathcal{L}^\dmn(R) \geq \ell^\dmn\quad \mathrm{and}\quad \mathrm{diam}(R) \leq \sqrt{n}\ell + 2\delta \quad \mathrm{for\ all}\quad R\in \mathcal{R}.
  \end{align*}

  Consider an arbitrary ordering of the cubes in $\mathcal{Q} = \{Q_i\}_{i = 1}^M$.
  By way of induction, we first define $R_1$ to be $\mathbf{B}(Q_1, \delta)\cap E$ except for the region of $E$ that is contained by the rest of the cubes, i.e.,
  \[R_1 = [\mathbf{B}(Q_1, \delta)\cap E]\setminus \bigcup_{j = 2}^M Q_j.\]
  Then, for $k = 2, 3, \dots, M$, we similarly define $R_k$ to be $\mathbf{B}(Q_k, \delta)\cap E$ except for the region of $E$ that is contained by the rest of the cubes in $\{Q_j\}_{j = k + 1}^M$ or the previously assigned partitions in $\{R_j\}_{j = 1}^{k-1}$, i.e., let
  \[R_k = [\mathbf{B}(Q_k, \delta) \cap E] \setminus \left[\bigcup_{j = 1}^{k-1}R_j \cup \bigcup_{j = k + 1}^M Q_j\right].\]

  The method employed by the Whitney decomposition of $E$ will provide us with $\mathcal{R}$.
  Simply speaking however, for any $\ell > 0$, the lattice $\ell\,\mathbb{Z}^\dmn$ defines a family of cubes $\Delta_\ell$ of side length $\ell$, where the diameter of each cube in $\Delta_\ell$ equals $\sqrt{\dmn}\ell$.
  Letting $\ell = \dmn^{-1/2}\delta$, any cube $Q$ in
  \[\mathcal{Q} = \{Q \in \Delta_\ell : Q\cap E^\ast \neq \emptyset\}\]
  will be contained in $E$ since $\mathrm{diam}(Q) \leq \delta$.
  Using such a $\mathcal{Q}$, we find that our constructed partition $\mathcal{R}$ of $E$ satisfies
  \[\mathcal{L}^\dmn(R) \geq \frac{\delta^\dmn}{\dmn^{\dmn/2}}, \text{ and } \mathrm{diam}(R) \leq 3\delta \quad \text{for}\quad R\in \mathcal{R}.\]
\end{proof}

\begin{proposition}\label{thm:opening2}
	Let $E$ be a subset of $\mathbb{R}^\dmn$ such that
	\[\sup_{x \in E} \mathrm{dist}(x, E^c) = \rho^\ast > 0.\]
	Then for any $0 < \delta < \rho^\ast$, there exists a finite partition $\mathcal{R}$ of $E$ such that
	\begin{align}
		\mathcal{L}^\dmn(R) \geq \frac{\delta^\dmn}{\dmn^{\dmn/2}}\quad \mathrm{and} \quad \mathrm{diam}(R) \leq \delta + 2\eta_\delta \quad \mathrm{for\ all}\ R \in \mathcal{R},
	\end{align}
	where
	\[\eta_\delta = \sup_{y \in E}\mathrm{dist}(y, E\ominus \mathbf{B}(0, \delta)).\]
\end{proposition}

\begin{proof}
  We get this result with the same construction we used in the proof of Lemma~\ref{lem:opening} modulo the collection of all neighborhoods $\mathbf{B}(\mathcal{Q}, \eta_\delta) = \{\mathbf{B}(Q, \eta_\delta)\}_{Q \in \mathcal{Q}}$, which we now need to cover $E$.
\end{proof}

\begin{remark}
  For any $\delta > 0$ satisfying the assumption of Lemma~\ref{lem:opening}, i.e., $\delta \in (0, \mathrm{reach}(E^c))$, we have that $\eta_\delta = \delta$.
  In general, for the assumptions of Proposition~\ref{thm:opening2}, we only know that $\eta_\delta \geq \delta$.
\end{remark}

We now apply Lemma~\ref{lem:opening} to answer the main question on the covering probability in Equation (\ref{eq:probability}).

\begin{theorem}\label{thm:reach}
  If $E$ is a compact subset of $\mathbb{R}^\dmn$ with $\mathrm{reach}(E^c) > \rho > 0$, then for any $\delta \in (0, \rho)$ there exists a natural number $M = M(\delta, E)$ such that for any independently and identically distributed sampling $\mathbb{X}_N = (X_i)_{i = 1}^N$ of $E$,
  \begin{align}\label{eq:problowerbound}
    P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) \geq 1 - M\exp\left(\frac{-\delta^\dmn}{\dmn^{\dmn/2}\mathcal{L}^\dmn(E)} N\right),
  \end{align}
  and therefore,
  \begin{align}\label{eq:limit}
    P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) \to 1 \qquad \text{ as } \qquad N\to \infty.
  \end{align}
\end{theorem}

\begin{proof}
  Once we establish~(\ref{eq:problowerbound}), noticing that $M$ is independent of $N$ along with a simple computation shows that~(\ref{eq:limit}) is true.
  We may show~(\ref{eq:problowerbound}) by applying Lemma~\ref{lem:opening} and elementary properties of probability.

  Since $\delta < \rho$, and $\mathrm{reach}(\partial E) > \rho$, by Lemma~\ref{lem:opening} we know that there exists a finite partition $\mathcal{R}$ of $E$ such that
  \[\mathcal{L}^\dmn(R) \geq \frac{\delta^\dmn}{\dmn^{\dmn/2}}\qquad \text{and} \quad \mathrm{diam}(R) \leq 3\delta\quad \text{ for all } R\in \mathcal{R}.\]
  Let $M$ be the cardinality of the partition $\mathcal{R}$.
  As in the introduction, for any sample point $X \in \mathbb{X}$ and partition element $R \in \mathcal{R}$, we have that $P\{X \notin R\} = 1 - \mathcal{L}^\dmn(R)/\mathcal{L}^\dmn(E).$
  Thus,
  \begin{align*}
    P\{\mathbb{X}_N \cap R = \emptyset\} &= (1 - \mathcal{L}^\dmn(R)/\mathcal{L}^\dmn(E))^N \\
    &\leq \exp\left(\frac{-\mathcal{L}^\dmn(R)}{\mathcal{L}^\dmn(E)}N\right)
  \end{align*}
  and hence
  \begin{align*}
    P\left(\bigcup_{R\in \mathcal{R}}\{\mathbb{X}\cap R\} = \emptyset \right) &\leq \sum_{R\in\mathcal{R}}P(\mathbb{X}\cap R = \emptyset)\\
    &\leq \sum_{R\in\mathcal{R}} \exp\left(\frac{-\mathcal{L}^\dmn(R)}{\mathcal{L}^\dmn(E)}N\right)\\
    &\leq M\exp\left(\frac{-\inf_{R\in \mathcal{R}} \mathcal{L}^\dmn(R)}{\mathcal{L}^\dmn(E)}N\right)\\
    &\leq M\exp\left(\frac{-\delta^\dmn}{\dmn^{\dmn/2}\mathcal{L}^\dmn(E)}N\right).
  \end{align*}
  Finally, since $\mathrm{diam}(R) \leq 3\delta$, the closed ball $\mathbf{B}(X, 3\delta)$ around the realization of any sample $X \in \mathbb{X}_N$ will contain the partition element $R_X \in \mathcal{R}$ that was hit by $X$.
  Therefore,
  \begin{align*}
    P(\mathbf{B}(\mathbb{X}_N, 3\delta) \supset E) &\geq 1 - M\exp\left(\frac{-\delta^\dmn}{\dmn^{\dmn/2}\mathcal{L}^\dmn(E)}N\right).
  \end{align*}
\end{proof}

\section{Beyond Whitney}\label{sec:beyondwhitney}

It turns out that there are plenty of compact subsets $E$ which \emph{do} have nice partitionings $\mathcal{R}$, but \emph{do not} have complements of positive reach nor are equal to openings of themselves with some $\mathbf{U}(0, \delta)$.
For an example in Figure~\ref{fig:EminusA}, we remove a very small $\eta > 0$ amount of volume $A$ from the closed ball $F = \mathbf{B}(0, R)$, in such a way that $E^c = (F\setminus A)^c$ will have $0$ reach and $E\neq E\circ \mathbf{U}(0, \delta)$ for any $\delta > 0$.

In the following, Corollary~\ref{cor:UminusA} states that one is able to get a similar lower bound to the probabilistic covering of sets $E$ that are obtained by removing a small volume from sets of positive reach.

\begin{figure}[htp!]
  \centering \includegraphics[width=.2\linewidth]{DiskWithoutA.png}
  \caption{The set $E = \mathbf{B}(0, R)\setminus A$ such that $\mathcal{L}^\dmn(A) < \epsilon$, $\mathrm{reach}(E^c) = 0$, and $E \neq E\circ \mathbf{U}(0, \delta)$ for any $\delta > 0$.    \label{fig:EminusA}
  }
\end{figure}

\begin{corollary}\label{cor:UminusA}
  Let $U$ be a bounded open subset of $\mathbb{R}^\dmn$ such that $\mathrm{reach}(U^c) > \rho > 0$, let $\delta \in (0, \rho)$, and let $A\subset U$ be such that $\mathcal{L}^\dmn(A) < \delta^\dmn n^{-n/2}$.
  For $E = U\setminus A$, there exists a partition $\mathcal{R}_E$ of $E$ such that for any finite i.i.d.~sampling $\mathbb{X}$ of $E$,
  \begin{align}\label{eq:problowerbound2}
    P(\mathbf{B}(\mathbb{X}, 3\delta) \supset E) \geq 1 - M\exp\left(\frac{-(\delta^\dmn n^{-n/2} - \mathcal{L}^\dmn(A))}{\mathcal{L}^\dmn(E)} N\right),
  \end{align}
  where $N$ denotes the number of samples and $M$ denotes the cardinality of the partition $\mathcal{R}_E$ of $E$.
\end{corollary}

\begin{proof}
  Since $\mathrm{reach}(U^c) > \rho > 0$, and $0 < \delta < \rho$, by Lemma~\ref{lem:opening}, there exists a partition $\mathcal{R}_U$ of $U$ such that
  \[\mathcal{L}^\dmn(R) \geq \frac{\delta^c}{\dmn^{\dmn/2}} \quad \text{ and } \quad \mathrm{diam}(R) \leq 3\delta \quad \text{ for all } R\in \mathcal{R}_U.\]
  Since $E \subset U$, we may construct a partition $\mathcal{R}_E$ of $E$ with
  \[\mathcal{R}_E = \{R\cap E : R \in\mathcal{R}\}.\]
  By noticing that $\inf_{R' \in \mathcal{R}_E} \mathcal{L}^\dmn(R') \geq \inf_{R \in \mathcal{R}} \mathcal{L}^\dmn(R) - \mathcal{L}^\dmn(A) > 0$, we may apply the argument in Theorem~\ref{thm:reach} to $\mathcal{R}_E$ and conclude that
  \begin{align}\label{eq:problowerbound3}
    P(\mathbf{B}(\mathbb{X}, 3\delta) \supset E) \geq 1 - M\exp\left(\frac{-(\delta^\dmn n^{-n/2} - \mathcal{L}^\dmn(A))}{\mathcal{L}^\dmn(E)} N\right),
  \end{align}
  where $N$ denotes the number of samples and $M$ denotes the cardinality of the partition $\mathcal{R}_U$ of $U$.
\end{proof}

\subsection{The multiscale flat norm and probabilistic covers in $\mathbb{R}^2$}\label{sec:flatnormR2}

Let $E$ be a set of finite perimeter in $\mathbb{R}^2$.
Corollary \ref{cor:UminusA} states that if we know $E = U\setminus A$ where $U^c$ has positive reach, then we are in good shape.
However, if $E$ does not necessarily have this form, can we still say something?
In this section we show that in $\mathbb{R}^2$, we have a method that allows us to obtain a lower bound on the probability that we ``almost'' cover all of $E$.
This method involves the \emph{multiscale flat norm} (see Definition \ref{def:MFN}).

Applying the multiscale flat norm $\mathscr{F}_\lambda$ with scale $\lambda > 0$ to $\partial E$ gives us a ``denoised'' version $\partial E - \partial S_\lambda$ of $E$ when $S_\lambda \in \arg \mathscr{F}_\lambda(\partial E)$.
We had shown previously \cite{alvarado2017lower} that for sets $E$ of finite perimeter in the plane, we have $\mathrm{reach}(E_\lambda^c) > \frac{1}{5\lambda}$ for $E_\lambda := E - S_\lambda$.
Since Lemma~\ref{lem:opening} applies to sets of positive reach, we investigate when the partition $\mathcal{R}_{E_\lambda}$ of $E_\lambda$ may be used to give a good partition of $E$.

In general we cannot guarantee that the partition $\mathcal{R}_{E_\lambda}$ can always be used to give a good partition of $E$.
However, the following Theorem~\ref{prop:flatnormsufficient} does give us a sufficient condition for when the partition $\mathcal{R}_{E_\lambda}$ of $E_\lambda$ may be used to give a \emph{good $\alpha$-almost partition} of $E$ (see Definition \ref{def:goodalphaalmostpartition}).
Intuitively, a \emph{good $\alpha$-almost partition} of $E$ is a ``large'' subset of $E$ with a good partition.
The existence of a good $\alpha$-almost partition $E$ will be used to provide a lower bound for the probability that $\mathbf{B}(\mathbb{X}, 3\delta)$ covers a ``large'' subset of $E$.

\begin{definition}\label{def:goodalphaalmostpartition}
  Let $E\subset \mathbb{R}^\dmn$ and $\alpha \in \mathbb{R}$.
  A partition $\mathcal{R}_A$ of a set $A$ is called an $\alpha$-{\bfseries almost partition} of $E$ if
  \[A \subset E \quad \text{ and } \quad \mathcal{L}^\dmn(E\setminus A) \,\geq\, (1 - \alpha)\mathcal{L}^\dmn(E) \, \geq 0.\]
  We say that $\mathcal{R}_A$ is a {\bfseries good $\alpha$-almost partition} of $E$ if $\mathcal{R}_A$ is a good partition of $A$ and if $\mathcal{R}_A$ is an $\alpha$-almost partition of $E$.
\end{definition}

Before we state the main result, we consider the case when $\lambda$ is small enough so that $E_\lambda = 0$.
Since we cannot use the empty set to form any good almost partition of $E$, we must require that $\lambda$ is large enough.
In particular, we require that $\lambda > \Lambda_E$ for $\Lambda_E > 0$ is chosen such that $E \in \arg \mathscr{F}_{\lambda}(\partial E)$ for any $\lambda \in (0, \Lambda_E)$.
Our sufficient condition says that for any $\lambda > \Lambda_E$ and $\delta > 0$ such that
\[\mathcal{L}^2(S_\lambda) < \frac{\delta^2}{2}\quad \text{ and } \quad 0 < \delta < \frac{1}{5\lambda}\]
the partitions $\mathcal{R}_{E_\lambda} = \mathcal{R}^\delta_{E_\lambda}$ of $E - S_\lambda$ may indeed be used as to obtain a good $\alpha$-almost partition of $E$ for a particular $\alpha$ that depends on $\delta$.

\begin{theorem}\label{prop:flatnormsufficient}
  Let $E \subset \mathbb{R}^2$ be an open set of finite perimeter.
  If $\lambda > \Lambda_E$ and $\delta > 0$ are chosen such that
  \[\mathcal{L}^2(S_\lambda) < \frac{\delta^2}{2}\quad \text{ and } \quad 0 < \delta < \frac{1}{5\lambda} \quad \text{ for } \quad S_\lambda \in \mathscr{F}_\lambda(\partial E),\]
  then for $A := E\cap (E- S_\lambda)$ and $\alpha_\delta := \delta^2/2\mathcal{L}^2(E)$ there exists a good $\alpha_\delta$-almost partition $\mathcal{R}_{A}$ of $E$ such that
  \begin{align}\label{eq:almostall}
    P\left(\frac{\mathcal{L}^2(\mathbf{B}(\mathbb{X}, 3\delta) \cap E)}{\mathcal{L}^2(E)} \geq 1 - \alpha_\delta\right) \geq 1 - M\exp\left(\frac{-(\delta^2 2^{-1} - \mathcal{L}^2(S_\lambda))}{\mathcal{L}^2(A)} N\right)
  \end{align}
  where $N$ is the number of samples in $\mathbb{X}$ and $M$ is the cardinality of $\mathcal{R}_{A}$.
\end{theorem}

\begin{proof}
  Let $E$ be an open set of finite perimeter in $\mathbb{R}^2$.
  Suppose that there exists a $\delta > 0$ and $\lambda > \Lambda_E$ such that
  \[\mathcal{L}^2(S_\lambda) < \frac{\delta^2}{2}\quad \text{ and } \quad 0 < \delta < \frac{1}{5\lambda}\,.\]
  From our previous work~\cite{alvarado2017lower}, we get that $\mathrm{reach}(\partial E_\lambda) > \frac{1}{5\lambda}$ for $E_\lambda := E - S_\lambda$.
  Since $\delta < \mathrm{reach}(\partial E_\lambda) \leq \mathrm{reach}(E_\lambda^c)$, by Lemma~\ref{lem:opening}, there exists a partition $\mathcal{R}_{E_\lambda}^\delta$ of $E_\lambda$ such that
  \[\mathcal{L}^2(R) \geq \frac{\delta^2}{2}\quad \text{ and }\quad \mathrm{diam}(R) \leq 3\delta\quad \text{ for all } R \in \mathcal{R}_{E_\lambda}^\delta.\]

  \noindent Now take the partition of $E\cap (E - S_\lambda)$ defined by
  \[\mathcal{R}_{E\cap (E - S_\lambda)} = \{R \cap (E\cap (E - S_\lambda)) : R \in \mathcal{R}^\delta_{E_\lambda}\}\,.\]
  Since $\mathcal{L}^2(E\cap (E - S_\lambda)) \geq \mathcal{L}^2(E) - \mathcal{L}^2(E - S_\lambda) \geq \mathcal{L}^2(E) - \frac{\delta^2}{2}$ implies that
  \[\frac{\mathcal{L}^2(E \cap(E - S_\lambda))}{\mathcal{L}^2(E)} \geq 1 - \frac{\delta^2}{2\mathcal{L}^2(E)}\,,\]
  if we can prove that
  \begin{align}\label{eq:want}
    P(\mathbf{B}(\mathbb{X}, 3\delta) \supset E\cap E_\lambda) \geq 1 - M\exp\left(\frac{-(\delta^2 2^{-1} - \mathcal{L}^2(S_\lambda))}{\mathcal{L}^2(E\cap E_\lambda)} N\right)
  \end{align}
  we will have proven the inequality in Equation (\ref{eq:almostall}).
  Since $\mathcal{L}^2(S_\lambda) < \frac{\delta^2}{2}$, we get that $\inf\{\mathcal{L}^2(R) : R \in \mathcal{R}_{E \cap E_\lambda}\} \geq \inf\{\mathcal{L}^2(R) : R \in \mathcal{R}^\delta_{E_\lambda}\} - \mathcal{L}^2(S_\lambda) > 0$.
  Therefore, we may apply the argument in Theorem~\ref{thm:reach} and obtain the inequality in Equation (\ref{eq:want}).
\end{proof}

In the special case that $E \subset \mathbb{R}^2$ is obtained in a similar manner to Corollary~\ref{cor:UminusA}, that is, $E = U \setminus A$ where $A$ is a subset of a compactly supported subset of $U$, then for a range of scales $\lambda$ there exists $\eta > 0$ such that $S_\lambda = A$ if $\mathcal{L}^2(A) < \eta$.
In particular, running the multiscale flat norm on $\partial E$ will fill $U\setminus A$ back in to get $U$.
Notice that if $\mathcal{L}^2(A) < \frac{\delta^2}{2}$, then Proposition~\ref{prop:flatnormsufficient} tells us that we have a good \emph{almost} partition of $E$.
However, in Proposition~\ref{thm:fnreach} we prove that it would in fact be a \emph{good} partition of $E$ since $S_\lambda = A$.

For subsets $A$ and $B$ of $\mathbb{R}^\dmn$ we will use $A \subset\subset B$ to denote that $A$ is a compactly supported subset of $B$.

\begin{figure}[htp!]
  \centering
  \includegraphics[width=.6\linewidth]{fig_thm_4_4.pdf}
  \caption{On the left we have removed a small set $A$ from $U = \mathbf{B}(0, R)$ away from the boundary of $U$ to obtain $E = U\setminus A$ such that $\mathrm{reach}(E^c) = 0$.
  Although $E$ does not satisfy the assumptions of Lemma~\ref{lem:opening}, we may apply the multiscale flat norm to $\partial E$ to obtain the nice set $U$ with positive reach on the right.
  \label{fig:flatnormfill}
  }
\end{figure}

\begin{theorem}\label{thm:fnreach}
  Let $E = \mathbf{E}^2\myell (U \setminus A)$ where $U$ is a bounded open subset of $\mathbb{R}^2$ with $\mathrm{reach}(\partial U)$ $> \rho > 0$, and let $W$ be an open, compactly supported subset of $U$.
  If
  \begin{align}\label{cond:1}
    0 < 2/\lambda < \rho,
  \end{align}
  then
  \begin{align}\label{conc:thm}
    \exists \delta > 0\ \text{ such that if } A \subset\subset W \text{ with } \mathcal{L}^2(A) < \delta,\ \text{ then } \partial (\mathbf{E}^2 \myell U) \in \mathrm{arg\,}\mathscr{F}_\lambda(\partial E).
  \end{align}
\end{theorem}

\begin{proof}
  Let $R = 2/\lambda$.
  By a result of Allard~\cite{allard-2006-1}, we know that the support of a minimizer $T \in \mathrm{arg\,} \mathscr{F}_\lambda(\partial E)$ differs from $\partial E$ only at arcs of circles of radius $1/\lambda$, which subtend angles no more than $\pi$, and meet $\partial E$ tangentially.
  Thus, if we first show that
  \begin{align}
    A \subset \Sigma_\lambda,
  \end{align}
  the only arc of a circle of radius $1/\lambda$ in $T$ that differs from $\partial E$ must start and end at two points of $\partial U$.
  If this circle touches $T$ at two points, it contradicts the fact that $\mathrm{reach}(\partial U) > 1/\lambda$.
  Therefore, $T$ must not differ from $\partial U$, i.e., $\partial(\mathbf{E}^2\myell U) \in \mathrm{arg\,}\mathscr{F}_\lambda(\partial E)$.

  We will prove that $A \subset \Sigma_\lambda$ by showing that for an $\hat{r} > 0$ (to be chosen later) there exists an $\epsilon > 0$ such that for all $a \in A$, we can find a center $x_a \in U$ such that
  \begin{align}\label{thm:fn:pf}
    \mathbf{U}(x_a, \hat{r}) \subset U\quad \text{ and }\quad a\in \mathbf{U}(x_a, (1-\epsilon)R).
  \end{align}
  By Theorem 2 of the manuscript by Vixie~\cite{Vi2007}, there exists a $\delta = \delta(\hat{r}, \epsilon, R) > 0$, such that
  \begin{align}
    \mathcal{L}^\dmn(\,\mathbf{U}(x_a, \hat{r})\setminus (U\setminus A)\,) \, < \, \delta\quad \text{ implies }\ \quad \mathbf{U}(x_a, (1-\epsilon)R) \subset \Sigma_\lambda.
  \end{align}
  Since $\hat{r}$ and $\epsilon$ are independent of $a$, satisfying the first condition of~(\ref{thm:fn:pf}), together with $\mathcal{L}^2(A) < \delta$ will be sufficient to apply Vixie's Theorem 2.
  Thus, every point of $A$ will be contained in a ball that is contained in $\Sigma_\lambda$, and hence we get that $A\subset \Sigma_\lambda$.

  Let us now prove that $A \subset \Sigma_\lambda$.
  For any $R \in (0, \rho)$ we can pick an $\hat{r} > 0$ such that
  \begin{align}\label{cond:rhat}
    R < \hat{r} < \min\left\{\rho, \,\mathrm{dist}(W, \partial U) + R, \,\frac{\sqrt{7}}{2}R \right\}.
  \end{align}
  We may then pick a small enough $\epsilon > 0$ such that
  \begin{align}\label{cond:epsilon}
    \hat{r} - (1 - \epsilon)R \,< \,\mathrm{dist}(A, \partial U).
  \end{align}

  Let $a \in A$.
  Either $\mathrm{dist}(a, \partial U) \geq \rho$, or not.
  If $\mathrm{dist}(a, \partial U) \geq \rho$, then $\mathbf{U}(a, \hat{r}) \subset U$ and clearly $\mathbf{U}(a, (1-\epsilon)R)$ contains $a$.

  If $\mathrm{dist}(a, \partial U) < \rho$, then since $\rho < \mathrm{reach}(\partial U)$ we may let $x_a = \xi(a) + \alpha(a - \xi(a))$ where $\alpha = \hat{r}/|a - \xi(a)|$.
  Since $|\xi(a) - x_a| = \hat{r} < \mathrm{reach}(\partial U)$, and $a - \xi(a) \in \mathrm{Nor}(\partial U, \xi(a))$, part (12) of Theorem 4.8.~in the work of Federer~\cite{federer-1959-1} implies that $\xi(x_a) = \xi(a)$ and hence, since $a \in \mathbf{U}(x_a, \hat{r})$, that $\mathbf{U}(x_a, \hat{r}) \subset U$.

  To conclude the proof we must show that $a \in \mathbf{U}(x_a, (1 - \epsilon)R)$.
  By the fact that $|x_a - a| + |a - \xi(a)| = \hat{r}$, and that we have chosen $\hat{r}$ and $\epsilon$ to satisfy~(\ref{cond:rhat}) and~(\ref{cond:epsilon}), respectively, we get that
  \begin{align*}
    |x_a - a| & < \mathrm{dist}(W, \partial U) + R - |a - \xi(a)|\\
              & \leq |a - \xi(a)| + (1 - \epsilon)R - |a - \xi(a)|\\
              & = (1 - \epsilon)R,
  \end{align*}
  thus concluding the proof of the theorem.
\end{proof}

\input{Discussion}

\input{RandomCovers_paper.bbltex}

\end{document}

Probability (math.PR); Differential Geometry (math.DG)

Geometry of a Set and its Random covers


Deleting digits

Abstract: In 2000, J. Shallit introduced a special partial ordering of a subset of positive integers and proposed the problem of finding the set of minimal elements with respect to this ordering. Shallit himself solved this problem for the set of primes and also for the set of composite numbers. In this recreational mathematics note, we compute the minimal sets of a few other arithmetically interesting sets and discuss questions on size and shape of minimal sets in general.

\section{A Paper by Shallit on Primes}

We consider here the positive integers with respect to their unique decimal expansions, where each $n\in\mathbb N$ is given by $n=\sum_{j=0}^k \alpha_j10^{j}$ for some non-negative integer $k$ and digit sequence $\alpha_k\alpha_{k-1}\ldots\alpha_0$. With slight abuse of notation, we also use $n$ to denote $\alpha_k\alpha_{k-1}\ldots\alpha_0$. For such sequences of digits (as well as for the numbers represented by the corresponding expansions) we write $x\triangleleft y$ if $x$ is a subsequence of $y$, which means that either $x=y$ or $x$ can be obtained from $y$ by deleting some digits of $y$. For example, $514\triangleleft 352148$. The main problem is as follows: {\it given a set $S\subset \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$, find the smallest possible set $M\subset S$ such that for all $s\in S$ there exists $m\in M$ with $m \triangleleft s$.} As a matter of fact, the set
$$
M(S):=\{s\in S\,\mid\, \{n\in S\,:\,n<s, n\triangleleft s\}=\varnothing\}
$$
solves this problem; clearly, every element of $S$ contains some element of $M(S)$ as a subword. The set $M(S)$ is said to be the {\it minimal set} and its elements are also called {\it minimal}.
\par

Remarkably, {\it $M(S)$ is finite for every possible $S\subset \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$}. This follows from a celebrated theorem from the theory of formal languages, the so-called lemma of Higman \cite{higman} (see also the Chapter entitled {\it Subwords} by Jacques Sakarovitch and Imre Simon \cite{lothaire} in Lothaire's  encyclopaedia {\it Combinatorics on Words}).
\par

In general, it seems to be difficult to compute $M(S)$ for a given $S$, the known proofs of Higman's lemma are ineffective. In the case of the set of prime numbers $\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}=\{2,3,5,\ldots\}$ Jeffrey Shallit \cite{shallit} succeeded in determining $M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}})$ by elementary means, namely
\begin{eqnarray*}
M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}})&=&\{2,3,5,7,11,19,41,61,89,409,449,499,881,991,6469,\\
&& \ 6949,9001,9049,9649,9949,60649,666649,946669,\\
&& \ 60000049,66000049,66600049\}.
\end{eqnarray*}
Already by a first glimpse on the elements of $M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}})$ one can guess the kind of reasoning necessary to prove this explicit form for the minimal set of primes. However, in the case of the set $2^{\hbox{\font\dubl=msbm10 scaled 800 {\dubl N}}}=\{2^n\,:\,n\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0\}$ consisting of the powers of $2$ Shallit \cite{shallit} conjectured
$$
M(2^{\hbox{\font\dubl=msbm10 scaled 800 {\dubl N}}})=\{1,2,4,8,65536\}.
$$
\pagebreak\newpage\noindent
Moreover, he observed that this is true if every number $16^m$ with $m\geq 4$ has at least one digit from $\{1,2,4,8\}$. This type of problem seems to be difficult to tackle. Of course, we know that the powers of $2$ are distributed according to Benford's law (i.e., the sequence $n\log_{10}2$ is uniformly distributed modulo one),  nevertheless, this just indicates - in an appropriate probabilistic framework - that a power of $2$ without any digit from $\{1,2,4,8\}$ must be a very rare event.
\par

In this note we present our new results on the minimal sets of a few other arithmetically interesting sets of positive integers (in Section 2 \& 3), we furthermore address questions on size and shape of minimal sets in general and indicate the absence of structure behind (Section 4), and finally we conclude with another example, namely the hypothetical minimal set for perfect numbers and analogous question for other bases (Section 5). Our main aim is to make the beautiful theorem of Higman and Shallit's paper more popular in order to attract more research in this direction.

\section{Sums of Squares and Quadratic Residues}

In this section we look at three subsets of $\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ for which the minimal sets can be determined easily. Whereas in the first example the reason for this is that the examined set contains many digits, in the second and third examples we exploit the fact that the elements of the sets are in some sense well-distributed. For the first example, this means that we have almost all digits lying in the set, which means that there are just few numbers that we are left to examine. In the other two examples, the elements of the examined sets lie in certain residue classes for some modulus, which will be helpful. Other explicit constructions of minimal sets of residue classes and some discussions about the structure can be found in \cite{kreh}.

\begin{Theorem}
Let
\begin{equation*}
\fbox{$3$} := \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x,y,z \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0 : n = x^2+y^2+z^2 \rbrace.
\end{equation*}
Then
\begin{equation*}
M(\fbox{$3$}) = \lbrace 1,2,3,4,5,6,8,9,70,77 \rbrace.
\end{equation*}
\end{Theorem}

\begin{proof}
It is easy to see that each of the numbers $1,2,3,4,5,6,8,9,70,77$ can be written as a sum of three squares, so they belong to $\fbox{3}$. Clearly $1,2,3,4,5,6,8,9$ belong to $M(\fbox{3})$. Since $7 \notin \fbox{3}$, $70$ and $77$ also belong to $M(\fbox{3})$. If $n \in \fbox{3}$ is different from $1,2,3,4,5,6,8,9,70,77$, then either $d \triangleleft n$ for $d \in \lbrace 1,2,3,4,5,6,8,9 \rbrace$ and $n$ cannot belong to $M(\fbox{3})$ or $n$ consists only of digits $0$ and $7$. In the latter case either $70 \triangleleft n$ or $77 \triangleleft n$, and so $n\notin M(\fbox{3})$.
\end{proof}

Two strings of digits $x$ and $y$ are called {\it incomparable} if neither $x\triangleleft y$ nor $y\triangleleft x$. The reader might have noticed that a subset of $S$ consisting of pairwise incomparable elements is in general not contained in $M(S)$ (as the example $S=\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ and the subset of all two digit numbers shows). However, in the previous proof for any element $x$ in the set $\{1,2,3,4,5,6,8,9,70,77\}$ of pairwise incomparable elements, there was no $y \in \fbox{3}, y \neq x$ with $y \triangleleft x$. In this case the set of pairwise incomparable elements is indeed contained in $M(S)$. We shall use this idea quite often in the sequel.

\begin{Theorem}
Let
\begin{equation*}
\Box\bmod\,6 := \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : x^2 \equiv n \mod 6 \rbrace.
\end{equation*}
Then
\begin{equation*}
M(\Box\bmod\,6) = \lbrace 1,3,4,6,7,9,22,25,28,52,55,58,82,85,88 \rbrace.
\end{equation*}
\end{Theorem}

\begin{proof}
It is easy to check that $n \in \Box\bmod\,6$ if and only if $n \equiv 1,3,4,6 \mod 6$. So we have indeed $\lbrace 1,3,4,6,7,9,22,25,28,52,55,58,82,85,88 \rbrace \subset \Box\bmod\,6$. Moreover, these elements are pairwise incomparable. Let $n \in \Box\bmod\,6$ be arbitrary. If $d \triangleleft n$ with $d \in \lbrace 1,3,4,6,7,9 \rbrace$, we are done. So suppose that $n$ contains none of these digits. Assume first that $n$ contains exactly two digits. Then $22,25,28,52,55,58,82,85,88 \in \Box\bmod\,6$ and $20,50,80 \notin \Box\bmod\,6$. If $n$ has more than two digits, then either two of its digits are nonzero and so there is an $x \in M(\Box\bmod\,6)$ with $x<n$, $x \triangleleft n$, or $n$ has only one nonzero digit. In the latter case, this digit is congruent to $2$ modulo $3$, hence $n \equiv 2 \mod 6$, and therefore $n \notin \Box\bmod\,6$.
\end{proof}

\begin{Theorem}
Let
\begin{equation*}
\Box\bmod\,7 := \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\,\exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : x^2 \equiv n \mod 7 \rbrace.
\end{equation*}
Then
\begin{equation*}
M(\Box\bmod\,7) = \lbrace 1,2,4,7,8,9,30,35,36,50,53,56,60,63,65,333,555,666 \rbrace.
\end{equation*}
\end{Theorem}

\begin{proof}
Since $n \in \Box\bmod\,7$ if and only if $n \equiv 1,2,4,7 \mod 7$, we have $\lbrace 1,2,4,7,8,9,30,35,36,50,53,56,60,63,65,333,555,666 \rbrace \subset \Box\bmod\,7$; again these elements are pairwise incomparable. Let $n \in \Box\bmod\,7$. If $d \triangleleft n$ with $d \in \lbrace 1,2,4,7,8,9 \rbrace$, we are done. So suppose that $n$ contains none of these digits. If $n$ has exactly two digits, then $30,35,36,50,53,56,60,63,65 \in \Box\bmod\,7$ and $33,55,66 \notin \Box\bmod\,7$. If $n$ has at least three digits and at least two of them are distinct we are done. It therefore remains to assume that $n$ is of the form $dd\ldots dd$ with $d \in \lbrace 3,5,6 \rbrace$. Then either $333 \triangleleft n$ or $555 \triangleleft n$ or $666 \triangleleft n$.
\end{proof}

\section{Values of Arithmetical Functions}

In this section, we consider sets of the type $S=\{n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : f(x)=n\}$ where $f:\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} \rightarrow \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ is an arithmetical function. Recall that the Euler function $\varphi(n)$ is defined to be the number of positive integers not exceeding $n$ which are relatively prime to $n$. If $n=\prod_{p|n} p^{k_p}$ is the unique prime factorization of $n$, then $\varphi(n)=\prod_{p|n} (p-1) p^{k_p-1}$.

\begin{Theorem}
Let
\begin{equation*}
\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}) := \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : \varphi(x)=n \rbrace.
\end{equation*}
Then
\begin{equation*}
M(\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})) = \lbrace 1, 2, 4, 6, 8, 30, 70, 500, 900, 990, 5590, 9550, 555555555550\rbrace.
\end{equation*}
\end{Theorem}

\begin{proof}
Observe that the numbers above are pairwise incomparable. Further, as
\begin{align*}
\varphi(1)&=1,&\varphi(3)&=2,&\varphi(5)&=4,&\varphi(7)&=6,\\
\varphi(16)&=8,&\varphi(31)&=30,&\varphi(71)&=70,&\varphi(625)&=500,\\
\varphi(1057)&=900,&\varphi(991)&=990,&\varphi(5591)&=5590,&\varphi(9551)&=9550,
\end{align*}
and
$$
\varphi(555555555551)=555555555550,
$$
we see that $\lbrace 1, 2, 4, 6, 8, 30, 70, 500, 900, 990, 5590, 9550, 555555555550\rbrace\subset \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. Note also that $3,5,7,9\notin \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. Now assume that $n\in \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$ has at least two digits. If there exists $d\in\{1,2,4,6,8\}$ such that $d \triangleleft n$ then $n\notin M(\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}))$. Suppose that $n$ contains only the digits $0,3,5,7,9$. Since $\varphi(m)$ is even for $m>2$, the last digit is $0$. It is easy to see that $50,90 \notin \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. Now assume that $n$ has at least three digits. If $n$ contains the digits $3$ or $7$, then $30 \triangleleft n$ or $70 \triangleleft n$, respectively. Consequently, $n\notin M(\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}))$. Next assume that $n$ contains only the digits $0,5,9$. It is easily verified that $550,590,950\notin \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. Suppose that $n$ has at least four digits. Then we have the following possibilities:
\begin{itemize}
\item $n$ contains at least two zeros. Then either $500 \triangleleft n$ or $900 \triangleleft n$.

\item $99 \triangleleft n$. Then $990 \triangleleft n$.

\item $559 \triangleleft n$. Then $5590 \triangleleft n$.

\item $955 \triangleleft n$. Then $9550 \triangleleft n$.

\item $n=5950$. Then $n\notin \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$.

\item $n=\underbrace{55\ldots 5}_{\ell}0$ with $\ell\ge 3$.
\end{itemize}
Therefore, it remains to show that if $n=\underbrace{55\ldots 5}_{\ell}0$ with $3\le\ell\le 10$, then $n\notin \varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. To this end, assume that $\varphi(m)=n$ for some $m\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$. Since $4\nmid n$, we have $4\nmid m$ and $m$ has exactly one odd prime divisor, that is $m=p^k$ or $m=2p^k$ with $k\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ and odd $p\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}$. In both cases we must have $p^{k-1}(p-1)=n$. Using a computer algebra package, we find the unique prime factorization of each of the values of $n$ under consideration, namely,
\begin{align*}
5550&=2\cdot3\cdot5^2\cdot37, & 55550&=2\cdot5^2\cdot11\cdot101,\\
555550&=2\cdot5^2\cdot41\cdot271, & 5555550&=2\cdot3\cdot5^2\cdot7\cdot11\cdot13\cdot37,\\
55555550&=2\cdot5^2\cdot239\cdot4649, & 555555550&=2\cdot5^2\cdot11\cdot73\cdot101\cdot137,\\
5555555550&=2\cdot3^2\cdot5^2\cdot37\cdot333667, & \!\!\!\!55555555550&=2\cdot5^2\cdot11\cdot41\cdot271\cdot9091.
\end{align*}
We see that if $p^{k-1}\mid n$ with $k\ge 3$, then $k=3$ and $p=3$ or $5$, and so $p^{k-1}(p-1)\ne n$. Further, it is easy to check that there is no prime number $p$ with $p(p-1)=n$. Hence $k=1$ and $n+1$ is a prime. However, all the numbers $\underbrace{55\ldots 5}_{\ell}1$, $3\le\ell\le 10$, are composite, and this gives the desired contradiction.
\end{proof}

It is not difficult to find minimal sets for some sets of shifted values of the Euler function. For example, it can be proved that
$$
M(3+\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}))=\lbrace 4, 5, 7, 9, 11, 13, 21, 23, 31, 33, 61, 63, 81, 83\rbrace,
$$
where
$$
3+\varphi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}):= \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : 3+\varphi(x)=n \rbrace.
$$
We leave this as an exercise for the interested reader.

Related to Euler's function but less well-known is the Dedekind $\psi$-function, for $n = \prod_{p\mid n} p^{k_p}$ defined by
\begin{equation*}
\psi(n) := \prod_{p\mid n} (p+1) p^{k_p-1}.
\end{equation*}
As we shall see in the proof of the following theorem, the determination of the corresponding minimal set is possible, although requires a little more effort than in the case of Euler's $\varphi$.

\begin{Theorem}
Let $\psi$ be the Dedekind $\psi$-function and
\begin{equation*}
\psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}) := \lbrace n \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\,\mid\, \exists x \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}} : \psi(x)=n \rbrace.
\end{equation*}
Then
\begin{align*}
M(\psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})) = \lbrace &1,3,4,6,8,20,72,90,222,252,500,522,552,570,592,750,770, \\
&992,7000,\underbrace{55\ldots 5}_{69}0\rbrace.
\end{align*}
\end{Theorem}

\begin{proof}
First note, that the elements given above are pairwise incomparable and we have
$$
\begin{array}{rclrclrclrcl}
\psi(1)&=&1, &\psi(2)&=&3, &\psi(3)&=&4, &\psi(5)&=&6,\\
\psi(7)&=&8, &\psi(19)&=&20, &\psi(71)&=&72, &\psi(89)&=&90,\\
\psi(146)&=&222, &\psi(251)&=&252, &\psi(499)&=&500, &\psi(521)&=&522, \\
\psi(411) &=&552, &\psi(569)&=&570, &\psi(511)&=&592, &\psi(625)&=&750,\\
\psi(769)&=&770, &\psi(991)&=&992, &\psi(6631)&=&7000&&&
\end{array}
$$
and
$$
\psi(\underbrace{55\ldots 5}_{68}49)=\underbrace{55\ldots 5}_{69}0,
$$
since $\underbrace{55\ldots 5}_{68}49$
is a prime, all these numbers belong to $\psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$.
\par

Now let $n \in \psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$ be arbitrary with at least two digits. If $d \triangleleft n$ with $d \in\{1,3,4,6,8\}$, then $n \notin M(\psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}))$. So $n$ does only contain the digits $2,5,7,9,0$. It follows from the product formula $\psi(m) = \prod_{p\mid m} (p+1) p^{k_p-1}$ defining $\psi$ that $\psi(m)$ is even for $m>2$. First we note  that $22, 50, 52, 70, 92,$ $292, 502, 550, 700, 922, 952 \notin \psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. Now suppose that $n$ has at least four digits. Then one of the following cases holds:
\begin{itemize}
\item $n$ ends with a $2$ and contains a $7$. Then $72 \triangleleft n$.
\item $n$ ends with a $2$, contains a zero and does not contain a 7. Then $20 \triangleleft n$ or $90 \triangleleft n$ or $502 \triangleleft n$. In the latter case $n$ contains one of the following strings:
\begin{equation*}
5002, 2502, 5202, 5022, 5502, 5052,9502, 5902, 5092.
\end{equation*}
Then $20 \triangleleft n$ or $90 \triangleleft n$ or $500 \triangleleft n$ or $522 \triangleleft n$ or $552 \triangleleft n$ or $592 \triangleleft n$.
\item $n$ ends with a $2$ and contains only the digits $2$, $5$ and $9$. Then $222 \triangleleft n$ or $252 \triangleleft n$ or $522 \triangleleft n$ or $552 \triangleleft n$ or $992 \triangleleft n$.
\item $n$ ends with a zero and contains a $2$ or a $9$. Then $20 \triangleleft n$ or $90 \triangleleft n$.
\item $n$ ends with a zero and contains a $7$ and a $5$. Then $570 \triangleleft n$ or $750 \triangleleft n$.
\item $n$ ends with a zero and contains only the digits $7$ and $0$. Then $770 \triangleleft n$ or $7000 \triangleleft n$.
\item $n$ ends with a zero and contains only the digits $5$ and $0$. Then $500 \triangleleft n$ or $550 \triangleleft n$.
\end{itemize}
\smallskip

Thus, the only numbers $n$ that need to be examined are of the form $5 \ldots 50$. It suffices to show that if $n=\underbrace{55\ldots 5}_{\ell}0$ with $3\le\ell\le 68$, then $n\notin \psi(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$.

We note, that if $m$ has $k$ distinct odd prime factors, then $2^k\mid\psi(m)$. In our case, $n \equiv 2 \mod 4$, so if there is $m \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ with $\psi(m)=n$, then $m = p^k$ or $m=2 p^k$ with $p \in \hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}$ odd. Hence either $p^{k-1}(p+1)=n$ or $3p^{k-1}(p+1)=n$ with $k\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ and odd $p\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}$. Note that $4\nmid(p+1)$. A computer search shows that if $p^{k-1}\mid n$ with $k\ge 3$ and $4\nmid(p+1)$, then $k=3$ and $p=5$. This implies that either $n=150$ or $n=450$, which is a contradiction. Next, one can easily verify that there is no prime $p$ with $n=p(p+1)$ or $3p(p+1)$, and so $k\ne 2$. Finally, note that neither $n-1$ nor $(n/3)-1$ is a prime, which yields $k\ne 1$. This concludes the proof.
\end{proof}

\section{The Absence of Structure}

The examples from the previous sections already indicate that minimal sets behave rather unexpectedly. It is easy to obtain some sets in explicit form, while for other sets of {\it higher arithmetical complexity} the explicit form of the corresponding minimal set may be only achieved conditionally. Already the size of minimal sets seems to be almost unpredictable.
\par

For $k\in\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ define $S_k:=\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}\cap [10^{k-1},10^k)$ (the set of positive integers with $k$ digits in base $10$). One easily verifies $M(S_k)=S_k$ which shows that the minimal set can be as large as we please even for finite sets. Moreover, $S_k$ is minimal among all sets $S$ with $\sharp M(S)=9\cdot 10^{k-1}$. In general it seems to be difficult to prove an upper bound for the number of minimal elements in an arbitrary set.
\par

One might be tempted to try to build up some kind of set theory for minimal sets. The following statement is trivial:
$$
M(S\cup T)\subset M(S)\cup M(T).
$$
The left-hand side above can be equal to the right-hand side (if, for example, $S=2+10\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0$ and $T=3+10\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0$) and smaller (if, for example, $S=\{2\}\cup (\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}} \cap (1+4\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0))$ and $T=\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}} \cap (3+4\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0$)). The same inclusion with $\cap$ in place of $\cup$ on the right hand-side is in general false as follows from the example $S=\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}$ and $T=1+4\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}_0$. Moreover, even $M(S\cap T)\subset M(S)\cup M(T)$ is false as the counterexample $S=7+10\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ and $T=\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}$ shows.
\par

Probably, the main obstacle in order to prove something 'structural' (whatever that means) is that $S\mapsto M(S)$ is not monotone: e.g., $\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}}\subset \hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}}$ but $\sharp M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}})>\sharp M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl N}})$. We conclude that minimal sets indeed behave erratically (but would be glad if the reader could disprove our non-mathematical statement).

\section{An Odd End}

Choosing another base than $10$ would not make things easier in general (see \cite{BDS} for recent results in this direction). Of course, with the binary expansion in place of the decimal expansion a few minimal sets would look more simple, e.g., $M(\hbox{\font\dubl=msbm10 scaled 1100 {\dubl P}})=\{10_2,11_2\}$. However, there are still plenty of sets, interesting from a  number-theoretical point of view, where the corresponding minimal set seems to be difficult to describe.
\par

For instance, the set of perfect numbers ${\sf Perfect}=\{6,28,496,\ldots\}$ is conjectured to contain no odd numbers. Recall that a positive integer is called {\it perfect} if it equals the sum of its proper divisors. As already Euclid knew (in different language), every Mersenne prime $2^p-1$ (with prime $p$) yields an even perfect number $2^{p-1}(2^p-1)$, and Leonhard Euler proved that every even perfect number is of this form (see Dickson \cite{dickson} for this and further details about and the history of perfect numbers). \'Edouard Lucas \cite{lucas} showed that every even perfect number different from $6$ and $496$ ends with decimal digits $16,28,36,56$ or $76$. Hence, {\it if there is no odd perfect number, then the minimal set of perfect numbers is given by $M({\sf Perfect})=\{6,28\}$}. If there exists an odd perfect number, although much can be said about its hypothetical multiplicative structure, we cannot exclude the possibility that this odd number is a minimal element. In base $2$ we would have $M({\sf Perfect})=\{110_2\}$ if there is no odd perfect number, and we leave the computation of the minimal set with respect to other bases (under the same assumption) to the interested reader.

\section*{Acknowledgment}
The authors thank the referee for careful reading of the manuscript and many helpful suggestions.

\medskip

Number Theory (math.NT); Combinatorics (math.CO)

Deleting digits


Congruences of Power Sums

Abstract: The following congruence for power sums, $S_n(p)$, is well known and has many applications: $1^n+2^n +\dots +p^n \equiv\begin{cases} -1 \text{ mod } p, & \text{ if } \ p-1 \ | \ n; 0 \text{ mod } p, & \text{ if } \ p-1 \ \not| \ n, \end{cases}$ where $n\in{\mathbb N}$ and $p$ is prime. We extend this congruence, in particular, to the case when $p$ is any power of a prime. We also show that the sequence $(S_n(m) \text{ mod } k )_{m \geq 1}$ is periodic and determine its period.

\section{Introduction}

Sums of powers of integers defined below have captivated mathematicians for many centuries \cite{Beery}.

\begin{definition}
For $n,m\in\mathbb{N}$, let
$$S_n(m) = \sum_{i=1}^m i^n.$$
\end{definition}

With their pebble experiments, the Pythagoreans were the first to discover a formula for the sum of the first powers. Formulas for the sums of second and third powers were proved geometrically by Aryabhatta and Archimedes, and Harriot later provided a generalizable form for these formulas. Faulhaber gave formulas for power sums up to the $17^{\text{th}}$ power, and Fermat, Pascal, and Bernoulli provided succinct formulas for them. Since then, different representations and number-theoretic properties of these power sums have been an object of study \cite{Knuth, MS}. Bernoulli numbers have been used to represent the coefficients of polynomial formulas for these power sums such as Faulhaber's formula \cite[p.\ 107]{Conway}. In a recent paper, Newsome et al.\ \cite{NMA} have demonstrated symmetry properties of the power sum polynomials and their roots via a novel Bernoulli number identity.

One of the most well-known results concerning the number-theoretic properties of power sums is the following congruence relation:

\begin{theorem}
\label{known-congruency-theorem}
If $n\in\mathbb{N}$ and $p$ is prime, then
$$S_n(p)\equiv\begin{cases}
-1 \pmod{p}, & \text{ if } \ p-1 \divides n; \\
0 \pmod{p}, & \text{ if } \ p-1 \notdivides n.
\end{cases}$$
\end{theorem}

The case $p-1 \divides n$ is an easy consequence of Fermat's little theorem. There are several different proofs for the case $p-1 \notdivides n$ in the literature. Some of the notable ones are by Rado \cite{HW, M2, R} using the theory of primitive roots, Zagier \cite{M} using Lagrange's theorem, and MacMillan and Sondow \cite{MS} using Pascal's identity. Also, a proof of both cases by Carlitz \cite{C} uses Bernoulli numbers.

This congruence is used to prove the von Staudt-Clausen theorem \cite{HW, R} and its generalization \cite{C}, prove the Carlitz-von Staudt theorem \cite {M}, and study the Erd\H{o}s-Moser equation $S_n(m-1)=m^n$ \cite{M, M2, Mo}.

Our main goal in this paper is to generalize the well-known congruence result above and to present periodicity properties of the sequence $(S_n(m)\bmod{k})_{m\geq 1}$. In Section \ref{generalization-section}, we extend Theorem \ref{known-congruency-theorem} to the case when $p$ is a power of a prime. In Section \ref{periodicity-section}, we prove that $(S_n(m) \bmod{k})_{m\geq 1}$ is periodic and determine its period for different values of $k$ and $n$.

\section{Generalization of Theorem \ref{known-congruency-theorem}}
\label{generalization-section}

\begin{theorem}
\label{generalized-congruency-theorem}
\begin{enumerate}
\item[(1)] For $n\in\mathbb{N}$ and $p=2^a$ with $a\ge 2$,
$$S_n(p)\equiv\begin{cases}
\varphi(p) \pmod{p}, & \text{ if } \ n=1 \text{ or } 2 \divides n; \\
0 \pmod{p}, & \text{ if } \ n>1 \text{ and } 2 \notdivides n,
\end{cases}$$
where $\varphi$ is Euler's totient function.

\item[(2)] If $n\in\mathbb{N}$ and $p=q^a$ where $q$ is an odd prime and $a\ge 1$, then
$$S_n(p)\equiv\begin{cases}
\varphi(p) \pmod{p}, & \text{ if } \ q-1 \divides n; \\
0 \pmod{p}, & \text{ if } \ q-1 \notdivides n.
\end{cases}$$
\end{enumerate}
\end{theorem}

\begin{proof}
\begin{enumerate}
\item[(1)]
The proof is by induction on $a$. For $a=2$,
\begin{align*}
S_n(4) & \equiv 1^n + 2^n + 3^n + 4^n \equiv 1^n + 2^n + (-1)^n \\
& \equiv \begin{cases}
2 \pmod{4}, & \text{ if $n=1$ or $2\divides n$}; \\
0 \pmod{4}, & \text{ if $n>1$ and $2\notdivides n$}.
\end{cases}
\end{align*}
Suppose the statement holds for some $a\ge 2$. Then, for $n=1$ we have
$$S_1(2^{a+1}) \equiv \frac{2^{a+1}(2^{a+1}+1)}{2} \equiv 2^a \equiv \varphi(2^{a+1}) \pmod{2^{a+1}},$$
and for $n\ge 2$,
\begin{align*}
S_n(2^{a+1}) & \equiv 1^n+\dots +(2^a)^n + (2^a+1)^n +\dots +(2^{a+1})^n \\
& \equiv S_n(2^a) + \sum_{t=1}^{2^a} (2^a+t)^n \\
& \equiv S_n(2^a) + \sum_{t=1}^{2^a} \left( t^n + n2^at^{n-1} \right)\\
& \text{(all other terms are divisible by $(2^{a})^2$, thus divisible by $2^{a+1}$)} \\
& \equiv 2S_n(2^a) + n2^a \underbrace{S_{n-1}(2^a)}_{\text{even}} \\
& (\text{since $a \ge 2$, $S_{n-1}(2^a)$ has an even number of odd terms})\\
& \equiv 2S_n(2^a) \pmod{2^{a+1}}.
\end{align*}
If $2 \divides n$, then
$$S_n(2^a)\equiv \varphi(2^a) \pmod{2^a},$$
so
$$S_n(2^{a+1})\equiv2S_n(2^a)\equiv 2\varphi(2^{a}) \equiv \varphi(2^{a+1}) \pmod{2^{a+1}}.$$
If $2 \notdivides n$, then
$$S_n(2^a)\equiv 0 \pmod{2^a},$$
so
$$S_n(2^{a+1})\equiv2S_n(2^a)\equiv 0 \pmod{2^{a+1}}.$$

\item[(2)]
The proof is by induction on $a$. The case $a=1$ is Theorem \ref{known-congruency-theorem}.

Suppose the statement holds for some $a\ge 1$. Then,
for $n=1$ we have
$$S_1(q^{a+1}) = \frac{q^{a+1}(q^{a+1}+1)}{2} \equiv 0 \pmod{q^{a+1}},$$
and for $n\ge 2$,
\begin{align*}
S_n(q^{a+1}) & \equiv \left(1^n+\dots +(q^a)^n\right) + \dots + \left(((q-1)q^a+1)^n +\dots +(q^{a+1})^n\right) \\
& \equiv \sum_{i=0}^{q-1} \sum_{t=1}^{q^a} (iq^a+t)^n \\
& \equiv \sum_{i=0}^{q-1} \sum_{t=1}^{q^a} \left( t^n + niq^at^{n-1} \right) \\
& \text{(all other terms are divisible by $(q^{a})^2$, thus divisible by $q^{a+1}$)} \\
& \equiv \sum_{i=0}^{q-1} \left( S_n(q^a) + niq^aS_{n-1}(q^a) \right)\\
& \equiv qS_n(q^a) + n\frac{(q-1)q}{2}q^aS_{n-1}(q^a) \\
& \equiv qS_n(q^a) \pmod{q^{a+1}}.
\end{align*}
If $q-1 \divides n$, then
$$S_n(q^a)\equiv \varphi(q^a)  \pmod{q^a},$$
so
$$S_n(q^{a+1})\equiv qS_n(q^a)\equiv q\varphi(q^a) \equiv \varphi(q^{a+1}) \pmod{q^{a+1}}.$$
If $q-1 \notdivides n$, then
$$S_n(q^a)\equiv 0 \pmod{q^a},$$
so
$$S_n(q^{a+1})\equiv qS_n(q^a)\equiv 0 \pmod{q^{a+1}}.$$
\end{enumerate}
\end{proof}

\begin{corollary}
\label{generalized-congruency-corollary}
For any $a,n\in\mathbb{N}$ and prime $q$,
$$S_n(q^a)\equiv 0 \pmod{q^{a-1}}.$$
\end{corollary}

The next few results will be used to extend Theorem \ref{generalized-congruency-theorem} (2).

\begin{lemma}
\label{div-by-qpowers-lemma}
If $n,i,j,k\in\mathbb{N}$ and $q$ is an odd prime such that $q^i \divides n$, then $q^{i+j} \divides \displaystyle\binom{n}{k}(q^j)^k$. Moreover, for $k\ge 2$,
$q^{i+j+1} \divides \displaystyle\binom{n}{k}(q^j)^k$.
\end{lemma}

\begin{proof}
If $k=1$, then $\displaystyle \binom{n}{k}(q^j)^k = nq^j$ is divisible by $q^{i+j}$.

If $k\ge 2$, note that since $\displaystyle \binom{n}{k} = \frac{n(n-1)\cdots(n-k+1)}{k!}$ and the highest power of $q$ that divides $k!$ is $q^\alpha$ where $\displaystyle \alpha=\left\lfloor\frac{k}{q}\right\rfloor+\left\lfloor\frac{k}{q^2}\right\rfloor+\cdots$, it is sufficient to show that
$$i+j < i - \left( \left\lfloor\frac{k}{q}\right\rfloor+\left\lfloor\frac{k}{q^2}\right\rfloor+\cdots\right) +jk.$$

Indeed,
\begin{align*}
i+j & \le i+j+\frac{k}{2}-1 \\
& = i+j-\frac{k}{2}+k-1 \\
& \le i+j- \frac{k}{q-1}+j(k-1) \\
& = i - \sum_{t=1}^{\infty}\frac{k}{q^t} +jk \\
& < i - \left( \left\lfloor\frac{k}{q}\right\rfloor+\left\lfloor\frac{k}{q^2}\right\rfloor+\cdots\right) +jk.
\end{align*}
\end{proof}

\begin{corollary}
\label{power-congruency-corollary}
If $i,j,n,t\in \mathbb{N}$, $q$ is an odd prime, and $q^i \divides n$, then
$$(t+q^j)^n \equiv t^n\pmod{q^{i+j}}.$$
\end{corollary}

\begin{proof}
We have
\begin{align*}
(t+q^j)^n &\equiv t^n+\sum_{k=1}^{n} \binom{n}{k} (q^j)^k t^{n-k} \\
&\equiv t^n\pmod{q^{i+j}}. \qquad\text{(by Lemma \ref{div-by-qpowers-lemma})}
\end{align*}
\end{proof}

If $q$ is an odd prime and $g$ is invertible modulo $q$, then multiplication by $g$ permutes elements of $\mathbb{Z}_q^*$, that is,
\begin{equation}\label{mult-by-g}
\{g\cdot1\bmod{q},\dots, g(q-1)\bmod{q}\}=\{1,\dots,q-1\}
\end{equation}
as sets.

The following theorem extends Theorem \ref{generalized-congruency-theorem} (2).

\begin{theorem}
\label{generator-block-theorem}
If $i\in\mathbb{Z}$, $i\ge 0$, $j,n\in\mathbb{N}$, $q$ is an odd prime, $q-1\notdivides n$, and $q^i \divides n$, then $$S_n(q^j)\equiv0\pmod{q^{i+j}}.$$
\end{theorem}

\begin{proof}
The case $i=0$ is Theorem \ref{generalized-congruency-theorem} (2).

For any fixed $i\ge 1$ we use induction on $j$. First consider $j=1$. Let $g$ be a generator of the multiplicative group $\mathbb{Z}_{q}^*$.
Then
\begin{align*}
g^nS_n(q) &\equiv g^n \sum_{k=1}^{q}k^n \\
&\equiv \sum_{k=1}^{q} (gk)^n \\
&\equiv \sum_{k=1}^{q} (gk\bmod{q})^n \qquad \text{(by Corollary \ref{power-congruency-corollary})}\\
&\equiv \sum_{k=1}^{q}k^n \qquad \text{(by \eqref{mult-by-g})}\\
&\equiv S_n(q) \pmod{q^{i+1}}.
\end{align*}
Thus $$(g^n-1)S_n(q)\equiv0\pmod{q^{i+1}}.$$
But $g^n\not\equiv 1$ (mod $q$) since $g$ is a generator of $\mathbb{Z}_{q}^*$ and $q-1\notdivides n$. Therefore $$S_n(q)\equiv 0\pmod{q^{i+1}}.$$
Now assume that $S_n(q^j)\equiv 0$ (mod $q^{i+j}$) for some $j\ge1$. Then
\begin{align*}
S_n(q^{j+1}) &\equiv \sum_{t=0}^{q-1}\sum_{r=1}^{q^j}(tq^j+r)^n\\
&\equiv \sum_{t=0}^{q-1}\sum_{r=1}^{q^j} \left( r^p+ntq^jr^{n-1}+\sum_{k=2}^n \binom{n}{k}(tq^j)^k r^{n-k}\right) \\
&\equiv \sum_{t=0}^{q-1}\sum_{r=1}^{q^j} \left( r^n+ntq^jr^{n-1}+0\right) \qquad\text{(by Lemma \ref{div-by-qpowers-lemma})} \\
&\equiv \sum_{t=0}^{q-1} \left( S_n(q^j) + ntq^j S_{n-1}(q^j)\right)\\
&\equiv qS_n(q^j) + n\frac{(q-1)q}{2}q^j S_{n-1}(q^j)\\
&\equiv 0\pmod{q^{i+j+1}}. \qquad (\text{since $q^i\divides n$})
\end{align*}
\end{proof}

\section{Periodicity}
\label{periodicity-section}

In this section, we first establish the periodicity of the sequence of sequences $((S_n(m)\bmod k)_{n\geq 1})_{m\geq 1}$ for any $k \in \mathbb{N}$. An immediate implication of this result is that the sequence $(S_n(m)\bmod k)_{m\geq 1}$ is periodic for all values of $k$ and $n$. We then provide formulas for the length of the period when $k$ is a power of a prime.

\begin{theorem}
\label{row-periodicity-theorem}
For each $k\in\mathbb{N}$, the sequence of sequences
$$( (S_1(m) \bmod{k}, \ S_2(m) \bmod{k}, \ S_3(m) \bmod{k}, \ \dots ))_{m\geq 1}$$
is periodic.
If $k=q_1^{a_1}q_2^{a_2}\cdots q_r^{a_r}$ where $q_i$'s are distinct primes, then the period is $q_1^{a_1+1}q_2^{a_2+1}\cdots q_r^{a_r+1}$.
\end{theorem}

\begin{proof}
We will first prove that
$$S_n(m+q^{a+1}) \equiv S_n(m) \pmod{q^a}$$
for all prime $q$ and natural $n$, $m$, and $a$.
We have
\begin{align*}
S_n(m+q^{a+1}) & \equiv S_n(q^{a+1}) + (q^{a+1}+1)^n + \dots + (q^{a+1}+m)^n \\
& \equiv S_n(q^{a+1}) + S_n(m) \\
& \equiv S_n(m) \pmod{q^a}
\end{align*}
since $S_n(q^{a+1})\equiv 0$ (mod $q^a$) by Corollary \ref{generalized-congruency-corollary}.\\
Thus, the sequence of sequences
$$((S_1(m)\bmod{q^a}, \ S_2(m)\bmod{q^a}, \ S_3(m)\bmod{q^a}, \ \dots ))_{m\geq 1}$$
repeats every $q^{a+1}$ terms. Thus it is periodic with period being a factor of $q^{a+1}$. To show that the period is not less than $q^{a+1}$, it is sufficient to show that the sequence does not repeat every $q^a$ terms. More precisely, we will show that $S_n(q^a) \not\equiv S_n(q^{a+1})$ (mod $q^a$) for at least one value of $n$.

Consider $n=q-1$ (or, in fact, any $n$ divisible by $q-1$ if $q$ is odd). By Theorem \ref{known-congruency-theorem} in the case $a=1$, and by Theorem \ref{generalized-congruency-theorem} otherwise, and using Corollary \ref{generalized-congruency-corollary},
$$S_n(q^a)\equiv \varphi(q^a) \not\equiv 0 \equiv S_n(q^{a+1})\pmod{q^a}.$$
Thus the sequence does not repeat every $q^a$ terms, which implies the period is exactly $q^{a+1}$.\\
Next, if $k=q_1^{a_1}q_2^{a_2}\cdots q_r^{a_r}$ where $q_i$'s are distinct primes, then from the case proved above and the Chinese Remainder Theorem, it follows that the period of the sequence is $q_1^{a_1+1}q_2^{a_2+1}\cdots q_r^{a_r+1}$.
\end{proof}

It follows from Theorem \ref{row-periodicity-theorem} that given any values of $k$ and $n$, the sequence
$$(S_n(m)\bmod{k})_{m\geq 1}$$
is periodic with period not exceeding the one given in Theorem \ref{row-periodicity-theorem}.
However, for some values of $k$ and $n$ the period is smaller.
\begin{theorem}
\label{vertical-periodicity-theorem}
For $k,n\in \mathbb{N}$, let $\ell(k,n)$ denote the period of the sequence $(S_n(m)\bmod{k})_{m\geq 1}$. Then
\begin{enumerate}
\item[(1)] $\ell(2,n)=4$ for all $n$.

\item[(2)] for $a\ge 2$,

$$\ell(2^a, n)=\begin{cases}
2^{a+1}, & \text{ if } n=1 \text{ or } 2 \divides n; \\
2^a, & \text{ otherwise}.
\end{cases}$$

\item[(3)] for $q$ an odd prime and $a\ge 1$,
$$\ell(q^a,n) = \begin{cases}
q^{a+1}, & \text{ if } q-1 \divides n; \\
q^{a-i}, & \text{ if } q-1\notdivides n, \ \nu_q(n) = i, \ 0 \le i \le a-2; \\
q, & \text{ if } q-1\notdivides n \text{ and } q^{a-1} \divides n,
\end{cases}$$
where $\nu_q(n)$ is the exponent of the highest power of $q$ that divides $n$.
\end{enumerate}
\end{theorem}

\begin{proof}
\begin{enumerate}
\item[(1)]
Theorem \ref{row-periodicity-theorem} implies that $\ell(2,n)$ is a factor of $4$. Since
$$\begin{array}{r@{\ }l}
1^n & \equiv 1 \pmod 2,\\
1^n+2^n & \equiv 1 \pmod 2,\\
1^n+2^n+3^n & \equiv 0 \pmod 2,\\
1^n+2^n+3^n+4^n & \equiv 0 \pmod 2,
\end{array}$$
$\ell(2,n)=4$.
\item[(2)]
Let $a \ge 2$.

If $n = 1$ or $2 \divides n$, by Theorem \ref{generalized-congruency-theorem} (1) we have $S_n(2^a) \equiv \varphi(2^a)$ (mod $2^a$). However, Theorem \ref{row-periodicity-theorem} implies that $\ell(2^a,n)$ is a factor of $2^{a+1}$, and hence must be $2^{a+1}$.

If $n > 1$ and $2 \notdivides n$, Theorem \ref{generalized-congruency-theorem} (1) implies that $S_n(2^a) \equiv 0$ (mod $2^a$).

We have
\begin{align*}
S_n(m+2^{a}) & \equiv S_n(2^{a}) + (2^{a}+1)^n + \dots + (2^{a}+m)^n \\
& \equiv S_n(2^{a}) + S_n(m) \\
& \equiv S_n(m)  \pmod{2^a}.
\end{align*}
Thus, $\ell(2^a,n)$ is a factor of $2^a$. We now show that $\ell(2^a,n)$ is not smaller than $2^a$. Assume to the contrary that $\ell(2^a,n)$ is a factor of $2^{a-1}$. Then $$S_n(2^{a-1})\equiv S_n(2^a)\equiv0\pmod{2^a},$$ but then
\begin{align*}
S_n(2^{a-1}+1) & \equiv S_n(2^{a-1}) + (2^{a-1}+1)^n \\
& \equiv 0 + 1^n + n2^{a-1} + \sum_{k=2}^n \binom{n}{k}(2^{a-1})^k 1^{n-k} \\
& \equiv 1^n + n2^{a-1}\\
& \not\equiv 1^n \qquad \text{(since $n$ is odd)} \\
& \equiv S_n(1) \pmod{2^a},
\end{align*}
which is a contradiction.

\item[(3)] Let $q$ be an odd prime and $a\ge 1$.

The case $q-1\divides n$ follows from the proof of Theorem \ref{row-periodicity-theorem}.

If $q-1\notdivides n$ and $q^i\divides n$ for $0\le i\le a-1$,
then by Theorem \ref{generator-block-theorem}
$$S_n(q^{a-i})\equiv 0\pmod{q^a}.$$
Then
\begin{align*}
S_n(m+q^{a-i}) & \equiv S_n(q^{a-i})+\sum_{r=1}^m(q^{a-i}+r)^n \\
& \equiv 0 + \sum_{r=1}^m \left(r^n +\sum_{k=1}^n \binom{n}{k} (q^{a-i})^k r^{n-k}\right)\\
& \equiv \sum_{r=1}^m r^n \qquad \text{(by Lemma \ref{div-by-qpowers-lemma})}\\
& \equiv S_n(m) \pmod{q^a},
\end{align*}
so $\ell(q^a,n)$ is a factor of $q^{a-i}$.

We will show that if $q^{i+1}\notdivides n$ for $0\le i\le a-2$, then $\ell(q^a,n)$ is not smaller than $q^{a-i}$. Assume to the contrary that $\ell(q^a,n)$ is a factor of $q^{a-i-1}$. Then
$$S_n(q^{a-i-1})\equiv S_n(q^{a-i}) \equiv 0 \pmod{q^a},$$
but then
\begin{align*}
S_n(q^{a-i-1}+1) & \equiv S_n(q^{a-i-1}) + (q^{a-i-1}+1)^n \\
& \equiv 0 + 1^n + nq^{a-i-1} + \sum_{k=2}^n \binom{n}{k}(q^{a-i-1})^k 1^{n-k} \\
& \equiv 1^n + nq^{a-i-1} + 0 \qquad \text{(by Lemma \ref{div-by-qpowers-lemma})} \\
& \not\equiv 1^n \qquad \text{(since $q^{i+1}\notdivides n$)} \\
& \equiv S_n(1) \pmod{q^a},
\end{align*}
which is a contradiction.

Thus we have shown that for $0\le i\le a-2$, if $q-1\notdivides n$, and $\nu_q(n) = i$, then $\ell(q^a,n)$ is a factor of $q^{a-i}$ but not a factor of $q^{a-i-1}$. Therefore, $\ell(q^a,n)=q^{a-i}$.

In the last case ($q-1\notdivides n$ and $q^{a-1}\divides n$), we have shown above that $\ell(q^a,n)$ is a factor of $q$. However,
$$S_n(1)\equiv 1 \not\equiv 0 \equiv S_n(q) \pmod{q^a},$$
so $\ell(q^a,n)\neq 1$. Therefore, $\ell(q^a,n)=q$.
\end{enumerate}
\end{proof}

\begin{section}{Acknowledgment}
The authors would like to thank the College of Science and Mathematics at California State University, Fresno for supporting this work.
\end{section}

Congruences of Power Sums