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 multi_vec_add_def
In [2]:
# check that the built expression is the same as the stored expression
assert multi_vec_add_def.expr == stored_expr
assert multi_vec_add_def.expr._style_id == stored_expr._style_id
print("Passed sanity check: multi_vec_add_def matches stored_expr")
Passed sanity check: multi_vec_add_def 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_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{x_{1}, x_{2}, \ldots, x_{n}, y \in V}~\\
\left(\left(x_{1} +  x_{2} +  \ldots +  x_{n} + y\right) = \left(\left(x_{1} +  x_{2} +  \ldots +  x_{n}\right) + y\right)\right)\end{array}\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: 50
body: 7
6ExprTuple50
7Conditionalvalue: 8
condition: 9
8Operationoperator: 22
operand: 13
9Operationoperator: 11
operands: 12
10ExprTuple13
11Literal
12ExprTuple50, 14
13Lambdaparameter: 53
body: 16
14Operationoperator: 17
operand: 21
15ExprTuple53
16Conditionalvalue: 19
condition: 20
17Literal
18ExprTuple21
19Operationoperator: 22
operand: 25
20Operationoperator: 47
operands: 24
21Variable
22Literal
23ExprTuple25
24ExprTuple53, 26
25Lambdaparameters: 38
body: 27
26Literal
27Conditionalvalue: 28
condition: 29
28Operationoperator: 30
operands: 31
29Operationoperator: 32
operands: 33
30Literal
31ExprTuple34, 35
32Literal
33ExprTuple36, 37
34Operationoperator: 45
operands: 38
35Operationoperator: 45
operands: 39
36ExprRangelambda_map: 40
start_index: 52
end_index: 53
37Operationoperator: 47
operands: 41
38ExprTuple49, 44
39ExprTuple42, 44
40Lambdaparameter: 57
body: 43
41ExprTuple44, 50
42Operationoperator: 45
operands: 46
43Operationoperator: 47
operands: 48
44Variable
45Literal
46ExprTuple49
47Literal
48ExprTuple54, 50
49ExprRangelambda_map: 51
start_index: 52
end_index: 53
50Variable
51Lambdaparameter: 57
body: 54
52Literal
53Variable
54IndexedVarvariable: 55
index: 57
55Variable
56ExprTuple57
57Variable