Theorem: Polynomial.cyclotomic_eq_X_pow_sub_one_div
File: Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean

tactic: nontriviality R
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
⊢ cyclotomic n R = (X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R
state_after: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ cyclotomic n R = (X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R

tactic: rw [← prod_cyclotomic_eq_X_pow_sub_one hpos, ← Nat.cons_self_properDivisors hpos.ne',
  Finset.prod_cons]
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ cyclotomic n R = (X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R
state_after: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ cyclotomic n R = (cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R

tactic: have prod_monic : (∏ i ∈ Nat.properDivisors n, cyclotomic i R).Monic := by
  apply monic_prod_of_monic
  intro i _
  exact cyclotomic.monic i R
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ cyclotomic n R = (cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R
state_after: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ cyclotomic n R = (cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R

tactic: rw [(div_modByMonic_unique (cyclotomic n R) 0 prod_monic _).1]
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ cyclotomic n R = (cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R) /ₘ ∏ i ∈ n.properDivisors, cyclotomic i R
state_after: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ 0 + (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R =
      cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R ∧
    degree 0 < (∏ i ∈ n.properDivisors, cyclotomic i R).degree

tactic: simp only [degree_zero, zero_add]
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ 0 + (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R =
      cyclotomic n R * ∏ x ∈ n.properDivisors, cyclotomic x R ∧
    degree 0 < (∏ i ∈ n.properDivisors, cyclotomic i R).degree
state_after: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R = cyclotomic n R * ∏ i ∈ n.properDivisors, cyclotomic i R ∧
    ⊥ < (∏ i ∈ n.properDivisors, cyclotomic i R).degree

tactic: constructor
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R = cyclotomic n R * ∏ i ∈ n.properDivisors, cyclotomic i R ∧
    ⊥ < (∏ i ∈ n.properDivisors, cyclotomic i R).degree
state_after: case left
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R = cyclotomic n R * ∏ i ∈ n.properDivisors, cyclotomic i R

case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ ⊥ < (∏ i ∈ n.properDivisors, cyclotomic i R).degree

tactic: rw [bot_lt_iff_ne_bot]
state_before: case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ ⊥ < (∏ i ∈ n.properDivisors, cyclotomic i R).degree
state_after: case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R).degree ≠ ⊥

tactic: intro h
state_before: case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R).degree ≠ ⊥
state_after: case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
h : (∏ i ∈ n.properDivisors, cyclotomic i R).degree = ⊥
⊢ False

tactic: exact Monic.ne_zero prod_monic (degree_eq_bot.1 h)
state_before: case right
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
h : (∏ i ∈ n.properDivisors, cyclotomic i R).degree = ⊥
⊢ False
state_after: no goals

tactic: apply monic_prod_of_monic
state_before: R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
state_after: case hs
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ ∀ i ∈ n.properDivisors, (cyclotomic i R).Monic

tactic: intro i _
state_before: case hs
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
⊢ ∀ i ∈ n.properDivisors, (cyclotomic i R).Monic
state_after: case hs
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝¹ : Nontrivial R
i : ℕ
a✝ : i ∈ n.properDivisors
⊢ (cyclotomic i R).Monic

tactic: exact cyclotomic.monic i R
state_before: case hs
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝¹ : Nontrivial R
i : ℕ
a✝ : i ∈ n.properDivisors
⊢ (cyclotomic i R).Monic
state_after: no goals

tactic: rw [mul_comm]
state_before: case left
R : Type u_1
inst✝ : CommRing R
n : ℕ
hpos : 0 < n
a✝ : Nontrivial R
prod_monic : (∏ i ∈ n.properDivisors, cyclotomic i R).Monic
⊢ (∏ i ∈ n.properDivisors, cyclotomic i R) * cyclotomic n R = cyclotomic n R * ∏ i ∈ n.properDivisors, cyclotomic i R
state_after: no goals