@@ -27,34 +27,125 @@ universe u v w y z
27
27
28
28
variable {R : Type u} {S : Type v} {k : Type y} {A : Type z} {a b : R} {n : ℕ}
29
29
30
+ section CommRing
31
+
32
+ variable [CommRing R]
33
+
34
+ theorem rootMultiplicity_sub_one_le_derivative_rootMultiplicity_of_ne_zero
35
+ (p : R[X]) (t : R) (hnezero : derivative p ≠ 0 ) :
36
+ p.rootMultiplicity t - 1 ≤ p.derivative.rootMultiplicity t :=
37
+ (le_rootMultiplicity_iff hnezero).2 <|
38
+ pow_sub_one_dvd_derivative_of_pow_dvd (p.pow_rootMultiplicity_dvd t)
39
+
40
+ theorem derivative_rootMultiplicity_of_root_of_mem_nonZeroDivisors
41
+ {p : R[X]} {t : R} (hpt : Polynomial.IsRoot p t)
42
+ (hnzd : (p.rootMultiplicity t : R) ∈ nonZeroDivisors R) :
43
+ (derivative p).rootMultiplicity t = p.rootMultiplicity t - 1 := by
44
+ by_cases h : p = 0
45
+ · simp only [h, map_zero, rootMultiplicity_zero]
46
+ obtain ⟨g, hp, hndvd⟩ := p.exists_eq_pow_rootMultiplicity_mul_and_not_dvd h t
47
+ set m := p.rootMultiplicity t
48
+ have hm : m - 1 + 1 = m := Nat.sub_add_cancel <| (rootMultiplicity_pos h).2 hpt
49
+ have hndvd : ¬(X - C t) ^ m ∣ derivative p := by
50
+ rw [hp, derivative_mul, dvd_add_left (dvd_mul_right _ _),
51
+ derivative_X_sub_C_pow, ← hm, pow_succ', hm, mul_comm (C _), mul_assoc,
52
+ dvd_cancel_left_mem_nonZeroDivisors (monic_X_sub_C t |>.pow _ |>.mem_nonZeroDivisors)]
53
+ rw [dvd_iff_isRoot, IsRoot] at hndvd ⊢
54
+ rwa [eval_mul, eval_C, mul_left_mem_nonZeroDivisors_eq_zero_iff hnzd]
55
+ have hnezero : derivative p ≠ 0 := fun h ↦ hndvd (by rw [h]; exact dvd_zero _)
56
+ exact le_antisymm (by rwa [rootMultiplicity_le_iff hnezero, hm])
57
+ (rootMultiplicity_sub_one_le_derivative_rootMultiplicity_of_ne_zero _ t hnezero)
58
+
59
+ theorem isRoot_iterate_derivative_of_lt_rootMultiplicity {p : R[X]} {t : R} {n : ℕ}
60
+ (hn : n < p.rootMultiplicity t) : (derivative^[n] p).IsRoot t :=
61
+ dvd_iff_isRoot.mp <| (dvd_pow_self _ <| Nat.sub_ne_zero_of_lt hn).trans
62
+ (pow_sub_dvd_iterate_derivative_of_pow_dvd _ <| p.pow_rootMultiplicity_dvd t)
63
+
64
+ open Finset in
65
+ theorem eval_iterate_derivative_rootMultiplicity {p : R[X]} {t : R} :
66
+ (derivative^[p.rootMultiplicity t] p).eval t =
67
+ (p.rootMultiplicity t).factorial • (p /ₘ (X - C t) ^ p.rootMultiplicity t).eval t := by
68
+ set m := p.rootMultiplicity t with hm
69
+ conv_lhs => rw [← p.pow_mul_divByMonic_rootMultiplicity_eq t, ← hm]
70
+ rw [iterate_derivative_mul, eval_finset_sum, sum_eq_single_of_mem _ (mem_range.mpr m.succ_pos)]
71
+ · rw [m.choose_zero_right, one_smul, eval_mul, m.sub_zero, iterate_derivative_X_sub_pow_self,
72
+ eval_nat_cast, nsmul_eq_mul]; rfl
73
+ · intro b hb hb0
74
+ rw [iterate_derivative_X_sub_pow, eval_smul, eval_mul, eval_smul, eval_pow,
75
+ Nat.sub_sub_self (mem_range_succ_iff.mp hb), eval_sub, eval_X, eval_C, sub_self,
76
+ zero_pow' b hb0, smul_zero, zero_mul, smul_zero]
77
+
78
+ theorem lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors
79
+ {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 )
80
+ (hroot : ∀ m ≤ n, (derivative^[m] p).IsRoot t)
81
+ (hnzd : (n.factorial : R) ∈ nonZeroDivisors R) :
82
+ n < p.rootMultiplicity t := by
83
+ by_contra! h'
84
+ replace hroot := hroot _ h'
85
+ simp only [IsRoot, eval_iterate_derivative_rootMultiplicity] at hroot
86
+ obtain ⟨q, hq⟩ := Nat.coe_nat_dvd (α := R) <| Nat.factorial_dvd_factorial h'
87
+ rw [hq, mul_mem_nonZeroDivisors] at hnzd
88
+ rw [nsmul_eq_mul, mul_left_mem_nonZeroDivisors_eq_zero_iff hnzd.1 ] at hroot
89
+ exact eval_divByMonic_pow_rootMultiplicity_ne_zero t h hroot
90
+
91
+ theorem lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors'
92
+ {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 )
93
+ (hroot : ∀ m ≤ n, (derivative^[m] p).IsRoot t)
94
+ (hnzd : ∀ m ≤ n, m ≠ 0 → (m : R) ∈ nonZeroDivisors R) :
95
+ n < p.rootMultiplicity t := by
96
+ apply lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors h hroot
97
+ clear hroot
98
+ induction' n with n ih
99
+ · simp only [Nat.zero_eq, Nat.factorial_zero, Nat.cast_one]
100
+ exact Submonoid.one_mem _
101
+ · rw [Nat.factorial_succ, Nat.cast_mul, mul_mem_nonZeroDivisors]
102
+ exact ⟨hnzd _ le_rfl n.succ_ne_zero, ih fun m h ↦ hnzd m (h.trans n.le_succ)⟩
103
+
104
+ theorem lt_rootMultiplicity_iff_isRoot_iterate_derivative_of_mem_nonZeroDivisors
105
+ {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 )
106
+ (hnzd : (n.factorial : R) ∈ nonZeroDivisors R) :
107
+ n < p.rootMultiplicity t ↔ ∀ m ≤ n, (derivative^[m] p).IsRoot t :=
108
+ ⟨fun hn _ hm ↦ isRoot_iterate_derivative_of_lt_rootMultiplicity <| hm.trans_lt hn,
109
+ fun hr ↦ lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors h hr hnzd⟩
110
+
111
+ theorem lt_rootMultiplicity_iff_isRoot_iterate_derivative_of_mem_nonZeroDivisors'
112
+ {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 )
113
+ (hnzd : ∀ m ≤ n, m ≠ 0 → (m : R) ∈ nonZeroDivisors R) :
114
+ n < p.rootMultiplicity t ↔ ∀ m ≤ n, (derivative^[m] p).IsRoot t :=
115
+ ⟨fun hn _ hm ↦ isRoot_iterate_derivative_of_lt_rootMultiplicity <| Nat.lt_of_le_of_lt hm hn,
116
+ fun hr ↦ lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors' h hr hnzd⟩
117
+
118
+ theorem one_lt_rootMultiplicity_iff_isRoot_iterate_derivative
119
+ {p : R[X]} {t : R} (h : p ≠ 0 ) :
120
+ 1 < p.rootMultiplicity t ↔ ∀ m ≤ 1 , (derivative^[m] p).IsRoot t :=
121
+ lt_rootMultiplicity_iff_isRoot_iterate_derivative_of_mem_nonZeroDivisors h
122
+ (by rw [Nat.factorial_one, Nat.cast_one]; exact Submonoid.one_mem _)
123
+
124
+ theorem one_lt_rootMultiplicity_iff_isRoot
125
+ {p : R[X]} {t : R} (h : p ≠ 0 ) :
126
+ 1 < p.rootMultiplicity t ↔ p.IsRoot t ∧ (derivative p).IsRoot t := by
127
+ rw [one_lt_rootMultiplicity_iff_isRoot_iterate_derivative h]
128
+ refine ⟨fun h ↦ ⟨h 0 (by norm_num), h 1 (by norm_num)⟩, fun ⟨h0, h1⟩ m hm ↦ ?_⟩
129
+ obtain (_|_|m) := m
130
+ exacts [h0, h1, by linarith [hm]]
131
+
132
+ end CommRing
133
+
30
134
section IsDomain
31
135
32
136
variable [CommRing R] [IsDomain R]
33
137
138
+ theorem one_lt_rootMultiplicity_iff_isRoot_gcd
139
+ [GCDMonoid R[X]] {p : R[X]} {t : R} (h : p ≠ 0 ) :
140
+ 1 < p.rootMultiplicity t ↔ (gcd p (derivative p)).IsRoot t := by
141
+ simp_rw [one_lt_rootMultiplicity_iff_isRoot h, ← dvd_iff_isRoot, dvd_gcd_iff]
142
+
34
143
theorem derivative_rootMultiplicity_of_root [CharZero R] {p : R[X]} {t : R} (hpt : p.IsRoot t) :
35
144
p.derivative.rootMultiplicity t = p.rootMultiplicity t - 1 := by
36
- rcases eq_or_ne p 0 with (rfl | hp)
37
- · simp
38
- nth_rw 1 [← p.pow_mul_divByMonic_rootMultiplicity_eq t, mul_comm]
39
- simp only [derivative_pow, derivative_mul, derivative_sub, derivative_X, derivative_C, sub_zero,
40
- mul_one]
41
- set n := p.rootMultiplicity t - 1
42
- have hn : n + 1 = _ := tsub_add_cancel_of_le ((rootMultiplicity_pos hp).mpr hpt)
43
- rw [← hn]
44
- set q := p /ₘ (X - C t) ^ (n + 1 ) with _hq
45
- convert_to rootMultiplicity t ((X - C t) ^ n * (derivative q * (X - C t) + q * C ↑(n + 1 ))) = n
46
- · congr
47
- rw [mul_add, mul_left_comm <| (X - C t) ^ n, ← pow_succ']
48
- congr 1
49
- rw [mul_left_comm <| (X - C t) ^ n, mul_comm <| (X - C t) ^ n]
50
- have h : eval t (derivative q * (X - C t) + q * C (R := R) ↑(n + 1 )) ≠ 0 := by
51
- suffices eval t q * ↑(n + 1 ) ≠ 0 by simpa
52
- refine' mul_ne_zero _ (Nat.cast_ne_zero.mpr n.succ_ne_zero)
53
- convert eval_divByMonic_pow_rootMultiplicity_ne_zero t hp
54
- rw [rootMultiplicity_mul, rootMultiplicity_X_sub_C_pow, rootMultiplicity_eq_zero h, add_zero]
55
- refine' mul_ne_zero (pow_ne_zero n <| X_sub_C_ne_zero t) _
56
- contrapose! h
57
- rw [h, eval_zero]
145
+ by_cases h : p = 0
146
+ · rw [h, map_zero, rootMultiplicity_zero]
147
+ exact derivative_rootMultiplicity_of_root_of_mem_nonZeroDivisors hpt <|
148
+ mem_nonZeroDivisors_of_ne_zero <| Nat.cast_ne_zero.2 ((rootMultiplicity_pos h).2 hpt).ne'
58
149
#align polynomial.derivative_root_multiplicity_of_root Polynomial.derivative_rootMultiplicity_of_root
59
150
60
151
theorem rootMultiplicity_sub_one_le_derivative_rootMultiplicity [CharZero R] (p : R[X]) (t : R) :
@@ -65,6 +156,19 @@ theorem rootMultiplicity_sub_one_le_derivative_rootMultiplicity [CharZero R] (p
65
156
exact zero_le _
66
157
#align polynomial.root_multiplicity_sub_one_le_derivative_root_multiplicity Polynomial.rootMultiplicity_sub_one_le_derivative_rootMultiplicity
67
158
159
+ theorem lt_rootMultiplicity_of_isRoot_iterate_derivative
160
+ [CharZero R] {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 )
161
+ (hroot : ∀ m ≤ n, (derivative^[m] p).IsRoot t) :
162
+ n < p.rootMultiplicity t :=
163
+ lt_rootMultiplicity_of_isRoot_iterate_derivative_of_mem_nonZeroDivisors h hroot <|
164
+ mem_nonZeroDivisors_of_ne_zero <| Nat.cast_ne_zero.2 <| Nat.factorial_ne_zero n
165
+
166
+ theorem lt_rootMultiplicity_iff_isRoot_iterate_derivative
167
+ [CharZero R] {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0 ) :
168
+ n < p.rootMultiplicity t ↔ ∀ m ≤ n, (derivative^[m] p).IsRoot t :=
169
+ ⟨fun hn _ hm ↦ isRoot_iterate_derivative_of_lt_rootMultiplicity <| Nat.lt_of_le_of_lt hm hn,
170
+ fun hr ↦ lt_rootMultiplicity_of_isRoot_iterate_derivative h hr⟩
171
+
68
172
section NormalizationMonoid
69
173
70
174
variable [NormalizationMonoid R]
0 commit comments