Definition of a group #
A type $G$ with $\cdot : G \times G \to G$, identity $1$, and inverse $(-)^{-1}$ satisfying associativity, left identity $1 \cdot a = a$, and left inverse $a^{-1} \cdot a = 1$. The right-handed duals follow as theorems.
- mul : G → G → G
- one : G
- inv : G → G
Associativity: $\forall a, b, c,\; (a \cdot b) \cdot c = a \cdot (b \cdot c)$.
Left identity: $\forall a,\; 1 \cdot a = a$.
Left inverse: $\forall a,\; a^{-1} \cdot a = 1$.
Instances
Examples of groups #
The trivial group: \texttt{Unit} with its single element.
Equations
- One or more equations did not get rendered due to their size.
$\mathbb{Z}/2\mathbb{Z}$: \texttt{Bool} under XOR, identity \texttt{false}, every element self-inverse.
Equations
- One or more equations did not get rendered due to their size.
Basic theorems from the axioms #
Natural-number powers #
$g^n$: product of $n$ copies of $g$ on the right of $1$.
Equations
- MyAlgebra.npow g 0 = 1
- MyAlgebra.npow g n.succ = MyAlgebra.npow g n * g
Instances For
Equations
Order of an element #
$\mathrm{IsOrderOf}\, 1\, 1$.
Permutations: the canonical non-abelian example #
$\sigma \cdot \tau := \sigma \circ \tau$ on $\mathrm{Perm}\ \alpha$.
Equations
- One or more equations did not get rendered due to their size.
$\sigma^{-1}$: swap $\sigma.\mathrm{toFun}$ and $\sigma.\mathrm{invFun}$.
Equations
- MyAlgebra.instInvPerm = { inv := fun (σ : MyAlgebra.Perm α) => { toFun := σ.invFun, invFun := σ.toFun, left_inv := ⋯, right_inv := ⋯ } }
$\mathrm{Perm}\,\alpha$ is a group under composition.
Equations
- MyAlgebra.instMyGroupPerm = { toMul := MyAlgebra.instMulPerm, toOne := MyAlgebra.instOnePerm, toInv := MyAlgebra.instInvPerm, mul_assoc := ⋯, one_mul := ⋯, mul_left_inv := ⋯ }
The swap on \texttt{Bool}: a concrete permutation exchanging \texttt{true} and \texttt{false}.
Equations
- MyAlgebra.swapBool = { toFun := not, invFun := not, left_inv := MyAlgebra.swapBool._proof_1, right_inv := MyAlgebra.swapBool._proof_1 }
Instances For
Sign of a permutation #
Sign is a group homomorphism on $\mathrm{Perm}(\mathrm{Bool})$: $\mathrm{sgn}(\sigma \cdot \tau) = \mathrm{sgn}(\sigma) \cdot \mathrm{sgn}(\tau)$ (the right-hand multiplication is XOR in \texttt{Bool_group}).
Dihedral groups #
A dihedral presentation of degree $n$ on $G$: distinguished generators $r, s$ with $r^n = 1$, $s^2 = 1$, and $s \cdot r = r^{-1} \cdot s$.
- r : G
Distinguished rotation $r \in G$.
- s : G
Distinguished reflection $s \in G$.
$r^n = 1$.
$s^2 = 1$.
$s \cdot r = r^{-1} \cdot s$.
Instances
$s = s^{-1}$: the reflection is an involution.
Abelian groups #
A group with $\forall a, b,\; a \cdot b = b \cdot a$.
Instances
\texttt{Bool} is abelian (the smallest non-trivial abelian group, $\mathbb{Z}/2\mathbb{Z}$).
Equations
- MyAlgebra.Bool_commGroup = { toMyGroup := MyAlgebra.Bool_group, mul_comm := MyAlgebra.Bool_commGroup._proof_1 }
$(a \cdot b)^{-1} = a^{-1} \cdot b^{-1}$ in an abelian group.
$g \cdot h \cdot g^{-1} = h$ in an abelian group (conjugation is trivial).
Subgroups #
A predicate $H : G \to \mathrm{Prop}$ with $1 \in H$, closed under $\cdot$ and $(-)^{-1}$.
Instances For
$\top := G$ (the whole group as a subgroup of itself).
Equations
Instances For
$\bot := \{1\}$ (the trivial subgroup).
Equations
- MyAlgebra.MySubgroup.bot = { carrier := fun (a : G) => a = 1, one_mem := ⋯, mul_mem := ⋯, inv_mem := ⋯ }
Instances For
$H \cap K$ is a subgroup.
Equations
Instances For
Subgroup criterion: a non-empty $P : G \to \mathrm{Prop}$ closed under $a, b \mapsto a \cdot b^{-1}$ is a subgroup. (One-shot test in place of checking $1 \in P$, closure under $\cdot$, closure under $(-)^{-1}$ separately.)
Subgroups generated by a subset #
Closure of $U$ under $1$, $\cdot$ and $(-)^{-1}$ — the underlying predicate of $\langle U \rangle$.
- of {G : Type u_1} [MyGroup G] {U : G → Prop} {x : G} : U x → Closure U x
- one {G : Type u_1} [MyGroup G] {U : G → Prop} : Closure U 1
- mul {G : Type u_1} [MyGroup G] {U : G → Prop} {a b : G} : Closure U a → Closure U b → Closure U (a * b)
- inv {G : Type u_1} [MyGroup G] {U : G → Prop} {a : G} : Closure U a → Closure U a⁻¹
Instances For
$\langle U \rangle$: the subgroup generated by $U \subseteq G$.
Equations
- MyAlgebra.MySubgroup.generatedBy U = { carrier := MyAlgebra.MySubgroup.Closure U, one_mem := ⋯, mul_mem := ⋯, inv_mem := ⋯ }
Instances For
$U \subseteq \langle U \rangle$.
$\langle U \rangle$ is the smallest subgroup containing $U$: $U \subseteq H \;\Longrightarrow\; \langle U \rangle \subseteq H$.
The intersection of an arbitrary family of subgroups is a subgroup.
Equations
- MyAlgebra.MySubgroup.iInf H = { carrier := fun (x : G) => ∀ (i : ι), (H i).carrier x, one_mem := ⋯, mul_mem := ⋯, inv_mem := ⋯ }
Instances For
Cyclic subgroups #
The closure of $\{g\}$ under $1$, $\cdot$, and $(-)^{-1}$ — the underlying predicate of $\langle g \rangle$.
- gen {G : Type u_1} [MyGroup G] {g : G} : Generated g g
- one {G : Type u_1} [MyGroup G] {g : G} : Generated g 1
- mul {G : Type u_1} [MyGroup G] {g a b : G} : Generated g a → Generated g b → Generated g (a * b)
- inv {G : Type u_1} [MyGroup G] {g a : G} : Generated g a → Generated g a⁻¹
Instances For
$\langle g \rangle$: the cyclic subgroup generated by $g$.
Equations
- MyAlgebra.MySubgroup.cyclic g = { carrier := MyAlgebra.MySubgroup.Generated g, one_mem := ⋯, mul_mem := ⋯, inv_mem := ⋯ }
Instances For
Proposition 1.3.3: $\langle g \rangle$ is the smallest subgroup containing $g$. Concretely: any subgroup $H$ containing $g$ also contains $\langle g \rangle$.
$\exists g \in G,\; \forall x \in G,\; x \in \langle g \rangle$ (i.e. $G = \langle g \rangle$ for some $g$).
Equations
- MyAlgebra.IsCyclic G = ∃ (g : G), ∀ (x : G), (MyAlgebra.MySubgroup.cyclic g).carrier x
Instances For
Proposition 1.3.14(a): every subgroup of a cyclic group is cyclic.
Stated for a subgroup $H \subseteq \langle g \rangle$ of an ambient cyclic-style subgroup: there exists $g' \in H$ such that $H = \langle g' \rangle$ — i.e. $H$ is itself cyclic, generated by some element of $H$.
Subgroups of the additive group of integers #
$a\mathbb{Z} := \{\, ka : k \in \mathbb{Z} \,\}$.
Equations
- MyAlgebra.aZ a n = ∃ (k : ℤ), n = k * a
Instances For
$a\mathbb{Z}$ is an additive subgroup of $(\mathbb{Z}, +)$.
Greatest common divisor and least common multiple #
$a\mathbb{Z} + b\mathbb{Z}$ is an additive subgroup of $(\mathbb{Z}, +)$.
$a\mathbb{Z} \cap b\mathbb{Z}$ is an additive subgroup of $(\mathbb{Z}, +)$.
$d$ is \emph{a $\gcd$} of $a, b$: $d \geq 0$ and $d\mathbb{Z} = a\mathbb{Z} + b\mathbb{Z}$.
Equations
- MyAlgebra.IsGcd a b d = (0 ≤ d ∧ ∀ (n : ℤ), MyAlgebra.aZ d n ↔ MyAlgebra.addSpanZ a b n)
Instances For
$m$ is \emph{an $\mathrm{lcm}$} of $a, b$: $m \geq 0$ and $m\mathbb{Z} = a\mathbb{Z} \cap b\mathbb{Z}$.
Equations
- MyAlgebra.IsLcm a b m = (0 ≤ m ∧ ∀ (n : ℤ), MyAlgebra.aZ m n ↔ MyAlgebra.aZ a n ∧ MyAlgebra.aZ b n)
Instances For
$a, b$ are \emph{coprime} if $\gcd(a, b) = 1$.
Equations
- MyAlgebra.IsCoprime a b = MyAlgebra.IsGcd a b 1
Instances For
Group homomorphisms #
The identity homomorphism $\mathrm{id}_G : G \to G$.
Equations
- MyAlgebra.MyHom.identity G = { toFun := fun (x : G) => x, mul_map := ⋯ }
Instances For
Image, kernel, and the kernel test #
Image of a subgroup $H \leq G$ under $\varphi$: $\varphi(H) := \{\, \varphi(h) : h \in H \,\} \leq G'$. Specializes to \cref{MyAlgebra.MyHom.image} at $H = \top$.
Equations
Instances For
Preimage of a subgroup $K \leq G'$ under $\varphi$: $\varphi^{-1}(K) := \{\, x \in G : \varphi(x) \in K \,\} \leq G$. Specializes to \cref{MyAlgebra.MyHom.kernel} at $K = \bot$.
Equations
Instances For
Isomorphisms #
A group isomorphism: a homomorphism bundled with a two-sided inverse function.
- toFun : G → G'
- invFun : G' → G
Two-sided inverse function $G' \to G$.
Left inverse: $\forall x,\; \mathrm{invFun}(\mathrm{toFun}\, x) = x$.
Right inverse: $\forall y,\; \mathrm{toFun}(\mathrm{invFun}\, y) = y$.
Instances For
The identity isomorphism $\mathrm{id}_G : G \xrightarrow{\sim} G$.
Equations
- MyAlgebra.MyIso.identity G = { toFun := fun (x : G) => x, mul_map := ⋯, invFun := fun (x : G) => x, left_inv := ⋯, right_inv := ⋯ }
Instances For
Normal subgroups #
$H \triangleleft G$: $\forall g \in G,\, h \in H,\; g \cdot h \cdot g^{-1} \in H$.
Instances For
In an abelian group, every subgroup is normal.
Preimage of a normal subgroup under a homomorphism is normal: $K \triangleleft G' \;\Longrightarrow\; \varphi^{-1}(K) \triangleleft G$.
The trivial subgroup is normal.
The whole group is normal in itself.
Intersection of two normal subgroups is normal.
The center #
$Z(G) := \{\, z : \forall x,\; z \cdot x = x \cdot z \,\}$, the center of $G$, as a subgroup.
Equations
Instances For
Centralizer, normalizer, and inner automorphisms #
$C_G(a) := \{\, g \in G : g \cdot a = a \cdot g \,\}$, the centralizer of $a$, as a subgroup of $G$.
Equations
Instances For
For each $g \in G$, conjugation by $g$, $\mathrm{conj}_g : G \to G,\; x \mapsto g \cdot x \cdot g^{-1}$, is a group homomorphism (an \emph{inner automorphism} of $G$).
Instances For
$N_G(H) := \{\, g : \forall h,\; h \in H \iff g h g^{-1} \in H \,\}$, the normalizer of $H$ in $G$, as a subgroup.
Equations
Instances For
Every subgroup is contained in its own normalizer: $H \subseteq N_G(H)$.
$H$ is normal in $G$ iff its normalizer is all of $G$: $H \triangleleft G \;\Longleftrightarrow\; \forall g \in G,\; g \in N_G(H)$.
A note on finite groups #
In a finite group every element has finite order: the powers
$g^0, g^1, g^2, \ldots$ cannot all be distinct, so $g^i = g^j$ for
some $i < j$, giving $g^{j-i} = 1$. Formalizing "finite" needs
Fintype, which lives in mathlib — the next chapter imports it
and proves Lagrange's theorem: the order of every element of a
finite group divides the order of the group.