logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import b, x
from proveit.logic import Equals
from proveit.numbers import one, two, Add, frac, Neg
from proveit.numbers.rounding import (
    real_minus_floor_interval, round_in_terms_of_floor)
from proveit.physics.quantum.QPE import (
    _b_floor, _b_round, _best_round_def, _best_round_is_int,
    _delta_b_def, _phase_is_real, _t_in_natural_pos,
    _two_pow_t, _two_pow_t_is_nat_pos)
In [2]:
%proving _scaled_delta_b_round_in_interval
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
_scaled_delta_b_round_in_interval:
(see dependencies)
In [3]:
_scaled_delta = _scaled_delta_b_round_in_interval.operands[0]
_scaled_delta:
In [4]:
display(_delta_b_def)
display(_best_round_def)
In [5]:
_best_round_is_int
In [6]:
_scaled_phase = _best_round_def.rhs.operand
_scaled_phase:
In [7]:
round_in_terms_of_floor
In [8]:
round_in_terms_of_floor_inst = round_in_terms_of_floor.instantiate({x: _scaled_phase })
round_in_terms_of_floor_inst:  ⊢  
In [9]:
b_round_as_floor = round_in_terms_of_floor_inst.sub_right_side_into(_best_round_def)
b_round_as_floor:  ⊢  
In [10]:
_delta_b_def_inst = _delta_b_def.instantiate({b: _b_round})
_delta_b_def_inst:  ⊢  
In [11]:
eq_01 = _delta_b_def_inst.substitution(_scaled_delta)
eq_01:  ⊢  
In [12]:
eq_02 = eq_01.inner_expr().rhs.distribute(1)
eq_02:  ⊢  
In [13]:
b_round_as_floor
In [14]:
eq_03 = (eq_02.inner_expr().rhs.operands[1].
         operand.substitute(b_round_as_floor.rhs))
eq_03:  ⊢  
In [15]:
desired_expr = Add(eq_03.rhs.operands[0], frac(one, two),
                   eq_03.rhs.operands[1], Neg(frac(one, two)))
desired_expr:
In [16]:
_scaled_delta_expr_manipulated = Equals(desired_expr, eq_03.rhs).prove()
_scaled_delta_expr_manipulated:  ⊢  
In [17]:
eq_04 = _scaled_delta_expr_manipulated.sub_left_side_into(eq_03)
eq_04:  ⊢  
In [18]:
real_minus_floor_interval
In [19]:
diff_domain = real_minus_floor_interval.instantiate(
    {x : Add(eq_03.rhs.operands[0], frac(one, two))})
diff_domain:  ⊢  
In [20]:
diff_lower_bound = diff_domain.derive_element_lower_bound()
diff_lower_bound:  ⊢  
In [21]:
diff_upper_bound = diff_domain.derive_element_upper_bound()
diff_upper_bound:  ⊢  
In [22]:
# This works, but the auto_simplify=False is needed to keep the eq_04.rhs expression
# from being simplified (by canceling the introduced ±1/2 terms)
upper_bound = (
    eq_04.rhs.bound_via_term_bound(diff_upper_bound, auto_simplify=False).
    inner_expr().rhs.simplify())
upper_bound:  ⊢  
In [23]:
upper_bound.inner_expr().lhs.substitute(eq_04)
_scaled_delta_b_round_in_interval may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [24]:
%qed
proveit.physics.quantum.QPE._scaled_delta_b_round_in_interval has been proven.
Out[24]:
 step typerequirementsstatement
0instantiation1, 2, 3, 4, 5  ⊢  
  : , : , :
1conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.in_IntervalCO
2reference20  ⊢  
3reference120  ⊢  
4instantiation12, 6, 41  ⊢  
  : , : , :
5instantiation7, 8, 9  ⊢  
  : , :
6instantiation129, 157, 10  ⊢  
  : , :
7theorem  ⊢  
 proveit.logic.booleans.conjunction.and_if_both
8instantiation12, 11, 14  ⊢  
  : , : , :
9instantiation12, 13, 14  ⊢  
  : , : , :
10instantiation118, 130, 15  ⊢  
  : , :
11instantiation16, 20, 33, 21, 17, 18*, 23*  ⊢  
  : , : , :
12theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
13instantiation19, 20, 21, 132, 22, 23*, 24*  ⊢  
  : , : , :
14instantiation92, 25, 26  ⊢  
  : , : , :
15instantiation30, 82  ⊢  
  :
16conjecture  ⊢  
 proveit.numbers.addition.weak_bound_via_left_term_bound
17instantiation27, 33, 132, 34  ⊢  
  : , : , :
18instantiation92, 28, 29  ⊢  
  : , : , :
19conjecture  ⊢  
 proveit.numbers.addition.strong_bound_via_left_term_bound
20instantiation30, 120  ⊢  
  :
21instantiation31, 33, 132, 34  ⊢  
  : , : , :
22instantiation32, 33, 132, 34  ⊢  
  : , : , :
23instantiation124, 35, 36  ⊢  
  : , : , :
24instantiation37, 153, 38, 155, 106*, 39*, 40*  ⊢  
  : , : , : , :
25instantiation92, 41, 42  ⊢  
  : , : , :
26instantiation92, 43, 44  ⊢  
  : , : , :
27conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.interval_co_lower_bound
28instantiation45, 52  ⊢  
  :
29instantiation46, 52, 47  ⊢  
  : , :
30conjecture  ⊢  
 proveit.numbers.negation.real_closure
31conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.all_in_interval_co__is__real
32conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.interval_co_upper_bound
33conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.zero_is_real
34instantiation48, 110, 49*  ⊢  
  :
35instantiation65, 66, 50, 158, 67, 51, 69, 72, 70, 52  ⊢  
  : , : , : , : , : , :
36instantiation53, 158, 66, 67, 69, 72, 70, 54  ⊢  
  : , : , : , : , : , : , : , :
37conjecture  ⊢  
 proveit.numbers.addition.rational_pair_addition
38instantiation55, 153  ⊢  
  :
39instantiation56, 116, 88, 134  ⊢  
  : , :
40instantiation124, 57, 58  ⊢  
  : , : , :
41instantiation138, 59  ⊢  
  : , : , :
42instantiation60, 158, 66, 67, 151, 61, 62, 63*  ⊢  
  : , : , : , : , : , :
43axiom  ⊢  
 proveit.physics.quantum.QPE._best_round_def
44instantiation64, 119  ⊢  
  :
45conjecture  ⊢  
 proveit.numbers.addition.elim_zero_right
46conjecture  ⊢  
 proveit.numbers.addition.commutation
47conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.zero_is_complex
48conjecture  ⊢  
 proveit.numbers.rounding.real_minus_floor_interval
49instantiation65, 66, 161, 158, 67, 68, 69, 72, 70  ⊢  
  : , : , : , : , : , :
50conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat3
51instantiation71  ⊢  
  : , : , :
52instantiation85, 72  ⊢  
  :
53conjecture  ⊢  
 proveit.numbers.addition.subtraction.add_cancel_general
54instantiation73  ⊢  
  :
55conjecture  ⊢  
 proveit.numbers.negation.int_closure
56conjecture  ⊢  
 proveit.numbers.division.neg_frac_neg_numerator
57instantiation74, 161, 75, 76, 77, 78  ⊢  
  : , : , : , :
58instantiation79, 116, 88, 80  ⊢  
  : , : , :
59instantiation81, 152  ⊢  
  :
60conjecture  ⊢  
 proveit.numbers.multiplication.distribute_through_subtract
61instantiation159, 156, 130  ⊢  
  : , : , :
62instantiation159, 156, 82  ⊢  
  : , : , :
63instantiation92, 83, 84  ⊢  
  : , : , :
64conjecture  ⊢  
 proveit.numbers.rounding.round_in_terms_of_floor
65conjecture  ⊢  
 proveit.numbers.addition.disassociation
66axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
67conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
68instantiation87  ⊢  
  : , :
69instantiation159, 156, 119  ⊢  
  : , : , :
70instantiation85, 86  ⊢  
  :
71conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_3_typical_eq
72instantiation159, 156, 120  ⊢  
  : , : , :
73axiom  ⊢  
 proveit.logic.equality.equals_reflexivity
74axiom  ⊢  
 proveit.core_expr_types.operations.operands_substitution
75instantiation87  ⊢  
  : , :
76instantiation87  ⊢  
  : , :
77instantiation150, 88  ⊢  
  :
78instantiation89, 116, 90*  ⊢  
  : , :
79conjecture  ⊢  
 proveit.numbers.addition.subtraction.subtract_from_add
80conjecture  ⊢  
 proveit.numbers.numerals.decimals.add_1_1
81axiom  ⊢  
 proveit.physics.quantum.QPE._delta_b_def
82instantiation131, 128, 157, 91  ⊢  
  : , :
83instantiation92, 93, 94  ⊢  
  : , : , :
84instantiation95, 96, 97, 98  ⊢  
  : , : , : , :
85conjecture  ⊢  
 proveit.numbers.negation.complex_closure
86instantiation162, 99, 100  ⊢  
  : , : , :
87conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_2_typical_eq
88instantiation159, 156, 133  ⊢  
  : , : , :
89conjecture  ⊢  
 proveit.numbers.multiplication.mult_neg_right
90instantiation141, 116  ⊢  
  :
91instantiation146, 164  ⊢  
  :
92theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
93instantiation101, 116, 117, 102, 103  ⊢  
  : , : , : , : , :
94instantiation124, 104, 105  ⊢  
  : , : , :
95conjecture  ⊢  
 proveit.logic.equality.four_chain_transitivity
96instantiation138, 106  ⊢  
  : , : , :
97instantiation138, 107  ⊢  
  : , : , :
98instantiation150, 117  ⊢  
  :
99instantiation165, 108  ⊢  
  : , :
100instantiation109, 110  ⊢  
  :
101conjecture  ⊢  
 proveit.numbers.division.mult_frac_cancel_numer_left
102instantiation159, 112, 111  ⊢  
  : , : , :
103instantiation159, 112, 113  ⊢  
  : , : , :
104instantiation138, 114  ⊢  
  : , : , :
105instantiation138, 115  ⊢  
  : , : , :
106instantiation140, 116  ⊢  
  :
107instantiation140, 117  ⊢  
  :
108conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.int_within_complex
109axiom  ⊢  
 proveit.numbers.rounding.floor_is_an_int
110instantiation118, 119, 120  ⊢  
  : , :
111instantiation159, 122, 121  ⊢  
  : , : , :
112conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_nonzero_within_complex_nonzero
113instantiation159, 122, 123  ⊢  
  : , : , :
114instantiation124, 125, 126  ⊢  
  : , : , :
115instantiation138, 127  ⊢  
  : , : , :
116instantiation159, 156, 132  ⊢  
  : , : , :
117instantiation159, 156, 128  ⊢  
  : , : , :
118conjecture  ⊢  
 proveit.numbers.addition.add_real_closure_bin
119instantiation129, 157, 130  ⊢  
  : , :
120instantiation131, 132, 133, 134  ⊢  
  : , :
121instantiation159, 136, 135  ⊢  
  : , : , :
122conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_nonzero_within_real_nonzero
123instantiation159, 136, 137  ⊢  
  : , : , :
124axiom  ⊢  
 proveit.logic.equality.equals_transitivity
125instantiation138, 139  ⊢  
  : , : , :
126instantiation140, 151  ⊢  
  :
127instantiation141, 151  ⊢  
  :
128instantiation159, 144, 142  ⊢  
  : , : , :
129conjecture  ⊢  
 proveit.numbers.multiplication.mult_real_closure_bin
130conjecture  ⊢  
 proveit.physics.quantum.QPE._phase_is_real
131conjecture  ⊢  
 proveit.numbers.division.div_real_closure
132instantiation159, 144, 143  ⊢  
  : , : , :
133instantiation159, 144, 145  ⊢  
  : , : , :
134instantiation146, 147  ⊢  
  :
135instantiation159, 148, 164  ⊢  
  : , : , :
136conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.nonzero_int_within_rational_nonzero
137instantiation159, 148, 149  ⊢  
  : , : , :
138axiom  ⊢  
 proveit.logic.equality.substitution
139instantiation150, 151  ⊢  
  :
140conjecture  ⊢  
 proveit.numbers.division.frac_one_denom
141conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_right
142instantiation159, 154, 152  ⊢  
  : , : , :
143instantiation159, 154, 153  ⊢  
  : , : , :
144conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_within_real
145instantiation159, 154, 155  ⊢  
  : , : , :
146conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.nonzero_if_is_nat_pos
147conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat2
148conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_nonzero_int
149conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat1
150conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_left
151instantiation159, 156, 157  ⊢  
  : , : , :
152conjecture  ⊢  
 proveit.physics.quantum.QPE._best_round_is_int
153instantiation159, 160, 158  ⊢  
  : , : , :
154conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.int_within_rational
155instantiation159, 160, 161  ⊢  
  : , : , :
156conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_within_complex
157instantiation162, 163, 164  ⊢  
  : , : , :
158theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
159theorem  ⊢  
 proveit.logic.sets.inclusion.superset_membership_from_proper_subset
160conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_within_int
161conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat2
162theorem  ⊢  
 proveit.logic.sets.inclusion.unfold_subset_eq
163instantiation165, 166  ⊢  
  : , :
164conjecture  ⊢  
 proveit.physics.quantum.QPE._two_pow_t_is_nat_pos
165theorem  ⊢  
 proveit.logic.sets.inclusion.relax_proper_subset
166conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.nat_pos_within_real
*equality replacement requirements