logo

Expression of type SetOfAll

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
from proveit.linear_algebra import lin_comb_axn
from proveit.logic import SetOfAll
In [2]:
# build up the expression from sub-expressions
expr = 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\{\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}
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 4
body: 5
4ExprTuple6
5Conditionalvalue: 7
condition: 8
6ExprRangelambda_map: 9
start_index: 18
end_index: 19
7Operationoperator: 10
operands: 11
8Operationoperator: 12
operands: 13
9Lambdaparameter: 32
body: 27
10Literal
11ExprTuple14
12Literal
13ExprTuple15
14ExprRangelambda_map: 16
start_index: 18
end_index: 19
15ExprRangelambda_map: 17
start_index: 18
end_index: 19
16Lambdaparameter: 32
body: 20
17Lambdaparameter: 32
body: 21
18Literal
19Variable
20Operationoperator: 22
operands: 23
21Operationoperator: 24
operands: 25
22Literal
23ExprTuple27, 26
24Literal
25ExprTuple27, 28
26IndexedVarvariable: 29
index: 32
27IndexedVarvariable: 30
index: 32
28Variable
29Variable
30Variable
31ExprTuple32
32Variable