logo

Expression of type Lambda

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 K, Lambda, V, m, n
from proveit.linear_algebra import TensorExp, VecSpaces
from proveit.logic import CartExp, Forall, SubsetEq
from proveit.numbers import Mult, NaturalPos
In [2]:
# build up the expression from sub-expressions
expr = Lambda(K, Forall(instance_param_or_params = [m, n], instance_expr = Forall(instance_param_or_params = [V], instance_expr = SubsetEq(TensorExp(CartExp(V, m), n), CartExp(V, Mult(m, 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())
K \mapsto \left[\forall_{m, n \in \mathbb{N}^+}~\left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left((V^{m})^{\otimes n} \subseteq V^{m \cdot n}\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
0Lambdaparameter: 36
body: 1
1Operationoperator: 7
operand: 3
2ExprTuple3
3Lambdaparameters: 40
body: 4
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple12, 13
11Lambdaparameter: 41
body: 15
12Operationoperator: 17
operands: 16
13Operationoperator: 17
operands: 18
14ExprTuple41
15Conditionalvalue: 19
condition: 20
16ExprTuple42, 21
17Literal
18ExprTuple43, 21
19Operationoperator: 22
operands: 23
20Operationoperator: 24
operands: 25
21Literal
22Literal
23ExprTuple26, 27
24Literal
25ExprTuple41, 28
26Operationoperator: 29
operands: 30
27Operationoperator: 37
operands: 31
28Operationoperator: 32
operand: 36
29Literal
30ExprTuple34, 43
31ExprTuple41, 35
32Literal
33ExprTuple36
34Operationoperator: 37
operands: 38
35Operationoperator: 39
operands: 40
36Variable
37Literal
38ExprTuple41, 42
39Literal
40ExprTuple42, 43
41Variable
42Variable
43Variable