|
|
|
|
Quelle Ideal.lean
Sprache: Lean
|
|
/-
Copyright (c) 2023 Eric Wieser. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Wieser
-/
module
public import Mathlib.RingTheory.Ideal.Quotient.Operations
public import Mathlib.RingTheory.MvPolynomial.MonomialOrder
import Mathlib.Algebra.MonoidAlgebra.Ideal
import Mathlib.Algebra.MvPolynomial.Division
import Mathlib.Algebra.Order.Group.Pointwise.Interval
/-!
# Lemmas about ideals of `MvPolynomial`
Notably this contains results about monomial ideals.
## Main results
* `MvPolynomial.mem_ideal_span_monomial_image`
* `MvPolynomial.mem_ideal_span_X_image`
* `MvPolynomial.mem_pow_idealOfVars_iff`
* `MvPolynomial.span_X_image_isPrime`: The ideal generated by a set of indeterminates of a
polynomial ring is prime over a nontrivial semiring with no zero divisors.
-/
public section
variable {σ R : Type*}
namespace MvPolynomial
variable [CommSemiring R]
/-- `x` is in a monomial ideal generated by `s` iff every element of its support dominates one of
the generators. Note that `si ≤ xi` is analogous to saying that the monomial corresponding to `si`
divides the monomial corresponding to `xi`. -/
theorem mem_ideal_span_monomial_image {x : MvPolynomial σ R} {s : Set (σ →₀ ℕ)} :
x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔ ∀ xi ∈ x.support, ∃ si ∈ s, si ≤ xi := by
refine AddMonoidAlgebra.mem_ideal_span_of'_image.trans ?_
simp_rw [le_iff_exists_add, add_comm]
rfl
theorem mem_ideal_span_monomial_image_iff_dvd {x : MvPolynomial σ R} {s : Set (σ →₀ ℕ)} :
x ∈ Ideal.span ((fun s => monomial s (1 : R)) '' s) ↔
∀ xi ∈ x.support, ∃ si ∈ s, monomial si 1 ∣ monomial xi (x.coeff xi) := by
refine mem_ideal_span_monomial_image.trans (forall₂_congr fun xi hxi => ?_)
simp_rw [monomial_dvd_monomial, one_dvd, and_true, mem_support_iff.mp hxi, false_or]
/-- `x` is in a monomial ideal generated by variables `X` iff every element of its support
has a component in `s`. -/
theorem mem_ideal_span_X_image {x : MvPolynomial σ R} {s : Set σ} :
x ∈ Ideal.span (MvPolynomial.X '' s : Set (MvPolynomial σ R)) ↔
∀ m ∈ x.support, ∃ i ∈ s, (m : σ →₀ ℕ) i ≠ 0 := by
have := @mem_ideal_span_monomial_image σ R _ x ((fun i => Finsupp.single i 1) '' s)
rw [Set.image_image] at this
refine this.trans ?_
simp [Nat.one_le_iff_ne_zero]
theorem span_X_image_eq_ker_aeval_ite_mem (s : Set σ) [DecidablePred (· ∈ s)] :
Ideal.span (X '' s : Set (MvPolynomial σ R)) =
RingHom.ker (aeval (fun x ↦ if x ∈ sᶜ then X (R := R) x else 0)) := by
classical
refine Submodule.span_eq_of_le _ (fun _ ⟨_, hx⟩ ↦ by simp [← hx.2, hx.1]) (fun _ hx ↦ ?_)
refine mem_ideal_span_X_image.mpr fun y _ ↦ ?_
rw [RingHom.mem_ker, aeval_ite_mem_eq, eq_zero_iff] at hx
specialize hx y
rw [coeff_sum, Finset.sum_eq_single y] at hx
all_goals grind [AddMonoidAlgebra.coeff_eq_zero, coeff_monomial]
theorem span_X_image_isPrime [Nontrivial R] [NoZeroDivisors R] (s : Set σ) :
(Ideal.span (X '' s : Set (MvPolynomial σ R))).IsPrime := by
classical
rw [span_X_image_eq_ker_aeval_ite_mem]
exact RingHom.ker_isPrime _
section idealOfVars
open Finset Finsupp
variable (σ R) in
/-- The ideal spanned by all variables. -/
noncomputable abbrev idealOfVars : Ideal (MvPolynomial σ R) := .span (.range X)
variable (σ R) in
lemma isPrime_idealOfVars [Nontrivial R] [NoZeroDivisors R] : (idealOfVars σ R).IsPrime := by
rw [idealOfVars, ← Set.image_univ]
exact span_X_image_isPrime ..
variable (σ R) in
lemma fg_idealOfVars [Finite σ] : (idealOfVars σ R).FG :=
Submodule.fg_span <| Set.finite_range _
@[deprecated (since := "2026-10-18")]
alias idealOfVars_fg := fg_idealOfVars
set_option backward.isDefEq.respectTransparency false in
lemma idealOfVars_eq_restrictSupportIdeal :
idealOfVars σ R = restrictSupportIdeal _ _ ((IsUpperSet.Ici 1).preimage degree_mono) := by
apply le_antisymm
· simp [idealOfVars, Ideal.span_le, Set.range_subset_iff, restrictSupportIdeal, X]
· simp only [IsConcreteLE.le_iff, restrictSupportIdeal, Submodule.mem_mk,
Submodule.mem_toAddSubmonoid, ← Submodule.restrictScalars_mem R (idealOfVars σ R)]
rw [← IsConcreteLE.le_iff, restrictSupport_eq_span, Submodule.span_le, Set.image_subset_iff]
intro x hx
obtain ⟨i, hi⟩ : x.support.Nonempty := by aesop
obtain ⟨c, rfl⟩ := le_iff_exists_add'.mp (show single i 1 ≤ x by simp_all; lia)
simpa [monomial_add_single] using Ideal.mul_mem_left _ _ (Ideal.subset_span (by simp))
open scoped Pointwise in
theorem pow_idealOfVars (n : ℕ) :
idealOfVars σ R ^ n = restrictSupportIdeal _ _ ((IsUpperSet.Ici n).preimage degree_mono) := by
rw [idealOfVars_eq_restrictSupportIdeal]
apply Submodule.restrictScalars_injective R
by_cases hn : n = 0
· simp [hn, Set.Ici_zero_eq_univ]
rw [Submodule.restrictScalars_pow hn]
simp [← restrictSupport_nsmul, ← degree_preimage_nsmul, hn, Set.Ici_nsmul_eq]
/-- The `n`th power of `idealOfVars` is spanned by all monic monomials of total degree `n`. -/
theorem pow_idealOfVars_eq_span (n) : idealOfVars σ R ^ n =
.span ((monomial · 1) '' degree ⁻¹' {n}) := by
rw [idealOfVars, Ideal.span, Submodule.span_pow, ← Set.image_univ,
image_pow_eq_finsuppProd_image]
simp [monomial_eq, Set.preimage, degree]
set_option backward.isDefEq.respectTransparency.types false in
theorem mem_pow_idealOfVars_iff (n : ℕ) (p : MvPolynomial σ R) :
p ∈ idealOfVars σ R ^ n ↔ ∀ x ∈ p.support, n ≤ degree x := by
rw [pow_idealOfVars]
simp [restrictSupportIdeal, mem_restrictSupport_iff, Set.subset_def]
theorem mem_pow_idealOfVars_iff' (n : ℕ) (p : MvPolynomial σ R) :
p ∈ idealOfVars σ R ^ n ↔ ∀ x, degree x < n → p.coeff x = 0 := by
grind only [mem_pow_idealOfVars_iff, mem_support_iff]
theorem monomial_mem_pow_idealOfVars_iff (n : ℕ) (x : σ →₀ ℕ) {r : R} (h : r ≠ 0) :
monomial x r ∈ idealOfVars σ R ^ n ↔ n ≤ degree x := by
classical
grind only [mem_pow_idealOfVars_iff, mem_support_iff, coeff_monomial]
theorem C_mem_pow_idealOfVars_iff (n r) : C r ∈ idealOfVars σ R ^ n ↔ r = 0 ∨ n = 0 := by
by_cases h : r = 0
· simp [h]
simpa [h] using monomial_mem_pow_idealOfVars_iff (σ := σ) n 0 h
end idealOfVars
section Quotient
variable {A σ : Type*} [CommRing A] (I : Ideal (MvPolynomial σ A))
theorem mkₐ_eq_aeval :
Ideal.Quotient.mkₐ A I = aeval fun d : σ => Ideal.Quotient.mk I (X d) := by
ext d
simp
set_option backward.isDefEq.respectTransparency.types false in
theorem mk_eq_eval₂ : (Ideal.Quotient.mk I).toFun =
eval₂ (algebraMap A (MvPolynomial σ A ⧸ I)) fun d : σ => Ideal.Quotient.mk I (X d) := by
ext d
simp_rw [RingHom.toFun_eq_coe, ← Ideal.Quotient.mkₐ_eq_mk A, mkₐ_eq_aeval, aeval_X, aeval,
AlgHom.coe_mk, coe_eval₂Hom]
end Quotient
end MvPolynomial
namespace MonomialOrder
variable [CommSemiring R] {m : MonomialOrder σ}
open Ideal
lemma span_leadingTerm_sdiff_singleton_zero (B : Set (MvPolynomial σ R)) :
span (m.leadingTerm '' (B \ {0})) = span (m.leadingTerm '' B) :=
m.image_leadingTerm_sdiff_singleton_zero B ▸ Ideal.span_sdiff_singleton_zero
lemma span_leadingTerm_insert_zero (B : Set (MvPolynomial σ R)) :
span (m.leadingTerm '' (insert 0 B)) = span (m.leadingTerm '' B) := by
by_cases h : 0 ∈ B
· rw [Set.insert_eq_of_mem h]
· simp
lemma span_leadingTerm_eq_span_monomial {B : Set (MvPolynomial σ R)}
(hB : ∀ p ∈ B, IsUnit (m.leadingCoeff p)) :
span (m.leadingTerm '' B) =
span ((fun p ↦ MvPolynomial.monomial (m.degree p) (1 : R)) '' B) := by
apply le_antisymm
all_goals
rw [Ideal.span_le, Set.image_subset_iff]
intro p hp
· rw [Set.mem_preimage, SetLike.mem_coe, ← C_mul_leadingCoeff_monomial_degree]
exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, hp, rfl⟩)
· rw [Set.mem_preimage, SetLike.mem_coe]
convert
(span <| m.leadingTerm '' B).mul_mem_left (MvPolynomial.C (hB p hp).unit⁻¹.val) <|
subset_span ⟨p, hp, rfl⟩
rw [← C_mul_leadingCoeff_monomial_degree, ← mul_assoc, ← map_mul,
IsUnit.val_inv_mul, MvPolynomial.C_1, one_mul]
lemma span_leadingTerm_eq_span_monomial₀ {B : Set (MvPolynomial σ R)}
(hB : ∀ p ∈ B, IsUnit (m.leadingCoeff p) ∨ p = 0) :
span (m.leadingTerm '' B) =
span ((fun p ↦ MvPolynomial.monomial (m.degree p) 1) '' (B \ {0})) := by
rw [← m.span_leadingTerm_sdiff_singleton_zero]
apply span_leadingTerm_eq_span_monomial
simp_intro .. [or_iff_not_imp_right.mp (hB _ _)]
lemma span_leadingTerm_eq_span_monomial' {k : Type*} [Field k] {B : Set (MvPolynomial σ k)} :
span (m.leadingTerm '' B) =
span ((fun p ↦ MvPolynomial.monomial (m.degree p) 1) '' (B \ {0})) := by
apply span_leadingTerm_eq_span_monomial₀
simp [em']
lemma sPolynomial_mem_sup_ideal {R : Type*} [CommRing R]
{I J : Ideal <| MvPolynomial σ R} {p q : MvPolynomial σ R}
(hp : p ∈ I) (hq : q ∈ J) : m.sPolynomial p q ∈ I ⊔ J :=
sub_mem (mul_mem_left _ _ (mem_sup_left hp)) (mul_mem_left _ _ (mem_sup_right hq))
lemma sPolynomial_mem_ideal {R : Type*} [CommRing R]
{I : Ideal <| MvPolynomial σ R} {p q : MvPolynomial σ R}
(hp : p ∈ I) (hq : q ∈ I) : m.sPolynomial p q ∈ I :=
sub_mem (mul_mem_left I _ hp) (mul_mem_left I _ hq)
end MonomialOrder
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|
|
|
|
|