AFTD Auto-Formalizing Theoretical Domains

qutrit_cyclic_cubic_nonnegative

theoremverified

The cyclic cubic determinant appearing in the constrained qutrit witness is nonnegative on the nonnegative octant.

Statement

theorem qutrit_cyclic_cubic_nonnegative (p q r : ℝ)
    (hp : 0 ≤ p) (hq : 0 ≤ q) (hr : 0 ≤ r) :
    0 ≤ p^2*r + p*q^2 + q*r^2 - 3*p*q*r
Source
OP-2299 zero-Bell face witness; determinant identity 41055 and the arithmetic-geometric mean inequality.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof establishes the inequality by first proving a core lemma for the case where $p$ is minimal ($p \le q$ and $p \le r$). In that case, the cubic decomposes into $p \big((q - p)^2 - (q - p)(r - p) + (r - p)^2\big) + (q - p)(r - p)^2$, which is manifestly nonnegative as a sum of products of nonnegative terms and sums of squares. Because the cubic expression is invariant under cyclic permutation of $(p, q, r)$, the general result follows by casing on the relative order of the three variables and rotating the minimal variable into the first position.

  1. If $0 \le p \le q$ and $p \le r$, then $p^2 r + p q^2 + q r^2 - 3 p q r \ge 0$.

    We prove the core lemma for when $p$ is minimal among the three variables. Writing the expression in terms of the differences $q - p$ and $r - p$, the cubic decomposes algebraically as $p \big((q - p)^2 - (q - p)(r - p) + (r - p)^2\big) + (q - p)(r - p)^2$. The quadratic factor $(q - p)^2 - (q - p)(r - p) + (r - p)^2$ equals $\frac{1}{2}\big(((q - p) - (r - p))^2 + (q - p)^2 + (r - p)^2\big)$, which is a sum of squares and thus nonnegative (`sq_nonneg`). Multiplying by $p \ge 0$ gives a nonnegative first term $h_1$ (`mul_nonneg`). Since $p \le q$, the difference $q - p$ is nonnegative (`sub_nonneg.mpr`), so the second term $h_2 = (q - p)(r - p)^2$ is also a product of nonnegative factors (`mul_nonneg`, `sq_nonneg`). Nonlinear arithmetic verifies the algebraic decomposition and concludes that the cubic sum $h_1 + h_2$ is nonnegative.

    lines 4–10

    uses sq_nonneg, mul_nonneg, sub_nonneg.mpr

      have core (p q r : ℝ) (hp : 0 ≤ p) (hpq : p ≤ q) (_hpr : p ≤ r) :
          0 ≤ p^2*r + p*q^2 + q*r^2 - 3*p*q*r := by
        have hquad : 0 ≤ (q-p)^2 - (q-p)*(r-p) + (r-p)^2 := by
          nlinarith [sq_nonneg ((q-p)-(r-p)), sq_nonneg (q-p), sq_nonneg (r-p)]
        have h₁ := mul_nonneg hp hquad
        have h₂ := mul_nonneg (sub_nonneg.mpr hpq) (sq_nonneg (r-p))
        nlinarith [h₁, h₂]
  2. The inequality holds in the case where $p \le q$ and $p \le r$.

    We begin a case split on the relative ordering of the variables using totality of $\le$ (`le_total`). When $p \le q$ and $p \le r$, $p$ is minimal, so applying the core lemma directly to $p, q, r$ completes this case.

    lines 11–13

    uses le_total

      rcases le_total p q with hpq | hqp
      · rcases le_total p r with hpr | hrp
        · exact core p q r hp hpq hpr
  3. The inequality holds in the case where $r \le p \le q$.

    When $p \le q$ and $r \le p$, transitivity (`le_trans`) implies $r \le q$, making $r$ minimal. We apply the core lemma to the cyclically permuted triple $(r, p, q)$ with $r \ge 0$. Because the cubic polynomial is invariant under cyclic permutation ($r^2 q + r p^2 + p q^2 - 3 r p q = p^2 r + p q^2 + q r^2 - 3 p q r$), nonlinear arithmetic deduces the original goal.

    lines 14–15

    uses le_trans

        · have h := core r p q hr hrp (le_trans hrp hpq)
          nlinarith [h]
  4. The inequality holds in the case where $q \le p$ and $q \le r$.

    In the remaining branch where $q \le p$, we compare $q$ and $r$ (`le_total`). If $q \le r$, then $q$ is minimal ($q \le r$ and $q \le p$). Applying the core lemma to the cyclically rotated triple $(q, r, p)$ with $q \ge 0$ yields nonnegativity, which nonlinear arithmetic matches with the goal by cyclic symmetry.

    lines 16–18

    uses le_total

      · rcases le_total q r with hqr | hrq
        · have h := core q r p hq hqr hqp
          nlinarith [h]
  5. The inequality holds in the remaining case where $r \le q \le p$, completing the proof.

    If $q \le p$ and $r \le q$, transitivity (`le_trans`) gives $r \le p$, so $r$ is minimal. Applying the core lemma to $(r, p, q)$ with $r \ge 0$ gives nonnegativity, which again equals the desired goal by cyclic invariance.

    lines 19–20

    uses le_trans

        · have h := core r p q hr (le_trans hrq hqp) hrq
          nlinarith [h]
sq_nonneg
The square of any real number is nonnegative ($a^2 \ge 0$).
mul_nonneg
The product of two nonnegative numbers is nonnegative ($0 \le a \to 0 \le b \to 0 \le a b$).
sub_nonneg.mpr
If $b \le a$, then $a - b \ge 0$.
le_total
For any two numbers in a linear order, either $a \le b$ or $b \le a$.
le_trans
The ordering relation is transitive: if $a \le b$ and $b \le c$, then $a \le 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

theorem qutrit_cyclic_cubic_nonnegative (p q r : ℝ)    (hp : 0 ≤ p) (hq : 0 ≤ q) (hr : 0 ≤ r) :    0 ≤ p^2*r + p*q^2 + q*r^2 - 3*p*q*r := by  have core (p q r : ℝ) (hp : 0 ≤ p) (hpq : p ≤ q) (_hpr : p ≤ r) :      0 ≤ p^2*r + p*q^2 + q*r^2 - 3*p*q*r := by    have hquad : 0 ≤ (q-p)^2 - (q-p)*(r-p) + (r-p)^2 := by      nlinarith [sq_nonneg ((q-p)-(r-p)), sq_nonneg (q-p), sq_nonneg (r-p)]    have h₁ := mul_nonneg hp hquad    have h₂ := mul_nonneg (sub_nonneg.mpr hpq) (sq_nonneg (r-p))    nlinarith [h₁, h₂]  rcases le_total p q with hpq | hqp  · rcases le_total p r with hpr | hrp    · exact core p q r hp hpq hpr    · have h := core r p q hr hrp (le_trans hrp hpq)      nlinarith [h]  · rcases le_total q r with hqr | hrq    · have h := core q r p hq hqr hqp      nlinarith [h]    · have h := core r p q hr (le_trans hrq hqp) hrq      nlinarith [h]
See it in the graphDiscuss this resultChallenge it