logo

Expression of type ExprTuple

from the theory of proveit.numbers.numerals.decimals

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, Function, f, i
from proveit.numbers import Add, five, four, one, seven, six, three, two
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(Function(f, [i]), Function(f, [Add(i, one)]), Function(f, [Add(i, two)]), Function(f, [Add(i, three)]), Function(f, [Add(i, four)]), Function(f, [Add(i, five)]), Function(f, [Add(i, six)]), Function(f, [Add(i, seven)]))
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(f\left(i\right), f\left(i + 1\right), f\left(i + 2\right), f\left(i + 3\right), f\left(i + 4\right), f\left(i + 5\right), f\left(i + 6\right), f\left(i + 7\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
1Operationoperator: 16
operand: 39
2Operationoperator: 16
operand: 18
3Operationoperator: 16
operand: 19
4Operationoperator: 16
operand: 20
5Operationoperator: 16
operand: 21
6Operationoperator: 16
operand: 22
7Operationoperator: 16
operand: 23
8Operationoperator: 16
operand: 24
9ExprTuple39
10ExprTuple18
11ExprTuple19
12ExprTuple20
13ExprTuple21
14ExprTuple22
15ExprTuple23
16Variable
17ExprTuple24
18Operationoperator: 31
operands: 25
19Operationoperator: 31
operands: 26
20Operationoperator: 31
operands: 27
21Operationoperator: 31
operands: 28
22Operationoperator: 31
operands: 29
23Operationoperator: 31
operands: 30
24Operationoperator: 31
operands: 32
25ExprTuple39, 33
26ExprTuple39, 34
27ExprTuple39, 35
28ExprTuple39, 36
29ExprTuple39, 37
30ExprTuple39, 38
31Literal
32ExprTuple39, 40
33Literal
34Literal
35Literal
36Literal
37Literal
38Literal
39Variable
40Literal