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 subtraction_disassociation
In [2]:
# check that the built expression is the same as the stored expression
assert subtraction_disassociation.expr == stored_expr
assert subtraction_disassociation.expr._style_id == stored_expr._style_id
print("Passed sanity check: subtraction_disassociation matches stored_expr")
Passed sanity check: subtraction_disassociation 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_{1}, b_{2}, \ldots, b_{j}, c_{1}, c_{2}, \ldots, c_{k} \in \mathbb{C}}~\left(\begin{array}{c} \begin{array}{l} \left(a_{1} +  a_{2} +  \ldots +  a_{i} - \left(b_{1} +  b_{2} +  \ldots +  b_{j}\right)+ c_{1} +  c_{2} +  \ldots +  c_{k}\right) =  \\ \left(a_{1} +  a_{2} +  \ldots +  a_{i}- b_{1} -  b_{2} -  \ldots -  b_{j}+ c_{1} +  c_{2} +  \ldots +  c_{k}\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: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple45, 67, 48
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 24
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12, 13
10Lambdaparameters: 14
body: 15
11Operationoperator: 51
operands: 16
12Operationoperator: 51
operands: 17
13Operationoperator: 51
operands: 18
14ExprTuple37, 64, 39
15Conditionalvalue: 19
condition: 20
16ExprTuple45, 21
17ExprTuple67, 21
18ExprTuple48, 21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Literal
22Literal
23ExprTuple26, 27
24Literal
25ExprTuple28, 29, 30
26Operationoperator: 58
operands: 31
27Operationoperator: 58
operands: 32
28ExprRangelambda_map: 33
start_index: 66
end_index: 45
29ExprRangelambda_map: 34
start_index: 66
end_index: 67
30ExprRangelambda_map: 35
start_index: 66
end_index: 48
31ExprTuple37, 36, 39
32ExprTuple37, 38, 39
33Lambdaparameter: 71
body: 40
34Lambdaparameter: 71
body: 41
35Lambdaparameter: 71
body: 42
36Operationoperator: 60
operand: 53
37ExprRangelambda_map: 44
start_index: 66
end_index: 45
38ExprRangelambda_map: 46
start_index: 66
end_index: 67
39ExprRangelambda_map: 47
start_index: 66
end_index: 48
40Operationoperator: 51
operands: 49
41Operationoperator: 51
operands: 50
42Operationoperator: 51
operands: 52
43ExprTuple53
44Lambdaparameter: 71
body: 55
45Variable
46Lambdaparameter: 71
body: 54
47Lambdaparameter: 71
body: 56
48Variable
49ExprTuple55, 57
50ExprTuple68, 57
51Literal
52ExprTuple56, 57
53Operationoperator: 58
operands: 59
54Operationoperator: 60
operand: 68
55IndexedVarvariable: 62
index: 71
56IndexedVarvariable: 63
index: 71
57Literal
58Literal
59ExprTuple64
60Literal
61ExprTuple68
62Variable
63Variable
64ExprRangelambda_map: 65
start_index: 66
end_index: 67
65Lambdaparameter: 71
body: 68
66Literal
67Variable
68IndexedVarvariable: 69
index: 71
69Variable
70ExprTuple71
71Variable