  In order to test if an unknown matrix has a given rank (null hypothesis), we
consider the family of statistics that are minimum squared distances between an
estimator and the manifold of fixed-rank matrix. Under the null hypothesis,
every statistic of this family converges to a weighted chi-squared
distribution. In this paper, we introduce the constrained bootstrap to build
bootstrap estimate of the law under the null hypothesis of such statistics. As
a result, the constrained bootstrap is employed to estimate the quantile for
testing the rank. We provide the consistency of the procedure and the
simulations shed light one the accuracy of the constrained bootstrap with
respect to the traditional asymptotic comparison. More generally, the results
are extended to test if an unknown parameter belongs to a sub-manifold locally
smooth. Finally, the constrained bootstrap is easy to compute, it handles a
large family of tests and it works under mild assumptions.
