From 1b5e416fed67965024296ae7262024bc14adf2d3 Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Sun, 29 Mar 2026 23:55:34 +0200 Subject: [PATCH] Use TryNextMethod instead of Error in Intersection2 if at least one group is finite --- gap/pcpgrp/inters.gi | 3 +++ tst/inters.tst | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gap/pcpgrp/inters.gi b/gap/pcpgrp/inters.gi index 834cf9c..42cfeba 100644 --- a/gap/pcpgrp/inters.gi +++ b/gap/pcpgrp/inters.gi @@ -151,5 +151,8 @@ function( U, V ) return NormalIntersection( V, U ); fi; + if IsFinite( U ) or IsFinite( V ) then + TryNextMethod(); + fi; Error("sorry: intersection for non-normal groups not yet installed"); end ); diff --git a/tst/inters.tst b/tst/inters.tst index 3528a2c..691261b 100644 --- a/tst/inters.tst +++ b/tst/inters.tst @@ -94,7 +94,7 @@ Pcp-group with orders [ 5, 3, 3, 3, 2 ] gap> H2 := Subgroup(H,[h[1]*h[7], h[4]*h[5]]); Pcp-group with orders [ 3, 3, 3, 3 ] gap> J := Intersection(H1,H2); -Error, sorry: intersection for non-normal groups not yet installed +Pcp-group with orders [ 3, 3, 3 ] gap> G1 := PreImagesNC(iso,H1); Group([ f2, f3*f4, f6 ]) gap> G2 := PreImagesNC(iso,H2); @@ -114,7 +114,7 @@ Pcp-group with orders [ 2, 3, 3, 3 ] gap> H2 := Subgroup(H,[h[1]*h[7], h[4]*h[5]^2]); Pcp-group with orders [ 2, 3, 3, 3 ] gap> Intersection(H1,H2); -Error, sorry: intersection for non-normal groups not yet installed +Pcp-group with orders [ 3, 3 ] gap> G1 := PreImagesNC(iso,H1); Group([ f2, f3*f4, f6^2 ]) gap> G2 := PreImagesNC(iso,H2); @@ -124,5 +124,15 @@ Group([ f6^2, f7^2 ]) gap> Image(iso,I); Pcp-group with orders [ 3, 3 ] +# finite - infinite combination example where the intersection isn't impl. when represented as a pcp-group (non-normalizing case) +gap> G := DirectProduct(ExamplesOfSomePcpGroups(8), PcGroupToPcpGroup(PcGroupCode(2835879971,72)));; +gap> g := GeneratorsOfGroup(G);; +gap> H1 := Subgroup(G,[g[6]*g[9]^2]); +Pcp-group with orders [ 2, 2 ] +gap> H2 := Subgroup(G,[g[6],g[2]*g[7]]); +Pcp-group with orders [ 0, 2, 2 ] +gap> Intersection(H1,H2); +Pcp-group with orders [ 2 ] + # gap> STOP_TEST( "inters.tst", 10000000);