This file is indexed.

/usr/share/gap/pkg/Polycyclic/gap/pcpgrp/schur.gi is in gap-polycyclic 2.11-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#############################################################################
##
#A ReduceTail
##
ReduceTail := function( w, n, Q, d, f )
    local   i,  a,  v;

    i := 1;
    while i < Length(w) and w[i] <= n do i := i+2; od;

    a := w{[1..i-1]};

    v := Q[1] * 0;
    while i < Length(w) do
        v := v + Q[ w[i] - n ] * w[i+1];
        i := i+2;
    od;

    for i in [1..Length(v)] do
        if d[i] > 1 then v[i] := v[i] mod d[i]; fi;
    od;

    for i in [1..Length(f)] do
        Add( a, n+i ); Add( a, v[ f[i] ] );
    od;

    return a;
end;

#############################################################################
##
#A SchurExtensionEpimorphism(G) . . . . . . . epimorphism from F/R to F/[R,F]
##
InstallMethod( SchurExtensionEpimorphism, "for pcp groups", [IsPcpGroup], function(G)
    local g, r, n, y, coll, k, i, j, e, sys, ext, extgens, images, epi, ker;

    # handle the trivial group
    if IsTrivial(G) then
    	return IdentityMapping(G);
    fi;

    # set up
    g := Igs(G);
    n := Length(g);
    r := List(g, x -> RelativeOrderPcp(x));

    if n = 1 then
        ext := AbelianPcpGroup(1, [0]); # the infinite cyclic group
        return GroupHomomorphismByImagesNC( ext, G, GeneratorsOfGroup(ext), GeneratorsOfGroup(G) );;
    fi;

    # get collector for extension
    y := n*(n-1)/2 + Number(r, x -> x>0);
    coll := FromTheLeftCollector(n+y);

    # add a tail to each power and each positive conjugate relation
    k := n;
    for i in [1..n] do
        SetRelativeOrder(coll, i, r[i]);

        if r[i] > 0 then
            e := ObjByExponents(coll, ExponentsByIgs(g, g[i]^r[i]));
            k := k+1;
            Append(e, [k,1]);
            SetPower(coll,i,e);
        fi;

        for j in [1..i-1] do
            e := ObjByExponents(coll, ExponentsByIgs(g, g[i]^g[j]));
            k := k+1;
            Append(e, [k,1]);
            SetConjugate(coll,i,j,e);
        od;
    od;

    # update
    UpdatePolycyclicCollector(coll);

    # evaluate consistency
    sys := CRSystem(1, y, 0);
    EvalConsistency( coll, sys );

    # determine quotient
    ext := QuotientBySystem( coll, sys, n );

    # construct quotient epimorphism
    extgens := Igs( ext );
    images := ListWithIdenticalEntries( Length(extgens), One(G) );
    images{[1..n]} := g;

    epi := GroupHomomorphismByImagesNC( ext, G, extgens, images );
    SetIsSurjective( epi, true );
    ker := Subgroup( ext, extgens{[n+1..Length(extgens)]} );
    SetKernelOfMultiplicativeGeneralMapping( epi, ker );

    return epi;
end );

#############################################################################
##
#A SchurExtension(G) . . . . . . . . . . . . . . . . . . . . . . . .  F/[R,F]
##
InstallMethod( SchurExtension, "for groups", [IsGroup], function(G)
    return Source( SchurExtensionEpimorphism( G ) );
end );

#############################################################################
##
#A AbelianInvariantsMultiplier(G) . . . . . . . . . . . . . . . . . . .  M(G)
##
InstallMethod( AbelianInvariantsMultiplier, "for pcp groups", [IsPcpGroup], function(G)
    local epi, H, M, T, D, I;

    # a simple check
    if IsCyclic(G) then return []; fi;

    # otherwise compute
    epi := SchurExtensionEpimorphism(G);
    H := Source(epi);
    M := KernelOfMultiplicativeGeneralMapping(epi);

    # the finite case
    if IsFinite(G) then
        T := TorsionSubgroup(M);
        return AbelianInvariants(T);
    fi;

    # the general case
    D := DerivedSubgroup(H);
    I := Intersection(M, D);
    return AbelianInvariants(I);
end );

#############################################################################
##
#A EpimorphismSchurCover(G) . . . . . . . . . . . . . . .  M(G) extended by G
##
InstallMethod( EpimorphismSchurCover, "for pcp groups", [IsPcpGroup], function(G)
    local epi, H, M, I, C, cover, g, n, extgens, images, ker;

    if IsCyclic(G) then return IdentityMapping( G ); fi;

    # get full extension F/[R,F]
    epi := SchurExtensionEpimorphism(G);
    H := Source(epi);

    # get R/[R,F]
    M := KernelOfMultiplicativeGeneralMapping(epi);

    # get R cap F'
    I := Intersection(M, DerivedSubgroup(H));

    # get complement to I in M
    C := Subgroup(H, GeneratorsOfPcp( Pcp(M,I,"snf")));

    if not IsFreeAbelian(C) then Error("wrong complement"); fi;

	# get Schur cover (R cap F') / [R,F]
    cover := H/C;

    # construct quotient epimorphism
    g := Igs(G);
    n := Length(g);
    extgens := Igs( cover );
    images := ListWithIdenticalEntries( Length(extgens), One(G) );
    images{[1..n]} := g;

    epi := GroupHomomorphismByImagesNC( cover, G, extgens, images );
    SetIsSurjective( epi, true );
    ker := Subgroup( cover, extgens{[n+1..Length(extgens)]} );
    SetKernelOfMultiplicativeGeneralMapping( epi, ker );

    return epi;
end );

#############################################################################
##
#A NonAbelianExteriorSquareEpimorphism(G) . . . . . . . . .  G wegde G --> G'
##
# FIXME: This function is documented and should be turned into a attribute
NonAbelianExteriorSquareEpimorphism := function( G )
    local   lift,  D,  gens,  imgs,  epi,  lambda;

    if Size(G) = 1 then return IdentityMapping( G ); fi;

    lift := SchurExtensionEpimorphism(G);
    D    := DerivedSubgroup( Source(lift) );

    gens := GeneratorsOfGroup( D );
    imgs := List( gens, g->Image( lift, g ) );
    epi  := GroupHomomorphismByImagesNC( D, DerivedSubgroup(G), gens, imgs );
    SetIsSurjective( epi, true );

    lambda := function( g, h )
        return Comm( PreImagesRepresentative( lift, g ),
                     PreImagesRepresentative( lift, h ) );
    end;

    D!.epimorphism := epi;
    # TODO: Make the crossedPairing accessible via an attribute!
    D!.crossedPairing := lambda;

    return epi;
end;

#############################################################################
##
#A NonAbelianExteriorSquare(G) . . . . . . . . . . . . . . . . . .(G wegde G)
##
InstallMethod( NonAbelianExteriorSquare, "for pcp groups", [IsPcpGroup], function(G)
    return Source( NonAbelianExteriorSquareEpimorphism( G ) );
end );

#############################################################################
##
#A NonAbelianExteriorSquarePlus(G) . . . . . . . . . . (G wegde G) by (G x G)
##
## This is the group tau(G) in our paper.
##
## The following function computes the embedding of the non-abelian exterior
## square of G into tau(G).
##
# FIXME: This function is documented and should be turned into an attribute
NonAbelianExteriorSquarePlusEmbedding := function(G)
    local   g,  n,  r,  w,  extlift,  F,  f,  D,  d,  m,  s,  c,  i,
            e,  j,  gens,  imgs,  k,  alpha,  S,  embed;

    if Size(G) = 1 then return G; fi;

    # set up
    g := Igs(G);
    n := Length(g);
    r := List(g, x -> RelativeOrderPcp(x));
    w := List([1..2*n], x -> 0);

    extlift := NonAbelianExteriorSquareEpimorphism( G );

    # F/[R,F] = G*
    F := Parent( Source( extlift ) );
    f := Pcp(F);

    # the non-abelian exterior square D = G^G
    D := Source( extlift );
    d := Pcp(D);
    m := Length(d);
    s := RelativeOrdersOfPcp(d);

#    Print( "#  NonAbelianExteriorSquarePlus: Setting up collector with ", 2*n+m,
#           " generators\n" );

    # set up collector for non-abelian exterior square plus
    c := FromTheLeftCollector(2*n+m);

    # the relators of GxG
    for i in [1..n] do

        # relative order and power
        if r[i] > 0 then
            SetRelativeOrder(c, i, r[i]);
            e := ExponentsByIgs(g, g[i]^r[i]);
            SetPower(c, i, ObjByExponents(c,e));

            SetRelativeOrder(c, n+i, r[i]);
            e := Concatenation(0*e, e);
            SetPower(c, n+i, ObjByExponents(c,e));
        fi;

        # conjugates
        for j in [1..i-1] do
            e := ExponentsByIgs(g, g[i]^g[j]);
            SetConjugate(c, i, j, ObjByExponents(c,e));

            e := Concatenation(0*e, e);
            SetConjugate(c, n+i, n+j, ObjByExponents(c,e));

            if r[j] = 0 then
                e := ExponentsByIgs(g, g[i]^(g[j]^-1));
                SetConjugate(c, i, -j, ObjByExponents(c,e));
                e := Concatenation(0*e, e);
                SetConjugate(c, n+i, -(n+j), ObjByExponents(c,e));
            fi;

        od;
    od;

    # the relators of G^G
    for i in [1..m] do

        # relative order and power
        if s[i] > 0 then
            SetRelativeOrder(c, 2*n+i, s[i]);
            e := ExponentsByPcp(d, d[i]^s[i]);
            e := Concatenation(w, e);
            SetPower(c, 2*n+i, ObjByExponents(c,e));
        fi;

        # conjugates
        for j in [1..i-1] do
            e := ExponentsByPcp(d, d[i]^d[j]);
            e := Concatenation(w, e);
            SetConjugate(c, 2*n+i, 2*n+j, ObjByExponents(c,e));

            if s[j] = 0 then
                e := ExponentsByPcp(d, d[i]^(d[j]^-1));
                e := Concatenation(w, e);
                SetConjugate(c, 2*n+i, -(2*n+j), ObjByExponents(c,e));
            fi;
        od;
    od;

    # the extension of G^G by GxG
    #
    # This is the computation of \lambda in our paper: For (g_i,g_j) we take
    # preimages (f_i,f_j) in G* and calculate the image of (g_i,g_j) under
    # \lambda as the commutator [f_i,f_j].
    for i in [1..n] do
        for j in [1..n] do
            e := ExponentsByPcp(d, Comm(f[j], f[i]));
            e := Concatenation(w, e); e[n+j] := 1;
            SetConjugate(c, n+j, i, ObjByExponents(c,e));

            if r[i] = 0 then
                e := ExponentsByPcp(d, Comm(f[j], f[i]^-1));
                e := Concatenation(w, e); e[n+j] := 1;
                SetConjugate(c, n+j, -i, ObjByExponents(c,e));
            fi;
        od;
    od;

    # the action on G^G by GxG
    for i in [1..n] do

        # create action homomorphism
        # G^G is generated by commutators of G*
        # G acts on G^G via conjugation with preimages in G*.
        gens := []; imgs := [];
        for k in [1..n] do
            for j in [1..n] do
                Add(gens, Comm(f[k], f[j]));
                Add(imgs, Comm(f[k]^f[i], f[j]^f[i]));
            od;
        od;
        alpha := GroupHomomorphismByImagesNC(D,D,gens,imgs);

        # compute conjugates
        for j in [1..m] do
            e := ExponentsByPcp(d, Image(alpha, d[j]));
            e := Concatenation(w, e);
            SetConjugate(c, 2*n+j, i, ObjByExponents(c,e));
            SetConjugate(c, 2*n+j, n+i, ObjByExponents(c,e));
        od;

        if r[i] = 0 then
            # create action homomorphism
            gens := []; imgs := [];
            for k in [1..n] do
                for j in [1..n] do
                    Add(gens, Comm(f[k], f[j]));
                    Add(imgs, Comm(f[k]^(f[i]^-1), f[j]^(f[i]^-1)));
                od;
            od;
            alpha := GroupHomomorphismByImagesNC(D,D,gens,imgs);

            # compute conjugates
            for j in [1..m] do
                e := ExponentsByPcp(d, Image(alpha, d[j]));
                e := Concatenation(w, e);
                SetConjugate(c, 2*n+j, -i, ObjByExponents(c,e));
                SetConjugate(c, 2*n+j, -(n+i), ObjByExponents(c,e));
            od;

        fi;

    od;

    if CHECK_SCHUR_PCP@ then
        S := PcpGroupByCollector(c);
    else
        UpdatePolycyclicCollector(c);
        S := PcpGroupByCollectorNC(c);
    fi;
    S!.group := G;

    gens := GeneratorsOfGroup(S){[2*n+1..2*n+m]};
    embed := GroupHomomorphismByImagesNC( D, S, GeneratorsOfPcp(d), gens );

    return embed;
end;

NonAbelianExteriorSquarePlus := function( G )
    return Range( NonAbelianExteriorSquarePlusEmbedding( G ) );
end;

#############################################################################
##
#A Epicentre
##
InstallMethod(Epicentre, "for pcp groups", [IsPcpGroup],
function (G)
	local epi;
	epi := SchurExtensionEpimorphism(G);
	return Image(epi,Centre(Source(epi)));
end);