  In this article we extend and strengthen the seminal work by Niyogi, Smale,
and Weinberger on the learning of the homotopy type from a sample of an
underlying space. In their work, Niyogi, Smale, and Weinberger studied samples
of $C^2$ manifolds with positive reach embedded in $\mathbb{R}^d$. We extend
their results in the following ways: In the first part of our paper we consider
both manifolds of positive reach -- a more general setting than $C^2$ manifolds
-- and sets of positive reach embedded in $\mathbb{R}^d$. The sample $P$ of
such a set $\mathcal{S}$ does not have to lie directly on it. Instead, we
assume that the two one-sided Hausdorff distances -- $\varepsilon$ and $\delta$
-- between $P$ and $\mathcal{S}$ are bounded. We provide explicit bounds in
terms of $\varepsilon$ and $ \delta$, that guarantee that there exists a
parameter $r$ such that the union of balls of radius $r$ centred at the sample
$P$ deformation-retracts to $\mathcal{S}$.
  In the second part of our paper we study homotopy learning in a significantly
more general setting -- we investigate sets of positive reach and submanifolds
of positive reach embedded in a \emph{Riemannian manifold with bounded
sectional curvature}. To this end we introduce a new version of the reach in
the Riemannian setting inspired by the cut locus. Yet again, we provide tight
bounds on $\varepsilon$ and $\delta$ for both cases (submanifolds as well as
sets of positive reach), exhibiting the tightness by an explicit construction.
