import proveit
from proveit import defaults
from proveit import x, y
from proveit.logic.equality import equals_symmetry
theory = proveit.Theory() # the theorem's theory
%proving not_equals_symmetry
defaults.assumptions = not_equals_symmetry.conditions
x_neq_y = defaults.assumptions[0]
not__x_eq_y = x_neq_y.unfold()
equals_symmetry
# substitute x=y with y=x within Not(x=y)
equals_symmetry.instantiate({x:x, y:y}).sub_left_side_into(not__x_eq_y.inner_expr().operand)
%qed