← All papers
First page of Sharp Threshold for Non-Monotonicity of Closed Convexity and Locally Good Non-Convex Neural Codes

Sharp Threshold for Non-Monotonicity of Closed Convexity and Locally Good Non-Convex Neural Codes

Weida Liu

math.CO Dec 2, 2026 · v1 math.MG
The main theorem on a 5-neuron neural code pair is fully formalized in Lean 4 with Mathlib (1,262 lines, no sorry, standard axioms only).
Gambacini, Jeffs, Macdonald, and Shiu (2022) proved on $n = 8$ neurons that closed convexity of neural codes is not monotone under adding non-maximal codewords, and gave an $8$-neuron, $21$-codeword locally good code that is neither open nor closed convex. They conjectured (Conjecture 3.13) that every locally good code on at most $7$ neurons is open or closed convex, and asked (Remark 3.4) whether non-monotonicity of closed convexity occurs on fewer than $8$ neurons or with all codewords of size at most $4$. We settle all of these questions at the exact sharp threshold $n = 5$ via a single pair $C_4 \subsetneq C_5'$ of $12$ and $13$ codewords with $Δ(C_4) = Δ(C_5')$ and max codeword size $4$: $C_4 = \{2345, 123, 134, 145, 13, 14, 23, 34, 45, 3, 4, \emptyset\}$ (the Lienkaemper-Shiu-Woodstock code) and $C_5' = C_4 \cup \{25\}$. We prove: (i) $C_4$ has an explicit compact (hence closed) convex realization in $\mathbb{R}^2$; (ii) $C_5'$ is locally good, with all $11$ missing nonempty faces having elementary collapsible links; and (iii) $C_5'$ admits neither an open nor a closed convex realization in $\mathbb{R}^d$ for any $d \ge 1$. Since for $n \le 4$ every locally good code is max-intersection-complete (hence open and closed convex, with closed convexity monotone), $n = 5$ is the exact minimal threshold for both phenomena, yielding a locally good non-convex code on the sole remaining $5$-neuron complex $Δ(C_4)$ left open by Goldrup and Phillipson (2020). Theorem 1.2 for $C_4 \subsetneq C_5'$ is fully verified in Lean 4 (0 sorry, standard axioms only); the $n \le 4$ and $13$-codeword minimality bounds (Proposition 3.3, Corollary 1.3) are proved in prose.

Gambacini, Jeffs, Macdonald, and Shiu showed on 8 neurons that closed convexity of neural codes is not monotone and that locally good codes need not be open or closed convex. They conjectured that every locally good code on at most 7 neurons is open or closed convex, and asked whether non-monotonicity occurs with fewer neurons or with codewords of size at most 4.

A single pair of 5-neuron codes is used: the 12-codeword Lienkaemper-Shiu-Woodstock code C4 and C5' = C4 ∪ {25}, which share the same simplicial complex. C4 gets an explicit compact convex realization by polygons in R^2. C5' is shown locally good via elementary collapses of all 11 links. An abstract triple-line obstruction in normed spaces, plus a pullback/Jacobian argument, rules out open and closed convex realizations of C5'. The main theorem is formalized in Lean 4 with Mathlib, with each result mapped to a named Lean declaration.

The questions are settled at the sharp threshold n=5 with maximum codeword size 4, giving a locally good code that is neither open nor closed convex and a non-monotonicity example. The Lean file compiles with 0 sorry using only propext, Classical.choice, and Quot.sound. The minimality bounds (n ≤ 4 and 13 codewords) are proved in prose only. The repository also includes earlier Lean formalizations of 6- and 7-neuron counterexamples.

Paper ResultLean 4 DeclarationVerification Method
Proposition 3.1C4_isCompactConvexExplicit polygons in R^2
Proposition 3.2C5_prime_locallyGoodAll 11 links via decide
Theorem 4.3C5_prime_not_open_convexConnectedness + Lemma 4.2
Theorem 4.4C5_prime_not_closed_convexPullback + 2x2 Jacobian
Theorem 1.2five_neuron_sharp_breakthroughCombined main theorem
Correspondence between paper results and Lean 4 declarations (excerpt)