Skip to content

Commit

Permalink
feat(algebra/group): make map_[z]pow generic in monoid_hom_class (#…
Browse files Browse the repository at this point in the history
…10749)

This PR makes `map_pow` take a `monoid_hom_class` instead of specifically a `monoid_hom`.
  • Loading branch information
Vierkantor committed Dec 14, 2021
1 parent f46a7a0 commit 9078914
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 56 deletions.
44 changes: 31 additions & 13 deletions src/algebra/group/hom.lean
Expand Up @@ -281,6 +281,25 @@ by rw [map_mul, map_inv]
(f : F) (x y : G) : f (x / y) = f x / f y :=
by rw [div_eq_mul_inv, div_eq_mul_inv, map_mul_inv]

@[simp, to_additive map_nsmul] theorem map_pow [monoid G] [monoid H] [monoid_hom_class F G H]
(f : F) (a : G) :
∀ (n : ℕ), f (a ^ n) = (f a) ^ n
| 0 := by rw [pow_zero, pow_zero, map_one]
| (n+1) := by rw [pow_succ, pow_succ, map_mul, map_pow]

@[to_additive]
theorem map_zpow' [div_inv_monoid G] [div_inv_monoid H] [monoid_hom_class F G H]
(f : F) (hf : ∀ (x : G), f (x⁻¹) = (f x)⁻¹) (a : G) :
∀ n : ℤ, f (a ^ n) = (f a) ^ n
| (n : ℕ) := by rw [zpow_coe_nat, map_pow, zpow_coe_nat]
| -[1+n] := by rw [zpow_neg_succ_of_nat, hf, map_pow, ← zpow_neg_succ_of_nat]

/-- Group homomorphisms preserve integer power. -/
@[simp, to_additive /-" Additive group homomorphisms preserve integer scaling. "-/]
theorem map_zpow [group G] [group H] [monoid_hom_class F G H] (f : F) (g : G) (n : ℤ) :
f (g ^ n) = (f g) ^ n :=
map_zpow' f (map_inv f) g n

end mul_one

section mul_zero_one
Expand Down Expand Up @@ -760,18 +779,16 @@ monoid_with_zero_hom.ext $ λ x, rfl
(f : monoid_with_zero_hom M N) : (monoid_with_zero_hom.id N).comp f = f :=
monoid_with_zero_hom.ext $ λ x, rfl

@[simp, to_additive add_monoid_hom.map_nsmul]
theorem monoid_hom.map_pow [monoid M] [monoid N] (f : M →* N) (a : M) :
∀(n : ℕ), f (a ^ n) = (f a) ^ n
| 0 := by rw [pow_zero, pow_zero, f.map_one]
| (n+1) := by rw [pow_succ, pow_succ, f.map_mul, monoid_hom.map_pow]
@[to_additive add_monoid_hom.map_nsmul]
protected theorem monoid_hom.map_pow [monoid M] [monoid N] (f : M →* N) (a : M) (n : ℕ) :
f (a ^ n) = (f a) ^ n :=
map_pow f a n

@[to_additive]
theorem monoid_hom.map_zpow' [div_inv_monoid M] [div_inv_monoid N] (f : M →* N)
(hf : ∀ x, f (x⁻¹) = (f x)⁻¹) (a : M) :
∀ n : ℤ, f (a ^ n) = (f a) ^ n
| (n : ℕ) := by rw [zpow_coe_nat, f.map_pow, zpow_coe_nat]
| -[1+n] := by rw [zpow_neg_succ_of_nat, hf, f.map_pow, ← zpow_neg_succ_of_nat]
protected theorem monoid_hom.map_zpow' [div_inv_monoid M] [div_inv_monoid N] (f : M →* N)
(hf : ∀ x, f (x⁻¹) = (f x)⁻¹) (a : M) (n : ℤ) :
f (a ^ n) = (f a) ^ n :=
map_zpow' f hf a n

@[to_additive]
theorem monoid_hom.map_div' [div_inv_monoid M] [div_inv_monoid N] (f : M →* N)
Expand Down Expand Up @@ -926,9 +943,10 @@ protected theorem map_inv {G H} [group G] [group H] (f : G →* H) (g : G) : f g
map_inv f g

/-- Group homomorphisms preserve integer power. -/
@[simp, to_additive /-" Additive group homomorphisms preserve integer scaling. "-/]
theorem map_zpow {G H} [group G] [group H] (f : G →* H) (g : G) (n : ℤ) : f (g ^ n) = (f g) ^ n :=
f.map_zpow' f.map_inv g n
@[to_additive /-" Additive group homomorphisms preserve integer scaling. "-/]
protected theorem map_zpow {G H} [group G] [group H] (f : G →* H) (g : G) (n : ℤ) :
f (g ^ n) = (f g) ^ n :=
map_zpow f g n

/-- Group homomorphisms preserve division. -/
@[to_additive /-" Additive group homomorphisms preserve subtraction. "-/]
Expand Down
4 changes: 2 additions & 2 deletions src/algebra/group_power/basic.lean
Expand Up @@ -286,9 +286,9 @@ namespace ring_hom

variables [semiring R] [semiring S]

@[simp] lemma map_pow (f : R →+* S) (a) :
protected lemma map_pow (f : R →+* S) (a) :
∀ n : ℕ, f (a ^ n) = (f a) ^ n :=
f.to_monoid_hom.map_pow a
map_pow f a

end ring_hom

Expand Down
8 changes: 4 additions & 4 deletions src/category_theory/preadditive/default.lean
Expand Up @@ -133,16 +133,16 @@ map_neg (left_comp R f) g
by simp

lemma nsmul_comp (n : ℕ) : (n • f) ≫ g = n • (f ≫ g) :=
map_nsmul (right_comp _ _) _ _
map_nsmul (right_comp P g) f n

lemma comp_nsmul (n : ℕ) : f ≫ (n • g) = n • (f ≫ g) :=
map_nsmul (left_comp _ _) _ _
map_nsmul (left_comp R f) g n

lemma zsmul_comp (n : ℤ) : (n • f) ≫ g = n • (f ≫ g) :=
map_zsmul (right_comp _ _) _ _
map_zsmul (right_comp P g) f n

lemma comp_zsmul (n : ℤ) : f ≫ (n • g) = n • (f ≫ g) :=
map_zsmul (left_comp _ _) _ _
map_zsmul (left_comp R f) g n

@[reassoc] lemma comp_sum {P Q R : C} {J : Type*} (s : finset J) (f : P ⟶ Q) (g : J → (Q ⟶ R)) :
f ≫ ∑ j in s, g j = ∑ j in s, f ≫ g j :=
Expand Down
4 changes: 2 additions & 2 deletions src/data/polynomial/derivative.lean
Expand Up @@ -214,10 +214,10 @@ theorem derivative_map [comm_semiring S] (p : polynomial R) (f : R →+* S) :
polynomial.induction_on p
(λ r, by rw [map_C, derivative_C, derivative_C, map_zero])
(λ p q ihp ihq, by rw [map_add, derivative_add, ihp, ihq, derivative_add, map_add])
(λ n r ih, by rw [map_mul, map_C, map_pow, map_X,
(λ n r ih, by rw [map_mul, map_C, polynomial.map_pow, map_X,
derivative_mul, derivative_pow_succ, derivative_C, zero_mul, zero_add, derivative_X, mul_one,
derivative_mul, derivative_pow_succ, derivative_C, zero_mul, zero_add, derivative_X, mul_one,
map_mul, map_C, map_mul, map_pow, map_add, map_nat_cast, map_one, map_X])
map_mul, map_C, map_mul, polynomial.map_pow, map_add, map_nat_cast, map_one, map_X])

@[simp]
theorem iterate_derivative_map [comm_semiring S] (p : polynomial R) (f : R →+* S) (k : ℕ):
Expand Down
5 changes: 3 additions & 2 deletions src/data/polynomial/eval.lean
Expand Up @@ -594,7 +594,8 @@ ring_hom.ext $ map_map g f
lemma map_list_prod (L : list (polynomial R)) : L.prod.map f = (L.map $ map f).prod :=
eq.symm $ list.prod_hom _ (map_ring_hom f).to_monoid_hom

@[simp] lemma map_pow (n : ℕ) : (p ^ n).map f = p.map f ^ n := (map_ring_hom f).map_pow _ _
@[simp] protected lemma map_pow (n : ℕ) : (p ^ n).map f = p.map f ^ n :=
(map_ring_hom f).map_pow _ _

lemma mem_map_srange {p : polynomial S} :
p ∈ (map_ring_hom f).srange ↔ ∀ n, p.coeff n ∈ f.srange :=
Expand All @@ -606,7 +607,7 @@ begin
intros i hi,
rcases h i with ⟨c, hc⟩,
use [C c * X^i],
rw [coe_map_ring_hom, map_mul, map_C, hc, map_pow, map_X] }
rw [coe_map_ring_hom, map_mul, map_C, hc, polynomial.map_pow, map_X] }
end

lemma mem_map_range {R S : Type*} [ring R] [ring S] (f : R →+* S)
Expand Down
4 changes: 2 additions & 2 deletions src/data/polynomial/lifts.lean
Expand Up @@ -199,7 +199,7 @@ begin
{ rw [← erase_lead_add_C_mul_X_pow p, er_zero, zero_add, monic.def.1 hmonic, C_1, one_mul],
use X ^ p.nat_degree,
repeat {split},
{ simp only [map_pow, map_X] },
{ simp only [polynomial.map_pow, map_X] },
{ rw [@degree_X_pow R _ Rtrivial, degree_X_pow] },
{exact monic_pow monic_X p.nat_degree } },
obtain ⟨q, hq⟩ := mem_lifts_and_degree_eq (erase_mem_lifts p.nat_degree hlifts),
Expand All @@ -210,7 +210,7 @@ begin
← @degree_X_pow R _ Rtrivial p.nat_degree] at deg_er,
use q + X ^ p.nat_degree,
repeat {split},
{ simp only [hq, map_add, map_pow, map_X],
{ simp only [hq, map_add, polynomial.map_pow, map_X],
nth_rewrite 3 [← erase_lead_add_C_mul_X_pow p],
rw [erase_lead, monic.leading_coeff hmonic, C_1, one_mul] },
{ rw [degree_add_eq_right_of_degree_lt deg_er, @degree_X_pow R _ Rtrivial p.nat_degree,
Expand Down
12 changes: 7 additions & 5 deletions src/field_theory/abel_ruffini.lean
Expand Up @@ -182,8 +182,9 @@ begin
have C_mul_C : (C (i a⁻¹)) * (C (i a)) = 1,
{ rw [←C_mul, ←i.map_mul, inv_mul_cancel ha, i.map_one, C_1] },
have key1 : (X ^ n - 1).map i = C (i a⁻¹) * ((X ^ n - C a).map i).comp (C b * X),
{ rw [polynomial.map_sub, polynomial.map_sub, map_pow, map_X, map_C, polynomial.map_one, sub_comp,
pow_comp, X_comp, C_comp, mul_pow, ←C_pow, hb, mul_sub, ←mul_assoc, C_mul_C, one_mul] },
{ rw [polynomial.map_sub, polynomial.map_sub, polynomial.map_pow, map_X, map_C,
polynomial.map_one, sub_comp, pow_comp, X_comp, C_comp, mul_pow, ←C_pow, hb, mul_sub,
←mul_assoc, C_mul_C, one_mul] },
have key2 : (λ q : polynomial E, q.comp (C b * X)) ∘ (λ c : E, X - C c) =
(λ c : E, C b * (X - C (c / b))),
{ ext1 c,
Expand All @@ -202,10 +203,11 @@ begin
apply gal_is_solvable_tower (X ^ n - 1) (X ^ n - C x),
{ exact splits_X_pow_sub_one_of_X_pow_sub_C _ n hx (splitting_field.splits _) },
{ exact gal_X_pow_sub_one_is_solvable n },
{ rw [polynomial.map_sub, map_pow, map_X, map_C],
{ rw [polynomial.map_sub, polynomial.map_pow, map_X, map_C],
apply gal_X_pow_sub_C_is_solvable_aux,
have key := splitting_field.splits (X ^ n - 1 : polynomial F),
rwa [←splits_id_iff_splits, polynomial.map_sub, map_pow, map_X, polynomial.map_one] at key }
rwa [←splits_id_iff_splits, polynomial.map_sub, polynomial.map_pow, map_X, polynomial.map_one]
at key }
end

end gal_X_pow_sub_C
Expand Down Expand Up @@ -311,7 +313,7 @@ begin
{ refine gal_is_solvable_tower p (p.comp (X ^ n)) _ hα _,
{ exact gal.splits_in_splitting_field_of_comp _ _ (by rwa [nat_degree_X_pow]) },
{ obtain ⟨s, hs⟩ := exists_multiset_of_splits _ (splitting_field.splits p),
rw [map_comp, map_pow, map_X, hs, mul_comp, C_comp],
rw [map_comp, polynomial.map_pow, map_X, hs, mul_comp, C_comp],
apply gal_mul_is_solvable (gal_C_is_solvable _),
rw prod_comp,
apply gal_prod_is_solvable,
Expand Down
6 changes: 3 additions & 3 deletions src/field_theory/finite/basic.lean
Expand Up @@ -276,14 +276,14 @@ instance : is_splitting_field (zmod p) K (X^q - X) :=
begin
have h : (X^q - X : polynomial K).nat_degree = q :=
X_pow_card_sub_X_nat_degree_eq K fintype.one_lt_card,
rw [←splits_id_iff_splits, splits_iff_card_roots, polynomial.map_sub, map_pow, map_X, h,
roots_X_pow_card_sub_X K, ←finset.card_def, finset.card_univ],
rw [←splits_id_iff_splits, splits_iff_card_roots, polynomial.map_sub, polynomial.map_pow,
map_X, h, roots_X_pow_card_sub_X K, ←finset.card_def, finset.card_univ],
end,
adjoin_roots :=
begin
classical,
transitivity algebra.adjoin (zmod p) ((roots (X^q - X : polynomial K)).to_finset : set K),
{ simp only [map_pow, map_X, polynomial.map_sub], convert rfl },
{ simp only [polynomial.map_pow, map_X, polynomial.map_sub], convert rfl },
{ rw [roots_X_pow_card_sub_X, val_to_finset, coe_univ, algebra.adjoin_univ], }
end }

Expand Down
8 changes: 4 additions & 4 deletions src/field_theory/finite/galois_field.lean
Expand Up @@ -93,7 +93,7 @@ begin
apply subring.closure_induction hx; clear_dependent x; simp_rw mem_root_set aux,
{ rintros x (⟨r, rfl⟩ | hx),
{ simp only [aeval_X_pow, aeval_X, alg_hom.map_sub],
rw [← ring_hom.map_pow, zmod.pow_card_pow, sub_self], },
rw [← map_pow, zmod.pow_card_pow, sub_self], },
{ dsimp only [galois_field] at hx,
rwa mem_root_set aux at hx, }, },
{ dsimp only [g_poly],
Expand Down Expand Up @@ -144,7 +144,7 @@ by exactI (is_splitting_field.alg_equiv (zmod p) (X ^ (p ^ 1) - X : polynomial (
variables {K : Type*} [field K] [fintype K] [algebra (zmod p) K]

theorem splits_X_pow_card_sub_X : splits (algebra_map (zmod p) K) (X ^ fintype.card K - X) :=
by rw [←splits_id_iff_splits, polynomial.map_sub, map_pow, map_X, splits_iff_card_roots,
by rw [←splits_id_iff_splits, polynomial.map_sub, polynomial.map_pow, map_X, splits_iff_card_roots,
finite_field.roots_X_pow_card_sub_X, ←finset.card_def, finset.card_univ,
finite_field.X_pow_card_sub_X_nat_degree_eq]; exact fintype.one_lt_card

Expand All @@ -157,8 +157,8 @@ lemma is_splitting_field_of_card_eq (h : fintype.card K = p ^ n) :
{ rintro rfl, rw [pow_zero, fintype.card_eq_one_iff_nonempty_unique] at h,
cases h, resetI, exact false_of_nontrivial_of_subsingleton K },
refine algebra.eq_top_iff.mpr (λ x, algebra.subset_adjoin _),
rw [polynomial.map_sub, map_pow, map_X, finset.mem_coe, multiset.mem_to_finset, mem_roots,
is_root.def, eval_sub, eval_pow, eval_X, ← h, finite_field.pow_card, sub_self],
rw [polynomial.map_sub, polynomial.map_pow, map_X, finset.mem_coe, multiset.mem_to_finset,
mem_roots, is_root.def, eval_sub, eval_pow, eval_X, ← h, finite_field.pow_card, sub_self],
exact finite_field.X_pow_card_pow_sub_X_ne_zero K hne (fact.out _)
end }

Expand Down
6 changes: 3 additions & 3 deletions src/linear_algebra/tensor_product.lean
Expand Up @@ -643,7 +643,7 @@ lemma map_mul (f₁ f₂ : M →ₗ[R] M) (g₁ g₂ : N →ₗ[R] N) :
map (f₁ * f₂) (g₁ * g₂) = (map f₁ g₁) * (map f₂ g₂) :=
map_comp f₁ f₂ g₁ g₂

@[simp] lemma map_pow (f : M →ₗ[R] M) (g : N →ₗ[R] N) (n : ℕ) :
@[simp] protected lemma map_pow (f : M →ₗ[R] M) (g : N →ₗ[R] N) (n : ℕ) :
(map f g)^n = map (f^n) (g^n) :=
begin
induction n with n ih,
Expand Down Expand Up @@ -827,10 +827,10 @@ by simp only [ltensor, rtensor, ← map_comp, id_comp, comp_id]
variables {M}

@[simp] lemma rtensor_pow (f : M →ₗ[R] M) (n : ℕ) : (f.rtensor N)^n = (f^n).rtensor N :=
by { have h := map_pow f (id : N →ₗ[R] N) n, rwa id_pow at h, }
by { have h := tensor_product.map_pow f (id : N →ₗ[R] N) n, rwa id_pow at h, }

@[simp] lemma ltensor_pow (f : N →ₗ[R] N) (n : ℕ) : (f.ltensor M)^n = (f^n).ltensor M :=
by { have h := map_pow (id : M →ₗ[R] M) f n, rwa id_pow at h, }
by { have h := tensor_product.map_pow (id : M →ₗ[R] M) f n, rwa id_pow at h, }

end linear_map

Expand Down
4 changes: 2 additions & 2 deletions src/ring_theory/polynomial/cyclotomic/basic.lean
Expand Up @@ -386,11 +386,11 @@ begin
have integer : ∏ i in nat.divisors n, cyclotomic i ℤ = X ^ n - 1,
{ apply map_injective (int.cast_ring_hom ℂ) int.cast_injective,
rw map_prod (int.cast_ring_hom ℂ) (λ i, cyclotomic i ℤ),
simp only [int_cyclotomic_spec, map_pow, nat.cast_id, map_X, map_one, map_sub],
simp only [int_cyclotomic_spec, polynomial.map_pow, nat.cast_id, map_X, map_one, map_sub],
exact prod_cyclotomic'_eq_X_pow_sub_one hpos
(complex.is_primitive_root_exp n (ne_of_lt hpos).symm) },
have coerc : X ^ n - 1 = map (int.cast_ring_hom R) (X ^ n - 1),
{ simp only [map_pow, map_X, map_one, map_sub] },
{ simp only [polynomial.map_pow, polynomial.map_X, polynomial.map_one, polynomial.map_sub] },
have h : ∀ i ∈ n.divisors, cyclotomic i R = map (int.cast_ring_hom R) (cyclotomic i ℤ),
{ intros i hi,
exact (map_cyclotomic_int i R).symm },
Expand Down
5 changes: 3 additions & 2 deletions src/ring_theory/polynomial/dickson.lean
Expand Up @@ -192,7 +192,7 @@ begin
refine ⟨K, _, _, _⟩; apply_instance },
resetI,
apply map_injective (zmod.cast_hom (dvd_refl p) K) (ring_hom.injective _),
rw [map_dickson, map_pow, map_X],
rw [map_dickson, polynomial.map_pow, map_X],
apply eq_of_infinite_eval_eq,
-- The two polynomials agree on all `x` of the form `x = y + y⁻¹`.
apply @set.infinite.mono _ {x : K | ∃ y, x = y + y⁻¹ ∧ y ≠ 0},
Expand Down Expand Up @@ -248,7 +248,8 @@ lemma dickson_one_one_char_p (p : ℕ) [fact p.prime] [char_p R p] :
begin
have h : (1 : R) = zmod.cast_hom (dvd_refl p) R (1),
simp only [zmod.cast_hom_apply, zmod.cast_one'],
rw [h, ← map_dickson (zmod.cast_hom (dvd_refl p) R), dickson_one_one_zmod_p, map_pow, map_X]
rw [h, ← map_dickson (zmod.cast_hom (dvd_refl p) R), dickson_one_one_zmod_p,
polynomial.map_pow, map_X]
end

end dickson
Expand Down
2 changes: 1 addition & 1 deletion src/ring_theory/polynomial/vieta.lean
Expand Up @@ -65,7 +65,7 @@ begin
simp only [eval_X, polynomial.map_add, polynomial.map_C, polynomial.map_X, eq_self_iff_true],
funext,
simp only [function.funext_iff, esymm, polynomial.map_C, map_sum, polynomial.C.map_sum,
polynomial.map_C, map_pow, polynomial.map_X, polynomial.map_mul],
polynomial.map_C, polynomial.map_pow, polynomial.map_X, polynomial.map_mul],
congr,
funext,
simp only [eval_prod, eval_X, (polynomial.C : R →+* polynomial R).map_prod],
Expand Down
2 changes: 1 addition & 1 deletion src/ring_theory/power_series/well_known.lean
Expand Up @@ -49,7 +49,7 @@ by simp [mul_sub, sub_sub_cancel]

lemma map_inv_units_sub (f : R →+* S) (u : units R) :
map f (inv_units_sub u) = inv_units_sub (units.map (f : R →* S) u) :=
by { ext, simp [← monoid_hom.map_pow] }
by { ext, simp [← map_pow] }

end ring

Expand Down
20 changes: 10 additions & 10 deletions src/ring_theory/roots_of_unity.lean
Expand Up @@ -93,7 +93,7 @@ lemma map_roots_of_unity (f : units M →* units N) (k : ℕ+) :
(roots_of_unity k M).map f ≤ roots_of_unity k N :=
begin
rintros _ ⟨ζ, h, rfl⟩,
simp only [←monoid_hom.map_pow, *, mem_roots_of_unity, set_like.mem_coe, monoid_hom.map_one] at *
simp only [←map_pow, *, mem_roots_of_unity, set_like.mem_coe, monoid_hom.map_one] at *
end

variables [comm_ring R]
Expand Down Expand Up @@ -487,22 +487,22 @@ variables [comm_semiring R] [comm_semiring S] {f : R →+* S} {ζ : R}
open function

lemma map_of_injective (hf : injective f) (h : is_primitive_root ζ k) : is_primitive_root (f ζ) k :=
{ pow_eq_one := by rw [←f.map_pow, h.pow_eq_one, f.map_one],
{ pow_eq_one := by rw [←map_pow, h.pow_eq_one, _root_.map_one],
dvd_of_pow_eq_one := begin
rw h.eq_order_of,
intros l hl,
rw [←f.map_pow, ←f.map_one] at hl,
rw [←map_pow, ←f.map_one] at hl,
exact order_of_dvd_of_pow_eq_one (hf hl)
end }

lemma of_map_of_injective (hf : injective f) (h : is_primitive_root (f ζ) k) :
is_primitive_root ζ k :=
{ pow_eq_one := by { apply_fun f, rw [f.map_pow, f.map_one, h.pow_eq_one] },
{ pow_eq_one := by { apply_fun f, rw [map_pow, _root_.map_one, h.pow_eq_one] },
dvd_of_pow_eq_one := begin
rw h.eq_order_of,
intros l hl,
apply_fun f at hl,
rw [f.map_pow, f.map_one] at hl,
rw [map_pow, _root_.map_one] at hl,
exact order_of_dvd_of_pow_eq_one hl
end }

Expand Down Expand Up @@ -877,7 +877,7 @@ lemma separable_minpoly_mod {p : ℕ} [fact p.prime] (hdiv : ¬p ∣ n) :
begin
have hdvd : (map (int.cast_ring_hom (zmod p))
(minpoly ℤ μ)) ∣ X ^ n - 1,
{ simpa [map_pow, map_X, polynomial.map_one, polynomial.map_sub] using
{ simpa [polynomial.map_pow, map_X, polynomial.map_one, polynomial.map_sub] using
ring_hom.map_dvd (map_ring_hom (int.cast_ring_hom (zmod p)))
(minpoly_dvd_X_pow_sub_one h hpos) },
refine separable.of_dvd (separable_X_pow_sub_C 1 _ one_ne_zero) hdvd,
Expand All @@ -901,8 +901,8 @@ begin
rw [polynomial.monic, leading_coeff, nat_degree_expand, mul_comm, coeff_expand_mul'
(nat.prime.pos hprime), ← leading_coeff, ← polynomial.monic],
exact minpoly.monic (is_integral (pow_of_prime h hprime hdiv) hpos) },
{ rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, map_pow, map_X, eval_comp,
eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def],
{ rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, polynomial.map_pow, map_X,
eval_comp, eval_pow, eval_X, ← eval₂_eq_eval_map, ← aeval_def],
exact minpoly.aeval _ _ }
end

Expand Down Expand Up @@ -960,9 +960,9 @@ begin
exact minpoly_dvd_X_pow_sub_one (pow_of_prime h hprime.1 hdiv) hpos } },
replace prod := ring_hom.map_dvd ((map_ring_hom (int.cast_ring_hom (zmod p)))) prod,
rw [coe_map_ring_hom, polynomial.map_mul, polynomial.map_sub,
polynomial.map_one, map_pow, map_X] at prod,
polynomial.map_one, polynomial.map_pow, map_X] at prod,
obtain ⟨R, hR⟩ := minpoly_dvd_mod_p h hpos hdiv,
rw [hR, ← mul_assoc, ← polynomial.map_mul, ← sq, map_pow] at prod,
rw [hR, ← mul_assoc, ← polynomial.map_mul, ← sq, polynomial.map_pow] at prod,
have habs : map (int.cast_ring_hom (zmod p)) P ^ 2 ∣ map (int.cast_ring_hom (zmod p)) P ^ 2 * R,
{ use R },
replace habs := lt_of_lt_of_le (enat.coe_lt_coe.2 one_lt_two)
Expand Down

0 comments on commit 9078914

Please sign in to comment.