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 complementary_event_prob_of_all
In [2]:
# check that the built expression is the same as the stored expression
assert complementary_event_prob_of_all.expr == stored_expr
assert complementary_event_prob_of_all.expr._style_id == stored_expr._style_id
print("Passed sanity check: complementary_event_prob_of_all matches stored_expr")
Passed sanity check: complementary_event_prob_of_all 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[\forall_{f \in \left[X \xrightarrow[\text{onto}]{\text{1-to-1}} \Omega\right]}~\left[\forall_{Q, R}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{x \in X}~\left(Q\left(x\right) = (\lnot R\left(x\right))\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] =  \\ \left(1 - \left[\textrm{Prob}_{y \in X~|~R\left(y\right)}~f\left(y\right)\right]\right) \end{array} \end{array}\right) \end{array} \end{array}\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: 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: 81
body: 13
11Literal
12ExprTuple81
13Operationoperator: 33
operand: 15
14ExprTuple15
15Lambdaparameter: 72
body: 17
16ExprTuple72
17Conditionalvalue: 18
condition: 19
18Operationoperator: 33
operand: 22
19Operationoperator: 77
operands: 21
20ExprTuple22
21ExprTuple72, 23
22Lambdaparameters: 24
body: 25
23Operationoperator: 26
operands: 27
24ExprTuple66, 79
25Operationoperator: 28
operands: 29
26Literal
27ExprTuple81, 30
28Literal
29ExprTuple31, 32
30Variable
31Operationoperator: 33
operand: 36
32Operationoperator: 47
operands: 35
33Literal
34ExprTuple36
35ExprTuple37, 38
36Lambdaparameter: 69
body: 39
37Operationoperator: 59
operand: 44
38Operationoperator: 41
operands: 42
39Conditionalvalue: 43
condition: 62
40ExprTuple44
41Literal
42ExprTuple45, 46
43Operationoperator: 47
operands: 48
44Lambdaparameter: 69
body: 49
45Literal
46Operationoperator: 50
operand: 55
47Literal
48ExprTuple63, 52
49Conditionalvalue: 53
condition: 54
50Literal
51ExprTuple55
52Operationoperator: 56
operand: 61
53Operationoperator: 72
operand: 69
54Operationoperator: 73
operands: 58
55Operationoperator: 59
operand: 64
56Literal
57ExprTuple61
58ExprTuple62, 63
59Literal
60ExprTuple64
61Operationoperator: 79
operand: 69
62Operationoperator: 77
operands: 65
63Operationoperator: 66
operand: 69
64Lambdaparameter: 82
body: 68
65ExprTuple69, 81
66Variable
67ExprTuple69
68Conditionalvalue: 70
condition: 71
69Variable
70Operationoperator: 72
operand: 82
71Operationoperator: 73
operands: 74
72Variable
73Literal
74ExprTuple75, 76
75Operationoperator: 77
operands: 78
76Operationoperator: 79
operand: 82
77Literal
78ExprTuple82, 81
79Variable
80ExprTuple82
81Variable
82Variable