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.statistics import constrained_event_prob_bound
In [2]:
# check that the built expression is the same as the stored expression
assert constrained_event_prob_bound.expr == stored_expr
assert constrained_event_prob_bound.expr._style_id == stored_expr._style_id
print("Passed sanity check: constrained_event_prob_bound matches stored_expr")
Passed sanity check: constrained_event_prob_bound matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{\Omega \underset{{\scriptscriptstyle c}}{\in} \textrm{SampleSpaces}}~\left[\forall_{X}~\left[\begin{array}{l}\forall_{f \in \left[X \rightarrow \Omega\right]}~\\
\left[\forall_{Q, R}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{x \in X~|~Q\left(x\right)}~R\left(x\right)\right] \Rightarrow  \\ \left(\begin{array}{c} \begin{array}{l} \left[\textrm{Prob}_{x \in X~|~Q\left(x\right)}~f\left(x\right)\right] \leq  \\ \left[\textrm{Prob}_{x \in X~|~R\left(x\right)}~f\left(x\right)\right] \end{array} \end{array}\right) \end{array} \end{array}\right)\right]\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: 33
operand: 2
1ExprTuple2
2Lambdaparameter: 30
body: 4
3ExprTuple30
4Conditionalvalue: 5
condition: 6
5Operationoperator: 33
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple30, 11
10Lambdaparameter: 63
body: 13
11Literal
12ExprTuple63
13Operationoperator: 33
operand: 15
14ExprTuple15
15Lambdaparameter: 52
body: 17
16ExprTuple52
17Conditionalvalue: 18
condition: 19
18Operationoperator: 33
operand: 22
19Operationoperator: 59
operands: 21
20ExprTuple22
21ExprTuple52, 23
22Lambdaparameters: 24
body: 25
23Operationoperator: 26
operands: 27
24ExprTuple58, 61
25Operationoperator: 28
operands: 29
26Literal
27ExprTuple63, 30
28Literal
29ExprTuple31, 32
30Variable
31Operationoperator: 33
operand: 37
32Operationoperator: 35
operands: 36
33Literal
34ExprTuple37
35Literal
36ExprTuple38, 39
37Lambdaparameter: 64
body: 40
38Operationoperator: 42
operand: 44
39Operationoperator: 42
operand: 45
40Conditionalvalue: 57
condition: 48
41ExprTuple44
42Literal
43ExprTuple45
44Lambdaparameter: 64
body: 46
45Lambdaparameter: 64
body: 47
46Conditionalvalue: 49
condition: 48
47Conditionalvalue: 49
condition: 50
48Operationoperator: 53
operands: 51
49Operationoperator: 52
operand: 64
50Operationoperator: 53
operands: 54
51ExprTuple56, 55
52Variable
53Literal
54ExprTuple56, 57
55Operationoperator: 58
operand: 64
56Operationoperator: 59
operands: 60
57Operationoperator: 61
operand: 64
58Variable
59Literal
60ExprTuple64, 63
61Variable
62ExprTuple64
63Variable
64Variable