logo
In [1]:
import proveit
# Automation is not needed when only building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_theorem_expr # Load the stored theorem expression as 'stored_expr'
# import the special expression
from proveit.numbers.numerals.decimals import range_8_expansion
In [2]:
# check that the built expression is the same as the stored expression
assert range_8_expansion.expr == stored_expr
assert range_8_expansion.expr._style_id == stored_expr._style_id
print("Passed sanity check: range_8_expansion matches stored_expr")
Passed sanity check: range_8_expansion matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, i, j~|~j = \left(i + 7\right)}~\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 [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 4
body: 5
4ExprTuple40, 57, 23
5Conditionalvalue: 6
condition: 7
6Operationoperator: 9
operands: 8
7Operationoperator: 9
operands: 10
8ExprTuple11, 12
9Literal
10ExprTuple23, 39
11ExprTuple13
12ExprTuple14, 15, 16, 17, 18, 19, 20, 21
13ExprRangelambda_map: 22
start_index: 57
end_index: 23
14Operationoperator: 40
operand: 57
15Operationoperator: 40
operand: 33
16Operationoperator: 40
operand: 34
17Operationoperator: 40
operand: 35
18Operationoperator: 40
operand: 36
19Operationoperator: 40
operand: 37
20Operationoperator: 40
operand: 38
21Operationoperator: 40
operand: 39
22Lambdaparameter: 50
body: 32
23Variable
24ExprTuple57
25ExprTuple33
26ExprTuple34
27ExprTuple35
28ExprTuple36
29ExprTuple37
30ExprTuple38
31ExprTuple39
32Operationoperator: 40
operand: 50
33Operationoperator: 48
operands: 42
34Operationoperator: 48
operands: 43
35Operationoperator: 48
operands: 44
36Operationoperator: 48
operands: 45
37Operationoperator: 48
operands: 46
38Operationoperator: 48
operands: 47
39Operationoperator: 48
operands: 49
40Variable
41ExprTuple50
42ExprTuple57, 51
43ExprTuple57, 52
44ExprTuple57, 53
45ExprTuple57, 54
46ExprTuple57, 55
47ExprTuple57, 56
48Literal
49ExprTuple57, 58
50Variable
51Literal
52Literal
53Literal
54Literal
55Literal
56Literal
57Variable
58Literal