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.numbers.addition.subtraction import add_cancel_general
In [2]:
# check that the built expression is the same as the stored expression
assert add_cancel_general.expr == stored_expr
assert add_cancel_general.expr._style_id == stored_expr._style_id
print("Passed sanity check: add_cancel_general matches stored_expr")
Passed sanity check: add_cancel_general matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{i, j, k \in \mathbb{N}}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{i}, b, c_{1}, c_{2}, \ldots, c_{j}, d, e_{1}, e_{2}, \ldots, e_{k} \in \mathbb{C}~|~b = d}~\left(\left(a_{1} +  a_{2} +  \ldots +  a_{i} + b+ c_{1} +  c_{2} +  \ldots +  c_{j} - d+ e_{1} +  e_{2} +  \ldots +  e_{k}\right) = \left(a_{1} +  a_{2} +  \ldots +  a_{i}+ c_{1} +  c_{2} +  \ldots +  c_{j}+ e_{1} +  e_{2} +  \ldots +  e_{k}\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
2Lambdaparameters: 3
body: 4
3ExprTuple54, 56, 59
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 23
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12, 13
10Lambdaparameters: 14
body: 15
11Operationoperator: 62
operands: 16
12Operationoperator: 62
operands: 17
13Operationoperator: 62
operands: 18
14ExprTuple44, 50, 45, 64, 46
15Conditionalvalue: 19
condition: 20
16ExprTuple54, 21
17ExprTuple56, 21
18ExprTuple59, 21
19Operationoperator: 41
operands: 22
20Operationoperator: 23
operands: 24
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple27, 28, 29, 30, 31, 32
25Operationoperator: 34
operands: 33
26Operationoperator: 34
operands: 35
27ExprRangelambda_map: 36
start_index: 58
end_index: 54
28Operationoperator: 62
operands: 37
29ExprRangelambda_map: 38
start_index: 58
end_index: 56
30Operationoperator: 62
operands: 39
31ExprRangelambda_map: 40
start_index: 58
end_index: 59
32Operationoperator: 41
operands: 42
33ExprTuple44, 50, 45, 43, 46
34Literal
35ExprTuple44, 45, 46
36Lambdaparameter: 73
body: 47
37ExprTuple50, 68
38Lambdaparameter: 73
body: 48
39ExprTuple64, 68
40Lambdaparameter: 73
body: 49
41Literal
42ExprTuple50, 64
43Operationoperator: 51
operand: 64
44ExprRangelambda_map: 53
start_index: 58
end_index: 54
45ExprRangelambda_map: 55
start_index: 58
end_index: 56
46ExprRangelambda_map: 57
start_index: 58
end_index: 59
47Operationoperator: 62
operands: 60
48Operationoperator: 62
operands: 61
49Operationoperator: 62
operands: 63
50Variable
51Literal
52ExprTuple64
53Lambdaparameter: 73
body: 65
54Variable
55Lambdaparameter: 73
body: 66
56Variable
57Lambdaparameter: 73
body: 67
58Literal
59Variable
60ExprTuple65, 68
61ExprTuple66, 68
62Literal
63ExprTuple67, 68
64Variable
65IndexedVarvariable: 69
index: 73
66IndexedVarvariable: 70
index: 73
67IndexedVarvariable: 71
index: 73
68Literal
69Variable
70Variable
71Variable
72ExprTuple73
73Variable