Unified Hanani-Tutte theorem

We introduce a common generalization of the strong Hanani-Tutte theorem and the weak Hanani-Tutte theorem: if a graph $G$ has a drawing $D$ in the plane where every pair of independent edges crosses an even number of times, then $G$ has a planar drawing preserving the rotation of each vertex whose incident edges cross each other evenly in $D$. The theorem is implicit in the proof of the strong Hanani-Tutte theorem by Pelsmajer, Schaefer and \v{S}tefankovi\v{c}. We give a new, somewhat simpler proof.

Theorem 1 (Unified Hanani-Tutte theorem). Let G be a graph and let W be a subset of vertices of G. Let D be a drawing of G where every pair of edges that are independent or have a common endpoint in W cross an even number of times. Then G has a planar embedding where cyclic orders of edges at vertices from W are the same as in D.
By setting W = ∅ we obtain the strong Hanani-Tutte theorem, while W = V (G) gives the weak variant.
Theorem 1 directly follows from the proof of the Hanani-Tutte theorem by Pelsmajer, Schaefer andŠtefankovič [9]. In Section 3 we give a new, slightly simpler proof by induction, based on case distinction of the connectivity of G and using the weak Hanani-Tutte theorem as a base case. Our proof of Theorem 1 also gives an alternative proof of the strong Hanani-Tutte theorem, by reducing it to the weak variant for 3-connected graphs.
In Section 4 we show how to extend Theorem 1 to multigraphs. The unified Hanani-Tutte theorem can be used to simplify the proof of the Hanani-Tutte theorem for clustered planarity with two clusters [4], and perhaps other variants of the Hanani-Tutte theorem as well. It is also one of the base cases of the induction in the proof of a variant for clustered planarity with embedded pipes [3].

Notation
We assume that G = (V, E) is a graph, with no loops or multiple edges. We use the shorthand notation G − v for G[V \ {v}]. A drawing of G is a representation of G in the plane where every vertex is represented by a unique point and every edge e = uv is represented by a simple curve joining the two points that represent u and v. If it leads to no confusion, we do not distinguish between a vertex or an edge and its representation in the drawing and we use the words "vertex" and "edge" in both contexts. We assume that in a drawing no edge passes through a vertex, no two edges touch, every edge has only finitely many intersection points with other edges and no three edges cross at the same inner point. In particular, every common point of two edges is either their common endpoint or a crossing.
A drawing of a graph is an embedding or a planar drawing if no two edges cross.
The rotation of a vertex v in a drawing is the clockwise cyclic order of the edges incident to v. We will represent the rotation of v by the cyclic order of the other endpoints of the edges incident to v.
We say that two edges in a graph are independent if they do not share a vertex. An edge in a drawing is even if it crosses every other edge an even number of times. A vertex v in a drawing is even if all the edges incident to v cross each other an even number of times. A drawing of a graph is even if all its edges are even. A drawing of a graph is independently even if every pair of independent edges in the drawing cross an even number of times.

Proof of Theorem 1
Assume that G = (V, E) and let n = |V |. We proceed by induction on n. The theorem is trivial for n = 1.
Assume that n ≥ 2. We distinguish four cases according to the connectivity of G.
Case 0: If G is disconnected, we can use the inductive hypothesis for each component separately and draw the components in disjoint regions in the plane.
Case 1: G is connected and has a separating vertex v.
be the subgraph of G induced by the vertices of G ′ i and v. By the inductive hypothesis, G i has an embedding D i preserving the rotations of even vertices in D. We may assume that v is incident with the outer face of D i . By gluing all the drawings D i at v we obtain an embedding of G preserving the rotations of all even vertices from V (G) \ {v} in D. If v is not an even vertex in D, the proof is finished.
If v is an even vertex in D, we need to glue the drawings D i in a very particular way to preserve the rotation of v. To this end, we show that the rotation of v in D is of a special form; see Figure 1.
If v is even in D, then there is an i ∈ [k] such that the edges of G i incident with v are consecutive in the rotation of v in D, and thus they form a well-defined clockwise linear order R i .
Proof. Let I be a minimal cyclic interval of consecutive edges in the rotation of v such that for some i ∈ [k], all the edges of G i incident with v are in I. The claim will follow from the fact that I contains only edges of G i .
Suppose that I contains an edge e of G j for some j ∈ [k] \ {i}. From the minimality of I, the edge e is not first nor last in I, and there is at least one more edge of G j incident with v that does not belong to I. That is, we have distinct indices i, j ∈ [k] and vertices such that the edges va, vc, vb, vd appear in the rotation of v in this cyclic order. Let C i be a cycle in G i extending the path avb and let C j be a cycle in G j extending the path cvd. Since D is independently even and v is even, every edge of C i crosses every edge of C j an even number of times in D. However, the closed curves representing C i and C j in D cross at v, which implies that they have an odd number of common crossings; a contradiction.
Let G i be the subgraph from Claim A. By induction, we obtain an embedding D i of G i and an embedding We may choose the outer face of D i so that when starting in the outer face, the clockwise linear order of the edges incident with v in D i is identical with the order R i . Now we can glue D i in an appropriate face of E i incident with v to obtain an embedding of G where the rotation of v is the same as the rotation of v in D.
i be the graph obtained from G ′′ i by adding the vertices u, v and all edges of G joining u or v with G ′′ i . Let G i be the graph obtained from G ′ i by adding the edge uv. Since each G ′ j contains a path P j from u to v, we can obtain an independently even drawing of each G i from the drawing of G ′ i and P j , for some j = i, as follows. We start with the curve γ j representing P j , and sequentially remove each self-crossing of γ j by a local redrawing; see Figure 2. In this way we obtain a simple curve joining u with v, drawn in a small neighborhood of γ j , and crossing every edge of G ′ i not incident with u, v an even number of times. By the inductive hypothesis, G i has an embedding D i preserving the rotations of even vertices in D. We may assume that the edge uv is incident with the outer face of D i . By gluing all the drawings D i at the edge uv and possibly removing this edge we obtain an embedding of G preserving the rotations of all even vertices of G[V \ {u, v}] in D.
If v is an even vertex, using Claim A for the graph G − u we get that the edges of some subgraph G ′ i incident with v are consecutive in the rotation of v in D, and thus they form a well-defined clockwise linear order. Moreover, this linear order coincides with the clockwise linear order of the edges incident with v in D i , if we read the rotation of v starting from the edge uv. In fact, since G is 2-connected, each subgraph G ′ i has this property in this case, as we show in Claim B. Figure 3: A sketch of an embedding of a 2-connected graph with a separating pair u, v.
by adding the edge uv if it is not present in G. We obtain an independently even drawing of H i by drawing the edge uv along the curve γ i in D and by removing self-crossings. By induction, we obtain an embedding E i of H i . We can now glue D i in one of the two faces of E i incident with uv in such a way that the rotation of v is preserved. Finally we remove the edge uv if needed. If u is not an even vertex, we are finished. The case when u is even but v is not is analogous.
If both u and v are even, we need the rotations of u and v in D to be "compatible" in the sense that the cyclic orders of the graphs G ′ i around u and v are opposite; see Figure 3. If uv ∈ E(G), we also have to include the graph G ′ 0 consisting of just the vertices u, v and the edge uv, and we define P 0 as G ′ 0 . The following claim finishes the proof of this case.

Claim B.
If v is even in D, then for each i ∈ [k], the edges of G ′ i incident with v are consecutive in the rotation of v in D, and thus they form a well-defined clockwise linear order. Moreover, this gives a well-defined clockwise cyclic order C v of the graphs G ′ i around v. If both u and v are even, then the analogously defined order C u is inverse to C v .
Proof. Assume that v is even. Suppose, for a contradiction, that there are indices i, j, j ′ ∈ [k]∪{0} with i distinct from j and j ′ , but j and j ′ possibly equal, and vertices a, b ∈ such that the edges va, vc, vb, vd appear in the rotation of v in this cyclic order. Let C i be a cycle in G ′ i − u extending the path avb and let C j be a cycle in G[V (G) \ V (G ′′ i )] extending the path cvd. Notice that the cycles C i and C j share only the vertex v. Since D is independently even and v is even, every edge of C i crosses every edge of C j an even number of times in D. However, the closed curves representing C i and C j in D cross at v, which implies that they have an odd number of common crossings; a contradiction. Now assume that both u and v are even. Let i, j, l ∈ [k] ∪ {0} be three distinct indices. The three paths P i , P j , P l form an independently even subdrawing of D, which can be easily changed into an even drawing by a local change in the neighborhoods of the internal vertices of the three paths. Using the weak Hanani-Tutte theorem or the parity of the winding number of the cycle P i ∪ P j around inner points of the curve representing P l , this implies that the cyclic orders of the paths around u and v are opposite. Consequently, the clockwise orders of the graphs G ′ i , G ′ j , G ′ l around u and v are opposite. Since this is true for all the triples i, j, l, the cyclic order C u is inverse to C v . Case 3: G is 3-connected. In this case we show that it is possible to change the rotations of the vertices locally to get an even drawing of G. The theorem will then follow from the weak Hanani-Tutte theorem.
Let v be a vertex of G with a pair of incident edges crossing oddly in D. Let uv be an arbitrary edge incident to v. By redrawing the other edges incident with v in a small neighborhood of v, we can make them cross uv an even number of times. Next, if two edges f 1 , f 2 incident with v and consecutive in the rotation of v cross oddly, we can make them cross evenly by a local redrawing that swaps their position in the rotation, introduces exactly one crossing between f 1 and f 2 , and does not change the parity of crossings of any other pair of edges. Let D ′ be a drawing of G obtained after all these adjustments. Let d be the degree of v and let (u 0 = u, u 1 , u 2 , . . . , u d−1 ) be the rotation of v in D ′ . After the adjustments, vu 0 crosses every other edge vu i an even number of times, and for each i ∈ {1, 2, . . . , d − 2}, the edge vu i crosses the edge vu i+1 an even number of times. We claim that this implies that v is an even vertex in D ′ ; that is, every pair of edges vu i , vu j crosses an even number of times.
Suppose, for a contradiction, that v is not an even vertex in D ′ . Let i, j be indices with i < j and with smallest difference j −i such that vu i and vu j cross an odd number of times. Let k = i + 1. Since j − i ≥ 2, we have i < k < j. Among the edges vu 0 , vu i , vu k , vu j , only the pair vu i , vu j crosses an odd number of times. Since G is 3-connected, the graph G − v is 2-connected. Hence, by Menger's theorem (see e.g. Diestel [2, Theorem 3.3.1]), there are two vertex-disjoint paths between {u 0 , u k } and {u i , u j } in G − v. Together with the edges vu 0 , vu i , vu k , vu j , the paths form two edge-disjoint cycles C 1 , C 2 , which share only the vertex v. Except the pair vu i , vu j , every other pair of edges e ∈ E(C 1 ) and f ∈ E(C 2 ) crosses an even number of times. Moreover, the edges of the two cycles incident with v do not alternate around v; that is, C 1 and C 2 "touch" at v. This implies that the two closed curves representing C 1 and C 2 in D ′ cross an odd number of times; a contradiction.

Concluding remarks
A reviewer raised the question whether a similar connectivity approach could also be used to prove the weak Hanani-Tutte theorem. We don't see how our approach could simplify currently known proofs, including the two recent beautiful redrawing proofs [9,5], which are quite simple already.
A slightly different connectivity approach to the weak Hanani-Tutte theorem has been applied before: for example, there are weaker variants that hold for 2-connected graphs. Schaefer [10] surveyed several variants of planarity characterizations similar to the weak Hanani-Tutte theorem. One of them, due to Lovász, Pach and Szegedy [7], characterizes planar graphs as graphs that have a drawing where each Θ-graph, that is, a subgraph that is a union of three paths with a common pair of endpoints u, v, is drawn so that the cyclic orders of the three paths around u and v are opposite. Schaefer [10,Theorem 1.9] showed that such a drawing can be changed to an embedding where the rotation system of every 2-connected subgraph is preserved. The same conclusion is true for drawings where every cycle has an even number of self-crossings [10,Theorem 1.4]. Again, we do not see how our approach could bring new insights or simplifications to these variants.

Multigraphs
It is quite straightforward to generalize the strong and weak Hanani-Tutte theorems to multigraphs; in fact, Pelsmajer, Schaefer andŠtefankovič [9] proved the weak version directly for multigraphs, since they appeared naturally in their proof. The strong Hanani-Tutte theorem for multigraphs follows from the graph version using the fact that a multigraph is planar if and only if its underlying graph is planar.
Theorem 1 can also be extended to arbitrary multigraphs with multiple edges and loops, as follows.
Theorem 2 (Unified Hanani-Tutte theorem for multigraphs). Let H be a multigraph and let W be a subset of vertices of H. Let D be a drawing of H where every pair of edges that are independent or have a common endpoint in W cross an even number of times. Then H has a planar embedding where cyclic orders of edges at vertices from W are the same as in D.
Proof. Given an independently even drawing H of a multigraph H, for each even vertex v in H we subdivide each edge incident with v by a new vertex placed very close to v. Each loop incident with v is subdivided twice. The resulting drawing H ′ is still independently even, and no loop or multiple edge is incident to an even vertex of H ′ . Let H ′′ be a drawing of a graph H ′′ obtained from H ′ by removing all loops and multiple edges. By Theorem 1, H ′′ has an embedding E preserving the rotation of all even vertices in H ′′ , which include all even vertices in H. We add the removed edges and loops back to E without crossings, by drawing the multiple edges along their copies in E, and drawing the loops close to the vertices they are incident to. Finally, by contracting the subdivided edges, we obtain an embedding of H preserving the rotations of all even vertices in H.