Theorem: AdjoinRoot.minpoly_root
File: Mathlib/RingTheory/AdjoinRoot.lean

tactic: have f'_monic : Monic _ := monic_mul_leadingCoeff_inv hf
state_before: R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
⊢ minpoly K (root f) = f * ↑C (Polynomial.leadingCoeff f)⁻¹

tactic: refine' (minpoly.unique K _ f'_monic _ _).symm
state_before: R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
⊢ minpoly K (root f) = f * ↑C (Polynomial.leadingCoeff f)⁻¹

tactic: intro q q_monic q_aeval
state_before: case refine'_2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
⊢ ∀ (q : K[X]), Monic q → ↑(aeval (root f)) q = 0 → degree (f * ↑C (Polynomial.leadingCoeff f)⁻¹) ≤ degree q

tactic: rw [degree_eq_natDegree f'_monic.ne_zero, degree_eq_natDegree q_monic.ne_zero,
  Nat.cast_withBot, Nat.cast_withBot, WithBot.coe_le_coe, natDegree_mul hf, natDegree_C, add_zero]
state_before: case refine'_2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ degree (f * ↑C (Polynomial.leadingCoeff f)⁻¹) ≤ degree q

tactic: apply natDegree_le_of_dvd
state_before: case refine'_2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ natDegree f ≤ natDegree q

case refine'_2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ ↑C (Polynomial.leadingCoeff f)⁻¹ ≠ 0

tactic: rw [AlgHom.map_mul, aeval_eq, mk_self, MulZeroClass.zero_mul]
state_before: case refine'_1
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
⊢ ↑(aeval (root f)) (f * ↑C (Polynomial.leadingCoeff f)⁻¹) = 0

tactic: ext
state_before: R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
⊢ RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f

tactic: simp only [RingHom.comp_apply, mk_C, lift_of]
state_before: case h₁.a
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
x✝ : K
⊢ ↑(RingHom.comp (RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q)) C) x✝ =
    ↑(RingHom.comp (mk f) C) x✝

tactic: rfl
state_before: case h₁.a
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
x✝ : K
⊢ ↑(algebraMap K (AdjoinRoot f)) x✝ = ↑(of f) x✝

tactic: simp only [RingHom.comp_apply, mk_X, lift_root]
state_before: case h₂
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
⊢ ↑(RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q)) X = ↑(mk f) X

tactic: have : mk f q = 0 := by rw [← commutes, RingHom.comp_apply, mk_self, RingHom.map_zero]
state_before: case refine'_2.h1
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ f ∣ q

tactic: exact mk_eq_zero.1 this
state_before: case refine'_2.h1
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
this : ↑(mk f) q = 0
⊢ f ∣ q

tactic: rw [← commutes, RingHom.comp_apply, mk_self, RingHom.map_zero]
state_before: R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ ↑(mk f) q = 0

tactic: exact q_monic.ne_zero
state_before: case refine'_2.h2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ q ≠ 0

tactic: rwa [Ne.def, C_eq_zero, inv_eq_zero, leadingCoeff_eq_zero]
state_before: case refine'_2
R : Type u
S : Type v
K : Type w
inst✝¹ : CommRing R
g : R[X]
inst✝ : Field K
f : K[X]
hf : f ≠ 0
f'_monic : Monic (f * ↑C (Polynomial.leadingCoeff f)⁻¹)
q : K[X]
q_monic : Monic q
q_aeval : ↑(aeval (root f)) q = 0
commutes : RingHom.comp (lift (algebraMap K (AdjoinRoot f)) (root f) q_aeval) (mk q) = mk f
⊢ ↑C (Polynomial.leadingCoeff f)⁻¹ ≠ 0