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 sample_space_via_bijections
In [2]:
# check that the built expression is the same as the stored expression
assert sample_space_via_bijections.expr == stored_expr
assert sample_space_via_bijections.expr._style_id == stored_expr._style_id
print("Passed sanity check: sample_space_via_bijections matches stored_expr")
Passed sanity check: sample_space_via_bijections 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, Y}~\left[\forall_{f \in \left[X \xrightarrow[\text{onto}]{\text{1-to-1}} \Omega\right], g \in \left[X \xrightarrow[\text{onto}]{\text{1-to-1}} Y\right]}~\left(\begin{array}{c} \begin{array}{l} \left[\forall_{x \in X}~\left(\textrm{Pr}\left(f\left(x\right)\right) = \textrm{Pr}\left(g\left(x\right)\right)\right)\right] \\  \Rightarrow \left(Y \underset{{\scriptscriptstyle c}}{\in} \textrm{SampleSpaces}\right) \end{array} \end{array}\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: 41
body: 4
3ExprTuple41
4Conditionalvalue: 5
condition: 6
5Operationoperator: 25
operand: 9
6Operationoperator: 27
operands: 8
7ExprTuple9
8ExprTuple41, 32
9Lambdaparameters: 38
body: 10
10Operationoperator: 25
operand: 12
11ExprTuple12
12Lambdaparameters: 13
body: 14
13ExprTuple55, 56
14Conditionalvalue: 15
condition: 16
15Operationoperator: 17
operands: 18
16Operationoperator: 19
operands: 20
17Literal
18ExprTuple21, 22
19Literal
20ExprTuple23, 24
21Operationoperator: 25
operand: 31
22Operationoperator: 27
operands: 28
23Operationoperator: 45
operands: 29
24Operationoperator: 45
operands: 30
25Literal
26ExprTuple31
27Literal
28ExprTuple42, 32
29ExprTuple55, 33
30ExprTuple56, 34
31Lambdaparameter: 58
body: 35
32Literal
33Operationoperator: 37
operands: 36
34Operationoperator: 37
operands: 38
35Conditionalvalue: 39
condition: 40
36ExprTuple49, 41
37Literal
38ExprTuple49, 42
39Operationoperator: 43
operands: 44
40Operationoperator: 45
operands: 46
41Variable
42Variable
43Literal
44ExprTuple47, 48
45Literal
46ExprTuple58, 49
47Operationoperator: 51
operand: 53
48Operationoperator: 51
operand: 54
49Variable
50ExprTuple53
51Literal
52ExprTuple54
53Operationoperator: 55
operand: 58
54Operationoperator: 56
operand: 58
55Variable
56Variable
57ExprTuple58
58Variable