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 ExprTuple, K, Lambda, V, n
from proveit.linear_algebra import TensorExp, VecSpaces
from proveit.logic import CartExp, Forall, SubsetEq
from proveit.numbers import NaturalPos
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Lambda(K, Forall(instance_param_or_params = [n], instance_expr = Forall(instance_param_or_params = [V], instance_expr = SubsetEq(TensorExp(V, n), CartExp(V, n)), domain = VecSpaces(K)), domain = 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(K \mapsto \left[\forall_{n \in \mathbb{N}^+}~\left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left(V^{\otimes n} \subseteq V^{n}\right)\right]\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
1Lambdaparameter: 33
body: 2
2Operationoperator: 9
operand: 4
3ExprTuple4
4Lambdaparameter: 32
body: 6
5ExprTuple32
6Conditionalvalue: 7
condition: 8
7Operationoperator: 9
operand: 13
8Operationoperator: 11
operands: 12
9Literal
10ExprTuple13
11Literal
12ExprTuple32, 14
13Lambdaparameter: 31
body: 16
14Literal
15ExprTuple31
16Conditionalvalue: 17
condition: 18
17Operationoperator: 19
operands: 20
18Operationoperator: 21
operands: 22
19Literal
20ExprTuple23, 24
21Literal
22ExprTuple31, 25
23Operationoperator: 26
operands: 28
24Operationoperator: 27
operands: 28
25Operationoperator: 29
operand: 33
26Literal
27Literal
28ExprTuple31, 32
29Literal
30ExprTuple33
31Variable
32Variable
33Variable