AFTD Auto-Formalizing Theoretical Domains

op861_crossing_estimate_arithmetic

theoremverified

For real n, k, p and t, if n is at least three, 2k=n+1, t+p=k squared, and 3nt is at most 3k cubed plus n times (nk minus k squared), then n squared is at most 24p.

Statement

theorem op861_crossing_estimate_arithmetic (n k p t : ℝ)
    (hn : 3 ≤ n) (hk : 2 * k = n + 1)
    (hcount : t + p = k^2)
    (hfourier : 3*n*t ≤ 3*k^3 + n*(n*k-k^2)) :
    n^2 ≤ 24*p
Source
The arithmetic reduction used for op861_ternary_crossing_pairs_dense.
Verified
18 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1
  • op861_ternary_crossing_pairs_denseFor every positive d and every subset S of the d-dimensional ternary vector space with twice its size equal to 3^d+1, there are at least…

The proof, explained

The proof eliminates k by substituting k = (n + 1) / 2. Multiplying the relation t + p = k² by 3n and comparing it with the Fourier inequality yields 24np ≥ (n² - 1)(n + 3). Because (n² - 1)(n + 3) - n³ = (n - 1)² ≥ 0, we obtain n³ ≤ 24np, and dividing by the strictly positive factor n concludes that n² ≤ 24p.

  1. n > 0 and k = (n + 1) / 2, eliminating k from all subsequent relations

    Since n ≥ 3, n is strictly positive. Solving 2k = n + 1 yields k = (n + 1) / 2, which is substituted for k throughout the goal and hypotheses.

    lines 9–11

      have hnpos : 0 < n := by linarith
      have hk' : k = (n+1)/2 := by linarith
      subst k
  2. n * (t + p) = n * ((n + 1) / 2)²

    Multiplying both sides of the relation t + p = k² by n, using the substituted value of k.

    line 12

      have hcount' : n * (t+p) = n * ((n+1)/2)^2 := by rw [hcount]
  3. n³ ≤ (n² - 1) * (n + 3)

    The difference (n² - 1)(n + 3) - n³ expands to (n - 1)², which is non-negative by `sq_nonneg (n - 1)`.

    line 13

    uses sq_nonneg

      have hpoly : n^3 ≤ (n^2-1)*(n+3) := by nlinarith [sq_nonneg (n-1)]
  4. n³ ≤ 24 * n * p

    Substituting t = ((n+1)/2)² - p into the Fourier inequality 3nt ≤ 3k³ + n(nk - k²) gives 24np ≥ (n² - 1)(n + 3); combining this with the previous bound (n² - 1)(n + 3) ≥ n³ establishes n³ ≤ 24np.

    line 14

      have hn3 : n^3 ≤ 24*n*p := by nlinarith [hcount', hfourier, hpoly]
  5. n² ≤ 24 * p

    Using `mul_le_mul_iff_left₀` with n > 0 reduces the target n² ≤ 24p to n² * n ≤ 24p * n, which follows immediately from n³ ≤ 24np.

    lines 15–16

    uses mul_le_mul_iff_left₀

      apply (mul_le_mul_iff_left₀ hnpos).mp
      nlinarith [hn3]
sq_nonneg
the square of any real number (or element in an ordered semiring) is non-negative: 0 ≤ a²
mul_le_mul_iff_left₀
for a strictly positive element a > 0, multiplying on the right by a reflects and preserves non-strict inequality: b * a ≤ c * a ↔ b ≤ c

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

open scoped BigOperatorsset_option maxHeartbeats 1000000theorem op861_crossing_estimate_arithmetic (n k p t : ℝ)    (hn : 3 ≤ n) (hk : 2 * k = n + 1)    (hcount : t + p = k^2)    (hfourier : 3*n*t ≤ 3*k^3 + n*(n*k-k^2)) :    n^2 ≤ 24*p := by  have hnpos : 0 < n := by linarith  have hk' : k = (n+1)/2 := by linarith  subst k  have hcount' : n * (t+p) = n * ((n+1)/2)^2 := by rw [hcount]  have hpoly : n^3 ≤ (n^2-1)*(n+3) := by nlinarith [sq_nonneg (n-1)]  have hn3 : n^3 ≤ 24*n*p := by nlinarith [hcount', hfourier, hpoly]  apply (mul_le_mul_iff_left₀ hnpos).mp  nlinarith [hn3]
See it in the graphDiscuss this resultChallenge it