Ask Your Question
0

Poset of intervals of a poset up to isomorphism

asked 2024-05-06 11:47:35 +0200

sagequstions gravatar image

updated 2024-05-07 11:53:37 +0200

Let P be a finite poset.

Is there an easy way to obtain the poset U(P) of intervals of P up to isomorphism?

So the elements of U(P) are the intervals of P up to isomorphism and x<=y in U(P) if x is isomorphic to an interval of y.

For example if P is the lattice of divisors of the number 12, then U(P) contains 5 elements. Namely the poset with 1 element, the chain with 2 elements, the chain with 3 elements, the Boolean lattice of a 2-set and the poset P itself. U(P) is isomorphic to the Boolean lattice of a 2-set with a minimum appended.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2024-05-06 19:56:09 +0200

FrédéricC gravatar image

Like this for just the set of isoclasses.

def iso(P):
    D = {}
    for x, y in P.relations():
        Q = P.subposet(P.interval(x, y))
        dp = Q.degree_polynomial()
        if dp not in D:
            D[dp] = []
        if not any(Q.is_isomorphic(R) for R in D[dp]):
            D[dp].append(Q)
    return D

then

sage: P = posets.PentagonPoset()
sage: iso(P)
{1: [Finite poset containing 1 elements],
 x + y: [Finite poset containing 2 elements],
 x^2 + 3*x*y + y^2: [Finite poset containing 5 elements],
 x*y + x + y: [Finite poset containing 3 elements]}
edit flag offensive delete link more

Comments

Just a minor note: if dp not in D: D[dp] = [] can be replaced with D.setdefault(dp,[])

Max Alekseyev gravatar imageMax Alekseyev ( 2024-05-06 22:20:18 +0200 )edit

Thanks. I am not so familiar with Sage, but is there an easy way to just obtain the posets as an output and not those polynomials? I tried something like [r[1] for r in list(iso(P))], but it seems to not work. I noted that there is the command has_isomorphic_subposet, which might then be used to define the right order on iso(P).

sagequstions gravatar imagesagequstions ( 2024-05-07 00:37:31 +0200 )edit

Instead of [r[1] for r in list(iso(P))] use list(iso(P).values()). I suggest you to learn about basic Python structures such as dict- e.g. at https://greenteapress.com/thinkpython...

Max Alekseyev gravatar imageMax Alekseyev ( 2024-05-07 02:18:05 +0200 )edit

Thank you. I will buy that book.

sagequstions gravatar imagesagequstions ( 2024-05-07 10:34:44 +0200 )edit
0

answered 2024-05-07 10:34:32 +0200

sagequstions gravatar image

updated 2024-05-07 10:36:12 +0200

Here my attempt so far using the program suggested in the answer of FrédéricC: There seems to be a probem with the program fcn. Maybe it is because list(iso(P).values()) gives lists of posets instead of posets as an output? I will try to fix this error, but maybe someone sees my mistake already.

def iso(P):
    D = {}
    for x, y in P.relations():
        Q = P.subposet(P.interval(x, y))
        dp = Q.degree_polynomial()
        if dp not in D:
            D[dp] = []
        if not any(Q.is_isomorphic(R) for R in D[dp]):
            D[dp].append(Q)
    return D

def fcn(A, B):
    if B.has_isomorphic_subposet(A):
        return True
    if not B.has_isomorphic_subposet(A):
        return False

def isoposet(P):
    U=list(iso(P).values())
    UU=Poset((U,fcn), cover_relations=True)
    return(UU)

P = posets.PentagonPoset()
U=isoposet(P)
edit flag offensive delete link more

Comments

Like that maybe

def isoposet(P):
    U = [po for liste in iso(P).values() for po in liste]
    UU = Poset((U,fcn), cover_relations=False)
    return UU
FrédéricC gravatar imageFrédéricC ( 2024-05-07 11:23:59 +0200 )edit

and your "fcn" is much too complicated, it could be written in one line..

FrédéricC gravatar imageFrédéricC ( 2024-05-07 11:33:37 +0200 )edit

Thanks. I also noted that it is still not quite what I wanted since I wanted x<=y if x is isomorphic to a subposet given by an interval of y. So the result of this code for the example posets.DivisorLattice(12) gives a chain instead of the result I intended as in the entry post. I will think about how to modify the fcn to do the right thing.

sagequstions gravatar imagesagequstions ( 2024-05-07 11:55:02 +0200 )edit

Perhaps you want sum(iso(P).values(), []).

Max Alekseyev gravatar imageMax Alekseyev ( 2024-05-07 13:02:07 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-05-06 11:47:35 +0200

Seen: 135 times

Last updated: May 07