/-Copyright (c) 2026 Carles Marín. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles Marín-/module public import Mathlib.Algebra.Polynomial.Divpublic import Mathlib.RingTheory.Polynomial.Subringpublic import Mathlib.Algebra.Ring.Subring.Basic /-!# The subring generated by the coefficients of a monic factor For a polynomial `F` over a commutative ring `R`, `NotaPuente.A F` is the subring generated byits coefficients. If `F` and `G` are monic and `F * G` has integer coefficients, then`A F = A G`: division by a monic polynomial stays inside any subring containing the coefficients. ## Main results * `NotaPuente.coeff_divByMonic_mem`: `p /ₘ q` has its coefficients in every subring containing those of `p` and of the monic `q` (by lifting to `T[X]` with `Polynomial.toSubring`).* `NotaPuente.A_eq_of_mul_int`: the division lemma, `A F = A G`.* `NotaPuente.A_mul_int_monic`: multiplying by a monic integer polynomial does not change `A`. ## References * C. Marín, *Non-real orders of character values of `GL(n)`*, preprint (2026).* C. Marín, *The ring of character values depends only on the segment: SU(n), Sp(2m) and GL(n) at a torsion element*, Zenodo (2026), doi:10.5281/zenodo.22847476.-/ @[expose] public section namespace NotaPuente open Polynomial variable {R : Type*} [CommRing R] /-- The subring of `R` generated by the coefficients of `F`. -/noncomputable def A (F : R[X]) : Subring R := Subring.closure (F.coeffs : Set R) /-- `A F ≤ T` iff every coefficient of `F` lies in `T`. -/theorem A_le_iff (F : R[X]) (T : Subring R) : A F ≤ T ↔ ∀ n, F.coeff n ∈ T := by constructor · intro h n by_cases hn : F.coeff n = 0 · rw [hn]; exact T.zero_mem · exact h (Subring.subset_closure (coeff_mem_coeffs hn)) · intro h refine Subring.closure_le.mpr ?_ intro c hc obtain ⟨n, -, rfl⟩ := mem_coeffs_iff.mp hc exact h n theorem coeff_mem_A (F : R[X]) (n : ℕ) : F.coeff n ∈ A F := (A_le_iff F (A F)).mp le_rfl n /-- Division by a monic polynomial stays inside any subring containing the coefficients. -/theorem coeff_divByMonic_mem (T : Subring R) {p q : R[X]} (hq : q.Monic) (hp : ∀ n, p.coeff n ∈ T) (hqT : ∀ n, q.coeff n ∈ T) (n : ℕ) : (p /ₘ q).coeff n ∈ T := by have sp : (p.coeffs : Set R) ⊆ T := by intro c hc; obtain ⟨m, -, rfl⟩ := mem_coeffs_iff.mp hc; exact hp m have sq : (q.coeffs : Set R) ⊆ T := by intro c hc; obtain ⟨m, -, rfl⟩ := mem_coeffs_iff.mp hc; exact hqT m have hq' : (q.toSubring T sq).Monic := (monic_toSubring q T sq).mpr hq have key := map_divByMonic (p := p.toSubring T sp) (Subring.subtype T) hq' rw [map_toSubring, map_toSubring] at key rw [← key, coeff_map] exact ((p.toSubring T sp /ₘ q.toSubring T sq).coeff n).2 /-- Coefficients of a polynomial coming from `ℤ[X]` lie in every subring. -/theorem coeff_map_int_mem (T : Subring R) (H : ℤ[X]) (n : ℕ) : (H.map (Int.castRingHom R)).coeff n ∈ T := by rw [coeff_map]; exact intCast_mem T _ /-- One inclusion: `F` monic and `F * G ∈ ℤ[X]` give `A G ≤ A F`. -/theorem A_le_of_mul_int {F G : R[X]} (hF : F.Monic) {H : ℤ[X]} (hFG : F * G = H.map (Int.castRingHom R)) : A G ≤ A F := by rw [A_le_iff] intro n have hG : G = (H.map (Int.castRingHom R)) /ₘ F := by rw [← hFG, mul_divByMonic_cancel_left G hF] rw [hG] exact coeff_divByMonic_mem (A F) hF (coeff_map_int_mem _ H) (coeff_mem_A F) n /-- **Division lemma** (Lemma 2.1 of the note). -/theorem A_eq_of_mul_int {F G : R[X]} (hF : F.Monic) (hG : G.Monic) {H : ℤ[X]} (hFG : F * G = H.map (Int.castRingHom R)) : A F = A G := le_antisymm (A_le_of_mul_int hG (by rw [mul_comm]; exact hFG)) (A_le_of_mul_int hF hFG) /-- **Corollary.** Multiplying by a monic integer polynomial does not change `A`(`F` need not be monic). -/theorem A_mul_int_monic (F : R[X]) {H : ℤ[X]} (hH : H.Monic) : A (F * H.map (Int.castRingHom R)) = A F := by apply le_antisymm · rw [A_le_iff] intro n rw [coeff_mul] exact Subring.sum_mem _ fun x _ => Subring.mul_mem _ (coeff_mem_A F x.1) (coeff_map_int_mem _ H x.2) · rw [A_le_iff] intro n have hm : (H.map (Int.castRingHom R)).Monic := hH.map _ have e : (F * H.map (Int.castRingHom R)) /ₘ H.map (Int.castRingHom R) = F := by rw [mul_comm, mul_divByMonic_cancel_left F hm] have h := coeff_divByMonic_mem (A (F * H.map (Int.castRingHom R))) hm (coeff_mem_A _) (coeff_map_int_mem _ H) n rwa [e] at h end NotaPuente