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