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 exists_in_superset
In [2]:
# check that the built expression is the same as the stored expression
assert exists_in_superset.expr == stored_expr
assert exists_in_superset.expr._style_id == stored_expr._style_id
print("Passed sanity check: exists_in_superset matches stored_expr")
Passed sanity check: exists_in_superset 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_{P, Q, A, B~|~A \subseteq B}~\left(\begin{array}{c} \begin{array}{l} \left[\exists_{x_{1}, x_{2}, \ldots, x_{n} \in A~|~Q\left(x_{1}, x_{2}, \ldots, x_{n}\right)}~P\left(x_{1}, x_{2}, \ldots, x_{n}\right)\right] \Rightarrow  \\ \left[\exists_{y_{1}, y_{2}, \ldots, y_{n} \in B~|~Q\left(y_{1}, y_{2}, \ldots, y_{n}\right)}~P\left(y_{1}, y_{2}, \ldots, y_{n}\right)\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: 7
operand: 2
1ExprTuple2
2Lambdaparameter: 56
body: 4
3ExprTuple56
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 52
operands: 9
7Literal
8ExprTuple10
9ExprTuple56, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple34, 44, 57, 59
13Conditionalvalue: 14
condition: 15
14Operationoperator: 16
operands: 17
15Operationoperator: 18
operands: 19
16Literal
17ExprTuple20, 21
18Literal
19ExprTuple57, 59
20Operationoperator: 23
operand: 25
21Operationoperator: 23
operand: 26
22ExprTuple25
23Literal
24ExprTuple26
25Lambdaparameters: 42
body: 27
26Lambdaparameters: 45
body: 28
27Conditionalvalue: 29
condition: 30
28Conditionalvalue: 31
condition: 32
29Operationoperator: 34
operands: 42
30Operationoperator: 35
operands: 33
31Operationoperator: 34
operands: 45
32Operationoperator: 35
operands: 36
33ExprTuple37, 38
34Variable
35Literal
36ExprTuple39, 40
37ExprRangelambda_map: 41
start_index: 55
end_index: 56
38Operationoperator: 44
operands: 42
39ExprRangelambda_map: 43
start_index: 55
end_index: 56
40Operationoperator: 44
operands: 45
41Lambdaparameter: 64
body: 46
42ExprTuple47
43Lambdaparameter: 64
body: 48
44Variable
45ExprTuple49
46Operationoperator: 52
operands: 50
47ExprRangelambda_map: 51
start_index: 55
end_index: 56
48Operationoperator: 52
operands: 53
49ExprRangelambda_map: 54
start_index: 55
end_index: 56
50ExprTuple58, 57
51Lambdaparameter: 64
body: 58
52Literal
53ExprTuple60, 59
54Lambdaparameter: 64
body: 60
55Literal
56Variable
57Variable
58IndexedVarvariable: 61
index: 64
59Variable
60IndexedVarvariable: 62
index: 64
61Variable
62Variable
63ExprTuple64
64Variable