logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import e, m, X, defaults
from proveit.logic import Equals, InSet, NotEquals
from proveit.numbers import zero, one, two, Div, greater, NaturalPos, Neg, Real, subtract
# import common expressions
from proveit.physics.quantum.QPE import _Omega, _e_domain, _e_value, _two_pow_t
# import axioms, definitions
from proveit.physics.quantum.QPE import _n_ge_two, _success_def, _t_in_natural_pos, _t_req
# import theorems
from proveit.physics.quantum.QPE import (
    _e_value_in_e_domain, _failure_upper_bound, _pfail_in_real, _phase_is_real, 
    _success_complements_failure, _precision_guarantee_lemma_01, _precision_guarantee_lemma_02, 
    _sample_space_def, _Omega_is_sample_space, _sample_space_bijection)
In [2]:
%proving _precision_guarantee
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
_precision_guarantee:
(see dependencies)

We eventually need to show: $\left(|m - b|_{\text{mod}\,2^{t}}\le e \right) \Rightarrow \left(|\frac{m}{2^t}-\varphi|_{\text{mod}\,1} \le 2^{-n}\right)$

In [3]:
_success_def
In [4]:
_success_def_inst = _success_def.instantiate({e: _e_value})
_success_def_inst:  ⊢  
In [5]:
# keep this handy for later
success_prob = _success_def_inst.rhs
success_prob:
In [6]:
_success_complements_failure
In [7]:
_success_complements_failure_inst = _success_complements_failure.instantiate({e: _e_value})
_success_complements_failure_inst:  ⊢  
In [8]:
_failure_upper_bound
In [9]:
fail_bound = _failure_upper_bound.instantiate({e: _e_value})
fail_bound:  ⊢  
In [10]:
# need this (and its instantiation) for deduce_bound effort further below
_pfail_in_real
In [11]:
_pfail_in_real.instantiate({e: _e_value})
In [12]:
bound_01 = (
    _success_complements_failure_inst.rhs.deduce_bound(
        fail_bound, assumptions=[InSet(e, _e_domain)]))
bound_01:  ⊢  
In [13]:
_precision_guarantee_lemma_01
In [14]:
greater(success_prob, _precision_guarantee_lemma_01.rhs).prove()

We prove the success_prob above is a lower bound of the desired probability

That is because the desired condition, $\left|\frac{m}{2^{t}} - \varphi\right|_{\rm{mod}\thinspace 1} \leq 2^{-n}$, is a weaker constraint than the $\left|m - b_{\textit{f}}\right|_{\rm{mod}\thinspace 2^{t}} \leq \left(2^{t - n} - 1\right) $. _sample_space_def, _Omega_is_sample_space, and sample_space_bijection are needed for this.

In [15]:
_precision_guarantee_lemma_02
In [16]:
thm_condition = _precision_guarantee_lemma_02.instantiate(
    assumptions=_precision_guarantee_lemma_02.conditions)
thm_condition: ,  ⊢  
In [17]:
success_prob.weaker_condition_bound(thm_condition.expr, _Omega)
_precision_guarantee may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [18]:
%qed
proveit.physics.quantum.QPE._precision_guarantee has been proven.
Out[18]:
 step typerequirementsstatement
0instantiation1, 2  ⊢  
  : , :
1conjecture  ⊢  
 proveit.numbers.ordering.relax_less
2instantiation106, 3, 4  ⊢  
  : , : , :
3instantiation5, 6, 7  ⊢  
  : , : , :
4modus ponens8, 9  ⊢  
5theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
6instantiation10, 11, 12  ⊢  
  : , : , :
7instantiation13, 113  ⊢  
  :
8instantiation14, 15, 16  ⊢  
  : , : , : , : , : , :
9conjecture  ⊢  
 proveit.physics.quantum.QPE._precision_guarantee_lemma_02
10theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
11instantiation106, 17, 18  ⊢  
  : , : , :
12instantiation19, 113  ⊢  
  :
13axiom  ⊢  
 proveit.physics.quantum.QPE._success_def
14conjecture  ⊢  
 proveit.statistics.constrained_event_prob_bound
15conjecture  ⊢  
 proveit.physics.quantum.QPE._Omega_is_sample_space
16instantiation40, 20  ⊢  
  : , :
17conjecture  ⊢  
 proveit.physics.quantum.QPE._precision_guarantee_lemma_01
18instantiation21, 58, 22, 23, 24, 25*  ⊢  
  : , : , :
19conjecture  ⊢  
 proveit.physics.quantum.QPE._success_complements_failure
20instantiation26, 27  ⊢  
  : , : , :
21conjecture  ⊢  
 proveit.numbers.addition.weak_bound_via_right_term_bound
22instantiation43, 48, 49  ⊢  
  : , :
23instantiation53, 29  ⊢  
  :
24instantiation28, 29, 30, 31, 32*  ⊢  
  : , :
25instantiation33, 114, 125, 34, 35, 36, 37, 38, 39  ⊢  
  : , : , : , : , : , :
26conjecture  ⊢  
 proveit.logic.sets.functions.injections.membership_unfolding
27instantiation40, 41  ⊢  
  : , :
28conjecture  ⊢  
 proveit.numbers.negation.negated_weak_bound
29instantiation42, 113  ⊢  
  :
30instantiation43, 52, 54  ⊢  
  : , :
31instantiation44, 113  ⊢  
  :
32instantiation45, 46, 47  ⊢  
  : , :
33conjecture  ⊢  
 proveit.numbers.addition.disassociation
34axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
35instantiation75  ⊢  
  : , :
36conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
37instantiation132, 86, 58  ⊢  
  : , : , :
38instantiation132, 86, 48  ⊢  
  : , : , :
39instantiation132, 86, 49  ⊢  
  : , : , :
40theorem  ⊢  
 proveit.logic.booleans.conjunction.left_from_and
41instantiation50, 51  ⊢  
  : , : , :
42conjecture  ⊢  
 proveit.physics.quantum.QPE._pfail_in_real
43conjecture  ⊢  
 proveit.numbers.addition.add_real_closure_bin
44conjecture  ⊢  
 proveit.physics.quantum.QPE._failure_upper_bound
45conjecture  ⊢  
 proveit.numbers.negation.distribute_neg_through_binary_sum
46instantiation132, 86, 52  ⊢  
  : , : , :
47instantiation132, 86, 54  ⊢  
  : , : , :
48instantiation53, 52  ⊢  
  :
49instantiation53, 54  ⊢  
  :
50conjecture  ⊢  
 proveit.logic.sets.functions.bijections.membership_unfolding
51conjecture  ⊢  
 proveit.physics.quantum.QPE._sample_space_bijection
52instantiation57, 58, 55, 56  ⊢  
  : , :
53conjecture  ⊢  
 proveit.numbers.negation.real_closure
54instantiation57, 58, 59, 60  ⊢  
  : , :
55instantiation64, 87, 74  ⊢  
  : , :
56instantiation67, 125, 61, 62, 78  ⊢  
  : , :
57conjecture  ⊢  
 proveit.numbers.division.div_real_closure
58instantiation132, 93, 63  ⊢  
  : , : , :
59instantiation64, 65, 66  ⊢  
  : , :
60instantiation67, 125, 68, 69, 70  ⊢  
  : , :
61instantiation75  ⊢  
  : , :
62instantiation132, 84, 71  ⊢  
  : , : , :
63instantiation132, 99, 111  ⊢  
  : , : , :
64conjecture  ⊢  
 proveit.numbers.multiplication.mult_real_closure_bin
65instantiation132, 93, 72  ⊢  
  : , : , :
66instantiation73, 74, 125  ⊢  
  : , :
67conjecture  ⊢  
 proveit.numbers.multiplication.mult_not_eq_zero
68instantiation75  ⊢  
  : , :
69instantiation132, 84, 76  ⊢  
  : , : , :
70instantiation77, 78, 79  ⊢  
  : , :
71instantiation132, 91, 80  ⊢  
  : , : , :
72instantiation132, 99, 81  ⊢  
  : , : , :
73conjecture  ⊢  
 proveit.numbers.exponentiation.exp_real_closure_nat_power
74instantiation132, 93, 82  ⊢  
  : , : , :
75conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_2_typical_eq
76instantiation132, 91, 83  ⊢  
  : , : , :
77conjecture  ⊢  
 proveit.numbers.exponentiation.exp_complex_nonzero_closure
78instantiation132, 84, 85  ⊢  
  : , : , :
79instantiation132, 86, 87  ⊢  
  : , : , :
80instantiation132, 97, 88  ⊢  
  : , : , :
81instantiation132, 124, 89  ⊢  
  : , : , :
82instantiation132, 99, 103  ⊢  
  : , : , :
83instantiation132, 97, 90  ⊢  
  : , : , :
84conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_nonzero_within_complex_nonzero
85instantiation132, 91, 92  ⊢  
  : , : , :
86conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_within_complex
87instantiation132, 93, 94  ⊢  
  : , : , :
88instantiation132, 100, 95  ⊢  
  : , : , :
89conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat4
90instantiation132, 100, 96  ⊢  
  : , : , :
91conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_nonzero_within_real_nonzero
92instantiation132, 97, 98  ⊢  
  : , : , :
93conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_within_real
94instantiation132, 99, 120  ⊢  
  : , : , :
95conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat2
96conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat4
97conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.nonzero_int_within_rational_nonzero
98instantiation132, 100, 101  ⊢  
  : , : , :
99conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.int_within_rational
100conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_nonzero_int
101instantiation102, 103, 104  ⊢  
  :
102conjecture  ⊢  
 proveit.numbers.number_sets.integers.pos_int_is_natural_pos
103instantiation132, 105, 113  ⊢  
  : , : , :
104instantiation106, 107, 108  ⊢  
  : , : , :
105instantiation109, 111, 112  ⊢  
  : , :
106conjecture  ⊢  
 proveit.numbers.ordering.transitivity_less_less_eq
107conjecture  ⊢  
 proveit.numbers.numerals.decimals.less_0_1
108instantiation110, 111, 112, 113  ⊢  
  : , : , :
109conjecture  ⊢  
 proveit.numbers.number_sets.integers.int_interval_within_int
110conjecture  ⊢  
 proveit.numbers.number_sets.integers.interval_lower_bound
111instantiation132, 124, 114  ⊢  
  : , : , :
112instantiation126, 115, 116  ⊢  
  : , :
113conjecture  ⊢  
 proveit.physics.quantum.QPE._e_value_in_e_domain
114theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
115instantiation117, 120, 118  ⊢  
  : , :
116instantiation119, 120  ⊢  
  :
117conjecture  ⊢  
 proveit.numbers.exponentiation.exp_int_closure
118instantiation121, 122, 123  ⊢  
  :
119conjecture  ⊢  
 proveit.numbers.negation.int_closure
120instantiation132, 124, 125  ⊢  
  : , : , :
121conjecture  ⊢  
 proveit.numbers.number_sets.integers.nonneg_int_is_natural
122instantiation126, 127, 128  ⊢  
  : , :
123instantiation129, 130  ⊢  
  : , :
124conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_within_int
125conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat2
126conjecture  ⊢  
 proveit.numbers.addition.add_int_closure_bin
127instantiation132, 131, 136  ⊢  
  : , : , :
128instantiation132, 133, 134  ⊢  
  : , : , :
129conjecture  ⊢  
 proveit.numbers.addition.subtraction.nonneg_difference
130instantiation135, 136  ⊢  
  :
131conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_int
132theorem  ⊢  
 proveit.logic.sets.inclusion.superset_membership_from_proper_subset
133conjecture  ⊢  
 proveit.numbers.number_sets.integers.neg_int_within_int
134instantiation137, 138  ⊢  
  :
135conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.natural_pos_lower_bound
136axiom  ⊢  
 proveit.physics.quantum.QPE._t_in_natural_pos
137conjecture  ⊢  
 proveit.numbers.negation.int_neg_closure
138conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat1
*equality replacement requirements