Sorting networks on 13 to 20 inputs need 45, 50, 55, 60, 66, 71, 76 and 81 comparators
- doi:10.5281/zenodo.24156529
- Certificate, verifier and native Lean proof, 13 inputs
- Kernel-checked Lean proofs, 13 inputs
- Programs, logs and independent checks for P(2, N)
- Certificates and programs, 14 inputs
- Lean proofs, 14 inputs
- Certificates and programs, 15, 16 and 20 inputs
- Lean proofs, 15, 16 and 20 inputs
- Lean proofs, 17, 18 and 19 inputs
- GitHub
Abstract
Let S(N) be the least number of comparators in a sorting network on N inputs. We prove that S(13) = 45 and S(16) = 60, so Juillé's network on 13 inputs and Green's 1969 network on 16 inputs are optimal in size. We also prove that S(14) ≥ 50, S(15) ≥ 55, S(17) ≥ 66, S(18) ≥ 71, S(19) ≥ 76 and S(20) ≥ 81; thus S(14) is 50 or 51 and S(15) is 55 or 56. Dobbelaere's table of sorting networks, as revised on 20 November 2026, lists the lower bounds 43, 47, 51, 55, 60, 65, 70 and 75 for 13 ≤ N ≤ 20. In addition, P(2, N) = ⌈log₂ F(N)⌉ for 3 ≤ N ≤ 32, where P(2, N) is the least worst-case number of comparators met by the two largest inputs in a network that delivers them to fixed outputs, and F is an explicit function of Van Voorhis. This proves the twenty lower bounds for 13 ≤ N ≤ 32 that the table listed before that revision. Those bounds rested on an inequality of Van Voorhis whose published proof Mericanii found invalid and which fails for 93 inputs; S(13) = 45 raises each of them by one. All proofs use computer searches. For 13 inputs we extend Harder's method for S(11) = 35 (arXiv:2012.04400) from the largest value to the two largest. For 14 and 15 inputs, the bounds for fewer inputs fix the shapes of the trees formed by the paths of the largest and the smallest value, and searches with lower bounds of Huffman type rule out the resulting starts. The bounds for 16 and 20 inputs come from a rigidity argument and a finite check, and the bound for 17 inputs from a search over the configurations of the three largest values; Van Voorhis's bound then gives the bounds for 18 and 19 inputs. Separately written programs check the computations for 13 to 16 and 20 inputs, other programs check the computation of P(2, N) except for 119 shapes at N = 28, and a C++ search cross-checks the claim at 17 inputs. In Lean 4, S(13) = 45 has a kernel-checked proof and P(2, N) = ⌈log₂ F(N)⌉ is proved for 3 ≤ N ≤ 13. The bounds for 17 to 19 inputs are proved in Lean, and Lean derives the bounds for 14, 15, 16 and 20 inputs a second time; one step of the proof of S(15) ≥ 55 exists only in Lean. The Lean proofs for 14 to 20 inputs assume two tables of bounds certified outside Lean, and parts of the Lean proofs run as compiled code.
In plain words
A sorting network puts numbers in order using a fixed sequence of compare-and-swap steps. Because the sequence never depends on the numbers, such networks suit parallel sorting. Juillé found a network that sorts 13 numbers in 45 steps, and Green one that sorts 16 numbers in 60, but no one could rule out shorter ones. This paper proves that none exist. It also proves lower bounds for 14, 15, 17, 18, 19 and 20 numbers: 50, 55, 66, 71, 76 and 81 steps. For 14 and 15 numbers the best networks known use 51 and 56.
Formal statement and axioms
Each main result as stated in Lean, copied verbatim from the published package, with the axioms that the proof rests on. Lean v4.35.0-rc3, Mathlib c55e6e786f49. The package.
Sortnet.S13_ge_45
S(13) ≥ 45: kernel-only
theorem S13_ge_45 : ∀ net : Network 13, net.Sorts → 45 ≤ net.lengthDefinitions used in the statement
structure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bSource: Zenodo record 23552145, lean_s13_kernel.tar.gz/lean_s13_kernel/tools/mkfinal.py:39. The generated Lean file is not published, so the statement above is taken from the published script that generates the file.
Axioms, as Lean reports them. Recorded in zenodo:23552145/BUILD_LOG.md:170.
'Sortnet.S13_ge_45' depends on axioms: [propext, Classical.choice, Quot.sound]Sortnet.S13_ge_45
S(13) ≥ 45: with compiled code
theorem S13_ge_45 : ∀ net : Network 13, net.Sorts → 45 ≤ net.lengthDefinitions used in the statement
structure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bSource: Zenodo record 23504361, lean_s45.tar.gz/lean_s45/S45Final/Unconditional.lean:15.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 1,724 more, for example Sortnet.certOK_harder11._native.native_decide.ax_1_1, Sortnet.S45Data.T9Hint7Check.chunk00._native.native_decide.ax_1_1 and Sortnet.S45Data.T9Hint7Check.chunk01._native.native_decide.ax_1_1. Each of these 1,724 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:23504361/lean_s45.tar.gz/lean_s45/logs/s45_unconditional_axioms.txt:1-1727.
Sortnet.S14.S14_ge_50_N
S(14) ≥ 50: with compiled code
theorem Sortnet.S14.S14_ge_50_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S14.S14StatementDefinitions used in the statement
def S14Statement : Prop := ∀ net : Network 14, net.Sorts → 50 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 23632985, lean_s14_tools.tar.gz/lean_s14/assembly_n/S14AssemblyN.lean:37-40.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 43,100 more, for example Sortnet.certOK_harder11._native.native_decide.ax_1_1, Sortnet.S14.CSD.n_V2164_10._native.native_decide.ax_1_1 and Sortnet.S14.CSD.n_V2202_12._native.native_decide.ax_1_1. Each of these 43,100 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:23632985/lean_s14_tools.tar.gz/lean_s14/assembly_n/assembly_out.txt:6-43108.
11 more formal statements
Sortnet.S15.S15_ge_55_N
S(15) ≥ 55: with compiled code
theorem Sortnet.S15.S15_ge_55_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S15.S15StatementDefinitions used in the statement
def S15Statement : Prop := ∀ net : Network 15, net.Sorts → 55 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24464975, lean_tools.tar.gz/lean_tools/assembly_n/S15AssemblyN.lean:45-48.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 267,863 more, for example Sortnet.S14.CSD.n_V2164_10._native.native_decide.ax_1_1, Sortnet.S14.CSD.n_V2202_12._native.native_decide.ax_1_1 and Sortnet.S14.CSD.n_V2202_21._native.native_decide.ax_1_1. Each of these 267,863 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24464975/lean_tools.tar.gz/lean_tools/axioms/S15_ge_55_N.txt:1-267866.
Sortnet.S16.S16_eq_60_N
S(16) = 60: with compiled code
theorem Sortnet.S16.S16_eq_60_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S16.S16Statement ∧ ∃ net : Sortnet.Network 16, net.Sorts ∧ net.length = 60Definitions used in the statement
def S16Statement : Prop := ∀ net : Network 16, net.Sorts → 60 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24464975, lean_tools.tar.gz/lean_tools/assembly_n/S16EqAssemblyN.lean:70-73.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 267,884 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 267,884 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24464975/lean_tools.tar.gz/lean_tools/axioms/S16_eq_60_N.txt:1-267887.
Sortnet.S20.S20_ge_81_N
S(20) ≥ 81: with compiled code
theorem Sortnet.S20.S20_ge_81_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S20.S20StatementDefinitions used in the statement
def S20Statement : Prop := ∀ net : Network 20, net.Sorts → 81 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24464975, lean_tools.tar.gz/lean_tools/assembly_n/S20AssemblyN.lean:71-74.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 267,917 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 267,917 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24464975/lean_tools.tar.gz/lean_tools/axioms/S20_ge_81_N.txt:1-267920.
Sortnet.T6.table6Lo_N
the paper’s lower bounds for 17 ≤ N ≤ 27: with compiled code
theorem Sortnet.T6.table6Lo_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.T6.Table6LoDefinitions used in the statement
def Table6Lo : Prop :=
Sortnet.S20.S17Statement ∧ Sortnet.S20.S18Statement ∧ Sortnet.S20.S19Statement ∧ Sortnet.S20.S20Statement ∧
S21Statement ∧ S22Statement ∧ S23Statement ∧ S24Statement ∧ S25Statement ∧ S26Statement ∧ S27Statementdef S17Statement : Prop := ∀ net : Network 17, net.Sorts → 65 ≤ net.lengthdef S18Statement : Prop := ∀ net : Network 18, net.Sorts → 70 ≤ net.lengthdef S19Statement : Prop := ∀ net : Network 19, net.Sorts → 75 ≤ net.lengthdef S20Statement : Prop := ∀ net : Network 20, net.Sorts → 81 ≤ net.lengthdef S21Statement : Prop := ∀ net : Network 21, net.Sorts → 86 ≤ net.lengthdef S22Statement : Prop := ∀ net : Network 22, net.Sorts → 92 ≤ net.lengthdef S23Statement : Prop := ∀ net : Network 23, net.Sorts → 97 ≤ net.lengthdef S24Statement : Prop := ∀ net : Network 24, net.Sorts → 103 ≤ net.lengthdef S25Statement : Prop := ∀ net : Network 25, net.Sorts → 108 ≤ net.lengthdef S26Statement : Prop := ∀ net : Network 26, net.Sorts → 114 ≤ net.lengthdef S27Statement : Prop := ∀ net : Network 27, net.Sorts → 119 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24464975, lean_tools.tar.gz/lean_tools/assembly_n/T6AssemblyN.lean:70-73.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 267,920 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 267,920 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24464975/lean_tools.tar.gz/lean_tools/axioms/table6Lo_N.txt:1-267923.
Sortnet.S16.green_sorts
kernel-only for the proof that Green’s network sorts
theorem green_sorts : greenNet.SortsDefinitions used in the statement
def greenNet : Network 16 :=
[gc 0 1, gc 2 3, gc 4 5, gc 6 7, gc 8 9, gc 10 11, gc 12 13, gc 14 15,
gc 0 2, gc 1 3, gc 4 6, gc 5 7, gc 8 10, gc 9 11, gc 12 14, gc 13 15,
gc 0 4, gc 1 5, gc 2 6, gc 3 7, gc 8 12, gc 9 13, gc 10 14, gc 11 15,
gc 0 8, gc 1 9, gc 2 10, gc 3 11, gc 4 12, gc 5 13, gc 6 14, gc 7 15,
gc 5 10, gc 6 9, gc 3 12, gc 13 14, gc 7 11, gc 1 2, gc 4 8,
gc 1 4, gc 7 13, gc 2 8, gc 11 14, gc 5 6, gc 9 10,
gc 2 4, gc 11 13, gc 3 8, gc 7 12,
gc 6 8, gc 10 12, gc 3 5, gc 7 9,
gc 3 4, gc 5 6, gc 7 8, gc 9 10, gc 11 12,
gc 6 7, gc 8 9]def gc (i j : Fin 16) (h : i < j := by decide) : Comparator 16 := ⟨i, j, h⟩structure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bSource: Zenodo record 24464975, lean_src.tar.gz/lean_src/S16/Green.lean:112.
Axioms, as Lean reports them.
'Sortnet.S16.green_sorts' depends on axioms: [propext, Classical.choice, Quot.sound]Sortnet.S19.S17_ge_66_N
S(17) ≥ 66: with compiled code
theorem Sortnet.S19.S17_ge_66_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S19.S17Statement66Definitions used in the statement
def S17Statement66 : Prop := ∀ net : Network 17, net.Sorts → 66 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24729010, LQ_routes.tar.gz/w17/src/S1719AssemblyC17K.lean:29-32.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 280,284 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 280,284 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24729010/LQ_records.tar.gz/records/C17/ax/ax_4.txt:1-280287.
Sortnet.S19.S18_ge_71_N
S(18) ≥ 71: with compiled code
theorem Sortnet.S19.S18_ge_71_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S19.S18Statement71Definitions used in the statement
def S18Statement71 : Prop := ∀ net : Network 18, net.Sorts → 71 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24729010, LQ_routes.tar.gz/w17/src/S1719AssemblyC17K.lean:36-39.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 280,284 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 280,284 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24729010/LQ_records.tar.gz/records/C17/ax/ax_5.txt:1-280287.
Sortnet.S19.S19_ge_76_N
S(19) ≥ 76: with compiled code
theorem Sortnet.S19.S19_ge_76_N :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S19.S19Statement76Definitions used in the statement
def S19Statement76 : Prop := ∀ net : Network 19, net.Sorts → 76 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24729010, LQ_routes.tar.gz/w17/src/S1719AssemblyC17K.lean:43-46.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 280,284 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 280,284 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24729010/LQ_records.tar.gz/records/C17/ax/ax_6.txt:1-280287.
Sortnet.S19.S19_ge_76_N_of_C19
S(19) ≥ 76 also by a second route that does not use S(17) ≥ 66
theorem Sortnet.S19.S19_ge_76_N_of_C19 :
Sortnet.S14.coreTableC.Valid →
(∀ i ∈ Sortnet.S14.Wed.done, (Sortnet.S14.Wed.TLf i).Valid) →
Sortnet.S19.S19Statement76Definitions used in the statement
def S19Statement76 : Prop := ∀ net : Network 19, net.Sorts → 76 ≤ net.lengthstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kabbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vdef Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v bdef bitSet (n K : ℕ) : Set (Vec n) := {v | Nat.testBit K (code v) = true}structure Table where
cnt : ℕ
ent : ℕ → ℕ × ℕ × ℕdef Table.Valid (T : Table) : Prop :=
∀ i < T.cnt, ((T.ent i).1 = 10 ∨ (T.ent i).1 = 11) → LB (bitSet (T.ent i).1 (T.ent i).2.1) (T.ent i).2.2Source: Zenodo record 24729010, LQ_routes.tar.gz/w19/src/S19AssemblyC19G.lean:22-25.
Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 268,047 more, for example Sortnet.S16.checkL1_ok._native.native_decide.ax_1_1, Sortnet.S16.orbit0_ok._native.native_decide.ax_1_1 and Sortnet.S16.orbit10_ok._native.native_decide.ax_1_1. Each of these 268,047 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:24729010/LQ_records.tar.gz/records/C19/ax/ax_release.txt:1-268050.
Sortnet.S13_ge_44
S(13) ≥ 44: kernel-only
theorem S13_ge_44 : ∀ net : Network 13, net.Sorts → 44 ≤ net.lengthDefinitions used in the statement
def Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v babbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kAxioms, as Lean reports them. Recorded in the published file (also lean_kernel/logs/run11/axioms.txt and lean_kernel/README.md#L37-L42).
'Sortnet.S13_ge_44' depends on axioms: [propext, Classical.choice, Quot.sound]Sortnet.S13_ge_44
S(13) ≥ 44: with compiled code
theorem S13_ge_44 : ∀ net : Network 13, net.Sorts → 44 ≤ net.lengthDefinitions used in the statement
def Network.Sorts {n : Nat} (net : Network n) : Prop :=
∀ v : Fin n → Nat, ∀ a b : Fin n, a ≤ b → net.eval v a ≤ net.eval v babbrev Network (n : Nat) := List (Comparator n)def Network.eval {n : Nat} (net : Network n) (v : Fin n → Nat) : Fin n → Nat :=
net.foldl (fun w c => c.apply w) vstructure Comparator (n : Nat) where
i : Fin n
j : Fin n
lt : i < j
deriving DecidableEqdef Comparator.apply {n : Nat} (c : Comparator n) (v : Fin n → Nat) : Fin n → Nat :=
fun k => if k = c.i then min (v c.i) (v c.j) else if k = c.j then max (v c.i) (v c.j) else v kAxioms, as Lean reports them. Recorded in the published file.
info: S13/S11/Axioms.lean:7:0: 'Sortnet.S13_ge_44' depends on axioms: [propext,
Classical.choice,
Quot.sound,
certOK_harder11._native.native_decide.ax_1_1,
fullCheck_13_8._native.native_decide.ax_1_1]