Ask Your Question
1

Obtaining a simplicial complex associated to a poset with the help of Sage

asked 2020-10-07 09:50:02 +0100

klaaa gravatar image

updated 2020-10-07 10:15:00 +0100

I want to associate to a finite poset a simplicial complex $\Delta(P)$ and study the homology(with coefficients in the rational numbers or a finite field) and the topological type of this simplicial complex using Sage. I have not yet used sage for this and wanted to ask whether there is an easy method to do this.

Let $P$ be a a finite poset with at least two elements and for $p \in P$ define two subsets as follows:

$J(p):=$ { $ g \in P | p \nleq g $ } and $I(p):=$ { $g \in P | g \leq p $ }.

For a subset $S$ of $P$ (we view $P$ also as set of its vertices) we then define

$J(S):= \bigcap\limits_{p \in S}^{}{J(p)}$ and $I(S):= \bigcup\limits_{p \in S}^{}{I(p)}$.

We set $J( \emptyset)=P, J(P)=\emptyset$ and $I(\emptyset)=\emptyset$, $I(P)=P$.

Then the simplicial complex $\Delta(P)$ is defined as the set of all subsets $S \subseteq P$ with $J(S^c) \subseteq I(S^c)$, where fore a subset $S \subseteq P$ we denote by $S^c$ the complement of $S$ in $P$.

For example when the poset $P$ is a chain with $n$-elements then $\Delta(P)$ should have topological type of the $(n-2)$-sphere.

I can obtain the sets $J(p)$ and $I(p)$ for elements but not for subsets in Sage, but I would think there is an easy trick.

Here is an example in Sage for a given poset $P$ :

P=posets.BooleanLattice(2)

display(P)

p=P[2]

I=[u for u in P if P.is_lequal(u,p)]

J=[u for u in P if not P.is_lequal(p,u)]

display(I)

display(J)

Thanks for any help.

edit retag flag offensive close merge delete

Comments

Please add the code you have so far, with an example $P$.

rburing gravatar imagerburing ( 2020-10-07 09:57:31 +0100 )edit

I added a small example for the Boolean lattice on how to obtain $J(p)$ and $I(p)$.

klaaa gravatar imageklaaa ( 2020-10-07 10:09:56 +0100 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2020-10-07 12:26:37 +0100

FrédéricC gravatar image

updated 2020-10-07 15:26:35 +0100

something like this maybe (not tested)

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    JSc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_ISc(g) for g in JSc)
edit flag offensive delete link more

Comments

Thank you very much, but it seems to not work for every subset. For example here it works:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) for g in Jsc)

P=posets.BooleanLattice(2)
U = Subsets(P)
T=U[2]
display(T)
test_subset(P, T)

but for the same poset P with another subset it does not work and gives an error (see next comment)

klaaa gravatar imageklaaa ( 2020-10-07 13:32:19 +0100 )edit

Here it gives an error:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    Jsc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_Isc(g) for g in Jsc)

P=posets.BooleanLattice(2)
U = Subsets(P)
T=U[1]
display(T)
test_subset(P, T)
klaaa gravatar imageklaaa ( 2020-10-07 13:32:31 +0100 )edit

There was a typo "Isc" versus ISc.

FrédéricC gravatar imageFrédéricC ( 2020-10-07 15:26:56 +0100 )edit

Thank you very much again. It seems to work now. I combined it and obtained the simplicial complex as follows:

def test_subset(P, S):
    Sc = set(g for g in P if g not in S)
    in_ISc = lambda g: any(s in Sc for s in P.principal_order_filter(g))
    JSc = (g for g in P if not any(s in Sc
                                   for s in P.principal_order_ideal(g)))
    return all(in_ISc(g) for g in JSc)

P=posets.ChainPoset(4)
P=P.relabel()
U = Subsets(P)
G=[t for t in U if test_subset(P, t)==true]
GG=[list(r) for r in G]
display(GG)
S=SimplicialComplex(GG)
display(S)
phi, M = S.algebraic_topological_model(QQ)
M.homology()
klaaa gravatar imageklaaa ( 2020-10-07 16:40:38 +0100 )edit

Do you know whether I calcuate the homology the right way over the rational numbers QQ? It seems I have to use the strange command

phi, M = S.algebraic_topological_model(QQ)

and I do not quite know why I need to write the phi before the M.

Also do you know whether there is a command to check whether the simplicial complex is topologically homeomorphic to a sphere?

klaaa gravatar imageklaaa ( 2020-10-07 16:41:55 +0100 )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: 2020-10-07 09:50:02 +0100

Seen: 332 times

Last updated: Oct 07 '20