From b1e97bc9896e7c4ede3a948b4b7d321aba1f3fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jori=20M=C3=A4ntysalo?= Date: Tue, 25 Aug 2015 10:13:30 +0300 Subject: [PATCH 1/5] Added function frattini_sublattice(). --- src/sage/combinat/posets/hasse_diagram.py | 15 ++++++++++++++ src/sage/combinat/posets/lattices.py | 25 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 7d13914756c..7467539c0ea 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1643,6 +1643,21 @@ def sublattice(elms, e): return result + def frattini_sublattice(self): + """ + Return the list of elements of the Frattini sublattice of the lattice. + + EXAMPLES:: + + sage: H = Posets.PentagonPoset()._hasse_diagram + sage: H.frattini_sublattice() + [0, 4] + """ + # Just a direct computation, no optimization at all. + max_sublats = self.maximal_sublattices() + return [e for e in range(self.cardinality()) if + all(e in ms for ms in max_sublats)] + from sage.misc.rest_index_of_methods import gen_rest_table_index import sys __doc__ = __doc__.format(INDEX_OF_FUNCTIONS=gen_rest_table_index(HasseDiagram)) diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index 21e92d24805..e99a9e613e9 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -947,6 +947,31 @@ def maximal_sublattices(self): return [self.sublattice([self.bottom()]), self.sublattice([self.top()])] return [self.sublattice([self[x] for x in d]) for d in self._hasse_diagram.maximal_sublattices()] + def frattini_sublattice(self): + r""" + Return the Frattini sublattice of the lattice. + + Frattini sublattice `\Phi(L)` is the intersection of all + proper maximal sublattices of `L`. It is also the set of + "non-generators" - if the sublattice generated by set `S` of + elements is whole lattice then also `S \setminus \Phi(L)` + generates whole lattice. + + EXAMPLES:: + + sage: L = LatticePoset(( [], [[1,2],[1,17],[1,8],[2,3],[2,22], + ....: [2,5],[2,7],[17,22],[17,13],[8,7], + ....: [8,13],[3,16],[3,9],[22,16],[22,18], + ....: [22,10],[5,18],[5,14],[7,9],[7,14], + ....: [7,10],[13,10],[16,6],[16,19],[9,19], + ....: [18,6],[18,33],[14,33],[10,19], + ....: [10,33],[6,4],[19,4],[33,4]] )) + sage: sorted(L.frattini_sublattice().list()) + [1, 2, 4, 10, 19, 22, 33] + """ + return LatticePoset(self.subposet([self[x] for x in + self._hasse_diagram.frattini_sublattice()])) + ############################################################################ FiniteMeetSemilattice._dual_class = FiniteJoinSemilattice From b20f025dc034b16e3f1d53968668030131ef8ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jori=20M=C3=A4ntysalo?= Date: Wed, 26 Aug 2015 10:58:13 +0300 Subject: [PATCH 2/5] Index of functions; check for 0-, 1- and 2-element lattices. --- src/sage/combinat/posets/hasse_diagram.py | 3 +++ src/sage/combinat/posets/lattices.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 7467539c0ea..15c408d8f46 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1654,6 +1654,9 @@ def frattini_sublattice(self): [0, 4] """ # Just a direct computation, no optimization at all. + n = self.cardinality() + if n == 0 or n == 2: return [] + if n == 1: return [0] max_sublats = self.maximal_sublattices() return [e for e in range(self.cardinality()) if all(e in ms for ms in max_sublats)] diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index e99a9e613e9..e434ab4516b 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -24,6 +24,8 @@ :delim: | :meth:`~FiniteLatticePoset.complements` | Return the list of complements of an element, or the dictionary of complements for all elements. + :meth:`~FiniteLatticePoset.maximal_sublattices` | Return maximal sublattices of the lattice. + :meth:`~FiniteLatticePoset.frattini_sublattice` | Return the intersection of maximal sublattices. :meth:`~FiniteLatticePoset.is_atomic` | Return ``True`` if the lattice is atomic. :meth:`~FiniteLatticePoset.is_complemented` | Return ``True`` if the lattice is complemented. :meth:`~FiniteLatticePoset.is_distributive` | Return ``True`` if the lattice is distributive. From c112de68d7ee459f35b24599817ee00b08bf48df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jori=20M=C3=A4ntysalo?= Date: Thu, 27 Aug 2015 08:16:50 +0300 Subject: [PATCH 3/5] Added a todo-note. --- src/sage/combinat/posets/hasse_diagram.py | 7 +++++++ src/sage/combinat/posets/lattices.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 15c408d8f46..64be19d5cfa 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1652,6 +1652,13 @@ def frattini_sublattice(self): sage: H = Posets.PentagonPoset()._hasse_diagram sage: H.frattini_sublattice() [0, 4] + + .. note:: + + If an element e is both meet- and join-irreducible in + the lattice L, then L\e is clearly a maximal sublattice. + This could be used as an optimization: first remove those + elements, as they can never be in the Frattini sublattice. """ # Just a direct computation, no optimization at all. n = self.cardinality() diff --git a/src/sage/combinat/posets/lattices.py b/src/sage/combinat/posets/lattices.py index e434ab4516b..8bb34533b4c 100644 --- a/src/sage/combinat/posets/lattices.py +++ b/src/sage/combinat/posets/lattices.py @@ -953,10 +953,10 @@ def frattini_sublattice(self): r""" Return the Frattini sublattice of the lattice. - Frattini sublattice `\Phi(L)` is the intersection of all + The Frattini sublattice `\Phi(L)` is the intersection of all proper maximal sublattices of `L`. It is also the set of "non-generators" - if the sublattice generated by set `S` of - elements is whole lattice then also `S \setminus \Phi(L)` + elements is whole lattice, then also `S \setminus \Phi(L)` generates whole lattice. EXAMPLES:: From c969573f199ff5b008db4c6553ce27dc66d6213e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jori=20M=C3=A4ntysalo?= Date: Thu, 27 Aug 2015 08:18:07 +0300 Subject: [PATCH 4/5] Arghs. Git again. --- src/sage/combinat/posets/hasse_diagram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 64be19d5cfa..3436c4c09bb 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1653,7 +1653,7 @@ def frattini_sublattice(self): sage: H.frattini_sublattice() [0, 4] - .. note:: + .. TODO:: If an element e is both meet- and join-irreducible in the lattice L, then L\e is clearly a maximal sublattice. From 24c94064ec51c2e539e6197c51e58d0769221c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jori=20M=C3=A4ntysalo?= Date: Mon, 31 Aug 2015 15:15:17 +0300 Subject: [PATCH 5/5] Removed a TODO-block. --- src/sage/combinat/posets/hasse_diagram.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index 3436c4c09bb..15c408d8f46 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1652,13 +1652,6 @@ def frattini_sublattice(self): sage: H = Posets.PentagonPoset()._hasse_diagram sage: H.frattini_sublattice() [0, 4] - - .. TODO:: - - If an element e is both meet- and join-irreducible in - the lattice L, then L\e is clearly a maximal sublattice. - This could be used as an optimization: first remove those - elements, as they can never be in the Frattini sublattice. """ # Just a direct computation, no optimization at all. n = self.cardinality()