Metamath Proof Explorer


Theorem discr

Description: If a quadratic polynomial with real coefficients is nonnegative for all values, then its discriminant is nonpositive. (Contributed by NM, 10-Aug-1999) (Revised by Mario Carneiro, 4-Jun-2014)

Ref Expression
Hypotheses discr.1 φ A
discr.2 φ B
discr.3 φ C
discr.4 φ x 0 A x 2 + B x + C
Assertion discr φ B 2 4 A C 0

Proof

Step Hyp Ref Expression
1 discr.1 φ A
2 discr.2 φ B
3 discr.3 φ C
4 discr.4 φ x 0 A x 2 + B x + C
5 2 adantr φ 0 < A B
6 resqcl B B 2
7 5 6 syl φ 0 < A B 2
8 7 recnd φ 0 < A B 2
9 4re 4
10 1 adantr φ 0 < A A
11 3 adantr φ 0 < A C
12 10 11 remulcld φ 0 < A A C
13 remulcl 4 A C 4 A C
14 9 12 13 sylancr φ 0 < A 4 A C
15 14 recnd φ 0 < A 4 A C
16 4pos 0 < 4
17 9 16 elrpii 4 +
18 simpr φ 0 < A 0 < A
19 10 18 elrpd φ 0 < A A +
20 rpmulcl 4 + A + 4 A +
21 17 19 20 sylancr φ 0 < A 4 A +
22 21 rpcnd φ 0 < A 4 A
23 21 rpne0d φ 0 < A 4 A 0
24 8 15 22 23 divsubdird φ 0 < A B 2 4 A C 4 A = B 2 4 A 4 A C 4 A
25 12 recnd φ 0 < A A C
26 10 recnd φ 0 < A A
27 4cn 4
28 27 a1i φ 0 < A 4
29 19 rpne0d φ 0 < A A 0
30 4ne0 4 0
31 30 a1i φ 0 < A 4 0
32 25 26 28 29 31 divcan5d φ 0 < A 4 A C 4 A = A C A
33 11 recnd φ 0 < A C
34 33 26 29 divcan3d φ 0 < A A C A = C
35 32 34 eqtrd φ 0 < A 4 A C 4 A = C
36 35 oveq2d φ 0 < A B 2 4 A 4 A C 4 A = B 2 4 A C
37 24 36 eqtrd φ 0 < A B 2 4 A C 4 A = B 2 4 A C
38 7 21 rerpdivcld φ 0 < A B 2 4 A
39 38 recnd φ 0 < A B 2 4 A
40 39 2timesd φ 0 < A 2 B 2 4 A = B 2 4 A + B 2 4 A
41 2t2e4 2 2 = 4
42 41 oveq1i 2 2 A = 4 A
43 2cnd φ 0 < A 2
44 43 43 26 mulassd φ 0 < A 2 2 A = 2 2 A
45 42 44 eqtr3id φ 0 < A 4 A = 2 2 A
46 45 oveq2d φ 0 < A 2 B 2 4 A = 2 B 2 2 2 A
47 43 8 22 23 divassd φ 0 < A 2 B 2 4 A = 2 B 2 4 A
48 2rp 2 +
49 rpmulcl 2 + A + 2 A +
50 48 19 49 sylancr φ 0 < A 2 A +
51 50 rpcnd φ 0 < A 2 A
52 50 rpne0d φ 0 < A 2 A 0
53 2ne0 2 0
54 53 a1i φ 0 < A 2 0
55 8 51 43 52 54 divcan5d φ 0 < A 2 B 2 2 2 A = B 2 2 A
56 46 47 55 3eqtr3d φ 0 < A 2 B 2 4 A = B 2 2 A
57 40 56 eqtr3d φ 0 < A B 2 4 A + B 2 4 A = B 2 2 A
58 oveq1 x = B 2 A x 2 = B 2 A 2
59 58 oveq2d x = B 2 A A x 2 = A B 2 A 2
60 oveq2 x = B 2 A B x = B B 2 A
61 59 60 oveq12d x = B 2 A A x 2 + B x = A B 2 A 2 + B B 2 A
62 61 oveq1d x = B 2 A A x 2 + B x + C = A B 2 A 2 + B B 2 A + C
63 62 breq2d x = B 2 A 0 A x 2 + B x + C 0 A B 2 A 2 + B B 2 A + C
64 4 ralrimiva φ x 0 A x 2 + B x + C
65 64 adantr φ 0 < A x 0 A x 2 + B x + C
66 5 50 rerpdivcld φ 0 < A B 2 A
67 66 renegcld φ 0 < A B 2 A
68 63 65 67 rspcdva φ 0 < A 0 A B 2 A 2 + B B 2 A + C
69 66 recnd φ 0 < A B 2 A
70 sqneg B 2 A B 2 A 2 = B 2 A 2
71 69 70 syl φ 0 < A B 2 A 2 = B 2 A 2
72 5 recnd φ 0 < A B
73 sqdiv B 2 A 2 A 0 B 2 A 2 = B 2 2 A 2
74 72 51 52 73 syl3anc φ 0 < A B 2 A 2 = B 2 2 A 2
75 sqval 2 A 2 A 2 = 2 A 2 A
76 51 75 syl φ 0 < A 2 A 2 = 2 A 2 A
77 51 43 26 mulassd φ 0 < A 2 A 2 A = 2 A 2 A
78 43 26 43 mul32d φ 0 < A 2 A 2 = 2 2 A
79 78 42 eqtrdi φ 0 < A 2 A 2 = 4 A
80 79 oveq1d φ 0 < A 2 A 2 A = 4 A A
81 76 77 80 3eqtr2d φ 0 < A 2 A 2 = 4 A A
82 81 oveq2d φ 0 < A B 2 2 A 2 = B 2 4 A A
83 71 74 82 3eqtrd φ 0 < A B 2 A 2 = B 2 4 A A
84 8 22 26 23 29 divdiv1d φ 0 < A B 2 4 A A = B 2 4 A A
85 83 84 eqtr4d φ 0 < A B 2 A 2 = B 2 4 A A
86 85 oveq2d φ 0 < A A B 2 A 2 = A B 2 4 A A
87 39 26 29 divcan2d φ 0 < A A B 2 4 A A = B 2 4 A
88 86 87 eqtrd φ 0 < A A B 2 A 2 = B 2 4 A
89 72 69 mulneg2d φ 0 < A B B 2 A = B B 2 A
90 sqval B B 2 = B B
91 72 90 syl φ 0 < A B 2 = B B
92 91 oveq1d φ 0 < A B 2 2 A = B B 2 A
93 72 72 51 52 divassd φ 0 < A B B 2 A = B B 2 A
94 92 93 eqtrd φ 0 < A B 2 2 A = B B 2 A
95 94 negeqd φ 0 < A B 2 2 A = B B 2 A
96 89 95 eqtr4d φ 0 < A B B 2 A = B 2 2 A
97 88 96 oveq12d φ 0 < A A B 2 A 2 + B B 2 A = B 2 4 A + B 2 2 A
98 7 50 rerpdivcld φ 0 < A B 2 2 A
99 98 recnd φ 0 < A B 2 2 A
100 39 99 negsubd φ 0 < A B 2 4 A + B 2 2 A = B 2 4 A B 2 2 A
101 97 100 eqtrd φ 0 < A A B 2 A 2 + B B 2 A = B 2 4 A B 2 2 A
102 101 oveq1d φ 0 < A A B 2 A 2 + B B 2 A + C = B 2 4 A - B 2 2 A + C
103 39 33 99 addsubd φ 0 < A B 2 4 A + C - B 2 2 A = B 2 4 A - B 2 2 A + C
104 102 103 eqtr4d φ 0 < A A B 2 A 2 + B B 2 A + C = B 2 4 A + C - B 2 2 A
105 68 104 breqtrd φ 0 < A 0 B 2 4 A + C - B 2 2 A
106 38 11 readdcld φ 0 < A B 2 4 A + C
107 106 98 subge0d φ 0 < A 0 B 2 4 A + C - B 2 2 A B 2 2 A B 2 4 A + C
108 105 107 mpbid φ 0 < A B 2 2 A B 2 4 A + C
109 57 108 eqbrtrd φ 0 < A B 2 4 A + B 2 4 A B 2 4 A + C
110 38 11 38 leadd2d φ 0 < A B 2 4 A C B 2 4 A + B 2 4 A B 2 4 A + C
111 109 110 mpbird φ 0 < A B 2 4 A C
112 38 11 suble0d φ 0 < A B 2 4 A C 0 B 2 4 A C
113 111 112 mpbird φ 0 < A B 2 4 A C 0
114 37 113 eqbrtrd φ 0 < A B 2 4 A C 4 A 0
115 7 14 resubcld φ 0 < A B 2 4 A C
116 0red φ 0 < A 0
117 115 116 21 ledivmuld φ 0 < A B 2 4 A C 4 A 0 B 2 4 A C 4 A 0
118 114 117 mpbid φ 0 < A B 2 4 A C 4 A 0
119 22 mul01d φ 0 < A 4 A 0 = 0
120 118 119 breqtrd φ 0 < A B 2 4 A C 0
121 3 adantr φ 0 = A B 0 C
122 121 ltp1d φ 0 = A B 0 C < C + 1
123 peano2re C C + 1
124 121 123 syl φ 0 = A B 0 C + 1
125 121 124 ltnegd φ 0 = A B 0 C < C + 1 C + 1 < C
126 122 125 mpbid φ 0 = A B 0 C + 1 < C
127 df-neg C = 0 C
128 126 127 breqtrdi φ 0 = A B 0 C + 1 < 0 C
129 124 renegcld φ 0 = A B 0 C + 1
130 0red φ 0 = A B 0 0
131 129 121 130 ltaddsubd φ 0 = A B 0 - C + 1 + C < 0 C + 1 < 0 C
132 128 131 mpbird φ 0 = A B 0 - C + 1 + C < 0
133 132 expr φ 0 = A B 0 - C + 1 + C < 0
134 oveq1 x = C + 1 B x 2 = C + 1 B 2
135 134 oveq2d x = C + 1 B A x 2 = A C + 1 B 2
136 oveq2 x = C + 1 B B x = B C + 1 B
137 135 136 oveq12d x = C + 1 B A x 2 + B x = A C + 1 B 2 + B C + 1 B
138 137 oveq1d x = C + 1 B A x 2 + B x + C = A C + 1 B 2 + B C + 1 B + C
139 138 breq2d x = C + 1 B 0 A x 2 + B x + C 0 A C + 1 B 2 + B C + 1 B + C
140 64 adantr φ 0 = A B 0 x 0 A x 2 + B x + C
141 2 adantr φ 0 = A B 0 B
142 simprr φ 0 = A B 0 B 0
143 129 141 142 redivcld φ 0 = A B 0 C + 1 B
144 139 140 143 rspcdva φ 0 = A B 0 0 A C + 1 B 2 + B C + 1 B + C
145 simprl φ 0 = A B 0 0 = A
146 145 oveq1d φ 0 = A B 0 0 C + 1 B 2 = A C + 1 B 2
147 143 recnd φ 0 = A B 0 C + 1 B
148 sqcl C + 1 B C + 1 B 2
149 147 148 syl φ 0 = A B 0 C + 1 B 2
150 149 mul02d φ 0 = A B 0 0 C + 1 B 2 = 0
151 146 150 eqtr3d φ 0 = A B 0 A C + 1 B 2 = 0
152 129 recnd φ 0 = A B 0 C + 1
153 141 recnd φ 0 = A B 0 B
154 152 153 142 divcan2d φ 0 = A B 0 B C + 1 B = C + 1
155 151 154 oveq12d φ 0 = A B 0 A C + 1 B 2 + B C + 1 B = 0 + C + 1
156 152 addid2d φ 0 = A B 0 0 + C + 1 = C + 1
157 155 156 eqtrd φ 0 = A B 0 A C + 1 B 2 + B C + 1 B = C + 1
158 157 oveq1d φ 0 = A B 0 A C + 1 B 2 + B C + 1 B + C = - C + 1 + C
159 144 158 breqtrd φ 0 = A B 0 0 - C + 1 + C
160 0re 0
161 129 121 readdcld φ 0 = A B 0 - C + 1 + C
162 lenlt 0 - C + 1 + C 0 - C + 1 + C ¬ - C + 1 + C < 0
163 160 161 162 sylancr φ 0 = A B 0 0 - C + 1 + C ¬ - C + 1 + C < 0
164 159 163 mpbid φ 0 = A B 0 ¬ - C + 1 + C < 0
165 164 expr φ 0 = A B 0 ¬ - C + 1 + C < 0
166 133 165 pm2.65d φ 0 = A ¬ B 0
167 nne ¬ B 0 B = 0
168 166 167 sylib φ 0 = A B = 0
169 168 sq0id φ 0 = A B 2 = 0
170 simpr φ 0 = A 0 = A
171 170 oveq1d φ 0 = A 0 C = A C
172 3 recnd φ C
173 172 adantr φ 0 = A C
174 173 mul02d φ 0 = A 0 C = 0
175 171 174 eqtr3d φ 0 = A A C = 0
176 175 oveq2d φ 0 = A 4 A C = 4 0
177 27 mul01i 4 0 = 0
178 176 177 eqtrdi φ 0 = A 4 A C = 0
179 169 178 oveq12d φ 0 = A B 2 4 A C = 0 0
180 0m0e0 0 0 = 0
181 0le0 0 0
182 180 181 eqbrtri 0 0 0
183 179 182 eqbrtrdi φ 0 = A B 2 4 A C 0
184 eqid if 1 B + if 0 C C 0 + 1 A B + if 0 C C 0 + 1 A 1 = if 1 B + if 0 C C 0 + 1 A B + if 0 C C 0 + 1 A 1
185 1 2 3 4 184 discr1 φ 0 A
186 leloe 0 A 0 A 0 < A 0 = A
187 160 1 186 sylancr φ 0 A 0 < A 0 = A
188 185 187 mpbid φ 0 < A 0 = A
189 120 183 188 mpjaodan φ B 2 4 A C 0