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.addition import term_as_strong_upper_bound
In [2]:
# check that the built expression is the same as the stored expression
assert term_as_strong_upper_bound.expr == stored_expr
assert term_as_strong_upper_bound.expr._style_id == stored_expr._style_id
print("Passed sanity check: term_as_strong_upper_bound matches stored_expr")
Passed sanity check: term_as_strong_upper_bound 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(i + j\right) > 0}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{i}, c_{1}, c_{2}, \ldots, c_{j} \in \mathbb{R}^-}~\left[\forall_{b \in \mathbb{R}}~\left(\left(a_{1} +  a_{2} +  \ldots +  a_{i} + b+ c_{1} +  c_{2} +  \ldots +  c_{j}\right) < b\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: 22
operand: 2
1ExprTuple2
2Lambdaparameters: 26
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 22
operand: 8
5Operationoperator: 24
operands: 7
6ExprTuple8
7ExprTuple9, 10, 11
8Lambdaparameters: 12
body: 13
9Operationoperator: 42
operands: 14
10Operationoperator: 42
operands: 15
11Operationoperator: 38
operands: 16
12ExprTuple49, 51
13Conditionalvalue: 17
condition: 18
14ExprTuple53, 19
15ExprTuple56, 19
16ExprTuple20, 21
17Operationoperator: 22
operand: 27
18Operationoperator: 24
operands: 25
19Literal
20Literal
21Operationoperator: 47
operands: 26
22Literal
23ExprTuple27
24Literal
25ExprTuple28, 29
26ExprTuple53, 56
27Lambdaparameter: 50
body: 31
28ExprRangelambda_map: 32
start_index: 55
end_index: 53
29ExprRangelambda_map: 33
start_index: 55
end_index: 56
30ExprTuple50
31Conditionalvalue: 34
condition: 35
32Lambdaparameter: 62
body: 36
33Lambdaparameter: 62
body: 37
34Operationoperator: 38
operands: 39
35Operationoperator: 42
operands: 40
36Operationoperator: 42
operands: 41
37Operationoperator: 42
operands: 43
38Literal
39ExprTuple44, 50
40ExprTuple50, 45
41ExprTuple57, 46
42Literal
43ExprTuple58, 46
44Operationoperator: 47
operands: 48
45Literal
46Literal
47Literal
48ExprTuple49, 50, 51
49ExprRangelambda_map: 52
start_index: 55
end_index: 53
50Variable
51ExprRangelambda_map: 54
start_index: 55
end_index: 56
52Lambdaparameter: 62
body: 57
53Variable
54Lambdaparameter: 62
body: 58
55Literal
56Variable
57IndexedVarvariable: 59
index: 62
58IndexedVarvariable: 60
index: 62
59Variable
60Variable
61ExprTuple62
62Variable