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 vec_sum_of_constant_vec
In [2]:
# check that the built expression is the same as the stored expression
assert vec_sum_of_constant_vec.expr == stored_expr
assert vec_sum_of_constant_vec.expr._style_id == stored_expr._style_id
print("Passed sanity check: vec_sum_of_constant_vec matches stored_expr")
Passed sanity check: vec_sum_of_constant_vec 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_{j, k \in \mathbb{Z}~|~j \leq k}~\left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left[\forall_{v \in V}~\left(\left(\sum_{i=j}^{k} v\right) = \left(\left(\left(k - j\right) + 1\right) \cdot v\right)\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: 24
operand: 2
1ExprTuple2
2Lambdaparameter: 36
body: 3
3Operationoperator: 24
operand: 5
4ExprTuple5
5Lambdaparameters: 64
body: 6
6Conditionalvalue: 7
condition: 8
7Operationoperator: 24
operand: 12
8Operationoperator: 10
operands: 11
9ExprTuple12
10Literal
11ExprTuple13, 14, 15
12Lambdaparameter: 42
body: 17
13Operationoperator: 56
operands: 18
14Operationoperator: 56
operands: 19
15Operationoperator: 20
operands: 64
16ExprTuple42
17Conditionalvalue: 21
condition: 22
18ExprTuple68, 23
19ExprTuple67, 23
20Literal
21Operationoperator: 24
operand: 28
22Operationoperator: 26
operands: 27
23Literal
24Literal
25ExprTuple28
26Literal
27ExprTuple42, 29
28Lambdaparameter: 52
body: 31
29Operationoperator: 32
operand: 36
30ExprTuple52
31Conditionalvalue: 34
condition: 35
32Literal
33ExprTuple36
34Operationoperator: 37
operands: 38
35Operationoperator: 56
operands: 39
36Variable
37Literal
38ExprTuple40, 41
39ExprTuple52, 42
40Operationoperator: 43
operand: 47
41Operationoperator: 45
operands: 46
42Variable
43Literal
44ExprTuple47
45Literal
46ExprTuple48, 52
47Lambdaparameter: 60
body: 50
48Operationoperator: 58
operands: 51
49ExprTuple60
50Conditionalvalue: 52
condition: 53
51ExprTuple54, 55
52Variable
53Operationoperator: 56
operands: 57
54Operationoperator: 58
operands: 59
55Literal
56Literal
57ExprTuple60, 61
58Literal
59ExprTuple67, 62
60Variable
61Operationoperator: 63
operands: 64
62Operationoperator: 65
operand: 68
63Literal
64ExprTuple68, 67
65Literal
66ExprTuple68
67Variable
68Variable