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 VecZero
from proveit.logic import CartExp, Forall, 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 = 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_expr2), NotEquals(z, sub_expr2), 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))
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)\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
1Operationoperator: 51
operands: 15
2Operationoperator: 51
operands: 16
3Operationoperator: 51
operands: 17
4Operationoperator: 51
operands: 18
5Operationoperator: 51
operands: 19
6Operationoperator: 51
operands: 20
7Operationoperator: 22
operands: 21
8Operationoperator: 22
operands: 23
9Operationoperator: 51
operands: 24
10Operationoperator: 51
operands: 25
11Operationoperator: 51
operands: 26
12Operationoperator: 51
operands: 27
13Operationoperator: 51
operands: 28
14Operationoperator: 29
operand: 44
15ExprTuple31, 54
16ExprTuple32, 54
17ExprTuple33, 54
18ExprTuple35, 54
19ExprTuple34, 54
20ExprTuple36, 54
21ExprTuple35, 37
22Literal
23ExprTuple36, 37
24ExprTuple38, 61
25ExprTuple39, 40
26ExprTuple41, 61
27ExprTuple42, 61
28ExprTuple43, 61
29Literal
30ExprTuple44
31Variable
32Variable
33Variable
34Variable
35Variable
36Variable
37Operationoperator: 45
operand: 54
38Variable
39Variable
40Literal
41Variable
42Variable
43Variable
44Lambdaparameter: 60
body: 47
45Literal
46ExprTuple54
47Conditionalvalue: 48
condition: 49
48Operationoperator: 51
operands: 50
49Operationoperator: 51
operands: 52
50ExprTuple53, 54
51Literal
52ExprTuple60, 55
53Operationoperator: 56
operand: 60
54Operationoperator: 58
operands: 59
55Literal
56Variable
57ExprTuple60
58Literal
59ExprTuple61, 62
60Variable
61Literal
62Literal