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.tensors import tensor_prod_factorization_from_summation_with_scalar_mult
In [2]:
# check that the built expression is the same as the stored expression
assert tensor_prod_factorization_from_summation_with_scalar_mult.expr == stored_expr
assert tensor_prod_factorization_from_summation_with_scalar_mult.expr._style_id == stored_expr._style_id
print("Passed sanity check: tensor_prod_factorization_from_summation_with_scalar_mult matches stored_expr")
Passed sanity check: tensor_prod_factorization_from_summation_with_scalar_mult matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{K, f, Q, s}~\left[\forall_{i \in \mathbb{N}, j \in \mathbb{N}^+, k \in \mathbb{N}}~\left[\begin{array}{l}\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\\
\left[\begin{array}{l}\forall_{a_{1}, a_{2}, \ldots, a_{i}, c_{1}, c_{2}, \ldots, c_{k}}~\\
\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(\left(a_{1} {\otimes}  a_{2} {\otimes}  \ldots {\otimes}  a_{i} {\otimes} \left(s\left(b_{1}, b_{2}, \ldots, b_{j}\right) \cdot f\left(b_{1}, b_{2}, \ldots, b_{j}\right)\right){\otimes} c_{1} {\otimes}  c_{2} {\otimes}  \ldots {\otimes}  c_{k}\right) \in V\right)\right] \Rightarrow  \\ \left(\begin{array}{c} \begin{array}{l} \left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~\left(s\left(b_{1}, b_{2}, \ldots, b_{j}\right) \cdot \left(a_{1} {\otimes}  a_{2} {\otimes}  \ldots {\otimes}  a_{i} {\otimes} f\left(b_{1}, b_{2}, \ldots, b_{j}\right){\otimes} c_{1} {\otimes}  c_{2} {\otimes}  \ldots {\otimes}  c_{k}\right)\right)\right] \\  = \left(a_{1} {\otimes}  a_{2} {\otimes}  \ldots {\otimes}  a_{i} {\otimes} \left[\sum_{b_{1}, b_{2}, \ldots, b_{j}~|~Q\left(b_{1}, b_{2}, \ldots, b_{j}\right)}~\left(s\left(b_{1}, b_{2}, \ldots, b_{j}\right) \cdot f\left(b_{1}, b_{2}, \ldots, b_{j}\right)\right)\right]{\otimes} c_{1} {\otimes}  c_{2} {\otimes}  \ldots {\otimes}  c_{k}\right) \end{array} \end{array}\right) \end{array} \end{array}\right)\end{array}\right]\end{array}\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: 41
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple38, 83, 73, 82
4Operationoperator: 41
operand: 6
5ExprTuple6
6Lambdaparameters: 7
body: 8
7ExprTuple79, 92, 81
8Conditionalvalue: 9
condition: 10
9Operationoperator: 41
operand: 14
10Operationoperator: 12
operands: 13
11ExprTuple14
12Literal
13ExprTuple15, 16, 17
14Lambdaparameter: 60
body: 19
15Operationoperator: 54
operands: 20
16Operationoperator: 54
operands: 21
17Operationoperator: 54
operands: 22
18ExprTuple60
19Conditionalvalue: 23
condition: 24
20ExprTuple79, 26
21ExprTuple92, 25
22ExprTuple81, 26
23Operationoperator: 41
operand: 30
24Operationoperator: 28
operands: 29
25Literal
26Literal
27ExprTuple30
28Literal
29ExprTuple60, 31
30Lambdaparameters: 32
body: 33
31Operationoperator: 34
operand: 38
32ExprTuple74, 75
33Operationoperator: 36
operands: 37
34Literal
35ExprTuple38
36Literal
37ExprTuple39, 40
38Variable
39Operationoperator: 41
operand: 45
40Operationoperator: 43
operands: 44
41Literal
42ExprTuple45
43Literal
44ExprTuple46, 47
45Lambdaparameters: 84
body: 48
46Operationoperator: 57
operand: 52
47Operationoperator: 69
operands: 50
48Conditionalvalue: 51
condition: 68
49ExprTuple52
50ExprTuple74, 53, 75
51Operationoperator: 54
operands: 55
52Lambdaparameters: 84
body: 56
53Operationoperator: 57
operand: 62
54Literal
55ExprTuple59, 60
56Conditionalvalue: 61
condition: 68
57Literal
58ExprTuple62
59Operationoperator: 69
operands: 63
60Variable
61Operationoperator: 71
operands: 64
62Lambdaparameters: 84
body: 65
63ExprTuple74, 67, 75
64ExprTuple76, 66
65Conditionalvalue: 67
condition: 68
66Operationoperator: 69
operands: 70
67Operationoperator: 71
operands: 72
68Operationoperator: 73
operands: 84
69Literal
70ExprTuple74, 77, 75
71Literal
72ExprTuple76, 77
73Variable
74ExprRangelambda_map: 78
start_index: 91
end_index: 79
75ExprRangelambda_map: 80
start_index: 91
end_index: 81
76Operationoperator: 82
operands: 84
77Operationoperator: 83
operands: 84
78Lambdaparameter: 96
body: 85
79Variable
80Lambdaparameter: 96
body: 86
81Variable
82Variable
83Variable
84ExprTuple87
85IndexedVarvariable: 88
index: 96
86IndexedVarvariable: 89
index: 96
87ExprRangelambda_map: 90
start_index: 91
end_index: 92
88Variable
89Variable
90Lambdaparameter: 96
body: 93
91Literal
92Variable
93IndexedVarvariable: 94
index: 96
94Variable
95ExprTuple96
96Variable