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_split_first
In [2]:
# check that the built expression is the same as the stored expression
assert vec_sum_split_first.expr == stored_expr
assert vec_sum_split_first.expr._style_id == stored_expr._style_id
print("Passed sanity check: vec_sum_split_first matches stored_expr")
Passed sanity check: vec_sum_split_first matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{v}~\left[\forall_{a, b \in \mathbb{Z}~|~a < b}~\left(\left(\sum_{i=a}^{b} v\left(i\right)\right) = \left(v\left(a\right) + \left(\sum_{i=a + 1}^{b} v\left(i\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: 5
operand: 2
1ExprTuple2
2Lambdaparameter: 42
body: 4
3ExprTuple42
4Operationoperator: 5
operand: 7
5Literal
6ExprTuple7
7Lambdaparameters: 41
body: 8
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operands: 12
10Operationoperator: 13
operands: 14
11Literal
12ExprTuple15, 16
13Literal
14ExprTuple17, 18, 19
15Operationoperator: 32
operand: 26
16Operationoperator: 21
operands: 22
17Operationoperator: 44
operands: 23
18Operationoperator: 44
operands: 24
19Operationoperator: 25
operands: 41
20ExprTuple26
21Literal
22ExprTuple27, 28
23ExprTuple54, 29
24ExprTuple51, 29
25Literal
26Lambdaparameter: 46
body: 30
27Operationoperator: 42
operand: 54
28Operationoperator: 32
operand: 35
29Literal
30Conditionalvalue: 39
condition: 34
31ExprTuple54
32Literal
33ExprTuple35
34Operationoperator: 44
operands: 36
35Lambdaparameter: 46
body: 37
36ExprTuple46, 38
37Conditionalvalue: 39
condition: 40
38Operationoperator: 48
operands: 41
39Operationoperator: 42
operand: 46
40Operationoperator: 44
operands: 45
41ExprTuple54, 51
42Variable
43ExprTuple46
44Literal
45ExprTuple46, 47
46Variable
47Operationoperator: 48
operands: 49
48Literal
49ExprTuple50, 51
50Operationoperator: 52
operands: 53
51Variable
52Literal
53ExprTuple54, 55
54Variable
55Literal