Theorem: LinearMap.minpoly_coeff_zero_of_injective
File: Mathlib/LinearAlgebra/Charpoly/Basic.lean

tactic: intro h
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
⊢ coeff (minpoly R f) 0 ≠ 0

tactic: obtain ⟨P, hP⟩ := X_dvd_iff.2 h
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
⊢ False

tactic: have hdegP : P.degree < (minpoly R f).degree := by
  rw [hP, mul_comm]
  refine' degree_lt_degree_mul_X fun h => _
  rw [h, MulZeroClass.mul_zero] at hP
  exact minpoly.ne_zero (isIntegral f) hP
state_before: case intro
R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
⊢ False

tactic: have hPmonic : P.Monic := by
  suffices (minpoly R f).Monic by
    rwa [Monic.def, hP, mul_comm, leadingCoeff_mul_X, ← Monic.def] at this
  exact minpoly.monic (isIntegral f)
state_before: case intro
R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
⊢ False

tactic: have hzero : aeval f (minpoly R f) = 0 := minpoly.aeval _ _
state_before: case intro
R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
hPmonic : Monic P
⊢ False

tactic: simp only [hP, mul_eq_comp, ext_iff, hf, aeval_X, map_eq_zero_iff, coe_comp, AlgHom.map_mul,
  zero_apply, Function.comp_apply] at hzero
state_before: case intro
R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
hPmonic : Monic P
hzero : ↑(aeval f) (minpoly R f) = 0
⊢ False

tactic: exact not_le.2 hdegP (minpoly.min _ _ hPmonic (ext hzero))
state_before: case intro
R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
hPmonic : Monic P
hzero : ∀ (x : M), ↑(↑(aeval f) P) x = 0
⊢ False

tactic: rw [hP, mul_comm]
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
⊢ degree P < degree (minpoly R f)

tactic: refine' degree_lt_degree_mul_X fun h => _
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
⊢ degree P < degree (P * X)

tactic: rw [h, MulZeroClass.mul_zero] at hP
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h✝ : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
h : P = 0
⊢ False

tactic: exact minpoly.ne_zero (isIntegral f) hP
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h✝ : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = 0
h : P = 0
⊢ False

tactic: suffices (minpoly R f).Monic by
  rwa [Monic.def, hP, mul_comm, leadingCoeff_mul_X, ← Monic.def] at this
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
⊢ Monic P

tactic: exact minpoly.monic (isIntegral f)
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
⊢ Monic (minpoly R f)

tactic: rwa [Monic.def, hP, mul_comm, leadingCoeff_mul_X, ← Monic.def] at this
state_before: R : Type u
M : Type v
inst✝⁵ : CommRing R
inst✝⁴ : Nontrivial R
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module.Free R M
inst✝ : Module.Finite R M
f : M →ₗ[R] M
hf : Function.Injective ↑f
h : coeff (minpoly R f) 0 = 0
P : R[X]
hP : minpoly R f = X * P
hdegP : degree P < degree (minpoly R f)
this : Monic (minpoly R f)
⊢ Monic P