@@ -811,6 +811,58 @@ lemma minimal_polynomial_dvd_mod_p {p : ℕ} [hprime : fact p.prime] (hdiv : ¬
811
811
(unique_factorization_monoid.dvd_pow_iff_dvd_of_squarefree (squarefree_minimal_polynomial_mod h
812
812
hpos hdiv) (nat.prime.ne_zero hprime)).1 (minimal_polynomial_dvd_pow_mod h hpos hdiv)
813
813
814
+ /-- If `p` is a prime that does not divide `n`,
815
+ then the minimal polynomials of a primitive `n`-th root of unity `μ`
816
+ and of `μ ^ p` are the same. -/
817
+ lemma minimal_polynomial_eq_pow {p : ℕ} [hprime : fact p.prime] (hdiv : ¬ p ∣ n) :
818
+ minimal_polynomial (is_integral h hpos) =
819
+ minimal_polynomial (is_integral (pow_of_prime h hprime hdiv) hpos) :=
820
+ begin
821
+ by_contra hdiff,
822
+ set P := minimal_polynomial (is_integral h hpos),
823
+ set Q := minimal_polynomial (is_integral (pow_of_prime h hprime hdiv) hpos),
824
+ have Pmonic : P.monic := minimal_polynomial.monic _,
825
+ have Qmonic : Q.monic := minimal_polynomial.monic _,
826
+ have Pirr : irreducible P := minimal_polynomial.irreducible _,
827
+ have Qirr : irreducible Q := minimal_polynomial.irreducible _,
828
+ have PQprim : is_primitive (P * Q) := Pmonic.is_primitive.mul Qmonic.is_primitive,
829
+ have prod : P * Q ∣ X ^ n - 1 ,
830
+ { apply (is_primitive.int.dvd_iff_map_cast_dvd_map_cast (P * Q) (X ^ n - 1 ) PQprim
831
+ ((monic_X_pow_sub_C 1 (ne_of_lt hpos).symm).is_primitive)).2 ,
832
+ rw [map_mul],
833
+ refine is_coprime.mul_dvd _ _ _,
834
+ { have aux := is_primitive.int.irreducible_iff_irreducible_map_cast Pmonic.is_primitive,
835
+ refine (dvd_or_coprime _ _ (aux.1 Pirr)).resolve_left _,
836
+ rw map_dvd_map (int.cast_ring_hom ℚ) int.cast_injective Pmonic,
837
+ intro hdiv,
838
+ refine hdiff (eq_of_monic_of_associated Pmonic Qmonic _),
839
+ exact associated_of_dvd_dvd hdiv (dvd_symm_of_irreducible Pirr Qirr hdiv) },
840
+ { apply (map_dvd_map (int.cast_ring_hom ℚ) int.cast_injective Pmonic).2 ,
841
+ exact minimal_polynomial_dvd_X_pow_sub_one h hpos },
842
+ { apply (map_dvd_map (int.cast_ring_hom ℚ) int.cast_injective Qmonic).2 ,
843
+ exact minimal_polynomial_dvd_X_pow_sub_one (pow_of_prime h hprime hdiv) hpos } },
844
+ replace prod := ring_hom.map_dvd (ring_hom.of (map (int.cast_ring_hom (zmod p)))) prod,
845
+ rw [ring_hom.coe_of, map_mul, map_sub, map_one, map_pow, map_X] at prod,
846
+ obtain ⟨R, hR⟩ := minimal_polynomial_dvd_mod_p h hpos hdiv,
847
+ rw [hR, ← mul_assoc, ← map_mul, ← pow_two, map_pow] at prod,
848
+ have habs : map (int.cast_ring_hom (zmod p)) P ^ 2 ∣ map (int.cast_ring_hom (zmod p)) P ^ 2 * R,
849
+ { use R },
850
+ replace habs := lt_of_lt_of_le (enat.coe_lt_coe.2 one_lt_two)
851
+ (multiplicity.le_multiplicity_of_pow_dvd (dvd_trans habs prod)),
852
+ have hfree : squarefree (X ^ n - 1 : polynomial (zmod p)),
853
+ { refine squarefree_X_pow_sub_C 1 _ one_ne_zero,
854
+ by_contra hzero,
855
+ exact hdiv ((zmod.nat_coe_zmod_eq_zero_iff_dvd n p).1 (not_not.1 hzero)) },
856
+ cases (multiplicity.squarefree_iff_multiplicity_le_one (X ^ n - 1 )).1 hfree
857
+ (map (int.cast_ring_hom (zmod p)) P) with hle hunit,
858
+ { exact not_lt_of_le hle habs },
859
+ { replace hunit := degree_eq_zero_of_is_unit hunit,
860
+ rw degree_map_eq_of_leading_coeff_ne_zero _ _ at hunit,
861
+ { exact (ne_of_lt (minimal_polynomial.degree_pos (is_integral h hpos))).symm hunit },
862
+ simp only [Pmonic, ring_hom.eq_int_cast, monic.leading_coeff, int.cast_one, ne.def,
863
+ not_false_iff, one_ne_zero] }
864
+ end
865
+
814
866
end minimal_polynomial
815
867
816
868
end is_primitive_root
0 commit comments