Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Weighted ideals and coefficient packets for multivariate power series

Definition
OAI_NumberTheory_PiExponent_Jets_JetGeometry

by Yuxuan Xu · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

commutative-algebranumber-theoryopenai-pi-exponent-017power-series

For a commutative ring R and a weight w : σ → ℕ, weightedIdeal w N consists of multivariate power series whose weighted order is at least N. Membership is characterized by vanishing of every coefficient indexed by a finitely supported multi-index of weighted degree below N. Products of weighted ideals add their thresholds, and if I ≤ weightedIdeal w R₀ then Iⁿ ≤ weightedIdeal w (n R₀). For rational nonnegative weights v : σ → ℚ, rationalWeightedIdeal v hv H consists of series whose coefficients vanish at all multi-indices of v-weight below H; these ideals also multiply by adding thresholds, and their powers obey the corresponding bound under the stated ideal containment. coordinatePowerIdeal e is the ideal generated by the coordinate powers Xᵢ^(e i). RationalCoefficientPacket v H is the function type from multi-indices of v-weight below H to R, and rationalCoefficientPacket evaluates a series' coefficients on that domain.

Definition code
import Mathlib.RingTheory.Ideal.Quotient.Operations
import Mathlib.RingTheory.MvPowerSeries.Order


namespace OAI

namespace PiExponent.JetGeometry

noncomputable section

open MvPowerSeries

variable {σ R : Type*} [CommRing R]

def weightedIdeal (w : σ → ℕ) (N : ℕ) : Ideal (MvPowerSeries σ R) where
  carrier := {f | (N : ℕ∞) ≤ f.weightedOrder w}
  zero_mem' := by simp
  add_mem' hf hg := (le_min hf hg).trans (min_weightedOrder_le_add w)
  smul_mem' a f hf := by
    change (N : ℕ∞) ≤ weightedOrder w (a * f)
    exact hf.trans (le_add_self.trans (le_weightedOrder_mul w))



theorem mem_weightedIdeal_iff (w : σ → ℕ) (N : ℕ)
    (f : MvPowerSeries σ R) :
    f ∈ weightedIdeal w N ↔ ∀ d, Finsupp.weight w d < N → coeff d f = 0 := by
  constructor
  · intro hf d hd
    have hd' : (Finsupp.weight w d : ℕ∞) < (N : ℕ∞) := by exact_mod_cast hd
    exact coeff_eq_zero_of_lt_weightedOrder w (hd'.trans_le hf)
  · intro hf
    exact nat_le_weightedOrder w hf

theorem weightedIdeal_mul_le (w : σ → ℕ) (M N : ℕ) :
    (weightedIdeal w M : Ideal (MvPowerSeries σ R)) * weightedIdeal w N ≤
      weightedIdeal w (M + N) := by
  apply Ideal.mul_le.mpr
  intro f hf g hg
  change ((M + N : ℕ) : ℕ∞) ≤ weightedOrder w (f * g)
  rw [Nat.cast_add]
  exact (add_le_add hf hg).trans (le_weightedOrder_mul w)

theorem ideal_pow_le_weightedIdeal (w : σ → ℕ) (I : Ideal (MvPowerSeries σ R))
    (R₀ : ℕ) (hI : I ≤ weightedIdeal w R₀) (n : ℕ) :
    I ^ n ≤ weightedIdeal w (n * R₀) := by
  induction n with
  | zero =>
      intro f hf
      change ((0 * R₀ : ℕ) : ℕ∞) ≤ weightedOrder w f
      simp
  | succ n ih =>
      rw [pow_succ, Nat.succ_mul]
      apply Ideal.mul_le.mpr
      intro f hf g hg
      exact (Ideal.mul_le.mp (weightedIdeal_mul_le w (n * R₀) R₀)) f (ih hf) g (hI hg)

def coordinatePowerIdeal (e : σ → ℕ) : Ideal (MvPowerSeries σ R) :=
  Ideal.span (Set.range (fun i => (X i : MvPowerSeries σ R) ^ e i))















theorem rational_weight_nonneg (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i)
    (d : σ →₀ ℕ) : 0 ≤ Finsupp.weight v d := by
  rw [Finsupp.weight_apply, Finsupp.sum]
  exact Finset.sum_nonneg (fun i _ => nsmul_nonneg (hv i) (d i))

def rationalWeightedIdeal (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i) (H : ℚ) :
    Ideal (MvPowerSeries σ R) where
  carrier := {f | ∀ d, Finsupp.weight v d < H → coeff d f = 0}
  zero_mem' := by simp
  add_mem' hf hg := by
    intro d hd
    rw [map_add, hf d hd, hg d hd, add_zero]
  smul_mem' a f hf := by
    classical
    intro d hd
    change coeff d (a * f) = 0
    rw [coeff_mul]
    apply Finset.sum_eq_zero
    intro ij hij
    have he : ij.1 + ij.2 = d := Finset.mem_antidiagonal.mp hij
    have hw : Finsupp.weight v ij.2 ≤ Finsupp.weight v d := by
      rw [← he, map_add]
      exact le_add_of_nonneg_left (rational_weight_nonneg v hv ij.1)
    rw [hf ij.2 (hw.trans_lt hd), mul_zero]



theorem rationalWeightedIdeal_mul_le (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i) (H K : ℚ) :
    (rationalWeightedIdeal v hv H : Ideal (MvPowerSeries σ R)) *
      rationalWeightedIdeal v hv K ≤ rationalWeightedIdeal v hv (H + K) := by
  classical
  apply Ideal.mul_le.mpr
  intro f hf g hg d hd
  rw [coeff_mul]
  apply Finset.sum_eq_zero
  intro ij hij
  have he : ij.1 + ij.2 = d := Finset.mem_antidiagonal.mp hij
  by_cases hfirst : Finsupp.weight v ij.1 < H
  · rw [hf ij.1 hfirst, zero_mul]
  · have hsecond : Finsupp.weight v ij.2 < K := by
      apply lt_of_not_ge
      intro hsecond
      have hsum := add_le_add (le_of_not_gt hfirst) hsecond
      rw [← map_add, he] at hsum
      exact (not_le_of_gt hd) hsum
    rw [hg ij.2 hsecond, mul_zero]

theorem ideal_pow_le_rationalWeightedIdeal (v : σ → ℚ) (hv : ∀ i, 0 ≤ v i)
    (I : Ideal (MvPowerSeries σ R)) (H : ℚ)
    (hI : I ≤ rationalWeightedIdeal v hv H) (n : ℕ) :
    I ^ n ≤ rationalWeightedIdeal v hv (n * H) := by
  induction n with
  | zero =>
      intro f hf d hd
      have hzero := rational_weight_nonneg v hv d
      simp only [Nat.cast_zero, zero_mul] at hd
      exact False.elim ((not_lt_of_ge hzero) hd)
  | succ n ih =>
      rw [pow_succ, Nat.cast_add, Nat.cast_one, add_mul, one_mul]
      apply Ideal.mul_le.mpr
      intro f hf g hg
      exact (Ideal.mul_le.mp (rationalWeightedIdeal_mul_le v hv (n * H) H))
        f (ih hf) g (hI hg)



def RationalCoefficientPacket (v : σ → ℚ) (H : ℚ) :=
  {d : σ →₀ ℕ // Finsupp.weight v d < H} → R

def rationalCoefficientPacket (v : σ → ℚ) (H : ℚ) (f : MvPowerSeries σ R) :
    RationalCoefficientPacket (R := R) v H := fun d => coeff d.val f





end

end PiExponent.JetGeometry

end OAI
Source
OpenAI math, commit adc7f1241b42e322a6451854ab7e4b4c146bf78a: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/NumberTheory/PiExponent/Jets/JetGeometry.lean#L14-L219

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me