moore_bound_three_formula
For any integer d ≥ 1, the Moore bound for diameter 3 evaluates to m(d, 3) = d^3 - d^2 + d + 1.
Statement
theorem moore_bound_three_formula (d : ℕ) (hd : 1 ≤ d) : moore_bound d 3 = d ^ 3 - d ^ 2 + d + 1- Source
- arXiv:2611.26037 Sec. 1
- Verified
- 22 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 3
- moore_boundThe Moore bound m(d, k) is defined as 1 + d * ∑_{i=0}^{k-1} (d-1)^i, representing the maximum possible number of vertices in a graph of…
- TotalPreorderA total preorder: a preorder where
≤is total (complete). This is weaker thanLinearOrder— it does NOT require antisymmetry or… - LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder.
Read back from the Lean
For every natural number $d$ satisfying $1 \le d$, $\operatorname{moore\_bound}(d, 3) = d^3 - d^2 + d + 1$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
We write d = 1 + e for e ≥ 0 to eliminate the condition d ≥ 1. Expanding the definition of the Moore bound for diameter 3 reduces the left-hand side to 1 + (1 + e)(1 + e + e^2). Because subtraction on natural numbers truncates, we prove (1 + e)^2 ≤ (1 + e)^3 to rewrite (1 + e)^3 - (1 + e)^2 as (1 + e)^2 * e. Substituting this identity eliminates subtraction, allowing both sides to be confirmed equal by ring arithmetic.
We can write d = 1 + e for some natural number e.
Since 1 ≤ d, Nat.exists_eq_add_of_le provides a natural number e such that d = 1 + e. The obtain tactic substitutes 1 + e for d throughout the goal.
uses
Nat.exists_eq_add_of_leobtain ⟨e, rfl⟩ := Nat.exists_eq_add_of_le hd
The Moore bound for degree 1 + e and diameter 3 evaluates to 1 + (1 + e) * (1 + e + e^2).
Unfolding the definition of moore_bound expresses the left-hand side as 1 + (1 + e) * ∑ i ∈ range 3, (1 + e - 1)^i. Applying Finset.sum_range_succ and Finset.sum_range_zero unrolls this sum into three terms (for i = 0, 1, 2), and norm_num simplifies (1 + e - 1) to e and computes the powers, leaving 1 + (1 + e) * (1 + e + e^2).
uses
Finset.sum_range_succ,Finset.sum_range_zerosimp only [moore_bound, Finset.sum_range_succ, Finset.sum_range_zero] norm_num
(1 + e)^2 ≤ (1 + e)^3.
Since e ≥ 0 by Nat.zero_le, we have 1 + e ≥ 1. Non-linear arithmetic (nlinarith) uses this to conclude that (1 + e)^2 ≤ (1 + e)^3.
uses
Nat.zero_lehave hle : (1 + e) ^ 2 ≤ (1 + e) ^ 3 := by nlinarith [Nat.zero_le e]
(1 + e)^3 - (1 + e)^2 = (1 + e)^2 * e.
Because natural number subtraction is truncated, Nat.sub_eq_iff_eq_add together with the inequality (1 + e)^2 ≤ (1 + e)^3 turns this subtraction into the equivalent addition (1 + e)^3 = (1 + e)^2 * e + (1 + e)^2, which is an identity in any commutative semiring verified by ring.
uses
Nat.sub_eq_iff_eq_addhave h : (1 + e) ^ 3 - (1 + e) ^ 2 = (1 + e) ^ 2 * e := by rw [Nat.sub_eq_iff_eq_add hle] ring
The Moore bound identity holds: 1 + (1 + e) * (1 + e + e^2) = (1 + e)^3 - (1 + e)^2 + (1 + e) + 1.
Rewriting with the identity h replaces (1 + e)^3 - (1 + e)^2 by (1 + e)^2 * e, eliminating the subtraction. Both sides are now polynomials in e, and the ring tactic confirms they are equal.
rw [h] ring
Nat.exists_eq_add_of_le- If m ≤ n for natural numbers m and n, there exists a natural number k such that n = m + k.
Finset.sum_range_succ- The sum of a function over {0, ..., n} equals the sum over {0, ..., n - 1} plus the term at index n.
Finset.sum_range_zero- The sum of any function over the empty range (range 0) is 0.
Nat.zero_le- Every natural number is greater than or equal to zero.
Nat.sub_eq_iff_eq_add- For natural numbers with b ≤ a, a - b = c if and only if a = c + b.
- In Lean, subtraction on natural numbers truncates at zero (a - b = 0 when a < b), so standard ring-algebra tactics cannot operate through subtractions directly. Lines 6–9 explicitly establish (1 + e)^2 ≤ (1 + e)^3 to convert the subtraction (1 + e)^3 - (1 + e)^2 into an addition, an algebraic formality with no counterpart in paper mathematics where d ≥ 1 is assumed.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- Algebraic expansion of the Moore bound m(d, 3) = d^3 - d^2 + d + 1 for d >= 1. -/theorem moore_bound_three_formula (d : ℕ) (hd : 1 ≤ d) : moore_bound d 3 = d ^ 3 - d ^ 2 + d + 1 := by obtain ⟨e, rfl⟩ := Nat.exists_eq_add_of_le hd simp only [moore_bound, Finset.sum_range_succ, Finset.sum_range_zero] norm_num have hle : (1 + e) ^ 2 ≤ (1 + e) ^ 3 := by nlinarith [Nat.zero_le e] have h : (1 + e) ^ 3 - (1 + e) ^ 2 = (1 + e) ^ 2 * e := by rw [Nat.sub_eq_iff_eq_add hle] ring rw [h] ring