import proveit
from proveit import defaults
from proveit import A, B
from proveit.logic.booleans.conjunction import nand_if_neither
theory = proveit.Theory() # the theorem's theory
%proving falsified_and_if_neither
defaults.assumptions = falsified_and_if_neither.all_conditions()
nand_if_neither
nand = nand_if_neither.instantiate({A:A, B:B})
# To do this manually, we'd execute nand.equate_negated_to_false(assumptions=conditions) and then generalize.
# But it can figure this out via automation.
%qed