AFTD Auto-Formalizing Theoretical Domains

tournament_degree_prod_le_regular

theoremverified

For n ≥ 2 and any real numbers x_1, ..., x_n ≥ 1 summing to n^2, the product ∏_{i=1}^n (x_i^2 + n) is at most (n(n+1))^n.

Statement

theorem tournament_degree_prod_le_regular (n : ℕ) (hn : 2 ≤ n) (x : Fin n → ℝ) (hx_pos : ∀ i, 1 ≤ x i) (hx_sum : ∑ i : Fin n, x i = (n : ℝ) ^ 2) : ∏ i : Fin n, (x i ^ 2 + (n : ℝ)) ≤ ((n : ℝ) * ((n : ℝ) + 1)) ^ n
Source
arXiv:2610.25886 Proposition 4.1 proof
Verified
22 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4

Read back from the Lean

For every natural number $n$ such that $2 \le n$, and for every function $x : \text{Fin } n \to \mathbb{R}$, if $1 \le x(i)$ for all $i \in \text{Fin } n$ and $\sum_{i \in \text{Fin } n} x(i) = n^2$, then $\prod_{i \in \text{Fin } n} (x(i)^2 + n) \le (n(n + 1))^n$.

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

The theorem is proved by taking logarithms and applying a tangent-line upper bound. An auxiliary lemma shows that for any m ≥ 2 and x ≥ 1, ln(x² + m) ≤ ln(m(m + 1)) + 2(x - m)/(m + 1), by demonstrating that the function φ(y) = ln(y² + m) - 2y/(m + 1) increases on [1, m] and decreases on [m, ∞), reaching its maximum at y = m. Setting m = n and summing this inequality over all x_i, the linear perturbation terms cancel because ∑ x_i = n². Exponentiating the resulting upper bound on the sum of logarithms yields the desired product bound ∏ (x_i² + n) ≤ (n(n + 1))^n.

  1. Define the auxiliary function φ(y) = ln(y² + m) - 2y/(m + 1) and establish that it is continuous on ℝ.

    Since m ≥ 2, y² + m ≥ m > 0 for all y, so y² + m is never zero. The composition y ↦ ln(y² + m) is therefore continuous on ℝ, and subtracting the linear term 2y/(m + 1) preserves continuity.

    lines 1–13

    uses Continuous.log, Continuous.sub, sq_nonneg

    lemma tournament_degree_prod_le_regular_aux (m : ℝ) (hm : 2 ≤ m) (x : ℝ) (hx : 1 ≤ x) :
        Real.log (x ^ 2 + m) ≤ Real.log (m * (m + 1)) + 2 * (x - m) / (m + 1) := by
      have hm1 : 0 < m + 1 := by linarith
      let φ : ℝ → ℝ := fun y => Real.log (y ^ 2 + m) - 2 * y / (m + 1)
      have hcont_log : Continuous (fun y : ℝ => Real.log (y ^ 2 + m)) := by
        apply Continuous.log
        · fun_prop
        · intro y
          have : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]
          exact this.ne'
      have hcont : Continuous φ := by
        apply Continuous.sub hcont_log
        fun_prop
  2. For every y ∈ ℝ, the derivative of φ at y is φ'(y) = 2y/(y² + m) - 2/(m + 1).

    By the power rule and linearity, the derivative of z ↦ z² + m is 2y. Applying the chain rule to the logarithm yields 2y/(y² + m). Differentiating the linear term 2z/(m + 1) gives 2/(m + 1). Subtracting the two gives the derivative of φ.

    lines 14–30

    uses sq_nonneg, hasDerivAt_pow, hasDerivAt_add_const_iff, hasDerivAt_const_mul, div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc

      have hderiv : ∀ y : ℝ, HasDerivAt φ (2 * y / (y ^ 2 + m) - 2 / (m + 1)) y := by
        intro y
        have hy : y ^ 2 + m ≠ 0 := by
          have : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]
          exact this.ne'
        have h1 : HasDerivAt (fun z : ℝ => z ^ 2 + m) (2 * y) y := by
          have hbase : HasDerivAt (fun z : ℝ => z ^ 2) (2 * y) y := by
            simpa using hasDerivAt_pow 2 y
          exact (hasDerivAt_add_const_iff m).mpr hbase
        have h2 : HasDerivAt (fun z : ℝ => Real.log (z ^ 2 + m)) (2 * y / (y ^ 2 + m)) y := by
          simpa using h1.log hy
        have h3 : HasDerivAt (fun z : ℝ => 2 * z / (m + 1)) (2 / (m + 1)) y := by
          have h := hasDerivAt_const_mul (x := y) (c := 2 / (m + 1))
          simpa [div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] using h
        have hsub := h2.sub h3
        change HasDerivAt (fun z : ℝ => Real.log (z ^ 2 + m) - 2 * z / (m + 1)) (2 * y / (y ^ 2 + m) - 2 / (m + 1)) y at hsub
        simpa [φ] using hsub
  3. The function φ is monotone increasing on the closed interval [1, m].

    By the mean value theorem / derivative test on the convex interval [1, m], it suffices to show φ'(y) ≥ 0 on the interior (1, m). On this interval, 1 < y < m, so 2y(m + 1) - 2(y² + m) = 2(y - 1)(m - y) ≥ 0, which implies 2y/(y² + m) ≥ 2/(m + 1).

    lines 31–43

    uses monotoneOn_of_hasDerivWithinAt_nonneg, convex_Icc, interior_Icc, sq_nonneg, sub_nonneg, div_le_div_iff₀, mul_nonneg

      have hmono : MonotoneOn φ (Set.Icc 1 m) := by
        apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc (1:ℝ) m) hcont.continuousOn
        · intro y hy
          exact (hderiv y).hasDerivWithinAt
        · intro y hy
          have hy' : y ∈ Set.Ioo (1:ℝ) m := by simpa [interior_Icc] using hy
          have hy1 : 1 < y := hy'.1
          have hym : y < m := hy'.2
          have hden : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]
          have hden2 : 0 < m + 1 := hm1
          rw [sub_nonneg]
          exact (div_le_div_iff₀ hden2 hden).mpr (by
            nlinarith [mul_nonneg (sub_nonneg.mpr hy1.le) (sub_nonneg.mpr hym.le)])
  4. The function φ is antitone (decreasing) on the interval [m, ∞).

    On the interior (m, ∞), we have y > m ≥ 2 > 1, which implies 2(y - 1)(m - y) ≤ 0, so φ'(y) ≤ 0. Since [m, ∞) is convex and φ is continuous, φ is antitone on [m, ∞).

    lines 44–55

    uses antitoneOn_of_hasDerivWithinAt_nonpos, convex_Ici, interior_Ici, sq_nonneg, sub_nonpos, div_le_div_iff₀, mul_nonneg

      have hanti : AntitoneOn φ (Set.Ici m) := by
        apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ici m) hcont.continuousOn
        · intro y hy
          exact (hderiv y).hasDerivWithinAt
        · intro y hy
          have hy' : y ∈ Set.Ioi m := by simpa [interior_Ici] using hy
          have hym : m < y := hy'
          have hden : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]
          have hden2 : 0 < m + 1 := hm1
          rw [sub_nonpos]
          exact (div_le_div_iff₀ hden hden2).mpr (by
            nlinarith [mul_nonneg (sub_nonneg.mpr (by linarith : 1 ≤ y)) (sub_nonneg.mpr hym.le)])
  5. For any x ≥ 1, ln(x² + m) ≤ ln(m(m + 1)) + 2(x - m)/(m + 1).

    We split into two cases: if x ≤ m, then x ∈ [1, m], and monotonicity of φ gives φ(x) ≤ φ(m). If x > m, then x ∈ [m, ∞), and antitonicity gives φ(x) ≤ φ(m). In either case, φ(x) ≤ φ(m), which expands to ln(x² + m) - 2x/(m + 1) ≤ ln(m² + m) - 2m/(m + 1). Factoring m² + m = m(m + 1) and rearranging yields the desired inequality.

    lines 56–75

    uses le_rfl

      by_cases hxle : x ≤ m
      · have hxI : x ∈ Set.Icc (1:ℝ) m := Set.mem_Icc.mpr ⟨hx, hxle⟩
        have hmI : m ∈ Set.Icc (1:ℝ) m := Set.mem_Icc.mpr ⟨by linarith, le_rfl⟩
        have h := hmono hxI hmI hxle
        simp only [φ] at h
        have hφm : m ^ 2 + m = m * (m + 1) := by ring
        rw [hφm] at h
        have hsub : 2 * (x - m) / (m + 1) = 2 * x / (m + 1) - 2 * m / (m + 1) := by ring
        rw [hsub]
        linarith
      · have hxge : m ≤ x := by linarith
        have hxI : x ∈ Set.Ici m := Set.mem_Ici.mpr hxge
        have hmI : m ∈ Set.Ici m := Set.mem_Ici.mpr le_rfl
        have h := hanti hmI hxI hxge
        simp only [φ] at h
        have hφm : m ^ 2 + m = m * (m + 1) := by ring
        rw [hφm] at h
        have hsub : 2 * (x - m) / (m + 1) = 2 * x / (m + 1) - 2 * m / (m + 1) := by ring
        rw [hsub]
        linarith
  6. Let N = n. Then N ≥ 2, N > 0, N + 1 > 0, and x_i² + N > 0 for each i.

    We cast the integer n to a real number N. Since n ≥ 2, N ≥ 2 > 0. For each index i, x_i ≥ 1, so x_i² + N ≥ 1 + 2 > 0.

    lines 76–88

    uses sq_nonneg

    /-- Degree product bound for tournament arborescences from concavity. -/
    theorem tournament_degree_prod_le_regular (n : ℕ) (hn : 2 ≤ n) (x : Fin n → ℝ) (hx_pos : ∀ i, 1 ≤ x i) (hx_sum : ∑ i : Fin n, x i = (n : ℝ) ^ 2) : ∏ i : Fin n, (x i ^ 2 + (n : ℝ)) ≤ ((n : ℝ) * ((n : ℝ) + 1)) ^ n := by
      let N : ℝ := (n : ℝ)
      have hN2 : 2 ≤ N := by
        dsimp [N]
        exact_mod_cast hn
      have hN0 : 0 < N := by linarith
      have hN1 : 0 < N + 1 := by linarith
      have hpos : ∀ i : Fin n, 0 < x i ^ 2 + N := by
        intro i
        have hxi : 1 ≤ x i := hx_pos i
        nlinarith [sq_nonneg (x i)]
  7. For each i, ln(x_i² + N) ≤ ln(N(N + 1)) + 2(x_i - N)/(N + 1).

    This is an immediate application of the auxiliary lemma with m = N and x = x_i, since N ≥ 2 and x_i ≥ 1.

    lines 89–91

    uses tournament_degree_prod_le_regular_aux

      have hpoint : ∀ i : Fin n, Real.log (x i ^ 2 + N) ≤ Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1) := by
        intro i
        exact tournament_degree_prod_le_regular_aux N hN2 (x i) (hx_pos i)
  8. The sum of logarithms ∑_{i} ln(x_i² + N) is at most ∑_{i} (ln(N(N + 1)) + 2(x_i - N)/(N + 1)).

    Summing the pointwise upper bounds over all i ∈ Fin n preserves the inequality.

    lines 92–94

    uses Finset.sum_le_sum

      have hsum_le : ∑ i : Fin n, Real.log (x i ^ 2 + N) ≤
          ∑ i : Fin n, (Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1)) := by
        exact Finset.sum_le_sum (fun i _ => hpoint i)
  9. The right-hand sum simplifies to n * ln(N(N + 1)).

    The sum splits into a constant sum and a linear deviation sum. The constant term sums to n * ln(N(N + 1)). In the deviation term, the factor 2/(N + 1) pulls out, leaving ∑ (x_i - N) = ∑ x_i - n * N = N² - n * N = 0, because ∑ x_i = n² and N = n. Thus the linear term vanishes completely.

    lines 95–116

    uses Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul, Finset.mul_sum, Finset.sum_congr, Finset.sum_sub_distrib, mul_zero, add_zero

      have hsum_rhs : ∑ i : Fin n, (Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1))
          = (n : ℝ) * Real.log (N * (N + 1)) := by
        rw [Finset.sum_add_distrib]
        have hconst : ∑ i : Fin n, Real.log (N * (N + 1)) = (n : ℝ) * Real.log (N * (N + 1)) := by
          simp [Finset.sum_const, nsmul_eq_mul]
        rw [hconst]
        have hzero : ∑ i : Fin n, 2 * (x i - N) / (N + 1) = 0 := by
          have hfactor : ∑ i : Fin n, 2 * (x i - N) / (N + 1) = (2 / (N + 1)) * ∑ i : Fin n, (x i - N) := by
            rw [Finset.mul_sum]
            apply Finset.sum_congr rfl
            intro i _
            ring
          rw [hfactor]
          have hsum_sub : ∑ i : Fin n, (x i - N) = 0 := by
            rw [Finset.sum_sub_distrib]
            have hxsumN : ∑ i : Fin n, x i = N ^ 2 := by
              rw [hx_sum]
            rw [hxsumN]
            simp [N, Finset.sum_const, nsmul_eq_mul]
            ring
          rw [hsum_sub, mul_zero]
        rw [hzero, add_zero]
  10. ln(∏_{i} (x_i² + N)) = ∑_{i} ln(x_i² + N) and ln((N(N + 1))^n) = n * ln(N(N + 1)).

    The logarithm turns the product of positive terms into a sum of logarithms, and pulls the exponent n out of the power (N(N + 1))^n.

    lines 117–122

    uses Real.log_prod, Real.log_pow

      have hlogprod_eq : Real.log (∏ i : Fin n, (x i ^ 2 + N)) = ∑ i : Fin n, Real.log (x i ^ 2 + N) := by
        rw [Real.log_prod]
        intro i _
        exact (hpos i).ne'
      have htarget_log : Real.log ((N * (N + 1)) ^ n) = (n : ℝ) * Real.log (N * (N + 1)) := by
        rw [Real.log_pow]
  11. ln(∏_{i} (x_i² + N)) ≤ ln((N(N + 1))^n).

    Combining the product-to-sum identity, the evaluated right-hand side, and the sum inequality directly gives the logarithm bound.

    lines 123–125

      have hfinal_log : Real.log (∏ i : Fin n, (x i ^ 2 + N)) ≤ Real.log ((N * (N + 1)) ^ n) := by
        rw [hlogprod_eq, htarget_log, ← hsum_rhs]
        exact hsum_le
  12. ∏_{i} (x_i² + n) ≤ (n(n + 1))^n.

    Both the product ∏ (x_i² + N) and the power (N(N + 1))^n are strictly positive. Since the natural logarithm is strictly increasing on positive reals, ln A ≤ ln B implies A ≤ B. Substituting N = n concludes the proof.

    lines 126–129

    uses Finset.prod_pos, pow_pos, mul_pos, Real.log_le_log_iff

      have hprod_pos : 0 < ∏ i : Fin n, (x i ^ 2 + N) := Finset.prod_pos (fun i _ => hpos i)
      have hpow_pos : 0 < (N * (N + 1)) ^ n := pow_pos (mul_pos hN0 hN1) n
      have hle := (Real.log_le_log_iff hprod_pos hpow_pos).mp hfinal_log
      simpa [N] using hle
Continuous.log
The logarithm of a continuous nowhere-zero real-valued function is continuous.
Continuous.sub
The difference of two continuous functions is continuous.
sq_nonneg
The square of any real number is non-negative.
hasDerivAt_pow
The derivative of x ↦ x^n at x is n * x^(n - 1).
hasDerivAt_add_const_iff
Adding a constant to a function does not change its derivative.
hasDerivAt_const_mul
The derivative of x ↦ c * x at any point is c.
div_eq_mul_inv
Division a / b is equivalent to multiplication by the inverse a * b⁻¹.
mul_comm
Multiplication is commutative: a * b = b * a.
mul_left_comm
Left-commutativity of multiplication: a * (b * c) = b * (a * c).
mul_assoc
Multiplication is associative: (a * b) * c = a * (b * c).
monotoneOn_of_hasDerivWithinAt_nonneg
A continuous function on a convex set whose derivative on the interior is non-negative is monotone increasing on that set.
convex_Icc
A closed interval [a, b] in ℝ is convex.
interior_Icc
The topological interior of the closed interval [a, b] is the open interval (a, b).
sub_nonneg
0 ≤ a - b if and only if b ≤ a.
div_le_div_iff₀
For positive denominators b, d > 0, a / b ≤ c / d if and only if a * d ≤ c * b.
mul_nonneg
The product of two non-negative numbers is non-negative.
antitoneOn_of_hasDerivWithinAt_nonpos
A continuous function on a convex set whose derivative on the interior is non-positive is antitone (decreasing) on that set.
convex_Ici
A half-infinite interval [a, ∞) in ℝ is convex.
interior_Ici
The topological interior of [a, ∞) is (a, ∞).
sub_nonpos
a - b ≤ 0 if and only if a ≤ b.
le_rfl
Every element in a preorder satisfies a ≤ a.
tournament_degree_prod_le_regular_aux
For m ≥ 2 and x ≥ 1, ln(x² + m) ≤ ln(m(m + 1)) + 2(x - m)/(m + 1).
Finset.sum_le_sum
If f(i) ≤ g(i) for all i in a finite set, then ∑ f(i) ≤ ∑ g(i).
Finset.sum_add_distrib
The sum of a sum of functions distributes over a finite set: ∑ (f(i) + g(i)) = ∑ f(i) + ∑ g(i).
Finset.sum_const
The sum of a constant c over a finite set s equals |s| * c.
nsmul_eq_mul
Scalar multiplication of a real number by a natural number n • a equals (n : ℝ) * a.
Finset.mul_sum
A constant factor can be pulled out of a finite sum: a * ∑ f(i) = ∑ (a * f(i)).
Finset.sum_congr
If two functions agree on every element of a finite set, their sums over that set are equal.
Finset.sum_sub_distrib
The sum of a difference of functions distributes: ∑ (f(i) - g(i)) = ∑ f(i) - ∑ g(i).
mul_zero
Multiplying any element by zero gives zero: a * 0 = 0.
add_zero
Adding zero to any element leaves it unchanged: a + 0 = a.
Real.log_prod
The logarithm of a finite product of non-zero terms is the sum of their logarithms.
Real.log_pow
For real x and natural n, ln(x^n) = n * ln(x).
Finset.prod_pos
A finite product of strictly positive elements is strictly positive.
pow_pos
A strictly positive real number raised to any natural power is strictly positive.
mul_pos
The product of two strictly positive real numbers is strictly positive.
Real.log_le_log_iff
For strictly positive x, y > 0, ln x ≤ ln y if and only if x ≤ y.

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

lemma tournament_degree_prod_le_regular_aux (m : ℝ) (hm : 2 ≤ m) (x : ℝ) (hx : 1 ≤ x) :    Real.log (x ^ 2 + m) ≤ Real.log (m * (m + 1)) + 2 * (x - m) / (m + 1) := by  have hm1 : 0 < m + 1 := by linarith  let φ : ℝ → ℝ := fun y => Real.log (y ^ 2 + m) - 2 * y / (m + 1)  have hcont_log : Continuous (fun y : ℝ => Real.log (y ^ 2 + m)) := by    apply Continuous.log    · fun_prop    · intro y      have : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]      exact this.ne'  have hcont : Continuous φ := by    apply Continuous.sub hcont_log    fun_prop  have hderiv : ∀ y : ℝ, HasDerivAt φ (2 * y / (y ^ 2 + m) - 2 / (m + 1)) y := by    intro y    have hy : y ^ 2 + m ≠ 0 := by      have : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]      exact this.ne'    have h1 : HasDerivAt (fun z : ℝ => z ^ 2 + m) (2 * y) y := by      have hbase : HasDerivAt (fun z : ℝ => z ^ 2) (2 * y) y := by        simpa using hasDerivAt_pow 2 y      exact (hasDerivAt_add_const_iff m).mpr hbase    have h2 : HasDerivAt (fun z : ℝ => Real.log (z ^ 2 + m)) (2 * y / (y ^ 2 + m)) y := by      simpa using h1.log hy    have h3 : HasDerivAt (fun z : ℝ => 2 * z / (m + 1)) (2 / (m + 1)) y := by      have h := hasDerivAt_const_mul (x := y) (c := 2 / (m + 1))      simpa [div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] using h    have hsub := h2.sub h3    change HasDerivAt (fun z : ℝ => Real.log (z ^ 2 + m) - 2 * z / (m + 1)) (2 * y / (y ^ 2 + m) - 2 / (m + 1)) y at hsub    simpa [φ] using hsub  have hmono : MonotoneOn φ (Set.Icc 1 m) := by    apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc (1:ℝ) m) hcont.continuousOn    · intro y hy      exact (hderiv y).hasDerivWithinAt    · intro y hy      have hy' : y ∈ Set.Ioo (1:ℝ) m := by simpa [interior_Icc] using hy      have hy1 : 1 < y := hy'.1      have hym : y < m := hy'.2      have hden : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]      have hden2 : 0 < m + 1 := hm1      rw [sub_nonneg]      exact (div_le_div_iff₀ hden2 hden).mpr (by        nlinarith [mul_nonneg (sub_nonneg.mpr hy1.le) (sub_nonneg.mpr hym.le)])  have hanti : AntitoneOn φ (Set.Ici m) := by    apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ici m) hcont.continuousOn    · intro y hy      exact (hderiv y).hasDerivWithinAt    · intro y hy      have hy' : y ∈ Set.Ioi m := by simpa [interior_Ici] using hy      have hym : m < y := hy'      have hden : 0 < y ^ 2 + m := by nlinarith [sq_nonneg y]      have hden2 : 0 < m + 1 := hm1      rw [sub_nonpos]      exact (div_le_div_iff₀ hden hden2).mpr (by        nlinarith [mul_nonneg (sub_nonneg.mpr (by linarith : 1 ≤ y)) (sub_nonneg.mpr hym.le)])  by_cases hxle : x ≤ m  · have hxI : x ∈ Set.Icc (1:ℝ) m := Set.mem_Icc.mpr ⟨hx, hxle⟩    have hmI : m ∈ Set.Icc (1:ℝ) m := Set.mem_Icc.mpr ⟨by linarith, le_rfl⟩    have h := hmono hxI hmI hxle    simp only [φ] at h    have hφm : m ^ 2 + m = m * (m + 1) := by ring    rw [hφm] at h    have hsub : 2 * (x - m) / (m + 1) = 2 * x / (m + 1) - 2 * m / (m + 1) := by ring    rw [hsub]    linarith  · have hxge : m ≤ x := by linarith    have hxI : x ∈ Set.Ici m := Set.mem_Ici.mpr hxge    have hmI : m ∈ Set.Ici m := Set.mem_Ici.mpr le_rfl    have h := hanti hmI hxI hxge    simp only [φ] at h    have hφm : m ^ 2 + m = m * (m + 1) := by ring    rw [hφm] at h    have hsub : 2 * (x - m) / (m + 1) = 2 * x / (m + 1) - 2 * m / (m + 1) := by ring    rw [hsub]    linarith/-- Degree product bound for tournament arborescences from concavity. -/theorem tournament_degree_prod_le_regular (n : ℕ) (hn : 2 ≤ n) (x : Fin n → ℝ) (hx_pos : ∀ i, 1 ≤ x i) (hx_sum : ∑ i : Fin n, x i = (n : ℝ) ^ 2) : ∏ i : Fin n, (x i ^ 2 + (n : ℝ)) ≤ ((n : ℝ) * ((n : ℝ) + 1)) ^ n := by  let N : ℝ := (n : ℝ)  have hN2 : 2 ≤ N := by    dsimp [N]    exact_mod_cast hn  have hN0 : 0 < N := by linarith  have hN1 : 0 < N + 1 := by linarith  have hpos : ∀ i : Fin n, 0 < x i ^ 2 + N := by    intro i    have hxi : 1 ≤ x i := hx_pos i    nlinarith [sq_nonneg (x i)]  have hpoint : ∀ i : Fin n, Real.log (x i ^ 2 + N) ≤ Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1) := by    intro i    exact tournament_degree_prod_le_regular_aux N hN2 (x i) (hx_pos i)  have hsum_le : ∑ i : Fin n, Real.log (x i ^ 2 + N) ≤      ∑ i : Fin n, (Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1)) := by    exact Finset.sum_le_sum (fun i _ => hpoint i)  have hsum_rhs : ∑ i : Fin n, (Real.log (N * (N + 1)) + 2 * (x i - N) / (N + 1))      = (n : ℝ) * Real.log (N * (N + 1)) := by    rw [Finset.sum_add_distrib]    have hconst : ∑ i : Fin n, Real.log (N * (N + 1)) = (n : ℝ) * Real.log (N * (N + 1)) := by      simp [Finset.sum_const, nsmul_eq_mul]    rw [hconst]    have hzero : ∑ i : Fin n, 2 * (x i - N) / (N + 1) = 0 := by      have hfactor : ∑ i : Fin n, 2 * (x i - N) / (N + 1) = (2 / (N + 1)) * ∑ i : Fin n, (x i - N) := by        rw [Finset.mul_sum]        apply Finset.sum_congr rfl        intro i _        ring      rw [hfactor]      have hsum_sub : ∑ i : Fin n, (x i - N) = 0 := by        rw [Finset.sum_sub_distrib]        have hxsumN : ∑ i : Fin n, x i = N ^ 2 := by          rw [hx_sum]        rw [hxsumN]        simp [N, Finset.sum_const, nsmul_eq_mul]        ring      rw [hsum_sub, mul_zero]    rw [hzero, add_zero]  have hlogprod_eq : Real.log (∏ i : Fin n, (x i ^ 2 + N)) = ∑ i : Fin n, Real.log (x i ^ 2 + N) := by    rw [Real.log_prod]    intro i _    exact (hpos i).ne'  have htarget_log : Real.log ((N * (N + 1)) ^ n) = (n : ℝ) * Real.log (N * (N + 1)) := by    rw [Real.log_pow]  have hfinal_log : Real.log (∏ i : Fin n, (x i ^ 2 + N)) ≤ Real.log ((N * (N + 1)) ^ n) := by    rw [hlogprod_eq, htarget_log, ← hsum_rhs]    exact hsum_le  have hprod_pos : 0 < ∏ i : Fin n, (x i ^ 2 + N) := Finset.prod_pos (fun i _ => hpos i)  have hpow_pos : 0 < (N * (N + 1)) ^ n := pow_pos (mul_pos hN0 hN1) n  have hle := (Real.log_le_log_iff hprod_pos hpow_pos).mp hfinal_log  simpa [N] using hle
See it in the graphDiscuss this resultChallenge it