logo

Expression of type ExprTuple

from the theory of proveit.numbers.multiplication

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, delta, k, theta
from proveit.numbers import Add, Exp, Mult, e, i, pi, two
In [2]:
# build up the expression from sub-expressions
sub_expr1 = Add(a, b)
sub_expr2 = Mult(two, pi, i, delta)
sub_expr3 = Mult(two, pi, i, theta)
sub_expr4 = Exp(e, Mult(two, pi, i, b))
expr = ExprTuple(Mult(sub_expr1, Exp(Mult(Exp(e, sub_expr2), Exp(e, sub_expr3)), k), sub_expr4), Mult(sub_expr1, Exp(e, Mult(Add(sub_expr2, sub_expr3), k)), sub_expr4))
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(\left(a + b\right) \cdot \left(\mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot \delta} \cdot \mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot \theta}\right)^{k} \cdot \mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot b}, \left(a + b\right) \cdot \mathsf{e}^{\left(\left(2 \cdot \pi \cdot \mathsf{i} \cdot \delta\right) + \left(2 \cdot \pi \cdot \mathsf{i} \cdot \theta\right)\right) \cdot k} \cdot \mathsf{e}^{2 \cdot \pi \cdot \mathsf{i} \cdot b}\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
1Operationoperator: 34
operands: 3
2Operationoperator: 34
operands: 4
3ExprTuple6, 5, 8
4ExprTuple6, 7, 8
5Operationoperator: 26
operands: 9
6Operationoperator: 28
operands: 10
7Operationoperator: 26
operands: 11
8Operationoperator: 26
operands: 12
9ExprTuple13, 23
10ExprTuple14, 24
11ExprTuple30, 15
12ExprTuple30, 16
13Operationoperator: 34
operands: 17
14Variable
15Operationoperator: 34
operands: 18
16Operationoperator: 34
operands: 19
17ExprTuple20, 21
18ExprTuple22, 23
19ExprTuple37, 38, 39, 24
20Operationoperator: 26
operands: 25
21Operationoperator: 26
operands: 27
22Operationoperator: 28
operands: 29
23Variable
24Variable
25ExprTuple30, 31
26Literal
27ExprTuple30, 32
28Literal
29ExprTuple31, 32
30Literal
31Operationoperator: 34
operands: 33
32Operationoperator: 34
operands: 35
33ExprTuple37, 38, 39, 36
34Literal
35ExprTuple37, 38, 39, 40
36Variable
37Literal
38Literal
39Literal
40Variable