logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit.logic import Equals, InSet
from proveit.numbers import Integer, Mult
from proveit.numbers.rounding import real_minus_floor_interval
from proveit.physics.quantum.QPE import (
    _phase, _two_pow_t, _two_pow__t_minus_one)
from proveit.physics.quantum.QPE import (
    _best_floor_def, _best_floor_is_in_m_domain, _delta_b_def, _phase_is_real, _t_in_natural_pos) 
In [2]:
%proving _scaled_delta_b_floor_in_interval
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
_scaled_delta_b_floor_in_interval:
(see dependencies)
In [3]:
scaled_delta = _scaled_delta_b_floor_in_interval.operands[0]
scaled_delta:
In [4]:
# interestingly, just importing this _delta_b_def can raise cascading
# side-effect errors and an eventual max recursion error unless
# we firt import some other seemingly unrelated items in the imports above
_delta_b_def
In [5]:
_best_floor_def

Elsewhere we have already established that $b_{f} \in \{0, \ldots, 2^t - 1\}$:

In [6]:
_best_floor_is_in_m_domain
In [7]:
from proveit import b
from proveit.physics.quantum.QPE import _b_floor
_delta_b_def_inst = _delta_b_def.instantiate({b: _b_floor})
_delta_b_def_inst:  ⊢  
In [8]:
eq_01 = _delta_b_def_inst.substitution(scaled_delta)
eq_01:  ⊢  
In [9]:
eq_02 = eq_01.inner_expr().rhs.distribute(1)
eq_02:  ⊢  
In [10]:
_best_floor_def_commuted = _best_floor_def.inner_expr().rhs.operands[0].commute()
_best_floor_def_commuted:  ⊢  
In [11]:
eq_03 = (eq_02.inner_expr().rhs.operands[1].
         operand.substitute(_best_floor_def_commuted.rhs))
eq_03:  ⊢  

$(2^t\cdot\delta_{b_f})$ has now been expressed in the form $x - \lfloor x \rfloor$, and we have a theorem for the value of such an expression:

In [12]:
real_minus_floor_interval

To instantiate that theorem, we need to know that our argument $x = (2^t\cdot\varphi)$ is Real. In the imports in the top cell we have imported the _phase_is_real theorem and the _t_in_natural_pos axiom, which combined are sufficient for Prove-It to know that $(2^t\cdot\varphi)$ is Real:

In [13]:
_phase_is_real
In [14]:
_t_in_natural_pos
In [15]:
from proveit import x
interval_claim = real_minus_floor_interval.instantiate({x:Mult(_two_pow_t, _phase)})
interval_claim:  ⊢  
In [16]:
eq_04 = Equals(scaled_delta, interval_claim.element).prove()
eq_04:  ⊢  
In [17]:
eq_04.sub_left_side_into(interval_claim)
_scaled_delta_b_floor_in_interval has been proven.  Now simply execute "%qed".
In [18]:
%qed
proveit.physics.quantum.QPE._scaled_delta_b_floor_in_interval has been proven.
Out[18]:
 step typerequirementsstatement
0instantiation1, 2, 3  ⊢  
  : , : , :
1theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
2instantiation4, 5  ⊢  
  :
3instantiation59, 6, 7  ⊢  
  : , : , :
4conjecture  ⊢  
 proveit.numbers.rounding.real_minus_floor_interval
5instantiation8, 82, 45  ⊢  
  : , :
6instantiation29, 9, 10  ⊢  
  : , : , :
7instantiation69, 11  ⊢  
  : , : , :
8conjecture  ⊢  
 proveit.numbers.multiplication.mult_real_closure_bin
9instantiation29, 12, 13  ⊢  
  : , : , :
10instantiation29, 14, 28  ⊢  
  : , : , :
11instantiation69, 15  ⊢  
  : , : , :
12instantiation69, 16  ⊢  
  : , : , :
13instantiation17, 107, 18, 19, 79, 37, 20, 21*  ⊢  
  : , : , : , : , : , :
14axiom  ⊢  
 proveit.physics.quantum.QPE._best_floor_def
15instantiation22, 23  ⊢  
  : , :
16instantiation24, 80  ⊢  
  :
17conjecture  ⊢  
 proveit.numbers.multiplication.distribute_through_subtract
18axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
19conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
20instantiation25, 53, 79, 47  ⊢  
  : , :
21instantiation29, 26, 27  ⊢  
  : , : , :
22theorem  ⊢  
 proveit.logic.equality.equals_reversal
23instantiation69, 28  ⊢  
  : , : , :
24axiom  ⊢  
 proveit.physics.quantum.QPE._delta_b_def
25conjecture  ⊢  
 proveit.numbers.division.div_complex_closure
26instantiation29, 30, 31  ⊢  
  : , : , :
27instantiation32, 33, 34, 35  ⊢  
  : , : , : , :
28instantiation36, 79, 37  ⊢  
  : , :
29theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
30instantiation38, 52, 53, 39, 40  ⊢  
  : , : , : , : , :
31instantiation59, 41, 42  ⊢  
  : , : , :
32conjecture  ⊢  
 proveit.logic.equality.four_chain_transitivity
33instantiation69, 43  ⊢  
  : , : , :
34instantiation69, 44  ⊢  
  : , : , :
35instantiation78, 53  ⊢  
  :
36conjecture  ⊢  
 proveit.numbers.multiplication.commutation
37instantiation105, 81, 45  ⊢  
  : , : , :
38conjecture  ⊢  
 proveit.numbers.division.mult_frac_cancel_numer_left
39instantiation46, 79, 47  ⊢  
  :
40instantiation105, 48, 49  ⊢  
  : , : , :
41instantiation69, 50  ⊢  
  : , : , :
42instantiation69, 51  ⊢  
  : , : , :
43instantiation71, 52  ⊢  
  :
44instantiation71, 53  ⊢  
  :
45conjecture  ⊢  
 proveit.physics.quantum.QPE._phase_is_real
46conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.nonzero_complex_is_complex_nonzero
47instantiation54, 55, 56  ⊢  
  : , :
48conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_nonzero_within_complex_nonzero
49instantiation105, 57, 58  ⊢  
  : , : , :
50instantiation59, 60, 61  ⊢  
  : , : , :
51instantiation69, 62  ⊢  
  : , : , :
52instantiation105, 81, 63  ⊢  
  : , : , :
53instantiation105, 81, 64  ⊢  
  : , : , :
54conjecture  ⊢  
 proveit.numbers.exponentiation.exp_rational_non_zero__not_zero
55instantiation105, 67, 65  ⊢  
  : , : , :
56instantiation105, 67, 66  ⊢  
  : , : , :
57conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_nonzero_within_real_nonzero
58instantiation105, 67, 68  ⊢  
  : , : , :
59axiom  ⊢  
 proveit.logic.equality.equals_transitivity
60instantiation69, 70  ⊢  
  : , : , :
61instantiation71, 79  ⊢  
  :
62instantiation72, 79  ⊢  
  :
63instantiation105, 86, 73  ⊢  
  : , : , :
64instantiation105, 86, 74  ⊢  
  : , : , :
65instantiation105, 76, 75  ⊢  
  : , : , :
66instantiation105, 76, 104  ⊢  
  : , : , :
67conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.nonzero_int_within_rational_nonzero
68instantiation105, 76, 77  ⊢  
  : , : , :
69axiom  ⊢  
 proveit.logic.equality.substitution
70instantiation78, 79  ⊢  
  :
71conjecture  ⊢  
 proveit.numbers.division.frac_one_denom
72conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_right
73instantiation105, 90, 101  ⊢  
  : , : , :
74instantiation105, 90, 80  ⊢  
  : , : , :
75conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat2
76conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_nonzero_int
77conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat1
78conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_left
79instantiation105, 81, 82  ⊢  
  : , : , :
80instantiation83, 84, 85  ⊢  
  : , : , :
81conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_within_complex
82instantiation105, 86, 87  ⊢  
  : , : , :
83theorem  ⊢  
 proveit.logic.sets.inclusion.unfold_subset_eq
84instantiation88, 89  ⊢  
  : , :
85conjecture  ⊢  
 proveit.physics.quantum.QPE._best_floor_is_in_m_domain
86conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_within_real
87instantiation105, 90, 95  ⊢  
  : , : , :
88theorem  ⊢  
 proveit.logic.sets.inclusion.relax_proper_subset
89instantiation91, 92, 93  ⊢  
  : , :
90conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.int_within_rational
91conjecture  ⊢  
 proveit.numbers.number_sets.integers.int_interval_within_int
92conjecture  ⊢  
 proveit.numbers.number_sets.integers.zero_is_int
93instantiation94, 95, 96  ⊢  
  : , :
94conjecture  ⊢  
 proveit.numbers.addition.add_int_closure_bin
95instantiation97, 98, 99  ⊢  
  : , :
96instantiation100, 101  ⊢  
  :
97conjecture  ⊢  
 proveit.numbers.exponentiation.exp_int_closure
98instantiation105, 106, 102  ⊢  
  : , : , :
99instantiation105, 103, 104  ⊢  
  : , : , :
100conjecture  ⊢  
 proveit.numbers.negation.int_closure
101instantiation105, 106, 107  ⊢  
  : , : , :
102conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat2
103conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.nat_pos_within_nat
104axiom  ⊢  
 proveit.physics.quantum.QPE._t_in_natural_pos
105theorem  ⊢  
 proveit.logic.sets.inclusion.superset_membership_from_proper_subset
106conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_within_int
107theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
*equality replacement requirements