import proveit
# Prepare this notebook for defining the theorems of a theory:
%theorems_notebook # Keep this at the top following 'import proveit'.
from proveit import ExprTuple, IndexedVar
from proveit.logic import Forall, Not, Equals, InSet, NotInSet, EmptySet, in_bool
from proveit import i, m, n, x, S
from proveit.numbers import zero, num, Natural, Exp, Interval
%begin theorems
# Proven. Used by the NotInSet class's deduce_in_bool() method
not_in_set_is_bool = Forall( (x, S), in_bool(NotInSet(x, S)), conditions=[in_bool(InSet(x, S))] )
unfold_not_in_set = Forall((x, S), Not(InSet(x, S)), conditions=[NotInSet(x, S)])
fold_not_in_set = Forall((x, S), NotInSet(x, S), conditions=[Not(InSet(x, S))])
double_negated_membership = Forall((x, S), Not(NotInSet(x, S)), conditions=[InSet(x, S)])
Might be useful to have an additional theorem here along the lines of: $(x\in S \Rightarrow \bot) \Rightarrow (x\notin S)$ (a form of “deny_via_contradiction” or some similar name)
%end theorems