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_of_linear_maps
In [2]:
# check that the built expression is the same as the stored expression
assert tensor_prod_of_linear_maps.expr == stored_expr
assert tensor_prod_of_linear_maps.expr._style_id == stored_expr._style_id
print("Passed sanity check: tensor_prod_of_linear_maps matches stored_expr")
Passed sanity check: tensor_prod_of_linear_maps 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_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{V_{1}, V_{2}, \ldots, V_{n}, W_{1}, W_{2}, \ldots, W_{n} \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\\
\left[\begin{array}{l}\forall_{\left(A_{1} \in \mathcal{L}\left(V_{1}, W_{1}\right)\right), \left(A_{2} \in \mathcal{L}\left(V_{2}, W_{2}\right)\right), \ldots, \left(A_{n} \in \mathcal{L}\left(V_{n}, W_{n}\right)\right)}~\\
\left[\begin{array}{l}\forall_{\left(v_{1} \in V_{1}\right), \left(v_{2} \in V_{2}\right), \ldots, \left(v_{n} \in V_{n}\right)}~\\
\left(\left(A_{1} {\otimes}  A_{2} {\otimes}  \ldots {\otimes}  A_{n}\right)\left(v_{1} {\otimes}  v_{2} {\otimes}  \ldots {\otimes}  v_{n}\right) = \left(A_{1}\left(v_{1}\right) {\otimes}  A_{2}\left(v_{2}\right) {\otimes}  \ldots {\otimes}  A_{n}\left(v_{n}\right)\right)\right)\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: 34
operand: 2
1ExprTuple2
2Lambdaparameter: 50
body: 3
3Operationoperator: 34
operand: 5
4ExprTuple5
5Lambdaparameter: 84
body: 7
6ExprTuple84
7Conditionalvalue: 8
condition: 9
8Operationoperator: 34
operand: 12
9Operationoperator: 75
operands: 11
10ExprTuple12
11ExprTuple84, 13
12Lambdaparameters: 14
body: 15
13Literal
14ExprTuple16, 17
15Conditionalvalue: 18
condition: 19
16ExprRangelambda_map: 20
start_index: 83
end_index: 84
17ExprRangelambda_map: 21
start_index: 83
end_index: 84
18Operationoperator: 34
operand: 24
19Operationoperator: 53
operands: 23
20Lambdaparameter: 92
body: 81
21Lambdaparameter: 92
body: 70
22ExprTuple24
23ExprTuple25, 26
24Lambdaparameters: 66
body: 27
25ExprRangelambda_map: 28
start_index: 83
end_index: 84
26ExprRangelambda_map: 29
start_index: 83
end_index: 84
27Conditionalvalue: 30
condition: 31
28Lambdaparameter: 92
body: 32
29Lambdaparameter: 92
body: 33
30Operationoperator: 34
operand: 40
31Operationoperator: 53
operands: 36
32Operationoperator: 38
operands: 37
33Operationoperator: 38
operands: 39
34Literal
35ExprTuple40
36ExprTuple41
37ExprTuple81, 42
38Literal
39ExprTuple70, 42
40Lambdaparameters: 73
body: 43
41ExprRangelambda_map: 44
start_index: 83
end_index: 84
42Operationoperator: 45
operand: 50
43Conditionalvalue: 47
condition: 48
44Lambdaparameter: 92
body: 49
45Literal
46ExprTuple50
47Operationoperator: 51
operands: 52
48Operationoperator: 53
operands: 54
49Operationoperator: 75
operands: 55
50Variable
51Literal
52ExprTuple56, 57
53Literal
54ExprTuple58
55ExprTuple85, 59
56Operationoperator: 60
operand: 67
57Operationoperator: 72
operands: 62
58ExprRangelambda_map: 63
start_index: 83
end_index: 84
59Operationoperator: 64
operands: 65
60Operationoperator: 72
operands: 66
61ExprTuple67
62ExprTuple68
63Lambdaparameter: 92
body: 69
64Literal
65ExprTuple81, 70
66ExprTuple71
67Operationoperator: 72
operands: 73
68ExprRangelambda_map: 74
start_index: 83
end_index: 84
69Operationoperator: 75
operands: 76
70IndexedVarvariable: 77
index: 92
71ExprRangelambda_map: 78
start_index: 83
end_index: 84
72Literal
73ExprTuple79
74Lambdaparameter: 92
body: 80
75Literal
76ExprTuple89, 81
77Variable
78Lambdaparameter: 92
body: 85
79ExprRangelambda_map: 82
start_index: 83
end_index: 84
80Operationoperator: 85
operand: 89
81IndexedVarvariable: 87
index: 92
82Lambdaparameter: 92
body: 89
83Literal
84Variable
85IndexedVarvariable: 88
index: 92
86ExprTuple89
87Variable
88Variable
89IndexedVarvariable: 90
index: 92
90Variable
91ExprTuple92
92Variable