-
Notifications
You must be signed in to change notification settings - Fork 113
/
conjugation.jl
271 lines (241 loc) · 7.64 KB
/
conjugation.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
@testset "Conjugacy classes in symmetric groups" begin
n = 5
G = symmetric_group(n)
cc = conjugacy_class(G, G[1])
@test acting_group(cc) === G
@test representative(cc) == G[1]
cc1 = conjugacy_class(G, G[1]^G[2])
@test length(cc) == length(cc1)
@test length(cc) == length(cc1)
@test cc == cc1
ccid = conjugacy_class(G,one(G))
@test acting_group(ccid) === G
@test representative(ccid) == one(G)
@test length(ccid)==1
@test collect(ccid) == [one(G)]
x = perm(G,vcat(2:n,[1]))
cc = conjugacy_class(G,x)
@test acting_group(cc) === G
@test representative(cc) == x
@test length(cc) == factorial(n-1)
@test x == representative(cc)
y = rand(cc)
@test order(y) == order(x)
@test is_conjugate(G,x,x^y)
@test is_conjugate_with_data(G,x,x^y)[1]
z = is_conjugate_with_data(G,x,x^y)[2]
@test x^z == x^y
z = cperm(G,[1,2])
@test !is_conjugate(G,x,z)
@test !is_conjugate_with_data(G,x,z)[1]
@inferred ZZRingElem number_of_conjugacy_classes(symmetric_group(4))
@inferred ZZRingElem number_of_conjugacy_classes(symmetric_group(40))
# something in smaller dimension
@test number_of_conjugacy_classes(symmetric_group(4)) == 5
G = symmetric_group(4)
x = perm(G,[3,4,1,2])
cc = conjugacy_class(G,x)
@test length(cc) == 3
@test Set(collect(cc)) == Set(x^y for y in G)
y = rand(cc)
@test y in collect(cc)
@test order(y) == 2
C = conjugacy_classes(G)
@test length(C) == 5
@test all(cc -> acting_group(cc) === G, C)
@test cc in C
@test sum(length, C) == order(G)
@test count(c -> x in c, C) == 1 # x belongs to a unique conjugacy class
@test count(c -> y in c, C) == 1 # y belongs to a unique conjugacy class
z = rand(G)
@test count(c -> z in c, C) == 1 # z belongs to a unique conjugacy class
@testset for i in 1:5
c = C[i]
x = rand(c)
y = rand(c)
@test is_conjugate(G,x,y)
@test is_conjugate_with_data(G,x,y)[1]
z = is_conjugate_with_data(G,x,y)[2]
@test x^z == y
y = rand(C[(i%5)+1])
@test !is_conjugate(G,x,y)
@test !is_conjugate_with_data(G,x,y)[1]
end
CC5 = @inferred subgroup_classes(G, order = 5)
@test length(CC5) == 0
CC = @inferred subgroup_classes(G)
@test length(CC)==11
@test all(cc -> acting_group(cc) === G, CC)
@testset for C in CC
@test C == conjugacy_class(G, representative(C))
@test length(C) == index(G, normalizer(G, representative(C))[1])
@test degree(representative(C)) == degree(G)
end
H = rand(rand(CC))
@test sum([length(c) for c in CC]) == length(collect(Iterators.flatten(CC)))
@test count(c -> H in c, CC) == 1 # H belongs to a unique conjugacy class
@testset for i in 1:length(CC)
c = CC[i]
x = rand(c)
y = rand(c)
@test is_conjugate(G,x,y)
@test is_conjugate_with_data(G,x,y)[1]
z = is_conjugate_with_data(G,x,y)[2]
@test x^z == y
@test is_conjugate_subgroup(G, x, y)
@test is_conjugate_subgroup_with_data(G, x, y)[1]
z = is_conjugate_subgroup_with_data(G,x,y)[2]
@test y^z == x
y = rand(CC[(i % length(CC))+1])
@test !is_conjugate(G,x,y)
@test !is_conjugate_with_data(G,x,y)[1]
end
CC = @inferred maximal_subgroup_classes(G)
@test length(CC)==3
@test Set([order(Int, representative(l)) for l in CC])==Set([6,8,12])
x = G(cperm([1,2,3,4]))
H = sub(G,[x])[1]
@test normalizer(G,H)==normalizer(G,x)
G = symmetric_group(5)
CC = @inferred maximal_subgroup_classes(G)
@test all(H -> degree(H) == degree(G), map(representative, CC))
@test all(H -> is_maximal_subgroup(H, G), map(representative, CC))
@test !is_maximal_subgroup(trivial_subgroup(G)[1], G)
G = symmetric_group(10)
x = rand(G)
H = sub(G,[x])[1]
z = rand(G)
K = H^z
@test Set([G(y) for y in K]) == Set([G(y^z) for y in H])
# @test Set(K) == Set([y^z for y in H]) may not work because the parent of the elements are different
end
@testset "Conjugacy classes as G-sets" begin
G = symmetric_group(4)
x = G(cperm([3, 4]))
y = G(cperm([1, 4, 2]))
C = conjugacy_class(G, x)
@test x in C
@test orbits(C) == [C]
@test C == orbit(G, x)
mp = action_homomorphism(C)
@test permutation(C, y) == mp(y)
@test length(C) == 6
@test order(image(mp)[1]) == 24
end
function TestConjCentr(G,x)
Cx = centralizer(G,x)[1]
cc = conjugacy_class(G,x)
@test index(G,Cx)==length(cc)
T=right_transversal(G,Cx)
@testset for y in cc
@test count(t -> y==x^t, T) == 1
end
cs = conjugacy_class(G,Cx)
Nx = normalizer(G,Cx)[1]
@test index(G,Nx)==length(cs)
T=right_transversal(G,Nx)
# Set([Cx^t for t in T]) == Set(collect(cs)) does not work
@testset for H in collect(cs)
@test sum([H==Cx^t for t in T])==1
end
end
@testset "Conjugation and centralizers" begin
G = symmetric_group(6)
x = cperm(G,[1,2,3,4])
TestConjCentr(G,x)
G = GL(3,3)
x = G[2]
TestConjCentr(G,x)
G = GL(3, GF(3, 1))
x = G[2]
TestConjCentr(G,x)
G = special_unitary_group(2,3)
x = G[1]
TestConjCentr(G,x)
end
@testset "Conjugation in matrix group (different from GL and SL)" begin
G = sylow_subgroup(general_linear_group(2, 3), 2)[1]
M = G(matrix(G.ring, 2, 2, [0, 1, 2, 0]))
@test order(M) == 4
@test is_conjugate(G, M, inv(M))
@test ! is_conjugate(G, M, M^2)
flag, N = is_conjugate_with_data(G, M, inv(M))
@test flag
@test M^N == inv(M)
flag, _ = is_conjugate_with_data(G, M, M^2)
@test ! flag
end
@testset "Conjugation and centralizers for GL and SL" begin
G = GL(8,25)
S = SL(8,25)
l = gen(base_ring(G))
R,t = polynomial_ring(base_ring(G),"t")
x = generalized_jordan_block(t-1,8)
y = generalized_jordan_block(t-1,8)
x[7,8]=l
x=S(x); y=S(y);
vero, z = is_conjugate_with_data(G, x, y)
@test vero
@test z in G
@test x^z==y
vero, z = is_conjugate_with_data(S, x, y)
@test !vero
x.elm[7,8]=l^8
vero, z = is_conjugate_with_data(S, x, y)
@test z in S
@test x^z==y
G = GL(8,5)
S = SL(8,5)
R,t = polynomial_ring(base_ring(G),"t")
x = cat(generalized_jordan_block(t-1,4), generalized_jordan_block(t-1,2), identity_matrix(base_ring(G),2), dims=(1,2))
C = centralizer(G,G(x))[1]
@test order(C) == order(GL(2,5))*4^2*5^16
@testset for y in gens(C)
@test x*y==y*x
end
Cs = centralizer(S,S(x))[1]
@test order(Cs) == div(order(GL(2,5))*4^2*5^16,4)
@testset for y in gens(Cs)
@test x*y==y*x
end
x = cat( [generalized_jordan_block(t-1,2) for i in 1:4]..., dims=(1,2) )
C = centralizer(G,G(x))[1]
@test order(C) == order(GL(4,5))*5^16
@testset for y in gens(C)
@test x*y==y*x
end
Cs = centralizer(S,S(x))[1]
@test order(Cs) == div(order(GL(4,5))*5^16,2)
x = cat( [generalized_jordan_block(t-1,4) for i in 1:2]..., dims=(1,2) )
C = centralizer(G,G(x))[1]
@test order(C) == order(GL(2,5))*5^12
Cs = centralizer(S,S(x))[1]
@test order(Cs) == order(GL(2,5))*5^12
x = companion_matrix(t^8+t^3+t^2+t+2)
C = centralizer(G,G(x))[1]
@test order(C)==5^8-1
@testset for y in gens(C)
@test x*y==y*x
end
x = cat(companion_matrix((t^2+3)^2), companion_matrix(t^3+3*t+2), companion_matrix(t-3), dims=(1,2))
C = centralizer(G,G(x))[1]
@test order(C)==24*124*4*25
@testset for y in gens(C)
@test x*y==y*x
end
C = centralizer(S,S(x))[1]
@test order(C)==24*124*25
@testset for y in gens(C)
@test x*y==y*x
end
F,t = polynomial_ring(GF(3),"t")
F,z = finite_field(t^2+1,"z")
_,t = polynomial_ring(F,"t")
G = GL(8,F)
x = cat(generalized_jordan_block(t^2+t+z,2), generalized_jordan_block(t^2+z+1,2); dims=(1,2))
C = centralizer(G,G(x))[1]
@test order(C)==81^2*80^2
@testset for y in gens(C)
@test x*y==y*x
end
end