First time here? Check out the FAQ!

Ask Your Question
0

Poset of intervals of a poset up to isomorphism

asked 0 years ago

sagequstions gravatar image

updated 0 years ago

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.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 0 years ago

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]}
Preview: (hide)
link

Comments

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

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

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 ( 0 years ago )

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 ( 0 years ago )

Thank you. I will buy that book.

sagequstions gravatar imagesagequstions ( 0 years ago )
0

answered 0 years ago

sagequstions gravatar image

updated 0 years ago

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)
Preview: (hide)
link

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 ( 0 years ago )

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

FrédéricC gravatar imageFrédéricC ( 0 years ago )

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 ( 0 years ago )

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

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

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: 0 years ago

Seen: 273 times

Last updated: May 07 '24