Skip to content

Commit

Permalink
drect maximal elements
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Mar 12, 2024
1 parent a48418a commit 060b8ce
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/sage/combinat/independence_posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def complete_mop(G, S):
sets = [(S, t)
for t in Subsets(Set(G).difference(S))
if not any((i, j) in edges for i in S for j in t)]
P = Poset([sets, _inc])
return P.maximal_elements()
return [u for u in sets
if not any(_inc(u, v) for v in sets if v != u)]


##############################################################
Expand All @@ -235,17 +235,22 @@ def is_left_modular(L, H=None, verbose=False) -> bool:
``H`` -- subset of elements; ``H`` is taken as ``L`` if none is given
``verbose`` -- indicates whether to give a list of failures; false by default
``verbose`` -- indicates whether to give
a list of failures; false by default
OUTPUT:
if ``verbose == True``, outputs a list of tuples `(y, x, z)` which fail left-modularity.
if ``verbose == False``, outputs ``False`` if any one `x \\in H` fails to be left-modular and ``True`` otherwise.
if ``verbose == True``, outputs a list of tuples
`(y, x, z)` which fail left-modularity.
if ``verbose == False``, outputs ``False``
if any one `x \\in H` fails to be left-modular and ``True`` otherwise.
ALGORITHM:
Given a lattice `L` and a subset of elements `H`, an element `x \\in H` is left-modular
if for every `y,z \\in L, y \\leq z` the equality `(y \\vee x) \\wedge z = y \\vee (x \\wedge z)`.
Given a lattice `L` and a subset of elements `H`,
an element `x \\in H` is left-modular
if for every `y,z \\in L, y \\leq z`
the equality `(y \\vee x) \\wedge z = y \\vee (x \\wedge z)`.
EXAMPLES:
Expand Down

0 comments on commit 060b8ce

Please sign in to comment.