Created
January 15, 2022 16:05
-
-
Save felixdae/afbe6e0e7a1b8e5e33306bde8c8aca85 to your computer and use it in GitHub Desktop.
to show the insolvability of the quintic by computing nested commutators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
def reverse(forward: tuple) -> tuple: | |
lst = [-1 for _ in forward] | |
for idx in range(len(forward)): | |
lst[forward[idx]] = idx | |
return tuple(lst) | |
def compose(perm1: tuple, perm2: tuple) -> tuple: | |
assert len(perm2) == len(perm1) | |
lst = [-1 for _ in perm1] | |
for idx in range(len(perm1)): | |
lst[idx] = perm2[perm1[idx]] | |
return tuple(lst) | |
def commutator(perms: set) -> set: | |
res = [] | |
for perm1 in perms: | |
for perm2 in perms: | |
res.append( | |
compose( | |
compose( | |
compose( | |
perm1, | |
perm2 | |
), | |
reverse(perm1)), | |
reverse(perm2) | |
) | |
) | |
return set(res) | |
# https://www.youtube.com/watch?v=RhpVSV6iCko | |
if __name__ == '__main__': | |
n = 3 | |
perms_set = set(itertools.permutations(range(n))) | |
depth = 4 | |
for i in range(depth): | |
print(i, len(perms_set), perms_set) | |
perms_set = commutator(perms_set) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment