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_cart_exps_within_cart_exp
In [2]:
# check that the built expression is the same as the stored expression
assert tensor_prod_of_cart_exps_within_cart_exp.expr == stored_expr
assert tensor_prod_of_cart_exps_within_cart_exp.expr._style_id == stored_expr._style_id
print("Passed sanity check: tensor_prod_of_cart_exps_within_cart_exp matches stored_expr")
Passed sanity check: tensor_prod_of_cart_exps_within_cart_exp 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_{m \in \mathbb{N}^+}~\left[\forall_{n_{1}, n_{2}, \ldots, n_{m} \in \mathbb{N}^+}~\left(\left(K^{n_{1}} {\otimes}  K^{n_{2}} {\otimes}  \ldots {\otimes}  K^{n_{m}}\right) \subseteq K^{n_{1} \cdot  n_{2} \cdot  \ldots \cdot  n_{m}}\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: 11
operand: 2
1ExprTuple2
2Lambdaparameter: 45
body: 4
3ExprTuple45
4Operationoperator: 11
operand: 6
5ExprTuple6
6Lambdaparameter: 44
body: 8
7ExprTuple44
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operand: 14
10Operationoperator: 35
operands: 13
11Literal
12ExprTuple14
13ExprTuple44, 39
14Lambdaparameters: 34
body: 15
15Conditionalvalue: 16
condition: 17
16Operationoperator: 18
operands: 19
17Operationoperator: 20
operands: 21
18Literal
19ExprTuple22, 23
20Literal
21ExprTuple24
22Operationoperator: 25
operands: 26
23Operationoperator: 40
operands: 27
24ExprRangelambda_map: 28
start_index: 43
end_index: 44
25Literal
26ExprTuple29
27ExprTuple45, 30
28Lambdaparameter: 49
body: 31
29ExprRangelambda_map: 32
start_index: 43
end_index: 44
30Operationoperator: 33
operands: 34
31Operationoperator: 35
operands: 36
32Lambdaparameter: 49
body: 37
33Literal
34ExprTuple38
35Literal
36ExprTuple46, 39
37Operationoperator: 40
operands: 41
38ExprRangelambda_map: 42
start_index: 43
end_index: 44
39Literal
40Literal
41ExprTuple45, 46
42Lambdaparameter: 49
body: 46
43Literal
44Variable
45Variable
46IndexedVarvariable: 47
index: 49
47Variable
48ExprTuple49
49Variable