logo
In [1]:
import proveit
# Automation is not needed when only building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_theorem_expr # Load the stored theorem expression as 'stored_expr'
# import the special expression
from proveit.logic.sets.unification import membership_unfolding
In [2]:
# check that the built expression is the same as the stored expression
assert membership_unfolding.expr == stored_expr
assert membership_unfolding.expr._style_id == stored_expr._style_id
print("Passed sanity check: membership_unfolding matches stored_expr")
Passed sanity check: membership_unfolding matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m \in \mathbb{N}^+}~\left[\forall_{x, A_{1}, A_{2}, \ldots, A_{m}~|~x \in \left(A_{1} \cup  A_{2} \cup  \ldots \cup  A_{m}\right)}~\left(\left(x \in A_{1}\right) \lor  \left(x \in A_{2}\right) \lor  \ldots \lor  \left(x \in A_{m}\right)\right)\right]
In [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 7
operand: 2
1ExprTuple2
2Lambdaparameter: 30
body: 4
3ExprTuple30
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 26
operands: 9
7Literal
8ExprTuple10
9ExprTuple30, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple31, 25
13Conditionalvalue: 14
condition: 15
14Operationoperator: 16
operands: 17
15Operationoperator: 26
operands: 18
16Literal
17ExprTuple19
18ExprTuple31, 20
19ExprRangelambda_map: 21
start_index: 29
end_index: 30
20Operationoperator: 22
operands: 23
21Lambdaparameter: 35
body: 24
22Literal
23ExprTuple25
24Operationoperator: 26
operands: 27
25ExprRangelambda_map: 28
start_index: 29
end_index: 30
26Literal
27ExprTuple31, 32
28Lambdaparameter: 35
body: 32
29Literal
30Variable
31Variable
32IndexedVarvariable: 33
index: 35
33Variable
34ExprTuple35
35Variable