Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Shao's Lemma 2.2: the asymmetric averaging inequality

Proved
ShaoThreeUnits.averaging_asymmetric

by aarontcao · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

additive-combinatoricsnumber-theory

Let nnn be even with n≥10n \ge 10n≥10 and let aaa, bbb, ccc each be decreasing sequences of nnn reals in [0,1][0,1][0,1], with averages AAA, BBB and CCC. Suppose that for every triple of indices i,j,ki, j, ki,j,k with i+j+k≥ni + j + k \ge ni+j+k≥n we have

aibj+bjck+ckai≤58(ai+bj+ck).a_i b_j + b_j c_k + c_k a_i \le \tfrac{5}{8}(a_i + b_j + c_k).ai​bj​+bj​ck​+ck​ai​≤85​(ai​+bj​+ck​).

Then AB+BC+CA≤58(A+B+C)AB + BC + CA \le \frac{5}{8}(A + B + C)AB+BC+CA≤85​(A+B+C).

This is the three-sequence version of Lemma 2.1, and it is what lets the induction split a function into three different fibers rather than three copies of one.

Preamble
import Mathlib
open scoped Classical
Formal statement
namespace ShaoThreeUnits

theorem averaging_asymmetric (n : ℕ) (hn : 10 ≤ n) (hev : Even n)
    (a b c : Fin n → ℝ) (ha : Antitone a) (hb : Antitone b) (hc : Antitone c)
    (h0 : ∀ i, 0 ≤ a i ∧ 0 ≤ b i ∧ 0 ≤ c i)
    (h1 : ∀ i, a i ≤ 1 ∧ b i ≤ 1 ∧ c i ≤ 1)
    (htriple : ∀ i j k : Fin n, n ≤ (i : ℕ) + (j : ℕ) + (k : ℕ) →
      a i * b j + b j * c k + c k * a i ≤ 5 / 8 * (a i + b j + c k))
    (A B C : ℝ) (hA : A = (∑ i, a i) / n) (hB : B = (∑ i, b i) / n)
    (hC : C = (∑ i, c i) / n) :
    A * B + B * C + C * A ≤ 5 / 8 * (A + B + C) := by sorry

end ShaoThreeUnits
Source
Xuancheng Shao, "A density version of the Vinogradov three primes theorem", Duke Math. J. 163 (2014) 489-512, arXiv:1206.6139v2, https://arxiv.org/abs/1206.6139, Lemma 2.2
Read-back

What the Lean code literally says, in plain math · claude-opus-5

READ-BACK

Fix an even natural number n with n at least 10. Let a, b, c be real sequences indexed by 0 through n-1. Each is non-increasing in the index, and each takes values in [0,1]. Assume that for every index triple (i,j,k) with i+j+k at least n, the quantity a_i b_j + b_j c_k + c_k a_i is at most (5/8)(a_i + b_j + c_k). Let A, B, C be the arithmetic means of a, b, c over the whole index range. The conclusion is AB + BC + CA at most (5/8)(A + B + C). The constant 5/8 is the same in hypothesis and conclusion, and both inequalities are non-strict. The pointwise hypothesis binds only triples of index sum at least n. Indices stop at n-1, so a triple such as (n-1, 1, 0) has sum exactly n and is constrained. The hypothesis therefore couples the last entry of one sequence to near-first entries of the other two, not just late entries of all three.

QUANTIFIER ORDER n, universal, outermost. hn, then hev, constraints on n. a, b, c, universal, functions from the index set to the reals. ha, hb, hc, then h0, h1, pointwise constraints on those functions. htriple, with i, j, k universally quantified inside it, each over the full index set, guarded by n at most i+j+k. A, B, C, universal reals, pinned by hA, hB, hC to the three averages, so they carry no freedom. Nothing is existentially quantified anywhere in the statement.

HYPOTHESES 10 at most n: nothing is asserted for n at most 9, and n is nonzero, so the division by n is by a nonzero real. Even n: nothing is asserted for odd n. Antitone (three times): rules out any increase at any step, and allows equal consecutive values. h0 and h1: confine every value to [0,1], ruling out negative entries and entries above 1. htriple: one inequality family. It rules out a = b = c = 1, where the left side is 3 and the right side is 15/8.

DEGENERATE CASES a = b = c = 0 satisfies every hypothesis, and the conclusion reads 0 at most 0. The constant sequences a = b = c = 5/8 satisfy htriple with equality, and make the conclusion an equality. So the hypotheses are satisfiable, the statement is not vacuous, and the constant is attained. The index set is never empty, since n is at least 10. The constrained triple family is never empty, since (n-1, n-1, n-1) has sum 3n-3.

UNREADABLE Nothing. Casts read as follows: the index coercion gives the numeric value 0 through n-1, the denominator n is the real cast, and 5/8 is real division equal to 0.625, not truncated natural division.

Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by aarontcao · Sep 17, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me