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_axiom_expr # Load the stored axiom expression as 'stored_expr'
# import the special expression
from proveit.core_expr_types.lambda_maps import lambda_substitution
In [2]:
# check that the built expression is the same as the stored expression
assert lambda_substitution.expr == stored_expr
assert lambda_substitution.expr._style_id == stored_expr._style_id
print("Passed sanity check: lambda_substitution matches stored_expr")
Passed sanity check: lambda_substitution matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{i \in \mathbb{N}^+}~\left[\forall_{f, g}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{a_{1}, a_{2}, \ldots, a_{i}}~\left(f\left(a_{1}, a_{2}, \ldots, a_{i}\right) = g\left(a_{1}, a_{2}, \ldots, a_{i}\right)\right)\right] \Rightarrow  \\ \left(\begin{array}{c} \begin{array}{l} \left[\left(b_{1}, b_{2}, \ldots, b_{i}\right) \mapsto f\left(b_{1}, b_{2}, \ldots, b_{i}\right)\right] =  \\ \left[\left(c_{1}, c_{2}, \ldots, c_{i}\right) \mapsto g\left(c_{1}, c_{2}, \ldots, c_{i}\right)\right] \end{array} \end{array}\right) \end{array} \end{array}\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: 18
operand: 2
1ExprTuple2
2Lambdaparameter: 45
body: 4
3ExprTuple45
4Conditionalvalue: 5
condition: 6
5Operationoperator: 18
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple45, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple35, 36
13Operationoperator: 14
operands: 15
14Literal
15ExprTuple16, 17
16Operationoperator: 18
operand: 21
17Operationoperator: 27
operands: 20
18Literal
19ExprTuple21
20ExprTuple22, 23
21Lambdaparameters: 37
body: 24
22Lambdaparameters: 29
body: 25
23Lambdaparameters: 30
body: 26
24Operationoperator: 27
operands: 28
25Operationoperator: 35
operands: 29
26Operationoperator: 36
operands: 30
27Literal
28ExprTuple31, 32
29ExprTuple33
30ExprTuple34
31Operationoperator: 35
operands: 37
32Operationoperator: 36
operands: 37
33ExprRangelambda_map: 38
start_index: 44
end_index: 45
34ExprRangelambda_map: 39
start_index: 44
end_index: 45
35Variable
36Variable
37ExprTuple40
38Lambdaparameter: 51
body: 41
39Lambdaparameter: 51
body: 42
40ExprRangelambda_map: 43
start_index: 44
end_index: 45
41IndexedVarvariable: 46
index: 51
42IndexedVarvariable: 47
index: 51
43Lambdaparameter: 51
body: 48
44Literal
45Variable
46Variable
47Variable
48IndexedVarvariable: 49
index: 51
49Variable
50ExprTuple51
51Variable