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 weak_summation_from_summands_bound
In [2]:
# check that the built expression is the same as the stored expression
assert weak_summation_from_summands_bound.expr == stored_expr
assert weak_summation_from_summands_bound.expr._style_id == stored_expr._style_id
print("Passed sanity check: weak_summation_from_summands_bound matches stored_expr")
Passed sanity check: weak_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}~\left(\left[\forall_{k \in S}~\left(a\left(k\right) \leq b\left(k\right)\right)\right] \Rightarrow \left(\left[\sum_{l \in S}~a\left(l\right)\right] \leq \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: 9
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple34, 35, 41
4Operationoperator: 5
operands: 6
5Literal
6ExprTuple7, 8
7Operationoperator: 9
operand: 12
8Operationoperator: 23
operands: 11
9Literal
10ExprTuple12
11ExprTuple13, 14
12Lambdaparameter: 39
body: 15
13Operationoperator: 17
operand: 21
14Operationoperator: 17
operand: 22
15Conditionalvalue: 19
condition: 20
16ExprTuple21
17Literal
18ExprTuple22
19Operationoperator: 23
operands: 24
20Operationoperator: 37
operands: 25
21Lambdaparameter: 40
body: 26
22Lambdaparameter: 40
body: 27
23Literal
24ExprTuple28, 29
25ExprTuple39, 41
26Conditionalvalue: 30
condition: 32
27Conditionalvalue: 31
condition: 32
28Operationoperator: 34
operand: 39
29Operationoperator: 35
operand: 39
30Operationoperator: 34
operand: 40
31Operationoperator: 35
operand: 40
32Operationoperator: 37
operands: 38
33ExprTuple39
34Variable
35Variable
36ExprTuple40
37Literal
38ExprTuple40, 41
39Variable
40Variable
41Variable