File: Mathlib/RingTheory/MvPolynomial/Homogeneous.lean

full_name: MvPolynomial.IsHomogeneous
code: /-- A multivariate polynomial `φ` is homogeneous of degree `n`
if all monomials occurring in `φ` have degree `n`. -/
def IsHomogeneous [CommSemiring R] (φ : MvPolynomial σ R) (n : ℕ) 
goal: Prop

full_name: MvPolynomial.weightedTotalDegree_one
code: theorem weightedTotalDegree_one (φ : MvPolynomial σ R) :
    weightedTotalDegree (1 : σ → ℕ) φ = φ.totalDegree 
goal: MvPolynomial.weightedTotalDegree 1 φ = φ.totalDegree

full_name: MvPolynomial.homogeneousSubmodule
code: /-- The submodule of homogeneous `MvPolynomial`s of degree `n`. -/
def homogeneousSubmodule (n : ℕ) : Submodule R (MvPolynomial σ R) 
goal: Submodule R (MvPolynomial σ R)

full_name: MvPolynomial.weightedHomogeneousSubmodule_one
code: @[simp]
lemma weightedHomogeneousSubmodule_one (n : ℕ) :
    weightedHomogeneousSubmodule R 1 n = homogeneousSubmodule σ R n 
goal: MvPolynomial.weightedHomogeneousSubmodule R 1 n = MvPolynomial.homogeneousSubmodule σ R n

full_name: MvPolynomial.mem_homogeneousSubmodule
code: @[simp]
theorem mem_homogeneousSubmodule [CommSemiring R] (n : ℕ) (p : MvPolynomial σ R) :
    p ∈ homogeneousSubmodule σ R n ↔ p.IsHomogeneous n 
goal: p ∈ MvPolynomial.homogeneousSubmodule σ R n ↔ p.IsHomogeneous n

full_name: MvPolynomial.homogeneousSubmodule_eq_finsupp_supported
code: /-- While equal, the former has a convenient definitional reduction. -/
theorem homogeneousSubmodule_eq_finsupp_supported [CommSemiring R] (n : ℕ) :
    homogeneousSubmodule σ R n = Finsupp.supported _ R { d | d.degree = n } 
goal: MvPolynomial.homogeneousSubmodule σ R n = Finsupp.supported R R {d | d.degree = n}

full_name: MvPolynomial.homogeneousSubmodule_mul
code: theorem homogeneousSubmodule_mul [CommSemiring R] (m n : ℕ) :
    homogeneousSubmodule σ R m * homogeneousSubmodule σ R n ≤ homogeneousSubmodule σ R (m + n) 
goal: MvPolynomial.homogeneousSubmodule σ R m * MvPolynomial.homogeneousSubmodule σ R n ≤
  MvPolynomial.homogeneousSubmodule σ R (m + n)

full_name: MvPolynomial.isHomogeneous_monomial
code: theorem isHomogeneous_monomial {d : σ →₀ ℕ} (r : R) {n : ℕ} (hn : d.degree = n) :
    IsHomogeneous (monomial d r) n 
goal: ((MvPolynomial.monomial d) r).IsHomogeneous n

full_name: MvPolynomial.totalDegree_eq_zero_iff
code: theorem totalDegree_eq_zero_iff (p : MvPolynomial σ R) :
    p.totalDegree = 0 ↔ ∀ (m : σ →₀ ℕ) (_ : m ∈ p.support) (x : σ), m x = 0 
goal: p.totalDegree = 0 ↔ ∀ m ∈ p.support, ∀ (x : σ), m x = 0

full_name: MvPolynomial.totalDegree_zero_iff_isHomogeneous
code: theorem totalDegree_zero_iff_isHomogeneous {p : MvPolynomial σ R} :
    p.totalDegree = 0 ↔ IsHomogeneous p 0 
goal: p.totalDegree = 0 ↔ p.IsHomogeneous 0

full_name: MvPolynomial.isHomogeneous_C
code: theorem isHomogeneous_C (r : R) : IsHomogeneous (C r : MvPolynomial σ R) 0 
goal: (MvPolynomial.C r).IsHomogeneous 0

full_name: MvPolynomial.isHomogeneous_zero
code: theorem isHomogeneous_zero (n : ℕ) : IsHomogeneous (0 : MvPolynomial σ R) n 
goal: MvPolynomial.IsHomogeneous 0 n

full_name: MvPolynomial.isHomogeneous_one
code: theorem isHomogeneous_one : IsHomogeneous (1 : MvPolynomial σ R) 0 
goal: MvPolynomial.IsHomogeneous 1 0

full_name: MvPolynomial.isHomogeneous_X
code: theorem isHomogeneous_X (i : σ) : IsHomogeneous (X i : MvPolynomial σ R) 1 
goal: (MvPolynomial.X i).IsHomogeneous 1

full_name: MvPolynomial.IsHomogeneous.coeff_eq_zero
code: theorem coeff_eq_zero (hφ : IsHomogeneous φ n) {d : σ →₀ ℕ} (hd : d.degree ≠ n) :
    coeff d φ = 0 
goal: MvPolynomial.coeff d φ = 0

full_name: MvPolynomial.IsHomogeneous.inj_right
code: theorem inj_right (hm : IsHomogeneous φ m) (hn : IsHomogeneous φ n) (hφ : φ ≠ 0) : m = n 
goal: m = n

full_name: MvPolynomial.IsHomogeneous.add
code: theorem add (hφ : IsHomogeneous φ n) (hψ : IsHomogeneous ψ n) : IsHomogeneous (φ + ψ) n 
goal: (φ + ψ).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.sum
code: theorem sum {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : ℕ)
    (h : ∀ i ∈ s, IsHomogeneous (φ i) n) : IsHomogeneous (∑ i ∈ s, φ i) n 
goal: (∑ i ∈ s, φ i).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.mul
code: theorem mul (hφ : IsHomogeneous φ m) (hψ : IsHomogeneous ψ n) : IsHomogeneous (φ * ψ) (m + n) 
goal: (φ * ψ).IsHomogeneous (m + n)

full_name: MvPolynomial.IsHomogeneous.prod
code: theorem prod {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) (n : ι → ℕ)
    (h : ∀ i ∈ s, IsHomogeneous (φ i) (n i)) : IsHomogeneous (∏ i ∈ s, φ i) (∑ i ∈ s, n i) 
goal: (∏ i ∈ s, φ i).IsHomogeneous (∑ i ∈ s, n i)

full_name: MvPolynomial.IsHomogeneous.C_mul
code: lemma C_mul (hφ : φ.IsHomogeneous m) (r : R) :
    (C r * φ).IsHomogeneous m 
goal: (MvPolynomial.C r * φ).IsHomogeneous m

full_name: MvPolynomial.isHomogeneous_C_mul_X
code: lemma _root_.MvPolynomial.isHomogeneous_C_mul_X (r : R) (i : σ) :
    (C r * X i).IsHomogeneous 1 
goal: (MvPolynomial.C r * MvPolynomial.X i).IsHomogeneous 1

full_name: MvPolynomial.IsHomogeneous.pow
code: lemma pow (hφ : φ.IsHomogeneous m) (n : ℕ) : (φ ^ n).IsHomogeneous (m * n) 
goal: (φ ^ n).IsHomogeneous (m * n)

full_name: MvPolynomial.isHomogeneous_X_pow
code: lemma _root_.MvPolynomial.isHomogeneous_X_pow (i : σ) (n : ℕ) :
    (X (R := R) i ^ n).IsHomogeneous n 
goal: (MvPolynomial.X i ^ n).IsHomogeneous n

full_name: MvPolynomial.isHomogeneous_C_mul_X_pow
code: lemma _root_.MvPolynomial.isHomogeneous_C_mul_X_pow (r : R) (i : σ) (n : ℕ) :
    (C r * X i ^ n).IsHomogeneous n 
goal: (MvPolynomial.C r * MvPolynomial.X i ^ n).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.eval₂
code: lemma eval₂ (hφ : φ.IsHomogeneous m) (f : R →+* MvPolynomial τ S) (g : σ → MvPolynomial τ S)
    (hf : ∀ r, (f r).IsHomogeneous 0) (hg : ∀ i, (g i).IsHomogeneous n) :
    (eval₂ f g φ).IsHomogeneous (n * m) 
goal: (MvPolynomial.eval₂ f g φ).IsHomogeneous (n * m)

full_name: MvPolynomial.IsHomogeneous.map
code: lemma map (hφ : φ.IsHomogeneous n) (f : R →+* S) : (map f φ).IsHomogeneous n 
goal: ((MvPolynomial.map f) φ).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.aeval
code: lemma aeval [Algebra R S] (hφ : φ.IsHomogeneous m)
    (g : σ → MvPolynomial τ S) (hg : ∀ i, (g i).IsHomogeneous n) :
    (aeval g φ).IsHomogeneous (n * m) 
goal: ((MvPolynomial.aeval g) φ).IsHomogeneous (n * m)

full_name: MvPolynomial.IsHomogeneous.neg
code: theorem neg (hφ : IsHomogeneous φ n) : IsHomogeneous (-φ) n 
goal: (-φ).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.sub
code: theorem sub (hφ : IsHomogeneous φ n) (hψ : IsHomogeneous ψ n) : IsHomogeneous (φ - ψ) n 
goal: (φ - ψ).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.totalDegree_le
code: /-- The homogeneous degree bounds the total degree.

See also `MvPolynomial.IsHomogeneous.totalDegree` when `φ` is non-zero. -/
lemma totalDegree_le (hφ : IsHomogeneous φ n) : φ.totalDegree ≤ n 
goal: φ.totalDegree ≤ n

full_name: MvPolynomial.IsHomogeneous.totalDegree
code: theorem totalDegree (hφ : IsHomogeneous φ n) (h : φ ≠ 0) : totalDegree φ = n 
goal: φ.totalDegree = n

full_name: MvPolynomial.IsHomogeneous.rename_isHomogeneous
code: theorem rename_isHomogeneous {f : σ → τ} (h : φ.IsHomogeneous n) :
    (rename f φ).IsHomogeneous n 
goal: ((MvPolynomial.rename f) φ).IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.rename_isHomogeneous_iff
code: theorem rename_isHomogeneous_iff {f : σ → τ} (hf : f.Injective) :
    (rename f φ).IsHomogeneous n ↔ φ.IsHomogeneous n 
goal: ((MvPolynomial.rename f) φ).IsHomogeneous n ↔ φ.IsHomogeneous n

full_name: MvPolynomial.IsHomogeneous.finSuccEquiv_coeff_isHomogeneous
code: lemma finSuccEquiv_coeff_isHomogeneous {N : ℕ} {φ : MvPolynomial (Fin (N+1)) R} {n : ℕ}
    (hφ : φ.IsHomogeneous n) (i j : ℕ) (h : i + j = n) :
    ((finSuccEquiv _ _ φ).coeff i).IsHomogeneous j 
goal: (((MvPolynomial.finSuccEquiv R N) φ).coeff i).IsHomogeneous j

full_name: MvPolynomial.IsHomogeneous.coeff_isHomogeneous_of_optionEquivLeft_symm
code: lemma coeff_isHomogeneous_of_optionEquivLeft_symm
    [hσ : Finite σ] {p : Polynomial (MvPolynomial σ R)}
    (hp : ((optionEquivLeft R σ).symm p).IsHomogeneous n) (i j : ℕ) (h : i + j = n) :
    (p.coeff i).IsHomogeneous j 
goal: (p.coeff i).IsHomogeneous j

full_name: _private.Mathlib.RingTheory.MvPolynomial.Homogeneous.0.MvPolynomial.IsHomogeneous.exists_eval_ne_zero_of_coeff_finSuccEquiv_ne_zero_aux
code: private
lemma exists_eval_ne_zero_of_coeff_finSuccEquiv_ne_zero_aux
    {N : ℕ} {F : MvPolynomial (Fin (Nat.succ N)) R} {n : ℕ} (hF : IsHomogeneous F n)
    (hFn : ((finSuccEquiv R N) F).coeff n ≠ 0) :
    ∃ r, eval r F ≠ 0 
goal: ∃ r, (MvPolynomial.eval r) F ≠ 0

full_name: _private.Mathlib.RingTheory.MvPolynomial.Homogeneous.0.MvPolynomial.IsHomogeneous.exists_eval_ne_zero_of_totalDegree_le_card_aux
code: private
lemma exists_eval_ne_zero_of_totalDegree_le_card_aux {N : ℕ} {F : MvPolynomial (Fin N) R} {n : ℕ}
    (hF : F.IsHomogeneous n) (hF₀ : F ≠ 0) (hnR : n ≤ #R) :
    ∃ r, eval r F ≠ 0 
goal: ∃ r, (MvPolynomial.eval r) F ≠ 0

full_name: MvPolynomial.IsHomogeneous.eq_zero_of_forall_eval_eq_zero_of_le_card
code: /-- See `MvPolynomial.IsHomogeneous.eq_zero_of_forall_eval_eq_zero`
for a version that assumes `Infinite R`. -/
lemma eq_zero_of_forall_eval_eq_zero_of_le_card
    (hF : F.IsHomogeneous n) (h : ∀ r : σ → R, eval r F = 0) (hnR : n ≤ #R) :
    F = 0 
goal: F = 0

full_name: MvPolynomial.IsHomogeneous.funext_of_le_card
code: /-- See `MvPolynomial.IsHomogeneous.funext`
for a version that assumes `Infinite R`. -/
lemma funext_of_le_card (hF : F.IsHomogeneous n) (hG : G.IsHomogeneous n)
    (h : ∀ r : σ → R, eval r F = eval r G) (hnR : n ≤ #R) :
    F = G 
goal: F = G

full_name: MvPolynomial.IsHomogeneous.eq_zero_of_forall_eval_eq_zero
code: /-- See `MvPolynomial.IsHomogeneous.eq_zero_of_forall_eval_eq_zero_of_le_card`
for a version that assumes `n ≤ #R`. -/
lemma eq_zero_of_forall_eval_eq_zero [Infinite R] {F : MvPolynomial σ R} {n : ℕ}
    (hF : F.IsHomogeneous n) (h : ∀ r : σ → R, eval r F = 0) : F = 0 
goal: F = 0

full_name: MvPolynomial.IsHomogeneous.funext
code: /-- See `MvPolynomial.IsHomogeneous.funext_of_le_card`
for a version that assumes `n ≤ #R`. -/
lemma funext [Infinite R] {F G : MvPolynomial σ R} {n : ℕ}
    (hF : F.IsHomogeneous n) (hG : G.IsHomogeneous n)
    (h : ∀ r : σ → R, eval r F = eval r G) : F = G 
goal: F = G

full_name: MvPolynomial.IsHomogeneous.HomogeneousSubmodule.gcommSemiring
code: /-- The homogeneous submodules form a graded ring. This instance is used by `DirectSum.commSemiring`
and `DirectSum.algebra`. -/
instance HomogeneousSubmodule.gcommSemiring : SetLike.GradedMonoid (homogeneousSubmodule σ R) 
goal: SetLike.GradedMonoid (MvPolynomial.homogeneousSubmodule σ R)

full_name: MvPolynomial.homogeneousComponent
code: /-- `homogeneousComponent n φ` is the part of `φ` that is homogeneous of degree `n`.
See `sum_homogeneousComponent` for the statement that `φ` is equal to the sum
of all its homogeneous components. -/
def homogeneousComponent [CommSemiring R] (n : ℕ) : MvPolynomial σ R →ₗ[R] MvPolynomial σ R 
goal: MvPolynomial σ R →ₗ[R] MvPolynomial σ R

full_name: MvPolynomial.homogeneousComponent_mem
code: theorem homogeneousComponent_mem  :
    homogeneousComponent n φ ∈ homogeneousSubmodule σ R n 
goal: (MvPolynomial.homogeneousComponent n) φ ∈ MvPolynomial.homogeneousSubmodule σ R n

full_name: MvPolynomial.coeff_homogeneousComponent
code: theorem coeff_homogeneousComponent (d : σ →₀ ℕ) :
    coeff d (homogeneousComponent n φ) = if d.degree = n then coeff d φ else 0 
goal: MvPolynomial.coeff d ((MvPolynomial.homogeneousComponent n) φ) = if d.degree = n then MvPolynomial.coeff d φ else 0

full_name: MvPolynomial.homogeneousComponent_apply
code: theorem homogeneousComponent_apply :
    homogeneousComponent n φ =
      ∑ d ∈ φ.support.filter fun d => d.degree = n, monomial d (coeff d φ) 
goal: (MvPolynomial.homogeneousComponent n) φ =
  ∑ d ∈ Finset.filter (fun d => d.degree = n) φ.support, (MvPolynomial.monomial d) (MvPolynomial.coeff d φ)

full_name: MvPolynomial.homogeneousComponent_isHomogeneous
code: theorem homogeneousComponent_isHomogeneous : (homogeneousComponent n φ).IsHomogeneous n 
goal: ((MvPolynomial.homogeneousComponent n) φ).IsHomogeneous n

full_name: MvPolynomial.homogeneousComponent_zero
code: @[simp]
theorem homogeneousComponent_zero : homogeneousComponent 0 φ = C (coeff 0 φ) 
goal: (MvPolynomial.homogeneousComponent 0) φ = MvPolynomial.C (MvPolynomial.coeff 0 φ)

full_name: MvPolynomial.homogeneousComponent_C_mul
code: @[simp]
theorem homogeneousComponent_C_mul (n : ℕ) (r : R) :
    homogeneousComponent n (C r * φ) = C r * homogeneousComponent n φ 
goal: (MvPolynomial.homogeneousComponent n) (MvPolynomial.C r * φ) =
  MvPolynomial.C r * (MvPolynomial.homogeneousComponent n) φ

full_name: MvPolynomial.homogeneousComponent_eq_zero'
code: theorem homogeneousComponent_eq_zero'
    (h : ∀ d : σ →₀ ℕ, d ∈ φ.support → d.degree ≠ n) :
    homogeneousComponent n φ = 0 
goal: (MvPolynomial.homogeneousComponent n) φ = 0

full_name: MvPolynomial.homogeneousComponent_eq_zero
code: theorem homogeneousComponent_eq_zero (h : φ.totalDegree < n) : homogeneousComponent n φ = 0 
goal: (MvPolynomial.homogeneousComponent n) φ = 0

full_name: MvPolynomial.sum_homogeneousComponent
code: theorem sum_homogeneousComponent :
    (∑ i ∈ range (φ.totalDegree + 1), homogeneousComponent i φ) = φ 
goal: ∑ i ∈ Finset.range (φ.totalDegree + 1), (MvPolynomial.homogeneousComponent i) φ = φ

full_name: MvPolynomial.homogeneousComponent_of_mem
code: theorem homogeneousComponent_of_mem {m n : ℕ} {p : MvPolynomial σ R}
    (h : p ∈ homogeneousSubmodule σ R n) :
    homogeneousComponent m p = if m = n then p else 0 
goal: (MvPolynomial.homogeneousComponent m) p = if m = n then p else 0

full_name: MvPolynomial.HomogeneousSubmodule.gradedMonoid
code: /-- The homogeneous submodules form a graded ring.
This instance is used by `DirectSum.commSemiring` and `DirectSum.algebra`. -/
lemma HomogeneousSubmodule.gradedMonoid :
    SetLike.GradedMonoid (homogeneousSubmodule σ R) 
goal: SetLike.GradedMonoid (MvPolynomial.homogeneousSubmodule σ R)

full_name: MvPolynomial.decomposition
code: /-- The decomposition of `MvPolynomial σ R` into homogeneous submodules. -/
abbrev decomposition :
    DirectSum.Decomposition (homogeneousSubmodule σ R) 
goal: DirectSum.Decomposition (MvPolynomial.homogeneousSubmodule σ R)

full_name: MvPolynomial.gradedAlgebra
code: /-- `MvPolynomial σ R` as a graded algebra, graded by the degree.
We do not make this a global instance because one may want to consider a different
graded algebra structure on `MvPolynomial σ R`, induced by another weight function.
To make it a local instance, you may use
`attribute [local instance] MvPolynomial.gradedAlgebra`.
-/
abbrev gradedAlgebra : GradedAlgebra (homogeneousSubmodule σ R) 
goal: GradedAlgebra (MvPolynomial.homogeneousSubmodule σ R)

full_name: MvPolynomial.decomposition.decompose'_apply
code: theorem decomposition.decompose'_apply (φ : MvPolynomial σ R) (i : ℕ) :
    (decomposition.decompose' φ i : MvPolynomial σ R) = homogeneousComponent i φ 
goal: ↑((DirectSum.Decomposition.decompose' φ) i) = (MvPolynomial.homogeneousComponent i) φ

full_name: MvPolynomial.decomposition.decompose'_eq
code: theorem decomposition.decompose'_eq :
    decomposition.decompose' = fun φ : MvPolynomial σ R =>
      DirectSum.mk (fun i : ℕ => ↥(homogeneousSubmodule σ R i)) (φ.support.image Finsupp.degree)
        fun m => ⟨homogeneousComponent m φ, homogeneousComponent_mem m φ⟩ 
goal: DirectSum.Decomposition.decompose' = fun φ =>
  (DirectSum.mk (fun i => ↥(MvPolynomial.homogeneousSubmodule σ R i)) (Finset.image Finsupp.degree φ.support)) fun m =>
    ⟨(MvPolynomial.homogeneousComponent ↑m) φ, ⋯⟩