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 conditioned_forall_over_bool_by_cases
In [2]:
# check that the built expression is the same as the stored expression
assert conditioned_forall_over_bool_by_cases.expr == stored_expr
assert conditioned_forall_over_bool_by_cases.expr._style_id == stored_expr._style_id
print("Passed sanity check: conditioned_forall_over_bool_by_cases matches stored_expr")
Passed sanity check: conditioned_forall_over_bool_by_cases matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{P, Q~|~Q\left(\top\right) \Rightarrow P\left(\top\right), Q\left(\bot\right) \Rightarrow P\left(\bot\right)}~\left[\forall_{A \in \mathbb{B}~|~Q\left(A\right)}~P\left(A\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: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple26, 34
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 23
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12
10Lambdaparameter: 37
body: 13
11Operationoperator: 15
operands: 14
12Operationoperator: 15
operands: 16
13Conditionalvalue: 17
condition: 18
14ExprTuple19, 20
15Literal
16ExprTuple21, 22
17Operationoperator: 26
operand: 37
18Operationoperator: 23
operands: 24
19Operationoperator: 34
operand: 30
20Operationoperator: 26
operand: 30
21Operationoperator: 34
operand: 31
22Operationoperator: 26
operand: 31
23Literal
24ExprTuple28, 29
25ExprTuple30
26Variable
27ExprTuple31
28Operationoperator: 32
operands: 33
29Operationoperator: 34
operand: 37
30Literal
31Literal
32Literal
33ExprTuple37, 36
34Variable
35ExprTuple37
36Literal
37Variable