Theorem: Polynomial.isUnit_leadingCoeff_mul_right_eq_zero_iff
File: Mathlib/Data/Polynomial/Monic.lean

tactic: constructor
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
⊢ p * q = 0 ↔ q = 0

tactic: intro hp
state_before: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
⊢ p * q = 0 → q = 0

tactic: rw [← smul_eq_zero_iff_eq h.unit⁻¹] at hp
state_before: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp : p * q = 0
⊢ q = 0

tactic: have : h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q := by
  ext
  simp only [Units.smul_def, coeff_smul, coeff_mul, smul_eq_mul, mul_sum]
  refine' sum_congr rfl fun x _ => _
  rw [← mul_assoc]
state_before: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
⊢ q = 0

tactic: rwa [this, Monic.mul_right_eq_zero_iff] at hp
state_before: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
this : (IsUnit.unit h)⁻¹ • (p * q) = (IsUnit.unit h)⁻¹ • p * q
⊢ q = 0

tactic: exact monic_of_isUnit_leadingCoeff_inv_smul _
state_before: case mp.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • p * q = 0
this : (IsUnit.unit h)⁻¹ • (p * q) = (IsUnit.unit h)⁻¹ • p * q
⊢ Monic ((IsUnit.unit h)⁻¹ • p)

tactic: ext
state_before: R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
⊢ (IsUnit.unit h)⁻¹ • (p * q) = (IsUnit.unit h)⁻¹ • p * q

tactic: simp only [Units.smul_def, coeff_smul, coeff_mul, smul_eq_mul, mul_sum]
state_before: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ coeff ((IsUnit.unit h)⁻¹ • (p * q)) n✝ = coeff ((IsUnit.unit h)⁻¹ • p * q) n✝

tactic: refine' sum_congr rfl fun x _ => _
state_before: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ ∑ x in Nat.antidiagonal n✝, ↑(IsUnit.unit h)⁻¹ * (coeff p x.fst * coeff q x.snd) =
    ∑ x in Nat.antidiagonal n✝, ↑(IsUnit.unit h)⁻¹ * coeff p x.fst * coeff q x.snd

tactic: rw [← mul_assoc]
state_before: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
hp✝ : p * q = 0
hp : (IsUnit.unit h)⁻¹ • (p * q) = 0
n✝ : ℕ
x : ℕ × ℕ
x✝ : x ∈ Nat.antidiagonal n✝
⊢ ↑(IsUnit.unit h)⁻¹ * (coeff p x.fst * coeff q x.snd) = ↑(IsUnit.unit h)⁻¹ * coeff p x.fst * coeff q x.snd

tactic: rintro rfl
state_before: case mpr
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
q : R[X]
⊢ q = 0 → p * q = 0

tactic: simp
state_before: case mpr
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit (leadingCoeff p)
⊢ p * 0 = 0