Skip to content

Commit c479ef2

Browse files
feat(Algebra/Ring/Subring/IntPolynomiall): add intPolynomial (#15733)
Co-authored-by: Filippo A. E. Nuccio <filippo.nuccio@univ-st-etienne.fr> Co-authored-by: María Inés de Frutos-Fernández <88536493+mariainesdff@users.noreply.github.com> Co-authored-by: faenuccio <filippo.nuccio@univ-st-etienne.fr>
1 parent ae7e499 commit c479ef2

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ import Mathlib.Algebra.Ring.Regular
774774
import Mathlib.Algebra.Ring.Semiconj
775775
import Mathlib.Algebra.Ring.Semireal.Defs
776776
import Mathlib.Algebra.Ring.Subring.Basic
777+
import Mathlib.Algebra.Ring.Subring.IntPolynomial
777778
import Mathlib.Algebra.Ring.Subring.MulOpposite
778779
import Mathlib.Algebra.Ring.Subring.Order
779780
import Mathlib.Algebra.Ring.Subring.Pointwise
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

Comments
 (0)