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.core_expr_types import f_i_to_j
from proveit.numbers import Add, eight, five, four, one, seven, six, three, two
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple([f_i_to_j], [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(\left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(j\right)\right), \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)\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, 9, 10, 11, 12
3ExprRangelambda_map: 13
start_index: 52
end_index: 14
4Operationoperator: 33
operand: 52
5Operationoperator: 33
operand: 25
6Operationoperator: 33
operand: 26
7Operationoperator: 33
operand: 27
8Operationoperator: 33
operand: 28
9Operationoperator: 33
operand: 29
10Operationoperator: 33
operand: 30
11Operationoperator: 33
operand: 31
12Operationoperator: 33
operand: 32
13Lambdaparameter: 44
body: 24
14Variable
15ExprTuple52
16ExprTuple25
17ExprTuple26
18ExprTuple27
19ExprTuple28
20ExprTuple29
21ExprTuple30
22ExprTuple31
23ExprTuple32
24Operationoperator: 33
operand: 44
25Operationoperator: 42
operands: 35
26Operationoperator: 42
operands: 36
27Operationoperator: 42
operands: 37
28Operationoperator: 42
operands: 38
29Operationoperator: 42
operands: 39
30Operationoperator: 42
operands: 40
31Operationoperator: 42
operands: 41
32Operationoperator: 42
operands: 43
33Variable
34ExprTuple44
35ExprTuple52, 45
36ExprTuple52, 46
37ExprTuple52, 47
38ExprTuple52, 48
39ExprTuple52, 49
40ExprTuple52, 50
41ExprTuple52, 51
42Literal
43ExprTuple52, 53
44Variable
45Literal
46Literal
47Literal
48Literal
49Literal
50Literal
51Literal
52Variable
53Literal