|
| 1 | +/- |
| 2 | +Copyright (c) 2024 María Inés de Frutos-Fernández, Filippo A. E. Nuccio. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: María Inés de Frutos-Fernández, Filippo A. E. Nuccio |
| 5 | +-/ |
| 6 | +import Mathlib.Algebra.Polynomial.AlgebraMap |
| 7 | + |
| 8 | +/-! |
| 9 | +# Polynomials over subrings. |
| 10 | +
|
| 11 | +Given a field `K` with a subring `R`, in this file we construct a map from polynomials in `K[X]` |
| 12 | +with coefficients in `R` to `R[X]`. We provide several lemmas to deal with |
| 13 | +coefficients, degree, and evaluation of `intPolynomial`. |
| 14 | +This is useful when dealing with integral elements in an extension of fields. |
| 15 | +
|
| 16 | +# Main Definitions |
| 17 | +* `Polynomial.int` : given a polynomial `P`. in `K[X]` with coefficients in a field `K` with a |
| 18 | + subring `R` such that all coefficients belong to `R`, `P.int R` is the corresponding polynomial |
| 19 | + in `R[X]`. |
| 20 | +-/ |
| 21 | + |
| 22 | +variable {K : Type*} [Field K] (R : Subring K) |
| 23 | + |
| 24 | +open Polynomial |
| 25 | + |
| 26 | +open scoped Polynomial |
| 27 | + |
| 28 | +/-- Given a polynomial in `K[X]` such that all coefficients belong to the subring `R`, |
| 29 | + `intPolynomial` is the corresponding polynomial in `R[X]`. -/ |
| 30 | +def Polynomial.int (P : K[X]) (hP : ∀ n : ℕ, P.coeff n ∈ R) : R[X] where |
| 31 | + toFinsupp := |
| 32 | + { support := P.support |
| 33 | + toFun := fun n => ⟨P.coeff n, hP n⟩ |
| 34 | + mem_support_toFun := fun n => by |
| 35 | + rw [ne_eq, ← Subring.coe_eq_zero_iff, mem_support_iff] } |
| 36 | + |
| 37 | +namespace Polynomial |
| 38 | + |
| 39 | +variable (P : K[X]) (hP : ∀ n : ℕ, P.coeff n ∈ R) |
| 40 | + |
| 41 | +@[simp] |
| 42 | +theorem int_coeff_eq (n : ℕ) : ↑((P.int R hP).coeff n) = P.coeff n := rfl |
| 43 | + |
| 44 | +@[simp] |
| 45 | +theorem int_leadingCoeff_eq : ↑(P.int R hP).leadingCoeff = P.leadingCoeff := rfl |
| 46 | + |
| 47 | +@[simp] |
| 48 | +theorem int_monic_iff : (P.int R hP).Monic ↔ P.Monic := by |
| 49 | + rw [Monic, Monic, ← int_leadingCoeff_eq, OneMemClass.coe_eq_one] |
| 50 | + |
| 51 | +@[simp] |
| 52 | +theorem int_natDegree : (P.int R hP).natDegree = P.natDegree := rfl |
| 53 | + |
| 54 | +variable {L : Type*} [Field L] [Algebra K L] |
| 55 | + |
| 56 | +@[simp] |
| 57 | +theorem int_eval₂_eq (x : L) : |
| 58 | + eval₂ (algebraMap R L) x (P.int R hP) = aeval x P := by |
| 59 | + rw [aeval_eq_sum_range, eval₂_eq_sum_range] |
| 60 | + exact Finset.sum_congr rfl (fun n _ => by rw [Algebra.smul_def]; rfl) |
| 61 | + |
| 62 | +end Polynomial |
0 commit comments