@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Zhouhang Zhou
55
66! This file was ported from Lean 3 source module algebra.quadratic_discriminant
7- ! leanprover-community/mathlib commit 829895f162a1f29d0133f4b3538f4cd1fb5bffd3
7+ ! leanprover-community/mathlib commit e085d1df33274f4b32f611f483aae678ba0b42df
88! Please do not edit these lines, except to modify the commit id
99! if you have ported upstream changes.
1010-/
@@ -89,7 +89,6 @@ variable {K : Type _} [Field K] [NeZero (2 : K)] {a b c x : K}
8989theorem quadratic_eq_zero_iff (ha : a ≠ 0 ) {s : K} (h : discrim a b c = s * s) (x : K) :
9090 a * x * x + b * x + c = 0 ↔ x = (-b + s) / (2 * a) ∨ x = (-b - s) / (2 * a) := by
9191 rw [quadratic_eq_zero_iff_discrim_eq_sq ha, h, sq, mul_self_eq_mul_self_iff]
92- have ne : 2 * a ≠ 0 := mul_ne_zero (NeZero.ne _) ha
9392 field_simp
9493 apply or_congr
9594 · constructor <;> intro h' <;> linear_combination -h'
@@ -149,11 +148,10 @@ lemma discrim_le_zero_of_nonpos (h : ∀ x : K, a * x * x + b * x + c ≤ 0) : d
149148/-- If a polynomial of degree 2 is always positive, then its discriminant is negative,
150149at least when the coefficient of the quadratic term is nonzero.
151150-/
152- theorem discrim_lt_zero (ha : a ≠ 0 ) (h : ∀ x : K, 0 < a * x * x + b * x + c) : discrim a b c < 0 :=
153- by
151+ theorem discrim_lt_zero (ha : a ≠ 0 ) (h : ∀ x : K, 0 < a * x * x + b * x + c) :
152+ discrim a b c < 0 := by
154153 have : ∀ x : K, 0 ≤ a * x * x + b * x + c := fun x => le_of_lt (h x)
155- refine' lt_of_le_of_ne (discrim_le_zero this) _
156- intro h'
154+ refine lt_of_le_of_ne (discrim_le_zero this) fun h' ↦ ?_
157155 have := h (-b / (2 * a))
158156 have : a * (-b / (2 * a)) * (-b / (2 * a)) + b * (-b / (2 * a)) + c = 0 := by
159157 rw [quadratic_eq_zero_iff_of_discrim_eq_zero ha h' (-b / (2 * a))]
0 commit comments