This file is indexed.

/usr/share/gap/lib/ghom.gd is in gap-libs 4r7p5-2.

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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
#############################################################################
##
#W  ghom.gd                     GAP library                     Thomas Breuer
#W                                                           Alexander Hulpke
#W                                                             Heiko Theißen
##
##
#Y  Copyright (C)  1997,  Lehrstuhl D für Mathematik,  RWTH Aachen, Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  1. Functions for creating group general mappings by images
##  2. Functions for creating natural homomorphisms
##  3. Functions for conjugation action
##  4. Functions for ...
##


#############################################################################
##
##  1. Functions for creating group general mappings by images
##


#############################################################################
##
#O  GroupGeneralMappingByImages( <G>, <H>, <gens>, <imgs> )
##
##  <#GAPDoc Label="GroupGeneralMappingByImages">
##  <ManSection>
##  <Oper Name="GroupGeneralMappingByImages" Arg='G, H, gens, imgs'/>
##  <Oper Name="GroupGeneralMappingByImages" Arg='G, gens, imgs' Label="from group to itself"/>
##  <Oper Name="GroupGeneralMappingByImagesNC" Arg='G, H, gens, imgs'/>
##  <Oper Name="GroupGeneralMappingByImagesNC" Arg='G, gens, imgs' Label="from group to itself"/>
##
##  <Description>
##  returns a general mapping defined by extending the mapping from
##  <A>gens</A> to <A>imgs</A> homomorphically. If the range <A>H</A> is not
##  given the mapping will be made automatically surjective. The NC version
##  does not test whether <A>gens</A> are contained in <A>G</A> or <A>imgs</A>
##  are contained in <A>H</A>.
##  (<Ref Func="GroupHomomorphismByImages"/> creates
##  a group general mapping by images and
##  tests whether it is in <Ref Func="IsMapping"/>.)
##  <Example><![CDATA[
##  gap> map:=GroupGeneralMappingByImages(g,h,gens,[(1,2,3),(1,2)]);
##  [ (1,2,3,4), (1,2) ] -> [ (1,2,3), (1,2) ]
##  gap> IsMapping(map);
##  false
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##

# for future use:
#DeclareOperation( "GroupGeneralMappingByImages",
#    [ IsGroup, IsGroup, IsList, IsList ] );
#DeclareOperation( "GroupGeneralMappingByImages",
#    [ IsGroup, IsList, IsList ] );

DeclareOperation( "GroupGeneralMappingByImagesNC",
    [ IsGroup, IsGroup, IsList, IsList ] );
DeclareOperation( "GroupGeneralMappingByImagesNC",
    [ IsGroup, IsList, IsList ] );
DeclareSynonym("GroupGeneralMappingByImages",GroupGeneralMappingByImagesNC);


#############################################################################
##
#F  GroupHomomorphismByImages( <G>[, <H>][[, <gens>], <imgs>] )
##
##  <#GAPDoc Label="GroupHomomorphismByImages">
##  <ManSection>
##  <Func Name="GroupHomomorphismByImages" Arg='G, H[[, gens], imgs]'/>
##
##  <Description>
##  <Ref Func="GroupHomomorphismByImages"/> returns the group homomorphism
##  with source <A>G</A> and range <A>H</A> that is defined by mapping the
##  list <A>gens</A> of generators of <A>G</A> to the list <A>imgs</A> of
##  images in <A>H</A>.
##  <P/>
##  If omitted, the arguments <A>gens</A> and <A>imgs</A> default to
##  the <Ref Func="GeneratorsOfGroup"/> value of <A>G</A> and <A>H</A>,
##  respectively. If <A>H</A> is not given the maopping is automatically
##  considered as surjective.
##  <P/>
##  If <A>gens</A> does not generate <A>G</A> or if the mapping of the
##  generators does not extend to a homomorphism
##  (i.e., if mapping the generators describes only a multi-valued mapping)
##  then <K>fail</K> is returned.
##  <P/>
##  This test can be quite expensive. If one is certain that the mapping of
##  the generators extends to a homomorphism,
##  one can avoid the checks by calling
##  <Ref Func="GroupHomomorphismByImagesNC"/>.
##  (There also is the possibility to
##  construct potentially multi-valued mappings with
##  <Ref Func="GroupGeneralMappingByImages"/> and to test with
##  <Ref Func="IsMapping"/> whether they are indeed homomorphisms.)
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "GroupHomomorphismByImages" );


#############################################################################
##
#O  GroupHomomorphismByImagesNC( <G>, <H>[[, <gens>], <imgs>] )
##
##  <#GAPDoc Label="GroupHomomorphismByImagesNC">
##  <ManSection>
##  <Oper Name="GroupHomomorphismByImagesNC" Arg='G, H[[, gens], imgs]'/>
##
##  <Description>
##  <Ref Func="GroupHomomorphismByImagesNC"/> creates a homomorphism as
##  <Ref Func="GroupHomomorphismByImages"/> does, however it does not test
##  whether <A>gens</A> generates <A>G</A> and that the mapping of
##  <A>gens</A> to <A>imgs</A> indeed defines a group homomorphism.
##  Because these tests can be expensive it can be substantially faster than
##  <Ref Func="GroupHomomorphismByImages"/>.
##  Results are unpredictable if the conditions do not hold.
##  <P/>
##  If omitted, the arguments <A>gens</A> and <A>imgs</A> default to
##  the <Ref Func="GeneratorsOfGroup"/> value of <A>G</A> and <A>H</A>,
##  respectively.
##  <P/>
##  (For creating a possibly multi-valued mapping from <A>G</A> to <A>H</A>
##  that respects multiplication and inverses,
##  <Ref Func="GroupGeneralMappingByImages"/> can be used.)
##  <!-- If we could guarantee that it does not matter whether we construct the-->
##  <!-- homomorphism directly or whether we construct first a general mapping-->
##  <!-- and ask it for  being a homomorphism,-->
##  <!-- then this operation would be obsolete,-->
##  <!-- and <C>GroupHomomorphismByImages</C> would be allowed to return the general-->
##  <!-- mapping itself after the checks.-->
##  <!-- (See also the declarations of <C>AlgebraHomomorphismByImagesNC</C>,-->
##  <!-- <C>AlgebraWithOneHomomorphismByImagesNC</C>,-->
##  <!-- <C>LeftModuleHomomorphismByImagesNC</C>.)-->
##  <P/>
##  <Example><![CDATA[
##  gap> gens:=[(1,2,3,4),(1,2)];
##  [ (1,2,3,4), (1,2) ]
##  gap> g:=Group(gens);
##  Group([ (1,2,3,4), (1,2) ])
##  gap> h:=Group((1,2,3),(1,2));
##  Group([ (1,2,3), (1,2) ])
##  gap> hom:=GroupHomomorphismByImages(g,h,gens,[(1,2),(1,3)]);
##  [ (1,2,3,4), (1,2) ] -> [ (1,2), (1,3) ]
##  gap> Image(hom,(1,4));
##  (2,3)
##  gap> map:=GroupHomomorphismByImages(g,h,gens,[(1,2,3),(1,2)]);
##  fail
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "GroupHomomorphismByImagesNC",
    [ IsGroup, IsGroup, IsList, IsList ] );
DeclareOperation( "GroupHomomorphismByImagesNC",
    [ IsGroup, IsList, IsList ] );


#############################################################################
##
#R  IsGroupGeneralMappingByImages(<map>)
##
##  <#GAPDoc Label="IsGroupGeneralMappingByImages">
##  <ManSection>
##  <Filt Name="IsGroupGeneralMappingByImages" Arg='map'
##   Type='Representation'/>
##
##  <Description>
##  Representation for mappings from one group to another that are defined
##  by extending a mapping of group generators homomorphically.
##  Instead of record components,
##  the attribute <Ref Attr="MappingGeneratorsImages"/> is
##  used to store generators and their images.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareRepresentation( "IsGroupGeneralMappingByImages",
      IsGroupGeneralMapping and IsSPGeneralMapping and IsAttributeStoringRep,
      [] );


#############################################################################
##
#R  IsPreimagesByAsGroupGeneralMappingByImages(<map>)
##
##  <#GAPDoc Label="IsPreimagesByAsGroupGeneralMappingByImages">
##  <ManSection>
##  <Filt Name="IsPreimagesByAsGroupGeneralMappingByImages" Arg='map'
##   Type='Representation'/>
##
##  <Description>
##  Representation for mappings that delegate work for preimages to a
##  mapping created with <Ref Func="GroupHomomorphismByImages"/>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareRepresentation( "IsPreimagesByAsGroupGeneralMappingByImages",
      IsGroupGeneralMapping and IsSPGeneralMapping and IsAttributeStoringRep,
      [  ] );


#############################################################################
##
#R  IsGroupGeneralMappingByAsGroupGeneralMappingByImages(<map>)
##
##  <#GAPDoc Label="IsGroupGeneralMappingByAsGroupGeneralMappingByImages">
##  <ManSection>
##  <Filt Name="IsGroupGeneralMappingByAsGroupGeneralMappingByImages"
##   Arg='map' Type='Representation'/>
##
##  <Description>
##  Representation for mappings that delegate work on a
##  <Ref Func="GroupHomomorphismByImages"/>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareRepresentation( "IsGroupGeneralMappingByAsGroupGeneralMappingByImages",
      IsPreimagesByAsGroupGeneralMappingByImages, [  ] );


#############################################################################
##
#A  AsGroupGeneralMappingByImages(<map>)
##
##  <#GAPDoc Label="AsGroupGeneralMappingByImages">
##  <ManSection>
##  <Attr Name="AsGroupGeneralMappingByImages" Arg='map'/>
##
##  <Description>
##  If <A>map</A> is a mapping from one group to another this attribute
##  returns a group general mapping that which implements the same abstract
##  mapping. (Some operations can be performed more effective in this
##  representation, see
##  also&nbsp;<Ref Func="IsGroupGeneralMappingByAsGroupGeneralMappingByImages"/>.)
##  <Example><![CDATA[
##  gap> AsGroupGeneralMappingByImages(hom);
##  [ (1,2,3,4), (1,2) ] -> [ (1,2), (1,2) ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "AsGroupGeneralMappingByImages", IsGroupGeneralMapping );


#############################################################################
##
#A  MappingOfWhichItIsAsGGMBI(<map>)
##
##  <ManSection>
##  <Attr Name="MappingOfWhichItIsAsGGMBI" Arg='map'/>
##
##  <Description>
##  If <A>map</A> is <C>AsGroupGeneralMappingByImages(<A>map2</A>)</C> then
##  <A>map2</A> is <C>MappingOfWhichItIsAsGGMBI(<A>map</A>)</C>. This attribute is used to
##  transfer attribute values which were set later.
##  </Description>
##  </ManSection>
##
DeclareAttribute( "MappingOfWhichItIsAsGGMBI", IsGroupGeneralMapping );

InstallAttributeMethodByGroupGeneralMappingByImages :=
  function( attr, value_filter )
    InstallMethod( attr, "via `AsGroupGeneralMappingByImages'", true,
            [ IsGroupGeneralMappingByAsGroupGeneralMappingByImages ], 0,
            hom -> attr( AsGroupGeneralMappingByImages( hom ) ) );
    InstallMethod( attr, "get delayed set attribute values", true,
            [ HasMappingOfWhichItIsAsGGMBI ],
	    SUM_FLAGS-1, # we want to do this before doing any calculations
	    function(hom)
              hom:=MappingOfWhichItIsAsGGMBI( hom );
	      if Tester(attr)(hom) then
	        return attr(hom);
	      else
	        TryNextMethod();
	      fi;
	    end);
end;


#############################################################################
##
##  2. Functions for creating natural homomorphisms
##


#############################################################################
##
#F  NaturalHomomorphismByNormalSubgroup( <G>, <N> )
#F  NaturalHomomorphismByNormalSubgroupNC( <G>, <N> )
##
##  <#GAPDoc Label="NaturalHomomorphismByNormalSubgroup">
##  <ManSection>
##  <Func Name="NaturalHomomorphismByNormalSubgroup" Arg='G, N'/>
##  <Func Name="NaturalHomomorphismByNormalSubgroupNC" Arg='G, N'/>
##
##  <Description>
##  returns a homomorphism from <A>G</A> to another group whose kernel is <A>N</A>.
##  &GAP; will try to select the image group as to make computations in it
##  as efficient as possible. As the factor group <M><A>G</A>/<A>N</A></M> can be identified
##  with the image of <A>G</A> this permits efficient computations in the factor
##  group.
##  The homomorphism returned is not necessarily surjective, so
##  <Ref Func="ImagesSource"/> should be used instead of 
##  <Ref Func="Range" Label="of a general mapping"/>
##  to get a group isomorphic to the factor group.
##  The <C>NC</C> variant does not check whether <A>N</A> is normal in
##  <A>G</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
InParentFOA( "NaturalHomomorphismByNormalSubgroupNC", IsGroup, IsGroup,
             DeclareAttribute );

DeclareSynonym( "NaturalHomomorphismByNormalSubgroupInParent",
    NaturalHomomorphismByNormalSubgroupNCInParent );
DeclareSynonym( "NaturalHomomorphismByNormalSubgroupOp",
    NaturalHomomorphismByNormalSubgroupNCOp );
#T Get rid of this hack when the ``in parent'' approach is cleaned!

BindGlobal( "NaturalHomomorphismByNormalSubgroupNCOrig",
    NaturalHomomorphismByNormalSubgroupNC );
#T Get rid of this hack when the ``in parent'' approach is cleaned!

MakeReadWriteGlobal( "NaturalHomomorphismByNormalSubgroupNC" );
UnbindGlobal( "NaturalHomomorphismByNormalSubgroupNC" );
BindGlobal( "NaturalHomomorphismByNormalSubgroupNC",
    function( G, N )
    local hom;
    hom:= NaturalHomomorphismByNormalSubgroupNCOrig( G, N );
    SetIsMapping( hom, true );
    return hom;
    end );
#T Get rid of this hack when the ``in parent'' approach is cleaned!

DeclareGlobalFunction( "NaturalHomomorphismByNormalSubgroup" );


#############################################################################
##
##  3. Functions for conjugation action
##


#############################################################################
##
#O  ConjugatorIsomorphism( <G>, <g> )
##
##  <#GAPDoc Label="ConjugatorIsomorphism">
##  <ManSection>
##  <Oper Name="ConjugatorIsomorphism" Arg='G, g'/>
##
##  <Description>
##  Let <A>G</A> be a group, and <A>g</A> an element in the same family as
##  the elements of <A>G</A>.
##  <Ref Func="ConjugatorIsomorphism"/> returns the isomorphism from <A>G</A>
##  to <C><A>G</A>^<A>g</A></C> defined by <M>h \mapsto h^{<A>g</A>}</M>
##  for all <M>h \in <A>G</A></M>.
##  <P/>
##  If <A>g</A> normalizes <A>G</A> then <Ref Func="ConjugatorIsomorphism"/>
##  does the same as <Ref Func="ConjugatorAutomorphismNC"/>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "ConjugatorIsomorphism",
    [ IsGroup, IsMultiplicativeElementWithInverse ] );


#############################################################################
##
#F  ConjugatorAutomorphism( <G>, <g> )
#O  ConjugatorAutomorphismNC( <G>, <g> )
##
##  <#GAPDoc Label="ConjugatorAutomorphism">
##  <ManSection>
##  <Func Name="ConjugatorAutomorphism" Arg='G, g'/>
##  <Oper Name="ConjugatorAutomorphismNC" Arg='G, g'/>
##
##  <Description>
##  Let <A>G</A> be a group, and <A>g</A> an element in the same family as
##  the elements of <A>G</A> such that <A>g</A> normalizes <A>G</A>.
##  <Ref Func="ConjugatorAutomorphism"/> returns the automorphism of <A>G</A>
##  defined by <M>h \mapsto h^{<A>g</A>}</M> for all <M>h \in <A>G</A></M>.
##  <P/>
##  If conjugation by <A>g</A> does <E>not</E> leave <A>G</A> invariant,
##  <Ref Func="ConjugatorAutomorphism"/> returns <K>fail</K>;
##  in this case,
##  the isomorphism from <A>G</A> to <C><A>G</A>^<A>g</A></C> induced by
##  conjugation with <A>g</A> can be constructed with
##  <Ref Func="ConjugatorIsomorphism"/>.
##  <P/>
##  <Ref Oper="ConjugatorAutomorphismNC"/> does the same as
##  <Ref Func="ConjugatorAutomorphism"/>,
##  except that the check is omitted whether <A>g</A> normalizes <A>G</A>
##  and it is assumed that <A>g</A> is chosen to be in <A>G</A> if possible.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "ConjugatorAutomorphism" );

DeclareOperation( "ConjugatorAutomorphismNC",
    [ IsGroup, IsMultiplicativeElementWithInverse ] );


#############################################################################
##
#F  InnerAutomorphism( <G>, <g> )
#O  InnerAutomorphismNC( <G>, <g> )
##
##  <#GAPDoc Label="InnerAutomorphism">
##  <ManSection>
##  <Func Name="InnerAutomorphism" Arg='G, g'/>
##  <Oper Name="InnerAutomorphismNC" Arg='G, g'/>
##
##  <Description>
##  Let <A>G</A> be a group, and <M><A>g</A> \in <A>G</A></M>.
##  <Ref Func="InnerAutomorphism"/> returns the automorphism of <A>G</A>
##  defined by <M>h \mapsto h^{<A>g</A>}</M> for all <M>h \in <A>G</A></M>.
##  <P/>
##  If <A>g</A> is <E>not</E> an element of <A>G</A>,
##  <Ref Func="InnerAutomorphism"/> returns <K>fail</K>;
##  in this case,
##  the isomorphism from <A>G</A> to <C><A>G</A>^<A>g</A></C> induced by
##  conjugation with <A>g</A> can be constructed
##  with <Ref Func="ConjugatorIsomorphism"/>
##  or with <Ref Func="ConjugatorAutomorphism"/>.
##  <P/>
##  <Ref Oper="InnerAutomorphismNC"/> does the same as
##  <Ref Func="InnerAutomorphism"/>,
##  except that the check is omitted whether <M><A>g</A> \in <A>G</A></M>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction( "InnerAutomorphism" );

DeclareOperation( "InnerAutomorphismNC",
    [ IsGroup, IsMultiplicativeElementWithInverse ] );


#############################################################################
##
#P  IsConjugatorIsomorphism( <hom> )
#P  IsConjugatorAutomorphism( <hom> )
#P  IsInnerAutomorphism( <hom> )
##
##  <#GAPDoc Label="IsConjugatorIsomorphism">
##  <ManSection>
##  <Prop Name="IsConjugatorIsomorphism" Arg='hom'/>
##  <Prop Name="IsConjugatorAutomorphism" Arg='hom'/>
##  <Prop Name="IsInnerAutomorphism" Arg='hom'/>
##
##  <Description>
##  Let <A>hom</A> be a group general mapping
##  (see&nbsp;<Ref Func="IsGroupGeneralMapping"/>) with source <M>G</M>, say.
##  <Ref Prop="IsConjugatorIsomorphism"/> returns <K>true</K> if <A>hom</A>
##  is induced by conjugation of <M>G</M> by an element <M>g</M> that lies in
##  <M>G</M> or in a group into which <M>G</M> is naturally embedded
##  in the sense described below, and <K>false</K> otherwise.
##  <P/>
##  Natural embeddings are dealt with in the case that <M>G</M> is
##  a permutation group (see Chapter&nbsp;<Ref Chap="Permutation Groups"/>),
##  a matrix group (see Chapter&nbsp;<Ref Chap="Matrix Groups"/>),
##  a finitely presented group
##  (see Chapter&nbsp;<Ref Chap="Finitely Presented Groups"/>), or
##  a group given w.r.t.&nbsp;a polycyclic presentation
##  (see Chapter&nbsp;<Ref Chap="Pc Groups"/>).
##  In all other cases, <Ref Prop="IsConjugatorIsomorphism"/> may return
##  <K>false</K> if <A>hom</A> is induced by conjugation
##  but is not an inner automorphism.
##  <P/>
##  If <Ref Prop="IsConjugatorIsomorphism"/> returns <K>true</K> for
##  <A>hom</A> then an element <M>g</M> that induces <A>hom</A> can be
##  accessed as value of the attribute
##  <Ref Func="ConjugatorOfConjugatorIsomorphism"/>.
##  <P/>
##  <Ref Prop="IsConjugatorAutomorphism"/> returns <K>true</K> if <A>hom</A>
##  is an automorphism (see&nbsp;<Ref Func="IsEndoGeneralMapping"/>)
##  that is regarded as a conjugator isomorphism
##  by <Ref Prop="IsConjugatorIsomorphism"/>, and <K>false</K> otherwise.
##  <P/>
##  <Ref Prop="IsInnerAutomorphism"/> returns <K>true</K> if <A>hom</A> is a
##  conjugator automorphism such that an element <M>g</M> inducing <A>hom</A>
##  can be chosen in <M>G</M>, and <K>false</K> otherwise.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareProperty( "IsConjugatorIsomorphism", IsGroupGeneralMapping );

DeclareSynonymAttr( "IsConjugatorAutomorphism",
    IsEndoGeneralMapping and IsConjugatorIsomorphism );

DeclareProperty( "IsInnerAutomorphism", IsGroupGeneralMapping );

InstallTrueMethod( IsBijective, IsConjugatorIsomorphism );
InstallTrueMethod( IsGroupHomomorphism, IsConjugatorIsomorphism );
InstallTrueMethod( IsConjugatorAutomorphism, IsInnerAutomorphism );


#############################################################################
##
#A  ConjugatorOfConjugatorIsomorphism( <hom> )
##
##  <#GAPDoc Label="ConjugatorOfConjugatorIsomorphism">
##  <ManSection>
##  <Attr Name="ConjugatorOfConjugatorIsomorphism" Arg='hom'/>
##
##  <Description>
##  For a conjugator isomorphism <A>hom</A>
##  (see&nbsp;<Ref Func="ConjugatorIsomorphism"/>),
##  <Ref Func="ConjugatorOfConjugatorIsomorphism"/> returns an element
##  <M>g</M> such that mapping under <A>hom</A> is induced by conjugation
##  with <M>g</M>.
##  <P/>
##  To avoid problems with <Ref Func="IsInnerAutomorphism"/>,
##  it is guaranteed that the conjugator is taken from the source of
##  <A>hom</A> if possible.
##  <P/>
##  <Example><![CDATA[
##  gap> hgens:=[(1,2,3),(1,2,4)];;h:=Group(hgens);;
##  gap> hom:=GroupHomomorphismByImages(h,h,hgens,[(1,2,3),(2,3,4)]);;
##  gap> IsInnerAutomorphism(hom);
##  true
##  gap> ConjugatorOfConjugatorIsomorphism(hom);
##  (1,2,3)
##  gap> hom:=GroupHomomorphismByImages(h,h,hgens,[(1,3,2),(1,4,2)]);
##  [ (1,2,3), (1,2,4) ] -> [ (1,3,2), (1,4,2) ]
##  gap> IsInnerAutomorphism(hom);
##  false
##  gap> IsConjugatorAutomorphism(hom);
##  true
##  gap> ConjugatorOfConjugatorIsomorphism(hom);
##  (1,2)
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "ConjugatorOfConjugatorIsomorphism",
    IsConjugatorIsomorphism );

##  just for compatibility with &GAP; 4.1 ...
DeclareSynonymAttr( "ConjugatorInnerAutomorphism",
    ConjugatorOfConjugatorIsomorphism );


#############################################################################
##
##  4. Functions for ...
##

DeclareGlobalFunction( "MakeMapping" );


#############################################################################
##
#F  GroupHomomorphismByFunction( <S>, <R>, <fun>[, <invfun>] )
#F  GroupHomomorphismByFunction( <S>, <R>, <fun>, `false', <prefun> )
##
##  <#GAPDoc Label="GroupHomomorphismByFunction">
##  <ManSection>
##  <Heading>GroupHomomorphismByFunction</Heading>
##  <Func Name="GroupHomomorphismByFunction" Arg='S, R, fun[, invfun]'
##   Label="by function (and inverse function) between two domains"/>
##  <Func Name="GroupHomomorphismByFunction" Arg='S, R, fun, false, prefun'
##   Label="by function and function that computes one preimage"/>
##
##  <Description>
##  <Ref Func="GroupHomomorphismByFunction" Label="by function (and inverse function) between two domains"/>
##  returns a group homomorphism
##  <C>hom</C> with source <A>S</A> and range <A>R</A>,
##  such that each element <C>s</C> of <A>S</A> is mapped to the element
##  <A>fun</A><C>( s )</C>, where <A>fun</A> is a &GAP; function.
##  <P/>
##  If the argument <A>invfun</A> is bound then <A>hom</A> is a bijection
##  between <A>S</A> and <A>R</A>,
##  and the preimage of each element <C>r</C> of <A>R</A> is given by
##  <A>invfun</A><C>( r )</C>,
##  where <A>invfun</A> is a &GAP; function.
##  <P/>
##  If five arguments are given and the fourth argument is <K>false</K> then
##  the &GAP; function <A>prefun</A> can be used to compute a single preimage
##  also if <C>hom</C> is not bijective.
##  <P/>
##  No test is performed on whether the functions actually give an
##  homomorphism between both groups because this would require testing the
##  full multiplication table.
##  <P/>
##  <Ref Func="GroupHomomorphismByFunction" Label="by function (and inverse function) between two domains"/>
##  creates a mapping which lies in <Ref Func="IsSPGeneralMapping"/>.
##  <P/>
##  <Example><![CDATA[
##  gap> hom:=GroupHomomorphismByFunction(g,h,
##  > function(x) if SignPerm(x)=-1 then return (1,2); else return ();fi;end);
##  MappingByFunction( Group([ (1,2,3,4), (1,2) ]), Group(
##  [ (1,2,3), (1,2) ]), function( x ) ... end )
##  gap> ImagesSource(hom);
##  Group([ (1,2), (1,2) ])
##  gap> Image(hom,(1,2,3,4));
##  (1,2)
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction("GroupHomomorphismByFunction");


#############################################################################
##
#F  ImagesRepresentativeGMBIByElementsList( <hom>, <elm> )
##
##  <ManSection>
##  <Func Name="ImagesRepresentativeGMBIByElementsList" Arg='hom, elm'/>
##
##  <Description>
##  This is the method for <C>ImagesRepresentative</C> which calls <C>MakeMapping</C>
##  and uses element lists to evaluate the image. It is used by
##  <C>Factorization</C>.
##  </Description>
##  </ManSection>
##
DeclareGlobalFunction("ImagesRepresentativeGMBIByElementsList");

#############################################################################
##
#A  ImagesSmallestGenerators(<map>)
##
##  <#GAPDoc Label="ImagesSmallestGenerators">
##  <ManSection>
##  <Attr Name="ImagesSmallestGenerators" Arg='map'/>
##
##  <Description>
##  returns the list of images of <C>GeneratorsSmallest(Source(<A>map</A>))</C>.
##  This list can be used to compare group homomorphisms.  (The standard
##  comparison is to compare the image lists on the set of elements of the
##  source. If however x and y have the same images under a and b,
##  certainly all their products have. Therefore it is sufficient to test
##  this on the images of the smallest generators.)
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "ImagesSmallestGenerators",
    IsGroupGeneralMapping );


#############################################################################
##
#A  RegularActionHomomorphism( <G> )
##
##  <#GAPDoc Label="RegularActionHomomorphism">
##  <ManSection>
##  <Attr Name="RegularActionHomomorphism" Arg='G'/>
##
##  <Description>
##  returns an isomorphism from <A>G</A> onto the regular permutation
##  representation of <A>G</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute( "RegularActionHomomorphism", IsGroup );


#############################################################################
##
#E