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.modular import redundant_mod_elimination_in_sum
In [2]:
# check that the built expression is the same as the stored expression
assert redundant_mod_elimination_in_sum.expr == stored_expr
assert redundant_mod_elimination_in_sum.expr._style_id == stored_expr._style_id
print("Passed sanity check: redundant_mod_elimination_in_sum matches stored_expr")
Passed sanity check: redundant_mod_elimination_in_sum matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{i, j \in \mathbb{N}}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{i}, b, c_{1}, c_{2}, \ldots, c_{j} \in \mathbb{R}}~\left[\forall_{L \in \mathbb{R}^+}~\left(\begin{array}{c} \begin{array}{l} \left(\left(a_{1} +  a_{2} +  \ldots +  a_{i} + \left(b ~\textup{mod}~ L\right)+ c_{1} +  c_{2} +  \ldots +  c_{j}\right) ~\textup{mod}~ L\right) =  \\ \left(\left(a_{1} +  a_{2} +  \ldots +  a_{i} + b+ c_{1} +  c_{2} +  \ldots +  c_{j}\right) ~\textup{mod}~ L\right) \end{array} \end{array}\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
3ExprTuple58, 61
4Conditionalvalue: 5
condition: 6
5Operationoperator: 18
operand: 9
6Operationoperator: 20
operands: 8
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 51
body: 12
10Operationoperator: 39
operands: 13
11Operationoperator: 39
operands: 14
12Conditionalvalue: 15
condition: 16
13ExprTuple58, 17
14ExprTuple61, 17
15Operationoperator: 18
operand: 22
16Operationoperator: 20
operands: 21
17Literal
18Literal
19ExprTuple22
20Literal
21ExprTuple23, 24, 25
22Lambdaparameter: 63
body: 27
23ExprRangelambda_map: 28
start_index: 60
end_index: 58
24Operationoperator: 39
operands: 29
25ExprRangelambda_map: 30
start_index: 60
end_index: 61
26ExprTuple63
27Conditionalvalue: 31
condition: 32
28Lambdaparameter: 69
body: 33
29ExprTuple62, 44
30Lambdaparameter: 69
body: 34
31Operationoperator: 35
operands: 36
32Operationoperator: 39
operands: 37
33Operationoperator: 39
operands: 38
34Operationoperator: 39
operands: 40
35Literal
36ExprTuple41, 42
37ExprTuple63, 43
38ExprTuple64, 44
39Literal
40ExprTuple65, 44
41Operationoperator: 55
operands: 45
42Operationoperator: 55
operands: 46
43Literal
44Literal
45ExprTuple47, 63
46ExprTuple48, 63
47Operationoperator: 50
operands: 49
48Operationoperator: 50
operands: 51
49ExprTuple53, 52, 54
50Literal
51ExprTuple53, 62, 54
52Operationoperator: 55
operands: 56
53ExprRangelambda_map: 57
start_index: 60
end_index: 58
54ExprRangelambda_map: 59
start_index: 60
end_index: 61
55Literal
56ExprTuple62, 63
57Lambdaparameter: 69
body: 64
58Variable
59Lambdaparameter: 69
body: 65
60Literal
61Variable
62Variable
63Variable
64IndexedVarvariable: 66
index: 69
65IndexedVarvariable: 67
index: 69
66Variable
67Variable
68ExprTuple69
69Variable