Skip to content

Commit 1727d01

Browse files
committed
refactor(NumberTheory): golf Mathlib/NumberTheory/Cyclotomic/Gal (#38495)
- simplifies `autToPow_injective` in `Mathlib/NumberTheory/Cyclotomic/Gal` by reusing `IsPrimitiveRoot.autToPow_spec` instead of expanding the proof through roots of unity and `pow_eq_pow_iff_modEq` - keeps the proof structured as an `algHom_ext` argument on the power basis, but removes the intermediate bookkeeping lemmas and coercion manipulations Extracted from #38144 [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
1 parent 89616f5 commit 1727d01

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

Mathlib/NumberTheory/Cyclotomic/Gal.lean

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,11 @@ variable [CommRing L] [IsDomain L] (hμ : IsPrimitiveRoot μ n) [Algebra K L]
5656
field extension. -/
5757
theorem autToPow_injective : Function.Injective <| hμ.autToPow K := by
5858
intro f g hfg
59-
apply_fun Units.val at hfg
60-
simp only [IsPrimitiveRoot.coe_autToPow_apply] at hfg
61-
generalize_proofs hf' hg' at hfg
62-
have hf := hf'.choose_spec
63-
have hg := hg'.choose_spec
64-
generalize_proofs hζ at hf hg
65-
suffices f (hμ.toRootsOfUnity : Lˣ) = g (hμ.toRootsOfUnity : Lˣ) by
66-
apply AlgEquiv.coe_algHom_injective
59+
have : f.toAlgHom = g.toAlgHom := by
6760
apply (hμ.powerBasis K).algHom_ext
68-
exact this
69-
rw [ZMod.natCast_eq_natCast_iff] at hfg
70-
refine (hf.trans ?_).trans hg.symm
71-
rw [← rootsOfUnity.coe_pow _ hf'.choose, ← rootsOfUnity.coe_pow _ hg'.choose]
72-
congr 2
73-
rw [pow_eq_pow_iff_modEq]
74-
convert hfg
75-
conv => enter [2]; rw [hμ.eq_orderOf, ← hμ.val_toRootsOfUnity_coe]
76-
rw [orderOf_units, Subgroup.orderOf_coe]
61+
rw [AlgEquiv.toAlgHom_eq_coe, AlgEquiv.toAlgHom_eq_coe, AlgHom.coe_coe, AlgHom.coe_coe,
62+
powerBasis_gen, ← autToPow_spec K hμ g, ← autToPow_spec K hμ f, hfg]
63+
exact AlgEquiv.coe_algHom_injective this
7764

7865
end IsPrimitiveRoot
7966

0 commit comments

Comments
 (0)