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