Theorem: PowerSeries.order_eq_multiplicity_X
File: Mathlib/RingTheory/PowerSeries/Basic.lean

tactic: rcases eq_or_ne φ 0 with (rfl | hφ)
state_before: R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ order φ = multiplicity X φ

tactic: induction' ho : order φ using PartENat.casesOn with n
state_before: case inr
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
⊢ order φ = multiplicity X φ

tactic: have hn : φ.order.get (order_finite_iff_ne_zero.mpr hφ) = n := by simp [ho]
state_before: case inr.a
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
⊢ ↑n = multiplicity X φ

tactic: rw [← hn]
state_before: case inr.a
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ↑n = multiplicity X φ

tactic: refine'
  le_antisymm (le_multiplicity_of_pow_dvd <| X_pow_order_dvd (order_finite_iff_ne_zero.mpr hφ))
    (PartENat.find_le _ _ _)
state_before: case inr.a
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ↑(Part.get (order φ) (_ : (order φ).Dom)) = multiplicity X φ

tactic: rintro ⟨ψ, H⟩
state_before: case inr.a
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ¬X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) ∣ φ

tactic: have := congr_arg (coeff R n) H
state_before: case inr.a.intro
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
⊢ False

tactic: rw [← (ψ.commute_X.pow_right _).eq, coeff_mul_of_lt_order, ← hn] at this
state_before: case inr.a.intro
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ)
⊢ False

tactic: simp
state_before: case inl
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
⊢ order 0 = multiplicity X 0

tactic: simp [hφ] at ho
state_before: case inr.a
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
ho : order φ = ⊤
⊢ ⊤ = multiplicity X φ

tactic: simp [ho]
state_before: R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
⊢ Part.get (order φ) (_ : (order φ).Dom) = n

tactic: exact coeff_order _ this
state_before: case inr.a.intro
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R (Part.get (order φ) (_ : (order φ).Dom))) φ = 0
⊢ False

tactic: rw [X_pow_eq, order_monomial]
state_before: case inr.a.intro
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
⊢ ↑n < order (X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))

tactic: split_ifs
state_before: case inr.a.intro
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
⊢ ↑n < if 1 = 0 then ⊤ else ↑(Part.get (order φ) (_ : (order φ).Dom) + 1)

tactic: exact PartENat.natCast_lt_top _
state_before: case inr.a.intro.inl
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : 1 = 0
⊢ ↑n < ⊤

tactic: rw [← hn, PartENat.coe_lt_coe]
state_before: case inr.a.intro.inr
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : ¬1 = 0
⊢ ↑n < ↑(Part.get (order φ) (_ : (order φ).Dom) + 1)

tactic: exact Nat.lt_succ_self _
state_before: case inr.a.intro.inr
R✝ : Type ?u.4264976
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : ¬1 = 0
⊢ Part.get (order φ) (_ : (order φ).Dom) < Part.get (order φ) (_ : (order φ).Dom) + 1