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 shift_equivalence
In [2]:
# check that the built expression is the same as the stored expression
assert shift_equivalence.expr == stored_expr
assert shift_equivalence.expr._style_id == stored_expr._style_id
print("Passed sanity check: shift_equivalence matches stored_expr")
Passed sanity check: shift_equivalence matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{f}~\left[\forall_{a \in \mathbb{Z}}~\left[\forall_{i, j, k, l~|~\left(\left(j + 1\right) - i\right) \in \mathbb{N}, k = \left(i - a\right), l = \left(j - a\right)}~\left(\left(f\left(i\right), f\left(i + 1\right), \ldots, f\left(j\right)\right) = \left(f\left(k + a\right), f\left(\left(k + 1\right) + a\right), \ldots, f\left(l + a\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: 10
operand: 2
1ExprTuple2
2Lambdaparameter: 48
body: 4
3ExprTuple48
4Operationoperator: 10
operand: 6
5ExprTuple6
6Lambdaparameter: 64
body: 7
7Conditionalvalue: 8
condition: 9
8Operationoperator: 10
operand: 13
9Operationoperator: 29
operands: 12
10Literal
11ExprTuple13
12ExprTuple64, 14
13Lambdaparameters: 15
body: 16
14Literal
15ExprTuple62, 60, 38, 40
16Conditionalvalue: 17
condition: 18
17Operationoperator: 32
operands: 19
18Operationoperator: 20
operands: 21
19ExprTuple22, 23
20Literal
21ExprTuple24, 25, 26
22ExprTuple27
23ExprTuple28
24Operationoperator: 29
operands: 30
25Operationoperator: 32
operands: 31
26Operationoperator: 32
operands: 33
27ExprRangelambda_map: 34
start_index: 62
end_index: 60
28ExprRangelambda_map: 35
start_index: 38
end_index: 40
29Literal
30ExprTuple36, 37
31ExprTuple38, 39
32Literal
33ExprTuple40, 41
34Lambdaparameter: 63
body: 42
35Lambdaparameter: 63
body: 43
36Operationoperator: 58
operands: 44
37Literal
38Variable
39Operationoperator: 58
operands: 45
40Variable
41Operationoperator: 58
operands: 46
42Operationoperator: 48
operand: 63
43Operationoperator: 48
operand: 53
44ExprTuple50, 51
45ExprTuple62, 52
46ExprTuple60, 52
47ExprTuple63
48Variable
49ExprTuple53
50Operationoperator: 58
operands: 54
51Operationoperator: 56
operand: 62
52Operationoperator: 56
operand: 64
53Operationoperator: 58
operands: 59
54ExprTuple60, 61
55ExprTuple62
56Literal
57ExprTuple64
58Literal
59ExprTuple63, 64
60Variable
61Literal
62Variable
63Variable
64Variable