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 import unfold_forall_over_bool
In [2]:
# check that the built expression is the same as the stored expression
assert unfold_forall_over_bool.expr == stored_expr
assert unfold_forall_over_bool.expr._style_id == stored_expr._style_id
print("Passed sanity check: unfold_forall_over_bool matches stored_expr")
Passed sanity check: unfold_forall_over_bool matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{P}~\left(\left[\forall_{A \in \mathbb{B}}~P\left(A\right)\right] \Rightarrow \left(P\left(\top\right) \land P\left(\bot\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: 9
operand: 2
1ExprTuple2
2Lambdaparameter: 23
body: 4
3ExprTuple23
4Operationoperator: 5
operands: 6
5Literal
6ExprTuple7, 8
7Operationoperator: 9
operand: 13
8Operationoperator: 11
operands: 12
9Literal
10ExprTuple13
11Literal
12ExprTuple14, 15
13Lambdaparameter: 27
body: 16
14Operationoperator: 23
operand: 21
15Operationoperator: 23
operand: 22
16Conditionalvalue: 19
condition: 20
17ExprTuple21
18ExprTuple22
19Operationoperator: 23
operand: 27
20Operationoperator: 25
operands: 26
21Literal
22Literal
23Variable
24ExprTuple27
25Literal
26ExprTuple27, 28
27Variable
28Literal