logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.tensors

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import Conditional, ExprTuple, K, Lambda, V, m, n
from proveit.linear_algebra import TensorExp, VecSpaces
from proveit.logic import And, CartExp, Forall, InSet, SubsetEq
from proveit.numbers import Mult, NaturalPos
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda([m, n], Conditional(Forall(instance_param_or_params = [V], instance_expr = SubsetEq(TensorExp(CartExp(V, m), n), CartExp(V, Mult(m, n))), domain = VecSpaces(K)), And(InSet(m, NaturalPos), InSet(n, NaturalPos)))))
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left(\left(m, n\right) \mapsto \left\{\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left((V^{m})^{\otimes n} \subseteq V^{m \cdot n}\right) \textrm{ if } m \in \mathbb{N}^+ ,  n \in \mathbb{N}^+\right..\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameters: 38
body: 2
2Conditionalvalue: 3
condition: 4
3Operationoperator: 5
operand: 9
4Operationoperator: 7
operands: 8
5Literal
6ExprTuple9
7Literal
8ExprTuple10, 11
9Lambdaparameter: 39
body: 13
10Operationoperator: 15
operands: 14
11Operationoperator: 15
operands: 16
12ExprTuple39
13Conditionalvalue: 17
condition: 18
14ExprTuple40, 19
15Literal
16ExprTuple41, 19
17Operationoperator: 20
operands: 21
18Operationoperator: 22
operands: 23
19Literal
20Literal
21ExprTuple24, 25
22Literal
23ExprTuple39, 26
24Operationoperator: 27
operands: 28
25Operationoperator: 35
operands: 29
26Operationoperator: 30
operand: 34
27Literal
28ExprTuple32, 41
29ExprTuple39, 33
30Literal
31ExprTuple34
32Operationoperator: 35
operands: 36
33Operationoperator: 37
operands: 38
34Variable
35Literal
36ExprTuple39, 40
37Literal
38ExprTuple40, 41
39Variable
40Variable
41Variable