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_1_expansion
In [2]:
# check that the built expression is the same as the stored expression
assert range_1_expansion.expr == stored_expr
assert range_1_expansion.expr._style_id == stored_expr._style_id
print("Passed sanity check: range_1_expansion matches stored_expr")
Passed sanity check: range_1_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 = i}~\left(\left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(j\right)\right) = \left(f\left(i\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
4ExprTuple20, 19, 16
5Conditionalvalue: 6
condition: 7
6Operationoperator: 9
operands: 8
7Operationoperator: 9
operands: 10
8ExprTuple11, 12
9Literal
10ExprTuple16, 19
11ExprTuple13
12ExprTuple14
13ExprRangelambda_map: 15
start_index: 19
end_index: 16
14Operationoperator: 20
operand: 19
15Lambdaparameter: 22
body: 18
16Variable
17ExprTuple19
18Operationoperator: 20
operand: 22
19Variable
20Variable
21ExprTuple22
22Variable