Skip to content

Commit 0bd43a9

Browse files
committed
chore(RingTheory/Polynomial): rename frange to coeffs (#12919)
Renames `Polynomial.frange` to `Polynomial.coeffs`.
1 parent 7823218 commit 0bd43a9

File tree

6 files changed

+47
-39
lines changed

6 files changed

+47
-39
lines changed

Mathlib/FieldTheory/Adjoin.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,12 +1165,12 @@ theorem adjoin_eq_top_of_adjoin_eq_top [Algebra E K] [IsScalarTower F E K]
11651165
`F` adjoin the coefficients of `minpoly K α` is equal to `K` itself. -/
11661166
theorem adjoin_minpoly_coeff_of_exists_primitive_element
11671167
[FiniteDimensional F E] (hprim : adjoin F {α} = ⊤) (K : IntermediateField F E) :
1168-
adjoin F ((minpoly K α).map (algebraMap K E)).frange = K := by
1168+
adjoin F ((minpoly K α).map (algebraMap K E)).coeffs = K := by
11691169
set g := (minpoly K α).map (algebraMap K E)
1170-
set K' : IntermediateField F E := adjoin F g.frange
1170+
set K' : IntermediateField F E := adjoin F g.coeffs
11711171
have hsub : K' ≤ K := by
11721172
refine adjoin_le_iff.mpr fun x ↦ ?_
1173-
rw [Finset.mem_coe, mem_frange_iff]
1173+
rw [Finset.mem_coe, mem_coeffs_iff]
11741174
rintro ⟨n, -, rfl⟩
11751175
rw [coeff_map]
11761176
apply Subtype.mem

Mathlib/FieldTheory/Fixed.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ variable [Fintype G] (x : F)
171171
/-- `minpoly G F x` is the minimal polynomial of `(x : F)` over `FixedPoints.subfield G F`. -/
172172
def minpoly : Polynomial (FixedPoints.subfield G F) :=
173173
(prodXSubSMul G F x).toSubring (FixedPoints.subfield G F).toSubring fun _ hc g =>
174-
let ⟨n, _, hn⟩ := Polynomial.mem_frange_iff.1 hc
174+
let ⟨n, _, hn⟩ := Polynomial.mem_coeffs_iff.1 hc
175175
hn.symm ▸ prodXSubSMul.coeff G F x g n
176176
#align fixed_points.minpoly FixedPoints.minpoly
177177

Mathlib/FieldTheory/PrimitiveElement.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ theorem finite_intermediateField_of_exists_primitive_element [Algebra.IsAlgebrai
335335
-- The map `K ↦ g` is injective
336336
have hinj : Function.Injective g := fun K K' heq ↦ by
337337
rw [Subtype.mk.injEq] at heq
338-
apply_fun fun f : E[X] ↦ adjoin F (f.frange : Set E) at heq
338+
apply_fun fun f : E[X] ↦ adjoin F (f.coeffs : Set E) at heq
339339
simpa only [adjoin_minpoly_coeff_of_exists_primitive_element F hprim] using heq
340340
-- Therefore there are only finitely many intermediate fields
341341
exact Finite.of_injective g hinj

Mathlib/FieldTheory/SeparableDegree.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ variable {E K} in
759759
theorem Polynomial.Separable.comap_minpoly_of_isSeparable [Algebra E K] [IsScalarTower F E K]
760760
[IsSeparable F E] {x : K} (hsep : (minpoly E x).Separable) : (minpoly F x).Separable := by
761761
set f := minpoly E x with hf
762-
let E' : IntermediateField F E := adjoin F f.frange
762+
let E' : IntermediateField F E := adjoin F f.coeffs
763763
haveI : FiniteDimensional F E' := finiteDimensional_adjoin fun x _ ↦ IsSeparable.isIntegral F x
764764
let g : E'[X] := f.toSubring E'.toSubring (subset_adjoin F _)
765765
have h : g.map (algebraMap E' E) = f := f.map_toSubring E'.toSubring (subset_adjoin F _)

Mathlib/RingTheory/IntegralClosure.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ and x is an element of an A-algebra that is integral over A, then x is integral
862862
theorem isIntegral_trans [Algebra.IsIntegral R A] (x : B) (hx : IsIntegral A x) :
863863
IsIntegral R x := by
864864
rcases hx with ⟨p, pmonic, hp⟩
865-
let S := adjoin R (p.frange : Set A)
865+
let S := adjoin R (p.coeffs : Set A)
866866
have : Module.Finite R S := ⟨(Subalgebra.toSubmodule S).fg_top.mpr <|
867-
fg_adjoin_of_finite p.frange.finite_toSet fun a _ ↦ Algebra.IsIntegral.isIntegral a⟩
867+
fg_adjoin_of_finite p.coeffs.finite_toSet fun a _ ↦ Algebra.IsIntegral.isIntegral a⟩
868868
let p' : S[X] := p.toSubring S.toSubring subset_adjoin
869869
have hSx : IsIntegral S x := ⟨p', (p.monic_toSubring _ _).mpr pmonic, by
870870
rw [IsScalarTower.algebraMap_eq S A B, ← eval₂_map]

Mathlib/RingTheory/Polynomial/Basic.lean

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -249,34 +249,40 @@ theorem not_finite [Nontrivial R] : ¬ Module.Finite R R[X] := by
249249
exact one_ne_zero this
250250

251251
/-- The finset of nonzero coefficients of a polynomial. -/
252-
def frange (p : R[X]) : Finset R :=
252+
def coeffs (p : R[X]) : Finset R :=
253253
letI := Classical.decEq R
254254
Finset.image (fun n => p.coeff n) p.support
255-
#align polynomial.frange Polynomial.frange
255+
#align polynomial.frange Polynomial.coeffs
256256

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]) = ∅ :=
258260
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
260264

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
264268

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
266272
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
276280
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]
278282
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
280286

281287
theorem geom_sum_X_comp_X_add_one_eq_sum (n : ℕ) :
282288
(∑ i in range n, (X : R[X]) ^ i).comp (X + 1) =
@@ -332,14 +338,14 @@ variable [Ring R]
332338

333339
/-- Given a polynomial, return the polynomial whose coefficients are in
334340
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)) :=
336342
∑ i in p.support,
337343
monomial i
338344
(⟨p.coeff i,
339345
letI := Classical.decEq R
340346
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))
343349
#align polynomial.restriction Polynomial.restriction
344350

345351
@[simp]
@@ -402,7 +408,7 @@ variable [Semiring S] {f : R →+* S} {x : S}
402408

403409
theorem eval₂_restriction {p : R[X]} :
404410
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
406412
simp only [eval₂_eq_sum, sum, support_restriction, ← @coeff_restriction _ _ p, RingHom.comp_apply,
407413
Subring.coeSubtype]
408414
#align polynomial.eval₂_restriction Polynomial.eval₂_restriction
@@ -413,15 +419,15 @@ variable (p : R[X]) (T : Subring R)
413419

414420
/-- Given a polynomial `p` and a subring `T` that contains the coefficients of `p`,
415421
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] :=
417423
∑ i in p.support,
418424
monomial i
419425
(⟨p.coeff i,
420426
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)
422428
#align polynomial.to_subring Polynomial.toSubring
423429

424-
variable (hp : (↑p.frange : Set R) ⊆ T)
430+
variable (hp : (↑p.coeffs : Set R) ⊆ T)
425431

426432
@[simp]
427433
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
462468
#align polynomial.monic_to_subring Polynomial.monic_toSubring
463469

464470
@[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
466472
ext i
467473
simp
468474
#align polynomial.to_subring_zero Polynomial.toSubring_zero
469475

470476
@[simp]
471477
theorem toSubring_one :
472478
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) =
474480
1 :=
475481
ext fun i => Subtype.eq <| by
476482
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
501507
#align polynomial.coeff_of_subring Polynomial.coeff_ofSubring
502508

503509
@[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
505511
classical
506512
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,
508514
(Finset.coe_image)] at hi
509515
rcases hi with ⟨n, _, h'n⟩
510516
rw [← h'n, coeff_ofSubring]
511517
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
513521

514522
end Ring
515523

0 commit comments

Comments
 (0)