module Algebra.Group.Instances.Cyclic where

Cyclic groups🔗

We say that a group is cyclic if it is generated by a single element that is, every element of the group can be written as some integer power of 1.

_is-generated-by_ : ∀ {ℓ} (G : Group ℓ) (g : ⌞ G ⌟) → Type ℓ
G is-generated-by g = ∀ x → ∃[ n ∈ Int ] x ≡ pow G g n

is-cyclic : ∀ {ℓ} (G : Group ℓ) → Type ℓ
is-cyclic G = ∃[ g ∈ G ] G is-generated-by g
Note

Generators are not unique, so we must use to get a proposition. In fact, if generates then so does hence a non-trivial cyclic group has at least two generators!

module _ {ℓ} (G : Group ℓ) (open Group-on (G .snd)) where
  inverse-generates
    : ∀ g → G is-generated-by g → G is-generated-by g ⁻¹
  inverse-generates g gen x = gen x <&> λ (n , p) → negℤ n , (
    x                     ≡⟨ p ⟩≡
    pow G g n             ≡˘⟨ inv-inv ⟩≡˘
    pow G g n ⁻¹ ⁻¹       ≡˘⟨ ap _⁻¹ (pres-inv (pow-hom G g .snd) {lift n}) ⟩≡˘
    pow G g (negℤ n) ⁻¹   ≡˘⟨ pow-inverse G g (negℤ n) ⟩≡˘
    pow G (g ⁻¹) (negℤ n) ∎)

The obvious example is the infinite cyclic group of the (additive) integers generated by but there is also a finite cyclic group of order for every As it turns out, we can construct all the cyclic groups using the same machine: the quotient group where is the normal subgroup of multiples of is the cyclic group of order when and is the infinite cyclic group when

infix 30 _·ℤ
_·ℤ : ∀ n → normal-subgroup ℤ λ i → el (n ∣ℤ i) (∣ℤ-is-prop n i)
(n ·ℤ) .has-rep .has-unit = ∣ℤ-zero
(n ·ℤ) .has-rep .has-⋆ = ∣ℤ-+
(n ·ℤ) .has-rep .has-inv = ∣ℤ-negℤ
(n ·ℤ) .has-conjugate {x} {y} = subst (n ∣ℤ_) x≡y+x-y where
  x≡y+x-y : x ≡ y +ℤ (x -ℤ y)
  x≡y+x-y =
    x                  ≡⟨ ℤ.insertl {y} (ℤ.inverser {x = y}) ⟩≡
    y +ℤ (negℤ y +ℤ x) ≡⟨ ap (y +ℤ_) (+ℤ-commutative (negℤ y) x) ⟩≡
    y +ℤ (x -ℤ y)      ∎

infix 25 ℤ/_
ℤ/_ : Nat → Group lzero
ℤ/ n = ℤ /ᴳ n ·ℤ

is an abelian group, since the commutativity of addition descends to the quotient.

ℤ/n-commutative : ∀ n → is-commutative-group (ℤ/ n)
ℤ/n-commutative n = elim! λ x y → ap inc (+ℤ-commutative x y)

infix 25 ℤ-ab/_
ℤ-ab/_ : Nat → Abelian-group lzero
ℤ-ab/_ n = from-commutative-group (ℤ/ n) (ℤ/n-commutative n)

Furthermore, is, by construction, cyclic, and is generated by

  ℤ/n-cyclic : is-cyclic (ℤ/ n)
  ℤ/n-cyclic = inc (1 , gen) where
    gen : ℤ/ n is-generated-by 1
    gen = elim! λ x → inc (x , Integers.induction Int-integers
      {P = λ x → inc x ≡ pow (ℤ/ n) 1 x}
      refl
      (λ x →
        inc x        ≡ pow (ℤ/ n) 1 x        ≃⟨ _ , equiv→cancellable (⋆-equivr 1) ⟩≃
        inc x ⋆ 1    ≡ pow (ℤ/ n) 1 x ⋆ 1    ≃⟨ ∙-pre-equiv (sym (ap inc (+ℤ-oner x))) ⟩≃
        inc (sucℤ x) ≡ pow (ℤ/ n) 1 x ⋆ 1    ≃⟨ ∙-post-equiv (sym (pow-sucr (ℤ/ n) 1 x)) ⟩≃
        inc (sucℤ x) ≡ pow (ℤ/ n) 1 (sucℤ x) ≃∎)
      x)

We prove the following mapping-out property for a group homomorphism is uniquely determined by an element of order i.e. such that Note that this condition is trivially satisfied if so we don’t need a special case.

This follows from the fact that a group homomorphism out of the group of integers is uniquely determined by an element of and some basic algebra.

module _
  (n : Nat)
  {ℓ} {G : Group ℓ} (open Group-on (G .snd))
  (x : ⌞ G ⌟) (open pow G x renaming (pow to infixr 30 x^_; pow-hom to x^-))
  (wraps : x^ pos n ≡ unit)
  where

  ℤ/-out : Groups.Hom (Lift-group ℓ (ℤ/ n)) G
  ℤ/-out .fst (lift i) = Coeq-rec (apply x^- ⊙ lift) coh i where abstract
    coh : ((a , b , _) : Σ[ a ∈ Int ] Σ[ b ∈ Int ] n ∣ℤ (a -ℤ b)) → x^ a ≡ x^ b
    coh (a , b , n∣a-b) using k , k*n≡a-b ← ∣ℤ→fibre n∣a-b = zero-diff $
      x^ a — x^ b          ≡˘⟨ pres-diff (x^- .snd) {lift a} {lift b} ⟩≡˘
      x^ (a -ℤ b)          ≡˘⟨ ap x^_ k*n≡a-b ⟩≡˘
      x^ (k *ℤ pos n)      ≡⟨ ap x^_ (*ℤ-commutative k (pos n)) ⟩≡
      x^ (pos n *ℤ k)      ≡⟨ pow-* G x (pos n) k ⟩≡
      pow G ⌜ x^ pos n ⌝ k ≡⟨ ap! wraps ⟩≡
      pow G unit k         ≡⟨ pow-unit G k ⟩≡
      unit                 ∎
  ℤ/-out .snd .pres-⋆ = elim! λ x y → x^- .snd .pres-⋆ (lift x) (lift y)

We can check that

ℤ-ab/0≡ℤ-ab : ℤ-ab/ 0 ≡ ℤ-ab
ℤ-ab/0≡ℤ-ab = ∫-Path
  (∫hom
    (Coeq-rec (λ z → z) (λ (_ , _ , p) → ℤ.zero-diff p))
    (record { pres-⋆ = elim! λ _ _ → refl }))
  (is-iso→is-equiv (iso inc (λ _ → refl) (elim! λ _ → refl)))

ℤ/0≡ℤ : ℤ/ 0 ≡ ℤ
ℤ/0≡ℤ = Grp→Ab→Grp (ℤ/ 0) (ℤ/n-commutative 0) ∙ ap Abelian→Group ℤ-ab/0≡ℤ-ab

For positive we show that is finite; more precisely, we construct an equivalence which sends to the representative of its congruence class modulo

Finite-ℤ/n : ∀ n → ⦃ Positive n ⦄ → ⌞ ℤ/ n ⌟ ≃ Fin n
Finite-ℤ/n n .fst = Coeq-rec (λ i → from-ℕ< (i %ℤ n , x%ℤy<y i n))
  λ (x , y , p) → fin-ap (divides-diff→same-rem n x y p)
Finite-ℤ/n n .snd = is-iso→is-equiv $ iso
  (λ (fin i) → inc (pos i))
  (λ i → fin-ap (Fin-%ℤ i))
  (elim! λ i → quot (same-rem→divides-diff n (pos (i %ℤ n)) i
    (Fin-%ℤ (fin _ ⦃ x%ℤy<y i n ⦄))))

Using this and the fact that we can check that is isomorphic to the symmetric group We start by defining a homomorphism that sends 1 to the equivalence that swaps the two elements, which corresponds to

ℤ/2→S₂ : Groups.Hom (ℤ/ 2) (S 2)
ℤ/2→S₂ = ℤ/-out 2 (Equiv.from (Fin-permutations 2) 1)
  (Equiv.injective (Fin-permutations 2) refl)
  Groups.∘ G→LiftG (ℤ/ 2)

In order to conclude the proof, we show that the function thus defined is an equivalence, by showing that it factors as in the following diagram and using the two-out-of-three property of equivalences:

ℤ/2≡S₂ : ℤ/ 2 ≡ S 2
ℤ/2≡S₂ = ∫-Path ℤ/2→S₂ $
  equiv-cancell (Fin-permutations 2 .snd)
    (equiv-cancelr ((Finite-ℤ/n 2 e⁻¹) .snd)
      (subst is-equiv (ext (indexₚ (refl , refl , tt)))
      id-equiv))

  1. Some authors (namely, Bourbaki) call such groups monogeneous, and reserve “cyclic” for the finite cyclic groups.↩︎