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