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.disjunction import destructive_multi_dilemma
In [2]:
# check that the built expression is the same as the stored expression
assert destructive_multi_dilemma.expr == stored_expr
assert destructive_multi_dilemma.expr._style_id == stored_expr._style_id
print("Passed sanity check: destructive_multi_dilemma matches stored_expr")
Passed sanity check: destructive_multi_dilemma matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m \in \mathbb{N}}~\left[\forall_{A_{1}, A_{2}, \ldots, A_{m}, B_{1}, B_{2}, \ldots, B_{m} \in \mathbb{B}~|~(\lnot A_{1}) \lor  (\lnot A_{2}) \lor  \ldots \lor  (\lnot A_{m}),\left(A_{1} \Rightarrow B_{1}\right), \left(A_{2} \Rightarrow B_{2}\right), \ldots, \left(A_{m} \Rightarrow B_{m}\right)}~\left((\lnot B_{1}) \lor  (\lnot B_{2}) \lor  \ldots \lor  (\lnot B_{m})\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
2Lambdaparameter: 45
body: 4
3ExprTuple45
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 41
operands: 9
7Literal
8ExprTuple10
9ExprTuple45, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple14, 15
13Conditionalvalue: 16
condition: 17
14ExprRangelambda_map: 18
start_index: 44
end_index: 45
15ExprRangelambda_map: 19
start_index: 44
end_index: 45
16Operationoperator: 31
operands: 20
17Operationoperator: 21
operands: 22
18Lambdaparameter: 57
body: 54
19Lambdaparameter: 57
body: 50
20ExprTuple23
21Literal
22ExprTuple24, 25, 26, 27
23ExprRangelambda_map: 28
start_index: 44
end_index: 45
24ExprRangelambda_map: 29
start_index: 44
end_index: 45
25ExprRangelambda_map: 30
start_index: 44
end_index: 45
26Operationoperator: 31
operands: 32
27ExprRangelambda_map: 33
start_index: 44
end_index: 45
28Lambdaparameter: 57
body: 34
29Lambdaparameter: 57
body: 35
30Lambdaparameter: 57
body: 36
31Literal
32ExprTuple37
33Lambdaparameter: 57
body: 38
34Operationoperator: 51
operand: 50
35Operationoperator: 41
operands: 40
36Operationoperator: 41
operands: 42
37ExprRangelambda_map: 43
start_index: 44
end_index: 45
38Operationoperator: 46
operands: 47
39ExprTuple50
40ExprTuple54, 48
41Literal
42ExprTuple50, 48
43Lambdaparameter: 57
body: 49
44Literal
45Variable
46Literal
47ExprTuple54, 50
48Literal
49Operationoperator: 51
operand: 54
50IndexedVarvariable: 53
index: 57
51Literal
52ExprTuple54
53Variable
54IndexedVarvariable: 55
index: 57
55Variable
56ExprTuple57
57Variable