logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra.tensors

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, a, alpha, beta, delta, fi, gamma, i, u, v, w, x, y, z
from proveit.linear_algebra import VecSpaces, VecZero
from proveit.logic import CartExp, Forall, InClass, InSet, NotEquals
from proveit.numbers import Complex, Natural, Real, three
In [2]:
# build up the expression from sub-expressions
sub_expr1 = CartExp(Real, three)
sub_expr2 = VecSpaces(Real)
sub_expr3 = VecZero(sub_expr1)
expr = ExprTuple(InSet(u, sub_expr1), InSet(v, sub_expr1), InSet(w, sub_expr1), InSet(x, sub_expr1), InSet(y, sub_expr1), InSet(z, sub_expr1), NotEquals(x, sub_expr3), NotEquals(z, sub_expr3), InSet(a, Real), InSet(alpha, Complex), InSet(beta, Real), InSet(gamma, Real), InSet(delta, Real), Forall(instance_param_or_params = [i], instance_expr = InSet(fi, sub_expr1), domain = Natural), InClass(fi, sub_expr2), InClass(x, sub_expr2))
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(u \in \mathbb{R}^{3}, v \in \mathbb{R}^{3}, w \in \mathbb{R}^{3}, x \in \mathbb{R}^{3}, y \in \mathbb{R}^{3}, z \in \mathbb{R}^{3}, x \neq \vec{0}\left(\mathbb{R}^{3}\right), z \neq \vec{0}\left(\mathbb{R}^{3}\right), a \in \mathbb{R}, \alpha \in \mathbb{C}, \beta \in \mathbb{R}, \gamma \in \mathbb{R}, \delta \in \mathbb{R}, \forall_{i \in \mathbb{N}}~\left(f\left(i\right) \in \mathbb{R}^{3}\right), f\left(i\right) \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(\mathbb{R}\right), x \underset{{\scriptscriptstyle c}}{\in} \textrm{VecSpaces}\left(\mathbb{R}\right)\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
wrap_positionsposition(s) at which wrapping is to occur; 'n' is after the nth comma.()()('with_wrapping_at',)
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'leftleft('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
1Operationoperator: 59
operands: 17
2Operationoperator: 59
operands: 18
3Operationoperator: 59
operands: 19
4Operationoperator: 59
operands: 20
5Operationoperator: 59
operands: 21
6Operationoperator: 59
operands: 22
7Operationoperator: 24
operands: 23
8Operationoperator: 24
operands: 25
9Operationoperator: 59
operands: 26
10Operationoperator: 59
operands: 27
11Operationoperator: 59
operands: 28
12Operationoperator: 59
operands: 29
13Operationoperator: 59
operands: 30
14Operationoperator: 31
operand: 48
15Operationoperator: 34
operands: 33
16Operationoperator: 34
operands: 35
17ExprTuple36, 62
18ExprTuple37, 62
19ExprTuple38, 62
20ExprTuple49, 62
21ExprTuple39, 62
22ExprTuple40, 62
23ExprTuple49, 41
24Literal
25ExprTuple40, 41
26ExprTuple42, 69
27ExprTuple43, 44
28ExprTuple45, 69
29ExprTuple46, 69
30ExprTuple47, 69
31Literal
32ExprTuple48
33ExprTuple61, 50
34Literal
35ExprTuple49, 50
36Variable
37Variable
38Variable
39Variable
40Variable
41Operationoperator: 51
operand: 62
42Variable
43Variable
44Literal
45Variable
46Variable
47Variable
48Lambdaparameter: 68
body: 53
49Variable
50Operationoperator: 54
operand: 69
51Literal
52ExprTuple62
53Conditionalvalue: 56
condition: 57
54Literal
55ExprTuple69
56Operationoperator: 59
operands: 58
57Operationoperator: 59
operands: 60
58ExprTuple61, 62
59Literal
60ExprTuple68, 63
61Operationoperator: 64
operand: 68
62Operationoperator: 66
operands: 67
63Literal
64Variable
65ExprTuple68
66Literal
67ExprTuple69, 70
68Variable
69Literal
70Literal