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_axiom_expr # Load the stored axiom expression as 'stored_expr'
# import the special expression
from proveit.logic.sets.intersection import intersect_all_def
In [2]:
# check that the built expression is the same as the stored expression
assert intersect_all_def.expr == stored_expr
assert intersect_all_def.expr._style_id == stored_expr._style_id
print("Passed sanity check: intersect_all_def matches stored_expr")
Passed sanity check: intersect_all_def matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}^+}~\left[\forall_{S_{1}, S_{2}, \ldots, S_{n}, Q, R, x~|~\exists_{\left(y_{1} \in S_{1}\right), \left(y_{2} \in S_{2}\right), \ldots, \left(y_{n} \in S_{n}\right)}~Q\left(y_{1}, y_{2}, \ldots, y_{n}\right)}~\left(\begin{array}{c} \begin{array}{l} \left(x \in \left[\bigcap_{\left(y_{1} \in S_{1}\right), \left(y_{2} \in S_{2}\right), \ldots, \left(y_{n} \in S_{n}\right)~|~Q\left(y_{1}, y_{2}, \ldots, y_{n}\right)}~R\left(y_{1}, y_{2}, \ldots, y_{n}\right)\right]\right) \\  = \left[\forall_{\left(y_{1} \in S_{1}\right), \left(y_{2} \in S_{2}\right), \ldots, \left(y_{n} \in S_{n}\right)~|~Q\left(y_{1}, y_{2}, \ldots, y_{n}\right)}~\left(x \in R\left(y_{1}, y_{2}, \ldots, y_{n}\right)\right)\right] \end{array} \end{array}\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: 25
operand: 2
1ExprTuple2
2Lambdaparameter: 56
body: 4
3ExprTuple56
4Conditionalvalue: 5
condition: 6
5Operationoperator: 25
operand: 9
6Operationoperator: 52
operands: 8
7ExprTuple9
8ExprTuple56, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple13, 48, 44, 40
12Conditionalvalue: 14
condition: 15
13ExprRangelambda_map: 16
start_index: 55
end_index: 56
14Operationoperator: 17
operands: 18
15Operationoperator: 19
operand: 23
16Lambdaparameter: 62
body: 57
17Literal
18ExprTuple21, 22
19Literal
20ExprTuple23
21Operationoperator: 52
operands: 24
22Operationoperator: 25
operand: 29
23Lambdaparameters: 49
body: 27
24ExprTuple40, 28
25Literal
26ExprTuple29
27Conditionalvalue: 46
condition: 30
28Operationoperator: 31
operand: 35
29Lambdaparameters: 49
body: 33
30Operationoperator: 42
operands: 34
31Literal
32ExprTuple35
33Conditionalvalue: 36
condition: 39
34ExprTuple45
35Lambdaparameters: 49
body: 37
36Operationoperator: 52
operands: 38
37Conditionalvalue: 41
condition: 39
38ExprTuple40, 41
39Operationoperator: 42
operands: 43
40Variable
41Operationoperator: 44
operands: 49
42Literal
43ExprTuple45, 46
44Variable
45ExprRangelambda_map: 47
start_index: 55
end_index: 56
46Operationoperator: 48
operands: 49
47Lambdaparameter: 62
body: 50
48Variable
49ExprTuple51
50Operationoperator: 52
operands: 53
51ExprRangelambda_map: 54
start_index: 55
end_index: 56
52Literal
53ExprTuple58, 57
54Lambdaparameter: 62
body: 58
55Literal
56Variable
57IndexedVarvariable: 59
index: 62
58IndexedVarvariable: 60
index: 62
59Variable
60Variable
61ExprTuple62
62Variable