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_both
In [2]:
# check that the built expression is the same as the stored expression
assert shift_equivalence_both.expr == stored_expr
assert shift_equivalence_both.expr._style_id == stored_expr._style_id
print("Passed sanity check: shift_equivalence_both matches stored_expr")
Passed sanity check: shift_equivalence_both 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, b \in \mathbb{Z}}~\left[\forall_{i, j, k, l~|~\left(\left(j + 1\right) - i\right) \in \mathbb{N}, \left(i + a\right) = \left(k + b\right), \left(j + a\right) = \left(l + b\right)}~\left(\left(f\left(i + a\right), f\left(\left(i + 1\right) + a\right), \ldots, f\left(j + a\right)\right) = \left(f\left(k + b\right), f\left(\left(k + 1\right) + b\right), \ldots, f\left(l + b\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: 11
operand: 2
1ExprTuple2
2Lambdaparameter: 56
body: 4
3ExprTuple56
4Operationoperator: 11
operand: 6
5ExprTuple6
6Lambdaparameters: 7
body: 8
7ExprTuple73, 75
8Conditionalvalue: 9
condition: 10
9Operationoperator: 11
operand: 14
10Operationoperator: 25
operands: 13
11Literal
12ExprTuple14
13ExprTuple15, 16
14Lambdaparameters: 17
body: 18
15Operationoperator: 34
operands: 19
16Operationoperator: 34
operands: 20
17ExprTuple72, 70, 60, 61
18Conditionalvalue: 21
condition: 22
19ExprTuple73, 23
20ExprTuple75, 23
21Operationoperator: 37
operands: 24
22Operationoperator: 25
operands: 26
23Literal
24ExprTuple27, 28
25Literal
26ExprTuple29, 30, 31
27ExprTuple32
28ExprTuple33
29Operationoperator: 34
operands: 35
30Operationoperator: 37
operands: 36
31Operationoperator: 37
operands: 38
32ExprRangelambda_map: 39
start_index: 72
end_index: 70
33ExprRangelambda_map: 40
start_index: 60
end_index: 61
34Literal
35ExprTuple41, 42
36ExprTuple43, 44
37Literal
38ExprTuple45, 46
39Lambdaparameter: 74
body: 47
40Lambdaparameter: 74
body: 49
41Operationoperator: 68
operands: 50
42Literal
43Operationoperator: 68
operands: 51
44Operationoperator: 68
operands: 52
45Operationoperator: 68
operands: 53
46Operationoperator: 68
operands: 54
47Operationoperator: 56
operand: 62
48ExprTuple74
49Operationoperator: 56
operand: 63
50ExprTuple58, 59
51ExprTuple72, 73
52ExprTuple60, 75
53ExprTuple70, 73
54ExprTuple61, 75
55ExprTuple62
56Variable
57ExprTuple63
58Operationoperator: 68
operands: 64
59Operationoperator: 65
operand: 72
60Variable
61Variable
62Operationoperator: 68
operands: 67
63Operationoperator: 68
operands: 69
64ExprTuple70, 71
65Literal
66ExprTuple72
67ExprTuple74, 73
68Literal
69ExprTuple74, 75
70Variable
71Literal
72Variable
73Variable
74Variable
75Variable