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

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 : Nat) β†’ 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 (LiftGroup β„“ (β„€/ n)) G
  β„€/-out .hom (lift i) = Coeq-rec (apply x^- βŠ™ lift) (Ξ» (a , b , n∣a-b) β†’ zero-diff $
    let k , k*n≑a-b = βˆ£β„€β†’fibre n∣a-b in
    x^ a β€” x^ b          β‰‘Λ˜βŸ¨ pres-diff (x^- .preserves) {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                 ∎)
    i
  β„€/-out .preserves .pres-⋆ = elim! Ξ» x y β†’
    x^- .preserves .pres-⋆ (lift x) (lift y)

We can check that

β„€-ab/0≑℀-ab : β„€-ab/ 0 ≑ β„€-ab
β„€-ab/0≑℀-ab = ∫-Path
  (total-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

β„€/n≃ℕ<n : βˆ€ n β†’ .⦃ Positive n ⦄ β†’ ⌞ β„€/ n ⌟ ≃ β„•< n
β„€/n≃ℕ<n n .fst = Coeq-rec (Ξ» i β†’ i %β„€ n , x%β„€y<y i n)
  λ (x , y , p) → Σ-prop-path! (divides-diff→same-rem n x y p)
β„€/n≃ℕ<n n .snd = is-isoβ†’is-equiv $ iso
  (Ξ» (i , p) β†’ inc (pos i))
  (Ξ» i β†’ Ξ£-prop-path! (β„•<-%β„€ i))
  (elim! λ i → quot (same-rem→divides-diff n (pos (i %℀ n)) i
    (β„•<-%β„€ (_ , x%β„€y<y i n))))

Finite-β„€/n : βˆ€ n β†’ .⦃ Positive n ⦄ β†’ ⌞ β„€/ n ⌟ ≃ Fin n
Finite-β„€/n n = β„€/n≃ℕ<n n βˆ™e Fin≃ℕ< e⁻¹

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 Ξ» where
        fzero β†’ refl
        (fsuc fzero) β†’ refl)
      id-equiv))

  1. Some authors (namely, Bourbaki) call such groups monogeneous, and reserve β€œcyclic” for the finite cyclic groups.β†©οΈŽ