GI

    Global Illumination
CD

    Chamfer Distance
EMD

    Earth Mover’s Distance
HD

    Hausdorff Distance
LOP

    Locally Optimal Projection
GAN

    Generative Adversarial Network
MLP

    Multi Layer Perceptron
TSDF

    Truncated Signed Distance Function

# Point Cloud Upsampling and Normal Estimation using Deep Learning for Robust
Surface Reconstruction

Rajat Sharma1, Tobias Schwandt1, Christian Kunert1, Steffen Urban2 and
Wolfgang Broll1
1Ilmenau University of Technology, Virtual Worlds and Digital Games Group,
Ehrenbergstraße 29, Ilmenau, Germany
2Carl Zeiss AG, Corporate Research and Technology, Carl-Zeiss-Promenade 10,
Jena, Germany
{rajat.sharma, tobias.schwandt<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>

###### Abstract

The reconstruction of real-world surfaces is on high demand in various
applications. Most existing reconstruction approaches apply 3D scanners for
creating point clouds which are generally sparse and of low density. These
points clouds will be triangulated and used for visualization in combination
with surface normals estimated by geometrical approaches. However, the quality
of the reconstruction depends on the density of the point cloud and the
estimation of the surface normals. In this paper, we present a novel deep
learning architecture for point cloud upsampling that enables subsequent
stable and smooth surface reconstruction. A noisy point cloud of low density
with corresponding point normals is used to estimate a point cloud with higher
density and appendant point normals. To this end, we propose a compound loss
function that encourages the network to estimate points that lie on a surface
including normals accurately predicting the orientation of the surface. Our
results show the benefit of estimating normals together with point positions.
The resulting point cloud is smoother, more complete, and the final surface
reconstruction is much closer to ground truth.

##  1 INTRODUCTION

Point clouds are one special representation of objects in 3D space. The recent
availability of large range 3D scanner devices has led to the research and
development in many areas of point cloud processing [Weinmann, 2016].
Classically, large amounts of handcrafted features were extracted from the
point clouds (e.g., eigenvalues or entropy), making sophisticated neighborhood
and feature selection necessary. Although in the area of deep learning, there
has not been much done in the early years. But since the adaption of PointNet
[Qi et al., 2016] and PointNet++ [Qi et al., 2017] much work has been done on
point clouds. These deep networks are trained to alleviate the process of
feature engineering and selection and have done very well in the area of
object classification and segmentation. The feature extraction and
classification accuracy is further improved with new architectures like Graph-
CNNs [Zhang and Rabbat, 2018] using graph convolution and Dynamic Graph-CNNs
[Wang et al., 2019] which also extracts edge features using edge convolution.

In the case of deep learning, the representation of a 3D object in space is
very important as this basically determines the network structure as well as
input and output representations. In case of volumetric representation, the
network is applied to a 3D voxel grid structure demonstrated in VoxNet
[Maturana and Scherer, 2015], OctnetFusion [Riegler et al., 2017b].

In our work, we use point based representation to perform point cloud
densification. Approaches such as PU-Net [Yu et al., 2018b], EC-Net [Yu et
al., 2018a] etc. considers the problem of upsampling the point clouds. All of
these approaches consider only point cloud as output but we also estimate the
normals by upsampling. Surface normals are also an important property of point
clouds. It has applications in surface reconstruction, rendering as well as
lighting calculations of 3D model which motivates us to estimate point cloud
with normals. We compare our results with some of the mentioned approaches in
this paper. In conclusion our main contributions are:

  * •

the extraction of features from 3D point cloud patches to upsample a input
point cloud using feature reshaping.

  * •

being one of the first approaches for an accurate prediction of surface
normals along with upsampled point clouds using a neural network.

  * •

a novel loss function consisting of point and normal loss for a more accurate
upsampling.

This paper is structured as follows: in section 1, a brief introduction into
the research topic is provided with some specific related work in section 2.
Subsequently in section 3, the network architecture as well as the feature
embedding and reshaping is emphasized. Section 4 describes the changes of the
loss function made to the architecture. The result of the new provided
approach is shown in section 5 in comparison to other related approaches.
Inside section 6, the findings and limitations are discussed. Next, all
findings are concluded in section 7 with a brief discussion and some possible
future work.

##  2 RELATED WORK

In this section, we will review existing approaches based on upsampling of
point clouds and how they are different from our approach. After discussing
classic optimization based methods, we will then look into methods based on
deep learning.

Early work on denoising point clouds is done in Parameterization-free
Projection for Geometry Reconstruction [Lipman et al., 2007] which uses the
Locally Optimal Projection (LOP) operator for surface prediction. In addition,
this method introduces a regularization term to move the point near to the
surface. [Huang et al., 2009] proposes weighted LOP (WLOP) to get a denoised
and evenly distributed point cloud. In addition, it also estimates the point
normals. Since these methods work well but fail at very sharp edges, [Huang et
al., 2013] introduces edge aware resampling to preserve the features at sharp
edges. It first resamples points away from edges and calculate the normals.
Based on these reliable points and normals, it progressively resamples towards
the edges. L0 Minimization [Sun et al., 2015] takes point cloud and normals as
input and resamples it such that all point lies on the surface with correct
normals.

Initially, volumetric approaches were used to make high resolution voxel grids
using deep learning for accurate surface reconstruction. VoxNet [Maturana and
Scherer, 2015] uses 3D convolution on voxel grids for the classification tasks
but the approach is limited to a $32^{3}$ resolution. However, the Octnet
[Riegler et al., 2017b] approach utilizes the convolution operation up to a
level of $256^{3}$ using space partitioning by converting 3D voxel grids into
small octree structures. Based on Octnet, OctnetFusion [Riegler et al., 2017a]
takes low resolution Truncated Signed Distance Function (TSDF) volume and
estimates higher resolution TSDF volume. Similarly, other approaches like
[Häne et al., 2019] also use octrees instead of 3D volumes. Depending on this
concrete data structure, these approaches suffer from performance issue like
memory and timing requirements when increasing the input resolution.

In the point cloud domain, PU-Net [Yu et al., 2018b] introduced a first point
upsampling network. They divide the mesh into small patches and group the
point w.r.t. different radii values and extract features. Subsequently, all
features are concatenated and reshaped to yield upscaled point features. Based
on this architecture, they introduced another network that preserves sharp
edges called EC-Net [Yu et al., 2018a]. There is another network based on
Generative Adversarial Networks [Goodfellow et al., 2014], PU-GAN [Li et al.,
2019]. All these methods directly employ neural network on point cloud. Recent
work PUGeo-Net [Qian et al., 2020] uses surface parameterization to map 3D
surface to 2D parametric domain. They also estimates the normals with
upsampled points. In contract to this method, our method is directly employed
on point cloud.

Some work was also done on generating point clouds from single images such as
PointSetGeneration [Fan et al., 2016] and DensePCR [Mandikal and Babu, 2019].
In addition, DensePCR also upsamples the generated point cloud using multiple
stages . But all these above networks only consider point clouds as output.
Point normals are also an important property for many applications from
surface reconstruction to rendering. Using classical techniques, normal
calculation are subjective to noise and outliers. In this paper, we propose to
predict not only the point positions but also the corresponding normals using
deep learning.

Similarly for normals prediction, as of now PCPNET [Guerrero et al., 2018] and
Nesti-Net [Ben-Shabat et al., 2018] are existing deep learning approaches.
PCPNET uses multi-level patches based on different scale and predicts normals.
Similarly, Nesti-Net modifies the representation of point clouds to multi-
scale point statistics (MuPS) which is then fed as input to CNN network. These
networks only predict normals w.r.t. corresponding point clouds. In our work,
we are upsampling the point clouds and predict normals for each point with
higher accuracy.

i) Input points$X_{n}$ Input points with normals n x 6 ii) Local Feature
Extraction Module Input points with normals n x 6 Circles containing neighbor
points mlp(32, 64, 128)shared Neighborhood feature max pooling $X_{l}$n x
512local featuresiii) Global Feature Extraction Module Input points with
normals mlp(32, 64, 64, 128, 256, 512)sharedn x 512 max pool $X_{g}$512global
features iv) Concatenated features $X_{n}$$X_{l}$$X_{g}$n x (6 + 128 +
512)mlp(512, 256, 128)sharedn x 128 v) Features reshaping - I 2n x 64mlp(64,
32)shared2n x 32 vi) Features reshaping - II 4n x 16mlp(16, 6)4n x 6 vii)
Dense Point Cloud with normals Figure 1: Proposed network architecture for
point cloud upsampling and normal estimation i) Input point cloud with normals
ii) Local feature extraction iii) Global feature extraction iv) Feature
concatenation v) Feature reshaping in points dimension by factor of 2 followed
by series of shared MLPs vi) Feature reshaping in points dimension by factor
of 2 followed by series of shared MLPs vii) Output point cloud with normals.

##  3 NETWORK ARCHITECTURE

For a given point cloud, our deep learning architecture upsamples the applied
input and predicts the point normals such that all points lie on the
underlying surface with uniform distribution. Our deep learning network
includes feature embedding, feature reshaping (expansion in point dimension),
and point coordinate regression. The transformation of the input point cloud
to feature space is discussed in 3.1. Here, feature extraction and
concatenation is done. The reshaping of features in point dimensions to
upsample points is discussed in section 3.2. After feature expansion, a series
of shared Multi Layer Perceptrons with shared weights regresses the output
point clouds with normals which is discussed in section 3.3. All these
components allow us to capture upsampled point clouds with point normals. The
detailed architecture is depicted in Figure 1.

###  3.1 Feature Embedding

The main intent of the network is to capture the salient features of the input
point cloud to learn its neighbor points. This is done by transforming the
input points to high level vector space (called features). In our network, we
use a combination of global and local feature extraction to better capture the
properties of the point cloud.

####  3.1.1 Global Features

The knowledge of global features gives the network a better understanding of
the object as a whole, e.g., features such density and spacing are model
specific. The PointNet [Qi et al., 2016] architecture uses a series of shared
MLPs with shared weights to extract the global features for classification and
segmentation tasks. We also uses the same network to extract global features.
For a input point cloud $X_{p}$ with shape $n\times 6$, the output of global
features $X_{g}$ is $1\times g$ where $g$ is the number of features extracted
in the last MLP layer.

####  3.1.2 Local Features

Global features only capture the overall property of an object but do not
contain information about local properties. Local features are the most
essential part of this network. The local features carry the neighborhood
properties as well as surface properties such as normals. Local features prove
to be very helpful in tasks like point cloud segmentation or surface
estimation. We have PointNet [Qi et al., 2016] that extracts features per
point by using a series of MLPs. But it does not induce local features based
on distance metrics. An improvement to PointNet, PointNet++ [Qi et al., 2017]
captures patches of neighborhood points for every point in the input set and
performs a series of MLPs on every patch and captures local information. We
use a series of sample and grouping modules at different scales like in
PointNet++ to extract hierarchical features and combine all those information
into a single feature layer. This is also called multi-resolution grouping.
For an input point cloud $X_{p}$ with shape $n\times 6$, the output of local
features $X_{l}$ is $n\times l$ where $l$ is the number of features extracted
in the last MLP layer of local features module.

####  3.1.3 Feature Concatenation

We concatenate all the learned features, i.e., global as well as local
features with input features (i.e., input point cloud) along the feature
dimension. The output after concatenation is $n\times(6+l+g)$. Then again we
uses a series of MLPs on these concatenated features before doing feature
reshaping. The output shape after these operation is $n\times d$ where $d$ is
multiple of the scaling factor(=`up_ratio`, which is 4 in our case).

###  3.2 Feature Reshaping

Feature reshaping is used to expand features in point dimension space. Since
both points and features are interchangeable this means that the learned
features can also be the neighbor points. Taking this idea, we reshape our
features in point dimension to upscale the points. The new shape of point
features after this operation is
$(n\times\verb|up_ratio|)\times(d\div\verb|up_ratio|)$. Reshaping is always
done by a factor of 2.

###  3.3 Coordinates Regression

After feature reshaping, we use series of MLPs layers to regress point cloud
outputs with corresponding normals. The shape of output point cloud is
$(n\times\verb|up_ratio|)\times 6$. The validation of the final output w.r.t.
the ground truth is done by a compound loss function which is discussed in the
next section.

##  4 LOSS FUNCTION

We propose a compound loss function that consists of point and normal losses.
The point loss is presented in section 4.1 and the normal loss in section 4.2.

###  4.1 Point Loss

For point clouds, the Chamfer Distance (CD) [Fan et al., 2017] and Earth
Mover’s Distance (EMD) [Rubner et al., 2000] are the most suitable cost
functions. CD tries to find the minimum distance between two sets of points,
i.e., in our case the ground truth and the estimated point clouds. In the
following, let the ground truth point cloud be $X_{p}$ and the network output
be $\widehat{X}_{p}$. The CD is defined as:

$\begin{split}d_{cd}(\widehat{X}_{p},X_{p})=\sum_{x\in\widehat{X}_{p}}\underset{y\in
X_{p}}{min}\left\|x-y\right\|_{2}^{2}\\\ +\sum_{y\in
X_{p}}\underset{x\in\widehat{X}_{p}}{min}\left\|x-y\right\|_{2}^{2}\end{split}$
(1)

EMD tries to solve an optimization problem. The mathematical equation of EMD
for output $\widehat{X}_{p}$ and ground truth $X_{p}$ is shown in Eq. (2)
where $\phi:\widehat{X}_{p}\rightarrow X_{p}$ is a bijection:

$d_{emd}(\widehat{X}_{p},X_{p})=\underset{\phi:\widehat{X}_{p}\rightarrow
X_{p}}{min}\sum_{x\in\widehat{X}_{p}}\left\|x-\phi(x))\right\|_{2}$ (2)

Both functions are fully differentiable. A Comparison of both functions can be
seen in [Fan et al., 2017]. However, EMD is more accurate than the CD. EMD is
more computationally intensive and requires more time and memory for high
density point clouds. In our network, we choose CD as a cost function for the
point loss.

It may happen that the predicted points lie too close to their neighbor points
and this may lead to a non-uniform gathering of points in the point cloud.
This behavior is depicted in Figure 2

Underlying surface Original points on underlying surface Predicted points
Expected points on surface Figure 2: Non-uniform gathering of predicted points
around the original points in the case of optimization using the chamfer
distance CD.

Therefore, we also include point neighbor loss as shown in Figure 3. This
ensures that the new points are not only closer to the ground truth but also
to K nearest points in the predicted points. The nearest neighbor loss is
shown in Eq. (3). For our training, we set k = 15.

Underlying surface Original points on underlying surface New points Containing
k neighbor points $P_{0}$ to $P_{k-1}$ knn points Figure 3: Uniform
distribution on underlying surface using knn point distance minimization.

$d_{point\\_knn}(\widehat{X}_{p},X_{p})=\underset{x\in\widehat{X}_{p}}{min}\sum_{i=0}^{k-1}\left\|x-y_{i}\right\|_{2}^{2}$
(3)

where: $y_{i}\in X_{p}$ are the k nearest neighbors to x.

Hence, the overall loss function for points is a combination of both CD and
nearest neighbor loss.

###  4.2 Normal Loss

For predicting accurate normals, we use a compound loss function too. For all
predicted points in the upsampled point cloud, the corresponding point normals
should be close to the ground truth and the adjacent points. This also ensures
that surface reconstruction (e.g., using Poisson Reconstruction) is robust.
Hence, we use an euclidean distance metric to calculate the deviation between
estimated and ground truth point normals. The normal loss between predicted
normals $\widehat{N}_{p}$ and ground truth normals $N_{p}$ is shown in Eq.
(4).

$l_{normal}(\widehat{N}_{p},N_{p})=\underset{}{min}\sum_{\widehat{n}\epsilon\widehat{N}_{p},n\in
N_{p}}\left\|\widehat{n}-n\right\|_{2}^{2}$ (4)

In addition, we need to take care that the estimated normals are orthogonal to
the underlying surface. Since normals are perpendicular to the surface, we
measure the cosine similarity which is shown in Eq. (5).

$\begin{split}l_{normal\\_orth}(\widehat{X}_{p},\widehat{N}_{p})=min\sum_{i=0}^{k-1}\frac{\left\langle
p_{l}-p_{i},n_{l}\right\rangle}{\left\|p_{l}-p_{i}\right\|\left\|n_{l}\right\|}\end{split}$
(5)

where: $p_{i},p_{l}\in X_{p}$, $p_{i}$ are knn to $p_{l}$ and $n_{l}$ normal
to $p_{l}$, $\left\langle P,N\right\rangle$ is a dot product.

Moreover, we took the assumption that for every k nearest point the normals
should be the same. Therefore, we try to minimize this difference for each
estimated normal. This term acts as an additional regularization on normal
estimation and enforces a smooth neighborhood. For our training, we set k =
15. The loss is shown in Eq. (6).

$l_{normal\\_knn}(\widehat{N}_{p})=\underset{x\in\widehat{N}_{p}}{min}\sum_{i=0}^{k-1}\left\|x-y_{i}\right\|_{2}^{2}$
(6)

where: $y_{i}\in\widehat{N}_{p}$ are knn normals to x.

####  4.2.1 Overall Loss

The overall loss function is a combination of both point loss and normal loss.
Since the main objective is that new points are close to the input points,
more weight is given to the point CD loss. The final loss function for
training the network is given below with their corresponding weights. For our
training we set $\textit{w}_{1}$ = 1,$\textit{w}_{2}$ = 0.1, $\textit{w}_{3}$
= 0.05, $\textit{w}_{4}$ = 0.0001, $\textit{w}_{5}$ = 0.0001. We set larger
values for the weights of point loss as compared to normal loss. The weights
used by the loss function are selected based on ablation study. We visualized
the effect of different weights on the output results and thus, came up with
these weights. The knn loss for normal shows more error in case of sharp edges
thus have very small weight.

$\begin{split}loss=\textit{w}_{1}d_{cd}+\textit{w}_{2}d_{point\\_knn}+\textit{w}_{3}l_{normal}\\\
+\textit{w}_{4}l_{normal\\_orth}+\textit{w}_{5}l_{normal\\_knn}\end{split}$
(7)

##  5 EVALUATION

###  5.1 Implementation Details and Network Training

We implemented our network shown in Figure 1 using the PyTorch framework. The
architecture is based on the PyTorch implementation of
pointnet++111https://github.com/erikwijmans/Pointnet2“˙PyTorch for our
network. Our code is open-source and available
online222https://github.com/rjtshrm/point-normals-upsampling.

However, the input point cloud size is set to 4096 points. We use the Adam
optimizer [Kingma and Ba, 2014] with a learning rate of $1e-3$ and a weight
decay of $1e-5$. The batch size is set to 20 and we train the network for 500
epochs. For inference, we do not feed the entire input to the network. We
create patches of input point clouds and process each patch individually.
Merging all upsampled patches results in very large number of points in the
final result and points may be too closer in the overlapping region.
Therefore, we use farthest point sampling to sample the merged point cloud
patches to exactly four times of the size of the input point cloud.

###  5.2 Datasets

Since there are no datasets directly available for point cloud upsampling with
normal inference, we create them artificially by downsampling point clouds
from existing point cloud datasets. We use the PU-Net [Yu et al., 2018b]
dataset providing point cloud patches segmented from large meshes. The dataset
consists of 4000 patches containing 4096 points in each point cloud with
corresponding normals. We use non-uniform downsampling to extract 1024 points
from each point cloud to feed them as input to the network. To avoid
overfitting, we apply on-the-fly data augmentation using random shifting,
rotation, scaling, and adding random Gaussian noise.

pc-1pc-2pc-3pc-4i) Inputii) PU-Netiii) EC-Netiv) Oursv) Ground truth

Figure 4: Upsampled point clouds from different methods with input of 5000
point clouds i) Input ii) PU-Net results iii) EC-Net results iv) Our results
v) Ground truth

pc-1pc-2pc-3pc-4i) Inputii) PU-Netiii) EC-Netiv) Our Normalsv) Our
reconstructionvi) Ground truth

Figure 5: Reconstruction results from different methods with input of 5000
point clouds i) Input ii) PU-Net results iii) EC-Net results iv) Our normals
v) Our reconstruction vi) Ground truth

###  5.3 Results and Comparisons

In this section, we will compare the results from our network w.r.t. to other
upsampling networks PU-Net [Yu et al., 2018b], EC-Net [Yu et al., 2018a]. We
use chamfer distance CD and Hausdorff Distance (HD) [Berger et al., 2013] for
the evaluation of the network output. All methods have been tested with an
upsampling ratio of 4. Figure 5 shows our results w.r.t. other approaches. It
can be clearly seen from the figure that PU-Net results are more noisy on the
surface as compared to EC-Net. But our results clearly outperform both PU-Net
and EC-Net and are less prone to noise. The quantitative results for Figure 5
is shown in Table 1. It can be infered from the table that the values of CD
and HD for our network are small when compared to PU-Net and EC-Net.

Table 1: Quantitative result with n=5000 points. $10^{-3}$ | Method | pc-1 | pc-2 | pc-3 | pc-4
---|---|---|---|---|---
CD | PU-Net | 0.26 | 0.22 | 0.19 | 0.15
EC-Net | 0.20 | 0.058 | 0.13 | 0.03
Ours | 0.18 | 0.06 | 0.036 | 0.028
HD | PU-Net | 10.63 | 10.04 | 10.14 | 8.84
EC-Net | 9.37 | 4.01 | 4.65 | 4.00
Ours | 9.02 | 3.76 | 4.00 | 3.86

For normal evaluation, we compare the final surface reconstruction based on
the predicted normals and ground truth meshes. We use meshlab [Cignoni et al.,
2008] to reconstruct the point cloud to a 3D model. The final Poisson
Reconstructions for the predicted point clouds as shown in Figure 5 are
depicted in Figure 5.

i) Ground truthii) PU-Netiii) Quality (PU-Net) w.r.t. ground truthii) Oursiii)
Quality (Ours) w.r.t. ground truthii) EC-Netiii) Quality (EC-Net w.r.t. ground
truth Figure 6: Quality of our result w.r.t. ground truth for bunny dataset
containing 20000 point clouds i) Ground truth ii) Our, PU-Net, EC-Net results
(4x upsampling with input of 5000 point clouds) iii) Vertex Quality mapper
(deviation from ground truth using red-green-blue color map) Red=zero error,
Blue=high error.

Figure 6 shows the deviation of the final mesh compared to the ground truth
using RGB color coding. Red color represents the zero error, blue represents
maximum error and the transition from red to blue has increasing error values.
It can be seen that our results for the bunny dataset are better when compared
to PU-Net and EC-Net. Figure 8 depicts some additional results of our method
compared to state-of-the-art approaches. In the first row (head point cloud),
PU-NET creates multiple layers on the surface which leads to wrong surface
reconstructions. Similarly EC-NET estimates a point cloud that is more noisy
than ours. Unlike these networks, our network also predicts the normals which
can be seen in last column Figure 8. The reconstruction based on these normals
is shown in Figure 8.

i) Inputii) Input normalsiii) PU-Netiv) EC-Netv) Oursvi) Our with normals

Figure 7: Additional results: Upsampled point clouds from different method
w.r.t. to others (Input 5000 points and 4x upsampled output) i) Input point
cloud ii) Input normals iii) PU-Net results iv) EC-Net results v) Our results
(point cloud) vi) Our results (point cloud normals)

i) PU-Netii) EC-Netiii) Ours

Figure 8: Additional results: Surface reconstruction result comparisons of
different architecture w.r.t. to others (Input 5000 points and 4x upsampled
output) i) PU-Net ii) EC-Net iii) Ours

##  6 DISCUSSION AND LIMITATIONS

Point clouds are an important representation for 3D objects. They have a wide
range of applications from visualization and rendering to surface
reconstruction. These applications also consider surface normals in addition
to the points. Therefore, our approach additionally estimates surface normals
along with the upsampled point cloud. We showed that both global features as
well local features are required to learn the geometry of an input point
cloud. The output point cloud based on our feature extraction and
concatenation is more accurate and estimated surface normals are mostly
oriented in the correct direction. It can be seen from the results that our
method predicts more consistent and less noisy point clouds compared to the
state of the art (PU-Net and EC-Net). The final surface reconstruction based
on the output point normals is also better.

i) Oursii) GTiii) Our reconstructioniv) GT reconstruction Figure 9: Upsampling
results of sparse point cloud (input = 625 points and output = 25000 points).

But our network also has some limitations. One of the limitations is that our
network does not work well on very sparse inputs. Our results can be seen in
Figure 9 w.r.t. to the ground truth. The normals predicted for sparse inputs
are also not oriented in the right direction which is why the final
reconstruction is also distorted. We also apply a patch based approach for the
inference and this may result in misalignments at the patch borders. Hence,
the Poisson Reconstruction is not perfectly smooth in areas where patches
overlap. Also, our network is not capable of shape completion, i.e., it does
not synthesize missing parts in shapes. Our main focus in this paper was to
upsample point clouds. Shape completion is a separate problem, requiring
further research.

##  7 CONCLUSION

In this paper, we presented a deep learning network to not only upsample the
point cloud but also to estimate corresponding surface normals. Our network
uses input features, local, and global features to learn the final estimation
of point cloud data. We introduced feature reshaping in point dimension to
upsample the point clouds. We also introduced a compound loss function
combining point and normal loss. It ensures that new points are on underlying
surfaces and the normals estimated are orthogonal to surfaces with correct
orientations. Moreover, we showed that predicting normals results in smoother
and more consistent upsampled point clouds. This is especially beneficial for
tasks like surface reconstruction. In this work, we focused on raw point
clouds with normals. In future work we will also extend the network to include
colored point clouds and estimate the color for each upsampled point. Another
direction of future work is looking into shape completion to fill in holes in
the input point cloud, which often result from real world scans.

## ACKNOWLEDGEMENTS

The underlying research of these results has been partially funded by the Free
State of Thuringia with the number 2015 FE 9108 and co-financed by the
European Union as part of the European Regional Development Fund (ERDF).

## REFERENCES

  * Ben-Shabat et al., 2018 Ben-Shabat, Y., Lindenbaum, M., and Fischer, A. (2018).  Nesti-net: Normal estimation for unstructured 3d point clouds using convolutional neural networks.  arXiv preprint arXiv:1812.00709.
  * Berger et al., 2013 Berger, M., Levine, J. A., Nonato, L. G., Taubin, G., and Silva, C. T. (2013).  A benchmark for surface reconstruction.  ACM Trans. Graph., 32(2):20:1–20:17.
  * Cignoni et al., 2008 Cignoni, P., Callieri, M., Corsini, M., Dellepiane, M., Ganovelli, F., and Ranzuglia, G. (2008).  MeshLab: an Open-Source Mesh Processing Tool.  In Scarano, V., Chiara, R. D., and Erra, U., editors, Eurographics Italian Chapter Conference. The Eurographics Association.
  * Fan et al., 2016 Fan, H., Su, H., and Guibas, L. J. (2016).  A point set generation network for 3d object reconstruction from a single image.  CoRR, abs/1612.00603.
  * Fan et al., 2017 Fan, H., Su, H., and Guibas, L. J. (2017).  A point set generation network for 3d object reconstruction from a single image.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 605–613.
  * Goodfellow et al., 2014 Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014).  Generative adversarial nets.  In Advances in neural information processing systems, pages 2672–2680.
  * Guerrero et al., 2018 Guerrero, P., Kleiman, Y., Ovsjanikov, M., and Mitra, N. J. (2018).  PCPNet: Learning local shape properties from raw point clouds.  Computer Graphics Forum, 37(2):75–85.
  * Häne et al., 2019 Häne, C., Tulsiani, S., and Malik, J. (2019).  Hierarchical surface prediction.  TPAMI.
  * Huang et al., 2009 Huang, H., Li, D., Zhang, H., Ascher, U., and Cohen-Or, D. (2009).  Consolidation of unorganized point clouds for surface reconstruction.  ACM SIGGRAPH Asia 2009 papers on - SIGGRAPH Asia ’09, page 1.
  * Huang et al., 2013 Huang, H., Wu, S., Gong, M., Cohen-Or, D., Ascher, U., and Zhang, H. R. (2013).  Edge-aware point set resampling.  ACM Transactions on Graphics, 32(1):1–12.
  * Kingma and Ba, 2014 Kingma, D. P. and Ba, J. (2014).  Adam: A method for stochastic optimization.  arXiv preprint arXiv:1412.6980.
  * Li et al., 2019 Li, R., Li, X., Fu, C.-W., Cohen-Or, D., and Heng, P.-A. (2019).  Pu-gan: a point cloud upsampling adversarial network.  In IEEE International Conference on Computer Vision (ICCV).
  * Lipman et al., 2007 Lipman, Y., Cohen-Or, D., Levin, D., and Tal-Ezer, H. (2007).  Parameterization-free projection for geometry reconstruction.  ACM Transactions on Graphics, 26(3):22.
  * Mandikal and Babu, 2019 Mandikal, P. and Babu, R. V. (2019).  Dense 3d point cloud reconstruction using a deep pyramid network.  In Winter Conference on Applications of Computer Vision (WACV).
  * Maturana and Scherer, 2015 Maturana, D. and Scherer, S. (2015).  Voxnet: A 3d convolutional neural network for real-time object recognition.  In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 922–928. IEEE.
  * Qi et al., 2016 Qi, C. R., Su, H., Mo, K., and Guibas, L. J. (2016).  Pointnet: Deep learning on point sets for 3d classification and segmentation.  arXiv preprint arXiv:1612.00593.
  * Qi et al., 2017 Qi, C. R., Yi, L., Su, H., and Guibas, L. J. (2017).  Pointnet++: Deep hierarchical feature learning on point sets in a metric space.  In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems 30, pages 5099–5108. Curran Associates, Inc.
  * Qian et al., 2020 Qian, Y., Hou, J., Kwong, S., and He, Y. (2020).  Pugeo-net: A geometry-centric network for 3d point cloud upsampling.  arXiv, pages arXiv–2002.
  * Riegler et al., 2017a Riegler, G., Ulusoy, A. O., Bischof, H., and Geiger, A. (2017a).  Octnetfusion: Learning depth fusion from data.  In Proceedings of the International Conference on 3D Vision.
  * Riegler et al., 2017b Riegler, G., Ulusoy, A. O., and Geiger, A. (2017b).  Octnet: Learning deep 3d representations at high resolutions.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.
  * Rubner et al., 2000 Rubner, Y., Tomasi, C., and Guibas, L. J. (2000).  The earth mover’s distance as a metric for image retrieval.  International journal of computer vision, 40(2):99–121.
  * Sun et al., 2015 Sun, Y., Schaefer, S., and Wang, W. (2015).  Denoising point sets via L0 minimization.  Computer Aided Geometric Design, 35-36:2–15.
  * Wang et al., 2019 Wang, Y., Sun, Y., Liu, Z., Sarma, S. E., Bronstein, M. M., and Solomon, J. M. (2019).  Dynamic graph cnn for learning on point clouds.  ACM Transactions on Graphics (TOG).
  * Weinmann, 2016 Weinmann, M. (2016).  Reconstruction and Analysis of 3D Scenes: From Irregularly Distributed 3D Points to Object Classes.  Springer Publishing Company, Incorporated, 1st edition.
  * Yu et al., 2018a Yu, L., Li, X., Fu, C.-W., Cohen-Or, D., and Heng, P.-A. (2018a).  Ec-net: an edge-aware point set consolidation network.  In ECCV.
  * Yu et al., 2018b Yu, L., Li, X., Fu, C.-W., Cohen-Or, D., and Heng, P.-A. (2018b).  Pu-net: Point cloud upsampling network.  In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR).
  * Zhang and Rabbat, 2018 Zhang, Y. and Rabbat, M. (2018).  A graph-cnn for 3d point cloud classification.  In International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, Canada.

  *[LOP]: Locally Optimal Projection
  *[TSDF]: Truncated Signed Distance Function
  *[MLPs]: Multi Layer Perceptron
  *[MLP]: Multi Layer Perceptron
  *[CD]: Chamfer Distance
  *[EMD]: Earth Mover’s Distance
  *[HD]: Hausdorff Distance


Wenbo Niu
Department of Mathematical Sciences, University of Arkansas, Fayetteville, AR, 72701, USA

Jinhyung Park
Department of Mathematical Sciences, KAIST, Daejeon 34141, Republic of Korea

J. Park was supported by the National Research Foundation (NRF) funded by the
Korea government (MSIT) (NRF-2021R1C1C1005479).

[2010]14N05, 14B05, 13D02

Dedicated to Professor Sijong Kwak on the occasion of his sixtieth birthday.

The purpose of this paper is to establish a Castelnuovo-Mumford regularity bound for threefolds with mild singularities. Let $X$ be a non-degenerate normal projective threefold in $\P^r$ of degree $d$ and codimension $e$. We prove that if $X$ has rational singularities, then $\reg(X) \leq d-e+2$. Our bound is very close to a sharp bound conjectured by Eisenbud-Goto. When $e=2$ and $X$ has Cohen-Macaulay Du Bois singularities, we obtain the conjectured bound $\reg(X) \leq d-1$, and we also classify the extremal cases.
To achieve these results, we bound the regularity of fibers of a generic projection of $X$ by using Loewy length, and also bound the dimension of the varieties swept out by secant lines through the singular locus of $X$.

§ INTRODUCTION

Throughout the paper, we work over the field $\C$ of complex numbers.
Let $X \subseteq \P^r$ be a non-degenerate projective variety of degree $d$ and codimension $e$.
We say that $X \subseteq \P^r$ is $m$-regular in the sense of Castelnuovo-Mumford if $H^i(\P^r, \mathcal{I}_{X|\P^r}(m-i))=0$ for all $i>0$. It is equivalent to saying that $X \subseteq \P^r$ is $(m-1)$-normal and $\mathcal{O}_X$ is $(m-1)$-regular, i.e., the natural restriction map $H^0(\P^r, \mathcal{O}_{\P^r}(m-1)) \to H^0(X, \mathcal{O}_X(m-1))$ is surjective and $H^i(X, \mathcal{O}_X(m-1-i))=0$ for $i>0$. The minimal such number $m$ is called the Castelnuovo-Mumford regularity of $X$ and is denoted by $\reg(X)$. For more details, we refer to <cit.>.

One of the fundamental problems in projective algebraic geometry is to find a bound for $\reg(X)$ in terms of algebraic and geometric data such as the degree $d$ and the codimension $e$. A sharp bound was suggested by Eisenbud-Goto [5] (cf. [9]) in the regularity conjecture, which says that

\reg(X) \leq d-e+1.

There is also a folklore conjecture which predicts that the maximal degree, denoted by $\max\deg(X)$, of minimal generators of the defining ideal $I_{X|\P^r}$ of $X \subseteq \P^r$ is at most $d$. Since $\max\deg(X) \leq \reg(X)$, the regularity conjecture implies this folklore conjecture. The regularity conjecture has only been proved for a few cases: integral curves [2], [9], connected curves [7], smooth surfaces [27], [19], singular surfaces with rational or Gorenstein elliptic singularities [24], and smooth threefold in $\P^r$ with $r\geq 9$ [28]. Slightly weaker bounds for lower dimensional smooth varieties were obtained in [15, 17].  A sharp bound for $\reg(\mathcal{O}_X)$ was shown in [18], [26] for a smooth variety $X$ of arbitrary dimension. This result is generalized in [23] to a variety $X$ with $\Q$-Gorenstein isolated singularities.

It turns out that the regularity conjecture is not true. McCullough-Peeva [22] constructed counterexamples to the regularity conjecture, but their examples are highly singular. It is then a natural problem to make a distinction between mildly singular varieties satisfying the regularity conjecture and highly singular varieties not satisfying the regularity conjecture. The threefold case is particularly interesting because one of the counterexamples to the regularity conjecture is a projective threefold $X$ in $\P^5$ such that $\dim X_{\Sing}=1, \deg(X)=31,$ and $\max\deg(X)=\reg(X)=38$  (<cit.>) while the regularity conjecture holds for a smooth projective threefold in $\P^5$ by [16]. Notice also that the singular threefold $X$ in $\P^5$ does not even fulfill the folklore conjecture aforementioned.

In this paper, we consider normal projective threefolds with rational or Du Bois singularities. Those singularities are naturally appearing inevitably in many places such as minimal model program, moduli theory, and Hodge theory. Recently, it was shown that the secant varieties of smooth projective curves have normal  Du Bois singularities (see [4]). In a variety of flavor, it is highly desirable to have the conjectured bound or a slightly weaker bound for $\reg(X)$, where $X$ is a normal projective threefold with rational or Du Bois singularities. It is also interesting to see how local geometric properties of those singularities are related to global algebraic properties of the embedded projective varieties.

The first main result of this paper is to establish the following regularity bound for threefolds with rational singularities, extending Kwak's result for smooth threefolds in [15]. Our bound is only off by 1 from the bound in the regularity conjecture, and in particular, the maximal degree can be bounded by the degree.

Let $X \subseteq \P^r$ be a non-degenerate normal projective threefold of degree $d$ and codimension $e$. Suppose that $X$ has rational singularities. Then we have

\reg(X) \leq d-e+2.

Suppose furthermore that $X$ has only isolated rational singularities and

\begin{equation}\tag{$\star$}\label{techassump}
\dim \bigcup_{l \in \Sigma} l \leq 4, \text{ where } \Sigma:=\{\text{lines } l \subseteq \P^r \mid \length(l \cap X) \geq 4 \text{ and } l \cap X_{\Sing} = \emptyset  \}.
\end{equation}

In this case, our approach yields the optimal result

\reg(X) \leq d-e+1.

See Remark <ref> for more details.
Note that Ran <cit.>  proved that if $r \geq 9$ and $X$ has non-degenerate tangent variety, then the condition (<ref>) holds. As remarked in <cit.>, threefolds with degenerate tangent variety is classified in <cit.>.

The codimension two case is specially important as one of the counterexamples to regularity conjecture by McCullough-Peeva appeared in this case. The second main result of this paper is to establish a sharp regularity bound for codimension two normal projective threefolds with Cohen-Macaulay Du Bois singularities and to classify the extremal cases. This generalizes the main theorem of [16], which deals with the smooth case. Note that rational singularities are Cohen-Macaulay Du Bois singularities.

Let $X \subseteq \P^5$ be a non-degenerate normal projective threefold of degree $d$. Suppose that $X$ has Cohen-Macaulay Du Bois singularities. Then we have

\reg(X) \leq d-1.

Furthermore, $\reg(X)=d-1$ if and only if $X \subseteq \P^5$ is either a variety of minimal degree or a complete intersection of type $(2,2)$.

If $X \subseteq \P^r$ is a non-degenerate normal projective threefolds with Cohen-Macaulay Du Bois singularities of degree $d$ and codimension $e$, then we have

\reg(X) \leq d-e+3 + {e+1 \choose 3}.

See Remark <ref> for more details.

To prove Theorems <ref> and <ref>, we take a general projection

\pi \colon X \to \overline{X} \subseteq \P^4

of a non-degenerate normal projective threefold $X$ in $\P^r$ to a hypersurface $\overline{X}$ in $\P^4$, and analyze the complexity of the fibers of $\pi$. It is known that if one has a smaller Castelnuovo-Mumford regularity bound for all fibers of $\pi$, then one would get a better Castelnuovo-Mumford regularity bound for $X$. See Section <ref> for more details. This idea essentially goes back to Castelnuovo [2] (see also  [27]), and is combined with cohomological method by Lazarsfeld [19] to show a sharp regularity bound for smooth surfaces. This technique has been successfully applied to lower dimensional smooth varieties as in [15, 16, 17], [29] and singular surfaces as in [24].

Along this line, our task is to find a reasonably small uniform regularity bound for every fiber $X_y=\pi^{-1}(y)$ of general projection $\pi  \colon X \to \overline{X} \subseteq \P^4$ with $y \in \overline{X}$ (Theorem <ref>). For this purpose, we essentially classify the fibers of $\pi$ (see Remark <ref>). The situation is well understood if $X$ is nonsingular; every $X_y$ has length at most $4$, and there are only finitely many $y$ with $X_y$ collinear of length $4$ (see [15]).
However, if $X$ is singular, then the situation becomes more complicated and new ideas are essentially needed. When $X_y$ is supported in the smooth locus of $X$, we can control the length of $X_y$ and consequently the regularity of $X_y$ by dimension counting arguments and the (dimension+2)-secant lemma <cit.> (Proposition <ref>). When $X_y$ contains a singular point of $X$, the situation becomes quite delicate. It is worth pointing out that the length of $X_y$ is not useful anymore to bound its regularity at least in our case. To remedy this situation, we use Loewy length instead to bound the regularity of fibers.
Since $X$ has rational or Cohen-Macaulay Du Bois singularities, we can apply Briançon-Skoda type theorem to bound the Loewy length (see Lemma <ref> and Proposition <ref>). This is enough to establish the regularity bound for $X$ if $X$ has only isolated singularities.
However, a normal projective threefold with rational or Cohen-Macaulay Du Bois singularities could have positive dimensional singular locus, and this is actually the major obstruction of bounding regularity of $X$.
The main novelty of this paper is to overcome the difficulty by computing the dimension of the secant variety swept out by secant lines passing through the singular locus of $X$ (see Theorem <ref>). This implies that the support of $X_y$ has at most two points (Proposition <ref>), and this result leads us to the desired control on the regularity of the fiber $X_y$. See Section <ref> for more details.

The following theorem describes the secant variety swept out by secant lines passing through the singular locus for an arbitrary projective variety.  It might be of independent interest, and can be viewed as complementary to the results on secant variety of smooth locus (see <cit.>, <cit.>). We expect that it would have other applications to general projections of higher dimensional singular varieties.

Let $X \subseteq \P^r$ be a projective variety of dimension $n$, and  let $Z$ be a nonempty proper closed subset containing $X_{\Sing}$. Denote $\delta:=\codim_{X}Z$ and $U_Z:=X-Z$. Consider the set of secant lines

\Sigma:=\{\text{lines } l \subseteq \P^r \mid \length(l \cap U_Z) \geq n+1-\delta \text{ and } l \cap Z \neq \emptyset  \}.

Then we have

$$\dim \overline{S_{\Sigma}(X)}\leq n+1,\text{ where }S_{\Sigma}(X):=\bigcup_{l \in \Sigma} l.$$

It is worth noting that Theorems <ref> and <ref> show a distinction between normal projective threefolds with rational or Cohen-Macaulay Du Bois singularities and highly singular projective threefolds.
There are two geometric reasons for this phenomenon. First, normal projective threefolds with rational or Cohen-Macaulay Du Bois singularities satisfy Kodaira vanishing theorem, so the cohomological method can be applied. Second, all fibers of generic projections of these varieties have reasonably small Loewy length, so the general projection method works. There do exist normal projective threefolds with rational or Cohen-Macaulay Du Bois singularities having one dimensional singular locus. The first secant variety $\Sigma_1=\Sigma_1(C, L)$ of a smooth projective curve $C$ of genus $g$ embedded by the complete linear system of a line bundle $L$ of degree $\geq 2g+3$ has rational singularities when $g=0$ and has normal Cohen-Macaulay Du Bois singularities when $g \geq 1$, and the singular locus of $\Sigma_{1}$ is $C$ (see [4]). If $(g, \deg L) = (0, 5), (1,6), (2,7)$, then $\Sigma_1$ has codimension two. In this case, $\deg(\Sigma_1) = 6,9,13$ and $\reg(\Sigma_1) = 3, 5, 5$, respectively (cf. counterexample of threefold in codimension two <cit.>).

The  paper is organized as follows. We begin in Section <ref> with the proof of Theorem <ref>. In Section <ref>, we study local properties of mild singularities using Loewy length.
Section <ref> is devoted to the study of complexity of fibers of a generic projection. Finally, in Section <ref>, by the classical generic projection method, we complete the proofs of Theorems <ref> and <ref>.

Acknowledgment. We would like to thank Lawrence Ein, Sijong Kwak and Lance Edward Miller for the inspiring suggestions and comments. We are grateful to the referee for helpful comments.

§ DIMENSION OF SECANT VARIETY

We give the proof of Theorem <ref> in this section. The theorem plays a crucial role in controlling regularity of fibers of a general projection passing through singular locus.

We prove the theorem by contradiction.  Assume otherwise that $\dim \overline{S_{\Sigma}(X)}\geq n+2$. Denote by $\G=\G(\P^1, \P^r)$ the Grassmannian variety parameterizing lines in $\P^r$. We can find a subvariety $B_0 \subseteq \G$ of dimension $n+1$ parameterizing lines $l$ in $\Sigma$.  We  then obtain a diagram:

\begin{equation}\label{diagram}
\xymatrix{
X \subseteq \P^r& \Lambda_B \ar[l]_-{\pi} \ar[d]_{\phi}^{\P^1\text{-bundle}} & \\
& B \ar[r] & B_0 \subseteq \G,
\end{equation}

where $B$ is a smooth projective variety of dimension $n+1$ mapping birationally to $B_0$, the morphism $\phi \colon \Lambda_B \to B$ is the pull-back to $B$ of the tautological $\P^1$-bundle on $\G$, and $\pi$ is the natural projection.

$$I_{X|\P^r}\cdot \sO_{\Lambda_B}=\sO_{\Lambda_B}(-\sum a_iE_i-F)\otimes I_{W|\Lambda_B}$$

where the ideal $I_{W|\Lambda_B}$ defines a subscheme $W$ with $\codim_{\Lambda_B} W\geq 2$ and $E_i$ and $F$ are divisors such that $E_i$ dominates $B$ but $F$ does not. Let

$$Y_i:=C_X(E_i)=\pi(E_i), \ \delta_i:=\codim_X Y_i,\text{ and }e:=\codim_{\P^r}X.$$

Note that the divisors $E_i$ can be  divided into two disjoint sets based on whether their centers are contained in $Z$ or not; the first set includes all $E_i$ with $C_X(E_i)\nsubseteq Z$ while the second one includes all $E_i$ with $C_X(E_i)\subseteq Z$. The latter one is not empty because $I_{X|\P^r} \subseteq I_{Z|\P^r}$ and all secant lines in $B$ touch $Z$, which in other words means that the subscheme defined by $I_{Z|\P^r} \cdot \sO_{\Lambda_B}$ dominates $B$.

We shall do the local calculation for each $E_i$. To be more concrete, let us consider the divisor $E_1$. Choose a general point $y\in E_1$ and set $x=\pi(y)$. We may assume that $x$ is a nonsingular point of $Y_1$. Hence we can choose a local system of parameters of $\sO_{\P^r,x}$ as

$$\underbrace{x_1,\ldots,  x_e,x_{e+1},\ldots, x_{e+\delta_1}}_{\text{ local equations for }Y_1}, x_{e+\delta_1 + 1},\ldots, x_r$$

and a local system of parameters of $\sO_{\Lambda_B,y}$ as

$$y_1,\ldots, y_{n+2}$$

such that $E_1$ is defined by $y_1$. Then, by assumption, one can write

$$x_1=y^{b_1}_1w_1, \ldots, x_e=y^{b_1}_1w_e,\ x_{e+1}=y_1w_{e+1}, \ldots, x_{e+\delta_1}=y_1w_{e+\delta_1},$$

where $w_i$ are elements in the local ring $\sO_{\Lambda_B,y}$ and the value of $b_1$ is assigned as follows: if $C_X(E_1)\nsubseteq Z$, we can further assume that $x$ is a nonsingular point of $X$ so that $x_1,\ldots, x_e$ are the local equations for $X$, and we set $b_1=a_1$; if $C_X(E_1)\subseteq Z$, we simply set $b_1=1$.

From the morphism $\pi \colon \Lambda_{B} \to \P^r$ in the diagram (<ref>), we have an exact sequence

\begin{equation}\label{eq:01}
\pi^*\Omega_{\P^r}^1\longrightarrow \Omega_{\Lambda_B}^1\longrightarrow \Omega_{\Lambda_B/\P^r}^1\longrightarrow 0.
\end{equation}

We consider the Fitting ideal $\Fitt^0(\Omega_{\Lambda_B/\P^r}^1)$.
Localizing the sequence (<ref>) at $y$, one has

$$\Omega_{\P^r,x}^1\stackrel{\varphi}{\longrightarrow}\Omega_{\Lambda_B,y}^1\longrightarrow \Omega_{\Lambda_B/\P^r,y}^1\longrightarrow 0.$$

Choose the basis ${dx_i}$ for $\Omega_{\P^r,x}^1$ and the basis $dy_j$ for $\Omega_{\Lambda_B,y}^1$. Then the map $\varphi $ can be represented as an $(n+2)\times r$ matrix

\left( \begin{array}{cccc}
\frac{\partial x_1}{\partial y_1} & \frac{\partial x_2}{\partial y_1} & \cdots &  \frac{\partial x_r}{\partial y_1} \\
\frac{\partial x_1}{\partial y_2} & \frac{\partial x_2}{\partial y_2} & \cdots &  \frac{\partial x_r}{\partial y_2} \\
\vdots & \vdots & \ddots & \vdots \\
\frac{\partial x_1}{\partial y_{n+2}} & \frac{\partial x_2}{\partial y_{n+2}} &\cdots &  \frac{\partial x_r}{\partial y_{n+2}}
\end{array} \right).

We then see that the $0$-th Fitting ideal of $\Omega_{\Lambda_B/\P^r,y}^1$, which is generated by the $(n+2)\times (n+2)$ minors of $\varphi$,  has the form

$$\Fitt^0(\Omega_{\Lambda_B/\P^r,y}^1)=y^{2b_1-1+\delta_1}_1\cdot J$$

for some ideal $J$. Hence we conclude that $\Fitt^0(\Omega_{\Lambda_B/\P^r,y}^1)\subseteq  (y^{2b_1-1+\delta_1}_1)$.
This argument works for all $E_i$, and therefore globally we have

$$\Fitt^0(\Omega_{\Lambda_B/\P^r}^1)\subseteq \sO_{\Lambda_B}(-\sum (2b_i-1+\delta_i)E_i).$$

Next we choose a general secant line $l\in B$. So the above inclusion shows that

$$\Fitt^0(\Omega_{\Lambda_B/\P^r}^1)\cdot \sO_l\subseteq \sO_{\Lambda_B}(-\sum (2b_i-1+\delta_i)E_i)\cdot \sO_l.$$

Let $D$ be the divisor on $l$ defined by $\Fitt^0(\Omega_{\Lambda_B/\P^r}^1)\cdot \sO_l$. Then the above inclusion shows that

\begin{eqnarray*}
\deg(D)& \geq & (\sum (2b_i-1+\delta_i)E_i)\cdot l\nonumber\\
&=& \sum_{C_X(E_i)\nsubseteq Z} (2a_i-1+\delta_i)E_i\cdot l +\sum_{C_X(E_i)\subseteq Z} (1+\delta_i)E_i\cdot l \nonumber \\
&=& \sum_{C_X(E_i)\nsubseteq Z} a_iE_i\cdot l +\sum_{C_X(E_i)\nsubseteq Z} (a_i-1+\delta_i)E_i\cdot l+\sum_{C_X(E_i)\subseteq Z} (1+\delta_i)E_i\cdot l \nonumber \\
&\geq & \text{length}(l\cap U_Z)+\sum_{C_X(E_i)\subseteq Z} (1+\delta_i)E_i\cdot l \nonumber\\
& \geq & (n+1-\delta) + (1+\delta) ~\,~\,~\, \text{ ~(recall: $\{E_i \mid C_X(E_i) \subseteq Z\} \neq \emptyset$)} \nonumber\\
& = &  n+2. \nonumber
\end{eqnarray*}

On the other hand, write $T$ as the tangent space of $B$ at $l$. There is a commutative diagram

0@>>>N^*_{l/\P^r} @>>> \Omega_{\P^r}^1|_l@>>> \Omega^1_l @>>>0\\
@.@VVV @VVV @|\\
0@>>>T^*\otimes \sO_l @>>> \Omega^1_{\Lambda_B}|_l@>>> \Omega^1_l @>>> 0.
\end{CD}$$

Note that $N^*_{l/\P^r}=A\otimes \sO_l(-1)$ where $A$ is an $(r-1)$-dimensional vector space. By the Snake Lemma, we obtain an  exact sequence

$$A\otimes \sO_l(-1)\longrightarrow T^*\otimes \sO_l\longrightarrow \Omega_{\Lambda_B/\P^r}^1|_l\longrightarrow 0.$$

The Eagon-Northcott complex gives an exact sequence

$$\wedge^{n+1}A\otimes \sO_{l} (-(n+1))\longrightarrow \det T^*\otimes \sO_l\longrightarrow \sO_D\longrightarrow 0.$$

The semistability of the vector bundle $\wedge^{n+1}A\otimes \sO_l (-(n+1))$ implies that $\deg (D)\leq n+1$. Hence combing all together, we have

$$n+1\geq \deg(D)\geq n+2, $$

which gives the desired contradiction.

The proof is inspired by <cit.>. However, instead of applying the generic projection argument as in [1], our proof uses the Fitting ideal.
In addition, Theorem <ref> does allow the case that $X_{\Sing}$ is empty, i.e., $X$ is nonsingular. In this case, $S_{\Sigma}$ is swept out by the secant lines passing through the nonempty proper closed subset $Z$.

§ LOEWY LENGTH AND MILD SINGULARITIES

In this section, we study local properties of mild singularities. Especially, we bound the regularity of the intersection of the singularities with general linear spaces by using Loewy length (see Proposition <ref>).

For an Artinian local ring $(A, \mathfrak{m})$, we define the Loewy length $ll(A)$ of $A$ to be the nonnegative number $ll(A) := \max \{ i \mid \mathfrak{m}^i \neq 0 \}$. If $\mathfrak{m}=0$, i.e., $A$ is a field, then we put $ll(A)=0$.

The Loewy length of an Artinian local ring is usually much smaller than its length. It provides an efficient way to bound the regularity of  zero dimensional schemes, as shown in the following.

Let $X \subseteq \P^r$ be a zero dimensional subscheme supported at distinct closed points $p_1, \ldots, p_t$. For each $1 \leq i \leq t$, set $\mu_i:=ll({\mathcal{O}_{X, p_i}})$ to be the Loewy length of the local ring $\mathcal{O}_{X, p_i}$. Then $X$ is $(\mu_1 + \cdots  +\mu_t + t)$-regular.

To bound the Loewy length, we need to consider a reduction of an ideal.

Let $(R, \mathfrak{m})$ be a local Noetherian ring. An ideal $J \subseteq \mathfrak{m}$ is called a reduction of $\mathfrak{m}$ if $\mathfrak{m}^{k+1} = J \mathfrak{m}^k$ for some integer $k \geq 0$. Moreover, $J$ is called a minimal reduction if it is a reduction minimal with respect to inclusion.

As the setting in the definition, if $J$ is a reduction of $\mathfrak{m}$, then $J$ always contains a minimal reduction (<cit.>). Furthermore, if $\dim R = n$ and $R/\mathfrak{m}=\C$, then there exists a nonempty Zariski open subset $U$ in the $n$-th Cartesian product $(\mathfrak{m}/\mathfrak{m}^2)^n$ of the cotangent space such that if $x_1, \ldots, x_n \in \mathfrak{m}$ with $(x_1 + \mathfrak{m}^2, \ldots, x_n + \mathfrak{m}^2) \in U$, then $(x_1, \ldots, x_n)$ is a reduction of $\mathfrak{m}$ (<cit.>).

Turning to geometric setting, let $X \subseteq \P^r$ be a projective variety of dimension $n$, and $p \in X$ be a point. Let $L\subseteq\P^r$ be an $(r-k)$-dimensional linear subspace passing through $p$, and assume that $L$ is cut out by linear forms $l_1,\ldots, l_k$ on $\P^r$. Locally at the point $p$, each form $l_i$ gives an element $\bar{l}_i$ of $\mathfrak{m}_{X, p}$ via the quotient $\mathfrak{m}_{X,p}=\mathfrak{m}_{\P^r,p}/I_{X,p}$. Thus we obtain an ideal $(\bar{\l}_1, \ldots, \bar{l}_k) \subseteq \mathfrak{m}_{X, p}$ generated by the elements $\bar{l}_i$. This ideal is the localization of the ideal sheaf $\mathcal{I}_L\cdot \sO_X$ at $p$. We say that $L$ is a reduction linear subspace at $(X,p)$ or simply $L$ is a reduction at $(X,p)$ if the ideal $(\bar{l}_1, \ldots, \bar{l}_k)$ is a reduction of $\mathfrak{m}_{X, p}$.
If $L$ is reduction at $(X,p)$, then the intersection $X\cap L$ has dimension zero at $p$ and $k\geq n$. For two linear subspaces $L, L'$ with $p \in L' \subseteq L$, if $L$ is a reduction at $(X,p)$, then so is $L'$.

Let $X \subseteq \P^r$ be a projective variety of dimension $n$, and $p \in X$ be a point. Suppose that $m$ is a positive integer such that  $\mathfrak{m}_{X, p}^m \subseteq J$ for any minimal reduction $J$ of $\mathfrak{m}_{X, p}$. If $L$ is a reduction linear subspace at $(X,p)$ in $\P^r$, then we have $ll({\mathcal{O}_{X \cap L, p}}) \leq m-1$.

Let $l_1, \ldots, l_k$ be linear forms on $\P^r$ cutting out $L$. Locally at the point $p$, these linear forms generate an ideal  $(\bar{\l}_1, \ldots, \bar{l}_k)\subseteq \mathfrak{m}_{X, p}$  which is a reduction ideal of $\mathfrak{m}_{X, p}$, and hence, $\mathfrak{m}_{X, p}^m \subseteq (\bar{l}_1, \ldots, \bar{l}_k)$ since the latter contains a minimal reduction. As $\mathcal{O}_{X \cap L, p} = \mathcal{O}_{X, p}/(\bar{l}_1, \ldots, \bar{l}_k)$, we see immediately that $\mathfrak{m}_{X \cap L, p}^m=0$ as desired.

To apply the above lemma, we need to bound the number $m$. This number turns out to depend on the singularities of the local ring. Let us recall definitions of some mild singularities that provide us reasonable bounds on $m$.

Let $X$ be a projective variety.

* We say that $X$ has rational singularities if $X$ is normal and
there exists a proper birational morphism $f \colon Y \to X$ from a smooth variety $Y$ such that $R^i f_* \mathcal{O}_Y=0$ for $i>0$. Note that $R^i f_* \mathcal{O}_Y=0$ for $i>0$ if and only if $X$ is locally Cohen-Macaulay and $f_* \omega_Y = \omega_X$ (<cit.>).

* Let  $\underline{\Omega}_X^{\bullet}$ be the Deligne-Du Bois complex for $X$, which is a generalization of the de Rham complex for a nonsingular variety (see <cit.> for detail). We say that $X$ has Du Bois singularities if the natural map

\sO_X \longrightarrow \underline{\Omega}_X^{0}=Gr_{\text{filt}}^0 \underline{\Omega}_X^{\bullet}.

is a quasi-isomorphism.

Rational singularities contain a large range of important singularities considered in birational geometry such as terminal, canonical, or log terminal singularities (<cit.>). Du Bois singularities are another important singularities naturally appeared in birational geometry and Hodge theory.
Note that if $X$ has rational singularities or log canonical singularities, then $X$ has Du Bois singularities (<cit.>).
For further information about rational or Du Bois singularities and their relation with birational geometry, we refer to [13] and [14].

Let $X \subseteq \P^r$ be a normal projective threefold, $p \in X$ be a point, and $L$ be a reduction linear subspace at $(X, p)$ in $\P^r$. Then the following hold:

* If $X$ has rational singularities, then $ll({\mathcal{O}_{X \cap L, p}}) \leq 2$.

* If $X$ has Cohen-Macaulay Du Bois singularities, then $ll({\mathcal{O}_{X \cap L, p}}) \leq 3$.

Let $J$ be a minimal reduction of the maximal ideal $\mathfrak{m}_{X, p}$ of the local ring ${\mathcal{O}_{X,p}}$ at $p$. If $(X, p)$ is a $3$-dimensional rational singularity, then it follows from Briançon-Skoda type theorem ([21], see also <cit.>) that $\mathfrak{m}_{X, p}^3 \subseteq J$. If $(X, p)$ is a $3$-dimensional normal Cohen-Macaulay Du Bois singularity, then <cit.> implies that $\mathfrak{m}_{X, p}^4 \subseteq J$. Thus the assertions follow from Lemma <ref>.

For a surface $S$ with rational singularities or Gorenstein elliptic singularities and for a closed point $p \in S$, it has been showed in [24] that the inequality $\mult_p S \leq \embdim_p S$ plays a crucial role in bounding the Loewy length of fibers of a general projection of $S$. Ideally, following the method used there, if one could show  $\mult_p X \leq \embdim_p X -1$ for a threefold $X$,  then Lemma <ref> (1)  can be established. However, this inequality is only known for terminal singularities by <cit.> (see also <cit.>) and for Gorenstein canonical singularities by <cit.>. In general, if $(X, p)$ is a rational singularity, then we only have $\mult_p X \leq {{\embdim_p X -1}\choose{\dim X-1}}$ which is sharp (see <cit.>).

Let $S \subseteq \P^r$ be a non-degenerate normal projective surface of degree $d$ and codimension $e$. Suppose that $S$ has Du Bois singularities.
As in the proof of Lemma <ref>, by applying <cit.>, we can show that the Loewy length of any fiber of a general projection $\pi \colon S \to \overline{S} \subseteq \P^3$ is at most 2. Then the arguments in <cit.> show that the regularity conjecture holds for $S$, i.e.,

\reg(S) \leq d-e +1.

Note that all singularities considered in [24] are Du Bois singularities.

In the rest of the paper, we frequently use the notion of (partial) flag varieties. For given $m$ integers $1\leq k_1<k_2<\cdots <k_m\leq r-1$, the (partial) flag variety $\F(\P^{k_1}, \ldots, \P^{k_m}, \P^r)$  parameterizes the $m$-tuples $(L_1,L_2,\ldots, L_m)$ of the nested linear subspaces $L_1\subseteq L_2\subseteq \cdots\subseteq L_m$ in $\P^r$ with $\dim L_i=k_i$. For a closed point $p\in \P^r$, we also consider the subvariety

\F(p, \P^{k_1}, \ldots, \P^{k_m}, \P^r):=\{ (L_1, \ldots, L_m) \in \F(\P^{k_1}, \ldots, \P^{k_m}, \P^r) \mid p \in L_1 \}

of the flag variety $\F(\P^{k_1}, \ldots, \P^{k_m}, \P^r)$. There is a canonical isomorphism

\F(p, \P^{k_1}, \ldots, \P^{k_m}, \P^r) \simeq \F(\P^{k_1-1}, \ldots, \P^{k_m-1}, \P^{r-1}).

In the special case when $m=1$, the flag variety $\F(\P^{k_1},\P^r)$ is just the Grassmannian variety $\G(\P^{k_1},\P^r)$, and therefore, $\F(p, \P^{k_1}, \P^r) \simeq \G(\P^{k_1-1}, \P^{r-1})$.

Now we are ready to prove the following main result of this section. The proposition plays an important role in controlling regularity of fibers of a general projection passing through singular locus. The essential idea of the proof is to use the classical dimension counting method.

Let $X \subseteq \P^r$ be a normal projective threefold, and $\Lambda \subseteq \P^r$ be a general $(r-5)$-dimensional linear subspace $\Lambda$ in $\P^r$ disjoint from $X$. Then for every singular point $p \in X_{\Sing}$, the linear subspace $L_p= \langle \Lambda,  p \rangle$ in $\P^r$ spanned by $\Lambda$ and $p$ is a reduction at $(X,p)$. In particular, the following hold:

* Suppose that $X$ has rational singularities. Then $ll({\mathcal{O}_{X \cap L_p, p}}) \leq 2$. If furthermore $X \cap L_p$ supports only at $p$, then $X \cap L_p \subseteq L_p \simeq \P^{r-4}$ is $3$-regular.

* Suppose that $X$ has Cohen-Macaulay Du Bois singularities. Then $ll({\mathcal{O}_{X \cap L_p, p}}) \leq 3$. If furthermore $X \cap L_p$ supports only at $p$, then $X \cap L_p \subseteq L_p \simeq \P^{r-4}$ is $4$-regular.

Let $p \in X_{\Sing}$ be a singular point of $X$.
Let $\mathfrak{m}=\mathfrak{m}_{X, p}$ be the maximal ideal of the local ring $\mathcal{O}_{X,p}$, and $\mathfrak{m}_{\P^r,p}$ be the maximal ideal of the local ring $\mathcal{O}_{\P^r,p}$.

V_p := \overline{\{ L \in \F(p, \P^{r-3}, \P^r) \mid L \text{ is not a reduction at $(X,p)$} \}} \subseteq \F(p, \P^{r-3}, \P^r).

As $\mathfrak{m}=\mathfrak{m}_{\P^r,p}/I_{X,p}$, it is generated by the quotients of linear forms. By <cit.>, we can choose three general linear forms $l_1,l_2,l_3$ so that the $3$-tuple of their quotients $(\bar{l}_1,\bar{l}_2,\bar{l}_3)$ in the product $(\mathfrak{m}/\mathfrak{m}^2)^3$  lies in the Zariski open subset stated in <cit.>. Hence the linear space defined by $l_1,l_2,l_3$ is a  reduction at $(X,p)$. This suggests that $V_p$ is a proper closed subset of $\F(p, \P^{r-3}, \P^r)$. Thus $\dim V_p \leq \dim \F(p, \P^{r-3}, \P^r)-1 = 3r-10$. Let

V_p' := \overline{\{ L' \in \F(p, \P^{r-4}, \P^r) \mid L' \text{ is not a reduction at $(X, p)$} \}} \subseteq \F(p, \P^{r-4}, \P^r).

We claim that

\text{$\dim V_p' \leq 4r-18$, i.e., $\codim_{\F(p, \P^{r-4}, \P^r)} V_p' \geq 2$.}

To see the claim, we consider the diagram of flag varieties

\[
\begin{split}
\xymatrix{
& \F(p, \P^{r-4}, \P^{r-3}, \P^r) \ar[dl]_-f \ar[dr]^-g& \\
\F(p,  \P^{r-3}, \P^r)  & & \F(p, \P^{r-4}, \P^r),
\end{split}
\]

where $f$ and $g$ are natural projections. The dimensions of any fibers of $f$ and $g$ are $r-4$ and $3$, respectively. Let

W:=\{ L' \in \F(p, \P^{r-4}, \P^r) \mid g^{-1}(L') \subseteq f^{-1}(V_p) \} \subseteq \F(p, \P^{r-4}, \P^r).

It is clear that we have the inclusion $V_p' \subseteq W$. Thus to prove the claim, it is enough to show that $W$ has codimension at least $2$ in $\F(p, \P^{r-4}, \P^r)$. Now, we take a prime divisor $H$ on $\F(p, \P^{r-3}, \P^r)$ containing an irreducible component of $V_p$. Then $f^{-1}(H)$ is a prime divisor on $\F(p, \P^{r-4}, \P^{r-3}, \P^r)$. We show that the restricted morphism

u:=g|_{f^{-1}(H)}: f^{-1}(H)\rightarrow \F(p, \P^{r-4}, \P^r)

is surjective. Indeed, for any point $L'\in \F(p, \P^{r-4}, \P^r)$,  the set $f(g^{-1}(L'))$ parameterizes $(r-3)$-dimensional linear subspaces that contain the $(r-4)$-dimensional subspace represented by $L'$. Thus $\dim f(g^{-1}(L')) = 3$. However, since every effective divisor on $\F(p, \P^{r-3}, \P^r)$ is very ample, $f(g^{-1}(L'))$ meets $H$. This implies that $g^{-1}(L')$ meets $f^{-1}(H)$. Thus $u$ is surjective as desired.
Note that $\dim f^{-1}(H)=(3r-10)+(r-4)=4r-14$. So a general fiber of  $u$ has dimension $2$. Furthermore, for any prime divisor $H'$ on $\F(p, \P^{r-4}, \P^r)$, it is impossible that $g^{-1}(H') \subseteq f^{-1}(H)$. This means that the locus of points in $\F(p, \P^{r-4}, \P^r)$ over which the fiber of $u$ has dimension $3$ has codimension at least two. Notice that $g^{-1}(W) \subseteq f^{-1}(H)$ and $\dim g^{-1}(L') = 3$ for all $L' \in W$. Hence $\codim_{\F(p, \P^{r-4}, \P^r)} W  \geq 2$, so the claim follows.

Now each $V'_p$ discussed above is naturally a subset of the Grassmannian $\G(\P^{r-4}, \P^r)$. Let

V:=\bigcup_{p \in X_{\Sing}} V_p' \subseteq \G(\P^{r-4}, \P^r).

Since $\dim X_{\Sing} \leq 1$, it follows from the claim above that $\dim V \leq 4r-17$. Consider the diagram of the flag varieties

\[
\begin{split}
\xymatrix{
& \F(\P^{r-5}, \P^{r-4}, \P^r) \ar[dl]_-{f'} \ar[dr]^-{g'}& \\
\G(\P^{r-4}, \P^r) & & \G(\P^{r-5},  \P^r)
\end{split}
\]

with the natural projections $f'$ and $g'$. The dimensions of any fibers of $f'$ and $g'$ are $r-4$ and $4$, respectively. Then $\dim f'^{-1}(V) \leq  (4r-17)+(r-4)=5r-21$. Since $\dim \G(\P^{r-5}, \P^r)=5r-20$, we have $g'^{-1}(\Lambda) \cap f'^{-1}(V) = \emptyset$ for a general member $\Lambda \in \G(\P^{r-5}, \P^r)$. Therefore, for every singular point $p \in X_{\Sing}$, the linear subspace $L_p=\langle p, \Lambda \rangle$ is a reduction at $p$. The remaining assertions now follow from Lemma <ref> and Theorem <ref>.

§ COMPLEXITY OF FIBERS OF A GENERIC PROJECTION

This section is devoted to the study of the fibers of generic projections of threefolds. Recall the construction of a generic projection for a variety. Let $X \subseteq \P^r$ be a non-degenerate projective variety of dimension $n$. Take an  $(r-n-2)$-dimensional linear subspace $\Lambda$ in $\P^r$ disjoint with $X$. Blowing up $\P^r$ along the center $\Lambda$ and then projecting to $\P^{n+1}$,
we obtain the diagram

\begin{CD}
\Bl_{\Lambda}\P^r @>q>> \P^{n+1}\\
@VpVV  \\
\P^r.
\end{CD}

The variety $X$ is naturally a subvariety of $\Bl_{\Lambda}\P^r$. Restricting $q$ to $X$ yields the morphism $\pi \colon X\rightarrow \P^{n+1}$ which is called a projection of $X$ from the center $\Lambda$. We denote the image of $\pi$ as $\overline{X}$ which is a hypersurface in $\P^{n+1}$. For $y \in \overline{X}$, denote by $X_y:=\pi^{-1}(y)$ the fiber of the projection and denote by
$$\P_y^{r-n-1}:=q^{-1}(y)=\langle \Lambda, X_y \rangle \simeq \P^{r-n-1}$$
the fiber of $q$ which is an $(r-n-1)$-dimensional linear subspace in $\P^r$. Note  that scheme-theoretically $X_y=X\cap \P_y^{r-n-1}$ and therefore $X_y\subseteq \P_y^{r-n-1}$ is a closed subscheme. As there are flexibility on the choice of the projection center $\Lambda$, we expect the projection would have some good properties. We frequently say that a general projection $\pi$ satisfies a property $\sP$, which means that there exists an open set $U$ in the Grassmannian $\G(\P^{r-n-2},\P^r)$ such that for $\Lambda\in U$ the projection from $\Lambda$ satisfies the property $\sP$. Of course, such open set $U$ depends on what kind of property $\sP$ is involved, and it should be clear from the context.

The main goal of this section is to understand the complexity of a fiber $X_y$ of a general projection of a threefold $X$, especially the regularity of $X_y$.
We first consider the case that $X_y$ is supported in the smooth locus $X_{\reg}$ of $X$. Recall that a zero-dimensional scheme $X$ is called curvilinear if each local ring $\mathcal{O}_{X, x}$ is isomorphic to $\C[x]/(x^k)$ for some $k \geq 1$. It is clear that a dimension zero scheme is curvilinear if and only if it admits an embedding into a smooth curve.

Let $X \subseteq \P^r$ be a projective threefold and $\pi \colon X \to \overline{X} \subseteq \P^{4}$ be a general projection from an $(r-5)$-dimensional linear subspace $\Lambda \subseteq \P^r$. Then the following hold:

* $X_y\cap X_{\reg}$ is curvilinear for all $y \in \overline{X}$.

* If a fiber $X_y$ over $y \in \overline{X}$ is supported in $X_{\reg}$, then $X_y$ has length at most $4$. In particular, $X_y \subseteq \P^{r-4}_y$ is $4$-regular.

* There are finitely many points $y\in \overline{X}$ such that $X_y$ is supported in $X_{\reg}$ and $X_y \subseteq \P^{r-4}_y$ is not $3$-regular; in this case $X_y$ consists of collinear four reduced points.

(1) For $x\in X_{\reg}$, denote by $T_x$ the projective tangent space of $X$ at $x$ in $\P^r$.
We need to prove that $\dim (T_x \cap \langle x, \Lambda \rangle ) \leq 1$ for every $x \in X_{\reg}$. It is enough to prove the following claim:

\text{$\dim (T_x\cap \Lambda ) \leq 0$ for every $x\in X_{\reg}$.}

To show the claim, we consider the diagram of flag varieties

\[
\begin{split}
\xymatrix{
& \F(\P^1, \P^{r-5}, \P^r) \ar[dl]_-{f} \ar[dr]^-{g}& \\
\G(\P^1, \P^r) & & \G(\P^{r-5}, \P^r)
\end{split}
\]

with natural projections $f$ and $g$.
Let $T:=\overline{\bigcup_{x \in X_{\reg}} T_x} \subseteq \P^r$ be the variety swept out by tangent spaces, and $V_T \subseteq \G(\P^1, \P^r)$ be the closure of the set parameterizing lines in $T_x$ for $x\in X_{\reg}$. Note that $\dim V_T \leq 7$. Let

W_T:=g(f^{-1}(V_T))=\overline{\{\Lambda\in \G(\P^{r-5},\P^r)\mid \dim (T_x \cap \Lambda) \geq 1~ \text{for some } x\in X_{\reg} \}} \subseteq \G(\P^{r-5}, \P^r).

Since every fiber of $f$ has dimension $5(r-6)$, it follows that $\dim f^{-1}(V_T) \leq 5r-23$ so that $\dim W_T \leq 5r-23$. Thus $\codim_{\G(\P^{r-5}, \P^r)} W_T \geq 3$. This proves the claim, so finishes the proof of $(1)$.

(2) We first show that
there exists a dense open subset $U \subseteq \G(\P^{r-4}, \P^r)$ parametrizing $(r-4)$-dimensional linear subspaces of $\P^r$ containing a general  $(r-5)$-dimensional linear subspace of $\P^r$.
To see this, consider the diagram of  flag varieties

\[
\begin{split}
\xymatrix{
& \F(\P^{r-5}, \P^{r-4}, \P^r) \ar[dl]_-f \ar[dr]^-g& \\
\G(\P^{r-5}, \P^r) & &\G(\P^{r-4}, \P^r)
\end{split}
\]

where $f$ and $g$ are natural projections. Let $V \subseteq \G(\P^{r-5}, \P^r)$ be a closed subset whose complement $ \G(\P^{r-5}, \P^r) \setminus V$ consists of general $(r-5)$-dimensional linear subspaces of $\P^r$. Let

V':=\{ L \in \G(\P^{r-4}, \P^r) \mid g^{-1}(L) \subseteq f^{-1}(V) \}

be the close subset of  $\G(\P^{r-4}, \P^r)$.
Following the similar arguments in the proof of Proposition <ref>, we can show that $V'$ has positive codimension in $\G(\P^{r-4}, \P^r)$. Then $U:=\G(\P^{r-4}, \P^r) \setminus V'$ is the desired dense open subset of $\G(\P^{r-4}, \P^r)$.

We now consider a closed subset

\begin{array}{rcl}
W&:=&\overline{\{L \in \G(\P^{r-4}, \P^r)  \mid L \cap X \text{ is a finite scheme supported in $X_{\reg}$ and length}(L \cap X) \geq 5 \}}\\
& \subseteq &\G(\P^{r-4}, \P^r).
\end{array}

We shall show

U\cap W=\emptyset.

To derive a contradiction, suppose that $U \cap W \neq \emptyset$.
Take an irreducible component $Y$ of $\overline{U \cap W}$, and give a reduced scheme structure on $Y$. Then the variety $Y$ parametrizes a family $\{ L_y \}$ of $(r-4)$-dimensional linear subspaces of $\P^r$ such that a general $L_y$ contains a general $(r-5)$-dimensional linear subspace of $\P^r$  disjoint from $X$ such that $L_y \cap X$ is a finite scheme supported in $X_{\reg}$ and $\length(L_y \cap X) \geq 5$.
By (1), $L_y \cap X$ is curvilinear.
However, the (dimension+2)-secant lemma (<cit.>) says that a general $(r-5)$-dimensional linear subspace of $\P^r$ is not contained in any $L_y$. Thus we get a contradiction, and hence, $U \cap W =\emptyset$. Now, notice that $\langle x, \Lambda \rangle \in U$ for all $x \in X$.
It then immediately follows that every fiber of a general projection $\pi \colon X \to \overline{X} \subseteq \P^4$ supported in $X_{\reg}$ has length at most $4$ and is $4$-regular.

(3) Suppose that $X_y$ is supported in $X_{\reg}$. If the length of $X_y$ is at most $3$ or is not contained in a line, then $X_y \subseteq \P_y^{r-4}$ is $3$-regular by <cit.>. Thus if $X_y \subseteq \P_y^{r-4}$ is not $3$-regular, then $X_y$ should be collinear of length $4$.

By <cit.>, the $4$-secant variety $\Sec^4 X_{\reg}$ has dimension $\leq 5$. Hence it intersects a general $(r-5)$-dimensional linear subspace $\Lambda$ in dimension $\leq 0$, which proves the finiteness of the fiber $X_y$ supported in $X_{\reg}$ such that $X_y \subseteq \P_y^{r-4}$ is not $3$-regular. Note that if $l$ is a general $4$-secant line to $X$, then $l \cap X$ consists of four distinct reduced points. This implies the last assertion.

We now turn to consider the case that $X_y$ meets the singular locus of $X$.
The major difficulty of controlling the complexity of $X_y$ lies in this case, and we apply Theorem <ref> to overcome this difficulty.

Let $X \subseteq \P^r$ be a normal projective threefold, and $\pi \colon X \to \overline{X} \subseteq \P^4$ be a general projection from an $(r-5)$-dimensional linear subspace $\Lambda \subseteq \P^r$.
Then the following hold:

* $X_y$ is supported only at $p$ for all $p \in X_{\Sing}$ with $y =\pi(p)$ except finitely many points $p_1, \ldots, p_k \in X_{\Sing}$. The exceptional case only occurs when $\dim X_{\Sing} = 1$.

* If $p$ is one such point $p_i$, then the fiber $X_y$ over $y=\pi(p)$ can be decomposed as two disjoint subschemes $Z$ and $q$ such that $Z$ is supported at $p$ and $q$ is a reduced point supported in $X_{\reg}$.

Note first that if $p \in X_{\Sing}$ is an isolated singular point, then the fiber  $X_y \subseteq  \P^{r-4}_y$ over $y=\pi(p)$ is supported at the single point $p$.
Hence, without loss of generality, we may assume that $\dim X_{\Sing}=1$. Since $\Lambda$ is general and the variety swept out by lines connecting two singular points of $X$ has dimension $\leq 3$,  it follows that for any $p \in X_{\Sing}$, the scheme $X_y\cap X_{\Sing}$ is supported only at $p$. Also since the variety swept out by lines connecting a singular point with a nonsingular point of $X$ has dimension $\leq 5$, there are at most finitely many points $p_1, \ldots, p_k \in X_{\Sing}$ such that the support of the corresponding fiber $X_y$ has more than one points. Let $p=p_i$ for some $1 \leq i \leq k$, and $X_y$ be the fiber over $y=\pi(p)$ as usual.
We claim that

\text{$X_y \cap X_{\reg}$ is contained in a line passing through $p$.}

Granting the claim, by Theorem <ref> for $Z=X_{\Sing}$, we see that $\length(X_y\cap X_{\reg}) \leq 1$. Thus $X_y$ is supported at two points $p \in X_{\Sing}$ and $q \in X_{\reg}$, and $q$ is a reduced point in $X_y$.

It only remains to prove the claim. To this end, consider a closed subset

V:=\overline{\{ L \in \G(\P^2, \P^r) \mid  \text{ $\length(L \cap X_{\reg}) \geq 2$ and $L$ intersects with $X_{\Sing}$ } \} } \subseteq \G(\P^2, \P^r).

If the claim is not true, then $\dim(\Lambda \cap L) \geq 1$ for some $L \in V$.
Note that $\dim V \leq 7$.
Let $U \subseteq \G(\P^1, \P^r)$ be the closed subset parametrizing lines contained in $L\in V$. Note that $\dim U \leq 9$. Consider now the diagram of the flag varieties

\[
\begin{split}
\xymatrix{
& \F(\P^1, \P^{r-5}, \P^r) \ar[dl]_-f \ar[dr]^-g& \\
\G(\P^1, \P^r)  & &\G(\P^{r-5}, \P^r),
\end{split}
\]

where $f$ and $g$ are natural projections. Then we obtain a closed subset

W:=g(f^{-1}(U))=\overline{\{\Lambda\in \G(\P^{r-5},\P^r)\mid \dim (\Lambda\cap L) \geq 1, L \in V \}} \subseteq \G(\P^{r-5}, \P^r).

Since every fiber of $f$ has dimension $5(r-6)$, it follows that $\dim f^{-1}(U) \leq 5r-21$ so that $\dim W \leq 5r-21$. Thus $W$ has codimension at least $1$ in $\G(\P^{r-5}, \P^r)$. This implies that for a general $(r-5)$-dimensional linear subspace $\Lambda \subseteq \P^r$ and for every $L \in V$, we have $\dim (\Lambda \cap L) \leq 0$. Thus the claim follows, so we finish the proof.

We are now in the position to prove the following main result of this section. The theorem is the main ingredient in the proofs of Theorems <ref> and <ref>. It turns out that only using length is not enough to bound the regularity of $X_y$ when $X_y$ meets the singular locus of $X$. This is the place where we have to use Loewy length, especially Proposition <ref>.

Let $X \subseteq \P^r$ be a normal projective threefold, and let $\pi \colon X \to \overline{X} \subseteq \P^4$ be a general projection from an $(r-5)$-dimensional linear subspace $\Lambda$ in $ \P^r$.

* Suppose that $X$ has rational singularities. Then the following hold:

* The fiber $X_y \subseteq \P_y^{r-4}$ is $4$-regular for each $y \in \overline{X}$.

* There are only finitely many points $y \in \overline{X}$ such that $X_y \subseteq \P_y^{r-4}$ is not $3$-regular, and such a fiber $X_y$ can be decomposed into two disjoint subscheme $Z$ and $q$ such that $\reg(Z)=3$ and $q$ is a reduced point in $X_{\reg}$.

* Suppose that $X$ has Cohen-Macaulay Du Bois singularities. Then the following hold:

* The fiber $X_y \subseteq \P_y^{r-4}$ is $5$-regular for each $y \in \overline{X}$.

* There are only finitely many points $y \in \overline{X}$ such that $X_y \subseteq \P_y^{r-4}$ is not $4$-regular, and such a fiber $X_y$ can be decomposed into two disjoint subscheme $Z$ and $q$ such that $\reg(Z)=4$ and $q$ is a reduced point in $X_{\reg}$.

First, consider the case that the fiber $X_y$ over $y \in \overline{X}$ is supported in $X_{\reg}$.
By Proposition <ref> (2) and (3), $X_y  \subseteq \P_y^{r-4}$ is $4$-regular, and there are only finitely many points $y \in \overline{X}$ such that $X_y \subseteq \P_y^{r-4}$ is not $3$-regular; in this case, $X_y$ consists of collinear four reduced points, so we can decompose it into two disjoint subscheme $Z$ and $q$ such that $Z$ consists of three points.

Next, consider the case that the fiber $X_y$ over $y \in \overline{X}$ meets $X_{\Sing}$, i.e., $y=\pi(p)$ for some $p \in X_{\Sing}$.
Proposition <ref> $(1)$ says that $X_y$ is supported only at $p$ except finitely many points $p_1, \ldots, p_k \in X_{\Sing}$ (notice that the exceptional case only occurs when $\dim X_{\Sing}=1$).
If $p \not\in \{p_1, \ldots, p_k \}$, then Proposition <ref> implies that $X_y \subseteq \P^{r-4}_y$ is $3$-regular (resp. $4$-regular) when $X$ has rational singularities (resp. $X$ has Cohen-Macaulay Du Bois singularities). Suppose that $p \in \{p_1, \ldots, p_k \}$. By Proposition <ref> (2), $X_y$ is decomposed into two disjoint subscheme $Z$ and $q$ such that $Z$ is supported at $p$ and $q$ is a reduced point in $X_{\reg}$.
When $X$ has rational singularities (resp. $X$ has Cohen-Macaulay Du Bois singularities), Proposition <ref> implies that $Z \subseteq \P^{r-4}_y$ is $3$-regular (resp. $4$-regular), so $X_y \subseteq \P_y^{r-4}$ is $4$-regular (resp. $5$-regular).

As setting in the theorem, write $\overline{X}_4:=\{y\in \overline{X}\mid X_y \subseteq \P^{r-4}_y \text{ is not $3$-regular}  \}$. In the proof, we actually show the classification of the fiber $X_y$ over $y \in \overline{X}_4$.

* Suppose that $X$ has rational singularities. For any $y \in \overline{X}_4$, one of the following holds:

* $X_y$ consists of collinear four reduced points in $X_{\reg}$.

* $X_y$ can be decomposed into two disjoint subschemes $Z$ and $q$ such that $Z$ is supported at a singular point of $X$ with $\reg(Z)=3$ ($ll(\sO_Z) = 2$) and $q$ is a reduced point in $X_{\reg}$. This case only occurs when $\dim X_{\Sing}=1$.

* Suppose that $X$ has Cohen-Macaulay Du Bois singularities. For any $y \in \overline{X}_4$, one of the following holds:

* $X_y$ consists of collinear four reduced points in $X_{\reg}$.

* $X_y$ is supported at a singular point of $X$ with $ll(\sO_{X_y}) = 3$.

* $X_y$ can be decomposed into two disjoint subschemes $Z$ and $q$ such that $Z$ is supported at a singular point of $X$ with $\reg(Z)=3$ or $4$ ($ll(\sO_Z) = 2$ or $3$ respectively) and $q$ is a reduced point in $X_{\reg}$. This case only occurs when $\dim X_{\Sing}=1$.

Note that $\reg(X_y) = 4$ for cases $(1.a), (1.b), (2.a), (2.b),$ and $(2.c)$ with $\reg(Z)=3$ and $\reg(X_y)=5$ for case $(2.c)$ with $\reg(Z)=4$.

§ CASTELNUOVO-MUMFORD REGULARITY BOUNDS

We prove Theorems <ref> and <ref> in this section by using the method of generic projection, which has been used to bound the regularities in [19], [15, 16, 17] and [24]. The paper [17] gives a very nice explanation of this method, so we refer the reader to there for further information.

Let $X \subseteq \P^r$ be a non-degenerate locally Cohen-Macaulay projective variety of dimension $n$, codimension $e$, and degree $d$. As we have introduced in the beginning of Section <ref>,

\pi \colon X \to \overline{X} \subseteq \P^{n+1}

be a general projection from an $(r-n-2)$-dimensional linear subspace $\Lambda\subseteq \P^r$. Denote by $V=H^0(\Lambda,\sO_{\Lambda}(1))$ the vector space of linear forms on $\Lambda$.

\mathcal{V}=\{V_1,V_2,\ldots, V_k\}

be a collection of linear subspaces $V_j \subseteq H^0(\P^r, \mathcal{O}_{\P^r}(j))$ such that
the natural maps

V_1 \to V,~~ V_2 \to S^2(V)=H^0(\Lambda, \sO_{\Lambda}(2))

are isomorphisms and

V_j \to S^j(V)=H^0(\Lambda, \sO_{\Lambda}(j))

are injective for all $3 \leq j \leq k$.
Then we have a map

w_{\mathcal{V}} \colon V_k \otimes \mathcal{O}_{\P^{n+1}}(-k) \oplus \cdots \oplus V_1 \otimes \mathcal{O}_{\P^{n+1}}(-1) \oplus \mathcal{O}_{\P^{n+1}} \longrightarrow \pi_* \mathcal{O}_X.

Let $p \colon \Bl_{\Lambda}\P^r \to \P^r$ be the blow-up of $\P^r$ along the center $\Lambda$, and $q \colon \Bl_{\Lambda}\P^r \to \P^{n+1}$ be the natural projection. Then the map $w_{\mathcal{V}}$ is induced by the natural map

q_*p^* \mathcal{O}_{\P^r}(k) \longrightarrow q_*p^*\mathcal{O}_X(k)=\pi_*\mathcal{O}_X(k).

For a point $y\in \overline{X}$, as discussed in Section <ref>, the fiber $X_y$ is a subscheme of $\P^{r-n-1}_y$. Furthermore, there is a linear form $l_y\in H^0(\P^{n+1},\sO_{\P^{n+1}}(1))$ which generates $1$ in the residue field $\C(y)$ of $y$.
Note that $l_y$ is regarded as a linear form on $\P^{r-n-1}_y$ and $l^j_y$ represents the  subspace of $H^0(\P^{r-n-1}_y,\sO_{\P^{r-n-1}_y}(j))$ with the basis $l^j_y$. Furthermore, $V_j$ also can be regarded as a subspace of $H^0(\P^{r-n-1}_y, \mathcal{O}_{\P^{r-n-1}_y}(j))$ in an obvious way.
Therefore, by base change, the map $w_{\mathcal{V}}$ is surjective if and only if for all $y\in \overline{X}$ the map

w_{\mathcal{V},y}:V_k \oplus (V_{k-1} \otimes l_y) \oplus \cdots \oplus (V_1 \otimes  l_y^{k-1} ) \oplus  l_y^k \longrightarrow H^0(X_y,\mathcal{O}_{X_y}(k))

is surjective. Note that the vector space in the left side is a subspace of $H^0(\P^{r-n-1}_y,\sO_{\P^{r-n-1}_y}(k))$. Therefore one can check the surjectivity of $w_{\mathcal{V},y}$ for the subscheme $X_y$ in the space $\P^{r-n-1}_y$.

Suppose that $w_{\mathcal{V}}$ is surjective. Since $\pi_*\mathcal{O}_X$ is Cohen-Macaulay, it follows that

is a vector bundle on $\P^{n+1}$.
Assume now that the Kodaira vanishing theorem holds on $X$ (e.g., $X$ has rational or Du Bois singularities).
By <cit.>, we have $\reg(E^*) \leq -2$ and $\reg(E^*) \leq -3$ if and only if $X \subseteq \P^r$ is linearly normal and $H^0(\P^r, \mathcal{I}_{X|\P^r}(2))=H^1(X, \mathcal{O}_X)=0$. Then by the standard cohomological argument, the regularity of $X$ can be bounded as follows.

Under the same notations as above, we have

\reg(X) \leq d-e+1 + \sum_{j=3}^k (j-2) \dim V_j.

If moreover $\reg(E^*) \leq -3$, then we have

\reg(X) \leq d-e+1 -\dim V_1 - \dim V_2 +  \sum_{j=4}^k (j-3) \dim V_j.

We are ready to prove Theorem <ref>.

Take a general projection $\pi \colon X \to \overline{X} \subseteq \P^4$ from an  $(r-5)$-dimensional linear subspace $\Lambda \subseteq \P^r$, and set $V_1 \subseteq H^0(\P^r, \mathcal{O}_{\P^r}(1))$ and $V_2 \subseteq H^0(\P^r, \mathcal{O}_{\P^r}(2))$ to be any subspaces such that the natural maps $V_1 \to V=H^0(\Lambda,\sO_{\Lambda}(1))$ and $V_2 \to S^2(V)$ are isomorphisms.
For $y \in \overline{X}$, denote by $X_y:=\pi^{-1}(y)$ the fiber of the projection $\pi$ and $\P^{r-4}_y:=\langle \Lambda, X_y \rangle \simeq \P^{r-4}$.
Let $\overline{X}_4 := \{ y \in \overline{X} \mid X_y \subseteq  \P_y^{r-4} \text{ is not $3$-regular}\}$.
By definition, for every $y \in \overline{X} \setminus \overline{X}_4$, the fiber $X_y \subseteq  \P_y^{r-4}$ is $3$-regular, i.e., it is $2$-normal. Thus the  map

\begin{equation}\label{eq:02}
V_2  \otimes \mathcal{O}_{\P^{4}}(-2)  \oplus V_1  \otimes \mathcal{O}_{\P^{4}}(-1) \oplus \mathcal{O}_{\P^{4}} \longrightarrow \pi_* \mathcal{O}_X
\end{equation}

is surjective over all $y \in \overline{X} \setminus \overline{X}_4$ (i.e., tensoring with $\C(y)$ the resulting map is surjective).

By Theorem <ref>, $\overline{X}_4$ is a finite set, and for all $y \in \overline{X}_4$, the zero dimensional scheme $X_y$ can be decomposed into two disjoint subschemes $Z$ and $q$ such that $q$ is a reduced point in $X_{\reg}$ and $Z \subseteq \P_y^{r-4}$ is $3$-regular.
Let $H$ be a general linear form on $\P^r$ which is also a linear form on both $\P_y^{r-4}$ and $\Lambda$.
By the choice of $H$, it gives a nonzero constant in the residue field $\C(q)$.  Let $l_y$ be a linear form on $\P^{4}$ that does not vanish at $y$. Then we have a diagram

0@>>>V_2 \oplus (V_1\otimes l_y)\oplus l^2_y@>\cdot l_y>> H^3\oplus (V_2\otimes l_y) \oplus (V_1\otimes l_y^2)\oplus l^3_y @>>> H^3 @>>>0\\
@.@V\theta_2VV @V\theta_3VV @V\theta_HVV\\
0@>>>H^0(Z,\sO_Z(2)) @>\cdot l_y>> H^0(X_y,\sO_{X_y}(3))@>>> k(q) @>>> 0
\end{CD}$$

where $H^3$ represents a  subspace of $H^0(\P^{r-4}_y,\sO_{\P^{r-4}_y}(3))$ with the basis $H^3$ and the same for the powers of $l_y$  regarded as a linear form on $\P^{r-4}_y$. Since $Z \subseteq \P^{r-4}_y$ is $3$-regular and $H^0(\P^{r-4}_y,\sO_{\P^{r-4}_y}(2))=V_2 \oplus (V_1\otimes l_y)\oplus l^2_y$, it follows that $\theta_2$ is surjective. By the choice of $H$, the map $\theta_H$ is also surjective. Hence $\theta_3$ is surjective as well. Thus if we set $V_3:=\langle H^3 \rangle$ and  $\mathcal{V}:=\{V_1, V_2, V_3 \}$, then the map

w_{\mathcal{V}} \colon V_3 \otimes \mathcal{O}_{\P^4}(-3) \oplus V_2  \otimes \mathcal{O}_{\P^{4}}(-2)  \oplus V_1  \otimes \mathcal{O}_{\P^{4}}(-1) \oplus \mathcal{O}_{\P^{4}} \longrightarrow \pi_* \mathcal{O}_X

is surjective over all $y \in \overline{X}_4$. Combining the surjectivity in (<ref>), we conclude that the map $w_{\mathcal{V}}$
is indeed surjective. Finally, by applying Lemma <ref>, we obtain

\reg(X) \leq d-e+1+1=d-e+2,

so we complete the proof.

Let $X \subseteq \P^r$ be a non-degenerate normal projective threefold of degree $d$ and codimension $e$. Take a general projection $\pi \colon X \to \overline{X} \subseteq \P^4$ from an $(r-5)$-dimensional linear subspace $\Lambda \subseteq \P^r$.

* Suppose that $X$ has isolated rational singularities and the condition (<ref>) in Introduction holds, i.e.,

\dim \bigcup_{l \in \Sigma} l \leq 4, \text{ where }~\Sigma=\{\text{lines } l \subseteq \P^r \mid \length(l \cap X) \geq 4 \text{ and } l \cap X_{\Sing} = \emptyset  \}.

Notice that the condition (<ref>) means that there is no $y \in \overline{X}$ such that $X_y$ consists of collinear four reduced points. Thus the case $(1.a)$ in Remark <ref> cannot occur. Moreover, since $\dim X_{\Sing} \leq 0$, the case $(1.b)$ in Remark <ref> cannot occur. Thus $X_y \subseteq \P^{r-4}_y$ is $3$-regular for all $y \in \overline{X}$. Then the map

w \colon V_2  \otimes \mathcal{O}_{\P^{4}}(-2)  \oplus V_1  \otimes \mathcal{O}_{\P^{4}}(-1) \oplus \mathcal{O}_{\P^{4}} \longrightarrow \pi_* \mathcal{O}_X

is surjective. By Lemma <ref>, we obtain

\reg(X) \leq d-e+1.

* Suppose that $X$ has Cohen-Macaulay Du Bois singularities. As in the proof of Theorem <ref>, we can argue that the map

w \colon V_4 \otimes \mathcal{O}_{\P^4}(-4) \oplus V_3 \otimes \mathcal{O}_{\P^4}(-3) \oplus V_2  \otimes \mathcal{O}_{\P^{4}}(-2)  \oplus V_1  \otimes \mathcal{O}_{\P^{4}}(-1) \oplus \mathcal{O}_{\P^{4}} \longrightarrow \pi_* \mathcal{O}_X

is surjective, where we take $V_3, V_4$ with $\dim V_3 = {e+1 \choose 3}, \dim V_4=1$. By Lemma <ref>, we obtain

\reg(X) \leq d-e+3 + {e+1 \choose 3}.

On the other hand, consider a general hyperplane section $S$ of $X$, which is a non-degenerate normal projective surface with Du Bois singularities in $\P^{r-1}$. By Remark <ref>, we know that $\reg(S) \leq d-e+1$. Then <cit.> (see also <cit.>) implies that

\reg(\mathcal{O}_X) \leq d-e.

Finally, we prove Theorem <ref>. We shall use the following proposition. It is probably known to experts, but we could not find a suitable reference. So we give a proof here.

Let $X\subseteq\P^r$ be a projective variety of codimension $2$. Assume that $\dim X\geq 3$. Then $X \subseteq \P^r$ is linearly normal.

Note that if $X$ is contained in a hyperplane in $\P^r$, then the proposition is obvious. So in the sequel we assume $X \subseteq \P^r$ is non-degenerate. We first show that the only non-degenerate surface $S$ in $\P^4$ which is not linearly normal is obtained by an isomorphic projection of the second Veronese surface in $\P^5$. Indeed, if $S \subseteq \P^4$ is not linearly normal, then it can be projected isomorphically from $\P^5$. Thus in $\P^5$, the secant variety of $S$ should have dimension $4$. By Severi's theorem for singular surfaces [3], $S \subseteq \P^5$ is either a cone or the second Veronese surface in $\P^5$. But if $S$ is a cone, then the tangent space of $S$ at a vertex point is the whole space $\P^5$. So in this case, $S$ cannot be projected to $\P^4$ isomorphically. Hence $S $ is a projected second Veronese surface in $\P^4$.

Now let $X$ be a threefold in $\P^5$. Suppose otherwise $X \subseteq \P^5$ is not linearly normal so that it is obtained by an isomorphic projection of $X \subseteq \P^6$.
Let $Y$ be a general hyperplane section of $X \subseteq \P^5$. Then $Y \subseteq \P^4$ is not linearly normal. So by the above argument, $Y$ is a projected second Veronese surface in $\P^4$. This implies that $X \subseteq \P^6$ has degree $4$, and therefore, it is a variety of minimal degree. Hence $X \subseteq \P^6$ is either a rational normal scroll or a cone over the second Veronese surface. If $X$ is a cone, then the tangent space of $X$ at a vertex point is the whole $\P^6$ so that $X$ cannot be projected isomorphically to $\P^5$. Hence $X$ is not a cone, and it is a rational normal scroll. However in this case the tangent variety of $X$ fills all $\P^6$, so again it cannot be projected isomorphically into $\P^5$. Hence $X \subseteq \P^5$ has to be linearly normal.

Finally, consider a non-degenerate projective variety $X \subseteq \P^r$ of codimension $2$ and dimension $\geq 4$. By taking general hyperplane section which is linearly normal by induction, we see that $X \subseteq \P^r$ is linearly normal as claimed.

Suppose first that $X \subseteq \P^5$ is contained in a hyperquadric, i.e., $H^0(\P^5, \mathcal{I}_{X|\P^5}(2)) \neq 0$. If $X \subseteq \P^5$ is a complete intersection, then $\reg(X) \leq d-1$ and the equality holds exactly when $X \subseteq \P^5$ is of type $(2,2)$.  If $X \subseteq \P^5$ is not a complete intersection, then $\reg(X)=\frac{d+1}{2}$ by <cit.>. Thus $\reg(X) \leq d-1$ and the equality holds when $d=3$, i.e., $X \subseteq \P^5$ is a variety of minimal degree. From now on, we assume that $X \subseteq \P^5$ is not contained in a hyperquadric, i.e., $H^0(\P^5, \mathcal{I}_{X|\P^5}(2))=0$. We actually prove that $\reg(X) \leq d-2$, which completes the proof.

As in the proof of Theorem <ref>, take a general projection $\pi \colon X \to \overline{X} \subseteq \P^4$ from a general point in $\P^5$. By Theorem <ref>, $\pi^{-1}(y)=X_y \subseteq \P_y^1$ is $5$-regular. Thus the map

w \colon \mathcal{O}_{\P^4}(-4) \oplus \mathcal{O}_{\P^4}(-3) \oplus \mathcal{O}_{\P^4}(-2) \oplus  \mathcal{O}_{\P^4}(-1) \oplus \mathcal{O}_{\P^4} \longrightarrow \pi_* \mathcal{O}_X

is surjective, and the kernel of $w$ is a vector bundle $E$ on $\P^4$. We now claim that

\reg(E^*) \leq -3.

By <cit.>, it is sufficient to show that $X \subseteq \P^5$ is linearly normal and $H^1(X, \mathcal{O}_X)=0$. By Proposition <ref>, $X \subseteq \P^5$ is linearly normal. On the other hand, <cit.> says that $X$ is simply connected and therefore $H^1(X,\C)=0$.
Since $X$ has Du Bois singularities, it follows that $H^1(X, \C) \to H^1(X, \mathcal{O}_X)$ is surjective. Thus we obtain $H^1(X, \mathcal{O}_X)=0$. We have shown the claim. Now, by applying  Lemma <ref>, we see that $\reg(X) \leq d-2$.

$ $

[1] F. Bastianelli, P. De Poi, L. Ein, R. Lazarsfeld, and B. Ullery, Measures of irrationality for hypersurfaces of large degree, Compos. Math. 153 (2017), 2368-2393.

[2] G. Castelnuovo, Sui multipli di una serie lineare di gruppi di punti appartenente ad una curva algebrica Rend. Circ. Mat. Palermo 7 (1893), 89-110.

[3] M. Dale, Severi's theorem on the Veronese-surface, J. London Math. Soc. (2) 32 (1985), 419-425.

[4] L. Ein, W. Niu, and J. Park, Singularities and syzygies of secant varieties of nonsingular projective curves, Invent. Math. 222 (2020), 615-665.

[5] D. Eisenbud and S. Goto, Linear free resolutions and minimal multiplicity,
J. Algebra 88 (1984), 89-133.

[6] W. Fulton and R. Lazarsfeld, Connectivity and its applications in algebraic geometry, Algebraic geometry (Chicago, Ill., 1980), pp. 26-92, Lecture Notes in Math., 862 (1981), Springer, Berlin-New York.

[7] D. Giaimo, On the Castelnuovo-Mumford regularity of connected curves, Trans. Amer. Math. Soc. 58 (2006), 267-284.

[8] P. Griffiths and J. Harris, Algebraic geometry and local differential geometry, Ann. Sci. Ecole Norm. Sup. 12 (1979), 355-452.

[9] L. Gruson, R. Lazarsfeld, and C. Peskine, On a theorem of Castelnuovo, and the equations defining space curves, Invent. Math. 72 (1983), 491-506.

[10] C. Huneke and I. Swanson, Integral Closure of Ideals, Rings, and Modules, London Mathematical Society Lecture Note Series 336 (2006), Cambridge University Press, Cambridge.

[11] C. Huneke and K.-I. Watanabe, Upper bound of multiplicity of F-pure rings, Proc. Amer. Math. Soc. 143 (2015), 5021-5026.

[12] N. Kakimi, On the multiplicity of terminal singularities on threefolds, preprint, arXiv0004105v2.

[13] J. Kollár, Singularities of the minimal model program, Cambridge Tracts in Mathematics 200 (2013), Cambridge Univ. Press, Cambridge.

[14] J. Kollár and S. Mori, Birational geometry of algebraic varieties, Cambridge Tracts in Math. 134 (1998), Cambridge Univ. Press, Cambridge.

[15] S. Kwak, Castelnuovo regularity for smooth subvarieties of dimension 3 and 4, J. Algebraic Geom. 7 (1998), 195-206.

[16] S. Kwak, Castelnuovo-Mumford regularity bound for smooth threefolds in $\P^5$ and extremal examples, J. Reine Angew. Math. 509 (1999), 21-34.

[17] S. Kwak, Generic projections, the equations defining projective varieties and Castelnuovo regularity, Math. Z. 234 (2000), 413-434.

[18] S. Kwak and J. Park, A bound for Castelnuovo-Mumford regularity by double point divisors, Adv. Math. 364 (2020), 107008, 33 pp.

[19] R. Lazarsfeld, A sharp Castelnuovo bound for smooth surfaces, Duke Math. J. 55 (1987), 423-429.

[20] R. Lazarsfeld, Positivity in algebraic geometry I. Classical Setting: line bundles and linear series, A Series of Modern Surveys in Math. 48, Springer-Verlag, Berlin, (2004).

[21] J. Lipman and B. Teissier, Pseudorational local rings and a theorem of Briançon-Skoda about integral closures of ideals, Michigan Math. J. 28 (1981), 97-116.

[22] J. McCullough and I. Peeva, Counterexamples to the Eisenbud-Goto regularity conjecture, J. Amer. Math. Soc. 31 (2018), 473-496.

[23] J. Moraga, J. Park, and L. Song, Regularity of structure sheaves of varieties with isolated singularities, Commun. Contemp. Math. 23 (2021), No.05, 2050039.

[24] W. Niu, Castelnuovo-Mumford regularity bounds for singular surfaces, Math. Z. 280 (2015), 609-620.

[25] W. Niu and J. Park, A Castelnuovo-Mumford regularity bound for scrolls, J. Algebra 488 (2017), 388-402.

[26] A. Noma, Generic inner projections of projective varieties and an application to the positivity of double point divisors, Trans. Amer. Math. Soc. 366 (2014), 4603-4623.

[27] H. Pinkham, A Castelnuovo bound for smooth surfaces, Invent. Math. 83 (1986), 321-332.

[28] Z. Ran, Local differential geometry and generic projections of threefolds, J. Differential Geom. 32 (1990), 131-137.

[29] Z. Ran, The (dimension+2)-secant lemma, Invent. Math. 106 (1991), 65-71.

[30] K. Shibata, Upper bound of the multiplicity of a Du Bois singularity, Proc. Amer. Math. Soc. 145 (2017), 1053-1059.

[31] S. Takagi and K.-I. Watanabe, On F-pure thresholds, J. Algebra 282 (2004), 278-297.