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.core_expr_types.tuples import range_fn_transformation
In [2]:
# check that the built expression is the same as the stored expression
assert range_fn_transformation.expr == stored_expr
assert range_fn_transformation.expr._style_id == stored_expr._style_id
print("Passed sanity check: range_fn_transformation matches stored_expr")
Passed sanity check: range_fn_transformation matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f, g}~\left[\forall_{i, j \in \mathbb{Z}}~\left(\left[\forall_{k \in \{i~\ldotp \ldotp~j\}}~\left(f\left(k\right) = g\left(k\right)\right)\right] \Rightarrow \left(\left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(j\right)\right) = \left(g\left(i\right), g\left(i + 1\right), \ldots, g\left(j\right)\right)\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: 18
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple44, 45
4Operationoperator: 18
operand: 6
5ExprTuple6
6Lambdaparameters: 48
body: 7
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operands: 11
9Operationoperator: 12
operands: 13
10Literal
11ExprTuple14, 15
12Literal
13ExprTuple16, 17
14Operationoperator: 18
operand: 23
15Operationoperator: 34
operands: 20
16Operationoperator: 36
operands: 21
17Operationoperator: 36
operands: 22
18Literal
19ExprTuple23
20ExprTuple24, 25
21ExprTuple51, 26
22ExprTuple52, 26
23Lambdaparameter: 50
body: 27
24ExprTuple28
25ExprTuple29
26Literal
27Conditionalvalue: 30
condition: 31
28ExprRangelambda_map: 32
start_index: 51
end_index: 52
29ExprRangelambda_map: 33
start_index: 51
end_index: 52
30Operationoperator: 34
operands: 35
31Operationoperator: 36
operands: 37
32Lambdaparameter: 49
body: 38
33Lambdaparameter: 49
body: 39
34Literal
35ExprTuple40, 41
36Literal
37ExprTuple50, 42
38Operationoperator: 44
operand: 49
39Operationoperator: 45
operand: 49
40Operationoperator: 44
operand: 50
41Operationoperator: 45
operand: 50
42Operationoperator: 47
operands: 48
43ExprTuple49
44Variable
45Variable
46ExprTuple50
47Literal
48ExprTuple51, 52
49Variable
50Variable
51Variable
52Variable