logo

Expression of type Exists

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
from proveit.linear_algebra import VecZero, lin_comb_axn, some_nonzero_a
from proveit.logic import Equals, Exists
In [2]:
# build up the expression from sub-expressions
expr = 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())
\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}
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneTrue('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: 33
end_index: 34
7Operationoperator: 10
operands: 11
8Operationoperator: 12
operands: 13
9Lambdaparameter: 48
body: 43
10Literal
11ExprTuple14, 15
12Literal
13ExprTuple16, 17
14Operationoperator: 18
operands: 19
15Operationoperator: 20
operand: 26
16ExprRangelambda_map: 22
start_index: 33
end_index: 34
17Operationoperator: 23
operands: 24
18Literal
19ExprTuple25
20Literal
21ExprTuple26
22Lambdaparameter: 48
body: 27
23Literal
24ExprTuple28
25ExprRangelambda_map: 29
start_index: 33
end_index: 34
26Variable
27Operationoperator: 30
operands: 31
28ExprRangelambda_map: 32
start_index: 33
end_index: 34
29Lambdaparameter: 48
body: 35
30Literal
31ExprTuple43, 36
32Lambdaparameter: 48
body: 37
33Literal
34Variable
35Operationoperator: 38
operands: 39
36Variable
37Operationoperator: 40
operands: 41
38Literal
39ExprTuple43, 42
40Literal
41ExprTuple43, 44
42IndexedVarvariable: 45
index: 48
43IndexedVarvariable: 46
index: 48
44Literal
45Variable
46Variable
47ExprTuple48
48Variable