logo

Theorem prob_of_all_as_sum of type Forall

from the theory of proveit.statistics

see dependencies

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 prob_of_all_as_sum
In [2]:
# check that the built expression is the same as the stored expression
assert prob_of_all_as_sum.expr == stored_expr
assert prob_of_all_as_sum.expr._style_id == stored_expr._style_id
print("Passed sanity check: prob_of_all_as_sum matches stored_expr")
Passed sanity check: prob_of_all_as_sum 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{1-to-1}} \Omega\right]}~\left[\forall_{Q}~\left(\begin{array}{c} \begin{array}{l} \left[\textrm{Prob}_{x \in X~|~Q\left(x\right)}~f\left(x\right)\right] =  \\ \left[\sum_{x \in X~|~Q\left(x\right)}~\textrm{Pr}\left(f\left(x\right)\right)\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: 20
operand: 2
1ExprTuple2
2Lambdaparameter: 31
body: 4
3ExprTuple31
4Conditionalvalue: 5
condition: 6
5Operationoperator: 20
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple31, 11
10Lambdaparameter: 56
body: 13
11Literal
12ExprTuple56
13Operationoperator: 20
operand: 15
14ExprTuple15
15Lambdaparameter: 51
body: 17
16ExprTuple51
17Conditionalvalue: 18
condition: 19
18Operationoperator: 20
operand: 23
19Operationoperator: 52
operands: 22
20Literal
21ExprTuple23
22ExprTuple51, 24
23Lambdaparameter: 54
body: 26
24Operationoperator: 27
operands: 28
25ExprTuple54
26Operationoperator: 29
operands: 30
27Literal
28ExprTuple56, 31
29Literal
30ExprTuple32, 33
31Variable
32Operationoperator: 34
operand: 38
33Operationoperator: 36
operand: 39
34Literal
35ExprTuple38
36Literal
37ExprTuple39
38Lambdaparameter: 57
body: 40
39Lambdaparameter: 57
body: 41
40Conditionalvalue: 48
condition: 43
41Conditionalvalue: 42
condition: 43
42Operationoperator: 44
operand: 48
43Operationoperator: 46
operands: 47
44Literal
45ExprTuple48
46Literal
47ExprTuple49, 50
48Operationoperator: 51
operand: 57
49Operationoperator: 52
operands: 53
50Operationoperator: 54
operand: 57
51Variable
52Literal
53ExprTuple57, 56
54Variable
55ExprTuple57
56Variable
57Variable