Skip to content

Commit 7455834

Browse files
committed
feat(GroupTheory/SpecificGroups/Cyclic): unique_zpow_zmod (#11016)
Suggested in #6342 .
1 parent 4a17492 commit 7455834

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Mathlib/GroupTheory/SpecificGroups/Cyclic.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,27 @@ theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
351351
#align is_cyclic.image_range_card IsCyclic.image_range_card
352352
#align is_add_cyclic.image_range_card IsAddCyclic.image_range_card
353353

354+
@[to_additive]
355+
theorem IsCyclic.unique_zpow_zmod (ha : ∀ x : α, x ∈ zpowers a) (x : α) :
356+
∃! n : ZMod (Fintype.card α), x = a ^ n.val := by
357+
obtain ⟨n, rfl⟩ := ha x
358+
refine ⟨n, (?_ : a ^ n = _), fun y (hy : a ^ n = _) ↦ ?_⟩
359+
· rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
360+
Int.modEq_comm, Int.modEq_iff_add_fac, ← ZMod.int_coe_zmod_eq_iff]
361+
· rw [← zpow_coe_nat, zpow_eq_zpow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers ha,
362+
← ZMod.int_cast_eq_int_cast_iff] at hy
363+
simp [hy]
364+
365+
@[to_additive]
366+
lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b : ZMod d}
367+
(hGcard : Fintype.card G = d) (h : ∀ t : G, t ^ a.val = t ^ b.val) : a = b := by
368+
obtain ⟨g, hg⟩ := IsCyclic.exists_generator (α := G)
369+
specialize h g
370+
subst hGcard
371+
rw [pow_eq_pow_iff_modEq, orderOf_eq_card_of_forall_mem_zpowers hg,
372+
← ZMod.nat_cast_eq_nat_cast_iff] at h
373+
simpa [ZMod.nat_cast_val, ZMod.cast_id'] using h
374+
354375
end
355376

356377
section Totient

0 commit comments

Comments
 (0)