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
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 Equals, Set, SetOfAll
In [2]:
# build up the expression from sub-expressions
expr = Equals(Span(Set(x_1_to_n)), SetOfAll(instance_param_or_params = [a_1_to_n], instance_element = lin_comb_axn, domain = K)).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} \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} \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: 1
operands: 2
1Literal
2ExprTuple3, 4
3Operationoperator: 5
operand: 9
4Operationoperator: 7
operand: 10
5Literal
6ExprTuple9
7Literal
8ExprTuple10
9Operationoperator: 11
operands: 12
10Lambdaparameters: 13
body: 14
11Literal
12ExprTuple15
13ExprTuple16
14Conditionalvalue: 17
condition: 18
15ExprRangelambda_map: 19
start_index: 29
end_index: 30
16ExprRangelambda_map: 20
start_index: 29
end_index: 30
17Operationoperator: 21
operands: 22
18Operationoperator: 23
operands: 24
19Lambdaparameter: 43
body: 37
20Lambdaparameter: 43
body: 38
21Literal
22ExprTuple25
23Literal
24ExprTuple26
25ExprRangelambda_map: 27
start_index: 29
end_index: 30
26ExprRangelambda_map: 28
start_index: 29
end_index: 30
27Lambdaparameter: 43
body: 31
28Lambdaparameter: 43
body: 32
29Literal
30Variable
31Operationoperator: 33
operands: 34
32Operationoperator: 35
operands: 36
33Literal
34ExprTuple38, 37
35Literal
36ExprTuple38, 39
37IndexedVarvariable: 40
index: 43
38IndexedVarvariable: 41
index: 43
39Variable
40Variable
41Variable
42ExprTuple43
43Variable