Lesson 7 of 15
Cosets & Lagrange's Theorem
Cosets & Lagrange's Theorem
Cosets
Let be a subgroup of . For any element , the left coset of with respect to is:
In , where the operation is addition: .
Example
In , let . The cosets are:
Notice that every element of belongs to exactly one coset, and all cosets have the same size.
Lagrange's Theorem
If is a subgroup of a finite group , then divides . Moreover:
where is the index of in (the number of distinct cosets).
Consequences
- The order of any element divides
- A group of prime order is cyclic (its only subgroups are and itself)
- for all (gives Fermat's little theorem as a special case)
Your Task
Implement left_cosets(subgroup, n) that returns the list of all distinct left cosets of the given subgroup in (each coset as a sorted list), sorted by smallest element. Also implement verify_lagrange(n) that checks Lagrange's theorem for all subgroups of .
Pyodide loading...
Loading...
Click "Run" to execute your code.