Skip to content

Commit

Permalink
Trac #17226: LatticePoset: add Frattini sublattice
Browse files Browse the repository at this point in the history
Add a function that computes the Frattini sublattice, i.e. intersection
of all proper sublattices of a lattice. AFAIK there is no known good
algorithm for this. Maybe making even a slow function will make it
easier to search for one.

URL: http://trac.sagemath.org/17226
Reported by: jmantysalo
Ticket author(s): Jori Mäntysalo
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Sep 4, 2015
2 parents 0e9fb6c + 24c9406 commit 653f972
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/sage/combinat/posets/hasse_diagram.py
Expand Up @@ -1636,6 +1636,24 @@ 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.
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)]

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))
27 changes: 27 additions & 0 deletions src/sage/combinat/posets/lattices.py
Expand Up @@ -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.
Expand Down Expand Up @@ -947,6 +949,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.
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)`
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
Expand Down

0 comments on commit 653f972

Please sign in to comment.