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.existence import skolem_elim_lemma
In [2]:
# check that the built expression is the same as the stored expression
assert skolem_elim_lemma.expr == stored_expr
assert skolem_elim_lemma.expr._style_id == stored_expr._style_id
print("Passed sanity check: skolem_elim_lemma matches stored_expr")
Passed sanity check: skolem_elim_lemma 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}^+, \alpha \in \mathbb{B}}~\left[\forall_{P, Q}~\left(\left(\left[\exists_{y_{1}, y_{2}, \ldots, y_{n}~|~Q\left(y_{1}, y_{2}, \ldots, y_{n}\right)}~P\left(y_{1}, y_{2}, \ldots, y_{n}\right)\right] \land \left[\forall_{x_{1}, x_{2}, \ldots, x_{n}~|~Q\left(x_{1}, x_{2}, \ldots, x_{n}\right)}~\left(P\left(x_{1}, x_{2}, \ldots, x_{n}\right) \Rightarrow \alpha\right)\right]\right) \Rightarrow \alpha\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: 27
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple52, 43
4Conditionalvalue: 5
condition: 6
5Operationoperator: 27
operand: 9
6Operationoperator: 21
operands: 8
7ExprTuple9
8ExprTuple10, 11
9Lambdaparameters: 12
body: 13
10Operationoperator: 15
operands: 14
11Operationoperator: 15
operands: 16
12ExprTuple45, 40
13Operationoperator: 38
operands: 17
14ExprTuple52, 18
15Literal
16ExprTuple43, 19
17ExprTuple20, 43
18Literal
19Literal
20Operationoperator: 21
operands: 22
21Literal
22ExprTuple23, 24
23Operationoperator: 25
operand: 29
24Operationoperator: 27
operand: 30
25Literal
26ExprTuple29
27Literal
28ExprTuple30
29Lambdaparameters: 37
body: 31
30Lambdaparameters: 46
body: 32
31Conditionalvalue: 33
condition: 34
32Conditionalvalue: 35
condition: 36
33Operationoperator: 45
operands: 37
34Operationoperator: 40
operands: 37
35Operationoperator: 38
operands: 39
36Operationoperator: 40
operands: 46
37ExprTuple41
38Literal
39ExprTuple42, 43
40Variable
41ExprRangelambda_map: 44
start_index: 51
end_index: 52
42Operationoperator: 45
operands: 46
43Variable
44Lambdaparameter: 56
body: 47
45Variable
46ExprTuple48
47IndexedVarvariable: 49
index: 56
48ExprRangelambda_map: 50
start_index: 51
end_index: 52
49Variable
50Lambdaparameter: 56
body: 53
51Literal
52Variable
53IndexedVarvariable: 54
index: 56
54Variable
55ExprTuple56
56Variable