AFTD Auto-Formalizing Theoretical Domains

drf_two_resources_projection_inequality

theoremverifiedformalization

For all real numbers x, y in [0, 1] with x + y >= 1, max(x, y) <= ((1 + Real.sqrt 3) / 4) * (x^2 + (1 - x)^2 + (1 - y)^2 + y^2).

Statement

theorem drf_two_resources_projection_inequality (x y : ℝ) (hx0 : 0 ≤ x) (hx1 : x ≤ 1) (hy0 : 0 ≤ y) (hy1 : y ≤ 1) (hsum : 1 ≤ x + y) : max x y ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2)
Formalizes
arXiv:2611.07905 Lemma 14
Verified
08 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

Read back from the Lean

For any real numbers $x$ and $y$, if $0 \le x$, $x \le 1$, $0 \le y$, $y \le 1$, and $1 \le x + y$, then $\max(x, y) \le \frac{1 + \sqrt{3}}{4} (x^2 + (1 - x)^2 + (1 - y)^2 + y^2)$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

To bound max(x, y), the proof bounds x and y individually by the same quadratic expression. Each bound is proved by completing the square: subtracting x (respectively y) from the expression yields ((1 + √3) / 2) times a sum of two squares, specifically (x - √3 / 2)² + (y - 1 / 2)² (respectively (x - 1 / 2)² + (y - √3 / 2)²). Since a positive multiple of a sum of squares is non-negative, both x and y are bounded by the expression, and taking their maximum completes the proof.

  1. (√3)² = 3

    By definition of the real square root, (√3)² = 3 since 0 ≤ 3.

    line 3

    uses Real.sq_sqrt

      have hs : (Real.sqrt 3) ^ 2 = 3 := Real.sq_sqrt (by norm_num)
  2. x ≤ ((1 + √3) / 4) * (x² + (1 - x)² + (1 - y)² + y²)

    The difference between the right-hand side and x can be rewritten by completing the square as ((1 + √3) / 2) * ((x - √3 / 2)² + (y - 1 / 2)²), verified by expanding the polynomials and using (√3)² = 3. Since squares are non-negative and (1 + √3) / 2 > 0, this difference is non-negative, which implies the upper bound for x.

    lines 4–10

      have hx : x ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) := by
        have h_id : (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) - x =
            (1 + Real.sqrt 3) / 2 * ((x - Real.sqrt 3 / 2) ^ 2 + (y - 1 / 2) ^ 2) := by
          linear_combination (x / 2 - (1 + Real.sqrt 3) / 8) * hs
        have h_pos : 0 ≤ (1 + Real.sqrt 3) / 2 * ((x - Real.sqrt 3 / 2) ^ 2 + (y - 1 / 2) ^ 2) := by
          positivity
        linarith
  3. y ≤ ((1 + √3) / 4) * (x² + (1 - x)² + (1 - y)² + y²)

    Symmetrically, the difference between the right-hand side and y rewrites as ((1 + √3) / 2) * ((x - 1 / 2)² + (y - √3 / 2)²). Being a positive multiple of a sum of squares, this difference is non-negative, which yields the upper bound for y.

    lines 11–17

      have hy : y ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) := by
        have h_id : (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) - y =
            (1 + Real.sqrt 3) / 2 * ((x - 1 / 2) ^ 2 + (y - Real.sqrt 3 / 2) ^ 2) := by
          linear_combination (y / 2 - (1 + Real.sqrt 3) / 8) * hs
        have h_pos : 0 ≤ (1 + Real.sqrt 3) / 2 * ((x - 1 / 2) ^ 2 + (y - Real.sqrt 3 / 2) ^ 2) := by
          positivity
        linarith
  4. max(x, y) ≤ ((1 + √3) / 4) * (x² + (1 - x)² + (1 - y)² + y²)

    Since both x and y are bounded above by the quadratic expression, their maximum is also bounded above by it.

    line 18

    uses max_le

      exact max_le hx hy
Real.sq_sqrt
For any non-negative real number x, the square of its square root is x.
max_le
If a ≤ c and b ≤ c, then max(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

/-- Geometric inequality bounding congestion by projected resource loads for two resources (Lemma 14). -/theorem drf_two_resources_projection_inequality (x y : ℝ) (hx0 : 0 ≤ x) (hx1 : x ≤ 1) (hy0 : 0 ≤ y) (hy1 : y ≤ 1) (hsum : 1 ≤ x + y) : max x y ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) := by  have hs : (Real.sqrt 3) ^ 2 = 3 := Real.sq_sqrt (by norm_num)  have hx : x ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) := by    have h_id : (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) - x =        (1 + Real.sqrt 3) / 2 * ((x - Real.sqrt 3 / 2) ^ 2 + (y - 1 / 2) ^ 2) := by      linear_combination (x / 2 - (1 + Real.sqrt 3) / 8) * hs    have h_pos : 0 ≤ (1 + Real.sqrt 3) / 2 * ((x - Real.sqrt 3 / 2) ^ 2 + (y - 1 / 2) ^ 2) := by      positivity    linarith  have hy : y ≤ (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) := by    have h_id : (1 + Real.sqrt 3) / 4 * (x ^ 2 + (1 - x) ^ 2 + (1 - y) ^ 2 + y ^ 2) - y =        (1 + Real.sqrt 3) / 2 * ((x - 1 / 2) ^ 2 + (y - Real.sqrt 3 / 2) ^ 2) := by      linear_combination (y / 2 - (1 + Real.sqrt 3) / 8) * hs    have h_pos : 0 ≤ (1 + Real.sqrt 3) / 2 * ((x - 1 / 2) ^ 2 + (y - Real.sqrt 3 / 2) ^ 2) := by      positivity    linarith  exact max_le hx hy
See it in the graphDiscuss this resultChallenge it