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_rev
In [2]:
# check that the built expression is the same as the stored expression
assert add_cancel_general_rev.expr == stored_expr
assert add_cancel_general_rev.expr._style_id == stored_expr._style_id
print("Passed sanity check: add_cancel_general_rev matches stored_expr")
Passed sanity check: add_cancel_general_rev 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}}~\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
3ExprTuple52, 54, 57
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 24
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12, 13
10Lambdaparameters: 14
body: 15
11Operationoperator: 60
operands: 16
12Operationoperator: 60
operands: 17
13Operationoperator: 60
operands: 18
14ExprTuple42, 62, 43, 47, 44
15Conditionalvalue: 19
condition: 20
16ExprTuple52, 21
17ExprTuple54, 21
18ExprTuple57, 21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Literal
22Literal
23ExprTuple26, 27
24Literal
25ExprTuple28, 29, 30, 31, 32
26Operationoperator: 34
operands: 33
27Operationoperator: 34
operands: 35
28ExprRangelambda_map: 36
start_index: 56
end_index: 52
29Operationoperator: 60
operands: 37
30ExprRangelambda_map: 38
start_index: 56
end_index: 54
31Operationoperator: 60
operands: 39
32ExprRangelambda_map: 40
start_index: 56
end_index: 57
33ExprTuple42, 41, 43, 47, 44
34Literal
35ExprTuple42, 43, 44
36Lambdaparameter: 71
body: 45
37ExprTuple62, 66
38Lambdaparameter: 71
body: 46
39ExprTuple47, 66
40Lambdaparameter: 71
body: 48
41Operationoperator: 49
operand: 62
42ExprRangelambda_map: 51
start_index: 56
end_index: 52
43ExprRangelambda_map: 53
start_index: 56
end_index: 54
44ExprRangelambda_map: 55
start_index: 56
end_index: 57
45Operationoperator: 60
operands: 58
46Operationoperator: 60
operands: 59
47Variable
48Operationoperator: 60
operands: 61
49Literal
50ExprTuple62
51Lambdaparameter: 71
body: 63
52Variable
53Lambdaparameter: 71
body: 64
54Variable
55Lambdaparameter: 71
body: 65
56Literal
57Variable
58ExprTuple63, 66
59ExprTuple64, 66
60Literal
61ExprTuple65, 66
62Variable
63IndexedVarvariable: 67
index: 71
64IndexedVarvariable: 68
index: 71
65IndexedVarvariable: 69
index: 71
66Literal
67Variable
68Variable
69Variable
70ExprTuple71
71Variable