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.conjunction import quantification_from_conjunction
In [2]:
# check that the built expression is the same as the stored expression
assert quantification_from_conjunction.expr == stored_expr
assert quantification_from_conjunction.expr._style_id == stored_expr._style_id
print("Passed sanity check: quantification_from_conjunction matches stored_expr")
Passed sanity check: quantification_from_conjunction 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) \land  P\left(i + 1\right) \land  \ldots \land  P\left(j\right)\right) \Rightarrow \left[\forall_{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: 22
operand: 2
1ExprTuple2
2Lambdaparameters: 40
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 22
operand: 8
5Operationoperator: 20
operands: 7
6ExprTuple8
7ExprTuple9, 10
8Lambdaparameter: 32
body: 12
9Operationoperator: 34
operands: 13
10Operationoperator: 34
operands: 14
11ExprTuple32
12Operationoperator: 15
operands: 16
13ExprTuple41, 17
14ExprTuple42, 17
15Literal
16ExprTuple18, 19
17Literal
18Operationoperator: 20
operands: 21
19Operationoperator: 22
operand: 25
20Literal
21ExprTuple24
22Literal
23ExprTuple25
24ExprRangelambda_map: 26
start_index: 41
end_index: 42
25Lambdaparameter: 37
body: 27
26Lambdaparameter: 36
body: 28
27Conditionalvalue: 29
condition: 30
28Operationoperator: 32
operand: 36
29Operationoperator: 32
operand: 37
30Operationoperator: 34
operands: 35
31ExprTuple36
32Variable
33ExprTuple37
34Literal
35ExprTuple37, 38
36Variable
37Variable
38Operationoperator: 39
operands: 40
39Literal
40ExprTuple41, 42
41Variable
42Variable