import proveit
from proveit import defaults
from proveit import A, B
from proveit.logic import in_bool, Not, Or
from proveit.logic.booleans.disjunction import not_left_if_neither
theory = proveit.Theory() # the theorem's theory
import proveit.logic
%proving not_right_if_neither
# If we do not disable "not_left_if_neither" then a sub-optimal derivation may be generated through the automration.
# (a locally optimal choice in minimizing proof steps is not always globally optimal)
not_left_if_neither.proof().disable()
defaults.assumptions = not_right_if_neither.all_conditions()
AorB_given_B = Or(A, B).conclude_via_example(
B, assumptions = defaults.assumptions + (B,))
B_impl_AorB = AorB_given_B.as_implication(B)
B_impl_AorB.deny_antecedent()
%qed