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_9_expansion
In [2]:
# check that the built expression is the same as the stored expression
assert range_9_expansion.expr == stored_expr
assert range_9_expansion.expr._style_id == stored_expr._style_id
print("Passed sanity check: range_9_expansion matches stored_expr")
Passed sanity check: range_9_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 + 8\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), f\left(i + 8\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
4ExprTuple43, 62, 24
5Conditionalvalue: 6
condition: 7
6Operationoperator: 9
operands: 8
7Operationoperator: 9
operands: 10
8ExprTuple11, 12
9Literal
10ExprTuple24, 42
11ExprTuple13
12ExprTuple14, 15, 16, 17, 18, 19, 20, 21, 22
13ExprRangelambda_map: 23
start_index: 62
end_index: 24
14Operationoperator: 43
operand: 62
15Operationoperator: 43
operand: 35
16Operationoperator: 43
operand: 36
17Operationoperator: 43
operand: 37
18Operationoperator: 43
operand: 38
19Operationoperator: 43
operand: 39
20Operationoperator: 43
operand: 40
21Operationoperator: 43
operand: 41
22Operationoperator: 43
operand: 42
23Lambdaparameter: 54
body: 34
24Variable
25ExprTuple62
26ExprTuple35
27ExprTuple36
28ExprTuple37
29ExprTuple38
30ExprTuple39
31ExprTuple40
32ExprTuple41
33ExprTuple42
34Operationoperator: 43
operand: 54
35Operationoperator: 52
operands: 45
36Operationoperator: 52
operands: 46
37Operationoperator: 52
operands: 47
38Operationoperator: 52
operands: 48
39Operationoperator: 52
operands: 49
40Operationoperator: 52
operands: 50
41Operationoperator: 52
operands: 51
42Operationoperator: 52
operands: 53
43Variable
44ExprTuple54
45ExprTuple62, 55
46ExprTuple62, 56
47ExprTuple62, 57
48ExprTuple62, 58
49ExprTuple62, 59
50ExprTuple62, 60
51ExprTuple62, 61
52Literal
53ExprTuple62, 63
54Variable
55Literal
56Literal
57Literal
58Literal
59Literal
60Literal
61Literal
62Variable
63Literal