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.linear_algebra.addition import disassociation
In [2]:
# check that the built expression is the same as the stored expression
assert disassociation.expr == stored_expr
assert disassociation.expr._style_id == stored_expr._style_id
print("Passed sanity check: disassociation matches stored_expr")
Passed sanity check: disassociation matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{K}~\left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left[\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 V}~\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]\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: 22
operand: 2
1ExprTuple2
2Lambdaparameter: 21
body: 3
3Operationoperator: 22
operand: 5
4ExprTuple5
5Lambdaparameter: 69
body: 7
6ExprTuple69
7Conditionalvalue: 8
condition: 9
8Operationoperator: 22
operand: 13
9Operationoperator: 11
operands: 12
10ExprTuple13
11Literal
12ExprTuple69, 14
13Lambdaparameters: 15
body: 16
14Operationoperator: 17
operand: 21
15ExprTuple59, 72, 61
16Conditionalvalue: 19
condition: 20
17Literal
18ExprTuple21
19Operationoperator: 22
operand: 25
20Operationoperator: 38
operands: 24
21Variable
22Literal
23ExprTuple25
24ExprTuple26, 27, 28
25Lambdaparameters: 46
body: 29
26Operationoperator: 64
operands: 30
27Operationoperator: 64
operands: 31
28Operationoperator: 64
operands: 32
29Conditionalvalue: 33
condition: 34
30ExprTuple59, 35
31ExprTuple72, 35
32ExprTuple61, 35
33Operationoperator: 36
operands: 37
34Operationoperator: 38
operands: 39
35Literal
36Literal
37ExprTuple40, 41
38Literal
39ExprTuple42, 43, 44
40Operationoperator: 56
operands: 45
41Operationoperator: 56
operands: 46
42ExprRangelambda_map: 47
start_index: 71
end_index: 59
43ExprRangelambda_map: 48
start_index: 71
end_index: 72
44ExprRangelambda_map: 49
start_index: 71
end_index: 61
45ExprTuple51, 50, 52
46ExprTuple51, 66, 52
47Lambdaparameter: 78
body: 53
48Lambdaparameter: 78
body: 54
49Lambdaparameter: 78
body: 55
50Operationoperator: 56
operands: 57
51ExprRangelambda_map: 58
start_index: 71
end_index: 59
52ExprRangelambda_map: 60
start_index: 71
end_index: 61
53Operationoperator: 64
operands: 62
54Operationoperator: 64
operands: 63
55Operationoperator: 64
operands: 65
56Literal
57ExprTuple66
58Lambdaparameter: 78
body: 67
59Variable
60Lambdaparameter: 78
body: 68
61Variable
62ExprTuple67, 69
63ExprTuple75, 69
64Literal
65ExprTuple68, 69
66ExprRangelambda_map: 70
start_index: 71
end_index: 72
67IndexedVarvariable: 73
index: 78
68IndexedVarvariable: 74
index: 78
69Variable
70Lambdaparameter: 78
body: 75
71Literal
72Variable
73Variable
74Variable
75IndexedVarvariable: 76
index: 78
76Variable
77ExprTuple78
78Variable