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_6_expansion
In [2]:
# check that the built expression is the same as the stored expression
assert range_6_expansion.expr == stored_expr
assert range_6_expansion.expr._style_id == stored_expr._style_id
print("Passed sanity check: range_6_expansion matches stored_expr")
Passed sanity check: range_6_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 + 5\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)\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
4ExprTuple34, 47, 21
5Conditionalvalue: 6
condition: 7
6Operationoperator: 9
operands: 8
7Operationoperator: 9
operands: 10
8ExprTuple11, 12
9Literal
10ExprTuple21, 33
11ExprTuple13
12ExprTuple14, 15, 16, 17, 18, 19
13ExprRangelambda_map: 20
start_index: 47
end_index: 21
14Operationoperator: 34
operand: 47
15Operationoperator: 34
operand: 29
16Operationoperator: 34
operand: 30
17Operationoperator: 34
operand: 31
18Operationoperator: 34
operand: 32
19Operationoperator: 34
operand: 33
20Lambdaparameter: 42
body: 28
21Variable
22ExprTuple47
23ExprTuple29
24ExprTuple30
25ExprTuple31
26ExprTuple32
27ExprTuple33
28Operationoperator: 34
operand: 42
29Operationoperator: 40
operands: 36
30Operationoperator: 40
operands: 37
31Operationoperator: 40
operands: 38
32Operationoperator: 40
operands: 39
33Operationoperator: 40
operands: 41
34Variable
35ExprTuple42
36ExprTuple47, 43
37ExprTuple47, 44
38ExprTuple47, 45
39ExprTuple47, 46
40Literal
41ExprTuple47, 48
42Variable
43Literal
44Literal
45Literal
46Literal
47Variable
48Literal