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.core_expr_types.conditionals import true_condition_elimination
In [2]:
# check that the built expression is the same as the stored expression
assert true_condition_elimination.expr == stored_expr
assert true_condition_elimination.expr._style_id == stored_expr._style_id
print("Passed sanity check: true_condition_elimination matches stored_expr")
Passed sanity check: true_condition_elimination matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m, n \in \mathbb{N}}~\left[\forall_{a, Q_{1}, Q_{2}, \ldots, Q_{m}, R_{1}, R_{2}, \ldots, R_{n}}~\left(\begin{array}{c} \begin{array}{l} \left\{a \textrm{ if } Q_{1} ,  Q_{2} ,  \ldots ,  Q_{m} ,  \top, R_{1} ,  R_{2} ,  \ldots ,  R_{n}\right.. \\  = \left\{a \textrm{ if } Q_{1} ,  Q_{2} ,  \ldots ,  Q_{m}, R_{1} ,  R_{2} ,  \ldots ,  R_{n}\right.. \end{array} \end{array}\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
3ExprTuple33, 36
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 27
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12
10Lambdaparameters: 13
body: 14
11Operationoperator: 16
operands: 15
12Operationoperator: 16
operands: 17
13ExprTuple24, 30, 31
14Operationoperator: 18
operands: 19
15ExprTuple33, 20
16Literal
17ExprTuple36, 20
18Literal
19ExprTuple21, 22
20Literal
21Conditionalvalue: 24
condition: 23
22Conditionalvalue: 24
condition: 25
23Operationoperator: 27
operands: 26
24Variable
25Operationoperator: 27
operands: 28
26ExprTuple30, 29, 31
27Literal
28ExprTuple30, 31
29Literal
30ExprRangelambda_map: 32
start_index: 35
end_index: 33
31ExprRangelambda_map: 34
start_index: 35
end_index: 36
32Lambdaparameter: 42
body: 37
33Variable
34Lambdaparameter: 42
body: 38
35Literal
36Variable
37IndexedVarvariable: 39
index: 42
38IndexedVarvariable: 40
index: 42
39Variable
40Variable
41ExprTuple42
42Variable