logo

Expression of type ExprTuple

from the theory of proveit.core_expr_types.tuples

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 ExprRange, ExprTuple, Variable, j
from proveit.numbers import Add, Exp, e, four, three, two
In [2]:
# build up the expression from sub-expressions
sub_expr1 = Variable("_a", latex_format = r"{_{-}a}")
expr = ExprTuple([ExprRange(sub_expr1, Exp(e, Add(sub_expr1, j)), two, four)], [Exp(e, Add(two, j)), Exp(e, Add(three, j)), Exp(e, Add(four, j))])
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(\mathsf{e}^{2 + j}, \mathsf{e}^{3 + j}, \ldots, \mathsf{e}^{4 + j}\right), \left(\mathsf{e}^{2 + j}, \mathsf{e}^{3 + j}, \mathsf{e}^{4 + j}\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
1ExprTuple3
2ExprTuple4, 5, 6
3ExprRangelambda_map: 7
start_index: 23
end_index: 25
4Operationoperator: 16
operands: 8
5Operationoperator: 16
operands: 9
6Operationoperator: 16
operands: 10
7Lambdaparameter: 28
body: 12
8ExprTuple21, 13
9ExprTuple21, 14
10ExprTuple21, 15
11ExprTuple28
12Operationoperator: 16
operands: 17
13Operationoperator: 26
operands: 18
14Operationoperator: 26
operands: 19
15Operationoperator: 26
operands: 20
16Literal
17ExprTuple21, 22
18ExprTuple23, 29
19ExprTuple24, 29
20ExprTuple25, 29
21Literal
22Operationoperator: 26
operands: 27
23Literal
24Literal
25Literal
26Literal
27ExprTuple28, 29
28Variable
29Variable