AFTD Auto-Formalizing Theoretical Domains

real_cubic_im_le_quarter_of_certificate

theoremverified

A complex root z of the real monic cubic z^3 + c3 z^2 + c2 z + c1 has |Im z| ≤ 1/4 provided c3^2 - 3 c2 ≥ -11/16 and 4(c3^2 c2^2 - 4 c2^3 - 4 c3^3 c1 - 27 c1^2 + 18 c1 c2 c3) + (c3^2 - 3 c2 + 1/4)^2 ≥ 0.

Statement

theorem real_cubic_im_le_quarter_of_certificate (c1 c2 c3 : ℝ) (z : ℂ)
    (hroot : z ^ 3 + (c3 : ℂ) * z ^ 2 + (c2 : ℂ) * z + (c1 : ℂ) = 0)
    (hD : -(11 / 16) ≤ c3 ^ 2 - 3 * c2)
    (hH : 0 ≤ 4 * (c3 ^ 2 * c2 ^ 2 - 4 * c2 ^ 3 - 4 * c3 ^ 3 * c1 - 27 * c1 ^ 2 + 18 * c1 * c2 * c3)
        + (c3 ^ 2 - 3 * c2 + 1 / 4) ^ 2) :
    |z.im| ≤ 1 / 4
Source
step towards standardized_laplacian_order_four_two_fractional_im_le
Verified
27 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

We decompose the root into real and imaginary parts z = x + i y. If y = 0, the bound |y| ≤ 1/4 is trivial. When y ≠ 0, the imaginary equation expresses c1 and c2 in terms of x and y, which transforms the certificate inequality into 0 ≤ -((y^2 - 1/16) * P) for a polynomial P that is a sum of non-negative terms. Either y^2 ≤ 1/16 (yielding |y| ≤ 1/4), or y^2 > 1/16 forces P ≤ 0, which implies y^2 = 1/4 and u = 0, yielding c3^2 - 3 c2 = -3/4 and contradicting the first certificate hypothesis.

  1. The real and imaginary parts of the cubic equation yield two scalar relations: x^3 - 3 x y^2 + c3(x^2 - y^2) + c2 x + c1 = 0 and y(3 x^2 - y^2 + 2 c3 x + c2) = 0.

    We write z = x + i y with x = Re(z) and y = Im(z). Expanding z^2 and z^3 in the cubic equation z^3 + c3 z^2 + c2 z + c1 = 0 and taking the real and imaginary parts of both sides yields these two real polynomial equations.

    lines 8–18

    uses congrArg

      set x := z.re
      set y := z.im
      have h3 : z ^ 3 = z * z * z := by ring
      have h2 : z ^ 2 = z * z := by ring
      rw [h3, h2] at hroot
      have hre_raw := congrArg Complex.re hroot
      have him_raw := congrArg Complex.im hroot
      simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im,
        Complex.ofReal_re, Complex.ofReal_im, Complex.zero_re, Complex.zero_im] at hre_raw him_raw
      have hre : x ^ 3 - 3 * x * y ^ 2 + c3 * (x ^ 2 - y ^ 2) + c2 * x + c1 = 0 := by linear_combination hre_raw
      have him : y * (3 * x ^ 2 - y ^ 2 + 2 * c3 * x + c2) = 0 := by linear_combination him_raw
  2. If y = 0, then |y| ≤ 1/4 holds.

    We perform a case split on whether y = 0. In this branch, y = 0, so |y| = |0| = 0, which is at most 1/4.

    lines 19–21

    uses abs_zero

      by_cases hy : y = 0
      · rw [hy, abs_zero]
        norm_num
  3. When y ≠ 0, we have y^2 = 3 x^2 + 2 c3 x + c2 and c1 = (c3 + 2 x)(x^2 + y^2).

    Since y ≠ 0, the imaginary relation y(3 x^2 - y^2 + 2 c3 x + c2) = 0 implies 3 x^2 - y^2 + 2 c3 x + c2 = 0, giving y^2 = 3 x^2 + 2 c3 x + c2. Adding x times this equation to the real equation eliminates c2 and expresses c1 in terms of x and y.

    lines 22–28

    uses mul_eq_zero.mp

      have hy2 : y ^ 2 = 3 * x ^ 2 + 2 * c3 * x + c2 := by
        have hmul : 3 * x ^ 2 - y ^ 2 + 2 * c3 * x + c2 = 0 := by
          cases mul_eq_zero.mp him with
          | inl h => exact (hy h).elim
          | inr h => exact h
        linear_combination -hmul
      have hc1 : c1 = (c3 + 2 * x) * (x ^ 2 + y ^ 2) := by linear_combination hre + x * hy2
  4. With u = (c3 + 3 x)^2 ≥ 0, we have c3^2 - 3 c2 = u - 3 y^2, and the second certificate expression factors as -((y^2 - 1/16) * P).

    Defining u = (c3 + 3 x)^2, which is non-negative, and expressing c2 = y^2 - 3 x^2 - 2 c3 x, linear algebra shows that c3^2 - 3 c2 = u - 3 y^2. Substituting the expressions for c1 and c2 into the certificate polynomial 4(c3^2 c2^2 - 4 c2^3 - 4 c3^3 c1 - 27 c1^2 + 18 c1 c2 c3) + (c3^2 - 3 c2 + 1/4)^2 shows that it equals -((y^2 - 1/16) * P), where P = 16 u^2 + 8(4 y^2 + 1) u + (4 y^2 - 1)^2. Hence the second certificate hypothesis becomes 0 ≤ -((y^2 - 1/16) * P).

    lines 29–39

    uses sq_nonneg

      set u := (c3 + 3 * x) ^ 2
      have hu : 0 ≤ u := sq_nonneg (c3 + 3 * x)
      have hD_eq : c3 ^ 2 - 3 * c2 = u - 3 * y ^ 2 := by linear_combination 3 * hy2
      set P := 16 * u ^ 2 + 8 * (4 * y ^ 2 + 1) * u + (4 * y ^ 2 - 1) ^ 2
      have hH_eq : 4 * (c3 ^ 2 * c2 ^ 2 - 4 * c2 ^ 3 - 4 * c3 ^ 3 * c1 - 27 * c1 ^ 2 + 18 * c1 * c2 * c3)
          + (c3 ^ 2 - 3 * c2 + 1 / 4) ^ 2 = -((y ^ 2 - 1 / 16) * P) := by
        have hc2 : c2 = y ^ 2 - 3 * x ^ 2 - 2 * c3 * x := by linear_combination -hy2
        dsimp only [P, u]
        subst hc1 hc2
        ring
      rw [hH_eq] at hH
  5. If y^2 ≤ 1/16, then |y| ≤ 1/4.

    We split on whether y^2 ≤ 1/16. In the branch where y^2 ≤ 1/16, since 1/16 = (1/4)^2, taking square roots gives |y| ≤ 1/4.

    lines 40–43

    uses le_or_gt, abs_le_of_sq_le_sq

      rcases le_or_gt (y ^ 2) (1 / 16) with hle | hgt
      · have h1 : y ^ 2 ≤ (1 / 4 : ℝ) ^ 2 := by
          linarith [show (1 / 4 : ℝ) ^ 2 = 1 / 16 by ring]
        exact abs_le_of_sq_le_sq h1 (by norm_num)
  6. The case y^2 > 1/16 is impossible because it forces c3^2 - 3 c2 = -3/4, contradicting c3^2 - 3 c2 ≥ -11/16.

    If y^2 > 1/16, then y^2 - 1/16 > 0, so 0 ≤ -((y^2 - 1/16) * P) forces P ≤ 0. But P is defined as a sum of three terms: 16 u^2, 8(4 y^2 + 1) u, and (4 y^2 - 1)^2. Since u ≥ 0 and 4 y^2 + 1 > 0, all three terms are non-negative, so their sum can be at most 0 only if each term is 0. This forces (4 y^2 - 1)^2 = 0 (hence y^2 = 1/4) and u = 0. Substituting these into c3^2 - 3 c2 = u - 3 y^2 gives c3^2 - 3 c2 = -3/4 = -12/16. This contradicts the hypothesis c3^2 - 3 c2 ≥ -11/16, completing the proof.

    lines 44–63

    uses sq_eq_zero_iff.mp

      · have hP : P ≤ 0 := by nlinarith
        have h1 : 0 ≤ 16 * u ^ 2 := by positivity
        have h2 : 0 ≤ 8 * (4 * y ^ 2 + 1) * u := by positivity
        have h3 : 0 ≤ (4 * y ^ 2 - 1) ^ 2 := by positivity
        have hsq : (4 * y ^ 2 - 1) ^ 2 = 0 := by linarith [hP, h1, h2, h3]
        have hsq0 : 4 * y ^ 2 - 1 = 0 := sq_eq_zero_iff.mp hsq
        have hy2_val : y ^ 2 = 1 / 4 := by linarith
        have h8u : 8 * (4 * (1 / 4 : ℝ) + 1) * u ≤ 0 := by
          calc 8 * (4 * (1 / 4 : ℝ) + 1) * u
            _ = 8 * (4 * y ^ 2 + 1) * u := by rw [hy2_val]
            _ ≤ 16 * u ^ 2 + 8 * (4 * y ^ 2 + 1) * u + (4 * y ^ 2 - 1) ^ 2 := by linarith
            _ = P := rfl
            _ ≤ 0 := hP
        have hu_zero : u = 0 := by linarith
        have hD_val : c3 ^ 2 - 3 * c2 = -3 / 4 := by
          calc c3 ^ 2 - 3 * c2
            _ = u - 3 * y ^ 2 := hD_eq
            _ = 0 - 3 * (1 / 4 : ℝ) := by rw [hu_zero, hy2_val]
            _ = -3 / 4 := by ring
        linarith [hD, hD_val]
congrArg
Applying a function to both sides of an equality preserves equality: if a₁ = a₂, then f(a₁) = f(a₂).
abs_zero
The absolute value of zero is zero: |0| = 0.
mul_eq_zero.mp
If a product is zero, then at least one factor is zero: a * b = 0 implies a = 0 or b = 0.
sq_nonneg
The square of any real number is non-negative: 0 ≤ a^2.
le_or_gt
For any two elements in a linear order, either a ≤ b or b < a.
abs_le_of_sq_le_sq
For non-negative b, if a^2 ≤ b^2, then |a| ≤ b.
sq_eq_zero_iff.mp
If the square of an element is zero, the element itself is zero: a^2 = 0 implies a = 0.

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

/-- Real-cubic root bound: the D- and H-certificate on the coefficients forces |Im z| ≤ 1/4. -/theorem real_cubic_im_le_quarter_of_certificate (c1 c2 c3 : ℝ) (z : ℂ)    (hroot : z ^ 3 + (c3 : ℂ) * z ^ 2 + (c2 : ℂ) * z + (c1 : ℂ) = 0)    (hD : -(11 / 16) ≤ c3 ^ 2 - 3 * c2)    (hH : 0 ≤ 4 * (c3 ^ 2 * c2 ^ 2 - 4 * c2 ^ 3 - 4 * c3 ^ 3 * c1 - 27 * c1 ^ 2 + 18 * c1 * c2 * c3)        + (c3 ^ 2 - 3 * c2 + 1 / 4) ^ 2) :    |z.im| ≤ 1 / 4 := by  set x := z.re  set y := z.im  have h3 : z ^ 3 = z * z * z := by ring  have h2 : z ^ 2 = z * z := by ring  rw [h3, h2] at hroot  have hre_raw := congrArg Complex.re hroot  have him_raw := congrArg Complex.im hroot  simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im,    Complex.ofReal_re, Complex.ofReal_im, Complex.zero_re, Complex.zero_im] at hre_raw him_raw  have hre : x ^ 3 - 3 * x * y ^ 2 + c3 * (x ^ 2 - y ^ 2) + c2 * x + c1 = 0 := by linear_combination hre_raw  have him : y * (3 * x ^ 2 - y ^ 2 + 2 * c3 * x + c2) = 0 := by linear_combination him_raw  by_cases hy : y = 0  · rw [hy, abs_zero]    norm_num  have hy2 : y ^ 2 = 3 * x ^ 2 + 2 * c3 * x + c2 := by    have hmul : 3 * x ^ 2 - y ^ 2 + 2 * c3 * x + c2 = 0 := by      cases mul_eq_zero.mp him with      | inl h => exact (hy h).elim      | inr h => exact h    linear_combination -hmul  have hc1 : c1 = (c3 + 2 * x) * (x ^ 2 + y ^ 2) := by linear_combination hre + x * hy2  set u := (c3 + 3 * x) ^ 2  have hu : 0 ≤ u := sq_nonneg (c3 + 3 * x)  have hD_eq : c3 ^ 2 - 3 * c2 = u - 3 * y ^ 2 := by linear_combination 3 * hy2  set P := 16 * u ^ 2 + 8 * (4 * y ^ 2 + 1) * u + (4 * y ^ 2 - 1) ^ 2  have hH_eq : 4 * (c3 ^ 2 * c2 ^ 2 - 4 * c2 ^ 3 - 4 * c3 ^ 3 * c1 - 27 * c1 ^ 2 + 18 * c1 * c2 * c3)      + (c3 ^ 2 - 3 * c2 + 1 / 4) ^ 2 = -((y ^ 2 - 1 / 16) * P) := by    have hc2 : c2 = y ^ 2 - 3 * x ^ 2 - 2 * c3 * x := by linear_combination -hy2    dsimp only [P, u]    subst hc1 hc2    ring  rw [hH_eq] at hH  rcases le_or_gt (y ^ 2) (1 / 16) with hle | hgt  · have h1 : y ^ 2 ≤ (1 / 4 : ℝ) ^ 2 := by      linarith [show (1 / 4 : ℝ) ^ 2 = 1 / 16 by ring]    exact abs_le_of_sq_le_sq h1 (by norm_num)  · have hP : P ≤ 0 := by nlinarith    have h1 : 0 ≤ 16 * u ^ 2 := by positivity    have h2 : 0 ≤ 8 * (4 * y ^ 2 + 1) * u := by positivity    have h3 : 0 ≤ (4 * y ^ 2 - 1) ^ 2 := by positivity    have hsq : (4 * y ^ 2 - 1) ^ 2 = 0 := by linarith [hP, h1, h2, h3]    have hsq0 : 4 * y ^ 2 - 1 = 0 := sq_eq_zero_iff.mp hsq    have hy2_val : y ^ 2 = 1 / 4 := by linarith    have h8u : 8 * (4 * (1 / 4 : ℝ) + 1) * u ≤ 0 := by      calc 8 * (4 * (1 / 4 : ℝ) + 1) * u        _ = 8 * (4 * y ^ 2 + 1) * u := by rw [hy2_val]        _ ≤ 16 * u ^ 2 + 8 * (4 * y ^ 2 + 1) * u + (4 * y ^ 2 - 1) ^ 2 := by linarith        _ = P := rfl        _ ≤ 0 := hP    have hu_zero : u = 0 := by linarith    have hD_val : c3 ^ 2 - 3 * c2 = -3 / 4 := by      calc c3 ^ 2 - 3 * c2        _ = u - 3 * y ^ 2 := hD_eq        _ = 0 - 3 * (1 / 4 : ℝ) := by rw [hu_zero, hy2_val]        _ = -3 / 4 := by ring    linarith [hD, hD_val]
See it in the graphDiscuss this resultChallenge it