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.number_sets.natural_numbers import fold_forall_natural
In [2]:
# check that the built expression is the same as the stored expression
assert fold_forall_natural.expr == stored_expr
assert fold_forall_natural.expr._style_id == stored_expr._style_id
print("Passed sanity check: fold_forall_natural matches stored_expr")
Passed sanity check: fold_forall_natural matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{P}~\left(\left(P\left(0\right) \land \left[\forall_{m \in \mathbb{N}~|~P\left(m\right)}~P\left(m + 1\right)\right]\right) \Rightarrow \left[\forall_{n \in \mathbb{N}}~P\left(n\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: 15
operand: 2
1ExprTuple2
2Lambdaparameter: 38
body: 4
3ExprTuple38
4Operationoperator: 5
operands: 6
5Literal
6ExprTuple7, 8
7Operationoperator: 29
operands: 9
8Operationoperator: 15
operand: 13
9ExprTuple11, 12
10ExprTuple13
11Operationoperator: 38
operand: 18
12Operationoperator: 15
operand: 19
13Lambdaparameter: 27
body: 17
14ExprTuple18
15Literal
16ExprTuple19
17Conditionalvalue: 20
condition: 21
18Literal
19Lambdaparameter: 42
body: 22
20Operationoperator: 38
operand: 27
21Operationoperator: 36
operands: 24
22Conditionalvalue: 25
condition: 26
23ExprTuple27
24ExprTuple27, 41
25Operationoperator: 38
operand: 31
26Operationoperator: 29
operands: 30
27Variable
28ExprTuple31
29Literal
30ExprTuple32, 33
31Operationoperator: 34
operands: 35
32Operationoperator: 36
operands: 37
33Operationoperator: 38
operand: 42
34Literal
35ExprTuple42, 40
36Literal
37ExprTuple42, 41
38Variable
39ExprTuple42
40Literal
41Literal
42Variable