op861_crossing_estimate_arithmetic
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.
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.
have hnpos : 0 < n := by linarith have hk' : k = (n+1)/2 := by linarith subst k
n * (t + p) = n * ((n + 1) / 2)²
Multiplying both sides of the relation t + p = k² by n, using the substituted value of k.
have hcount' : n * (t+p) = n * ((n+1)/2)^2 := by rw [hcount]
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)`.
uses
sq_nonneghave hpoly : n^3 ≤ (n^2-1)*(n+3) := by nlinarith [sq_nonneg (n-1)]
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.
have hn3 : n^3 ≤ 24*n*p := by nlinarith [hcount', hfourier, hpoly]
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.
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
- The non-linear arithmetic tactic `nlinarith` at line 14 automates the elimination of t and the algebraic identity 3n((n+1)/2)² - [3((n+1)/2)³ + n(n(n+1)/2 - ((n+1)/2)²)] = (n²-1)(n+3)/8.
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.
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]