logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import defaults
from proveit.numbers import two, i, pi, Mult, Exp
from proveit.physics.quantum.QPE import (
        _alpha_m_mod_evaluation, _phase_is_real, _two_pow_t_is_nat_pos)
In [2]:
%proving _alpha_m_mod_as_geometric_sum
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
_alpha_m_mod_as_geometric_sum:
(see dependencies)
In [3]:
defaults.assumptions = _alpha_m_mod_as_geometric_sum.all_conditions()
defaults.assumptions:
In [4]:
_alpha_m_mod_evaluation
In [5]:
# Don't combine exponents during auto-simplification for the following steps.
Mult.change_simplification_directives(combine_all_exponents = False)
In [6]:
_alpha_m_mod_evaluation_inst = _alpha_m_mod_evaluation.instantiate()
_alpha_m_mod_evaluation_inst:  ⊢  
In [7]:
the_summation = _alpha_m_mod_evaluation_inst.rhs.factors[1]
the_summation:
In [8]:
k_domain = the_summation.domain
k_domain:
In [9]:
from proveit import k
from proveit.logic import InSet
k_in_k_domain = InSet(k, k_domain)
k_in_k_domain:
In [10]:
defaults.assumptions = defaults.assumptions + (k_in_k_domain,)
defaults.assumptions:

Rewriting the summand, step by step, to get

$\exp{(-\frac{2 \pi i k \ell}{2^t})}\exp{(2\pi i \varphi k)} = (\exp{(-\frac{2 \pi i k \ell}{2^t})}\exp{(2\pi i \varphi k)})^k = (e^{2\pi i (\varphi - \frac{\ell}{2^t})})^k$

(so we can eventually evaluate as a geometric sum under the right circumstances in further theorems).

In [11]:
the_summand_01 = the_summation.instance_expr
the_summand_01:
In [12]:
# need these for the common_power_extraction() to work
display(_phase_is_real)
display(_two_pow_t_is_nat_pos)
In [13]:
the_summand_02 = the_summand_01.inner_expr().common_power_extraction(exp_factor=k)
the_summand_02: ,  ⊢  
In [14]:
# # Now we can combine exponents, but let's preserve the left side as an exception.
Mult.change_simplification_directives(combine_all_exponents = True)
Exp.change_simplification_directives(reduce_double_exponent = False)
defaults.preserved_exprs = set([the_summand_02.lhs])
defaults.preserved_exprs:
In [15]:
the_summand_03 = the_summand_02.inner_expr().rhs.base.simplify()
the_summand_03: ,  ⊢  
In [16]:
the_summand_04 = the_summand_03.inner_expr().rhs.base.exponent.commute()
the_summand_04: ,  ⊢  
In [17]:
the_summand_05 = (
        the_summand_04.inner_expr().rhs.base.exponent.factor(
                Mult(two, pi, i), auto_simplify=False))
the_summand_05: ,  ⊢  

And a quick tinkering with the grouping in the exponent:

In [18]:
the_summand_06 = the_summand_05.inner_expr().rhs.base.exponent.disassociate(0)
the_summand_06: ,  ⊢  

Now we can substitute the modified summand expression back into the original summation:

In [19]:
(_alpha_m_mod_evaluation_inst.inner_expr().
        rhs.factors[1].summand.substitute(the_summand_06.rhs))
_alpha_m_mod_as_geometric_sum may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [20]:
%qed
proveit.physics.quantum.QPE._alpha_m_mod_as_geometric_sum has been proven.
Out[20]:
 step typerequirementsstatement
0generalization1  ⊢  
1instantiation2, 3, 4  ⊢  
  : , :
2theorem  ⊢  
 proveit.logic.equality.rhs_via_equality
3instantiation5, 186  ⊢  
  :
4instantiation85, 6, 7*, 8*  ⊢  
  : , : , :
5conjecture  ⊢  
 proveit.physics.quantum.QPE._alpha_m_mod_evaluation
6modus ponens9, 10  ⊢  
7instantiation11, 181  ⊢  
  : , :
8instantiation11, 181  ⊢  
  : , :
9instantiation12, 174  ⊢  
  : , : , : , : , : , : , :
10generalization13  ⊢  
11conjecture  ⊢  
 proveit.core_expr_types.conditionals.satisfied_condition_reduction
12conjecture  ⊢  
 proveit.core_expr_types.lambda_maps.general_lambda_substitution
13instantiation128, 14, 15,  ⊢  
  : , : , :
14instantiation128, 16, 17,  ⊢  
  : , : , :
15instantiation156, 157, 123, 202, 158, 124, 169, 170, 161, 18  ⊢  
  : , : , : , : , : , :
16instantiation128, 19, 20,  ⊢  
  : , : , :
17instantiation31, 21, 22, 23  ⊢  
  : , : , : , :
18instantiation24, 142, 40  ⊢  
  : , :
19instantiation128, 25, 26,  ⊢  
  : , : , :
20instantiation27, 64, 75  ⊢  
  : , :
21instantiation85, 28  ⊢  
  : , : , :
22instantiation85, 29  ⊢  
  : , : , :
23instantiation87, 30  ⊢  
  : , :
24conjecture  ⊢  
 proveit.numbers.addition.add_complex_closure_bin
25instantiation31, 32, 33, 34,  ⊢  
  : , : , : , :
26instantiation35, 119, 64, 75  ⊢  
  : , : , :
27conjecture  ⊢  
 proveit.numbers.addition.commutation
28instantiation125, 157, 123, 202, 158, 124, 169, 170, 161, 142  ⊢  
  : , : , : , : , : , :
29instantiation146, 36, 37  ⊢  
  : , : , :
30instantiation38, 202, 195, 157, 39, 158, 101, 142, 40  ⊢  
  : , : , : , : , : , :
31conjecture  ⊢  
 proveit.logic.equality.four_chain_transitivity
32instantiation85, 41,  ⊢  
  : , : , :
33instantiation85, 42  ⊢  
  : , : , :
34instantiation87, 43,  ⊢  
  : , :
35conjecture  ⊢  
 proveit.numbers.exponentiation.product_of_complex_powers
36instantiation85, 44  ⊢  
  : , : , :
37instantiation87, 45  ⊢  
  : , :
38conjecture  ⊢  
 proveit.numbers.multiplication.distribute_through_sum
39instantiation171  ⊢  
  : , :
40instantiation76, 58  ⊢  
  :
41instantiation146, 46, 47,  ⊢  
  : , : , :
42instantiation146, 48, 49  ⊢  
  : , : , :
43instantiation50, 51, 52, 152, 53, 54,  ⊢  
  : , : , :
44instantiation146, 55, 56  ⊢  
  : , : , :
45instantiation57, 101, 58  ⊢  
  : , :
46instantiation85, 59,  ⊢  
  : , : , :
47instantiation87, 60,  ⊢  
  : , :
48instantiation85, 61  ⊢  
  : , : , :
49instantiation87, 62  ⊢  
  : , :
50conjecture  ⊢  
 proveit.numbers.exponentiation.real_power_of_product
51instantiation63, 79, 64  ⊢  
  : , :
52instantiation63, 79, 75  ⊢  
  : , :
53instantiation78, 79, 64, 81  ⊢  
  : , :
54instantiation65, 66, 67  ⊢  
  : , : , :
55instantiation85, 68  ⊢  
  : , : , :
56instantiation87, 69  ⊢  
  : , :
57conjecture  ⊢  
 proveit.numbers.multiplication.mult_neg_right
58instantiation93, 162, 137, 94  ⊢  
  : , :
59instantiation146, 70, 71,  ⊢  
  : , : , :
60instantiation72, 79, 77, 81,  ⊢  
  : , :
61instantiation125, 157, 126, 202, 158, 73, 169, 170, 161, 142, 135  ⊢  
  : , : , : , : , : , :
62instantiation74, 79, 75, 81  ⊢  
  : , :
63conjecture  ⊢  
 proveit.numbers.exponentiation.exp_complex_closure
64instantiation76, 77  ⊢  
  :
65theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
66instantiation78, 79, 80, 81  ⊢  
  : , :
67instantiation85, 82  ⊢  
  : , : , :
68instantiation125, 157, 123, 202, 158, 124, 169, 170, 161, 162  ⊢  
  : , : , : , : , : , :
69instantiation105, 101, 162, 108, 107, 83*, 84*  ⊢  
  : , : , : , :
70instantiation85, 86,  ⊢  
  : , : , :
71instantiation87, 88,  ⊢  
  : , :
72instantiation89, 175  ⊢  
  :
73instantiation144  ⊢  
  : , : , : , :
74instantiation90, 175  ⊢  
  :
75instantiation128, 91, 92  ⊢  
  : , : , :
76conjecture  ⊢  
 proveit.numbers.negation.complex_closure
77instantiation93, 106, 137, 94  ⊢  
  : , :
78conjecture  ⊢  
 proveit.numbers.exponentiation.exp_not_eq_zero
79instantiation200, 177, 95  ⊢  
  : , : , :
80instantiation128, 96, 97  ⊢  
  : , : , :
81instantiation98, 99  ⊢  
  :
82instantiation100, 202, 169, 170, 161, 142  ⊢  
  : , : , : , : , : , : , :
83instantiation134, 101  ⊢  
  :
84instantiation102, 137  ⊢  
  :
85axiom  ⊢  
 proveit.logic.equality.substitution
86instantiation146, 103, 104,  ⊢  
  : , : , :
87theorem  ⊢  
 proveit.logic.equality.equals_reversal
88instantiation105, 106, 135, 107, 108, 109*, 110*,  ⊢  
  : , : , : , :
89conjecture  ⊢  
 proveit.numbers.exponentiation.int_exp_of_neg_exp
90conjecture  ⊢  
 proveit.numbers.exponentiation.int_exp_of_exp
91instantiation168, 155, 111  ⊢  
  : , :
92instantiation146, 112, 113  ⊢  
  : , : , :
93conjecture  ⊢  
 proveit.numbers.division.div_complex_closure
94instantiation114, 197  ⊢  
  :
95instantiation200, 184, 119  ⊢  
  : , : , :
96instantiation168, 139, 115  ⊢  
  : , :
97instantiation146, 116, 117  ⊢  
  : , : , :
98conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.nonzero_if_in_real_nonzero
99instantiation200, 118, 119  ⊢  
  : , : , :
100conjecture  ⊢  
 proveit.numbers.multiplication.leftward_commutation
101instantiation128, 120, 121  ⊢  
  : , : , :
102conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_left
103instantiation122, 123, 202, 157, 124, 158, 169, 170, 161, 135, 162,  ⊢  
  : , : , : , : , : , : , :
104instantiation125, 157, 126, 202, 158, 127, 169, 170, 161, 162, 135,  ⊢  
  : , : , : , : , : , :
105conjecture  ⊢  
 proveit.numbers.division.prod_of_fracs
106instantiation128, 129, 130  ⊢  
  : , : , :
107instantiation200, 132, 131  ⊢  
  : , : , :
108instantiation200, 132, 133  ⊢  
  : , : , :
109instantiation134, 135  ⊢  
  :
110instantiation136, 137  ⊢  
  :
111instantiation168, 161, 142  ⊢  
  : , :
112instantiation156, 202, 195, 157, 138, 158, 155, 161, 142  ⊢  
  : , : , : , : , : , :
113instantiation156, 157, 195, 158, 159, 138, 169, 170, 161, 142  ⊢  
  : , : , : , : , : , :
114conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.nonzero_if_is_nat_pos
115instantiation168, 170, 142  ⊢  
  : , :
116instantiation156, 202, 195, 157, 141, 158, 139, 170, 142  ⊢  
  : , : , : , : , : , :
117instantiation156, 157, 195, 158, 140, 141, 169, 161, 170, 142  ⊢  
  : , : , : , : , : , :
118conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.real_pos_within_real_nonzero
119conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.e_is_real_pos
120instantiation168, 155, 161  ⊢  
  : , :
121instantiation156, 157, 195, 202, 158, 159, 169, 170, 161  ⊢  
  : , : , : , : , : , :
122conjecture  ⊢  
 proveit.numbers.multiplication.rightward_commutation
123conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat3
124instantiation143  ⊢  
  : , : , :
125conjecture  ⊢  
 proveit.numbers.multiplication.association
126conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat4
127instantiation144  ⊢  
  : , : , : , :
128theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
129instantiation168, 155, 145  ⊢  
  : , :
130instantiation146, 147, 148  ⊢  
  : , : , :
131instantiation200, 150, 149  ⊢  
  : , : , :
132conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_nonzero_within_complex_nonzero
133instantiation200, 150, 151  ⊢  
  : , : , :
134conjecture  ⊢  
 proveit.numbers.division.frac_one_denom
135instantiation200, 177, 152  ⊢  
  : , : , :
136conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_right
137instantiation200, 177, 153  ⊢  
  : , : , :
138instantiation171  ⊢  
  : , :
139instantiation168, 169, 161  ⊢  
  : , :
140instantiation171  ⊢  
  : , :
141instantiation171  ⊢  
  : , :
142instantiation200, 177, 154  ⊢  
  : , : , :
143conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_3_typical_eq
144conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_4_typical_eq
145instantiation168, 161, 162  ⊢  
  : , :
146axiom  ⊢  
 proveit.logic.equality.equals_transitivity
147instantiation156, 202, 195, 157, 160, 158, 155, 161, 162  ⊢  
  : , : , : , : , : , :
148instantiation156, 157, 195, 158, 159, 160, 169, 170, 161, 162  ⊢  
  : , : , : , : , : , :
149instantiation200, 164, 163  ⊢  
  : , : , :
150conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_nonzero_within_real_nonzero
151instantiation200, 164, 165  ⊢  
  : , : , :
152instantiation200, 182, 166  ⊢  
  : , : , :
153instantiation200, 182, 167  ⊢  
  : , : , :
154conjecture  ⊢  
 proveit.physics.quantum.QPE._phase_is_real
155instantiation168, 169, 170  ⊢  
  : , :
156conjecture  ⊢  
 proveit.numbers.multiplication.disassociation
157axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
158conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
159instantiation171  ⊢  
  : , :
160instantiation171  ⊢  
  : , :
161conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.i_is_complex
162instantiation200, 177, 172  ⊢  
  : , : , :
163instantiation200, 173, 197  ⊢  
  : , : , :
164conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.nonzero_int_within_rational_nonzero
165instantiation200, 173, 174  ⊢  
  : , : , :
166instantiation200, 190, 175  ⊢  
  : , : , :
167instantiation200, 190, 193  ⊢  
  : , : , :
168conjecture  ⊢  
 proveit.numbers.multiplication.mult_complex_closure_bin
169instantiation200, 177, 176  ⊢  
  : , : , :
170instantiation200, 177, 178  ⊢  
  : , : , :
171conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_2_typical_eq
172instantiation200, 182, 179  ⊢  
  : , : , :
173conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_nonzero_int
174conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat1
175instantiation200, 180, 181  ⊢  
  : , : , :
176instantiation200, 182, 183  ⊢  
  : , : , :
177conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_within_complex
178instantiation200, 184, 185  ⊢  
  : , : , :
179instantiation200, 190, 186  ⊢  
  : , : , :
180instantiation187, 188, 189  ⊢  
  : , :
181assumption  ⊢  
182conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_within_real
183instantiation200, 190, 191  ⊢  
  : , : , :
184conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.real_pos_within_real
185conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.pi_is_real_pos
186assumption  ⊢  
187conjecture  ⊢  
 proveit.numbers.number_sets.integers.int_interval_within_int
188conjecture  ⊢  
 proveit.numbers.number_sets.integers.zero_is_int
189instantiation192, 193, 194  ⊢  
  : , :
190conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.int_within_rational
191instantiation200, 201, 195  ⊢  
  : , : , :
192conjecture  ⊢  
 proveit.numbers.addition.add_int_closure_bin
193instantiation200, 196, 197  ⊢  
  : , : , :
194instantiation198, 199  ⊢  
  :
195conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat2
196conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_int
197conjecture  ⊢  
 proveit.physics.quantum.QPE._two_pow_t_is_nat_pos
198conjecture  ⊢  
 proveit.numbers.negation.int_closure
199instantiation200, 201, 202  ⊢  
  : , : , :
200theorem  ⊢  
 proveit.logic.sets.inclusion.superset_membership_from_proper_subset
201conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_within_int
202theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
*equality replacement requirements