Theorem: Polynomial.isUnit_leadingCoeff_mul_right_eq_zero_iff
File: Mathlib/Algebra/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 p.leadingCoeff
q : R[X]
⊢ p * q = 0 ↔ q = 0
state_after: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
⊢ p * q = 0 → q = 0

case mpr
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
⊢ q = 0 → p * 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 p.leadingCoeff
q : R[X]
⊢ p * q = 0 → q = 0
state_after: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : 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 p.leadingCoeff
q : R[X]
hp : p * q = 0
⊢ q = 0
state_after: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
⊢ q = 0
state_after: case mp
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
this : h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q
⊢ 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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
this : h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q
⊢ q = 0
state_after: case mp.h
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • p * q = 0
this : h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q
⊢ (h.unit⁻¹ • p).Monic

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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • p * q = 0
this : h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q
⊢ (h.unit⁻¹ • p).Monic
state_after: no goals

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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
⊢ h.unit⁻¹ • (p * q) = h.unit⁻¹ • p * q
state_after: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ (h.unit⁻¹ • (p * q)).coeff n✝ = (h.unit⁻¹ • p * q).coeff n✝

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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ (h.unit⁻¹ • (p * q)).coeff n✝ = (h.unit⁻¹ • p * q).coeff n✝
state_after: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ ∑ i ∈ antidiagonal n✝, ↑h.unit⁻¹ * (p.coeff i.1 * q.coeff i.2) =
    ∑ x ∈ antidiagonal n✝, ↑h.unit⁻¹ * p.coeff x.1 * q.coeff x.2

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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
⊢ ∑ i ∈ antidiagonal n✝, ↑h.unit⁻¹ * (p.coeff i.1 * q.coeff i.2) =
    ∑ x ∈ antidiagonal n✝, ↑h.unit⁻¹ * p.coeff x.1 * q.coeff x.2
state_after: case a
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
x : ℕ × ℕ
x✝ : x ∈ antidiagonal n✝
⊢ ↑h.unit⁻¹ * (p.coeff x.1 * q.coeff x.2) = ↑h.unit⁻¹ * p.coeff x.1 * q.coeff x.2

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 p.leadingCoeff
q : R[X]
hp : h.unit⁻¹ • (p * q) = 0
n✝ : ℕ
x : ℕ × ℕ
x✝ : x ∈ antidiagonal n✝
⊢ ↑h.unit⁻¹ * (p.coeff x.1 * q.coeff x.2) = ↑h.unit⁻¹ * p.coeff x.1 * q.coeff x.2
state_after: no goals

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 p.leadingCoeff
q : R[X]
⊢ q = 0 → p * q = 0
state_after: case mpr
R : Type u
S : Type v
a b : R
m n : ℕ
ι : Type y
inst✝ : Semiring R
p : R[X]
h : IsUnit p.leadingCoeff
⊢ p * 0 = 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 p.leadingCoeff
⊢ p * 0 = 0
state_after: no goals