Theorem: Polynomial.cyclotomic_injective
File: Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean

tactic: intro n m hnm
state_before: R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
⊢ Function.Injective fun n => cyclotomic n R
state_after: R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : (fun n => cyclotomic n R) n = (fun n => cyclotomic n R) m
⊢ n = m

tactic: simp only at hnm
state_before: R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : (fun n => cyclotomic n R) n = (fun n => cyclotomic n R) m
⊢ n = m
state_after: R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
⊢ n = m

tactic: rcases eq_or_ne n 0 with (rfl | hzero)
state_before: R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
⊢ n = m
state_after: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : cyclotomic 0 R = cyclotomic m R
⊢ 0 = m

case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
hzero : n ≠ 0
⊢ n = m

tactic: rw [cyclotomic_zero] at hnm
state_before: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : cyclotomic 0 R = cyclotomic m R
⊢ 0 = m
state_after: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : 1 = cyclotomic m R
⊢ 0 = m

tactic: replace hnm := congr_arg natDegree hnm
state_before: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : 1 = cyclotomic m R
⊢ 0 = m
state_after: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : natDegree 1 = (cyclotomic m R).natDegree
⊢ 0 = m

tactic: rwa [natDegree_one, natDegree_cyclotomic, eq_comm, Nat.totient_eq_zero, eq_comm] at hnm
state_before: case inl
R : Type u_1
inst✝¹ : CommRing R
n : ℕ
inst✝ : CharZero R
m : ℕ
hnm : natDegree 1 = (cyclotomic m R).natDegree
⊢ 0 = m
state_after: no goals

tactic: haveI := NeZero.mk hzero
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
hzero : n ≠ 0
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
hzero : n ≠ 0
this : NeZero n
⊢ n = m

tactic: rw [← map_cyclotomic_int _ R, ← map_cyclotomic_int _ R] at hnm
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : cyclotomic n R = cyclotomic m R
hzero : n ≠ 0
this : NeZero n
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : map (Int.castRingHom R) (cyclotomic n ℤ) = map (Int.castRingHom R) (cyclotomic m ℤ)
hzero : n ≠ 0
this : NeZero n
⊢ n = m

tactic: replace hnm := map_injective (Int.castRingHom R) Int.cast_injective hnm
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hnm : map (Int.castRingHom R) (cyclotomic n ℤ) = map (Int.castRingHom R) (cyclotomic m ℤ)
hzero : n ≠ 0
this : NeZero n
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℤ = cyclotomic m ℤ
⊢ n = m

tactic: replace hnm := congr_arg (map (Int.castRingHom ℂ)) hnm
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℤ = cyclotomic m ℤ
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : map (Int.castRingHom ℂ) (cyclotomic n ℤ) = map (Int.castRingHom ℂ) (cyclotomic m ℤ)
⊢ n = m

tactic: rw [map_cyclotomic_int, map_cyclotomic_int] at hnm
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : map (Int.castRingHom ℂ) (cyclotomic n ℤ) = map (Int.castRingHom ℂ) (cyclotomic m ℤ)
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
⊢ n = m

tactic: have hprim := Complex.isPrimitiveRoot_exp _ hzero
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
⊢ n = m

tactic: have hroot := isRoot_cyclotomic_iff (R := ℂ).2 hprim
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic n ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m

tactic: rw [hnm] at hroot
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic n ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic m ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m

tactic: haveI hmzero : NeZero m := ⟨fun h => by simp [h] at hroot⟩
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic m ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic m ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
hmzero : NeZero m
⊢ n = m

tactic: rw [isRoot_cyclotomic_iff (R := ℂ)] at hroot
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic m ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
hmzero : NeZero m
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) m
hmzero : NeZero m
⊢ n = m

tactic: replace hprim := hprim.eq_orderOf
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) m
hmzero : NeZero m
⊢ n = m
state_after: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hroot : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) m
hmzero : NeZero m
hprim : n = orderOf (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m

tactic: rwa [← IsPrimitiveRoot.eq_orderOf hroot] at hprim
state_before: case inr
R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hroot : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) m
hmzero : NeZero m
hprim : n = orderOf (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
⊢ n = m
state_after: no goals

tactic: simp [h] at hroot
state_before: R : Type u_1
inst✝¹ : CommRing R
n✝ : ℕ
inst✝ : CharZero R
n m : ℕ
hzero : n ≠ 0
this : NeZero n
hnm : cyclotomic n ℂ = cyclotomic m ℂ
hprim : IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n
hroot : (cyclotomic m ℂ).IsRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n))
h : m = 0
⊢ False
state_after: no goals