import proveit
from proveit import defaults
from proveit import m, x, y, A, B, S
from proveit.numbers import one, two
from proveit.logic import InSet, Union
from proveit.logic.sets.inclusion import subset_eq_def
from proveit.logic.sets.unification import union_def
theory = proveit.Theory() # the theorem's theory
%proving set_subset_eq_of_union_with_set
defaults.assumptions = [set_subset_eq_of_union_with_set.condition]
set_subset_eq_of_union_with_set.condition.instantiate()
subset_eq_def
subset_eq_def_inst = subset_eq_def.instantiate({A:A, B:Union(A, B)})
union_def_inst = union_def.instantiate({m:two, x:x, A:[A, B]})
defaults.assumptions = [*defaults.assumptions, InSet(x, A)]
union_def_inst.rhs.prove()
union_def_inst.derive_left_via_equality()
subset_eq_def_inst.derive_left_via_equality(assumptions=[set_subset_eq_of_union_with_set.condition])
%qed