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.summation import strong_summation_from_summands_bound
In [2]:
# check that the built expression is the same as the stored expression
assert strong_summation_from_summands_bound.expr == stored_expr
assert strong_summation_from_summands_bound.expr._style_id == stored_expr._style_id
print("Passed sanity check: strong_summation_from_summands_bound matches stored_expr")
Passed sanity check: strong_summation_from_summands_bound matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{a, b, S~|~|S| > 0}~\left(\left[\forall_{k \in S}~\left(a\left(k\right) < b\left(k\right)\right)\right] \Rightarrow \left(\left[\sum_{l \in S}~a\left(l\right)\right] < \left[\sum_{l \in S}~b\left(l\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: 14
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple41, 42, 48
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operands: 8
6Operationoperator: 30
operands: 9
7Literal
8ExprTuple10, 11
9ExprTuple12, 13
10Operationoperator: 14
operand: 19
11Operationoperator: 30
operands: 16
12Literal
13Operationoperator: 17
operand: 48
14Literal
15ExprTuple19
16ExprTuple20, 21
17Literal
18ExprTuple48
19Lambdaparameter: 46
body: 22
20Operationoperator: 24
operand: 28
21Operationoperator: 24
operand: 29
22Conditionalvalue: 26
condition: 27
23ExprTuple28
24Literal
25ExprTuple29
26Operationoperator: 30
operands: 31
27Operationoperator: 44
operands: 32
28Lambdaparameter: 47
body: 33
29Lambdaparameter: 47
body: 34
30Literal
31ExprTuple35, 36
32ExprTuple46, 48
33Conditionalvalue: 37
condition: 39
34Conditionalvalue: 38
condition: 39
35Operationoperator: 41
operand: 46
36Operationoperator: 42
operand: 46
37Operationoperator: 41
operand: 47
38Operationoperator: 42
operand: 47
39Operationoperator: 44
operands: 45
40ExprTuple46
41Variable
42Variable
43ExprTuple47
44Literal
45ExprTuple47, 48
46Variable
47Variable
48Variable