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 singular_constructive_multi_dilemma
In [2]:
# check that the built expression is the same as the stored expression
assert singular_constructive_multi_dilemma.expr == stored_expr
assert singular_constructive_multi_dilemma.expr._style_id == stored_expr._style_id
print("Passed sanity check: singular_constructive_multi_dilemma matches stored_expr")
Passed sanity check: singular_constructive_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} \in \mathbb{B}~|~A_{1} \lor  A_{2} \lor  \ldots \lor  A_{m}}~\left[\forall_{C~|~\left(A_{1} \Rightarrow C\right), \left(A_{2} \Rightarrow C\right), \ldots, \left(A_{m} \Rightarrow C\right)}~C\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: 14
operand: 2
1ExprTuple2
2Lambdaparameter: 37
body: 4
3ExprTuple37
4Conditionalvalue: 5
condition: 6
5Operationoperator: 14
operand: 9
6Operationoperator: 30
operands: 8
7ExprTuple9
8ExprTuple37, 10
9Lambdaparameters: 24
body: 11
10Literal
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 17
13Operationoperator: 28
operands: 16
14Literal
15ExprTuple17
16ExprTuple18, 19
17Lambdaparameter: 42
body: 21
18ExprRangelambda_map: 22
start_index: 36
end_index: 37
19Operationoperator: 23
operands: 24
20ExprTuple42
21Conditionalvalue: 42
condition: 25
22Lambdaparameter: 45
body: 26
23Literal
24ExprTuple27
25Operationoperator: 28
operands: 29
26Operationoperator: 30
operands: 31
27ExprRangelambda_map: 32
start_index: 36
end_index: 37
28Literal
29ExprTuple33
30Literal
31ExprTuple41, 34
32Lambdaparameter: 45
body: 41
33ExprRangelambda_map: 35
start_index: 36
end_index: 37
34Literal
35Lambdaparameter: 45
body: 38
36Literal
37Variable
38Operationoperator: 39
operands: 40
39Literal
40ExprTuple41, 42
41IndexedVarvariable: 43
index: 45
42Variable
43Variable
44ExprTuple45
45Variable