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.multiplication import mult_nat_closure
In [2]:
# check that the built expression is the same as the stored expression
assert mult_nat_closure.expr == stored_expr
assert mult_nat_closure.expr._style_id == stored_expr._style_id
print("Passed sanity check: mult_nat_closure matches stored_expr")
Passed sanity check: mult_nat_closure matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{n} \in \mathbb{N}}~\left(\left(a_{1} \cdot  a_{2} \cdot  \ldots \cdot  a_{n}\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
2Lambdaparameter: 26
body: 4
3ExprTuple26
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 27
operands: 9
7Literal
8ExprTuple10
9ExprTuple26, 30
10Lambdaparameters: 20
body: 11
11Conditionalvalue: 12
condition: 13
12Operationoperator: 27
operands: 14
13Operationoperator: 15
operands: 16
14ExprTuple17, 30
15Literal
16ExprTuple18
17Operationoperator: 19
operands: 20
18ExprRangelambda_map: 21
start_index: 25
end_index: 26
19Literal
20ExprTuple22
21Lambdaparameter: 33
body: 23
22ExprRangelambda_map: 24
start_index: 25
end_index: 26
23Operationoperator: 27
operands: 28
24Lambdaparameter: 33
body: 29
25Literal
26Variable
27Literal
28ExprTuple29, 30
29IndexedVarvariable: 31
index: 33
30Literal
31Variable
32ExprTuple33
33Variable