case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ coeff (cyclotomic n R) 0 = 1
R : Type u_1
inst✝ : CommRing R
n : ℕ
hn : 1 < n
⊢ coeff (cyclotomic n R) 0 = 1
induction' n using Nat.strong_induction_on with n hi
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ coeff (cyclotomic n R) 0 = 1
have hprod : (∏ i in Nat.properDivisors n, (Polynomial.cyclotomic i R).coeff 0) = -1 := by
  rw [← Finset.insert_erase (Nat.one_mem_properDivisors_iff_one_lt.2
    (lt_of_lt_of_le one_lt_two hn)), Finset.prod_insert (Finset.not_mem_erase 1 _),
    cyclotomic_one R]
  have hleq : ∀ j ∈ n.properDivisors.erase 1, 2 ≤ j := by
    intro j hj
    apply Nat.succ_le_of_lt
    exact (Ne.le_iff_lt (Finset.mem_erase.1 hj).1.symm).mp
      (Nat.succ_le_of_lt (Nat.pos_of_mem_properDivisors (Finset.mem_erase.1 hj).2))
  have hcongr : ∀ j ∈ n.properDivisors.erase 1, (cyclotomic j R).coeff 0 = 1 := by
    intro j hj
    exact hi j (Nat.mem_properDivisors.1 (Finset.mem_erase.1 hj).2).2 (hleq j hj)
  have hrw : (∏ x : ℕ in n.properDivisors.erase 1, (cyclotomic x R).coeff 0) = 1 := by
    rw [Finset.prod_congr (refl (n.properDivisors.erase 1)) hcongr]
    simp only [Finset.prod_const_one]
  simp only [hrw, mul_one, zero_sub, coeff_one_zero, coeff_X_zero, coeff_sub]
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
⊢ coeff (cyclotomic n R) 0 = 1
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
have heq : (X ^ n - 1 : R[X]).coeff 0 = -(cyclotomic n R).coeff 0 := by
  rw [← prod_cyclotomic_eq_X_pow_sub_one (zero_le_one.trans_lt hn), ←
    Nat.cons_self_properDivisors hn.ne_bot, Finset.prod_cons, mul_coeff_zero, coeff_zero_prod,
    hprod, mul_neg, mul_one]
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
hzero : coeff (X ^ n - 1) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
⊢ coeff (cyclotomic n R) 0 = 1
have hzero : (X ^ n - 1 : R[X]).coeff 0 = (-1 : R) := by
  rw [coeff_zero_eq_eval_zero _]
  simp only [zero_pow (lt_of_lt_of_le zero_lt_two hn), eval_X, eval_one, zero_sub, eval_pow,
    eval_sub]
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : -1 = -coeff (cyclotomic n R) 0
hzero : coeff (X ^ n - 1) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
hzero : coeff (X ^ n - 1) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
rw [hzero] at heq
no goals
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : -1 = -coeff (cyclotomic n R) 0
hzero : coeff (X ^ n - 1) 0 = -1
⊢ coeff (cyclotomic n R) 0 = 1
exact neg_inj.mp (Eq.symm heq)
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
rw [← Finset.insert_erase (Nat.one_mem_properDivisors_iff_one_lt.2
  (lt_of_lt_of_le one_lt_two hn)), Finset.prod_insert (Finset.not_mem_erase 1 _),
  cyclotomic_one R]
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
have hleq : ∀ j ∈ n.properDivisors.erase 1, 2 ≤ j := by
  intro j hj
  apply Nat.succ_le_of_lt
  exact (Ne.le_iff_lt (Finset.mem_erase.1 hj).1.symm).mp
    (Nat.succ_le_of_lt (Nat.pos_of_mem_properDivisors (Finset.mem_erase.1 hj).2))
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
have hcongr : ∀ j ∈ n.properDivisors.erase 1, (cyclotomic j R).coeff 0 = 1 := by
  intro j hj
  exact hi j (Nat.mem_properDivisors.1 (Finset.mem_erase.1 hj).2).2 (hleq j hj)
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
hrw : ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = 1
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
have hrw : (∏ x : ℕ in n.properDivisors.erase 1, (cyclotomic x R).coeff 0) = 1 := by
  rw [Finset.prod_congr (refl (n.properDivisors.erase 1)) hcongr]
  simp only [Finset.prod_const_one]
no goals
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
hrw : ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = 1
⊢ coeff (X - 1) 0 * ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = -1
simp only [hrw, mul_one, zero_sub, coeff_one_zero, coeff_X_zero, coeff_sub]
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ 2 ≤ j
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
⊢ ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
intro j hj
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ 1 < j
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ 2 ≤ j
apply Nat.succ_le_of_lt
no goals
case h
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ 1 < j
exact (Ne.le_iff_lt (Finset.mem_erase.1 hj).1.symm).mp
  (Nat.succ_le_of_lt (Nat.pos_of_mem_properDivisors (Finset.mem_erase.1 hj).2))
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ coeff (cyclotomic j R) 0 = 1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
⊢ ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
intro j hj
no goals
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
j : ℕ
hj : j ∈ Finset.erase (Nat.properDivisors n) 1
⊢ coeff (cyclotomic j R) 0 = 1
exact hi j (Nat.mem_properDivisors.1 (Finset.mem_erase.1 hj).2).2 (hleq j hj)
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
⊢ ∏ x in Finset.erase (Nat.properDivisors n) 1, 1 = 1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
⊢ ∏ x in Finset.erase (Nat.properDivisors n) 1, coeff (cyclotomic x R) 0 = 1
rw [Finset.prod_congr (refl (n.properDivisors.erase 1)) hcongr]
no goals
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hleq : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → 2 ≤ j
hcongr : ∀ (j : ℕ), j ∈ Finset.erase (Nat.properDivisors n) 1 → coeff (cyclotomic j R) 0 = 1
⊢ ∏ x in Finset.erase (Nat.properDivisors n) 1, 1 = 1
simp only [Finset.prod_const_one]
no goals
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
⊢ coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
rw [← prod_cyclotomic_eq_X_pow_sub_one (zero_le_one.trans_lt hn), ←
  Nat.cons_self_properDivisors hn.ne_bot, Finset.prod_cons, mul_coeff_zero, coeff_zero_prod,
  hprod, mul_neg, mul_one]
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
⊢ eval 0 (X ^ n - 1) = -1
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
⊢ coeff (X ^ n - 1) 0 = -1
rw [coeff_zero_eq_eval_zero _]
no goals
R : Type u_1
inst✝ : CommRing R
n✝ : ℕ
hn✝ : 1 < n✝
n : ℕ
hi : ∀ (m : ℕ), m < n → 1 < m → coeff (cyclotomic m R) 0 = 1
hn : 1 < n
hprod : ∏ i in Nat.properDivisors n, coeff (cyclotomic i R) 0 = -1
heq : coeff (X ^ n - 1) 0 = -coeff (cyclotomic n R) 0
⊢ eval 0 (X ^ n - 1) = -1
simp only [zero_pow (lt_of_lt_of_le zero_lt_two hn), eval_X, eval_one, zero_sub, eval_pow,
  eval_sub]