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.physics.quantum.QPE import _fail_sum_prob_conds_equiv_lemma
In [2]:
# check that the built expression is the same as the stored expression
assert _fail_sum_prob_conds_equiv_lemma.expr == stored_expr
assert _fail_sum_prob_conds_equiv_lemma.expr._style_id == stored_expr._style_id
print("Passed sanity check: _fail_sum_prob_conds_equiv_lemma matches stored_expr")
Passed sanity check: _fail_sum_prob_conds_equiv_lemma matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\begin{array}{l}\forall_{l}~\\
\left[\begin{array}{l}\forall_{e \in \{1~\ldotp \ldotp~2^{t - 1} - 2\}}~\\
\left(\begin{array}{c} \begin{array}{l} \left(\left(l \in \left(\{-2^{t - 1} + 1~\ldotp \ldotp~-\left(e + 1\right)\} \cup \{e + 1~\ldotp \ldotp~2^{t - 1}\}\right)\right) \land \left(\left|l\right|_{\textup{mod}\thinspace 2^{t}} > e\right)\right) \\  \Leftrightarrow \left(\left(l \in \{-2^{t - 1} + 1~\ldotp \ldotp~2^{t - 1}\}\right) \land \left(\left|l\right|_{\textup{mod}\thinspace 2^{t}} > e\right)\right) \end{array} \end{array}\right)\end{array}\right]\end{array}
In [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneTrue('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: 5
operand: 2
1ExprTuple2
2Lambdaparameter: 44
body: 4
3ExprTuple44
4Operationoperator: 5
operand: 7
5Literal
6ExprTuple7
7Lambdaparameter: 59
body: 9
8ExprTuple59
9Conditionalvalue: 10
condition: 11
10Operationoperator: 12
operands: 13
11Operationoperator: 27
operands: 14
12Literal
13ExprTuple15, 16
14ExprTuple59, 17
15Operationoperator: 19
operands: 18
16Operationoperator: 19
operands: 20
17Operationoperator: 47
operands: 21
18ExprTuple22, 24
19Literal
20ExprTuple23, 24
21ExprTuple70, 25
22Operationoperator: 27
operands: 26
23Operationoperator: 27
operands: 28
24Operationoperator: 29
operands: 30
25Operationoperator: 64
operands: 31
26ExprTuple44, 32
27Literal
28ExprTuple44, 33
29Literal
30ExprTuple59, 34
31ExprTuple58, 35
32Operationoperator: 36
operands: 37
33Operationoperator: 47
operands: 38
34Operationoperator: 39
operands: 40
35Operationoperator: 68
operand: 62
36Literal
37ExprTuple42, 43
38ExprTuple50, 58
39Literal
40ExprTuple44, 45
41ExprTuple62
42Operationoperator: 47
operands: 46
43Operationoperator: 47
operands: 48
44Variable
45Operationoperator: 60
operands: 49
46ExprTuple50, 51
47Literal
48ExprTuple55, 58
49ExprTuple62, 66
50Operationoperator: 64
operands: 52
51Operationoperator: 68
operand: 55
52ExprTuple54, 70
53ExprTuple55
54Operationoperator: 68
operand: 58
55Operationoperator: 64
operands: 57
56ExprTuple58
57ExprTuple59, 70
58Operationoperator: 60
operands: 61
59Variable
60Literal
61ExprTuple62, 63
62Literal
63Operationoperator: 64
operands: 65
64Literal
65ExprTuple66, 67
66Literal
67Operationoperator: 68
operand: 70
68Literal
69ExprTuple70
70Literal