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, 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)])])
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)\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
3ExprRangelambda_map: 12
start_index: 47
end_index: 13
4Operationoperator: 30
operand: 47
5Operationoperator: 30
operand: 23
6Operationoperator: 30
operand: 24
7Operationoperator: 30
operand: 25
8Operationoperator: 30
operand: 26
9Operationoperator: 30
operand: 27
10Operationoperator: 30
operand: 28
11Operationoperator: 30
operand: 29
12Lambdaparameter: 40
body: 22
13Variable
14ExprTuple47
15ExprTuple23
16ExprTuple24
17ExprTuple25
18ExprTuple26
19ExprTuple27
20ExprTuple28
21ExprTuple29
22Operationoperator: 30
operand: 40
23Operationoperator: 38
operands: 32
24Operationoperator: 38
operands: 33
25Operationoperator: 38
operands: 34
26Operationoperator: 38
operands: 35
27Operationoperator: 38
operands: 36
28Operationoperator: 38
operands: 37
29Operationoperator: 38
operands: 39
30Variable
31ExprTuple40
32ExprTuple47, 41
33ExprTuple47, 42
34ExprTuple47, 43
35ExprTuple47, 44
36ExprTuple47, 45
37ExprTuple47, 46
38Literal
39ExprTuple47, 48
40Variable
41Literal
42Literal
43Literal
44Literal
45Literal
46Literal
47Variable
48Literal