logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.vector_sets

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
from proveit.core_expr_types import a_1_to_n, x_1_to_n
from proveit.linear_algebra import Span, lin_comb_axn
from proveit.logic import Set, SetOfAll
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Span(Set(x_1_to_n)), SetOfAll(instance_param_or_params = [a_1_to_n], instance_element = lin_comb_axn, domain = K))
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(\textrm{Span}\left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\}\right), \left\{\left(a_{1} \cdot x_{1}\right) +  \left(a_{2} \cdot x_{2}\right) +  \ldots +  \left(a_{n} \cdot x_{n}\right)\right\}_{a_{1}, a_{2}, \ldots, a_{n} \in K}\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
wrap_positionsposition(s) at which wrapping is to occur; 'n' is after the nth comma.()()('with_wrapping_at',)
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'leftleft('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1, 2
1Operationoperator: 3
operand: 7
2Operationoperator: 5
operand: 8
3Literal
4ExprTuple7
5Literal
6ExprTuple8
7Operationoperator: 9
operands: 10
8Lambdaparameters: 11
body: 12
9Literal
10ExprTuple13
11ExprTuple14
12Conditionalvalue: 15
condition: 16
13ExprRangelambda_map: 17
start_index: 27
end_index: 28
14ExprRangelambda_map: 18
start_index: 27
end_index: 28
15Operationoperator: 19
operands: 20
16Operationoperator: 21
operands: 22
17Lambdaparameter: 41
body: 35
18Lambdaparameter: 41
body: 36
19Literal
20ExprTuple23
21Literal
22ExprTuple24
23ExprRangelambda_map: 25
start_index: 27
end_index: 28
24ExprRangelambda_map: 26
start_index: 27
end_index: 28
25Lambdaparameter: 41
body: 29
26Lambdaparameter: 41
body: 30
27Literal
28Variable
29Operationoperator: 31
operands: 32
30Operationoperator: 33
operands: 34
31Literal
32ExprTuple36, 35
33Literal
34ExprTuple36, 37
35IndexedVarvariable: 38
index: 41
36IndexedVarvariable: 39
index: 41
37Variable
38Variable
39Variable
40ExprTuple41
41Variable