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 summation_closure
In [2]:
# check that the built expression is the same as the stored expression
assert summation_closure.expr == stored_expr
assert summation_closure.expr._style_id == stored_expr._style_id
print("Passed sanity check: summation_closure matches stored_expr")
Passed sanity check: summation_closure matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{j \in \mathbb{N}^+}~\left[\forall_{K, f, Q}~\left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~\left(f\left(b_{1}, b_{2}, \ldots, b_{j}\right) \in V\right)\right] \Rightarrow  \\ \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] \in V\right) \end{array} \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: 26
operand: 2
1ExprTuple2
2Lambdaparameter: 51
body: 4
3ExprTuple51
4Conditionalvalue: 5
condition: 6
5Operationoperator: 26
operand: 9
6Operationoperator: 39
operands: 8
7ExprTuple9
8ExprTuple51, 10
9Lambdaparameters: 11
body: 12
10Literal
11ExprTuple33, 45, 46
12Operationoperator: 26
operand: 14
13ExprTuple14
14Lambdaparameter: 42
body: 16
15ExprTuple42
16Conditionalvalue: 17
condition: 18
17Operationoperator: 19
operands: 20
18Operationoperator: 21
operands: 22
19Literal
20ExprTuple23, 24
21Literal
22ExprTuple42, 25
23Operationoperator: 26
operand: 31
24Operationoperator: 39
operands: 28
25Operationoperator: 29
operand: 33
26Literal
27ExprTuple31
28ExprTuple32, 42
29Literal
30ExprTuple33
31Lambdaparameters: 47
body: 34
32Operationoperator: 35
operand: 38
33Variable
34Conditionalvalue: 37
condition: 44
35Literal
36ExprTuple38
37Operationoperator: 39
operands: 40
38Lambdaparameters: 47
body: 41
39Literal
40ExprTuple43, 42
41Conditionalvalue: 43
condition: 44
42Variable
43Operationoperator: 45
operands: 47
44Operationoperator: 46
operands: 47
45Variable
46Variable
47ExprTuple48
48ExprRangelambda_map: 49
start_index: 50
end_index: 51
49Lambdaparameter: 55
body: 52
50Literal
51Variable
52IndexedVarvariable: 53
index: 55
53Variable
54ExprTuple55
55Variable