Bijection between ideals of a poset and order-preserving maps from the poset to $\{0,1\}$. 
Show that there is a bijection between the ideals of a poset $P$ and the order-preserving functions from $P$ to $\{0,1\}$ with the relation $0\leq 1$.
A nonempty subset $I\subset P$ is called an ideal (just a "lower set" in some texts) if $y\leq x$ for any $x\in I$, then $y\in I$.

Let $\mathcal{I}$ be the set of ideals of $P$ and $\text{Hom}_{\mathcal{P}os}(P,\{0,1\})$ be the set of order preserving maps from $P\to \{0,1\}$. Define $\Phi:\mathcal{I}\to\text{Hom}_{\mathcal{P}os}(P,\{0,1\})$ by
$$I\mapsto f(x)=\begin{cases} 
                    1 & \text{ if } x \text{ is maximal in }I, \\
                    0 & \text{ else}
                \end{cases}$$
Is this the correct map to use here? The map $f$ defined in this way is order-preserving and $\Phi$ should be one-to-one since if $\Phi(I)=\Phi(J)$ then $I$ and $J$ have all the same maximal elements and would thus be the same ideal(I think elements in $I$ and $J$ that are not comparable to anything else would be problematic for this potentially...).  Now if $f\in\text{Hom}_{\mathcal{P}os}(P,\{0,1\})$, let $I$ be the ideal generated by all $x\in P$ such that $f(x)=1$. Then $\Phi(I)=f$. Thus $\Phi$ is a bijection. Is this correct? Thanks in advance.
 A: I think your bijection does not work because more than one ideal may not have a maximal element.  For example, for the poset $\mathbb{R}$, the ideals $(-\infty,0)$ and $(-\infty,1)$ will cause a problem.  I propose defining the map $\Phi:\mathcal{I}\to\text{Hom}_\text{Pos}\big(P,\{0,1\}\big)$ by setting
$$\Phi(I):=f_I\,,\text{ where }f_I(x):=\left\{\begin{array}{ll}0\,,&\text{if }x\in I\,,\\
1\,,&\text{if }x\in P\setminus I\,,
\end{array}\right.$$
for all $I\in\mathcal{I}$.
Then, the inverse map $\Phi^{-1}:\text{Hom}_\text{Pos}\big(P,\{0,1\}\big)\to\mathcal{I}$ is given by
$$\Phi^{-1}(f):=f^{-1}\big(\{0\}\big)\text{ for all }f\in\text{Hom}_{\text{Pos}}\big(P,\{0,1\}\big)\,.$$
We can say more about $\Phi$.  Equip $\mathcal{I}$ with an order induced by reverse inclusion: for all $I,J\in\mathcal{I}$, $I\leq J$ iff $I\supseteq J$.   Order $\text{Hom}_{\text{Pos}}\big(P,\{0,1\}\big)$ by setting $f\leq g$ if $f(x)\leq g(x)$ for all $x\in P$, where $f,g\in\text{Hom}_{\text{Pos}}\big(P,\{0,1\}\big)$.  Then, $\Phi$ is an isomorphism of partially ordered sets.
A: Two lower sets with the same maximal elements may not be the same unless the lower sets are bounded above by their maximal elements.
Give [0,oo)×[0,oo) the product order.
Let A = {(0,0), (0,1)};
B = [0,oo)×{0} $\cup$ {(0,1)}.  
