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, eight, 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)]), Function(f, [Add(i, eight)]))
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), f\left(i + 8\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
1Operationoperator: 18
operand: 44
2Operationoperator: 18
operand: 20
3Operationoperator: 18
operand: 21
4Operationoperator: 18
operand: 22
5Operationoperator: 18
operand: 23
6Operationoperator: 18
operand: 24
7Operationoperator: 18
operand: 25
8Operationoperator: 18
operand: 26
9Operationoperator: 18
operand: 27
10ExprTuple44
11ExprTuple20
12ExprTuple21
13ExprTuple22
14ExprTuple23
15ExprTuple24
16ExprTuple25
17ExprTuple26
18Variable
19ExprTuple27
20Operationoperator: 35
operands: 28
21Operationoperator: 35
operands: 29
22Operationoperator: 35
operands: 30
23Operationoperator: 35
operands: 31
24Operationoperator: 35
operands: 32
25Operationoperator: 35
operands: 33
26Operationoperator: 35
operands: 34
27Operationoperator: 35
operands: 36
28ExprTuple44, 37
29ExprTuple44, 38
30ExprTuple44, 39
31ExprTuple44, 40
32ExprTuple44, 41
33ExprTuple44, 42
34ExprTuple44, 43
35Literal
36ExprTuple44, 45
37Literal
38Literal
39Literal
40Literal
41Literal
42Literal
43Literal
44Variable
45Literal