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.disjunction import quantification_from_disjunction
In [2]:
# check that the built expression is the same as the stored expression
assert quantification_from_disjunction.expr == stored_expr
assert quantification_from_disjunction.expr._style_id == stored_expr._style_id
print("Passed sanity check: quantification_from_disjunction matches stored_expr")
Passed sanity check: quantification_from_disjunction matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{i, j \in \mathbb{Z}}~\left[\forall_{P}~\left(\left(P\left(i\right) \lor  P\left(i + 1\right) \lor  \ldots \lor  P\left(j\right)\right) \Rightarrow \left[\exists_{k \in \{i~\ldotp \ldotp~j\}}~P\left(k\right)\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: 6
operand: 2
1ExprTuple2
2Lambdaparameters: 42
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 10
5Operationoperator: 8
operands: 9
6Literal
7ExprTuple10
8Literal
9ExprTuple11, 12
10Lambdaparameter: 34
body: 14
11Operationoperator: 36
operands: 15
12Operationoperator: 36
operands: 16
13ExprTuple34
14Operationoperator: 17
operands: 18
15ExprTuple43, 19
16ExprTuple44, 19
17Literal
18ExprTuple20, 21
19Literal
20Operationoperator: 22
operands: 23
21Operationoperator: 24
operand: 27
22Literal
23ExprTuple26
24Literal
25ExprTuple27
26ExprRangelambda_map: 28
start_index: 43
end_index: 44
27Lambdaparameter: 39
body: 29
28Lambdaparameter: 38
body: 30
29Conditionalvalue: 31
condition: 32
30Operationoperator: 34
operand: 38
31Operationoperator: 34
operand: 39
32Operationoperator: 36
operands: 37
33ExprTuple38
34Variable
35ExprTuple39
36Literal
37ExprTuple39, 40
38Variable
39Variable
40Operationoperator: 41
operands: 42
41Literal
42ExprTuple43, 44
43Variable
44Variable