def find_min_col_lex(M) -> int:
    """Find the minimal column of a matrix ``M`` lexiographically.
    
    Parameters
    ----------
    M : ndarray
        Matrix for which to find minimum column.
    
    Returns
    -------
    mincol : int
        Index of minimum column in M.
    """
    number_of_rows = M.shape[0]
    col_min = M.min(axis=1).reshape(number_of_rows, 1)
    min_cols_idx = (M == col_min)
    c = min_cols_idx.sum(1).reshape(number_of_rows, 1)
    minrow = -min((x, -i) for i, x in enumerate(c))[1]
    d = M[minrow, ]
    mincol = -min((x, -i) for i, x in enumerate(d))[1]
    return mincol