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, V
from proveit.core_expr_types import a_1_to_n, x_1_to_n
from proveit.linear_algebra import LinDepSets, VecZero, lin_comb_axn, some_nonzero_a
from proveit.logic import Equals, Exists, InSet, Set
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(InSet(Set(x_1_to_n), LinDepSets(V)), Exists(instance_param_or_params = [a_1_to_n], instance_expr = Equals(lin_comb_axn, VecZero(V)), domain = K, condition = some_nonzero_a).with_wrapping())
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\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{LinDepSets}\left(V\right), \begin{array}{l}\exists_{a_{1}, a_{2}, \ldots, a_{n} \in K~|~\left(a_{1} \neq 0\right) \lor  \left(a_{2} \neq 0\right) \lor  \ldots \lor  \left(a_{n} \neq 0\right)}~\\
\left(\left(\left(a_{1} \cdot x_{1}\right) +  \left(a_{2} \cdot x_{2}\right) +  \ldots +  \left(a_{n} \cdot x_{n}\right)\right) = \vec{0}\left(V\right)\right)\end{array}\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: 40
operands: 3
2Operationoperator: 4
operand: 8
3ExprTuple6, 7
4Literal
5ExprTuple8
6Operationoperator: 9
operands: 10
7Operationoperator: 11
operand: 36
8Lambdaparameters: 12
body: 13
9Literal
10ExprTuple14
11Literal
12ExprTuple15
13Conditionalvalue: 16
condition: 17
14ExprRangelambda_map: 18
start_index: 43
end_index: 44
15ExprRangelambda_map: 19
start_index: 43
end_index: 44
16Operationoperator: 20
operands: 21
17Operationoperator: 22
operands: 23
18Lambdaparameter: 58
body: 52
19Lambdaparameter: 58
body: 53
20Literal
21ExprTuple24, 25
22Literal
23ExprTuple26, 27
24Operationoperator: 28
operands: 29
25Operationoperator: 30
operand: 36
26ExprRangelambda_map: 32
start_index: 43
end_index: 44
27Operationoperator: 33
operands: 34
28Literal
29ExprTuple35
30Literal
31ExprTuple36
32Lambdaparameter: 58
body: 37
33Literal
34ExprTuple38
35ExprRangelambda_map: 39
start_index: 43
end_index: 44
36Variable
37Operationoperator: 40
operands: 41
38ExprRangelambda_map: 42
start_index: 43
end_index: 44
39Lambdaparameter: 58
body: 45
40Literal
41ExprTuple53, 46
42Lambdaparameter: 58
body: 47
43Literal
44Variable
45Operationoperator: 48
operands: 49
46Variable
47Operationoperator: 50
operands: 51
48Literal
49ExprTuple53, 52
50Literal
51ExprTuple53, 54
52IndexedVarvariable: 55
index: 58
53IndexedVarvariable: 56
index: 58
54Literal
55Variable
56Variable
57ExprTuple58
58Variable