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