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 norm_of_tensor_prod
In [2]:
# check that the built expression is the same as the stored expression
assert norm_of_tensor_prod.expr == stored_expr
assert norm_of_tensor_prod.expr._style_id == stored_expr._style_id
print("Passed sanity check: norm_of_tensor_prod matches stored_expr")
Passed sanity check: norm_of_tensor_prod 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_{i \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{V_{1}, V_{2}, \ldots, V_{i} \underset{{\scriptscriptstyle c}}{\in} \textrm{InnerProdSpaces}\left(K\right)}~\\
\left[\begin{array}{l}\forall_{\left(a_{1} \in V_{1}\right), \left(a_{2} \in V_{2}\right), \ldots, \left(a_{i} \in V_{i}\right)}~\\
\left(\left \|a_{1} {\otimes}  a_{2} {\otimes}  \ldots {\otimes}  a_{i}\right \| = \left(\left \|a_{1}\right \| \cdot  \left \|a_{2}\right \| \cdot  \ldots \cdot  \left \|a_{i}\right \|\right)\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: 20
operand: 2
1ExprTuple2
2Lambdaparameter: 49
body: 3
3Operationoperator: 20
operand: 5
4ExprTuple5
5Lambdaparameter: 60
body: 7
6ExprTuple60
7Conditionalvalue: 8
condition: 9
8Operationoperator: 20
operand: 12
9Operationoperator: 53
operands: 11
10ExprTuple12
11ExprTuple60, 13
12Lambdaparameters: 14
body: 15
13Literal
14ExprTuple16
15Conditionalvalue: 17
condition: 18
16ExprRangelambda_map: 19
start_index: 59
end_index: 60
17Operationoperator: 20
operand: 23
18Operationoperator: 32
operands: 22
19Lambdaparameter: 67
body: 57
20Literal
21ExprTuple23
22ExprTuple24
23Lambdaparameters: 51
body: 25
24ExprRangelambda_map: 26
start_index: 59
end_index: 60
25Conditionalvalue: 27
condition: 28
26Lambdaparameter: 67
body: 29
27Operationoperator: 30
operands: 31
28Operationoperator: 32
operands: 33
29Operationoperator: 34
operands: 35
30Literal
31ExprTuple36, 37
32Literal
33ExprTuple38
34Literal
35ExprTuple57, 39
36Operationoperator: 61
operand: 46
37Operationoperator: 41
operands: 42
38ExprRangelambda_map: 43
start_index: 59
end_index: 60
39Operationoperator: 44
operand: 49
40ExprTuple46
41Literal
42ExprTuple47
43Lambdaparameter: 67
body: 48
44Literal
45ExprTuple49
46Operationoperator: 50
operands: 51
47ExprRangelambda_map: 52
start_index: 59
end_index: 60
48Operationoperator: 53
operands: 54
49Variable
50Literal
51ExprTuple55
52Lambdaparameter: 67
body: 56
53Literal
54ExprTuple64, 57
55ExprRangelambda_map: 58
start_index: 59
end_index: 60
56Operationoperator: 61
operand: 64
57IndexedVarvariable: 63
index: 67
58Lambdaparameter: 67
body: 64
59Literal
60Variable
61Literal
62ExprTuple64
63Variable
64IndexedVarvariable: 65
index: 67
65Variable
66ExprTuple67
67Variable