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 number_summation_reduction
In [2]:
# check that the built expression is the same as the stored expression
assert number_summation_reduction.expr == stored_expr
assert number_summation_reduction.expr._style_id == stored_expr._style_id
print("Passed sanity check: number_summation_reduction matches stored_expr")
Passed sanity check: number_summation_reduction matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, Q}~\left[\forall_{n, j \in \mathbb{N}^+}~\left[\forall_{x_{1}, x_{2}, \ldots, x_{n} \in \mathbb{C}}~\left(\left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~f\left(b_{1}, b_{2}, \ldots, b_{j}\right)\right] = \left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~f\left(b_{1}, b_{2}, \ldots, b_{j}\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: 11
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple47, 48
4Operationoperator: 11
operand: 6
5ExprTuple6
6Lambdaparameters: 7
body: 8
7ExprTuple37, 54
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operand: 14
10Operationoperator: 28
operands: 13
11Literal
12ExprTuple14
13ExprTuple15, 16
14Lambdaparameters: 17
body: 18
15Operationoperator: 41
operands: 19
16Operationoperator: 41
operands: 20
17ExprTuple21
18Conditionalvalue: 22
condition: 23
19ExprTuple37, 24
20ExprTuple54, 24
21ExprRangelambda_map: 25
start_index: 53
end_index: 37
22Operationoperator: 26
operands: 27
23Operationoperator: 28
operands: 29
24Literal
25Lambdaparameter: 58
body: 45
26Literal
27ExprTuple30, 31
28Literal
29ExprTuple32
30Operationoperator: 33
operand: 38
31Operationoperator: 34
operand: 38
32ExprRangelambda_map: 36
start_index: 53
end_index: 37
33Literal
34Literal
35ExprTuple38
36Lambdaparameter: 58
body: 39
37Variable
38Lambdaparameters: 49
body: 40
39Operationoperator: 41
operands: 42
40Conditionalvalue: 43
condition: 44
41Literal
42ExprTuple45, 46
43Operationoperator: 47
operands: 49
44Operationoperator: 48
operands: 49
45IndexedVarvariable: 50
index: 58
46Literal
47Variable
48Variable
49ExprTuple51
50Variable
51ExprRangelambda_map: 52
start_index: 53
end_index: 54
52Lambdaparameter: 58
body: 55
53Literal
54Variable
55IndexedVarvariable: 56
index: 58
56Variable
57ExprTuple58
58Variable