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.comprehension import in_superset_if_in_comprehension
In [2]:
# check that the built expression is the same as the stored expression
assert in_superset_if_in_comprehension.expr == stored_expr
assert in_superset_if_in_comprehension.expr._style_id == stored_expr._style_id
print("Passed sanity check: in_superset_if_in_comprehension matches stored_expr")
Passed sanity check: in_superset_if_in_comprehension matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{S, Q}~\left[\forall_{x \in \left\{y~|~Q\left(y\right)\right\}_{y \in S}}~\left(x \in S\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: 5
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple29, 27
4Operationoperator: 5
operand: 7
5Literal
6ExprTuple7
7Lambdaparameter: 14
body: 9
8ExprTuple14
9Conditionalvalue: 10
condition: 11
10Operationoperator: 25
operands: 12
11Operationoperator: 25
operands: 13
12ExprTuple14, 29
13ExprTuple14, 15
14Variable
15Operationoperator: 16
operand: 18
16Literal
17ExprTuple18
18Lambdaparameter: 30
body: 19
19Conditionalvalue: 30
condition: 20
20Operationoperator: 21
operands: 22
21Literal
22ExprTuple23, 24
23Operationoperator: 25
operands: 26
24Operationoperator: 27
operand: 30
25Literal
26ExprTuple30, 29
27Variable
28ExprTuple30
29Variable
30Variable