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.booleans.quantification.universality import unbundle
In [2]:
# check that the built expression is the same as the stored expression
assert unbundle.expr == stored_expr
assert unbundle.expr._style_id == stored_expr._style_id
print("Passed sanity check: unbundle matches stored_expr")
Passed sanity check: unbundle matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m, n \in \mathbb{N}^+}~\left[\forall_{P, Q, R}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{x_{1}, x_{2}, \ldots, x_{m}, y_{1}, y_{2}, \ldots, y_{n}~|~Q\left(x_{1}, x_{2}, \ldots, x_{m}\right), R\left(x_{1}, x_{2}, \ldots, x_{m},y_{1}, y_{2}, \ldots, y_{n}\right)}~P\left(x_{1}, x_{2}, \ldots, x_{m},y_{1}, y_{2}, \ldots, y_{n}\right)\right] \\  \Rightarrow \left[\forall_{x_{1}, x_{2}, \ldots, x_{m}~|~Q\left(x_{1}, x_{2}, \ldots, x_{m}\right)}~\left[\forall_{y_{1}, y_{2}, \ldots, y_{n}~|~R\left(x_{1}, x_{2}, \ldots, x_{m},y_{1}, y_{2}, \ldots, y_{n}\right)}~P\left(x_{1}, x_{2}, \ldots, x_{m},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: 32
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple48, 51
4Conditionalvalue: 5
condition: 6
5Operationoperator: 32
operand: 9
6Operationoperator: 30
operands: 8
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 12
body: 13
10Operationoperator: 15
operands: 14
11Operationoperator: 15
operands: 16
12ExprTuple42, 36, 43
13Operationoperator: 17
operands: 18
14ExprTuple48, 19
15Literal
16ExprTuple51, 19
17Literal
18ExprTuple20, 21
19Literal
20Operationoperator: 32
operand: 24
21Operationoperator: 32
operand: 25
22ExprTuple24
23ExprTuple25
24Lambdaparameters: 44
body: 26
25Lambdaparameters: 37
body: 27
26Conditionalvalue: 40
condition: 28
27Conditionalvalue: 29
condition: 34
28Operationoperator: 30
operands: 31
29Operationoperator: 32
operand: 35
30Literal
31ExprTuple34, 41
32Literal
33ExprTuple35
34Operationoperator: 36
operands: 37
35Lambdaparameters: 38
body: 39
36Variable
37ExprTuple45
38ExprTuple46
39Conditionalvalue: 40
condition: 41
40Operationoperator: 42
operands: 44
41Operationoperator: 43
operands: 44
42Variable
43Variable
44ExprTuple45, 46
45ExprRangelambda_map: 47
start_index: 50
end_index: 48
46ExprRangelambda_map: 49
start_index: 50
end_index: 51
47Lambdaparameter: 57
body: 52
48Variable
49Lambdaparameter: 57
body: 53
50Literal
51Variable
52IndexedVarvariable: 54
index: 57
53IndexedVarvariable: 55
index: 57
54Variable
55Variable
56ExprTuple57
57Variable