# 42.5 IsBijection

`IsBijection( map )`

`IsBijection` returns `true` if the mapping map is a bijection and `false` otherwise. Signals an error if map is a multi valued mapping.

A mapping map is a bijection if for each element img of the range there is exactly one element elm of the source that map maps to img. We also say that map is bijective.

```    gap> g := Group( (1,2,3,4), (2,4), (5,6,7) );;  g.name := "g";;
gap> p4 := MappingByFunction( g, g, x -> x^4 );
MappingByFunction( g, g, function ( x )
return x ^ 4;
end )
gap> IsBijection( p4 );
false
gap> IsBijection( InverseMapping( p4 ) );
Error, <map> must be a single valued mapping
gap> p5 := MappingByFunction( g, g, x -> x^5 );
MappingByFunction( g, g, function ( x )
return x ^ 5;
end )
gap> IsBijection( p5 );
true
gap> IsBijection( InverseMapping( p5 ) );
true    # 'p5' is a bijection ```

`IsBijection` first tests if the flag `map.isBijection` is bound. If the flag is bound, it returns its value. Otherwise it calls `map.operations.IsBijection( map )`, remembers the returned value in `map.isBijection`, and returns it.

The default function called this way is `MappingOps.IsBijection`, which calls `IsInjective` and `IsSurjective`, and returns the logical and of the results. This function is seldom overlaid, because all the interesting work is done by `IsInjective` and `IsSurjective`.

GAP 3.4.4
April 1997