File: Mathlib/RingTheory/PowerSeries/Order.lean

full_name: PowerSeries.exists_coeff_ne_zero_iff_ne_zero
code: theorem exists_coeff_ne_zero_iff_ne_zero : (∃ n : ℕ, coeff R n φ ≠ 0) ↔ φ ≠ 0 
goal: (∃ n, (PowerSeries.coeff R n) φ ≠ 0) ↔ φ ≠ 0

full_name: PowerSeries.order
code: /-- The order of a formal power series `φ` is the greatest `n : PartENat`
such that `X^n` divides `φ`. The order is `⊤` if and only if `φ = 0`. -/
def order (φ : R⟦X⟧) : PartENat 
goal: PartENat

full_name: PowerSeries.order_zero
code: /-- The order of the `0` power series is infinite. -/
@[simp]
theorem order_zero : order (0 : R⟦X⟧) = ⊤ 
goal: PowerSeries.order 0 = ⊤

full_name: PowerSeries.order_finite_iff_ne_zero
code: theorem order_finite_iff_ne_zero : (order φ).Dom ↔ φ ≠ 0 
goal: φ.order.Dom ↔ φ ≠ 0

full_name: PowerSeries.coeff_order
code: /-- If the order of a formal power series is finite,
then the coefficient indexed by the order is nonzero. -/
theorem coeff_order (h : (order φ).Dom) : coeff R (φ.order.get h) φ ≠ 0 
goal: (PowerSeries.coeff R (φ.order.get h)) φ ≠ 0

full_name: PowerSeries.order_le
code: /-- If the `n`th coefficient of a formal power series is nonzero,
then the order of the power series is less than or equal to `n`. -/
theorem order_le (n : ℕ) (h : coeff R n φ ≠ 0) : order φ ≤ n 
goal: φ.order ≤ ↑n

full_name: PowerSeries.coeff_of_lt_order
code: /-- The `n`th coefficient of a formal power series is `0` if `n` is strictly
smaller than the order of the power series. -/
theorem coeff_of_lt_order (n : ℕ) (h : ↑n < order φ) : coeff R n φ = 0 
goal: (PowerSeries.coeff R n) φ = 0

full_name: PowerSeries.order_eq_top
code: /-- The `0` power series is the unique power series with infinite order. -/
@[simp]
theorem order_eq_top {φ : R⟦X⟧} : φ.order = ⊤ ↔ φ = 0 
goal: φ.order = ⊤ ↔ φ = 0

full_name: PowerSeries.nat_le_order
code: /-- The order of a formal power series is at least `n` if
the `i`th coefficient is `0` for all `i < n`. -/
theorem nat_le_order (φ : R⟦X⟧) (n : ℕ) (h : ∀ i < n, coeff R i φ = 0) : ↑n ≤ order φ 
goal: ↑n ≤ φ.order

full_name: PowerSeries.le_order
code: /-- The order of a formal power series is at least `n` if
the `i`th coefficient is `0` for all `i < n`. -/
theorem le_order (φ : R⟦X⟧) (n : PartENat) (h : ∀ i : ℕ, ↑i < n → coeff R i φ = 0) :
    n ≤ order φ 
goal: n ≤ φ.order

full_name: PowerSeries.order_eq_nat
code: /-- The order of a formal power series is exactly `n` if the `n`th coefficient is nonzero,
and the `i`th coefficient is `0` for all `i < n`. -/
theorem order_eq_nat {φ : R⟦X⟧} {n : ℕ} :
    order φ = n ↔ coeff R n φ ≠ 0 ∧ ∀ i, i < n → coeff R i φ = 0 
goal: φ.order = ↑n ↔ (PowerSeries.coeff R n) φ ≠ 0 ∧ ∀ i < n, (PowerSeries.coeff R i) φ = 0

full_name: PowerSeries.order_eq
code: /-- The order of a formal power series is exactly `n` if the `n`th coefficient is nonzero,
and the `i`th coefficient is `0` for all `i < n`. -/
theorem order_eq {φ : R⟦X⟧} {n : PartENat} :
    order φ = n ↔ (∀ i : ℕ, ↑i = n → coeff R i φ ≠ 0) ∧ ∀ i : ℕ, ↑i < n → coeff R i φ = 0 
goal: φ.order = n ↔ (∀ (i : ℕ), ↑i = n → (PowerSeries.coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < n → (PowerSeries.coeff R i) φ = 0

full_name: PowerSeries.le_order_add
code: /-- The order of the sum of two formal power series
 is at least the minimum of their orders. -/
theorem le_order_add (φ ψ : R⟦X⟧) : min (order φ) (order ψ) ≤ order (φ + ψ) 
goal: min φ.order ψ.order ≤ (φ + ψ).order

full_name: _private.Mathlib.RingTheory.PowerSeries.Order.0.PowerSeries.order_add_of_order_eq.aux
code: private theorem order_add_of_order_eq.aux (φ ψ : R⟦X⟧) (_h : order φ ≠ order ψ)
    (H : order φ < order ψ) : order (φ + ψ) ≤ order φ ⊓ order ψ 
goal: (φ + ψ).order ≤ φ.order ⊓ ψ.order

full_name: PowerSeries.order_add_of_order_eq
code: /-- The order of the sum of two formal power series
 is the minimum of their orders if their orders differ. -/
theorem order_add_of_order_eq (φ ψ : R⟦X⟧) (h : order φ ≠ order ψ) :
    order (φ + ψ) = order φ ⊓ order ψ 
goal: (φ + ψ).order = φ.order ⊓ ψ.order

full_name: PowerSeries.order_mul_ge
code: /-- The order of the product of two formal power series
 is at least the sum of their orders. -/
theorem order_mul_ge (φ ψ : R⟦X⟧) : order φ + order ψ ≤ order (φ * ψ) 
goal: φ.order + ψ.order ≤ (φ * ψ).order

full_name: PowerSeries.order_monomial
code: /-- The order of the monomial `a*X^n` is infinite if `a = 0` and `n` otherwise. -/
theorem order_monomial (n : ℕ) (a : R) [Decidable (a = 0)] :
    order (monomial R n a) = if a = 0 then (⊤ : PartENat) else n 
goal: ((PowerSeries.monomial R n) a).order = if a = 0 then ⊤ else ↑n

full_name: PowerSeries.order_monomial_of_ne_zero
code: /-- The order of the monomial `a*X^n` is `n` if `a ≠ 0`. -/
theorem order_monomial_of_ne_zero (n : ℕ) (a : R) (h : a ≠ 0) : order (monomial R n a) = n 
goal: ((PowerSeries.monomial R n) a).order = ↑n

full_name: PowerSeries.coeff_mul_of_lt_order
code: /-- If `n` is strictly smaller than the order of `ψ`, then the `n`th coefficient of its product
with any other power series is `0`. -/
theorem coeff_mul_of_lt_order {φ ψ : R⟦X⟧} {n : ℕ} (h : ↑n < ψ.order) :
    coeff R n (φ * ψ) = 0 
goal: (PowerSeries.coeff R n) (φ * ψ) = 0

full_name: PowerSeries.coeff_mul_one_sub_of_lt_order
code: theorem coeff_mul_one_sub_of_lt_order {R : Type*} [CommRing R] {φ ψ : R⟦X⟧} (n : ℕ)
    (h : ↑n < ψ.order) : coeff R n (φ * (1 - ψ)) = coeff R n φ 
goal: (PowerSeries.coeff R n) (φ * (1 - ψ)) = (PowerSeries.coeff R n) φ

full_name: PowerSeries.coeff_mul_prod_one_sub_of_lt_order
code: theorem coeff_mul_prod_one_sub_of_lt_order {R ι : Type*} [CommRing R] (k : ℕ) (s : Finset ι)
    (φ : R⟦X⟧) (f : ι → R⟦X⟧) :
    (∀ i ∈ s, ↑k < (f i).order) → coeff R k (φ * ∏ i ∈ s, (1 - f i)) = coeff R k φ 
goal: (∀ i ∈ s, ↑k < (f i).order) → (PowerSeries.coeff R k) (φ * ∏ i ∈ s, (1 - f i)) = (PowerSeries.coeff R k) φ

full_name: PowerSeries.X_pow_order_dvd
code: theorem X_pow_order_dvd (h : (order φ).Dom) : X ^ (order φ).get h ∣ φ 
goal: PowerSeries.X ^ φ.order.get h ∣ φ

full_name: PowerSeries.order_eq_multiplicity_X
code: theorem order_eq_multiplicity_X {R : Type*} [Semiring R] [@DecidableRel R⟦X⟧ (· ∣ ·)] (φ : R⟦X⟧) :
    order φ = multiplicity X φ 
goal: φ.order = multiplicity PowerSeries.X φ

full_name: PowerSeries.divided_by_X_pow_order
code: /-- Given a non-zero power series `f`, `divided_by_X_pow_order f` is the power series obtained by
  dividing out the largest power of X that divides `f`, that is its order-/
def divided_by_X_pow_order {f : PowerSeries R} (hf : f ≠ 0) : R⟦X⟧ 
goal: PowerSeries R

full_name: PowerSeries.self_eq_X_pow_order_mul_divided_by_X_pow_order
code: theorem self_eq_X_pow_order_mul_divided_by_X_pow_order {f : R⟦X⟧} (hf : f ≠ 0) :
    X ^ f.order.get (order_finite_iff_ne_zero.mpr hf) * divided_by_X_pow_order hf = f 
goal: PowerSeries.X ^ f.order.get ⋯ * PowerSeries.divided_by_X_pow_order hf = f

full_name: PowerSeries.order_one
code: /-- The order of the formal power series `1` is `0`. -/
@[simp]
theorem order_one : order (1 : R⟦X⟧) = 0 
goal: PowerSeries.order 1 = 0

full_name: PowerSeries.order_zero_of_unit
code: /-- The order of an invertible power series is `0`. -/
theorem order_zero_of_unit {f : PowerSeries R} : IsUnit f → f.order = 0 
goal: IsUnit f → f.order = 0

full_name: PowerSeries.order_X
code: /-- The order of the formal power series `X` is `1`. -/
@[simp]
theorem order_X : order (X : R⟦X⟧) = 1 
goal: PowerSeries.X.order = 1

full_name: PowerSeries.order_X_pow
code: /-- The order of the formal power series `X^n` is `n`. -/
@[simp]
theorem order_X_pow (n : ℕ) : order ((X : R⟦X⟧) ^ n) = n 
goal: (PowerSeries.X ^ n).order = ↑n

full_name: PowerSeries.order_mul
code: /-- The order of the product of two formal power series over an integral domain
 is the sum of their orders. -/
theorem order_mul (φ ψ : R⟦X⟧) : order (φ * ψ) = order φ + order ψ 
goal: (φ * ψ).order = φ.order + ψ.order

full_name: PowerSeries.divided_by_X_pow_order_of_X_eq_one
code: @[simp]
theorem divided_by_X_pow_order_of_X_eq_one : divided_by_X_pow_order X_ne_zero = (1 : R⟦X⟧) 
goal: PowerSeries.divided_by_X_pow_order ⋯ = 1

full_name: PowerSeries.divided_by_X_pow_orderMul
code: theorem divided_by_X_pow_orderMul {f g : R⟦X⟧} (hf : f ≠ 0) (hg : g ≠ 0) :
    divided_by_X_pow_order hf * divided_by_X_pow_order hg =
      divided_by_X_pow_order (mul_ne_zero hf hg) 
goal: PowerSeries.divided_by_X_pow_order hf * PowerSeries.divided_by_X_pow_order hg = PowerSeries.divided_by_X_pow_order ⋯