Theorem: PowerSeries.order_eq
File: Mathlib/RingTheory/PowerSeries/Order.lean

tactic: induction n using PartENat.casesOn
state_before: R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
n : PartENat
⊢ φ.order = n ↔ (∀ (i : ℕ), ↑i = n → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < n → (coeff R i) φ = 0
state_after: case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ.order = ⊤ ↔ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0

case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
n✝ : ℕ
⊢ φ.order = ↑n✝ ↔ (∀ (i : ℕ), ↑i = ↑n✝ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ↑n✝ → (coeff R i) φ = 0

tactic: rw [order_eq_top]
state_before: case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ.order = ⊤ ↔ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
state_after: case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ = 0 ↔ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0

tactic: constructor
state_before: case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ = 0 ↔ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
state_after: case a.mp
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ = 0 → (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0

case a.mpr
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ ((∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0) → φ = 0

tactic: rintro rfl
state_before: case a.mp
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ φ = 0 → (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
state_after: case a.mp
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
⊢ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) 0 ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) 0 = 0

tactic: constructor <;> intros
state_before: case a.mp
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
⊢ (∀ (i : ℕ), ↑i = ⊤ → (coeff R i) 0 ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) 0 = 0
state_after: case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ (coeff R i✝) 0 ≠ 0

case a.mp.right
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ < ⊤
⊢ (coeff R i✝) 0 = 0

tactic: exfalso
state_before: case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ (coeff R i✝) 0 ≠ 0
state_after: case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ False

tactic: exact PartENat.natCast_ne_top ‹_› ‹_›
state_before: case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ False
state_after: no goals

tactic: exact (coeff _ _).map_zero
state_before: case a.mp.right
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
i✝ : ℕ
a✝ : ↑i✝ < ⊤
⊢ (coeff R i✝) 0 = 0
state_after: no goals

tactic: rintro ⟨_h₁, h₂⟩
state_before: case a.mpr
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
⊢ ((∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0) → φ = 0
state_after: case a.mpr.intro
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
⊢ φ = 0

tactic: ext i
state_before: case a.mpr.intro
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
⊢ φ = 0
state_after: case a.mpr.intro.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
i : ℕ
⊢ (coeff R i) φ = (coeff R i) 0

tactic: exact h₂ i (PartENat.natCast_lt_top i)
state_before: case a.mpr.intro.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → (coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → (coeff R i) φ = 0
i : ℕ
⊢ (coeff R i) φ = (coeff R i) 0
state_after: no goals

tactic: simpa [PartENat.natCast_inj] using order_eq_nat
state_before: case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : R⟦X⟧
n✝ : ℕ
⊢ φ.order = ↑n✝ ↔ (∀ (i : ℕ), ↑i = ↑n✝ → (coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ↑n✝ → (coeff R i) φ = 0
state_after: no goals