1 Introduction
Decision problems related to the homotopy of curves have been considered from combinatorial and algorithmic viewpoints for more than a century. On surfaces, Dehn [8] describes a combinatorial procedure for the contractibility problem: Given a closed curve on a surface, decide whether it is contractible. Dehn’s algorithm can be analyzed [9], and is a fundamental tool in geometric group theory [12]. Much more recently, Lazarus and Rivaud [23] and Erickson and Whittlesey [11] develop lineartime algorithms for the contractibility problem (and the more general free homotopy problem) on a surface.
Homotopy questions of curves turn out to be much more complicated for more general topological spaces. Indeed, the problem of contractibility in 2dimensional simplicial complexes is undecidable; this follows from the facts that every finitely presented group is the fundamental group of a 2complex, which can be constructed easily from the presentation, and that, given a finitely presented group specified by generators and relations, there is no algorithm to decide whether a word in the generators and their inverses represents the identity in the group. This implies that the contractibility problem is also undecidable for 4manifolds. See, e.g., Stillwell [29] for more details.
Between surfaces and 4manifolds lies the case of 3manifolds. All known algorithms for deciding contractibility of curves in 3manifolds use the Geometrization Conjecture of Thurston and its proof. The first such algorithm is deduced from the fact that the fundamental group of a 3manifold is residually finite [18]. An algorithm also follows from the bounds on the isoperimetric functions of the fundamental groups of 3manifolds, which are at most exponential [10]. However, the computational complexity of the problem has not been made explicit^{1}^{1}1The implicit bound for the complexity of the word problem in 3manifolds seems to be at least triply exponential. This follows from the exponential lower bounds for the isoperimetric function of a presentation of the fundamental group of a manifold [10, Theorem 8.1.3]. Then the the trivial algorithm for solving the word problem [10, Theorem 2.2.5, Lemma 2.2.4], is triply exponential in the worst case. See also Aschenbrenner et al. [5].. For decidability questions regarding 3manifolds see, e.g., Aschenbrenner et al. [5, 4, Section 4.1].
1.1 Our result
We consider a special case of the contractibility problem in 3manifolds, namely, the case where the 3manifold has nonempty boundary and the input curve lies on the boundary of the 3manifold. Formally, the problem we consider is the following.
BdContract:
Input: A triangulation of a 3manifold made of tetrahedra; a general position PL closed curve on the boundary of made of segments and having selfcrossings.
Output: The answer to the question “Is contractible in ?”. If the answer is positive, and is noncontractible in , the output also includes some simple curve in that is noncontractible in but bounds an embedded disk in .
The decision problem associated to BdContract is similar, except that the output is simply “yes” or “no” (without the possible curve in the output).
We remark that the size of the input of our algorithm is . With our choice of representation of , as a PL curve, the selfcrossings of are not necessarily vertices of , so we always have , and we may have . However, is a natural parameter of the problem, so we choose to take it into account in the complexity analysis.
Theorem 1.1
The BdContract problem admits an algorithm with polynomial space complexity, and with time complexity .
Ignoring the possible curve output by the algorithm, this gives us an algorithm for deciding contractibility of a curve in , restricted to the case where the input curves lies on the boundary of . In addition to being explicit and relatively simple, it has a runningtime that is a considerable improvement over existing implicit bounds for the general contractibility problem for closed curves in a 3manifold.
While the complexity of our algorithm is high, we remark that getting a polynomial complexity would result in a polynomialtime algorithm for the unknot problem (see below), the existence of which has been a longstanding open problem. Moreover, our algorithm does not depend on the Geometrization Conjecture.
The proof of correctness builds closely upon the proof of the Loop Theorem by Papakyriacopoulos, the statement of which we recall here:
Theorem 1.2 (Loop Theorem [24])
Let be a manifold. Suppose that there is a closed curve that is noncontractible in and contractible in . Then there is a simple closed curve that is noncontractible in and bounds an embedded disk in .
Thus, our algorithm is naturally a computational version of the Loop Theorem: If the input curve is noncontractible in and contractible in , it computes a simple closed curve that is noncontractible in and bounds an embedded disk in . Recall that deciding contractibility of curves on surfaces is easy in linear time [23, 11], so that it is possible to check whether is contractible in easily (although we will not need to do this in our algorithm: if the input curve turns out to be contractible in , the algorithm may return no curve, or may return a simple curve that is noncontractible in and bounds an embedded disk in ).
By refining the analysis, we can obtain some related results, which we briefly indicate here, and which are detailed in the last section of this article.
First, in a positive instance of BdContract, we can, in the same amount of time, construct a singular (nonembedded) PL disk that bounds ; it has the same space complexity as the runningtime of the algorithm, see Theorem 9.2.
Secondly, the algorithm can in fact express the homotopy class of , in a tubular neighborhood of its image, as an element in the normal subgroup generated by the homotopy classes, in , of a collection of closed simple curves , such that all curves in are contractible in , see Theorem 9.1. In other words, the algorithm can output all possible simple curves whose existence is guaranteed by the Loop Theorem for , together with an expression writing as a product of their conjugates.
Finally, we prove that the BdContract problem is in the complexity class NP in two specific cases: (i) if the number of selfintersections of the curve is bounded by a constant, or more generally by the logarithm of the input size (Theorem 9.3); or (ii) if the boundary of is a torus (Theorem 9.4)—this case is relevant because of the role of manifolds with torus boundaries in JSJdecompositions [20].
1.2 Related work
More on the Loop Theorem.
Historically, the Loop Theorem originates from Dehn’s famous Lemma:
Lemma 1.3 (Dehn’s lemma [7])
If a simple closed PL curve on the boundary of a 3manifold bounds a PL disk, then it bounds an embedded PL disk.
The first correct proof of the Loop Theorem was given by Papakyriakopoulos [24] using the theory of covering spaces. Later, Shapiro and Whitehead [27] presented a simpler proof of an extension of the Dehn’s Lemma. This proof is the basis for the next extension by Stallings [28]. We heavily use the proof of this extended version, which can be found also in Rolfsen [25]; see also Hempel [19] and Shapiro and Whitehead [27]. A proof of the Loop Theorem by quite a different approach is given by Aitchison and Rubinstein [2].
The unknot problem.
This is one of the most central problems in 3dimensional algorithmic topology. Formally, it is defined as follows.
Unknot:
Input: A general position simple PL closed curve in , made of segments.
Question: Is the unknot, namely, is ambient isotopic to a circle in ?
It has been shown to be decidable by Haken [13]. More recently, Hass et al. [15] have proved that the problem is in NP. In the very recent years, Kuperberg has shown that it is in coNP assuming the generalized Riemann hypothesis [21], and then Lackenby has announced that it is in coNP unconditionally [22]. However, whether the problem is polynomialtime solvable remains a challenging open problem.
As it turns out, the unknot problem can be recast as a special case of the BdContract problem, in which the curve is simple. Indeed, Hass et al. [15] solve the Unknot problem by noting that the input closed curve is unknotted if and only if, on the 3manifold obtained from by removing a torus neighborhood of , a certain simple closed curve “parallel” to the input curve bounds an embedded disk in , or, equivalently by Dehn’s lemma, is contractible in . This reduction from Unknot to BdContract takes polynomial time, which implies, as announced above, that any polynomialtime algorithm for BdContract would, in particular, yield a polynomialtime algorithm for Unknot.
To provide a polynomialsize certificate, Hass et al. [15] use normal surface theory developed by Haken [13] together with tools by Schubert [26] and Jaco and Tollefson [20], which provides a compact encoding of some “nice” embedded surfaces in triangulated 3manifolds; it turns out that a disk as above can be represented by a normal surface of polynomial complexity. This leads to an exponentialtime algorithm for the contractibility problem for simple curves on the boundary of a 3manifold. Our result implies an algorithm with a similar running time for the more general case of possibly nonsimple closed curves on the boundary of a 3manifold.
Agol et al. [1] extend significantly the results of Hass et al. [15] to prove that for an arbitrary knot in a given orientable manifold, deciding if the knot bounds an embedded orientable surface of genus less than an input integer is NPcomplete. The unknot problem is the same problem, restricted to the case where and where the 3manifold is the 3sphere. The smallest integer satisfying this property is the genus of the knot. Our algorithm relies on the abovementioned algorithms from normal surface theory [26, 15, 1] to decide contractibility of simple curves.
Waldhausen’s algorithm.
Even for curves in the interior of the 3manifold, a special case for which a contractibility algorithm existed before the Geometrization Conjecture was proved is when the input 3manifold is known to be sufficiently large and irreducible. This class includes the compact submanifolds of the 3sphere. An algorithm for deciding contractibility in this case was given by Waldhausen [30]. This algorithm uses Haken’s decomposition of sufficiently large manifolds. The complexity of this algorithm has not been analyzed, however, it seems to be much more ineffective than the natural algorithm that computes in the fundamental group of the 3manifold, using the isoperimetric bound whose existence is guaranteed using geometrization. See the complexity calculations by Haken [14].
Immersed normal surfaces.
A natural idea for solving the contractibility problem of a nonsimple curve is to look for a singular (not necessarily embedded) disk bounded by . However, by design, normal surface theory cannot handle nonembedded surfaces. Recently, Burton et al. [6] have studied a natural generalization of normal surfaces that could in principle handle surfaces that are not necessarily embedded. However, they prove that it is NPhard to decide whether such a relaxed normal surface corresponds to an immersed surface, or equivalently whether it corresponds to a surface without a branchpoint. In any case, there is no bound known on the complexity of a singular disk bounding a nonsimple curve on the boundary, other than those given by the implicit bounds on the general word problem for manifolds.
1.3 Outline
The rest of the article is organized as follows. After some preliminaries in Section 2, we discuss the case where the input curve is simple (Section 3), and the cutandpaste procedure on singular disks (Section 4). In Section 5, we introduce another special case and show how this simpler case can be solved. Sections 6 to 8 present our general algorithm and the theory behind its correctness. Finally, in Section 9, we discuss some extensions and special cases.
2 Preliminaries and Notations
2.1 Complexity theory
We briefly introduce, somewhat informally, standard notions of complexity theory that we will need; see, e.g., Arora and Barak [3] for more information. In general, the efficiency of an algorithm is evaluated by its (time) complexity, or running time, which is an (asymptotic) function of the input size: It maps each input size to the largest number of standard operations that the algorithm will perform, over all inputs of size . However, depending on the problem, it is often useful to introduce parameters of the problem others than the input size, and to express the complexity of the problem in terms of these parameters also. As an example, in the problem BdContract, the input size is , but the parameter is used also. The time complexity of a problem is the smallest time complexity of an algorithm solving it. Similarly, the space complexity of an algorithm is a function that maps each input size (or set of parameters) to the largest size of the computation space needed by the algorithm, over all inputs of that size (or with these parameters). The space complexity of a problem is defined analogously. We remark that the space needed to store a positive integer is , its bit complexity, and that the standard arithmetic operations on numbers take time proportional to their bit complexities.
Here are some standard complexity classes for decision problems, for which the answer is either “yes” or “no”:

P is the set of decision problems whose time complexity is upper bounded by a polynomial in the input size;

NP is, intuitively, the set of decision problems for which the “yes” instances can be “certified” to be indeed “yes” instances efficiently. More formally, this is the set of decision problems for which there exists a verifier, a polynomialtime algorithm that takes as input the instance and some additional data of polynomial size, the certificate, such that an instance is a “yes” instance if and only if there exists some choice of certificate such that , when given as input and , returns “yes”;

coNP is the set of decision problems whose negation is in NP;

PSPACE is the set of decision problems whose space complexity is upper bounded by a polynomial in the input size;

EXPTIME is the set of decision problems whose time complexity is upper bounded by an exponential function in a polynomial of the input size.
We have the inclusions PNPPSPACEEXPTIME (and similarly with NP replaced with coNP):

PNPcoNP because if a problem is in P, we can define the verifier to run the polynomialtime algorithm, ignoring the certificate;

NPcoNPPSPACE. To prove NPPSPACE, use the PSPACE algorithm that runs the NPverifier over all possible certificates of polynomial size, and returns “yes” if and only if, for at least one certificate, the verifier returned “yes”. Of course, a symmetric argument holds for coNP;

PSPACEEXPTIME because no algorithm running in polynomial space can be in the same state at two different times (otherwise, it would run forever), and the number of possible states of an algorithm running in polynomial space is exponential.
None of the above inclusions is known to be strict, except between the two extremes: PEXPTIME.
Thus, our result indicates that the decision problem associated to BdContract lies in the complexity class PSPACE.
2.2 Topological notation
We denote the standard unit disk in by , and its boundary by . We denote the homotopy class of a curve in by and the homotopy class of in by . The basepoint for the fundamental groups is always a fixed point of . In many cases, we are not explicit about the basepoints, because we are mainly concerned with contractibility of loops. In general, we use subscripts to record the space in which a homotopy class is computed. A map of a pair is a map such that and . We remark that this latter requirement is not standard. For standard topological concepts on homotopy and covering space, see, e.g., Hatcher [16].
2.3 Curves on triangulated 3manifolds
A triangulation of a 3manifold is the combinatorial data of a number of tetrahedra, with the information of a gluing between some pairs of their faces (i.e., identification of triangles), such that the resulting topological space, after gluing, is homeomorphic to . (In particular, without loss of generality, could be chosen as a 3dimensional simplicial complex, although generalized triangulations, which allow the same vertex, edge, or triangle to be incident several times to a given tetrahedron, are also admissible.) Checking whether such a gluing of tetrahedra actually defines a 3manifold with boundary is easy and standard, see, e.g., [1, Proof of Theorem 2]; one needs to check that (i) each triangle is incident to at most two tetrahedra, (ii) no edge is identified with itself in reverse, (iii) the tetrahedra incident to a given vertex are “spherelike” or “disklike” (technically, the link of each vertex is a 2dimensional sphere or a 2dimensional disk).
We assume that our input 3manifold has nonempty boundary, which thus forms a surface (or 2manifold) . Without loss of generality, we assume that the given curve is a piecewiselinear (PL) map in general position on the triangulated surface , by which we mean that it has finitely many selfintersection points, each of which is a double point where the intersection is transverse. We represent as a PL curve in , in a way that the set of vertices of this PL curve includes the intersections of with the edges of the triangulation of , but not necessarily the selfintersections of . In more detail, this means that is stored as an ordered sequence of its vertices, where a vertex lying in a triangle of is described by its barycentric coordinates in .
3 The Case of Simple Curves
We begin by explaining the algorithm for contractibility in the case where the input curve (lies on the boundary of the 3manifold and) is simple. We will use this algorithm for simple curves as a subroutine for the general case.
Proposition 3.1
The BdContract problem, that is, the case where is simple (), admits an algorithm with polynomial space complexity, and with time complexity . Moreover, the associated decision problem lies in NP.

This essentially follows from previous work on algorithms using normal surface theory, and we will use some of the concepts of this theory, which are described in other articles containing the main ideas used below [15, 1].
Let be the triangulation of the manifold . We first compute, in polynomial time, another triangulation of of complexity such that the input curve belongs to the 1skeleton of (namely, the union of its vertices and edges of ). For this purpose, let be a triangulation of that is a subdivision of containing the the image of in its 1skeleton; we can easily compute such a triangulation of complexity . For each triangle of belonging to a tetrahedron of , we subdivide by coning from the vertex of not on . Finally, for every tetrahedron of intersecting along an edge split into, say, subedges in , we can easily subdivide into tetrahedra such that these subedges appear as edges of these tetrahedra. Let be the resulting triangulation; it satisfies the announced properties.
By Dehn’s lemma, if is contractible in , it bounds an embedded disk in . By a result by Schubert [26, Section 5.5], it then bounds a fundamental normal disk (with respect to the triangulation ). By Hass et al. [15, Lemma 6.1(2)], such a fundamental normal disk has size (in terms of number of bits needed to store it). After these considerations, the algorithm for the BdContract problem restricted to curves that are simple is essentially described in Hass et al. [15, Section 8, Haken unknottedness algorithm]. It enumerates all normal surfaces with size and, for each of them, determines whether it is a disk bounding (namely, whether it is connected, which can be done using the orbit counting algorithm of Agol et al. [1, Corollary 14]; and whether it has Euler characteristic one and bounds , which can be done easily using the normal coordinates). If such a disk is found, it returns “yes”; otherwise, it returns “no”. Moreover, if the answer is “yes”, we determine whether is contractible in ; since is simple, it is equivalent to deciding whether bounds a disk in , which is easy to do in linear time, by computing the Euler characteristic of the connected components of the surface cut along . If is noncontractible in , then we also return it. The algorithm is clearly correct and runs in time.
There remains to prove that the decision problem associated to BdContract is in NP. The verification algorithm mentioned above for fundamental normal coordinates runs in polynomial time. This is indeed the reason for incorporating the orbit counting algorithm. See Agol et al. [1].
Remark. Note that in the proof of Proposition 3.1 we have used the normal surface theory in the sense of Haken [14] and Schubert [26]. This setting seems more appropriate for the general problem of contractibility of simple curves than the now standard normal surface theory. In the former, one has different types of 3dimensional cells and in the latter one works only with tetrahedra.
Remark. As an alternative to the above proof, we could use only the result by Agol et al. [1], which states that the problem of deciding if a simple closed curve in the interior of an orientable 3manifold bounds an embedded surface of genus at most is in NP. For this purpose, we could attach a collar to each boundary component of , obtaining a manifold containing in its interior. We claim that is a knot of genus zero in if and only if is contractible in . Indeed, if is a knot of genus zero in , it is contractible in , and thus also in because deformation retracts to . Conversely, by Dehn’s lemma, if is contractible in , then it bounds an embedded disk in , and thus also in . This proves the claim. It thus suffices to decide whether has genus zero in . It is not difficult to build a triangulation of with complexity , and we can then use the NP proof (and corresponding algorithm) by Agol et al. [1] directly. That paper [1] is presented in the case where the 3manifold is orientable, but the results we use extend immediately to nonorientable ones by passing to the orientable double cover, which we can also construct algorithmically.
4 Removing Singularities by Cut and Paste
We present procedures to replace some singular disks with others that have fewer singularities. The ideas used in this section are instrumental in the proof of the Loop Theorem; see, e.g., Hempel [19, Chapter 4]. However, additional details are needed because we do not only care about the existence of some curves, but we also need to be able to compute them.
4.1 Smoothings of a curve in a manifold
Let be a general position PL curve on , and let be a selfcrossing point of .
There are two natural ways to modify the curve in a small neighborhood of , while staying on , such that the selfintersection is removed. These are depicted in Figure 1. Observe that one of the possibilities results in two curves and the other in a single curve. These operations are called the smoothings of at .
4.2 Good singular disks
A singular disk is a map . In this article, we restrict ourselves to singular disks that are PL and in general position. This does not restrict generality; indeed, if a PL curve in is contractible, then the contraction can be taken to be PL and in general position, so bounds a PL singular disk in general position. A singular point of is a point of that is the image, under , of at least two points in .
We say that the singular disk is good if every singular point of is the image of exactly two points in , and moreover the set of singular points is the disjoint union, in , of finitely many closed double curves, i.e., simple closed curves, and double arcs, i.e., simple paths in whose endpoints have preimages in . Not every singular disk in general position is good; for example, a good singular disk contains no triple points (isolated points with three preimages in ) or branchpoints (which have one preimage, but are limits of singular points—such branchpoints are excluded because, by definition, the set of singular points of a good singular disk has to be closed).
Every contractible closed curve in bounds a singular disk. However, not every contractible closed curve in bounds a good singular disk; for example, no contractible closed curve in
with an odd number of selfintersections can bound a good singular disk.
4.3 Eliminating closed double curves
Eliminating closed double curves in a good singular disk is easy:
Lemma 4.1
Let be a manifold and be a good singular disk. Then there is a good singular disk such that and has no closed double curve.

This directly follows from Hempel [19, Lemma 4.6]. Here is an overview of the proof (we deliberately omit some details, especially in the case where is nonorientable). A closed double curve in corresponds to two disjoint closed curves and in the interior of , bounding disks and in . There are two cases depending on whether and are nested. If they are nested, without loss of generality we can assume that is the exterior closed curve. In , we can replace with (suitably reparameterized). If they are not nested, then one can replace with (suitably reparameterized) and similarly with , and finally slightly perturb the resulting map in a suitable way. This removes at least one closed double curve; iterating, we remove all closed double curves.
4.4 Eliminating double arcs
Eliminating double arcs is more complicated, because such arcs intersect the boundary of the singular disk. We first need a definition. Let be a closed curve on , and and be two selfintersection points of . When walking along , the points and are encountered twice, either in the order (noninterlaced case) or in the order (interlaced case)—these are the only possibilities up to cyclic permutation.
Below, we describe two ways to eliminate a double arc, depending on whether the endpoints of the double arc are interlaced or not along . These arguments are essentially from Hempel [19, Lemma 4.7].
First, let us consider the easier noninterlaced case.
Lemma 4.2
Let be a manifold, and let be a closed curve on . Let be a tubular neighborhood of the image of . Let and be distinct selfcrossings of that are noninterlaced. Then we can compute two closed curves and in , each resulting from smoothing in at and , such that:

is in the normal subgroup generated by and ;

if bounds a good singular disk such that and are endpoints of a double arc , then and bound good singular disks and in , whose sets of double arcs are included in those of , but do not contain .

Let us first assume that is a good singular disk containing a double arc with endpoints and , which are noninterlaced; see Figure 2(left). Write as the concatenation of , , , and in this order, in such a way that goes from to , goes from to , and both and are loops based at and , respectively. In two different ways, we can simplify to remove the arc by cutting the image of open along and then gluing back the pieces; see Figure 3. These two operations result in two good singular disks and , bounded by curves and .
The crucial point in the above construction is that the definition of and does not depend on the singular disk , but only on , , and . Thus, let , , and be as in the statement of the lemma (and let us not assume any more that and are the endpoints of a double arc). See Figure 3. As above, write as the concatenation of , , , and in this order, in such a way that goes from to , goes from to , and both and are loops based at and , respectively. We define and . These curves are obtained by smoothing at and . A trivial computation shows that , which implies that is in the normal subgroup generated by and .
Moreover, if turns out to bound a good singular disk such that and are endpoints of a double arc , then the above construction shows that and bound good singular disks in , whose sets of double arcs are included in those of , but do not contain the arc .
Now, let us consider the interlaced case. The statement is similar in spirit, but more complicated: There are two pairs of curves to consider.
Lemma 4.3
Let be a manifold, and let be a closed curve on . Let be a tubular neighborhood of the image of . Let and be distinct selfcrossings of that are interlaced. Then we can compute four closed curves and , , in , each resulting from smoothing in at and , such that:

for each , is in the normal subgroup generated by and ;

if bounds a good singular disk such that and are endpoints of a double arc , then for some , the curves and bound good singular disks and in , whose sets of double arcs are included in those of , but do not contain .

Let us first assume that is a good singular disk containing a double arc , whose endpoints are interlaced along ; see Figure 2(right). Write as the concatenation of , , , and in this order, where the endpoints of these four paths are and . By construction, either and together bound a good singular disk whose image is included in the image of , or and do; up to changing , , , and , let us assume that and do. As in the preceding proof, we can, in two different ways, simplify to remove the arc by cutting the image of open along and then gluing back the pieces. These two operations result in two good singular disks and , bounded by curves and .
Now, let , , and be as in the statement of the lemma (and let us not assume any more that and are the endpoints of a double arc). Write as the concatenation of , , , and in this order, where the endpoints of these four paths are and . We define and . These curves are obtained by smoothing at and . A trivial computation shows that , which implies that is in the normal subgroup generated by and .
Assume moreover that bounds a good singular disk , and that and together bound a good singular disk whose image is included in the image of . Then the above construction shows that and bound good singular disks in , whose sets of double arcs are included in those of , but do not contain the arc .
The subtlety compared to the previous proof is that, given , written as the concatenation where the endpoints of these four paths are and , and assuming it bounds a good singular disk , the algorithm cannot decide whether and (and thus also and ) bound a good singular disk whose image is included in the image of , or whether and (and thus also and ) do. So, we have to introduce two pairs of curves, one for each case. Specifically, define and (the case described above, in which and together bound a singular disk whose image is included in that of ), and similarly and (corresponding to the case where and together bound a singular disk whose image is included in that of ). As a side note, it turns out that and are identical, except for their basepoints; in the sequel, we do not exploit this coincidence.
5 Strongly Contractible Curves
Not every contractible closed curve in bounds a good singular disk in . We call a closed curve on strongly contractible if it bounds a good singular disk. The purpose of this section is to prove the following proposition.
Proposition 5.1
Under the hypotheses of Theorem 1.1, there is an algorithm that in polynomial space and time outputs either “(i)” or “(ii)”, such that:

if it outputs “(i)”, then is contractible in ;

if it outputs “(ii)”, then is not strongly contractible in .
Moreover, if it outputs (i), and if is noncontractible in , it also outputs a simple curve contractible in and noncontractible in .
Note that these two possibilities are not exclusive from each other; if the input curve is contractible but not strongly contractible, the algorithm can return either (i) or (ii). Roughly speaking, if it were true that every contractible closed curve on is strongly contractible, then the above proposition would give an algorithm for deciding contractibility.
Although we will not use this proposition directly in the rest of the paper, the arguments of the proof will be reused almost verbatim in a more refined context later (see Proposition 7.1).
The proof uses the following lemma.
Lemma 5.2
Assume that is strongly contractible but is not simple. Then there is a pair of (distinct) selfintersection points and of satisfying the following:

We note that the following algorithm is not the most efficient one could think of, but the same proof pattern will be used in the proof of Proposition 7.1.
The algorithm is recursive. If has no selfintersection point, we first determine whether is contractible in , using Proposition 3.1. If it is the case, then we return (i) ( is contractible in ), together with the curve if output by the algorithm of Proposition 3.1; otherwise, we return (ii) ( is not strongly contractible); in both cases, this is correct. If has a single selfintersection point, we return (ii); this is also correct, because otherwise, would be strongly contractible and would thus have at least two selfintersection points (Lemma 5.2).
Now, assume that has at least two selfintersection points. We apply the following algorithm.

For every choice of distinct selfintersection points and of , we do the following:

if and are noninterlaced: compute the curves and obtained from Lemma 4.2, and recursively run the algorithm on and . If the outcomes for both and is (i), then return (i).

if and are interlaced: compute the curves , , , and obtained from Lemma 4.3, and recursively run the algorithm on these four curves. If the outcome for both and , or for both and , is (i), then return (i).


(Assuming the algorithm arrives at this point:) Return (ii).
We now prove correctness. Assume that the algorithm returns (i) in Step 1(a) or 1(b). This is correct: indeed, if this occurs in Step 1(a), by Lemma 4.2, the homotopy class of lies in the normal subgroup generated by the homotopy classes of and , in , and thus also in ; but on the other hand, by (i), and are contractible in ; so is indeed contractible in . If this occurs in Step 1(b), by Lemma 4.3, the same argument holds, in which and are replaced with and for some .
Moreover, if the output of at least one of these two recursive calls contains a curve, we return one such curve. By the induction hypothesis, the output curve satisfies the desired properties. Finally, if no curve is output, this implies that both and (or and , for some , in the interlaced case) are contractible in , so , the homotopy class of which lies in the normal subgroup generated by those of and (or and ) in , is also contractible in ; hence it is correct to output no curve.
Otherwise, we return (ii). This is correct because otherwise, Lemma 5.2 would imply that for some choice of and , both and (or and ) are strongly contractible, which we know is not true.
The space needed by the algorithm is polynomial. Indeed, the depth of the recursion tree is , and each call takes polynomial space. The running time of the algorithm can be bounded from above by a function of the number of selfintersections of . Each of the closed curves at the leaves of the recursion tree has complexity . We have by Proposition 3.1 (because the curves at the leaves of the recursion tree can have complexity ); we also have and for . This implies by induction , and thus the result.

6 Towers of TwoSheeted Covering Spaces
As we have seen in the previous section, if it were true that every contractible closed curve on is strongly contractible, we would have an algorithm to test such curves for contractibility. It is not the case, however, and the proof of the Loop Theorem has to face this difficulty. The way to circumvent it is via an iterative construction of twosheeted covering spaces, a concept that originates from the classical proof of the Loop Theorem due to Shapiro and Whitehead [27] and available in various sources [19, 25, 17], which we reformulate now.
Let be a singular disk. A tower (of twosheeted covering spaces) for is defined by the following commutative diagram:
M0 & &V0 & &
&p0 & &f0(2,6) & &
M1 & &V1 & &
⋮& &⋮&(2,4) &
Mℓ1 & &Vℓ1 & &
&pℓ1 & &fℓ1 & &
M=Mℓ& &Vℓ&fℓ=f&D2
such that for each :

and are connected 3manifolds with boundary;

the map is a twosheeted covering map;

maps into and (after composition with the inclusion map ) into .
We also say that this tower is a tower for the curve .
The following theorem follows from the classical proofs of the Loop Theorem [27, 28], and will be used in Section 8:
Theorem 6.1
Under the hypotheses of Theorem 1.1, assume that is contractible. Then there is a tower for such that is a disjoint union of spheres.
7 Virtually Strongly Contractible Curves
We say that a curve on is virtually strongly contractible if there exists a tower for such that lifts to a strongly contractible curve in . In particular, every virtually strongly contractible curve is contractible in , because it lifts to a contractible closed curve.
We now prove the following proposition, which is the same as Proposition 5.1 with “strongly contractible” replaced by “virtually strongly contractible”:
Proposition 7.1
Under the hypotheses of Theorem 1.1, there is an algorithm that in polynomial space and time outputs either “(i)” or “(ii)”, such that:

if it outputs “(i)”, then is contractible in ;

if it outputs “(ii)”, then is not virtually strongly contractible.
Moreover, in case (i), and if is noncontractible in , it also outputs a simple curve contractible in and noncontractible in .
The proof rests on the following lemma.
Lemma 7.2
Assume that is strongly contractible but is not simple. Then there is a pair of (distinct) selfintersection points and of satisfying the following:

Consider a tower for , with minimum possible height among all choices of towers of such that is a good singular disk. By Lemma 4.1, we can assume that has no closed double curve.
Assume that is an embedding. This implies , because is not an embedding due to the selfcrossings of . Moreover, because is an embedding and is a twosheeted covering map, is a good singular disk (this is the key reason why twosheeted covering spaces are used!). So the tower starting at , not , is a tower of smaller height; this contradicts the choice of the tower. Hence, is a good singular disk with at least one double curve, but no closed double curve (as shown in the previous paragraph), thus with at least one double arc.
We apply Lemma 4.2 or Lemma 4.3 in to and to the endpoints of this double arc, depending on whether these endpoints are interlaced along . We obtain two closed curves obtained from smoothing at these endpoints, which bound good singular disks. Let and be the projections of these two closed curves to ; they are also obtained from by the smoothings described in Lemma 4.2 or 4.3, because the constructions of and are done in the same way regardless of whether they take place in or in any space in the tower. This implies that the tower for is also a tower for and , which are thus also virtually strongly contractible.

The algorithm is identical to that in the proof of Proposition 5.1. The proof is exactly the same, replacing everywhere “strongly contractible” with “virtually strongly contractible”, and using Lemma 7.2 in place of Lemma 5.2. We reproduce the proof for clarity.
The algorithm is recursive. If has no selfintersection point, we first determine whether is contractible in , using Proposition 3.1. If it is the case, then we return (i) ( is contractible in ), together with the curve if output by the algorithm of Proposition 3.1; otherwise, we return (ii) ( is not virtually strongly contractible); in both cases, this is correct. If has a single selfintersection point, we return (ii); this is also correct, because otherwise, would be virtually strongly contractible and would thus have at least two selfintersection points (Lemma 7.2).
Now, assume that has at least two selfintersection points. We apply the following algorithm.

For every choice of distinct selfintersection points and of , we do the following:

if and are noninterlaced: compute the curves and obtained from Lemma 4.2, and recursively run the algorithm on and . If the outcomes for both and is (i), then return (i).

if and are interlaced: compute the curves , , , and obtained from Lemma 4.3, and recursively run the algorithm on these four curves. If the outcome for both and , or for both and , is (i), then return (i).


(Assuming the algorithm arrives at this point:) Return (ii).
We now prove correctness. Assume that the algorithm returns (i) in Step 1(a) or 1(b). This is correct: indeed, if this occurs in Step 1(a), by Lemma 4.2, the homotopy class of lies in the normal subgroup generated by the homotopy classes of and , in , and thus also in ; but on the other hand, by (i), and are contractible in ; so is indeed contractible in . If this occurs in Step 1(b), by Lemma 4.3, the same argument holds, in which and are replaced with and for some .
Moreover, if the output of at least one of these two recursive calls contains a curve, we return one such curve. By the induction hypothesis, the output curve satisfies the desired properties. Finally, if no curve is output, this implies that both and (or and , for some , in the interlaced case) are contractible in , so , the homotopy class of which lies in the normal subgroup generated by those of and (or and ) in , is also contractible in ; hence it is correct to output no curve.
Otherwise, we return (ii). This is correct because otherwise, Lemma 5.2 would imply that for some choice of and , both and (or and ) are virtually strongly contractible, which we know is not true.
The space needed by the algorithm is polynomial. Indeed, the depth of the recursion tree is , and each call takes polynomial space. The running time of the algorithm can be bounded from above by a function of the number of selfintersections of . Each of the closed curves at the leaves of the recursion tree has complexity . We have by Proposition 3.1 (because the curves at the leaves of the recursion tree can have complexity ); we also have and for . This implies by induction , and thus the result.

8 Proof of Theorem 1.1
Let be a closed curve on in general position, let be the set of selfcrossing points of , and let . Let be the abstract graph, naturally drawn (with crossings) on , whose vertex set is and whose edges are the subpaths of between consecutive points of (“consecutive” when walking along ). This is a fourvalent graph, possibly with loops and multiple edges, drawn on in generic position; some edges cross (or selfcross) unless . A special case is when is empty; in that case, is a closed curve (equal to ).
Alternatively, one may find useful to think of as follows: In the neighborhood of each crossing point of in , pull one of the two pieces of passing through slightly in the interior of , thus removing the crossing . The result is an embedding of the graph , and the drawing that we consider is obtained by pushing back the pieces to .
We need to carefully distinguish between objects in and their images in . For this purpose, we employ the standard graph theory terminology of closed walk in (the abstract graph) . A cycle in (the abstract graph) is a closed walk without repeated vertices. The image, in , of a cycle in may, of course, selfcross (at points in ).
Let be an abstract graph, and let an arbitrary spanning tree of . An elementary cycle in (with respect to ) is a cycle in with all its edges in , except precisely one. We will use the following easy and well known fact:
Fact 8.1
Let be an abstract graph, viewed as a topological space. For any spanning tree of , the homotopy class of every closed walk in lies in the normal subgroup generated by the homotopy classes of its elementary cycles.
Lemma 8.2
Let us assume the hypotheses of Theorem 1.1. Let be the set of selfcrossing points of . Then:

If is contractible in , then for some , the image in of every cycle in is virtually strongly contractible.

If for some and some spanning tree of , the image, in , of every elementary cycle in (with respect to ) is contractible, then is contractible in .

1. Assume that is contractible in . By Theorem 6.1, there is a tower for such that is a disjoint union of spheres. Moreover, lifts to a closed curve on . Let be the set of selfcrossing points of that are the projections of the selfcrossing points of . The image of every cycle in is virtually strongly contractible, because the image of every such cycle lifts to a simple closed curve in , which is a sphere.
2. By Fact 8.1, if for some , the image of every elementary cycle in is contractible in , then the image of every closed walk in is contractible in . As is the image of a closed walk in , this curve is contractible in as well.

Here is the algorithm. For every possible subset of selfcrossing points of , we consider the set of the elementary cycles in (with respect to an arbitrary but fixed spanning tree of ), and apply Proposition 7.1 to each element of . If, for some , the algorithm of Proposition 7.1 returns (i) for every elementary cycle in (implying that these cycles are contractible in ), then we report that is contractible in ; moreover, if at least one instance of the algorithm of Proposition 7.1 has returned a curve, we also return one of these output curves. Otherwise, we report that is noncontractible in .
The proof of correctness follows easily from the previous considerations. First, if is contractible in , then Lemma 8.2(1) implies that for some choice of , the cycles in are virtually strongly contractible; thus the algorithm in Proposition 7.1 returns (i) for these cycles, and the above algorithm reports that is contractible in . If the algorithm returns a curve, then it clearly satisfies the specification. On the other hand, if the algorithm returns no curve, this means that all the elementary cycles in are contractible in , which implies, by Fact 8.1, that is also contractible in , so it is correct to output no curve.
On the other hand, if the algorithm reports that is contractible in , this is because, for some choice of , every elementary cycle in is contractible in . Lemma 8.2(2) implies that is indeed contractible in .
9 Extensions and Refined Analysis in Special Cases
In this section, we show that essentially the same algorithm as in Theorem 1.1 can output more information if desired, and show that the BdContract problem, when restricted to two special cases, lies in the complexity class NP.
9.1 Extensions
Theorem 9.1
Consider an input to the BdContract problem, and assume that is contractible in . Let be the graph that is the image of . In time, we can compute:

closed curves in , such that each has complexity , is contractible in , and can be slightly perturbed on by smoothing some selfcrossings of to be made simple;

paths in , each of complexity ,

and a formula expressing the homotopy class of in as being in the normal product of the homotopy classes of in where is the same as but connected to the basepoint; more precisely, it indicates that is homotopic, in , to a curve that is the concatenation of the paths , , and in some order, each appearing exactly once, such that the pairs and are conjugator paths.

The proof is essentially a refinement of the proof of Theorem 1.1. One can refine Proposition 7.1 so that, if the answer is (i), some paths and some curves as indicated in the statement of the theorem are computed so that is expressed as above. Expressing in terms of the homotopy classes of these curves can be done explicitly, as in the proof of Lemma 4.2 or 4.3 (see also Hempel [19, Lemma 4.7]). The formula is obtained by recurrence on the formula indicated in either Lemma 4.2 or Lemma 4.3. Finally, since is contractible in , the algorithm of Theorem 1.1 returns this extended output of Proposition 7.1, as desired. This does not change the asymptotic time complexity of the algorithm (although the space complexity becomes exponential).
Theorem 9.2
Consider an input to the BdContract problem, and assume that is contractible in . In time, we can compute a PL singular disk in bounded by , of complexity .

We can modify the algorithm in a way that, at each recursive call, a singular disk bounding is computed. Proposition 3.1 can be modified to return an explicit PL embedded disk, by presenting the normal disk found explicitly. Then, in Proposition 7.1, one can also return a PL singular disk bounding the curve , if is found to be contractible. This does not change the time complexity of the algorithm (although the space complexity becomes exponential).
9.2 Refined analysis in special cases
It would be very interesting to know whether the contractibility problem lies in NP. We are presently unable to decide this; the obstruction for our contractibility algorithm to be in NP is the size of the recursion tree of the algorithm of Proposition 7.1. Nonetheless, we show that the BdContract problem is indeed in NP in two special cases. Formally, in this section, because being in NP makes sense only for decision problems, we only consider the decision problem associated to BdContract.
9.2.1 Curves with few selfintersections
The first special case is when the number of selfcrossings is small:
Theorem 9.3
The decision problem associated to BdContract, restricted to inputs with , lies in the complexity class NP.

Assume that is contractible. The certificate that it is the case is the formula of Theorem 9.1, together with, for each curve , a normal disk bounded by (a slightly perturbed simple copy of) . Because of the upper bound on , this formula has polynomial size; moreover, by the proof of Proposition 3.1, for each curve there is such a normal disk with polynomial size. Moreover, since the formula expresses an equality in the homotopy group of , which is a free group, it is trivial to check its validity in polynomial time in its size. Finally, as in the proof of Proposition 3.1 (see Agol et al. [1]), in polynomial time one can check whether indeed normal disks bounding slightly perturbed simple copies of the s are provided.
9.2.2 The case of the torus boundary
The second case in which we prove that the decision problem associated to BdContract is in NP is perhaps the simplest nontrivial case, namely, the case where the boundary component of containing the curve is a torus. Using the fact that the fundamental group of the torus is Abelian, we prove:
Theorem 9.4
The decision problem associated to BdContract, restricted to the case where the connected component of containing is a torus, lies in the complexity class NP.

As above, let be the fourvalent graph whose image is . By a subcurve of we mean any closed curve whose image lies in the image , and that uses every edge of at most once. We first claim the following: The number of distinct homotopy classes of subcurves of is . To see this, let be a spanning tree of , and let be obtained from by contracting . Each subcurve of becomes a walk without repeated edges in , which is a onevertex graph embedded on the torus. So the loops of fall into at most three distinct homotopy classes, of the form , , and (in multiplicative notation). Moreover, the number of edges in is . Since the fundamental group of the torus is Abelian, each subcurve of is homotopic to a homotopy class of the form , where and are at most . The claim follows.
Next, we show that there exists a certificate of polynomial length for contractibility of the curve . We use the formula provided by Theorem 9.1. The closed curves appearing in that formula are subcurves of ; up to replacing some curves with others within the same homotopy class in , and considering that the formula expresses an equality in homotopy not in but in , we can assume that there are curves. Since the fundamental group of the torus is Abelian, we can omit the conjugator paths, and thus the formula simplifies as the product of the homotopy classes of closed curves, each elevated to some power that is at most . The first part of the certificate is this formula; since there are polynomially many curves, and since the power can be encoded in binary, this takes polynomial space. The second part of the certificate is a normal disk spanning each of the curves; this again takes polynomial space.
Now assume that such a certificate is given; we need to check it in polynomial time. We first check that the formula is valid in homotopy on ; since the boundary component is a torus, this is easy to do in polynomial time using homology; alternatively, we can use previous results [23, 11]. Then, one need to check the second part of the certificate, namely, that each normal surface provided is indeed a normal disk bounding the corresponding curve; this can be done in polynomial time, as in the proof of Proposition 3.1 (see also Agol et al. [1]).
Acknowledgments.
The authors would like to thank Jonathan Spreer for a stimulating discussion at the early stage of this research.
References
 [1] (2006) The computational complexity of knot genus and spanning area. Transactions of the American Mathematical Society 358 (9), pp. 3821–3850. Cited by: §1.2, §2.3, §3, §3, §3, §3, §9.2.1, §9.2.2.
 [2] (2004) Localising Dehn’s lemma and the loop theorem in 3manifolds. Mathematical Proceedings of the Cambridge Philosophical Society 137, pp. 281–292. Cited by: §1.2.
 [3] (2009) Computational complexity: A modern approach. Cambridge University Press, New York, NY, USA. Cited by: §2.1.
 [4] (2015) 3manifold groups. EMS Series of lectures in mathematics, European mathematical society. External Links: ISBN 9783037191545, LCCN 2016304774, Link Cited by: §1.
 [5] (2015) Decision problems for 3manifolds and their fundamental groups. Geometry & Topology Monographs 19, pp. 201–236. Cited by: §1, footnote 1.
 [6] (2015) On the complexity of immersed normal surfaces. Geometry and Topology 20, pp. 1061–1083. Cited by: §1.2.
 [7] (1910) Über die Topologie des dreidimensionalen Raumes. Mathematische Annalen 69 (1), pp. 137–168. Cited by: Lemma 1.3.
 [8] (1912) Transformation der Kurven auf zweiseitigen Flächen. Mathematische Annalen 72, pp. 413–421. Cited by: §1.
 [9] (1985) The complexity of Dehn’s algorithm for word problems in groups. Journal of Algorithms 6, pp. 543–549. Cited by: §1.
 [10] (1992) Word processing in groups. Ak Peters Series, Taylor & Francis. External Links: ISBN 9780867202441, LCCN lc91046119, Link Cited by: §1, footnote 1.
 [11] (2013) Transforming curves on surfaces redux. In Proceedings of the 24th Annual ACMSIAM Symposium on Discrete Algorithms (SODA), pp. 1646–1655. Cited by: §1.1, §1, §9.2.2.
 [12] (1960) On Dehn’s algorithm for the conjugacy and word problems with applications. Communications on Pure and Applied Mathematics 13, pp. 641–677. Cited by: §1.
 [13] (1961) Theorie der Normalflächen, ein Isotopiekriterium für den Kreisnoten. Acta Mathematica 105, pp. 245–375. Cited by: §1.2, §1.2.
 [14] (19621201) Über das Homöomorphieproblem der 3Mannigfaltigkeiten. I. Mathematische Zeitschrift 80 (1), pp. 89–120. External Links: ISSN 14321823, Document, Link Cited by: §1.2, §3.
 [15] (199903) The computational complexity of knot and link problems. J. ACM 46 (2), pp. 185–211. External Links: ISSN 00045411, Link, Document Cited by: §1.2, §1.2, §1.2, §1.2, §3, §3.
 [16] (2001) Algebraic topology. Cambridge University Press. External Links: ISBN 0521795400 Cited by: §2.2.
 [17] (2007) Notes on basic 3manifold topology. Note: Notes available on the author’s webpage Cited by: §6.
 [18] (1987) Residual finiteness for 3manifolds. Combinatorial group theory and topology (Alta, Utah, 1984) 111, pp. 379–396. Cited by: §1.
 [19] (2004) 3manifolds. AMS Chelsea Publishing Series, AMS Chelsea Pub., American Mathematical Society. External Links: ISBN 9780821836958, LCCN 2004048971, Link Cited by: §1.2, §4.3, §4.4, §4, §6, §9.1.
 [20] (199509) Algorithms for the complete decomposition of a closed manifold. Illinois J. Math. 39 (3), pp. 358–406. External Links: Link Cited by: §1.1, §1.2.
 [21] (2014) Knottedness is in NP, modulo GRH. Advances in Mathematics 256, pp. 493–506. Cited by: §1.2.
 [22] (2016) The efficient certification of knottedness and Thurston norm. Note: arXiv:1604.00290 Cited by: §1.2.
 [23] (2012) On the homotopy test on surfaces. In Proceedings of the 53rd Annual IEEE Symposium on Foundations of Computer Science (FOCS), pp. 440–449. Cited by: §1.1, §1, §9.2.2.
 [24] (1957) On Dehn’s lemma and the asphericity of knots. Annals of Mathematics 66 (1), pp. 1–26. External Links: ISSN 0003486X, Link Cited by: §1.2,
Comments
There are no comments yet.