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