AFTD Auto-Formalizing Theoretical Domains

davenport_box_three_even_sequence_card

theoremverified

The sequence T(m) (even case) has length 16m^3 - 16m^2 + 8m - 1.

Statement

theorem davenport_box_three_even_sequence_card (m : ℕ) (hm : 2 ≤ m) :
    Multiset.card (davenport_box_three_even_sequence m) = 16 * m ^ 3 - 16 * m ^ 2 + 8 * m - 1
Source
Step of the proof of Theorem 3 of arXiv:2610.16562 (even m): the length of T(m).
Verified
19 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • davenport_box_three_even_sequenceThe sequence T(m) for even m: (-m,-m,-m) repeated 4m^3-6m^2+4m-1 times, (-m,m-1,m) repeated 4m^3-4m^2+2m times, (m,-(m-1),m-1) repeated…
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
Used by 1

The proof, explained

The proof computes the cardinality of the multiset $T(m)$ by unfolding its definition as the sum of four replicated multisets and applying `Multiset.card_add` and `Multiset.card_replicate`. Because subtraction in $\mathbb{N}$ truncates at zero, it establishes six ordering inequalities from $m \ge 2$ ensuring no subtraction underflows. Finally, `zify` casts the identity to $\mathbb{Z}$, where it is verified by polynomial ring normalization.

  1. The multiset cardinality reduces to the natural number sum $(4m^3 - 6m^2 + 4m - 1) + (4m^3 - 4m^2 + 2m) + (4m^3 - 2m^2 + m) + (4m^3 - 4m^2 + m) = 16m^3 - 16m^2 + 8m - 1$.

    Unfolding the definition of `davenport_box_three_even_sequence`, the multiset is expressed as the sum of four replicated vectors of lengths $4m^3 - 6m^2 + 4m - 1$, $4m^3 - 4m^2 + 2m$, $4m^3 - 2m^2 + m$, and $4m^3 - 4m^2 + m$. Simplifying with `Multiset.card_add` and `Multiset.card_replicate` expresses the total cardinality as the sum of these four counts.

    lines 3–4

    uses Multiset.card_add, Multiset.card_replicate

      dsimp [davenport_box_three_even_sequence]
      simp only [Multiset.card_add, Multiset.card_replicate]
  2. The ordering inequalities $6m^2 \le 4m^3$, $1 \le 4m^3 - 6m^2 + 4m$, $4m^2 \le 4m^3$, $2m^2 \le 4m^3$, $16m^2 \le 16m^3$, and $1 \le 16m^3 - 16m^2 + 8m$ all hold.

    To ensure that the natural number subtractions in the expression do not truncate at zero, we establish bounds on the terms from the assumption $m \ge 2$. The inequalities $h_1, h_3, h_4, h_5$ are proved by nonlinear arithmetic (`nlinarith`), and the inequalities $h_2, h_6$ are closed by integer arithmetic (`omega`).

    lines 5–10

      have h1 : 6 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h2 : 1 ≤ 4 * m ^ 3 - 6 * m ^ 2 + 4 * m := by omega
      have h3 : 4 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h4 : 2 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h5 : 16 * m ^ 2 ≤ 16 * m ^ 3 := by nlinarith
      have h6 : 1 ≤ 16 * m ^ 3 - 16 * m ^ 2 + 8 * m := by omega
  3. The multiset cardinality equals $16m^3 - 16m^2 + 8m - 1$.

    Using `zify` along with the bounds $h_1$ through $h_6$, each truncated subtraction in $\mathbb{N}$ is converted into standard subtraction in $\mathbb{Z}$. The resulting polynomial identity in $\mathbb{Z}$ is then verified by commutative ring normalization (`ring`).

    lines 11–12

      zify [h1, h2, h3, h4, h5, h6]
      ring
Multiset.card_add
The cardinality of the sum (disjoint union) of two multisets is the sum of their cardinalities.
Multiset.card_replicate
The cardinality of a multiset formed by replicating an element $n$ times is $n$.

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

theorem davenport_box_three_even_sequence_card (m : ℕ) (hm : 2 ≤ m) :    Multiset.card (davenport_box_three_even_sequence m) = 16 * m ^ 3 - 16 * m ^ 2 + 8 * m - 1 := by  dsimp [davenport_box_three_even_sequence]  simp only [Multiset.card_add, Multiset.card_replicate]  have h1 : 6 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h2 : 1 ≤ 4 * m ^ 3 - 6 * m ^ 2 + 4 * m := by omega  have h3 : 4 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h4 : 2 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h5 : 16 * m ^ 2 ≤ 16 * m ^ 3 := by nlinarith  have h6 : 1 ≤ 16 * m ^ 3 - 16 * m ^ 2 + 8 * m := by omega  zify [h1, h2, h3, h4, h5, h6]  ring
See it in the graphDiscuss this resultChallenge it