# 62.78 Defining near-rings with known multiplication table

Suppose that for a given group g the multiplication table of a binary operation * on the elements of g is known such that * is a near-ring multiplication on g. Then the constructor function `Nearring` can be used to input the near-ring specified by g and *.

An example shall illustrate a possibility how this could be accomplished: Take the group S_3, which in GAP can be defined e.g. by

```  gap> g := Group( (1,2), (1,2,3) );
Group( (1,2), (1,2,3) )
```

This group has the following list of elements:

```  gap> Elements( g );
[ (), (2,3), (1,2), (1,2,3), (1,3,2), (1,3) ]
```

Let `1` stand for the first element in this list, `2` for the second, and so on up to `6` which stands for the sixth element in the following multiplication table:

catcode`|=12 begintabularc`cccccc} \catcode`\`=13 * & 1 & 2 & 3 & 4 & 5 & 6
hline 1 & 1 & 1 & 1 & 1 & 1 & 1
2 & 2 & 2 & 2 & 2 & 2 & 2
3 & 2 & 2 & 6 & 3 & 6 & 3
4 & 1 & 1 & 5 & 4 & 5 & 4
5 & 1 & 1 & 4 & 5 & 4 & 5
6 & 2 & 2 & 3 & 6 & 3 & 6 A near-ring on `g` with this multiplication can be input by first defining a multiplication function, say `m` in the following way:

```  gap> m := function( x, y )
>   local elms, table;
>     elms := Elements( g );
>     table := [ [ 1, 1, 1, 1, 1, 1 ],
>                [ 2, 2, 2, 2, 2, 2 ],
>                [ 2, 2, 6, 3, 6, 3 ],
>                [ 1, 1, 5, 4, 5, 4 ],
>                [ 1, 1, 4, 5, 4, 5 ],
>                [ 2, 2, 3, 6, 3, 6 ] ];
>
>     return elms[ table[Position( elms, x )][Position( elms, y )] ];
>   end;
function ( x, y ) ... end
```

Then the near-ring can be constructed by calling `Nearring` with the parameters `g` and `m`:

```  gap> n := Nearring( g, m );
Nearring( Group( (1,2), (1,2,3) ), function ( x, y )
local  elms, table;
elms := Elements( g );
table := [ [ 1, 1, 1, 1, 1, 1 ], [ 2, 2, 2, 2, 2, 2 ],
[ 2, 2, 6, 3, 6, 3 ], [ 1, 1, 5, 4, 5, 4 ],
[ 1, 1, 4, 5, 4, 5 ], [ 2, 2, 3, 6, 3, 6 ] ];
return elms[table[Position( elms, x )][Position( elms, y )]];
end )
```
Previous Up Top
Index

GAP 3.4.4
April 1997