From 61be0c98ebf01759839b01ec22e36a351b51d3d6 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Wed, 27 Mar 2024 15:10:37 +0000 Subject: [PATCH 1/3] Add IsModularLatticeDigraph --- gap/prop.gd | 1 + gap/prop.gi | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gap/prop.gd b/gap/prop.gd index e58a20579..553c683fb 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -51,6 +51,7 @@ DeclareProperty("IsJoinSemilatticeDigraph", IsDigraph); DeclareProperty("IsMeetSemilatticeDigraph", IsDigraph); DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); +DeclareProperty("IsModularLatticeDigraph", IsDigraph); DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index 0f4fd0d18..33b0b2660 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -661,19 +661,28 @@ end); InstallMethod(IsDistributiveLatticeDigraph, "for a digraph", [IsDigraph], function(D) - local N5, M3; + local M3; + if not IsLatticeDigraph(D) then return false; fi; - N5 := DigraphReflexiveTransitiveClosure( - Digraph([[2, 4], [3], [5], [5], []])); M3 := DigraphReflexiveTransitiveClosure( Digraph([[2, 3, 4], [5], [5], [5], []])); - if LatticeDigraphEmbedding(N5, D) <> fail or - LatticeDigraphEmbedding(M3, D) <> fail then + return IsModularLatticeDigraph(D) and + LatticeDigraphEmbedding(M3, D) = fail; +end); + +InstallMethod(IsModularLatticeDigraph, "for a digraph", [IsDigraph], +function(D) + local N5; + if not IsLatticeDigraph(D) then return false; fi; - return true; + + N5 := DigraphReflexiveTransitiveClosure( + Digraph([[2, 4], [3], [5], [5], []])); + + return LatticeDigraphEmbedding(N5, D) = fail; end); From 7de72d90e7c2b0865aca09e0d1af3ce5a9167514 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Wed, 27 Mar 2024 15:10:37 +0000 Subject: [PATCH 2/3] Add IsModularLatticeDigraph --- gap/prop.gd | 1 + gap/prop.gi | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gap/prop.gd b/gap/prop.gd index e58a20579..553c683fb 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -51,6 +51,7 @@ DeclareProperty("IsJoinSemilatticeDigraph", IsDigraph); DeclareProperty("IsMeetSemilatticeDigraph", IsDigraph); DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); +DeclareProperty("IsModularLatticeDigraph", IsDigraph); DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index 0f4fd0d18..33b0b2660 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -661,19 +661,28 @@ end); InstallMethod(IsDistributiveLatticeDigraph, "for a digraph", [IsDigraph], function(D) - local N5, M3; + local M3; + if not IsLatticeDigraph(D) then return false; fi; - N5 := DigraphReflexiveTransitiveClosure( - Digraph([[2, 4], [3], [5], [5], []])); M3 := DigraphReflexiveTransitiveClosure( Digraph([[2, 3, 4], [5], [5], [5], []])); - if LatticeDigraphEmbedding(N5, D) <> fail or - LatticeDigraphEmbedding(M3, D) <> fail then + return IsModularLatticeDigraph(D) and + LatticeDigraphEmbedding(M3, D) = fail; +end); + +InstallMethod(IsModularLatticeDigraph, "for a digraph", [IsDigraph], +function(D) + local N5; + if not IsLatticeDigraph(D) then return false; fi; - return true; + + N5 := DigraphReflexiveTransitiveClosure( + Digraph([[2, 4], [3], [5], [5], []])); + + return LatticeDigraphEmbedding(N5, D) = fail; end); From aa188bd21e23b30873d7130bf9f7e13b1f8fe2c5 Mon Sep 17 00:00:00 2001 From: Murray Whyte Date: Wed, 3 Apr 2024 14:37:10 +0100 Subject: [PATCH 3/3] Add documentation and tests --- doc/prop.xml | 34 ++++++++++++++++++++++++++++++++++ doc/z-chap5.xml | 1 + tst/standard/prop.tst | 27 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/doc/prop.xml b/doc/prop.xml index 795acf6a1..0b9b4bd7e 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1334,6 +1334,40 @@ false]]> <#/GAPDoc> +<#GAPDoc Label="IsModularLatticeDigraph"> + + + true or false. + + IsModularLatticeDigraph returns true if the digraph + digraph is a modular lattice digraph.

+ + A modular lattice digraph is a lattice digraph + () which is modular. That is to say, + the lattice digraph representing N5 is not + embeddable as a lattice + (see https://en.wikipedia.org/wiki/Modular_lattice and + ). + + &MUTABLE_RECOMPUTED_PROP; + + D := ChainDigraph(5); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsModularLatticeDigraph(D); +true +gap> N5 := Digraph([[2, 3], [4], [4], []]); + +gap> DigraphReflexiveTransitiveClosure(N5); + +gap> IsModularLatticeDigraph(N5); +false +]]> + + +<#/GAPDoc> <#GAPDoc Label="IsPreorderDigraph"> diff --git a/doc/z-chap5.xml b/doc/z-chap5.xml index bde06bf94..8adb9eb49 100644 --- a/doc/z-chap5.xml +++ b/doc/z-chap5.xml @@ -36,6 +36,7 @@ <#Include Label="DigraphMeetTable"> <#Include Label="IsUpperSemimodularDigraph"> <#Include Label="IsDistributiveLatticeDigraph"> + <#Include Label="IsModularLatticeDigraph">

Regularity diff --git a/tst/standard/prop.tst b/tst/standard/prop.tst index 7ca8fd0b9..492c3b063 100644 --- a/tst/standard/prop.tst +++ b/tst/standard/prop.tst @@ -1330,6 +1330,33 @@ gap> D := DigraphReflexiveTransitiveClosure(D); gap> IsDistributiveLatticeDigraph(D); true +# IsModularLatticeDigraph +gap> D := Digraph([[11, 10], [], [2], [2], [3], [4, 3], [6, 5], [7], [7], +> [8], [9, 8]]); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsModularLatticeDigraph(D); +true +gap> D := ChainDigraph(10); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsModularLatticeDigraph(D); +true +gap> D := Digraph([[2, 4], [3, 5], [9], [5, 6], [7], [7, 8], [9], [9], []]); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsModularLatticeDigraph(D); +false +gap> M3 := Digraph([[2, 3, 4], [5], [5], [5], []]); + +gap> M3 := DigraphReflexiveTransitiveClosure(M3); + +gap> IsModularLatticeDigraph(M3); +true + # IsPartialOrderDigraph gap> gr := NullDigraph(5);