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, Lambda, V, n
from proveit.core_expr_types import x_1_to_n
from proveit.linear_algebra import Bases, LinDepSets, SpanningSets, VecSpaces
from proveit.logic import And, Equals, Forall, InSet, NotInSet, Set
from proveit.numbers import NaturalPos
In [2]:
# build up the expression from sub-expressions
sub_expr1 = Set(x_1_to_n)
expr = ExprTuple(Lambda(K, Forall(instance_param_or_params = [V], instance_expr = Forall(instance_param_or_params = [n], instance_expr = Forall(instance_param_or_params = [x_1_to_n], instance_expr = Equals(InSet(sub_expr1, Bases(V)), And(InSet(sub_expr1, SpanningSets(V)), NotInSet(sub_expr1, LinDepSets(V))).with_wrapping_at(2)).with_wrapping_at(2), domain = V).with_wrapping(), domain = NaturalPos), domain = VecSpaces(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(K \mapsto \left[\forall_{V \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(K\right)}~\left[\forall_{n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{x_{1}, x_{2}, \ldots, x_{n} \in V}~\\
\left(\begin{array}{c} \begin{array}{l} \left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{Bases}\left(V\right)\right) =  \\ \left(\begin{array}{c} \left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \in \textrm{SpanningSets}\left(V\right)\right) \land  \\ \left(\left\{x_{1}, x_{2}, \ldots, x_{n}\right\} \notin \textrm{LinDepSets}\left(V\right)\right) \end{array}\right) \end{array} \end{array}\right)\end{array}\right]\right]\right]\right)
In [5]:
stored_expr.style_options()
no style options
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1
1Lambdaparameter: 19
body: 2
2Operationoperator: 20
operand: 4
3ExprTuple4
4Lambdaparameter: 57
body: 5
5Conditionalvalue: 6
condition: 7
6Operationoperator: 20
operand: 11
7Operationoperator: 9
operands: 10
8ExprTuple11
9Literal
10ExprTuple57, 12
11Lambdaparameter: 60
body: 14
12Operationoperator: 15
operand: 19
13ExprTuple60
14Conditionalvalue: 17
condition: 18
15Literal
16ExprTuple19
17Operationoperator: 20
operand: 23
18Operationoperator: 46
operands: 22
19Variable
20Literal
21ExprTuple23
22ExprTuple60, 24
23Lambdaparameters: 53
body: 25
24Literal
25Conditionalvalue: 26
condition: 27
26Operationoperator: 28
operands: 29
27Operationoperator: 35
operands: 30
28Literal
29ExprTuple31, 32
30ExprTuple33
31Operationoperator: 46
operands: 34
32Operationoperator: 35
operands: 36
33ExprRangelambda_map: 37
start_index: 59
end_index: 60
34ExprTuple49, 38
35Literal
36ExprTuple39, 40
37Lambdaparameter: 64
body: 41
38Operationoperator: 42
operand: 57
39Operationoperator: 46
operands: 43
40Operationoperator: 44
operands: 45
41Operationoperator: 46
operands: 47
42Literal
43ExprTuple49, 48
44Literal
45ExprTuple49, 50
46Literal
47ExprTuple61, 57
48Operationoperator: 51
operand: 57
49Operationoperator: 52
operands: 53
50Operationoperator: 54
operand: 57
51Literal
52Literal
53ExprTuple56
54Literal
55ExprTuple57
56ExprRangelambda_map: 58
start_index: 59
end_index: 60
57Variable
58Lambdaparameter: 64
body: 61
59Literal
60Variable
61IndexedVarvariable: 62
index: 64
62Variable
63ExprTuple64
64Variable