How few edges preserve a hypercube’s diameter?

AI-generated · No human mathematician has yet refereed the proof.

The n-cube has a corner for each string of n bits, with edges between corners differing in one bit. Lean proves that, for n ≥ 2, joining every two corners by a path of at most n edges takes at least 2ⁿ + (2ⁿ − 2n)/(n − 1) edges.

Let f(n) be the fewest edges of a subgraph of the n-cube Qₙ that keeps all 2ⁿ corners and joins every two of them by a path of at most n edges. Then f(n) ≥ 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉ for every n ≥ 2; for every rational ε > 0, (f(n) − 2ⁿ)(n − 1) ≥ (3/2 − ε)·2ⁿ for all large enough n; f(n) ≤ 2ⁿ + C(n, ⌊n/2⌋) − 2 for every n ≥ 1; f(4) = 20, 39 ≤ f(5) ≤ 40, 76 ≤ f(6) ≤ 81, f(7) ≥ 150 and f(8) ≥ 294; and sixteen lower bounds for n = 17 to 32, from f(17) ≥ 140,128 to f(32) ≥ 4,454,492,243.

Graham and Harary (1992) asked how many edges of the n-cube can be thrown away while every two corners stay within n steps of each other, the largest distance between two corners at the start. Bouabdallah, Delorme and Djelloul (1995) proved a lower bound whose second term is about 2ⁿ/(2n − 1). Lean checks a bound whose second term is about 2ⁿ/(n − 1), roughly twice as large, and pushes the coefficient on that scale from 1 to 3/2 for large n.

Two exact counting identities give a lower bound above the 1995 one for every n ≥ 4, and Lean checks bounds from Q₄ to Q₃₂

Walkthrough: 12 of 14 main results in Lean; 2 more rest in part on computations outside Lean

Lean assumes no outside theorem. The 1995 upper bound is re-proved in Lean by building its subgraph, and the 81-edge subgraph of Q₆ found by Charton et al. is checked in Lean.

Published inputs

  • Bouabdallah, Delorme & Djelloul (1995) (Re-proved in Lean): Established the upper bound g(n) = 2ⁿ + C(n, ⌊n/2⌋) − 2, which Lean re-proves by building a valid subgraph with that many edges (Proposition 4).
  • Erdős, Hamburger, Pippert & Weakley (1996) (not fully read); Graham & Harary (1992) (Re-proved in Lean): Also credited with the g(n)-edge construction. Nenadov et al. (2020) attribute it to Erdős et al., and Charton et al. (2024) to Erdős et al., Graham and Harary, and Bouabdallah et al. jointly.
  • de Bruijn, van Ebbenhorst Tengbergen & Kruyswijk (1951) (Re-proved in Lean): Symmetric-chain decompositions, which the paper names beside Hall’s marriage theorem as a source of the matching between neighbouring layers of the cube; in Lean the matching is built directly from prefix sums.
  • Charton, Ellenberg, Wagner & Williamson (2024) (Ported into Lean): Found an explicit valid subgraph of Q₆ with 81 edges, one fewer than g(6) = 82; Lean checks that it is valid and has 81 edges. The paper also takes from them the term “blocking” vertex (Proposition 7).

What this paper adds

  • Exact identities & lower bounds for every n ≥ 2: Two exact identities; The bound for every n ≥ 2; Above the 1995 lower bound for n ≥ 4; The coefficient 3/2 for large n
  • Explicit subgraphs, Q₄ and Q₅: Upper bounds from explicit subgraphs; Blocking corners; Q₄ needs exactly 20 edges; Q₅ needs 39 or 40 edges
  • Antipodal certificates for n = 6 to 32: The certificate bridge; f(6), f(8) and n = 9 to 16; f(7) ≥ 150; Sixteen bounds for n = 17 to 32

f(n) ≥ 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉ for every n ≥ 2, f(4) = 20, and bounds through n = 32

The fewest edges f(n) of a subgraph of the n-cube that keeps every two corners within n steps satisfies f(n) ≥ 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉ for every n ≥ 2 and f(n) ≤ 2ⁿ + C(n, ⌊n/2⌋) − 2 for every n ≥ 1; for every rational ε > 0, (f(n) − 2ⁿ)(n − 1) ≥ (3/2 − ε)·2ⁿ for all large enough n; f(4) = 20, 39 ≤ f(5) ≤ 40, f(6) ≥ 76, f(7) ≥ 150, f(8) ≥ 294, and lower bounds for every n from 9 to 32.

12 of 14 main results are counted as in Lean, with no outside theorem or computation; in two of them, Theorems 1 and 3, one clause is stated by no Lean declaration. Theorem 1 is in Lean in both forms its statement gives, 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉ and 2ⁿ + ⌊(2ⁿ − 2n + n − 2)/(n − 1)⌋, each as its own bound on f(n), but no Lean declaration states that the two are equal. Theorem 3 is in Lean in the form it gives for every rational ε > 0 and all large enough n; its equivalent, that the lim inf of (n − 1)(f(n) − 2ⁿ)/2ⁿ is at least 3/2, is stated by no Lean declaration. Proposition 12 is in Lean except for the per-excess floors its statement gives, (28, 38, 48, 54) at n = 6 and (134, 226, 314, 398, 478, 554) at n = 8, which no Lean theorem states and the paper’s recompute.py computes; f(6) ≥ 76 and f(8) ≥ 294 are proved in Lean. Proposition 14 is split: Lean proves that no 19-edge subgraph of Q₄ keeps the diameter, while the census of 8,320 labelled 20-edge subgraphs in 30 classes is by external enumeration only.

Listed as open in the paper

  • Whether f(5) is 39 or 40 (Conjecture 15).
  • The exact growth rate and leading constant of f(n) − 2ⁿ, which lies between order 2ⁿ/n and order 2ⁿ/√n (Conjecture 15).

Adjacent prior work (not used as inputs)

  • Bass & Sudborough (2000 (not fully read), 2003) [f(4) > 18, f(5) > 35, f(6) > 69, f(7) > 137 and f(8) > 272, proved in Lean]: Printed edge-removal tables leaving 18, 35, 69, 137 and 272 surviving edges in dimensions 4 to 8, matching the 1995 lower bound; Lean proves f(n) is larger than each, so none is attained. Pages 137–146 of the 2000 paper were not read.
  • Graham’s conjecture, as recorded by Charton et al. (2024) [Charton et al.’s 81-edge subgraph of Q₆, checked in Lean (Proposition 10)]: That the g(n)-edge construction is optimal; at n = 6 an 81-edge valid subgraph beats its 82 edges, and Lean proves f(6) is below the construction’s edge count.
  • Bouabdallah, Delorme & Djelloul (1995); Wang, Ho, Ferrero & Sung (2008): Bouabdallah et al. proved the lower bound 2ⁿ − 1 + ⌈(2ⁿ − 1)/(2n − 1)⌉, whose coefficient on the scale 2ⁿ/(n − 1) is 1/2; Wang et al. record it in survey material. Theorem 1 exceeds it for every n ≥ 4.
  • Graham & Harary (1992): Introduced diameter-preserving edge deletion on hypercubes.
  • Nenadov, Sawhney, Sudakov & Wagner (2020): Restated the question of the fewest edges and proved a lower bound of order 2ⁿ/n on f(n) − 2ⁿ.

Squares, cubes and the table

In Q₂, the square 00, 01, 11, 10, all 4 edges are needed: drop one and its two ends are 3 steps apart, more than 2. So f(2) = 4.

Q₃ has 12 edges, and 3 of them can go. Keep all three edges at 000 and all three at 111, and the edges 001–011, 010–110 and 100–101. Every two of the 8 corners are then at most 3 steps apart. A count over all 220 ways to keep 9 edges finds exactly 8 that work, and none of the 495 ways to keep 8 works, so f(3) = 9. That count is a small computation outside Lean; Lean proves f(3) = 9 from the bound and the chain construction. The bound gives 2³ + ⌈(8 − 6)/2⌉ = 9 as well, where ⌈x⌉ means x rounded up to a whole number.

At n = 4 the bound gives 2⁴ + ⌈(16 − 8)/3⌉ = 16 + 3 = 19. For n = 4 to 8 it gives 19, 38, 75, 147 and 291, against 18, 35, 69, 137 and 272 from the 1995 formula 2ⁿ − 1 + ⌈(2ⁿ − 1)/(2n − 1)⌉. Lean also proves f(4) = 20, 39 ≤ f(5) ≤ 40 and 76 ≤ f(6) ≤ 81.

Why, for n ≥ 2, every corner keeps at least 2 edges: if a corner u kept only its edge along bit i, take the string that differs from u in every bit except i. Every path to it starts by changing bit i, which it must later change back, so it takes at least (n − 1) + 2 = n + 1 steps, one too many.

The cube, its corners and f(n)

The corners of Qₙ are the 2ⁿ strings of n bits, and an edge joins two strings that differ in one bit, so two corners are as many steps apart as the bits in which they differ. A subgraph G keeps some of the edges; it is valid when every two corners are joined in G by a path of at most n edges, and f(n) is the fewest edges of a valid G. Every path in G changes one bit per step, so it is at least as long as the number of bits its ends differ in, and has the same parity. For n ≥ 2 this forces every corner of a valid G to keep at least 2 edges.

  • For n ≥ 2, every corner of a valid subgraph keeps at least 2 edges

    For n ≥ 2 and every valid subgraph G of Qₙ, every corner has degree at least 2.

    theorem Hypercube.two_le_degree {n : ℕ} {G : SimpleGraph (CubeVertex n)} [DecidableRel G.Adj] (hn : 2 ≤ n) (hV : IsValidSpanningSubgraph n G) (u : CubeVertex n) :
      2 ≤ G.degree u
  • The corners of the n-cube, as stated
  • A valid subgraph, as stated
  • The number of edges, as stated
  • The fewest edges f(n), as stated
  • Distances in G are at least cube distances, with the same parity

    In a connected subgraph of Qₙ, the distance from u to w is at least the number of bits where they differ and has the same parity.

  • A bound for every valid subgraph bounds f(n)

    If every valid subgraph of Qₙ has at least m edges, then f(n) ≥ m.

  • The opposite corner, as stated

Layers around a corner

Fix a corner v and sort the other corners into layers by their distance from v in G. Each corner's excess is its number of kept edges minus 2, and the excesses of all corners add up to 2t, where t is the number of kept edges minus 2ⁿ. For n ≥ 2 and a valid G, counting edges between neighbouring layers gives exact identities: how big each layer is, how many extra neighbours there are in all (a corner with p neighbours in the layer before has p − 1 extra, and from layer 2 on these add up to t + 1), and, summed over every corner, one identity: the excess of each corner times the extra distance it sees, plus twice a weighted count of the extra neighbours, adds up to 2ⁿ((n − 1)t − (2ⁿ − 2n)). The extra distance of w is how much the distances from all corners to w add up to beyond their total n·2ⁿ⁻¹ in the cube.

  • The identity summed over all corners

    For n ≥ 2 and G of diameter n inside Qₙ, the sum over corners w of x(w)·δ(w), plus twice the sum over corners v of M(v), equals 2ⁿ((n − 1)t − (2ⁿ − 2n)).

  • The excesses add up to 2t

    The excesses of all corners add up to 2t, twice the number of edges beyond 2ⁿ.

  • The size of each layer

    For a connected subgraph of Qₙ and k ≥ 1, |Sₖ(v)| = 2 + Yₖ₋₁(v) − 2(M₂(v) + … + Mₖ₋₁(v)) − Mₖ(v).

  • The extra neighbours add up to t + 1

    For n ≥ 2 and G of diameter n inside Qₙ, M₂(v) + … + Mₙ(v) = t + 1 for every corner v.

  • L(v) = 2ⁿ⁻¹ − n + M(v)

    For n ≥ 2 and G of diameter n inside Qₙ, the sum of ball excesses at every corner v equals 2ⁿ⁻¹ − n + M(v).

  • For n ≥ 2, excesses are at least 0

    For n ≥ 2, in a subgraph of Qₙ with diameter n, every corner has excess at least 0.

  • The extra distance is never negative

    For n ≥ 1 and G of diameter n inside Qₙ, δ(w) ≥ 0 for every corner w.

  • The weighted extra neighbours are never negative

    In a connected G, M(v) ≥ 0 for every corner v.

  • The excess of a corner, as stated
  • The weighted count of extra neighbours, as stated
  • The edges beyond 2ⁿ, as stated

The bound for every n

In the identity every term on the left is at least 0: each corner has excess at least 0, distances in G are never shorter than in the cube, and extra neighbours are never negative. So (n − 1)t ≥ 2ⁿ − 2n, which is Theorem 1, f(n) ≥ 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉ for every n ≥ 2. For n ≥ 4 this is more than the 1995 formula 2ⁿ − 1 + ⌈(2ⁿ − 1)/(2n − 1)⌉, so that formula is never the true value there.

  • For n ≥ 2, f(n) ≥ 2ⁿ + ⌊(2ⁿ − 2n + n − 2)/(n − 1)⌋

    For every n ≥ 2, f(n) ≥ 2ⁿ + ⌊(2ⁿ − 2n + n − 2)/(n − 1)⌋, the division rounded down. The paper also writes this bound as 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉; no Lean theorem states that the two forms are equal.

    theorem HypercubeChallenge.theorem1_f_lower_bound_nat {n : ℕ} (hn : 2 ≤ n) :
      2 ^ n + (2 ^ n - 2 * n + (n - 2)) / (n - 1) ≤ f n
  • For n ≥ 4, f(n) is more than the 1995 formula

    For every n ≥ 4, f(n) > 2ⁿ − 1 + ⌈(2ⁿ − 1)/(2n − 1)⌉.

    theorem HypercubeChallenge.not_attained_1995 {n : ℕ} (hn : 4 ≤ n) :
      bound1995 n < ↑(f n)
  • For n ≥ 2, (n − 1)t ≥ 2ⁿ − 2n

    For n ≥ 2, every valid subgraph of Qₙ with 2ⁿ + t edges has (n − 1)t ≥ 2ⁿ − 2n.

  • For n ≥ 4, Theorem 1 beats the 1995 formula

    For every n ≥ 4, 2ⁿ − 1 + ⌈(2ⁿ − 1)/(2n − 1)⌉ < 2ⁿ + ⌈(2ⁿ − 2n)/(n − 1)⌉.

  • The 1995 formula, as stated

Valid subgraphs with few edges

To bound f(n) from above it is enough to show one valid subgraph. Lean builds one for every n ≥ 1 by matching each layer of strings with k ones to the next layer along chains, so that every string has a path down to 00…0 and a path up to 11…1; it has 2ⁿ + C(n, ⌊n/2⌋) − 2 edges, which gives f(4) ≤ 20 and f(5) ≤ 40. In Q₆ an explicit subgraph with 81 edges does better than this one's 82. For every corner r, a valid subgraph that saves s edges against the chain construction has at least s corners, other than r and its opposite, with no kept edge one step farther from r or none one step nearer.

  • For n ≥ 1, f(n) ≤ 2ⁿ + C(n, ⌊n/2⌋) − 2

    For every n ≥ 1, the fewest edges of a valid subgraph of Qₙ is at most 2ⁿ + C(n, ⌊n/2⌋) − 2.

    theorem HypercubeChallenge.f_le_construction {n : ℕ} (hn : 1 ≤ n) :
      f n ≤ 2 ^ n + n.choose (n / 2) - 2
  • Saving edges forces blocking corners

    For n ≥ 1, every valid subgraph G of Qₙ and every corner r, |E(G)| + (the number of blocking corners relative to r) ≥ 2ⁿ + C(n, ⌊n/2⌋) − 2.

    theorem HypercubeChallenge.blocking_lower_bound_valid {n : ℕ} (hn : 1 ≤ n) {G : SimpleGraph (CubeVertex n)} [DecidableRel G.Adj] (hV : IsValidSpanningSubgraph n G) (r : CubeVertex n) :
      2 ^ n + n.choose (n / 2) - 2 ≤ edgeCount G + blockingCount G r
  • f(6) ≤ 81

    The fewest edges of a valid subgraph of Q₆ is at most 81.

    theorem HypercubeChallenge.f_six_le_81 :
      f 6 ≤ 81
  • The chain construction is valid

    For every n, the chain construction joins every two corners by a path of at most n edges.

  • The chain construction has 2ⁿ + C(n, ⌊n/2⌋) − 2 edges

    For every n ≥ 1, the chain construction has exactly 2ⁿ + C(n, ⌊n/2⌋) − 2 edges.

  • The number of blocking corners, as stated

Dimensions 2 to 5

Theorem 1 with the chain construction gives f(2) = 4 and f(3) = 9. In Q₄, Theorem 1 gives 19, and a case analysis of how the excess can be spread over the two halves of the cube (strings with an even or odd number of ones) rules out 19 edges, so f(4) = 20. In Q₅ a similar analysis rules out 38 edges, so 39 ≤ f(5) ≤ 40.

  • f(4) = 20

    The fewest edges of a valid subgraph of Q₄ is 20.

    theorem HypercubeChallenge.f_four_eq_twenty :
      f 4 = 20
  • 39 ≤ f(5) ≤ 40

    Every valid subgraph of Q₅ has at least 39 edges, and one has 40.

    theorem HypercubeChallenge.f_five_bounds :
      39 ≤ f 5 ∧ f 5 ≤ 40
  • No valid subgraph of Q₅ has 38 edges

    Every valid subgraph of Q₅ has a number of edges other than 38.

  • No valid subgraph of Q₄ has 19 edges

    Every valid subgraph of Q₄ has a number of edges other than 19.

Thin layers and the coefficient 3/2

Every layer around every corner has at most 2 + 2t corners. If t is small, the balls around a corner in G therefore grow far more slowly than the balls of the cube, and each corner sees a large extra distance. A bound on the size of cube balls of small radius, from the sum of the squares (2|u| − n)² where |u| is the number of ones in u, turns this into a lower bound on the left side of the identity. Comparing the two sides shows that, for every rational ε > 0, (f(n) − 2ⁿ)(n − 1) ≥ (3/2 − ε)·2ⁿ for all large enough n, where Theorem 1 gives the coefficient 1 and the 1995 formula less than 1/2.

  • For every ε > 0, f(n) − 2ⁿ is eventually at least (3/2 − ε)·2ⁿ/(n − 1)

    For every ε > 0 there is N such that (f(n) − 2ⁿ)(n − 1) ≥ (3/2 − ε)·2ⁿ for every n ≥ N.

    theorem HypercubeChallenge.theorem5_asymptotic_three_halves (ε : ℚ) (a.0 : 0 < ε) :
      ∃ N, ∀ (n : ℕ), N ≤ n → (3 / 2 - ε) * 2 ^ n ≤ (↑(f n) - 2 ^ n) * (↑n - 1)
  • The ψ(w) add up to 2ⁿ((n − 1)t − (2ⁿ − 2n))

    For n ≥ 2 and every valid subgraph G of Qₙ, the sum of ψ(w) over all corners w is 2ⁿ((n − 1)t − (2ⁿ − 2n)), where t is the number of edges of G minus 2ⁿ.

    theorem HypercubeChallenge.sum_psi {n : ℕ} {G : SimpleGraph (CubeVertex n)} (hn : 2 ≤ n) (hV : IsValidSpanningSubgraph n G) :
      ∑ w, psi G w = 2 ^ n * ((↑n - 1) * edgeExcess G - (2 ^ n - 2 * ↑n))
  • The thin-layer inequality

    For n ≥ 2 and every valid G, 2t·Δ(n, 2 + 2t) ≤ 2ⁿ((n − 1)t − (2ⁿ − 2n)).

  • Every layer has at most 2 + 2t corners

    For n ≥ 2, a valid G and k ≥ 1, every layer k around every corner has at most 2 + 2t corners.

  • Thin layers force a large extra distance

    For n ≥ 1, if G has diameter n inside Qₙ and every layer k ≥ 1 around w has at most s corners, then δ(w) ≥ Δ(n, s).

  • Small cube balls are small

    For 2j ≤ n, (n − 2j)²·B(n, j) ≤ n·2ⁿ.

  • The term ψ(w) of a corner, as stated

Certificates for dimensions 6 to 32

Write ψ(w) for the term of corner w in the identity, so the ψ(w) add up to 2ⁿ((n − 1)t − (2ⁿ − 2n)). Pairing w with its opposite corner caps the extra neighbours of w, and this gives, for every possible excess x of w, a floor on ψ(w) that grows with x. A certificate is a pair of numbers t₃ and P for which these floors, added up, contradict the identity whenever t ≤ t₃; Lean evaluates each one by computation, giving f(n) ≥ 2ⁿ + t₃ + 1. This proves f(6) ≥ 76, f(8) ≥ 294 and the bounds for n = 9 to 32; a separate choice of floors in Q₇ proves f(7) ≥ 150.

  • The identity for a corner and its opposite, halved

    For n ≥ 2, a valid subgraph G of Qₙ and a corner w with opposite corner w̄, M(w) + M(w̄) plus the sum over all corners v of x(v)·(η(w, v)/2) equals μ. The halving is division of whole numbers.

    theorem HypercubeChallenge.lemma20_antipodal_identity_div2 {n : ℕ} (hn : 2 ≤ n) {G : SimpleGraph (CubeVertex n)} (hV : IsValidSpanningSubgraph n G) (w : CubeVertex n) :
      weightedExtra G w + weightedExtra G (antipode w) + ∑ v, excess G v * (antipodalDetour G w v / 2) = meanPsi n G
  • A certificate gives f(n) ≥ 2ⁿ + t₃ + 1

    For all n, t₃ and P, if the certificate check for n, t₃ and P is true, then f(n) ≥ 2ⁿ + t₃ + 1.

    theorem HypercubeChallenge.theorem14_from_cert (n : ℕ) (t3 : ℕ) (P : ℤ) (hcert : capCertOk n t3 P = true) :
      2 ^ n + t3 + 1 ≤ f n
  • f(6) ≥ 76

    Every valid subgraph of Q₆ has at least 76 edges.

    theorem HypercubeChallenge.f_six_ge_76 :
      76 ≤ f 6
  • f(7) ≥ 150

    Every valid subgraph of Q₇ has at least 150 edges.

    theorem HypercubeChallenge.f_seven_ge_150 :
      150 ≤ f 7
  • f(8) ≥ 294

    Every valid subgraph of Q₈ has at least 294 edges.

    theorem HypercubeChallenge.f_eight_ge_294 :
      294 ≤ f 8
  • Lower bounds on f(n) for n = 17 to 32

    f(17) ≥ 140,128, f(18) ≥ 279,210, f(19) ≥ 556,449, f(20) ≥ 1,110,320, f(21) ≥ 2,214,490, f(22) ≥ 4,418,155, f(23) ≥ 8,816,922, f(24) ≥ 17,599,972, f(25) ≥ 35,138,325, f(26) ≥ 70,152,107, f(27) ≥ 140,081,100, f(28) ≥ 279,786,071, f(29) ≥ 558,766,740, f(30) ≥ 1,116,183,007, f(31) ≥ 2,229,577,178 and f(32) ≥ 4,454,492,243.

  • The identity for a corner and its opposite

    For n ≥ 2 and a valid G, 2(M(w) + M(w̄)) plus the sum over v of x(v)·η(w, v) equals 2μ.

  • The weighted extra neighbours of a corner are at most μ

    For n ≥ 2 and a valid G, 0 ≤ M(w) ≤ μ and M(w) + M(w̄) ≤ μ at every corner w.

  • ψ(w) is at least the capped floor

    For n ≥ 4, a valid G, a layer assignment κ and α ≥ 0 whose weights 2x(w) + α·(uₖ₊₂ − uₖ) are never negative, ψ(w) is at least the capped floor at the excess of w and t.

  • The average of ψ, as stated
  • The detour through a corner and its opposite, as stated
  • Checking a certificate
Short

Watch on YouTube ↗