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, i, j, k
from proveit.numbers import Add, Exp, e, four, one, 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)), i, k)], [Exp(e, Add(i, j)), Exp(e, Add(Add(i, one), j)), Exp(e, Add(Add(i, two), j)), Exp(e, Add(Add(i, three), j)), Exp(e, Add(Add(i, 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}^{i + j}, \mathsf{e}^{\left(i + 1\right) + j}, \ldots, \mathsf{e}^{k + j}\right), \left(\mathsf{e}^{i + j}, \mathsf{e}^{\left(i + 1\right) + j}, \mathsf{e}^{\left(i + 2\right) + j}, \mathsf{e}^{\left(i + 3\right) + j}, \mathsf{e}^{\left(i + 4\right) + 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, 7, 8
3ExprRangelambda_map: 9
start_index: 47
end_index: 10
4Operationoperator: 23
operands: 11
5Operationoperator: 23
operands: 12
6Operationoperator: 23
operands: 13
7Operationoperator: 23
operands: 14
8Operationoperator: 23
operands: 15
9Lambdaparameter: 42
body: 17
10Variable
11ExprTuple30, 18
12ExprTuple30, 19
13ExprTuple30, 20
14ExprTuple30, 21
15ExprTuple30, 22
16ExprTuple42
17Operationoperator: 23
operands: 24
18Operationoperator: 40
operands: 25
19Operationoperator: 40
operands: 26
20Operationoperator: 40
operands: 27
21Operationoperator: 40
operands: 28
22Operationoperator: 40
operands: 29
23Literal
24ExprTuple30, 31
25ExprTuple47, 43
26ExprTuple32, 43
27ExprTuple33, 43
28ExprTuple34, 43
29ExprTuple35, 43
30Literal
31Operationoperator: 40
operands: 36
32Operationoperator: 40
operands: 37
33Operationoperator: 40
operands: 38
34Operationoperator: 40
operands: 39
35Operationoperator: 40
operands: 41
36ExprTuple42, 43
37ExprTuple47, 44
38ExprTuple47, 45
39ExprTuple47, 46
40Literal
41ExprTuple47, 48
42Variable
43Variable
44Literal
45Literal
46Literal
47Variable
48Literal