Theorem: Polynomial.EisensteinCriterionAux.map_eq_C_mul_X_pow_of_forall_coeff_mem
File: Mathlib/RingTheory/EisensteinCriterion.lean

tactic: by_cases hf0 : f = 0
state_before: R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: case pos
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : f = 0
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

case neg
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

tactic: rcases lt_trichotomy (n : WithBot ℕ) (degree f) with (h | h | h)
state_before: case neg
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: case neg.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n < f.degree
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

case neg.inr.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n = f.degree
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

tactic: simp [hf0]
state_before: case pos
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : f = 0
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: no goals

tactic: erw [coeff_map, eq_zero_iff_mem.2 (hfP n h), coeff_C_mul, coeff_X_pow, if_neg,
  mul_zero]
state_before: case neg.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n < f.degree
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: case neg.inl.hnc
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n < f.degree
⊢ ¬n = f.natDegree

tactic: rintro rfl
state_before: case neg.inl.hnc
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n < f.degree
⊢ ¬n = f.natDegree
state_after: case neg.inl.hnc
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
hf0 : ¬f = 0
h : ↑f.natDegree < f.degree
⊢ False

tactic: exact not_lt_of_ge degree_le_natDegree h
state_before: case neg.inl.hnc
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
hf0 : ¬f = 0
h : ↑f.natDegree < f.degree
⊢ False
state_after: no goals

tactic: have : natDegree f = n := natDegree_eq_of_degree_eq_some h.symm
state_before: case neg.inr.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n = f.degree
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: case neg.inr.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n = f.degree
this : f.natDegree = n
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n

tactic: rw [coeff_C_mul, coeff_X_pow, if_pos this.symm, mul_one, leadingCoeff, this, coeff_map]
state_before: case neg.inr.inl
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : ↑n = f.degree
this : f.natDegree = n
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: no goals

tactic: rw [coeff_eq_zero_of_degree_lt, coeff_eq_zero_of_degree_lt]
state_before: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (map (mk P) f).coeff n = (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).coeff n
state_after: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).degree < ↑n

case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (map (mk P) f).degree < ↑n

tactic: refine lt_of_le_of_lt (degree_C_mul_X_pow_le _ _) ?_
state_before: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (C ((mk P) f.leadingCoeff) * X ^ f.natDegree).degree < ↑n
state_after: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ ↑f.natDegree < ↑n

tactic: rwa [← degree_eq_natDegree hf0]
state_before: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ ↑f.natDegree < ↑n
state_after: no goals

tactic: exact lt_of_le_of_lt (degree_map_le _ _) h
state_before: case neg.inr.inr
R : Type u_1
inst✝ : CommRing R
f : R[X]
P : Ideal R
hfP : ∀ (n : ℕ), ↑n < f.degree → f.coeff n ∈ P
n : ℕ
hf0 : ¬f = 0
h : f.degree < ↑n
⊢ (map (mk P) f).degree < ↑n
state_after: no goals