Manuscript Offprint
arXiv:2610.31719Two-colour crossing minimization in complete geometric graphs is NP-hard
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Given a fixed straight-line drawing of a complete graph, we seek a two-colouring of its edges that minimizes the number of monochromatic crossing pairs. We prove that the threshold decision problem is NP-complete, even when the vertices are in general position and have integer coordinates of polynomial binary length. Thus exact minimization is NP-hard, answering the complexity question posed at the Crossing Number Workshop in 2019. The reduction is from MaxCut on permutation graphs. Its main difficulty is to control the edges required by completeness, whose colours must remain free. We construct a large comparison grid with two stable colour phases and use additional points to assign costs to the edges that encode the source graph. A geometric separation eliminates one large class of unwanted crossings. The costs of all remaining edges are included in a computable baseline and bounded errors, with each unit of the source objective amplified beyond the total error. The construction is deterministic and has polynomial size and coordinate bit length.
Keywords. Complete geometric graph; monochromatic crossings; permutation graph; MaxCut; quantitative stability.
© 2026 Zhe Zhang. Licensed under CC BY 4.0.
Contents
1 Introduction 3
1.1 Previous results 3
1.2 Result and proof outline 4
1.3 Conventions and scales 5
1.4 Membership in NP and integer coordinates 5
2 Stability of the comparison grid 6
2.1 The continuous comparison energy 6
2.2 Finite rectangular grids with unary costs 10
2.3 Freezing probes with the grid colouring fixed 13
3 Geometric construction and rational coordinates 14
3.1 Two convex chains 14
3.2 Ordinary programs 15
3.3 Rank programs 16
3.4 Canonical response fields 18
3.5 All remaining edge classes 19
3.6 A deterministic rational realization 20
4 Encoding the source graph in the core 23
4.1 Source matching and amplification 23
4.2 Unary costs from frozen fans 24
4.3 Forcing the palette inside the core 25
4.4 Dummy edges and local constraints 26
4.5 A computable core baseline 27
5 The complete drawing and the decision reduction 28
5.1 A common computable background 28
5.2 Parameter estimates 29
5.3 Quantitative reduction and threshold 30
6 Formal verification and reproducible computations 31
6.1 Scope and external assumptions 32
6.2 Verification procedure 32
6.3 Finite checks and use of AI 33
A A direct-completion obstruction 33
Let be a labelled point set in the plane. Its complete geometric graph contains the straight segment for every . How hard is it to find an edge two-colouring with the fewest monochromatic crossing pairs? This was Question 4 at the Crossing Number Workshop in 2019 [11, Section 1.4], and it appears as the first open problem in Section 5 of Aichholzer et al. [2]. It was subsequently listed as Vogtenhuber's Problem 2 in the report of Dagstuhl Seminar 21293 [8, Section 4.12] and as Problem 11 at Geometric Graphs Week 2022 [12]. We prove that the threshold decision problem is NP-complete, including when the given points have integer coordinates.
Definition 1.1. The input to complete geometric two-colour crossing minimization is a list of pairwise distinct points with no three collinear, together with an integer in the decision version. Coordinates and are encoded in binary. Write
for , and put . The decision question is whether .
A proper crossing is an intersection of two open segments with four distinct endpoints. Several crossing pairs may have the same geometric intersection point; each pair is counted separately. The colouring is unrestricted: it is not a proper edge colouring in the graph-theoretic sense. There are no weights or prescribed colours.
1.1 Previous results
For a fixed drawing on , let be its crossing graph: its vertices are the edges of the geometric graph, and two vertices are adjacent precisely when the corresponding segments cross properly. If , then
Every crossing is either monochromatic or belongs to the cut induced by the two colours. This relation makes MaxCut a natural source of both algorithms and hardness results.
Aichholzer, Mulzer, Schnider and Vogtenhuber [3] proved that MaxCut is NP-complete on segment intersection graphs. Their reduction does not require the segments to form the edges of a complete geometric graph. Adding all missing edges between their endpoints introduces new colour variables and crossing costs; the minimum added cost can depend on the colours used by the original segments. Thus the general segment result does not settle the complete-graph problem. The six-point example in Appendix A illustrates this dependence.
The role of completeness is also visible in convex position. Masuda et al. [10] proved NP-hardness for assigning the edges of an arbitrary graph to two pages with a fixed vertex order. This is equivalent to two-colour crossing minimization on a convex drawing of that graph. For a complete graph, however, the optimum is known exactly. Two chords cross exactly when their endpoints alternate, so two-colour crossing minimization is equivalent to the two-page crossing-number problem for .
Ábrego et al. [1] determined this value exactly; we recall the formula below and use it for two convex parts of our construction. In Appendix B of the full version, Aichholzer et al. [2] also studied the complete bipartite drawing between two convex chains and gave a two-colouring with asymptotic crossing ratio at most 1/3. A rectangular version of this drawing forms our comparison grid. For the reduction we need a stability estimate: its optimal colourings must remain close to one of two reference patterns in the presence of additional crossing costs.
Previous work on coloured crossing numbers has established several extremal bounds. Aichholzer et al. [2] obtained bounds on the minimum over all drawings of , using small configurations, integer programming and a duplication construction. They also proved that every sufficiently large complete geometric graph admits a two-colouring whose monochromatic crossing ratio is bounded away from 1/2. Fabila-Monroy [7] extended this ratio result to dense geometric graphs and any fixed number of colours. For random points in the unit square, Cabello et al. [5] analysed a colouring defined by edge slopes and obtained an expected monochromatic crossing count equal to 9/25 of the expected total crossing count. More recently, Hahn, Klinz and Vogtenhuber [9] generalized the doubling construction to several colours and improved asymptotic upper bounds using heuristic searches for small initial drawings.
Approximation also benefits from the crossing-graph formulation. Complete geometric graphs have crossings, so is dense on its vertices. The dense-graph MaxCut approximation scheme of Arora, Karger and Karpinski [4] therefore applies, as noted by Hahn et al. [9]. Through (1.1), it gives additive approximation for the monochromatic objective on the scale of . Such a guarantee does not determine the exact optimum. The result below settles that exact complexity question.
1.2 Result and proof outline
Theorem 1.2. The decision problem in Definition 1.1 is NP-complete under deterministic polynomial-time many-one reductions. Consequently, computing OPT(P) exactly is NP-hard. The decision problem remains NP-complete when all coordinates are integers encoded in binary.
We reduce from MAXCUT on permutation graphs, with a permutation representation supplied as part of the input. Its NP-completeness follows from de Figueiredo et al. [6]: their construction explicitly produces the two permutations. After relabelling the first order, a source graph can be described by a permutation of , with an edge ij when and . For a source graph G, set
Thus a source threshold k becomes the equivalent integer threshold , where .
The reduction must keep every target edge available for either colour. We arrange the points so that a large family of original-frame edges forms a rectangular comparison grid. A quantitative stability theorem shows that every optimal colouring, even after bounded perturbations, lies close to one of two reference patterns. This provides a reference colouring for the rest of the construction without prescribing colours in the input.
Additional points, called program points, then control the difference between the two colour costs on selected edges. These selected edges encode a blown-up permutation graph. Their interactions with the other edges of the complete graph are handled in two ways. A convex separation excludes crossings between the comparison grid and program edges that do not meet a frame point. The remaining costs are either evaluated explicitly or bounded by errors smaller than the amplified source signal. In particular, the background contribution is computable without knowing an optimal source colouring.
The resulting estimate is
Here the baseline , the amplification , and the nonnegative error bounds are all computable in polynomial time. The lower bound applies to an unrestricted optimum of the complete graph, and one complete colouring supplies the upper bound. Since is an integer, the gap separates consecutive source values and gives a many-one reduction. We also specify a deterministic rational-coordinate construction and bound its bit complexity.
The construction and its final threshold equivalence have been formalized in Lean. Section 6 describes the formal statement, its assumption of the known convex optimum, and the complexity arguments proved separately in the text. The proof source and exact finite checks are available at
https://github.com/Myyura/two-colour-crossing-complete-geometric-graphs.
1.3 Conventions and scales
We use N for the number of points of the final geometric instance. The letter will denote the number of vertices of a comparison grid when a distinction is needed. For nonnegative integers v, define
The theorem of Ábrego et al. [1, Theorem 7] says that is the optimum for a convex complete geometric graph: a same-page pair of edges in a two-page drawing crosses exactly when its endpoints alternate in the linear order. Boundary edges do not affect this count. We use this established value for two convex background components.
For a source with , the parameters are
(1.3)
All exponents and constants are absolute. The large constants simplify the error estimates; the construction is intended to establish polynomial complexity rather than produce small instances.
1.4 Membership in NP and integer coordinates
Proposition 1.3. The problem in Definition 1.1 belongs to NP. Rational and integer coordinate versions are polynomial-time equivalent.
Proof. Let L be the total input bit length. Normalize denominators to be positive and let D be the product of all coordinate denominators. Its bit length is . Multiplying every coordinate by this same positive integer yields integer coordinates of bits and preserves all orientation signs. Computing D and the scaled coordinates takes polynomial time by ordinary integer arithmetic.
Pairwise distinctness and absence of collinear triples can be checked by examining point pairs and the determinants
Declare invalid inputs to be no-instances. A certificate consists of the edge colours. For every unordered pair ab, cd with four distinct endpoints, a proper crossing is equivalent to
There are such tests, each using a constant number of operations on integers of polynomial bit length. Count those crossing pairs with equal colours and compare the result with k. Negative thresholds are immediate no-instances. This verifies a certificate in polynomial time. The same positive scaling is a reduction from rational to integer inputs; the converse inclusion is immediate.
Section 2 proves the grid stability estimate. Section 3 constructs the points and establishes the required crossing relations. Section 4 encodes the source graph, and Section 5 combines the estimates to prove Theorem 1.2.
2 Stability of the comparison grid
The comparison grid supplies a reference colouring without prescribing any target edge colours. We first prove a quantitative continuous statement, then transfer it to every finite rectangular grid. The finite statement applies to minimizers with arbitrary bounded unary perturbations. A separate estimate applies to any colouring with the resulting localized support; this distinction will allow us to change the program colours while keeping the same grid colouring.
2.1 The continuous comparison energy
All integrals in this section use Lebesgue measure. Functions are Borel measurable; the statements also hold for Lebesgue-measurable functions after replacement on a null set. For a sign function , put
Each comparable unordered pair occurs once. Define
The diagonal convention has no effect on the continuous integral, but we retain this strict inequality when passing to finite grids.
Theorem 2.1 (Continuous two-phase stability). Every measurable sign function on the unit square has . For every , if , then
We give the analytic ingredients with constants, since only a uniform estimate, rather than a sharp exponent, is needed later.
For define
Values of the sign kernel on its diagonal are immaterial. A threshold function is a sign function that is constant on each side of a point , with opposite signs on those two intervals. Both orientations and, through , both constant functions are included.
Lemma 2.2 (One-dimensional stability). For every measurable sign function , one has . There is a threshold function such that
Proof. Let
The elementary identity
gives
To check the coefficient, after integrating out the third variable the coefficient of , for , in the triple expression is . On the other hand,
The constant triple integral is 1/6, and the ordered two-variable integral is half the corresponding symmetric integral. These observations give , including its constant term, by Fubini. All integrands are bounded, so these changes of order are legitimate.
Let be the least measure of disagreement with a threshold. For each orientation, disagreement is continuous in its threshold position, and is compact, so the minimum is attained. We claim . There is nothing to prove if . Otherwise let be the measure of the positive set. The constant negative threshold shows that . By continuity of cumulative positive mass choose so that the positive mass before and after is each.
If the negative mass between and is at least , independently choosing a positive point before , a negative point between , and a positive point after gives . Otherwise compare with the threshold positive before and negative after . Its disagreement is at least , whereas the negative mass between plus the positive mass after is less than . Thus the negative mass before is at least . Comparing with the oppositely oriented threshold at similarly gives negative mass at least after . The positive mass between is . Negative-positive-negative triples therefore give the stronger bound . The claim follows. By (2.3), ; since the sign-function distance is , the asserted bound follows.
Apply T in the two coordinates and write
Expanding the order indicators and the equality indicator, and using antisymmetry of the sign kernel, gives
In particular,
Lemma 2.2 on each row and column makes every term on the right nonnegative. This proves the lower bound in Theorem 2.1. For the mean vanishes, both slice families are thresholds, and direct integration gives . Hence its energy is exactly 1/12.
Under an excess bound , (2.4) gives
and the analogous column estimate. Jensen’s inequality and Lemma 2.2 show that the average row distance from a threshold, and also the average column distance, is at most . These distance functions are measurable: one may take the infimum over rational threshold positions in both orientations, using continuity in the threshold position. No measurable selection of optimal thresholds is required.
Lemma 2.3 (Approximation by a diagonal profile). Suppose and . There is a measurable such that, for ,
Proof. It suffices first to treat . Extend by zero outside the square. A threshold on , extended by zero, has total variation at most four. Approximating each row by a threshold and applying the triangle inequality shows that translation by in the first coordinate changes the zero extension in by at most . The same holds in the second coordinate. Here the rowwise inequality can be integrated using the measurable infimum just described, so no selection issue arises.
Let be the convolution of the zero extension with the uniform probability density on . Integrating the translation bound and using yields
On the interior square we also have
Indeed, on the open unit square, in the sense of distributions,
because and . The mixed derivative of the uniform averaging kernel is the signed measure at its four corners with total variation . Convolution on therefore gives a bound by (2.5). Only averaging boxes contained in the original square are used here, so no distributional boundary term from the zero extension enters this estimate. The box average of a bounded function is Lipschitz: translating either coordinate changes the averaging rectangle by area at most a constant times the translation distance. Consequently the weak directional derivative above agrees with its almost-everywhere derivative, and the one-dimensional fundamental theorem applies on almost every diagonal slice.
For each average over the interval of for which , and denote the average by . Put when that interval is empty. This defines a measurable function with . On an interval of length , an absolutely continuous function satisfies
The diagonal coordinates have Jacobian one and their intervals have length at most one. Integrating this inequality and using gives . In particular no inverse lower bound on the length of a short diagonal is required. Outside the area is at most 4h and the pointwise difference is at most two. Together with , this gives
Round to a sign, with a fixed convention at zero. For a sign and . Thus the resulting has distance at most .
For any two sign functions , expansion of the equality indicator gives the useful bound
Hence , which is stronger than the stated bound. If , any fixed diagonal sign function suffices: the distance is at most two, the energy is at most 1/4, and both claimed bounds follow. This completes the lemma for .
Proof of Theorem 2.1. Assume first that , put , and suppose . Lemma 2.3 gives with energy excess at most . Let . By (2.5) there is a row at height whose one-dimensional deficit is at most . Its sign profile is restricted to . By Lemma 2.2, it has a threshold approximation of error at most . Restrict that threshold to and extend it to as a threshold. The additional interval has length at most and costs at most . Thus on is within of a threshold . Selecting a row with in the same way gives a threshold within of on .
Let for and for , and put . The density of on the square is for and for , so it is at most one. Consequently
Each coordinate operator has operator norm at most one, by Cauchy–Schwarz on each unit interval and Fubini. Moreover, . Writing , the triangle inequality followed by gives
Set and . Directly integrating the two coordinate operators yields
Because are thresholds, the nonzero derivative of is supported on at most two intervals, and is constantly 2 or -2 on each. If , one of those intervals has length . For any constant , the integral of on that interval is at least
Taking in (2.11) and using (2.10), we obtain and hence
Replace by and call the resulting diagonal function . Since the diagonal density is at most one, . If is positive before and negative after , then
Reversing the threshold orientation reverses the mean. The distances from to the two canonical phases are and , in some order, since the density weights of the two halves add to one. Therefore its distance to a canonical phase is at most . With , the triangle inequality now gives
Using , (2.12), and , the right-hand side is at most
Here , , and each smaller power term is bounded by the displayed coefficient times . Since , this is at most .
If , the distance between any two sign functions is at most two. The inequality at the cutoff, and monotonicity thereafter, give the asserted estimate immediately. Finally, if , apply the positive-excess result for every positive excess parameter. The minimum of the distances to the two fixed phases must then be zero. One of those two phases attains that minimum, proving the zero-excess case without a choice of a limiting phase.
2.2 Finite rectangular grids with unary costs
For integers , let have vertex set , where two vertices are adjacent exactly when both coordinate orders strictly agree. In this section write
Thus V is the number of vertices of the comparison graph, not the number of points of the eventual geometric drawing. Define
In particular a diagonal cell centre has spin -1 in the positive phase.
Let be unary costs, and suppose
No bound is imposed on their additive constants. Write
where counts monochromatic edges of . For a set of grid vertices, denotes the colouring obtained by flipping exactly . Define the exact finite quantities
For let
Theorem 2.4 (Finite-grid localization and energy bounds). Let a satisfy . For every rectangular aspect ratio the following statements hold.
- Every minimizer c of E has a phase such that, with ,
- The minimum energy belongs to
For either prescribed phase, the explicit set has size at most 52aV and
- For every ,
This last conclusion requires no optimality of . In fact it holds for arbitrary real unary costs, without their oscillation bound, whenever .
For rational unary costs, both and the two prescribed-phase colourings are computable by polynomially many exact arithmetic operations.
Proof. From cells to the continuous objective. Extend a grid colouring to the sign function constant on its 1/m by 1/n cells. Comparable pairs in distinct rows and columns contribute exactly . All other contributions are nonnegative and their total uncoloured measure is
We will use the weaker bound
The functions and can disagree only where . This band has area at most , whence , and the analogous assertion holds for the negative phase. By (2.8), . For a minimizer , comparison with gives . Therefore
Theorem 2.1 and the canonical cell discrepancy give a phase whose disagreement fraction satisfies
For the final numerical bound, use , , and ; the first term is less than . This initial estimate follows from the minimum condition.
Canonical local fields. For let be the union of the lower-left and upper-right rectangles comparable to . With , direct integration gives
For , the lower-left rectangle contributes uv, and the upper-right rectangle contributes ; reflection gives the other case. The union of cells corresponding to the finite neighbours of a cell centre differs from only in its row and column strips, of total area at most . The sign-function discrepancy contributes at most another . A single grid flip changes the cost by minus the vertex spin times its neighbour-spin sum. Consequently, in either canonical phase,
At a diagonal centre the continuous field is zero, so the strict tie convention causes no change to this bound. Including the unary cost gives
If and , then either or , by considering and separately. Thus a small value of places the vertex in a narrow diagonal strip or in the two corner regions.
Finite strip and corner counts. A rectangle with side lengths r, t contains at most
cell centres. For , counting by rows gives , and bounding each corner triangle by a square gives . Two comparable points of , ordered coordinatewise, have the sum of their coordinate differences at most 2w. For any strip point its strip neighbours therefore lie in two squares of side 2w, giving at most possibilities. Hence for every ,
For the edge bound, strip-strip, strip-corner, and corner-corner edges contribute at most , , and , respectively. Counting an edge more than once when regions overlap only increases these upper bounds. The degree assertion is made only for strip vertices: corner vertices need not have degree of order .
Bootstrap from initial stability. For a disagreeing vertex , changing its colour back in the minimizer has cost change
Thus , and (2.17) yields
Initially . The observation following (2.17) gives
By (2.15), . For , (2.18) improves (2.19) to . In we have , so . The direct row count and the corner count now imply
Since and , we have and . Absorbing these terms proves . Substitution in the definition of gives , establishing the first conclusion. No small degree bound for corner vertices has been used in this absorption.
Exact correction for simultaneous flips. For every flip set F and arbitrary real unary costs,
Indeed, an edge with both endpoints flipped keeps its equality status, while its two single-flip contributions sum to . The second sum restores exactly this discrepancy; unary terms already add independently.
If and , (2.18) bounds the absolute correction by
The linear sum is at least . This proves the third conclusion, including its stronger independence from the unary oscillation and from optimality. Applying it to the localized minimizer proves the lower bound in the second conclusion.
For the upper bound in a prescribed phase, take exactly . By (2.17), this set is contained in , and its cardinality is at most
Its linear sum in (2.20) is the defining sum for , while its correction is bounded by . Choosing the phase with smaller proves the upper bound for the minimum. Finally, all quantities in (2.13) are finite sums and single-vertex comparisons. They require no search over colourings and can be evaluated exactly in polynomially many operations for rational unary costs.
2.3 Freezing probes with the grid colouring fixed
The following lemma is about an arbitrary finite simple graph. In the application its vertices are geometric edges and its adjacency relation is proper crossing. Thus its conclusion includes interactions between the probes themselves.
Proposition 2.5 (Probe freezing). Let a finite simple graph have vertex partition X, T, Z, with induced subgraph on X equal to . The objective is the number of monochromatic graph edges, and all vertices may be coloured freely. Use and . Suppose every vertex of X has at most neighbours outside X, every vertex of T has at most neighbours outside X, and
For and let
This is its colour-1 cost minus its colour-0 cost when the grid is canonical. Choose when and otherwise, and put . These are best responses in both phases, including their complemented zero-field tie convention.
Put , and suppose that satisfies
Then every optimal colouring has a phase and a colouring such that only vertices of T are changed, every probe is coloured , and
The unchanged grid differs from on at most 52aV vertices, all in . If is the minimum over colourings with the probes in either of the two frozen phases, then
It suffices for (2.21) to have the stronger estimate for , together with .
Proof. Fix the colours outside X in a global optimum. Its restriction to X minimizes the resulting grid objective. Each conditional unary oscillation is at most the number of outside neighbours, hence at most . Theorem 2.4 gives a phase and a disagreement set with and the stated support. Keep this grid colouring fixed for the rest of the proof.
For every probe, its field from X differs from by at most . Under any colouring of all other vertices, its field from neighbours outside X has absolute value at most . Thus the full field differs from by at most . If , the sign of the full field is the same as the canonical sign, whatever the outside colours are. Single-vertex optimality of therefore forces this hard probe already to have colour .
Recolour each remaining, soft probe to , in any order. At every step the grid remains fixed. The outside field still has absolute value at most even after earlier probe changes, since all probe-probe neighbours were included in that degree bound. The cost increase for the current recolouring is at most the magnitude of the current full field, which is bounded by
There are at most soft probes by (2.21). Summing the sequential cost changes gives the upper bound in (2.22). The lower bound follows because is a global optimum and is a feasible colouring. Only probes were changed, so the same grid and its localization remain.
The frozen feasible set is a subset of the original feasible set and contains the constructed . Its optimum is therefore between and , proving the final optimum bound.
The last clause of Theorem 2.4 can now be applied to this unchanged grid under the newly frozen unary costs. It applies because the support is localized, whether or not this grid minimizes the new conditional objective. This is the reason for retaining the arbitrary localized-colouring estimate in addition to the optimum bracket.
3 Geometric construction and rational coordinates
We construct three sets of points: originals, frames, and programs. Original-frame edges realize the comparison grid; program-frame edges are the probes to which Proposition 2.5 will apply. All other edges of the complete graph remain present.
3.1 Two convex chains
For rational , , and , set
Choose originals in increasing parameter order, and frames in decreasing parameter order, with and .
Lemma 3.1 (The base drawing). The base points are in general position. The edges induce the strict comparison grid:
An edge within either chain does not cross an edge joining the chains.
Proof. For , direct expansion gives
The brackets are at least and , respectively. These formulas cover every single-chain and mixed triple. With three points on one chain, the middle point lies strictly inside the triangle formed by the other two and any point on the other chain: the displayed chord test and the mixed tests for the two subpairs give its three side tests. This excludes an internal-chain edge crossing a joining edge. Two points on each chain form a convex quadrilateral, since the opposite chain lies strictly on one side of either same-chain chord. Its diagonals give the stated comparison relation, with the two parameter orders reversed.
There are early source endpoint clusters and late clusters, each containing consecutive originals. Between them lie dummy originals, so . Each cluster is an equally spaced interval of parameter diameter around a macro parameter. Early, dummy, and late parameters lie, respectively, in , , and . A matching pairs the early and late clusters; Section 4 specifies it from the source permutation.
Every original chord has direction , while an original-frame vector has horizontal component at least and vertical component of absolute value at most two. These direction cones are separated. Programs will lie in , . The crossing relations below hold for sufficiently small displacements and clone diameter . We then choose both scales explicitly so that all relations hold simultaneously.
3.2 Ordinary programs
Take and . The artificial point lies in the strict angular gap between the middle frame rows, as viewed from every original. At a macro point , an ordinary program has prototype
Lemma 3.2 (Crossings of ordinary program fans). For sufficiently small , followed by sufficiently small , every clone of the parent satisfies
Outside the parent block, the program fan has the neighbourhood of a virtual column inserted at that block. A core edge from a parent clone to a different macro or a dummy crosses exactly the first half of the program fans when its other endpoint is later, and exactly the last half when it is earlier. These tables hold on an open neighbourhood of the prototype.
Proof. Put . The strict central gap gives on the first half and -1 on the last half, uniformly for all clones after choosing . Both endpoint tests for proper crossing are needed. When , they require ; when , they require . For there is a common endpoint. Here and lie on the same strict side of each frame chord: on that chord has supporting coordinate
whereas both points lie in the left strip. This proves (3.3). In every nonparent column the nonzero macro determinants persist under displacement and cloning, giving the virtual-column prefix or suffix.
For the core table, let with . Then , so and every frame point lie on opposite sides of . The other test compares the signs of and . The former is negative on the first half and positive on the last; at zero displacement the latter has the sign of , and this strict sign persists. This gives the claimed halves for the actual clones. All signs have positive margins, hence hold on an open neighbourhood. No half-frame assertion is made for a short edge inside the parent cluster; its exact unary cost is retained later.
3.3 Rank programs
For a selected macro chord , , write and let , be its clone parameters. Choose
The supporting horizontal coordinate of an actual selected chord at height y is
Lemma 3.3 (Crossings of rank program fans). At each internal gap there are open regions for left and right programs. Every left program fan crosses precisely the selected edges with ; every right fan crosses precisely those with . The test is independent of the opposite clone rank.
The grid neighbourhood is the exact virtual column after the entire early parent block, or before the entire late parent block, independently of . On an incident nonselected core edge to , every fan crosses if , and none crosses otherwise.
Proof. At the unsteered centre , where or ,
Cloning and sufficiently small horizontal steering preserve these opposite endpoint signs for every frame point. The remaining crossing test is exactly
Thus this is an internal segment crossing, not merely a support-line intersection.
At , the support increases in s and decreases in t. The full ranges over the opposite rank satisfy
(3.6)
Indeed , , and . Thus choose
At , reflection and rank reversal give , so
gives exactly . These prototypes tend to the unsteered centres as , retaining the endpoint tests above.
For grid neighbours, marker-to-parent directions remain in the original-chord cone, outside the entire frame cone. The sign in the preceding proof is now constant over frame rows, positive for an original before the marker and negative for one after it. Consequently
The left marker is above its whole parent block and the right marker below its whole parent block. Their displacement remains below the next macro gap, and steering does not change these signs.
For a nonselected incident chord, put . At the left unsteered centre,
The support-side test excludes . For , the other endpoint test excludes , since its sign at tends to the sign of , while the near-endpoint sign is negative. Thus precisely remains. The right support difference is ; its near sign is positive and the other endpoint sign is negative precisely for , giving the same interval. Strict macro margins preserve these statements. Parent-cluster short edges and the selected partner are excluded from this last table.
Lemma 3.4 (Nonincident exclusion). A program fan does not cross a core edge whose endpoints both avoid its parent block.
Proof. For endpoints in different nonparent blocks, the fan at the parent macro is noncrossing by Lemma 3.1, with nonzero macro determinants. Small displacement and then cloning preserve the exclusion. For a short edge in one nonparent block, the macro fan has positive distance from that block's centre. Choose the displacement and clone neighbourhood below this distance. The whole short edge remains disjoint from the fan. This argument avoids applying a strict determinant test to a collapsed zero-length edge.
3.4 Canonical response fields
Let , , , and . The canonical grid spins are . The field of a fan is its grid cost in colour one minus its grid cost in colour zero. Its canonical response minimizes this cost, with colour zero at a tie. For a virtual column after originals, put ; its exact field is
(3.7)
There is no contribution from row k, whose fan shares a frame endpoint.
Lemma 3.5 (Field and soft-row bounds). Write . Then
(3.8)
A rank program has field . For an ordinary program, choose a virtual position at a parent-block boundary. Then , and away from the central ordinary switch the increment error is at most 2W.
Suppose , , and . For either program type and ,
An early program has response spin +1 on the middle 3B/4 rows; a late program has spin -1 there. Each early half-frame sum is at least B/4 and its full sum at least B/2; the late sums have the opposite bounds. For s programs the total soft count is at most , where .
Proof. For , any midpoint sum over a prefix or suffix of column cells differs from times the integral by at most one: only the threshold cell matters, including a midpoint tie. Also changing by changes a suffix integral by at most . Since
the first estimate follows from (3.7). The two rectangles and differ from the actual cell union only in row , of area . The cellwise canonical function differs from in by at most . Integrating the latter function over the rectangles gives , proving even the bound . Only the parent columns differ for an ordinary program. Each prefix or suffix has absolute sum at most and changes by at most one away from its switch. This proves its two error bounds.
For early programs , and for late programs . A soft row satisfies
It therefore belongs to one of , , or . For early ranks these lie in or ; for late ranks in or . Each lies away from the ordinary switch. On each interval the main increment has constant sign and magnitude at least . Even the weaker error leaves magnitude at least . A field interval of length contains at most such rows, proving (3.9).
On , an early rank has , so . The error cannot change the negative field sign, hence the response colour is one. The late case reverses the sign. Each half-frame has controlled and at most other rows, giving the claimed sums. Finally .
A frozen fan of colour contributes to the core unary coefficient. Early ordinary halves thus contribute positively, and late halves negatively. Early rank programs add positive suffix steps; late ones add negative prefixes whose disappearance is a positive step. Their full weights lie in . All internal gaps at an endpoint have the same response sequence; copies in one open prototype region retain it, independently of other programs.
3.5 All remaining edge classes
Partition the complete graph into X (original-frame), (program-frame), C (original-original), Y (program-original or program-program), and I (frame-frame).
Lemma 3.6 (Convex separation). The programs can all be placed strictly inside , where . Every open X segment lies outside . Consequently X has no crossing with C or Y. The frame class I has no crossing-graph neighbour outside itself.
Proof. The set H is convex. For ,
Its bracket is positive, so every open grid segment is outside. Substituting gives, for , at an ordinary prototype. At a rank height, and
Its steered horizontal coordinate is a midpoint of two such supports; is affine in , so the actual prototype is inside. If , perturbation by at most in both coordinates changes by less than on . Hence every final program remains inside. All endpoints lie in , so convexity excludes their crossing with .
For the frame component put and use . It contains all segments. Every nonframe point has , , and along a frame fan
for , since the bracket is at least . Thus no fan crosses . The remaining segments lie in , disjoint from .
The isolated component I contributes to the optimum. Besides I-I, the only possible crossing types are
All interactions involving multiple programs are retained. Let be the crossing graph after deleting Y, and set
Deletion removes only the last three crossing types, so
The upper bound extends any colouring of by arbitrary colours on Y, charging at most one per deleted constraint.
3.6 A deterministic rational realization
We now give explicit rational scales that instantiate all preceding open-region statements. These are the scales used in the formal development.
Fix , , and . Having fixed the integer counts and source pairing, choose the early macros, physically ordered late macros, dummies, and frames by
Here , , and . Let be the set of early and late macro parameters and all dummy parameters; frame parameters are not included. Define
Use and clone parameters , where . All internal rank prototypes use the midpoint formulas of Lemma 3.3; there are candidates, including those assigned zero copies later.
Lemma 3.7 (Simultaneous quantitative margins). The choices (3.14) give all the crossing relations above for the actual clones and every candidate program. In particular no choice depends on later program multiplicities.
Proof. The set A is finite with distinct parameters, so . Direct substitution gives
(3.15)
for any selected , since . Every clone remains in and within of its macro. A nonparent original parameter remains on the same side of the parent macro as its own macro and obeys . Consequently
If also avoids the selected partner macro , then and
For two nonparent actual parameters , even when they are clones of the same macro, their distances to are each at least . Thus
The second inequality uses .
We check that these numerical inequalities pay for both segment-side tests, rather than only support-line intersections. In the ordinary own-column test, the unperturbed parent determinant has magnitude at least . Moving its original parameter from to a clone changes it by at most . The bound therefore preserves its sign. The constant 25 follows by expanding the determinant difference:
here , . For a nonparent ray, ordinary displacement changes the determinant by at most , while its macro magnitude is at least . Inequality (3.16) preserves that sign. These bounds establish the full ordinary grid table, including its central switch.
For a core support , the ordinary offset is exactly
with for parameters in . When is a parent clone, the first term has absolute value at most ; the second is strictly negative and dominates it. Combining with the parent and nonparent ray signs gives the ordinary core half-frame table. For two nonparent endpoints, the product margin (3.18) preserves the macro support sign when the parent lies between them; if they are on one side, both ray signs agree. In either case there is no crossing. This also proves nonincidence for a short edge in a different cluster without taking a zero-length limit.
For rank programs, the last inequality of (3.15) and are exactly the full-range gap hypotheses in (3.6). The midpoint has horizontal steering from its unsteered macro-chord support at most , obtained by expanding (3.4) with endpoint deviations at most . Its displacement from its parent is at most . For either actual selected endpoint , the height gap is at least and
Indeed for a support through parameters u, v,
one endpoint differs from by at most , , , , and averaging preserves the bound. The horizontal distance to every frame point is at least 11, while its vertical distance is at most two. The endpoint determinant thus has the strict sign prescribed by whether or . This proves the endpoint-side test in (3.5) uniformly over both ranks.
A rank displacement bounded by changes a nonparent ray determinant by at most , compared with macro magnitude at least ; use (3.16). For a nonselected incident edge from parent clone to actual , the left support offset has the explicit error bound
It is the steering error plus clone error at most . Inequality (3.17) preserves its sign, so the ray and support tests together give exactly . The right statement follows by reflection. Finally any rank displacement of size changes a nonincident chord offset by at most , whereas its initial curvature offset is . Inequality (3.18) again preserves the sign. Endpoints on the same side give equal ray signs, and endpoints straddling the parent put program and frame on the same side of their chord. This proves rank nonincidence in all cases.
The strict inwardness formulas in Lemma 3.6 apply directly to these ordinary and steered rank prototypes. Their heights have absolute value below two. Thus all prototypes are valid simultaneously. The argument uses only fixed base data and the candidate gap index.
Compute each candidate’s exact grid neighbours and response sequence. These determine the ordinary and rank weights. The greedy and ceiling rules of Section 4 now determine the actual multiplicities and hence s. None of the earlier choices is repeated.
Let be the set of all fixed original and frame points, and the finite set of used prototypes. Define positive rational margins
These are the finite-minimum radius formulas used in the formalization. The value one handles empty sets. Every nonzero one-program determinant retains its sign under a coordinate change at most : its change is bounded by . At the insertion points below the displacement is less than per coordinate. Hence the cap and height bounds are preserved as well.
An unused zero determinant need not retain its value. Every prescribed crossing has four strict determinant tests. A pair sharing a base endpoint remains noncrossing by definition; each other prescribed exclusion has either a strict same-side support pair or strict same-side fan rays. The quantitative proof above supplies these certificates, including parent-cluster short edges, whose two fan rays have the same nonzero sign. Thus preserving the nonzero determinants suffices. Let be the final total point count. Set . For each required copy of prototype r, test in lexicographic order the rational candidates
Reject coincidences with existing points and collinearity with any existing pair. At most forbidden lines each meet this grid in at most points, and at most further points are forbidden. Since , some candidate survives. Induction gives distinct points in general position. The same radius and denominator are used throughout. All required one-program tables and response colours persist; actual fan-fan crossings and short-edge unary costs are evaluated after insertion, while program nonfans are covered by (3.11).
Proposition 3.8 (Effective realization). The construction is a deterministic polynomial-time algorithm with rational coordinates of polynomial binary length. It preserves all the stated crossing relations simultaneously and yields general position. A common positive scaling yields integer coordinates of polynomial binary length with the same crossing relation.
Proof. Proposition 4.8 bounds the actual program count, and bounds the candidate prototypes. Both, together with , are fixed polynomials in the source size. The base coordinates have bits. The fixed formulas for use a bounded number of rational operations on base parameters and counts. Prototype coordinates are bounded-degree expressions in these values. Each determinant margin therefore has polynomial bit length; finite minima select existing values. The sum defining has polynomially many terms, so its denominator bit length is bounded by the sum of their polynomial bit lengths. The same holds for . Internal rank gaps use direct formulas, not a chain of nested scales.
The integer greedy recurrence is evaluated with cached cumulative weights. Inserting at most N programs tests candidates per insertion, each against exact equations and determinants, for rational operations. All intermediate bit lengths are polynomial; standard integer arithmetic therefore implements the whole algorithm in polynomial bit time. Earlier inserted points only reject candidates and never redefine later scales. Finally the product of the positive coordinate denominators has bit length at most their sum. Scaling by this product preserves strict determinant signs and gives integer coordinates with polynomial bit length.
4 Encoding the source graph in the core
Throughout this section the program fans are fixed to their canonical best responses to the grid. We prove a statement about the entire original–original subsystem with these frozen neighbours. Colours forced here are consequences of minimization in this subsystem; they are never imposed in the target instance.
4.1 Source matching and amplification
Let G be a permutation graph on n vertices, with a supplied permutation representation, and write
This represented source is NP-hard by the construction in [6]. Place its two endpoint orders in consecutive blocks of the original cap, reversing one order. The resulting chords alternate exactly for adjacent source vertices. Replace each source chord by macro copies, ordered forward at the early endpoint and backward at the late endpoint. Copies of a vertex are nested; two distinct source classes have either all crossings or none. Write and label the selected macro chords , , by early endpoint order.
Each macro endpoint is replaced by W consecutive originals, denoted . There are dummy points between the endpoint blocks. All original points are in convex position on the same cap, so their chords cross precisely when their endpoints alternate.
Partition the core C into selected edges
short edges U within one endpoint cluster, dummy-dummy edges D, and the remaining palette edges F. Define the proposed palette by
Every palette edge falls in exactly one case.
Lemma 4.1 (Independent source amplification). After deleting the crossing constraints internal to each , the graph induced on is the independent -fold blowup of . Its minimum monochromatic count is , where .
Proof. Consecutive endpoint clusters preserve all crossings between different macro chords. The q macro copies of one vertex remain pairwise noncrossing, and the deletion makes each individual bundle independent. Thus each source vertex becomes an independent class of variables with identical neighbours; source adjacency gives a complete join.
With colours outside one class fixed, its cost is affine in the number of colour-one variables in that class. One uniform colour is therefore no worse. Perform this operation successively on all classes. The final class-uniform colouring costs times a colouring cost of G. Conversely every source colouring lifts to that cost. The deleted internal constraints remain in the actual drawing and are restored below.
4.2 Unary costs from frozen fans
Every unary coefficient means cost in colour one minus cost in colour zero; a frozen neighbour of colour a contributes . With denoting proper crossing, define
The first sum ranges over unordered pairs of distinct edges.
By Lemmas 3.2–3.5, an ordinary program at an early endpoint contributes a positive half-frame weight in on an incident nonshort core edge; at a late endpoint the weight is negative with magnitude in that interval. Which half is used depends only on endpoint order, not clone ranks. An early rank program at gap adds a positive weight on the suffix . A late program adds on the prefix . No program fan meets a nonincident core edge. Its contribution on any incident edge is bounded in magnitude by . The actual unary on a short edge is computed directly. Response weights depend only on one prototype and the base grid; their computation is independent of other multiplicities and core colours.
Lemma 4.2 (Affine palette field). The palette contribution to a selected edge is
where the integer coefficients are computable by crossing counts and obey and .
Proof. A palette edge avoiding both parent clusters contributes independently of r, t. One with an endpoint in the early parent crosses according to whether that endpoint precedes or follows r. Its other endpoint avoids the late parent, and its colour is constant over the early cluster; its sum is affine in r alone. The late cluster similarly gives a function of t. An edge between the two parent clusters is selected, and one inside a cluster is short, so neither contributes a mixed term to the palette field.
The dummy neighbours give exactly
The early-dummy edges have colour zero and cross when their parent rank is below ; the dummy-late edges have colour one and cross when their parent rank is above . Changing either rank changes at most one contribution for each nondummy endpoint, of which there are at most 2SW. Thus either slope lies in . Finally the number of possible palette neighbours is less than , proving the intercept bound.
Lemma 4.3 (Greedy rank correction). Each slope in Lemma 4.2 can be corrected with at most rank programs at that endpoint. After correction the field on bundle j is
Proof. For , let , so and . Starting with , at gap add the least nonnegative number of its weight- programs that makes the new cumulative weight at least . Inductively
If copies are added, the final overshoot is smaller than the last weight, at most B. If none is added, the preceding overshoot remains below B because the target increased. Each copy weighs at least B/4, while , giving the stated count. Unoccupied gaps add no copies; there is no extra term proportional to W.
At the early endpoint the coefficient is , which cancels the slope with error in . At the late endpoint the negative prefixes give . Their initial offset must be retained: . Since and , . Only the internal gaps are used.
4.3 Forcing the palette inside the core
Use
For early–late edges let be the ordinary positive half-frame weight at early endpoint j, and the magnitude of the negative weight at its late partner. Choose
(4.6)
where . Both targets are positive. These ceilings use only known integer weights and palette crossing counts.
Lemma 4.4 (Palette forcing and selected residuals). Every minimizer defining agrees with on . Once the palette and fans are fixed, each selected edge has unary coefficient with ; in particular .
Proof. For a nonselected early-j-late-k edge, , the ordinary coefficient is
The first term has absolute value at least T. All adverse terms, including arbitrary remaining core colours, have magnitude at most
The last strict bound uses and . The rank term counts both incident endpoint families; nonincident programs contribute nothing. The binomial term bounds the full core crossing degree, without assuming any other palette colour. A wrong colour can therefore be improved by a single flip. The preferred colour is zero for and one for .
For an edge on one side, the two ordinary fields have the same sign. Each ordinary multiplicity is at least because its target is at least . Either half-frame then contributes magnitude at least from each parent. A side-dummy edge has one such contribution. All adverse rank and core terms have magnitude at most
Thus early-side edges prefer zero and late-side edges prefer one. This covers the palette simultaneously.
For the selected edge , the ordinary counts cancel in (4.4), leaving exactly
All four errors have magnitude below B, proving the residual bound.
This lemma is restricted to (4.2). Before fan freezing, a global optimum need not have this palette. The full-drawing lower bound will use only that its post-freezing core energy is at least .
4.4 Dummy edges and local constraints
Lemma 4.5 (Exact dummy elimination). With the palette fixed, the optimized dummy-edge contribution, including its palette interactions, is
independently of all selected and short-edge colours.
Proof. A dummy chord with ranks crosses no early-late selected chord and no endpoint-cluster short edge. Its palette neighbours are exactly the side-dummy edges whose dummy endpoint is strictly between . It has such neighbours of each colour. Its palette cost is consequently the constant in either colour. There are no program-fan neighbours by Lemma 3.4. Summing over gives . What remains is the full convex drawing on points, with optimum by the two-page complete-graph theorem [1]. Its endpoint-alternation predicate agrees with that of convex straight-line chords.
Let be the crossing constraints internal to one selected bundle, between selected and short edges, and between two short edges. These are crossing-graph constraints, not removed geometric edges.
Lemma 4.6 (Conservative local budget).
After deleting these constraints and fixing the palette, every short edge has only unary costs. The dummy subsystem remains independent, and the remaining selected-edge graph is that of Lemma 4.1.
Proof. In one selected bundle, an internal crossing is specified by two early and two late ranks, giving at most choices. For a source–short crossing, the short chord belongs to one of that source’s two endpoint clusters and its endpoints surround the source endpoint. An upper bound, even without this surrounding condition, is per bundle. A short–short crossing must lie in one cluster; the two clusters contribute at most . The sum is at most .
A short edge cannot cross a selected bundle avoiding its cluster, since the cluster is consecutive in cap order; short edges in distinct clusters cannot alternate. Thus the listed types exhaust its unfixed neighbours, except for dummy edges, which are noncrossing with it by Lemma 4.5. The remaining fixed neighbours give unary costs. Removing internal bundle crossings leaves exactly the source graph already identified.
4.5 A computable core baseline
Delete from (4.2). Fix the palette, set all selected colours to zero, independently minimize each short unary, and insert the dummy optimum (4.8). Call this integer , and define
All of these operations are explicit sums, crossing tests, and minima of two integers. In particular neither nor is used.
For a fixed selected colouring x, let be the minimum of the deleted energy over the short and dummy variables, with the palette fixed. The exact identity is
(4.11)
Indeed, the short minima and dummy value are independent of after deletion. All remaining source-dependent fixed-neighbour costs have coefficient . The all-zero selected colouring contributes exactly to the main graph, explaining the single subtraction. No internal-bundle contribution is subtracted twice.
Proposition 4.7 (Core encoding). The baseline is computable in polynomial time, and
Proof. Every core minimizer has the palette by Lemma 4.4. Deleting nonnegative local terms and applying (4.11) gives the lower bound, since and each residual excess is nonnegative.
For the upper bound take a class-uniform selected colouring attaining , independently minimize every short unary, and choose an optimal dummy colouring. These choices coexist in one complete core colouring. Each selected unary exceeds its separate minimum by at most , and . Restoring all local constraints costs at most by Lemma 4.6. The formula (4.10) proves computability with polynomially many exact operations. The optimizers just used certify the inequalities and are not computed by the reduction.
The bound leaves some slack. The exact residual (4.7) permits in this unordered-edge presentation. The formal proof uses , which is the same stated budget because and .
Proposition 4.8 (Program count). The number of required program points satisfies
In particular . All multiplicities are computable before final general-position insertion.
Proof. Each target in (4.6) is at most . A weight is at least , so each endpoint uses at most ordinary programs. Lemma 4.3 uses at most rank programs per endpoint. Multiplication by gives the first bound.
For , and . Thus the first two terms are below and , respectively, and 10S is smaller still. Their sum is below . Since , this is smaller than for . Each step uses only the individually known response weights; placing the resulting number of copies in their open neighbourhoods preserves those weights.
5 The complete drawing and the decision reduction
All coordinates and crossing predicates in this section refer to the final general-position drawing from Proposition 3.8. Its total number of points is ; the comparison grid has vertices. The notation means the sum of monochromatic constraints with one endpoint in each of the distinct crossing-graph vertex classes ; counts unordered pairs within .
5.1 A common computable background
Let be the crossing graph with Y deleted. Its remaining constraints are precisely
Write for the canonical grid colouring and for the independently computed program-fan responses, with colour zero at a zero field. Define
(5.1)
The fan-fan term is evaluated after insertion, including every crossing that changed during program placement. These constants require no optimal grid or fan colouring.
Proposition 5.1 (Decoupling with the grid fixed). Suppose the hypotheses of Theorem 2.4 and Proposition 2.5 hold with grid dimensions B, o, grid size ,
Set and . Then
Proof. Take an optimum of . Conditional on every other colour, its grid minimizes a unary-perturbed comparison energy with unary differences bounded by . Theorem 2.4 supplies a canonical phase and a localized flip set of size at most . If necessary complement every colour in the whole graph to make the phase positive. There are no prescribed colours, and complementation preserves every monochromatic count.
Keep this grid unchanged. By Lemma 3.5, the probe soft-count hypothesis holds. Proposition 2.5 changes only the program fans to , with cost increase at most . The grid retains its localized flip set, so the localized lower estimate in Theorem 2.4, now for the frozen unary energy in (5.1), gives at least . The current core colouring costs at least , irrespective of whether its palette was forced before the fans were frozen. The frame class costs at least , and the fan-fan cost is exactly . These terms exhaust . Thus the altered colouring has cost at least but at most , proving the lower bound.
For the upper bound, use the same , the grid colouring , a core minimizer, and a convex frame optimum. The prescribed-phase upper witness in Theorem 2.4 has grid cost at most . All these choices coexist, since the edge classes are disjoint and no further cross-class constraints remain. This proves (5.2). Restoring Y with (3.12) proves (5.3). Optimizers are used only as witnesses for inequalities.
5.2 Parameter estimates
Use the parameters of , namely
Take
Proposition 4.8 gives and the convenient bounds
Also , , , , and . These verify the geometric and core hypotheses. Each follows directly by substituting and and using , , .
In , a grid vertex has at most p outside neighbours: it has no neighbours in C or I. A program fan has at most neighbours outside X, since I is isolated. Thus
For the second inequality, and the spare factor in dominates this term together with . The mesh satisfies . Finally the scale of gives and . The two phases, the localized grid estimate, and fan freezing therefore apply to this one actual drawing.
Substitution in their error bounds gives
For the freezing term, , , and , whence . For , use and (5.5). The resulting product is at most , and , both covered by the stated bound. Consequently
5.3 Quantitative reduction and threshold
Theorem 5.2 (Bounds for the target optimum). Given a represented permutation graph G with , the construction computes a general-position rational point set , a baseline , and a positive integer , with explicit nonnegative errors such that
All output data and threshold constants have polynomial binary length and are computable in deterministic polynomial time. The points can instead be returned with integer coordinates.
Proof. Put
The core bound (4.12) and Proposition 5.1 give the two-sided interval.
Divide its total error by . The part in (5.7) is less than
The selected unary term satisfies
and the conservative local term satisfies
Hence the total is less than , which proves the strict error bound in (5.8).
To compute the baseline, first enumerate proper crossings on the actual final coordinates by exact determinants. Evaluate , each fan response, the actual fan–fan cost, and each single-flip difference . Evaluate by (4.10): set the palette, use the all-zero source colour as a reference, minimize each short unary separately, insert the known dummy value, subtract the explicit , and add the residual unary minima. Finally insert . These are finite sums and minima of two known integers. The source optimum, core optimum, and target optimum never occur as computational subroutines.
The output point count is . Since , it is bounded by a fixed polynomial of degree 400 in . Proposition 3.8 proves polynomial coordinate bit length and construction time; it also gives the integer-coordinate version by a common positive scaling.
We make the bit bound for the decision threshold explicit as well. For total point count N, all grid, fan, and core edge counts are at most . Each unnormalized crossing contribution is zero or one, and all fields are differences of finite such sums. The baseline formula (5.1) and (4.10) therefore gives the bound
One may also see this by computing each baseline from its fixed colouring cost and at most single-edge unary corrections, each bounded by a fixed multiple of ; is the all-zero main crossing count, at most . Since , we have , and .
For a source MaxCut threshold , put and output
In particular
so the threshold bit length is . The baseline is integral in the counting presentation above; the floor also accommodates its equivalent rational presentation in the formalization.
Proof of Theorem 1.2. Use the NP-hard represented permutation-graph problem with threshold k, or equivalently . For apply Theorem 5.2 and output (5.10). If , then
Since the objective is an integer, it is at most . If , integrality gives , and
Thus the same point set and threshold give both directions.
Empty source inputs can be decided directly. A fixed yes instance consists of two distinct integer points and threshold zero. A fixed no instance is the five points , , with threshold zero: their diagonal crossing graph is a five-cycle and cannot be properly two-coloured. If the target convention permits only nonnegative thresholds and the computed is negative, output this fixed no instance. A source yes instance would otherwise imply the impossible inequality . Thresholds outside the source edge-count range may also be handled directly, though the displayed equivalence already covers them.
Proposition 3.8 and (5.11) prove a deterministic polynomial-time many-one reduction with a single complete geometric target instance. Every target edge colour is a free certificate bit. The palette and frozen colours enter the proof through minimizer properties and one compatible upper-bound colouring, not through precolouring restrictions on the output. Scaling produces the same hardness on integer coordinates. Membership in NP follows by assigning colours to all edges and testing the edge pairs with exact orientation determinants. This proves NP-completeness and, consequently, NP-hardness of exact minimization.
Corollary 5.3. If collinear input points are permitted while the objective still counts only proper crossings using strict orientation tests, the decision problem remains NP-complete.
Proof. The general-position hard instances are also inputs in the larger class. The same polynomial verifier excludes every zero orientation determinant and therefore handles the stipulated crossing convention on degenerate inputs. No perturbation of an arbitrary degenerate input is used.
6 Formal verification and reproducible computations
The Lean development proves the construction and threshold equivalence used in Theorem 1.2. Its principal declaration is
Q4. Candidate.ConstructedReduction.
constructed_maxcut_instance.
For every , permutation and integer source threshold , it produces one point count , one coordinate function coords: , and one integer threshold . The same witness satisfies injectivity, general position, coordinate encoding bounds and the equivalence
The colours on the left range over every edge of freely. The formal construction gives, with ,
where each coordinate has an integer numerator and nonzero denominator of absolute value at most .
6.1 Scope and external assumptions
The final Lean declaration has the explicit mathematical hypothesis
Here ConvexOptimum asserts both a lower bound for every free two-colouring of the chords and existence of an attaining colouring; knownZ is the value Z above. This hypothesis is supplied in the mathematical proof by the established two-page theorem [1]. Its conversion to the actual frame and dummy chord objectives is formalized. The literature theorem itself is not reproved in this development and is not introduced as a custom Lean axiom.
The formal proof constructs the program points and their multiplicities, proves general position, and establishes palette forcing within the core optimization. It includes the selected-edge costs, source amplification, partition of the complete edge set, computable background and strict error gap. The source optimum and background optimum are not inputs to the construction.
A guide in the repository maps these parts of the proof to their Lean modules. The final declaration depends on 123 construction modules and four shared foundation modules; a separate aggregate file imports them for verification.
The development uses the conservative local bound and proves . These are the bounds used in the final reduction here.
The source NP-hardness theorem [6], complexity classes, machine running times, membership in NP, and the separate output-threshold bit bound are not formalized in Lean. Their mathematical proofs and references are given in this paper and in the effective-reduction notes. In particular, a small-coordinate existence theorem alone would not prove the required polynomial construction time; the explicit finite selection algorithm supplies this additional fact.
6.2 Verification procedure
The public source contains the dependency closure just described. The Lean version is fixed to 4.34.1 and the mathlib dependency and its transitive revisions are fixed by the Lake manifest.
The verification script first compares the source set with this closure and its SHA256 manifest. It checks for proof placeholders and custom axioms, builds the aggregate entry point, elaborates every source file individually, and checks the outputs of the retained explicit #print axioms commands, including the final theorem. It also checks that source and configuration hashes did not change during the run. The permitted kernel axiom dependencies are propext, Classical.choice, and Quot.sound. The axiom queries cover the designated key declarations, including the final theorem; they do not enumerate every declaration in mathlib. The trust boundary includes Lean, the pinned dependencies and their compiled artifacts, and the ordinary compiler and hardware stack.
6.3 Finite checks and use of AI
Four standard-library Python programs provide exact finite diagnostics: the six-point completion obstruction in Appendix A; core combinatorics for all six orders of three source vertices; two reduced geometric realizations with actual general-position insertion and crossing-table checks; and rational or integer checks of selected parameter inequalities. The programs use exact arithmetic. Their recorded inputs and expected outputs are distributed with the source. They do not generate or solve the extremely large target instances of the reduction and are not used as proofs of statements for unbounded input sizes.
AI systems assisted the exploration, formalization and writing of this paper. Separate LLM-assisted reviews examined the definitions and the reduction, including its effective coordinate construction. These reviews are distinct from the Lean checks and do not constitute human peer review. The repository documents their scope and the verification commands.
A A direct-completion obstruction
The following example explains why the contribution of added edges must be controlled in a completeness-preserving reduction.
Proposition A.1. Completing a segment family to the complete geometric graph on its endpoints can produce an optimum whose restriction to the original family is not optimal. The minimum contribution of the added edges can also depend on the prescribed source colours.
Proof. Take for and abbreviate by ij. The source edges are 01, 24, 35. Their only crossing pair is 24, 35, so the source optimum is zero.
Every five-point subset is strictly convex. The crossing graph of its five diagonals is an odd cycle, so every two-colouring contains a monochromatic crossing. There are six five-point subsets, and every crossing pair belongs to exactly two of them. Therefore the complete six-point graph has at least three monochromatic crossing pairs in every colouring.
Colour 03, 04, 13, 14 blue and all remaining edges red. Its monochromatic crossing pairs are exactly (02, 15), (03, 14), (24, 35), so it is optimal for the complete graph. Its restriction to the source has cost one. In particular, when 24 and 35 have the same colour, the minimum additional cost is two.
Alternatively colour 14, 15, 24, 25 blue and the other edges red. The monochromatic crossing pairs are (02, 13), (04, 35), (14, 25). This is again a complete optimum, but 24 and 35 now have different colours. The source cost is zero and the minimum additional cost is three. Hence the extra optimum is not independent of the source colouring.
References
[1] Bernardo M. Ábrego, Oswin Aichholzer, Silvia Fernández-Merchant, Pedro Ramos, and Gelasio Salazar. The 2-page crossing number of . Discrete & Computational Geometry, 49(4):747–777, 2013. Open version: arXiv:1206.5669.
[2] Oswin Aichholzer, Ruy Fabila-Monroy, Adrian Fuchs, Carlos Hidalgo-Toscano, Irene Parada, Birgit Vogtenhuber, and Francisco Zaragoza. On the 2-colored crossing number. In Daniel Archambault and Csaba D. Tóth, editors, Graph Drawing and Network Visualization (GD 2019), volume 11904 of Lecture Notes in Computer Science, pages 87–100. Springer, 2019. Full version, including Appendix B: https://arxiv.org/abs/1908.06461v2.
[3] Oswin Aichholzer, Wolfgang Mulzer, Patrick Schnider, and Birgit Vogtenhuber. NP-completeness of Max-Cut for segment intersection graphs. In Proceedings of the 34th European Workshop on Computational Geometry (EuroCG 2018), pages 32:1–32:6, 2018. Extended abstract. https://page.mi.fu-berlin.de/mulzer/pubs/maxcutEWCG.pdf.
[4] Sanjeev Arora, David Karger, and Marek Karpinski. Polynomial time approximation schemes for dense instances of NP-hard problems. Journal of Computer and System Sciences, 58(1):193–210, 1999. doi:10.1006/jcss.1998.1605.
[5] Sergio Cabello, Éva Czabarka, Ruy Fabila-Monroy, Yuya Higashikawa, Raimund Seidel, László Székely, Josef Tkadlec, and Alexandra Wesolek. A note on the 2-colored rectilinear crossing number of random point sets in the unit square. Acta Mathematica Hungarica, 173(1):214–226, 2024. Open version: arXiv:2312.01935.
[6] Celina M. H. de Figueiredo, Aleksander A. de Melo, Fabiano S. Oliveira, and Ana Silva. MaxCut on permutation graphs is NP-complete. Journal of Graph Theory, 104(1):5–16, 2023. Open version: arXiv:2202.13955.
[7] Ruy Fabila-Monroy. A note on the k-colored crossing ratio of dense geometric graphs. Computational Geometry, 124–125:102123, 2025. Open version: arXiv:2301.07261.
[8] Robert Ganian, Fabrizio Montecchiani, Martin Nöllenburg, and Meirav Zehavi. Parameterized complexity in graph drawing (Dagstuhl seminar 21293). Dagstuhl Reports, 11(6):82–123, 2021. Editors; see Vogtenhuber's Problem 2 in Section 4.12, p. 107. doi:10.4230/DagRep.11.6.82.
[9] Benedikt Hahn, Bettina Klinz, and Birgit Vogtenhuber. On the geometric k-colored crossing number of . arXiv:2505.18014, 2025. Version 1, 23 May 2025. https://arxiv.org/abs/2505.18014.
[10] Sumio Masuda, Kazuo Nakajima, Toshinobu Kashiwabara, and Toshio Fujisawa. Crossing minimization in linear embeddings of graphs. IEEE Transactions on Computers, 39(1):124–127, 1990. doi:10.1109/12.46286.
[11] Birgit Vogtenhuber. Bicolouring crossings in a straight-line drawing of . Crossing Numbers Workshop 2019, open-problem summary, 2019. Section 1.4, Question 4, p. 3. https://www.fi.muni.cz/~hlineny/papers/Summary_CRNW2019.pdf.
[12] Birgit Vogtenhuber. 2-colored crossing number. GGWeek 2022 problem booklet, 17th European Research Week on Geometric Graphs, 2022. Problem 11, pp. 28–29. https://tutte.fernuni-hagen.de/web/ggweek/GGWeek2022.pdf.