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

tactic: rw [← cyclotomic']
state_before: K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ : K
n : ℕ
hz : IsPrimitiveRoot ζ n
⊢ cyclotomic n K = ∏ μ in primitiveRoots n K, (X - ↑C μ)

tactic: induction' n using Nat.strong_induction_on with k hk generalizing ζ
state_before: K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ : K
n : ℕ
hz : IsPrimitiveRoot ζ n
⊢ cyclotomic n K = cyclotomic' n K

tactic: obtain hzero | hpos := k.eq_zero_or_pos
state_before: case h
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
⊢ cyclotomic k K = cyclotomic' k K

tactic: have h : ∀ i ∈ k.properDivisors, cyclotomic i K = cyclotomic' i K := by
  intro i hi
  obtain ⟨d, hd⟩ := (Nat.mem_properDivisors.1 hi).1
  rw [mul_comm] at hd
  exact hk i (Nat.mem_properDivisors.1 hi).2 (IsPrimitiveRoot.pow hpos hz hd)
state_before: case h.inr
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
⊢ cyclotomic k K = cyclotomic' k K

tactic: rw [@cyclotomic_eq_X_pow_sub_one_div _ _ _ hpos, cyclotomic'_eq_X_pow_sub_one_div hpos hz,
  Finset.prod_congr (refl k.properDivisors) h]
state_before: case h.inr
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
h : ∀ (i : ℕ), i ∈ Nat.properDivisors k → cyclotomic i K = cyclotomic' i K
⊢ cyclotomic k K = cyclotomic' k K

tactic: simp only [hzero, cyclotomic'_zero, cyclotomic_zero]
state_before: case h.inl
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hzero : k = 0
⊢ cyclotomic k K = cyclotomic' k K

tactic: intro i hi
state_before: K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
⊢ ∀ (i : ℕ), i ∈ Nat.properDivisors k → cyclotomic i K = cyclotomic' i K

tactic: obtain ⟨d, hd⟩ := (Nat.mem_properDivisors.1 hi).1
state_before: K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
i : ℕ
hi : i ∈ Nat.properDivisors k
⊢ cyclotomic i K = cyclotomic' i K

tactic: rw [mul_comm] at hd
state_before: case intro
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
i : ℕ
hi : i ∈ Nat.properDivisors k
d : ℕ
hd : k = i * d
⊢ cyclotomic i K = cyclotomic' i K

tactic: exact hk i (Nat.mem_properDivisors.1 hi).2 (IsPrimitiveRoot.pow hpos hz hd)
state_before: case intro
K : Type u_1
inst✝¹ : CommRing K
inst✝ : IsDomain K
ζ✝ : K
n : ℕ
hz✝ : IsPrimitiveRoot ζ✝ n
k : ℕ
hk : ∀ (m : ℕ), m < k → ∀ {ζ : K}, IsPrimitiveRoot ζ m → cyclotomic m K = cyclotomic' m K
ζ : K
hz : IsPrimitiveRoot ζ k
hpos : k > 0
i : ℕ
hi : i ∈ Nat.properDivisors k
d : ℕ
hd : k = d * i
⊢ cyclotomic i K = cyclotomic' i K