cs.DS — Data Structures and Algorithms
Sorting networks on 13 inputs need 45 comparators
Let be the least number of comparators in a sorting network on inputs (the Bose--Nelson problem). The values are known for , and for inputs the smallest known sorting network, found by Juill\'e, has comparators. We prove , so . Deleting the comparators met by the largest and the second largest input leaves a sorting network on inputs, so , where is the least possible worst-case number of comparators met by these two values. Van Voorhis stated for an explicit function , but Mericanii showed that his proof is invalid. We prove for by a finite search, which rests on the structure of the tree of paths of the largest value, the comparators on these paths, and a forest of comparators that carries the second largest value. With this bound gives only . For we apply it to the suffix of a network: if a network with comparators sorts a set of - vectors, then for suitable pairs of inputs the two values meet at most comparators, where is the cost of sorting the residual set left when their paths are deleted. A breadth-first search over the sets produced by prefixes of a hypothetical sorting network with comparators discards each set for which no single network stays within all these budgets, and no set survives at depth . A separate verifier checks the certificate written by the search. Two proofs in Lean 4 check the same certificate, and in one of them Lean's kernel checks every computation, with only the standard axioms. Juill\'e's network is checked in the kernel as well. As a consequence, each of the twenty lower bounds on for that rested on Van Voorhis's inequality is proved and raised by one.