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.logic.booleans.quantification.universality import forall_induction
In [2]:
# check that the built expression is the same as the stored expression
assert forall_induction.expr == stored_expr
assert forall_induction.expr._style_id == stored_expr._style_id
print("Passed sanity check: forall_induction matches stored_expr")
Passed sanity check: forall_induction 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(\begin{array}{c} \begin{array}{l} \left(P\left(\right) \land \left[\forall_{n \in \mathbb{N}}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{x_{1}, x_{2}, \ldots, x_{n}}~P\left(x_{1}, x_{2}, \ldots, x_{n}\right)\right] \Rightarrow  \\ \left[\forall_{x_{1}, x_{2}, \ldots, x_{n + 1}}~P\left(x_{1}, x_{2}, \ldots, x_{n + 1}\right)\right] \end{array} \end{array}\right)\right]\right) \\  \Rightarrow \left[\forall_{n \in \mathbb{N}}~\left[\forall_{x_{1}, x_{2}, \ldots, x_{n}}~P\left(x_{1}, x_{2}, \ldots, x_{n}\right)\right]\right] \end{array} \end{array}\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: 30
operand: 2
1ExprTuple2
2Lambdaparameter: 37
body: 4
3ExprTuple37
4Operationoperator: 22
operands: 5
5ExprTuple6, 7
6Operationoperator: 8
operands: 9
7Operationoperator: 30
operand: 13
8Literal
9ExprTuple11, 12
10ExprTuple13
11Operationoperator: 37
operands: 14
12Operationoperator: 30
operand: 17
13Lambdaparameter: 48
body: 16
14ExprTuple
15ExprTuple17
16Conditionalvalue: 26
condition: 21
17Lambdaparameter: 48
body: 19
18ExprTuple48
19Conditionalvalue: 20
condition: 21
20Operationoperator: 22
operands: 23
21Operationoperator: 24
operands: 25
22Literal
23ExprTuple26, 27
24Literal
25ExprTuple48, 28
26Operationoperator: 30
operand: 32
27Operationoperator: 30
operand: 33
28Literal
29ExprTuple32
30Literal
31ExprTuple33
32Lambdaparameters: 36
body: 34
33Lambdaparameters: 38
body: 35
34Operationoperator: 37
operands: 36
35Operationoperator: 37
operands: 38
36ExprTuple39
37Variable
38ExprTuple40
39ExprRangelambda_map: 41
start_index: 49
end_index: 48
40ExprRangelambda_map: 41
start_index: 49
end_index: 42
41Lambdaparameter: 50
body: 43
42Operationoperator: 44
operands: 45
43IndexedVarvariable: 46
index: 50
44Literal
45ExprTuple48, 49
46Variable
47ExprTuple50
48Variable
49Literal
50Variable