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 prob_of_all_events_transformation
In [2]:
# check that the built expression is the same as the stored expression
assert prob_of_all_events_transformation.expr == stored_expr
assert prob_of_all_events_transformation.expr._style_id == stored_expr._style_id
print("Passed sanity check: prob_of_all_events_transformation matches stored_expr")
Passed sanity check: prob_of_all_events_transformation 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_{A, B, Q}~\left[\begin{array}{l}\forall_{f \in \left[A \xrightarrow[]{\text{1-to-1}} \Omega\right], g \in \left[B \xrightarrow[\text{onto}]{\text{1-to-1}} A\right]}~\\
\left(\left[\textrm{Prob}_{x \in A~|~Q\left(x\right)}~f\left(x\right)\right] = \left[\textrm{Prob}_{y \in B~|~Q\left(g\left(y\right)\right)}~f\left(g\left(y\right)\right)\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: 14
operand: 2
1ExprTuple2
2Lambdaparameter: 47
body: 4
3ExprTuple47
4Conditionalvalue: 5
condition: 6
5Operationoperator: 14
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple47, 11
10Lambdaparameters: 12
body: 13
11Literal
12ExprTuple62, 64, 60
13Operationoperator: 14
operand: 16
14Literal
15ExprTuple16
16Lambdaparameters: 17
body: 18
17ExprTuple49, 66
18Conditionalvalue: 19
condition: 20
19Operationoperator: 21
operands: 22
20Operationoperator: 50
operands: 23
21Literal
22ExprTuple24, 25
23ExprTuple26, 27
24Operationoperator: 29
operand: 33
25Operationoperator: 29
operand: 34
26Operationoperator: 58
operands: 31
27Operationoperator: 58
operands: 32
28ExprTuple33
29Literal
30ExprTuple34
31ExprTuple49, 35
32ExprTuple66, 36
33Lambdaparameter: 63
body: 37
34Lambdaparameter: 68
body: 38
35Operationoperator: 39
operands: 40
36Operationoperator: 41
operands: 42
37Conditionalvalue: 43
condition: 44
38Conditionalvalue: 45
condition: 46
39Literal
40ExprTuple62, 47
41Literal
42ExprTuple64, 62
43Operationoperator: 49
operand: 63
44Operationoperator: 50
operands: 48
45Operationoperator: 49
operand: 65
46Operationoperator: 50
operands: 51
47Variable
48ExprTuple52, 53
49Variable
50Literal
51ExprTuple54, 55
52Operationoperator: 58
operands: 56
53Operationoperator: 60
operand: 63
54Operationoperator: 58
operands: 59
55Operationoperator: 60
operand: 65
56ExprTuple63, 62
57ExprTuple63
58Literal
59ExprTuple68, 64
60Variable
61ExprTuple65
62Variable
63Variable
64Variable
65Operationoperator: 66
operand: 68
66Variable
67ExprTuple68
68Variable