Skip to content

Commit 4dd3d88

Browse files
committed
docs: Document DirectProductElement
1 parent fa36d5d commit 4dd3d88

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

doc/ref/mapping.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ section&nbsp;<Ref Sect="Technical Matters Concerning General Mappings"/>.
4040
<Heading>Direct Products and their Elements</Heading>
4141

4242
<#Include Label="IsDirectProductElement">
43+
<#Include Label="DirectProductElement">
4344
<#Include Label="DirectProductFamily">
4445

4546
</Section>

lib/tuples.gd

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,66 @@ BindGlobal( "EmptyDirectProductElementsFamily",
147147
#O DirectProductElementNC( <fam>, <objlist> ) . . . . omits check on object
148148
#O families and objlist length
149149
##
150+
## <#GAPDoc Label="DirectProductElement">
150151
## <ManSection>
151152
## <Oper Name="DirectProductElement" Arg='[fam, ]objlist'/>
152153
## <Oper Name="DirectProductElementNC" Arg='fam, objlist'/>
153154
##
154155
## <Description>
156+
## <Ref Oper="DirectProductElement"/> returns a direct product element
157+
## whose components are the entries of the list <A>objlist</A>.
158+
## If the optional argument <A>fam</A> is given, it must be the family of
159+
## direct product elements with the appropriate component families;
160+
## otherwise the family is determined from <A>objlist</A>.
161+
## <P/>
162+
## <Ref Oper="DirectProductElementNC"/> does the same but omits the checks
163+
## that <A>fam</A> is consistent with <A>objlist</A>.
164+
## <P/>
165+
## Direct product elements behave like lists: they can be indexed with
166+
## <C><A>elm</A>[i]</C> to access the <M>i</M>-th component, and
167+
## <Ref Attr="Length"/> returns the number of components.
168+
## Arithmetic operations (multiplication, powering, one, inverse,
169+
## addition, zero, additive inverse) are performed componentwise.
170+
## <Example><![CDATA[
171+
## gap> a := (1,2,3);; b := (1,2);;
172+
## gap> elm := DirectProductElement([a, b]);
173+
## DirectProductElement( [ (1,2,3), (1,2) ] )
174+
## gap> elm[1];
175+
## (1,2,3)
176+
## gap> elm[2];
177+
## (1,2)
178+
## gap> Length(elm);
179+
## 2
180+
## gap> elm2 := DirectProductElement([b, a]);;
181+
## gap> elm * elm2;
182+
## DirectProductElement( [ (2,3), (1,3) ] )
183+
## gap> One(elm);
184+
## DirectProductElement( [ (), () ] )
185+
## gap> Inverse(elm);
186+
## DirectProductElement( [ (1,3,2), (1,2) ] )
187+
## ]]></Example>
188+
## <P/>
189+
## The following example shows <Ref Oper="DirectProductElement"/> in the
190+
## context of a direct product <M>K = G \times H</M> built with
191+
## <Ref Func="DirectProduct"/>, where <M>G</M> is a permutation group and
192+
## <M>H</M> is a pc group. The projections of <M>K</M> are
193+
## used to move between the direct product and its component groups.
194+
## <Example><![CDATA[
195+
## gap> G := DihedralGroup(IsPermGroup, 8);;
196+
## gap> H := CyclicGroup(IsPcGroup, 4);;
197+
## gap> K := DirectProduct(G, H);;
198+
## gap> proj1 := Projection(K, 1);; proj2 := Projection(K, 2);;
199+
## gap> g := (1,2,3,4);; h := GeneratorsOfGroup(H)[1];;
200+
## gap> elm := DirectProductElement([g, h]);
201+
## DirectProductElement( [ (1,2,3,4), f1 ] )
202+
## gap> Image(proj1, elm) = g;
203+
## true
204+
## gap> Image(proj2, elm) = h;
205+
## true
206+
## ]]></Example>
155207
## </Description>
156208
## </ManSection>
209+
## <#/GAPDoc>
157210
##
158211
DeclareOperation( "DirectProductElement", [ IsList ]);
159212
DeclareOperation( "DirectProductElementNC",

0 commit comments

Comments
 (0)