# 51.8 CommutativeDiagram

`CommutativeDiagram( paramap1, paramap2, paramap3, paramap4 )`
```CommutativeDiagram( paramap1, paramap2, paramap3, paramap4, improvements )```

If [ ```CompositionMaps(paramap2,paramap1 ) = CompositionMaps(paramap4,paramap3 )``` ] shall hold, the consistency is checked and the four maps will be improved according to this condition.

If a record improvements with fields `imp1`, `imp2`, `imp3`, `imp4` (all lists) is entered as parameter, only diagrams containing elements of `impi` as positions in the i-th paramap are considered.

`CommutativeDiagram` returns `false` if an inconsistency was found, otherwise a record is returned that contains four lists `imp1`, ldots, `imp4`, where `impi` is the list of classes where the i-th paramap was improved.

```    gap> map1:= [ [ 1, 2, 3 ], [ 1, 3 ] ];;
gap> map2:= [ [ 1, 2 ], 1, [ 1, 3 ] ];;
gap> map3:= [ [ 2, 3 ], 3 ];; map4:= [ , 1, 2, [ 1, 2 ] ];;
gap> CommutativeDiagram( map1, map2, map3, map4 );
rec(
imp1 := [ 2 ],
imp2 := [ 1 ],
imp3 := [  ],
imp4 := [  ] )
gap> imp:= last;; map1; map2; map3; map4;
[ [ 1, 2, 3 ], 1 ]
[ 2, 1, [ 1, 3 ] ]
[ [ 2, 3 ], 3 ]
[ , 1, 2, [ 1, 2 ] ]
gap> CommutativeDiagram( map1, map2, map3, map4, imp );
rec(
imp1 := [  ],
imp2 := [  ],
imp3 := [  ],
imp4 := [  ] )```

GAP 3.4.4
April 1997