Quadratic discriminants and roots of a quadratic #
This file defines the discriminant of a quadratic and gives the solution to a quadratic equation.
Main definition #
discrim a b c
: the discriminant of a quadratica * (x * x) + b * x + c
isb * b - 4 * a * c
.
Main statements #
quadratic_eq_zero_iff
: roots of a quadratic can be written as(-b + s) / (2 * a)
or(-b - s) / (2 * a)
, wheres
is a square root of the discriminant.quadratic_ne_zero_of_discrim_ne_sq
: if the discriminant has no square root, then the corresponding quadratic has no root.discrim_le_zero
: if a quadratic is always non-negative, then its discriminant is non-positive.discrim_le_zero_of_nonpos
,discrim_lt_zero
,discrim_lt_zero_of_neg
: versions of this statement with other inequalities.
Tags #
polynomial, quadratic, discriminant, root
theorem
discrim_lt_zero
{K : Type u_1}
[LinearOrderedField K]
{a b c : K}
(ha : a ≠ 0)
(h : ∀ (x : K), 0 < a * (x * x) + b * x + c)
:
If a polynomial of degree 2 is always positive, then its discriminant is negative, at least when the coefficient of the quadratic term is nonzero.