I want to associate to a finite poset a simplicial complex $\Delta(P)$ and study 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 )$.
(here ( means { and ) means } but it seems that the set brackets can not be displayed here)
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 \subset P$ we denote by $S^c$ the complement of $S$ in $P$.
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.
Thanks for any help.