# Obtaining a certain list of posets via SAGE

I want to apply a function to a list of posets with certain properties.

Question : I want the set of all finite poset with a top and buttom that are not lattices and do not have a subposet isomorphic to the diamond poset or the pentagon poset (here pictures of the two lattices: http://i.stack.imgur.com/zC30M.png ). The part without the diamong and pentagon condition should be easy to obtain as follows:

[format_poset(P) for P in posets(n) if P.has_bottom() and P.has_top() and not P.is_lattice()] But I do not know how to tell SAGE the pentagon and diamond condition.

I asked a similar question as this before but now it is not so much about time and it is ok if it works only for posets with at most 8 or 9 points. In general, it would also be interesting to check for a given connected poset whether it has a diamond or pentagon lattice as a subposet. Is there an easy way to do this with SAGE?

edit retag close merge delete

Since what you are looking for are exactly distributive lattices, perhaps it would be good to change the title of the question to indicate that this is what is looked for. Something like "Obtaining distributive lattices from a list of posets via SAGE"

( 2018-01-10 02:58:18 -0600 )edit

Sort by » oldest newest most voted

For a poset p we can simply ask for:

M3 = Posets.DiamondPoset(5)
N5 = Posets.PentagonPoset()

p.has_isomorphic_subposet(M3)
p.has_isomorphic_subposet(N5)


1.st example:

p = Poset( { 0  : [10,11],
10 : [20,21],
11 : [20,21],
20 : [3],
21 : [3],
3  : [], })
p.show()

p.has_bottom()
p.has_top()

p.has_isomorphic_subposet(M3)
p.has_isomorphic_subposet(N5)


We obtain:

True
True
False
False


2.nd example:

q = Poset( { 0  : [10,11],
10 : [20,21],
11 : [20,21],
20 : [4],
21 : [3],
3  : [4],
4  : [], })
q.show()

q.has_bottom()
q.has_top()

q.has_isomorphic_subposet(M3)
q.has_isomorphic_subposet(N5)


This time:

True
True
False
True


3.rd example:

r = Posets.DiamondPoset(6).star_product( Posets.ChainPoset(4) )

r.has_isomorphic_subposet(M3)
r.has_isomorphic_subposet(N5)


and of course we get

True
False

more

Thank you very much. So in my case [format_poset(P) for P in posets(n) if P.has_bottom() and P.has_top() and not P.is_lattice() and not P.has_isomorphic_subposet(M3) and not P.has_isomorphic_subposet(N5)] should work. I think it does! (hope my usage of "not" is correct, since I just guessed that this does what I want and I didnt found it somewhere).

( 2018-01-07 07:15:35 -0600 )edit