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 conjunction_from_quantification
In [2]:
# check that the built expression is the same as the stored expression
assert conjunction_from_quantification.expr == stored_expr
assert conjunction_from_quantification.expr._style_id == stored_expr._style_id
print("Passed sanity check: conjunction_from_quantification matches stored_expr")
Passed sanity check: conjunction_from_quantification 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~|~i \leq \left(j + 1\right)}~\left(\left[\forall_{k \in \{i~\ldotp \ldotp~j\}}~P\left(k\right)\right] \Rightarrow \left(P\left(i\right) \land  P\left(i + 1\right) \land  \ldots \land  P\left(j\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: 25
operand: 2
1ExprTuple2
2Lambdaparameters: 48
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 25
operand: 8
5Operationoperator: 27
operands: 7
6ExprTuple8
7ExprTuple9, 10
8Lambdaparameter: 42
body: 12
9Operationoperator: 40
operands: 13
10Operationoperator: 40
operands: 14
11ExprTuple42
12Conditionalvalue: 15
condition: 16
13ExprTuple49, 17
14ExprTuple50, 17
15Operationoperator: 18
operands: 19
16Operationoperator: 20
operands: 21
17Literal
18Literal
19ExprTuple22, 23
20Literal
21ExprTuple49, 24
22Operationoperator: 25
operand: 31
23Operationoperator: 27
operands: 28
24Operationoperator: 29
operands: 30
25Literal
26ExprTuple31
27Literal
28ExprTuple32
29Literal
30ExprTuple50, 33
31Lambdaparameter: 44
body: 34
32ExprRangelambda_map: 35
start_index: 49
end_index: 50
33Literal
34Conditionalvalue: 36
condition: 37
35Lambdaparameter: 46
body: 38
36Operationoperator: 42
operand: 44
37Operationoperator: 40
operands: 41
38Operationoperator: 42
operand: 46
39ExprTuple44
40Literal
41ExprTuple44, 45
42Variable
43ExprTuple46
44Variable
45Operationoperator: 47
operands: 48
46Variable
47Literal
48ExprTuple49, 50
49Variable
50Variable