logo

Common expressions for the theory of proveit.logic.sets.intersection

In [1]:
import proveit
# Prepare this notebook for defining the common expressions of a theory:
%common_expressions_notebook # Keep this at the top following 'import proveit'.
from proveit import Lambda, ExprRange, IndexedVar
from proveit.logic import And, Or, InSet, NotInSet, Intersect
from proveit import A, x, i, n
from proveit.numbers import one
%begin common
Defining common sub-expressions for theory 'proveit.logic.sets.intersection'
Subsequent end-of-cell assignments will define common sub-expressions
%end_common will finalize the definitions
In [2]:
intersected_as = Intersect(ExprRange(i, IndexedVar(A, i), one, n))
intersected_as:
In [3]:
x_in_each_A = ExprRange(i, InSet(x, IndexedVar(A, i)), one, n)
x_in_each_A:
In [4]:
x_in_each_A_conjunction = And(ExprRange(i, InSet(x, IndexedVar(A, i)), one, n))
x_in_each_A_conjunction:
In [5]:
x_not_in_any_A = Or(ExprRange(i, NotInSet(x, IndexedVar(A, i)), one, n))
x_not_in_any_A:
In [6]:
%end common
These common expressions may now be imported from the theory package: proveit.logic.sets.intersection