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.scalar_multiplication import factorization_from_scalars
In [2]:
# check that the built expression is the same as the stored expression
assert factorization_from_scalars.expr == stored_expr
assert factorization_from_scalars.expr._style_id == stored_expr._style_id
print("Passed sanity check: factorization_from_scalars matches stored_expr")
Passed sanity check: factorization_from_scalars 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_{i \in \mathbb{N}}~\left[\forall_{\left(a_{1} \in \mathbb{C}\right), \left(a_{2} \in \mathbb{C}\right), \ldots, \left(a_{i} \in \mathbb{C}\right), v \in V}~\left(\begin{array}{c} \begin{array}{l} \left(\left(a_{1} \cdot v\right) +  \left(a_{2} \cdot v\right) +  \ldots +  \left(a_{i} \cdot v\right)\right) =  \\ \left(\left(a_{1} +  a_{2} +  \ldots +  a_{i}\right) \cdot v\right) \end{array} \end{array}\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: 22
operand: 2
1ExprTuple2
2Lambdaparameter: 21
body: 3
3Operationoperator: 22
operand: 5
4ExprTuple5
5Lambdaparameter: 46
body: 7
6ExprTuple46
7Conditionalvalue: 8
condition: 9
8Operationoperator: 22
operand: 13
9Operationoperator: 11
operands: 12
10ExprTuple13
11Literal
12ExprTuple46, 14
13Lambdaparameter: 59
body: 16
14Operationoperator: 17
operand: 21
15ExprTuple59
16Conditionalvalue: 19
condition: 20
17Literal
18ExprTuple21
19Operationoperator: 22
operand: 25
20Operationoperator: 50
operands: 24
21Variable
22Literal
23ExprTuple25
24ExprTuple59, 26
25Lambdaparameters: 27
body: 28
26Literal
27ExprTuple53, 60
28Conditionalvalue: 29
condition: 30
29Operationoperator: 31
operands: 32
30Operationoperator: 33
operands: 34
31Literal
32ExprTuple35, 36
33Literal
34ExprTuple37, 38
35Operationoperator: 48
operands: 39
36Operationoperator: 55
operands: 40
37ExprRangelambda_map: 41
start_index: 58
end_index: 59
38Operationoperator: 50
operands: 42
39ExprTuple43
40ExprTuple44, 60
41Lambdaparameter: 64
body: 45
42ExprTuple60, 46
43ExprRangelambda_map: 47
start_index: 58
end_index: 59
44Operationoperator: 48
operands: 49
45Operationoperator: 50
operands: 51
46Variable
47Lambdaparameter: 64
body: 52
48Literal
49ExprTuple53
50Literal
51ExprTuple61, 54
52Operationoperator: 55
operands: 56
53ExprRangelambda_map: 57
start_index: 58
end_index: 59
54Literal
55Literal
56ExprTuple61, 60
57Lambdaparameter: 64
body: 61
58Literal
59Variable
60Variable
61IndexedVarvariable: 62
index: 64
62Variable
63ExprTuple64
64Variable