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 deci_sequence_reduction
In [2]:
# check that the built expression is the same as the stored expression
assert deci_sequence_reduction.expr == stored_expr
assert deci_sequence_reduction.expr._style_id == stored_expr._style_id
print("Passed sanity check: deci_sequence_reduction matches stored_expr")
Passed sanity check: deci_sequence_reduction matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m, n, k \in \mathbb{N}}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{m}, b_{1}, b_{2}, \ldots, b_{n}, c, d_{1}, d_{2}, \ldots, d_{k} \in \mathbb{N}^{\leq 9}~|~\left(b_{1} +  b_{2} +  \ldots +  b_{n}\right) = c}~\left(\texttt{\#}(a_{1}, a_{2}, \ldots, a_{m} ~ \left(b_{1} +  b_{2} +  \ldots +  b_{n}\right) ~ d_{1}, d_{2}, \ldots, d_{k}) = \texttt{\#}(a_{1}, a_{2}, \ldots, a_{m} ~ c ~ d_{1}, d_{2}, \ldots, d_{k})\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: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple49, 66, 51
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 23
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12, 13
10Lambdaparameters: 14
body: 15
11Operationoperator: 54
operands: 16
12Operationoperator: 54
operands: 17
13Operationoperator: 54
operands: 18
14ExprTuple41, 61, 47, 42
15Conditionalvalue: 19
condition: 20
16ExprTuple49, 21
17ExprTuple66, 21
18ExprTuple51, 21
19Operationoperator: 39
operands: 22
20Operationoperator: 23
operands: 24
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple27, 28, 29, 30, 31
25Operationoperator: 33
operands: 32
26Operationoperator: 33
operands: 34
27ExprRangelambda_map: 35
start_index: 65
end_index: 49
28ExprRangelambda_map: 36
start_index: 65
end_index: 66
29Operationoperator: 54
operands: 37
30ExprRangelambda_map: 38
start_index: 65
end_index: 51
31Operationoperator: 39
operands: 40
32ExprTuple41, 46, 42
33Literal
34ExprTuple41, 47, 42
35Lambdaparameter: 70
body: 43
36Lambdaparameter: 70
body: 44
37ExprTuple47, 60
38Lambdaparameter: 70
body: 45
39Literal
40ExprTuple46, 47
41ExprRangelambda_map: 48
start_index: 65
end_index: 49
42ExprRangelambda_map: 50
start_index: 65
end_index: 51
43Operationoperator: 54
operands: 52
44Operationoperator: 54
operands: 53
45Operationoperator: 54
operands: 55
46Operationoperator: 56
operands: 57
47Variable
48Lambdaparameter: 70
body: 58
49Variable
50Lambdaparameter: 70
body: 59
51Variable
52ExprTuple58, 60
53ExprTuple67, 60
54Literal
55ExprTuple59, 60
56Literal
57ExprTuple61
58IndexedVarvariable: 62
index: 70
59IndexedVarvariable: 63
index: 70
60Literal
61ExprRangelambda_map: 64
start_index: 65
end_index: 66
62Variable
63Variable
64Lambdaparameter: 70
body: 67
65Literal
66Variable
67IndexedVarvariable: 68
index: 70
68Variable
69ExprTuple70
70Variable