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.sets.enumeration import false_for_one_is_false_for_all
In [2]:
# check that the built expression is the same as the stored expression
assert false_for_one_is_false_for_all.expr == stored_expr
assert false_for_one_is_false_for_all.expr._style_id == stored_expr._style_id
print("Passed sanity check: false_for_one_is_false_for_all matches stored_expr")
Passed sanity check: false_for_one_is_false_for_all matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}}~\left[\forall_{a_{1}, a_{2}, \ldots, a_{n}}~\left[\forall_{P}~\left(\left(\left(P\left(a_{1}\right) = \bot\right) \lor  \left(P\left(a_{2}\right) = \bot\right) \lor  \ldots \lor  \left(P\left(a_{n}\right) = \bot\right)\right) = \left(\left[\forall_{x \in \left\{a_{1}, a_{2}, \ldots, a_{n}\right\}}~P\left(x\right)\right] = \bot\right)\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: 25
operand: 2
1ExprTuple2
2Lambdaparameter: 48
body: 4
3ExprTuple48
4Conditionalvalue: 5
condition: 6
5Operationoperator: 25
operand: 9
6Operationoperator: 39
operands: 8
7ExprTuple9
8ExprTuple48, 10
9Lambdaparameters: 44
body: 11
10Literal
11Operationoperator: 25
operand: 13
12ExprTuple13
13Lambdaparameter: 37
body: 15
14ExprTuple37
15Operationoperator: 29
operands: 16
16ExprTuple17, 18
17Operationoperator: 19
operands: 20
18Operationoperator: 29
operands: 21
19Literal
20ExprTuple22
21ExprTuple23, 33
22ExprRangelambda_map: 24
start_index: 47
end_index: 48
23Operationoperator: 25
operand: 28
24Lambdaparameter: 52
body: 27
25Literal
26ExprTuple28
27Operationoperator: 29
operands: 30
28Lambdaparameter: 41
body: 31
29Literal
30ExprTuple32, 33
31Conditionalvalue: 34
condition: 35
32Operationoperator: 37
operand: 49
33Literal
34Operationoperator: 37
operand: 41
35Operationoperator: 39
operands: 40
36ExprTuple49
37Variable
38ExprTuple41
39Literal
40ExprTuple41, 42
41Variable
42Operationoperator: 43
operands: 44
43Literal
44ExprTuple45
45ExprRangelambda_map: 46
start_index: 47
end_index: 48
46Lambdaparameter: 52
body: 49
47Literal
48Variable
49IndexedVarvariable: 50
index: 52
50Variable
51ExprTuple52
52Variable