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 leftward_permutation
In [2]:
# check that the built expression is the same as the stored expression
assert leftward_permutation.expr == stored_expr
assert leftward_permutation.expr._style_id == stored_expr._style_id
print("Passed sanity check: leftward_permutation matches stored_expr")
Passed sanity check: leftward_permutation 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, d_{1}, d_{2}, \ldots, d_{k} \in V}~\left(\begin{array}{c} \begin{array}{l} \left(a_{1} +  a_{2} +  \ldots +  a_{i}+ b_{1} +  b_{2} +  \ldots +  b_{j} + c+ d_{1} +  d_{2} +  \ldots +  d_{k}\right) =  \\ \left(a_{1} +  a_{2} +  \ldots +  a_{i} + c+ b_{1} +  b_{2} +  \ldots +  b_{j}+ d_{1} +  d_{2} +  \ldots +  d_{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: 74
body: 7
6ExprTuple74
7Conditionalvalue: 8
condition: 9
8Operationoperator: 22
operand: 13
9Operationoperator: 11
operands: 12
10ExprTuple13
11Literal
12ExprTuple74, 14
13Lambdaparameters: 15
body: 16
14Operationoperator: 17
operand: 21
15ExprTuple61, 63, 66
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: 69
operands: 30
27Operationoperator: 69
operands: 31
28Operationoperator: 69
operands: 32
29Conditionalvalue: 33
condition: 34
30ExprTuple61, 35
31ExprTuple63, 35
32ExprTuple66, 35
33Operationoperator: 36
operands: 37
34Operationoperator: 38
operands: 39
35Literal
36Literal
37ExprTuple40, 41
38Literal
39ExprTuple42, 43, 44, 45
40Operationoperator: 47
operands: 46
41Operationoperator: 47
operands: 48
42ExprRangelambda_map: 49
start_index: 65
end_index: 61
43ExprRangelambda_map: 50
start_index: 65
end_index: 63
44Operationoperator: 69
operands: 51
45ExprRangelambda_map: 52
start_index: 65
end_index: 66
46ExprTuple53, 54, 58, 55
47Literal
48ExprTuple53, 58, 54, 55
49Lambdaparameter: 79
body: 56
50Lambdaparameter: 79
body: 57
51ExprTuple58, 74
52Lambdaparameter: 79
body: 59
53ExprRangelambda_map: 60
start_index: 65
end_index: 61
54ExprRangelambda_map: 62
start_index: 65
end_index: 63
55ExprRangelambda_map: 64
start_index: 65
end_index: 66
56Operationoperator: 69
operands: 67
57Operationoperator: 69
operands: 68
58Variable
59Operationoperator: 69
operands: 70
60Lambdaparameter: 79
body: 71
61Variable
62Lambdaparameter: 79
body: 72
63Variable
64Lambdaparameter: 79
body: 73
65Literal
66Variable
67ExprTuple71, 74
68ExprTuple72, 74
69Literal
70ExprTuple73, 74
71IndexedVarvariable: 75
index: 79
72IndexedVarvariable: 76
index: 79
73IndexedVarvariable: 77
index: 79
74Variable
75Variable
76Variable
77Variable
78ExprTuple79
79Variable