def up(root_ideal, col_index):
    """ Starting at the column corresponding to ``col_index``, return the up.

        Same as :meth:`down`, but this time you start in the *column* indicated by ``column_index``, and move *up* until you hit the root ideal, then move *left* until you hit the diagonal.

        EXAMPLES:

        The picture below represents the root ideal ``ri``:

        .. image:: _static/root-ideal.JPG
            :width: 180px
            :align: center
            :alt: The root ideal [(0,2), (0,3), (0,4), (1,3), (1,4), (2,4)]

        ::

            sage: ri = RootIdeals().init_from_partition([3, 2, 1], 5)
            sage: ri.up(0) == None
            True
            sage: ri.up(1) == None
            True
            sage: ri.up(2)
            0
            sage: ri.up(3)
            1
            sage: ri.up(4)
            2

        ..  SEEALSO::

            :meth:`down`, :meth:`down_path`, :meth:`up_path`, :meth:`top`, :meth:`bottom`
        """
    for r, c in reversed(root_ideal):
        if c == col_index:
            return r
    return None
