logo

Expression of type Equals

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 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 = Equals(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()).with_wrapping_at(2)
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())
\begin{array}{c} \begin{array}{l} \left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{LinDepSets}\left(V\right)\right) =  \\ \left[\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] \end{array} \end{array}
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
operation'infix' or 'function' style formattinginfixinfix
wrap_positionsposition(s) at which wrapping is to occur; '2 n - 1' is after the nth operand, '2 n' is after the nth operation.()(2)('with_wrapping_at', 'with_wrap_before_operator', 'with_wrap_after_operator', 'without_wrapping', 'wrap_positions')
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'centercenter('with_justification',)
directionDirection of the relation (normal or reversed)normalnormal('with_direction_reversed', 'is_reversed')
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 21
operands: 1
1ExprTuple2, 3
2Operationoperator: 41
operands: 4
3Operationoperator: 5
operand: 9
4ExprTuple7, 8
5Literal
6ExprTuple9
7Operationoperator: 10
operands: 11
8Operationoperator: 12
operand: 37
9Lambdaparameters: 13
body: 14
10Literal
11ExprTuple15
12Literal
13ExprTuple16
14Conditionalvalue: 17
condition: 18
15ExprRangelambda_map: 19
start_index: 44
end_index: 45
16ExprRangelambda_map: 20
start_index: 44
end_index: 45
17Operationoperator: 21
operands: 22
18Operationoperator: 23
operands: 24
19Lambdaparameter: 59
body: 53
20Lambdaparameter: 59
body: 54
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple27, 28
25Operationoperator: 29
operands: 30
26Operationoperator: 31
operand: 37
27ExprRangelambda_map: 33
start_index: 44
end_index: 45
28Operationoperator: 34
operands: 35
29Literal
30ExprTuple36
31Literal
32ExprTuple37
33Lambdaparameter: 59
body: 38
34Literal
35ExprTuple39
36ExprRangelambda_map: 40
start_index: 44
end_index: 45
37Variable
38Operationoperator: 41
operands: 42
39ExprRangelambda_map: 43
start_index: 44
end_index: 45
40Lambdaparameter: 59
body: 46
41Literal
42ExprTuple54, 47
43Lambdaparameter: 59
body: 48
44Literal
45Variable
46Operationoperator: 49
operands: 50
47Variable
48Operationoperator: 51
operands: 52
49Literal
50ExprTuple54, 53
51Literal
52ExprTuple54, 55
53IndexedVarvariable: 56
index: 59
54IndexedVarvariable: 57
index: 59
55Literal
56Variable
57Variable
58ExprTuple59
59Variable