@@ -104,7 +104,7 @@ InstallMethod( EmbeddingOfFinSets,
104104 function ( s, t )
105105 local iota;
106106
107- iota := MapOfFinSets( s, List ( s, x -> x ), t );
107+ iota := MapOfFinSets( s, AsList ( s ), t );
108108
109109 Assert ( 3 , IsMonomorphism( iota ) );
110110 SetIsMonomorphism( iota, true );
@@ -528,51 +528,36 @@ AddDirectProduct( SkeletalFinSets,
528528end );
529529
530530# #
531- AddProjectionInFactorOfDirectProduct( SkeletalFinSets, CAPOperationPrepareFunction( " ProjectionInFactorOfBinaryDirectProductToProjectionInFactorOfDirectProduct" , SkeletalFinSets, function ( cat, M, N, pos )
532- local S, T, n, imgs, i;
531+ AddProjectionInFactorOfDirectProductWithGivenDirectProduct( SkeletalFinSets,
532+ function ( cat, D, k, P )
533+ local T, l, a;
533534
534- S := DirectProduct( [ M, N ] );
535- if pos = 1 then
536- T := M;
537- else
538- T := N;
539- fi ;
535+ T := D[ k] ;
540536
541- n := Length( N );
537+ l := Length( T );
542538
543- imgs := [ ] ;
544-
545- for i in AsList( S ) do
546- if pos = 2 then
547- Add( imgs, (i - 1 ) mod n );
548- else
549- Add( imgs, Int( (i - 1 ) / n ) );
550- fi ;
551- od ;
539+ a := Product( D{[ k + 1 .. Length( D ) ]} , M -> Length( M ) );
552540
553- imgs := List( imgs, img -> img + 1 );
554-
555- return MapOfFinSets( S, imgs, T );
556- end ) );
541+ return MapOfFinSets( P, List( [ 0 .. Length( P ) - 1 ] , i -> 1 + RemInt( QuoInt( i, a ), l ) ), T );
542+
543+ end );
557544
558545# #
559- AddUniversalMorphismIntoDirectProduct( SkeletalFinSets, CAPOperationPrepareFunction( " UniversalMorphismIntoBinaryDirectProductToUniversalMorphismIntoDirectProduct" , SkeletalFinSets, function ( cat, tau1, tau2 )
560- local S, T, n, imgs, i;
546+ AddUniversalMorphismIntoDirectProductWithGivenDirectProduct( SkeletalFinSets,
547+ function ( cat, D, T, tau, P )
548+ local l, d, dd, taus;
561549
562- S := Source( tau1 );
563- T := DirectProduct( [ Range( tau1 ), Range( tau2 ) ] );
550+ l := Length( D );
564551
565- n := Length( Range( tau2 ) );
552+ d := List( D, x -> Length( x ) );
566553
567- imgs := [ ] ;
554+ dd := List( [ 1 .. l ] , i -> Product( d {[ i + 1 .. l ]} ) ) ;
568555
569- for i in AsList( S ) do
570- Add( imgs, (AsList( tau1 )[ i] - 1 ) * n + AsList( tau2 )[ i] );
571- od ;
556+ taus := List( tau, x -> AsList( x ) );
572557
573- return MapOfFinSets( S, imgs, T );
558+ return MapOfFinSets( T, List( AsList( T ), i -> 1 + Sum( [ 1 .. l ] , j -> ( taus [ j ][ i ] - 1 ) * dd [ j ] ) ), P );
574559
575- end ) ) ;
560+ end );
576561
577562# #
578563AddEqualizer( SkeletalFinSets,
0 commit comments