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, i
from proveit.core_expr_types import V_1_to_i
from proveit.linear_algebra import TensorProd, VecSpaces
from proveit.logic import Forall, InClass
from proveit.numbers import NaturalPos
In [2]:
# build up the expression from sub-expressions
sub_expr1 = VecSpaces(K)
expr = Lambda(K, Forall(instance_param_or_params = [i], instance_expr = Forall(instance_param_or_params = [V_1_to_i], instance_expr = InClass(TensorProd(V_1_to_i), sub_expr1), domain = sub_expr1), 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_{i \in \mathbb{N}^+}~\left[\forall_{V_{1}, V_{2}, \ldots, V_{i} \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left(\left(V_{1} {\otimes}  V_{2} {\otimes}  \ldots {\otimes}  V_{i}\right) \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\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
0Lambdaparameter: 39
body: 1
1Operationoperator: 8
operand: 3
2ExprTuple3
3Lambdaparameter: 29
body: 5
4ExprTuple29
5Conditionalvalue: 6
condition: 7
6Operationoperator: 8
operand: 12
7Operationoperator: 10
operands: 11
8Literal
9ExprTuple12
10Literal
11ExprTuple29, 13
12Lambdaparameters: 23
body: 14
13Literal
14Conditionalvalue: 15
condition: 16
15Operationoperator: 30
operands: 17
16Operationoperator: 18
operands: 19
17ExprTuple20, 33
18Literal
19ExprTuple21
20Operationoperator: 22
operands: 23
21ExprRangelambda_map: 24
start_index: 28
end_index: 29
22Literal
23ExprTuple25
24Lambdaparameter: 38
body: 26
25ExprRangelambda_map: 27
start_index: 28
end_index: 29
26Operationoperator: 30
operands: 31
27Lambdaparameter: 38
body: 32
28Literal
29Variable
30Literal
31ExprTuple32, 33
32IndexedVarvariable: 34
index: 38
33Operationoperator: 36
operand: 39
34Variable
35ExprTuple38
36Literal
37ExprTuple39
38Variable
39Variable