@@ -249,34 +249,40 @@ theorem not_finite [Nontrivial R] : ¬ Module.Finite R R[X] := by
249
249
exact one_ne_zero this
250
250
251
251
/-- The finset of nonzero coefficients of a polynomial. -/
252
- def frange (p : R[X]) : Finset R :=
252
+ def coeffs (p : R[X]) : Finset R :=
253
253
letI := Classical.decEq R
254
254
Finset.image (fun n => p.coeff n) p.support
255
- #align polynomial.frange Polynomial.frange
255
+ #align polynomial.frange Polynomial.coeffs
256
256
257
- theorem frange_zero : frange (0 : R[X]) = ∅ :=
257
+ @[deprecated (since := "2024-05-17")] noncomputable alias frange := coeffs
258
+
259
+ theorem coeffs_zero : coeffs (0 : R[X]) = ∅ :=
258
260
rfl
259
- #align polynomial.frange_zero Polynomial.frange_zero
261
+ #align polynomial.frange_zero Polynomial.coeffs_zero
262
+
263
+ @[deprecated (since := "2024-05-17")] alias frange_zero := coeffs_zero
260
264
261
- theorem mem_frange_iff {p : R[X]} {c : R} : c ∈ p.frange ↔ ∃ n ∈ p.support, c = p.coeff n := by
262
- simp [frange , eq_comm, (Finset.mem_image)]
263
- #align polynomial.mem_frange_iff Polynomial.mem_frange_iff
265
+ theorem mem_coeffs_iff {p : R[X]} {c : R} : c ∈ p.coeffs ↔ ∃ n ∈ p.support, c = p.coeff n := by
266
+ simp [coeffs , eq_comm, (Finset.mem_image)]
267
+ #align polynomial.mem_frange_iff Polynomial.mem_coeffs_iff
264
268
265
- theorem frange_one : frange (1 : R[X]) ⊆ {1 } := by
269
+ @[deprecated (since := "2024-05-17")] alias mem_frange_iff := mem_coeffs_iff
270
+
271
+ theorem coeffs_one : coeffs (1 : R[X]) ⊆ {1 } := by
266
272
classical
267
- simp only [frange]
268
- rw [Finset.image_subset_iff]
269
- simp only [mem_support_iff, ne_eq, mem_singleton, ← C_1, coeff_C]
270
- intro n hn
271
- simp only [exists_prop, ite_eq_right_iff, not_forall] at hn
272
- simp [hn]
273
- #align polynomial.frange_one Polynomial.frange_one
274
-
275
- theorem coeff_mem_frange (p : R[X]) (n : ℕ) (h : p.coeff n ≠ 0 ) : p.coeff n ∈ p.frange := by
273
+ simp_rw [coeffs, Finset.image_subset_iff]
274
+ simp_all [coeff_one]
275
+ #align polynomial.frange_one Polynomial.coeffs_one
276
+
277
+ @[deprecated (since := "2024-05-17")] alias frange_one := coeffs_one
278
+
279
+ theorem coeff_mem_coeffs (p : R[X]) (n : ℕ) (h : p.coeff n ≠ 0 ) : p.coeff n ∈ p.coeffs := by
276
280
classical
277
- simp only [frange , exists_prop, mem_support_iff, Finset.mem_image, Ne]
281
+ simp only [coeffs , exists_prop, mem_support_iff, Finset.mem_image, Ne]
278
282
exact ⟨n, h, rfl⟩
279
- #align polynomial.coeff_mem_frange Polynomial.coeff_mem_frange
283
+ #align polynomial.coeff_mem_frange Polynomial.coeff_mem_coeffs
284
+
285
+ @[deprecated (since := "2024-05-17")] alias coeff_mem_frange := coeff_mem_coeffs
280
286
281
287
theorem geom_sum_X_comp_X_add_one_eq_sum (n : ℕ) :
282
288
(∑ i in range n, (X : R[X]) ^ i).comp (X + 1 ) =
@@ -332,14 +338,14 @@ variable [Ring R]
332
338
333
339
/-- Given a polynomial, return the polynomial whose coefficients are in
334
340
the ring closure of the original coefficients. -/
335
- def restriction (p : R[X]) : Polynomial (Subring.closure (↑p.frange : Set R)) :=
341
+ def restriction (p : R[X]) : Polynomial (Subring.closure (↑p.coeffs : Set R)) :=
336
342
∑ i in p.support,
337
343
monomial i
338
344
(⟨p.coeff i,
339
345
letI := Classical.decEq R
340
346
if H : p.coeff i = 0 then H.symm ▸ (Subring.closure _).zero_mem
341
- else Subring.subset_closure (p.coeff_mem_frange _ H)⟩ :
342
- Subring.closure (↑p.frange : Set R))
347
+ else Subring.subset_closure (p.coeff_mem_coeffs _ H)⟩ :
348
+ Subring.closure (↑p.coeffs : Set R))
343
349
#align polynomial.restriction Polynomial.restriction
344
350
345
351
@[simp]
@@ -402,7 +408,7 @@ variable [Semiring S] {f : R →+* S} {x : S}
402
408
403
409
theorem eval₂_restriction {p : R[X]} :
404
410
eval₂ f x p =
405
- eval₂ (f.comp (Subring.subtype (Subring.closure (p.frange : Set R)))) x p.restriction := by
411
+ eval₂ (f.comp (Subring.subtype (Subring.closure (p.coeffs : Set R)))) x p.restriction := by
406
412
simp only [eval₂_eq_sum, sum, support_restriction, ← @coeff_restriction _ _ p, RingHom.comp_apply,
407
413
Subring.coeSubtype]
408
414
#align polynomial.eval₂_restriction Polynomial.eval₂_restriction
@@ -413,15 +419,15 @@ variable (p : R[X]) (T : Subring R)
413
419
414
420
/-- Given a polynomial `p` and a subring `T` that contains the coefficients of `p`,
415
421
return the corresponding polynomial whose coefficients are in `T`. -/
416
- def toSubring (hp : (↑p.frange : Set R) ⊆ T) : T[X] :=
422
+ def toSubring (hp : (↑p.coeffs : Set R) ⊆ T) : T[X] :=
417
423
∑ i in p.support,
418
424
monomial i
419
425
(⟨p.coeff i,
420
426
letI := Classical.decEq R
421
- if H : p.coeff i = 0 then H.symm ▸ T.zero_mem else hp (p.coeff_mem_frange _ H)⟩ : T)
427
+ if H : p.coeff i = 0 then H.symm ▸ T.zero_mem else hp (p.coeff_mem_coeffs _ H)⟩ : T)
422
428
#align polynomial.to_subring Polynomial.toSubring
423
429
424
- variable (hp : (↑p.frange : Set R) ⊆ T)
430
+ variable (hp : (↑p.coeffs : Set R) ⊆ T)
425
431
426
432
@[simp]
427
433
theorem coeff_toSubring {n : ℕ} : ↑(coeff (toSubring p T hp) n) = coeff p n := by
@@ -462,15 +468,15 @@ theorem monic_toSubring : Monic (toSubring p T hp) ↔ Monic p := by
462
468
#align polynomial.monic_to_subring Polynomial.monic_toSubring
463
469
464
470
@[simp]
465
- theorem toSubring_zero : toSubring (0 : R[X]) T (by simp [frange_zero ]) = 0 := by
471
+ theorem toSubring_zero : toSubring (0 : R[X]) T (by simp [coeffs ]) = 0 := by
466
472
ext i
467
473
simp
468
474
#align polynomial.to_subring_zero Polynomial.toSubring_zero
469
475
470
476
@[simp]
471
477
theorem toSubring_one :
472
478
toSubring (1 : R[X]) T
473
- (Set.Subset.trans frange_one <| Finset.singleton_subset_set_iff.2 T.one_mem) =
479
+ (Set.Subset.trans coeffs_one <| Finset.singleton_subset_set_iff.2 T.one_mem) =
474
480
1 :=
475
481
ext fun i => Subtype.eq <| by
476
482
rw [coeff_toSubring', coeff_one, coeff_one, apply_ite Subtype.val, ZeroMemClass.coe_zero,
@@ -501,15 +507,17 @@ theorem coeff_ofSubring (p : T[X]) (n : ℕ) : coeff (ofSubring T p) n = (coeff
501
507
#align polynomial.coeff_of_subring Polynomial.coeff_ofSubring
502
508
503
509
@[simp]
504
- theorem frange_ofSubring {p : T[X]} : (↑(p.ofSubring T).frange : Set R) ⊆ T := by
510
+ theorem coeffs_ofSubring {p : T[X]} : (↑(p.ofSubring T).coeffs : Set R) ⊆ T := by
505
511
classical
506
512
intro i hi
507
- simp only [frange , Set.mem_image, mem_support_iff, Ne, Finset.mem_coe,
513
+ simp only [coeffs , Set.mem_image, mem_support_iff, Ne, Finset.mem_coe,
508
514
(Finset.coe_image)] at hi
509
515
rcases hi with ⟨n, _, h'n⟩
510
516
rw [← h'n, coeff_ofSubring]
511
517
exact Subtype.mem (coeff p n : T)
512
- #align polynomial.frange_of_subring Polynomial.frange_ofSubring
518
+ #align polynomial.frange_of_subring Polynomial.coeffs_ofSubring
519
+
520
+ @[deprecated (since := "2024-05-17")] alias frange_ofSubring := coeffs_ofSubring
513
521
514
522
end Ring
515
523
0 commit comments