logo

Expression of type ExprTuple

from the theory of proveit.linear_algebra

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, b, c, u, v, w, x, y, z
from proveit.logic import CartExp, InSet
from proveit.numbers import Real, three
In [2]:
# build up the expression from sub-expressions
sub_expr1 = CartExp(Real, three)
expr = ExprTuple(InSet(a, Real), InSet(b, Real), InSet(c, Real), InSet(u, sub_expr1), InSet(v, sub_expr1), InSet(w, sub_expr1), InSet(x, sub_expr1), InSet(y, sub_expr1), InSet(z, sub_expr1))
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(a \in \mathbb{R}, b \in \mathbb{R}, c \in \mathbb{R}, 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}\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
1Operationoperator: 18
operands: 10
2Operationoperator: 18
operands: 11
3Operationoperator: 18
operands: 12
4Operationoperator: 18
operands: 13
5Operationoperator: 18
operands: 14
6Operationoperator: 18
operands: 15
7Operationoperator: 18
operands: 16
8Operationoperator: 18
operands: 17
9Operationoperator: 18
operands: 19
10ExprTuple20, 32
11ExprTuple21, 32
12ExprTuple22, 32
13ExprTuple23, 29
14ExprTuple24, 29
15ExprTuple25, 29
16ExprTuple26, 29
17ExprTuple27, 29
18Literal
19ExprTuple28, 29
20Variable
21Variable
22Variable
23Variable
24Variable
25Variable
26Variable
27Variable
28Variable
29Operationoperator: 30
operands: 31
30Literal
31ExprTuple32, 33
32Literal
33Literal