# Obtaining the rowmotion bijection on distributive lattices via sage

In the article https://arxiv.org/abs/1108.1172 a bijection F on finite distributive lattices called rowmotion is introduced.

Given a poset P and let L(P) denote the distributive lattice of order ideals of P, the bijection F: L(P) -> L(P) is defined as F(I)=the order ideal generated by the minimal elements of P not in I for a given order ideal I.

Is there a way to obtain this bijection F and its inverse for an explictly given distributive lattice in SAGE?

So the input in sage is a distributive lattice such as B4=posets.BooleanLattice(4)

display(B4)

and the output should be the bijection F (and its inverse) as a map on the points of the distributive lattice.