def opposite_condition(dim, i, j):
    """
    encode the equality `x_i = -x_j`

    EXAMPLES::

        sage: from flatsurf.geometry.l_infinity_delaunay_cells import \\
        ....:     opposite_condition, sign_and_norm_conditions

        sage: eq1 = opposite_condition(2, 0, 1)
        sage: eq2 = opposite_condition(2, 1, 0)

        sage: ieqs1 = sign_and_norm_conditions(2, 0, 1)
        sage: ieqs2 = sign_and_norm_conditions(2, 1, -1)

        sage: sorted(Polyhedron(eqns=[eq1], ieqs=ieqs1).vertices_list())
        [[0, 0], [1, -1]]
        sage: sorted(Polyhedron(eqns=[eq1,eq2], ieqs=ieqs1).vertices_list())
        [[0, 0], [1, -1]]
        sage: sorted(Polyhedron(eqns=[eq1,eq2], ieqs=ieqs1+ieqs2).vertices_list())
        [[0, 0], [1, -1]]
    """
    l = [0] * (dim + 1)
    l[i + 1] = 1
    l[j + 1] = 1
    return l
