AFTD Auto-Formalizing Theoretical Domains

davenport_box_three_odd_sequence_card

theoremverified

The sequence T(m) (odd case) has length 16m^3 - 16m^2 + 10m - 2.

Statement

theorem davenport_box_three_odd_sequence_card (m : ℕ) (hm : 2 ≤ m) :
    Multiset.card (davenport_box_three_odd_sequence m) = 16 * m ^ 3 - 16 * m ^ 2 + 10 * m - 2
Source
Step of the proof of Theorem 3 of arXiv:2610.16562 (odd m): the length of T(m).
Verified
19 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3
  • davenport_box_three_odd_sequenceThe sequence T(m) for odd m: (-m,-m,-m) repeated 4m^3-8m^2+5m-2 times, (-m,m-1,m) repeated 4m^3-2m^2+2m times, (m,-m,m-2) 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 multiset cardinality of the sequence is evaluated by unfolding its definition into four replicated multisets and applying the additivity of multiset cardinality. Because natural-number subtraction truncates at zero, auxiliary inequalities are verified using m ≥ 2 to ensure that all subtractions in the formula do not underflow. The identity is then cast into ℤ and closed by polynomial ring arithmetic.

  1. The multiset cardinality reduces to the sum of the lengths of the four replicated components in ℕ: (4m³ - 8m² + 5m - 2) + (4m³ - 2m² + 2m) + (4m³ - 2m² + m) + (4m³ - 4m² + 2m) = 16m³ - 16m² + 10m - 2.

    Unfolding the definition of davenport_box_three_odd_sequence shows that the sequence is the sum of four replicated multisets in ℤ³. Rewriting with Multiset.card_add and Multiset.card_replicate reduces the cardinality of this sum to the addition of the four multiplicities as natural numbers.

    lines 3–4

    uses Multiset.card_add, Multiset.card_replicate

      dsimp [davenport_box_three_odd_sequence]
      simp only [Multiset.card_add, Multiset.card_replicate]
  2. All natural-number subtractions in the expression are well-ordered: 8m² ≤ 4m³, 2 ≤ 4m³ - 8m² + 5m, 2m² ≤ 4m³, 4m² ≤ 4m³, 16m² ≤ 16m³, and 2 ≤ 16m³ - 16m² + 10m.

    Because m ≥ 2, the cubic terms dominate the lower-degree terms. Nonlinear arithmetic (nlinarith) directly verifies the four inequalities without subtractions. For the remaining two inequalities (h2 and h6), casting intermediate expressions to ℤ via zify enables nlinarith to establish that neither subtraction truncates at zero.

    lines 5–14

      have h1 : 8 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h2 : 2 ≤ 4 * m ^ 3 - 8 * m ^ 2 + 5 * m := by
        zify [h1]
        nlinarith
      have h3 : 2 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h4 : 4 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith
      have h5 : 16 * m ^ 2 ≤ 16 * m ^ 3 := by nlinarith
      have h6 : 2 ≤ 16 * m ^ 3 - 16 * m ^ 2 + 10 * m := by
        zify [h5]
        nlinarith
  3. The arithmetic identity holds, completing the evaluation of the multiset cardinality.

    With the six inequalities guaranteeing that no subtraction in ℕ truncates, zify lifts the equality from ℕ to the ring of integers ℤ. The resulting polynomial identity in ℤ is verified by polynomial expansion and collecting terms (ring).

    lines 15–16

      zify [h1, h2, h3, h4, h5, h6]
      ring
Multiset.card_add
The cardinality of the sum of two multisets is the sum of their cardinalities: |s + t| = |s| + |t|.
Multiset.card_replicate
The cardinality of a multiset consisting of n copies of an element 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_odd_sequence_card (m : ℕ) (hm : 2 ≤ m) :    Multiset.card (davenport_box_three_odd_sequence m) = 16 * m ^ 3 - 16 * m ^ 2 + 10 * m - 2 := by  dsimp [davenport_box_three_odd_sequence]  simp only [Multiset.card_add, Multiset.card_replicate]  have h1 : 8 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h2 : 2 ≤ 4 * m ^ 3 - 8 * m ^ 2 + 5 * m := by    zify [h1]    nlinarith  have h3 : 2 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h4 : 4 * m ^ 2 ≤ 4 * m ^ 3 := by nlinarith  have h5 : 16 * m ^ 2 ≤ 16 * m ^ 3 := by nlinarith  have h6 : 2 ≤ 16 * m ^ 3 - 16 * m ^ 2 + 10 * m := by    zify [h5]    nlinarith  zify [h1, h2, h3, h4, h5, h6]  ring
See it in the graphDiscuss this resultChallenge it