logo
In [1]:
import proveit
theory = proveit.Theory() # the theorem's theory
from proveit import a, b, c, k, m, r, x, y, defaults
from proveit.logic import InSet
from proveit.numbers import e, i, pi, Complex, Integer, Mod
from proveit.numbers.exponentiation import complex_power_of_complex_power, exp_eq
from proveit.numbers.modular import mod_natpos_in_interval
from proveit.numbers.number_sets.complex_numbers import exp_neg2pi_i_x
from proveit.physics.quantum.QPE import (
        _alpha_m_evaluation, _m_domain, _two_pow_t, _two_pow_t_is_nat_pos)
In [2]:
%proving _alpha_m_mod_evaluation
With these allowed/disallowed theorem/theory presumptions (e.g., to avoid circular dependencies), we begin our proof of
_alpha_m_mod_evaluation:
(see dependencies)
In [3]:
defaults.assumptions = _alpha_m_mod_evaluation.all_conditions()
defaults.assumptions:
In [4]:
_alpha_m_evaluation
In [5]:
mod_natpos_in_interval
In [6]:
_two_pow_t_is_nat_pos
In [7]:
mod_natpos_in_interval.instantiate({a: m, b: _two_pow_t})
In [8]:
_alpha_m_evaluation_inst = _alpha_m_evaluation.instantiate({m : Mod(m, _two_pow_t)})
_alpha_m_evaluation_inst:  ⊢  
In [9]:
exp_neg2pi_i_x
In [10]:
# doesn't look like there is a way to insert the desired extra k factor
# during the instantiation (can the exp_neg2pi_i_x be better generalized?)
exp_neg2pi_i_x_inst = exp_neg2pi_i_x.instantiate({r: _two_pow_t, x: m})
exp_neg2pi_i_x_inst:  ⊢  
In [11]:
_m_domain
In [12]:
exp_eq
In [13]:
exp_eq_inst = exp_eq.instantiate({a: k, x: exp_neg2pi_i_x_inst.lhs, y: exp_neg2pi_i_x_inst.rhs},
                  assumptions = [InSet(m, Integer), InSet(k, _m_domain)])
exp_eq_inst: ,  ⊢  
In [14]:
# what we have
exp_eq_inst.rhs.exponent.operand
In [15]:
# what we want
_alpha_m_evaluation_inst.rhs.operands[1].summand.operands[0].exponent.operand
In [16]:
exp_factored_k_01 = (
    _alpha_m_evaluation_inst.rhs.operands[1].summand.operands[0].exponent.inner_expr().
    operand.factorization(k, assumptions = [InSet(m, Integer), InSet(k, _m_domain)]))
exp_factored_k_01: ,  ⊢  
In [17]:
exp_factored_k_02 = exp_factored_k_01.inner_expr().rhs.operand.commute(0, 1)
exp_factored_k_02: ,  ⊢  
In [18]:
exp_factored_k_03 = exp_factored_k_02.sub_left_side_into(exp_eq_inst)
exp_factored_k_03: ,  ⊢  
In [19]:
exp_factored_k_04 = (
    _alpha_m_mod_evaluation.instance_expr.rhs.operands[1].summand.operands[0].exponent.inner_expr().
    operand.factorization(k, assumptions = [InSet(m, Integer), InSet(k, _m_domain)]))
exp_factored_k_04: ,  ⊢  
In [20]:
exp_factored_k_05 = exp_factored_k_04.inner_expr().rhs.operand.commute(0,1)
exp_factored_k_05: ,  ⊢  
In [21]:
exp_factored_k_06 = exp_factored_k_05.sub_left_side_into(exp_factored_k_03)
exp_factored_k_06: ,  ⊢  
In [22]:
# recall:
_alpha_m_evaluation_inst
In [23]:
_alpha_m_evaluation_inst.inner_expr().rhs.operands[1].summand.factors[0].substitute(exp_factored_k_06)
_alpha_m_mod_evaluation may now be readily provable (assuming required theorems are usable).  Simply execute "%qed".
In [24]:
%qed
proveit.physics.quantum.QPE._alpha_m_mod_evaluation has been proven.
Out[24]:
 step typerequirementsstatement
0generalization1  ⊢  
1instantiation2, 3, 4  ⊢  
  : , :
2theorem  ⊢  
 proveit.logic.equality.rhs_via_equality
3instantiation5, 144  ⊢  
  :
4instantiation57, 6, 7*, 8*  ⊢  
  : , : , :
5conjecture  ⊢  
 proveit.physics.quantum.QPE._alpha_m_evaluation
6modus ponens9, 10  ⊢  
7instantiation11, 135  ⊢  
  : , :
8instantiation11, 135  ⊢  
  : , :
9instantiation12, 127  ⊢  
  : , : , : , : , : , : , :
10generalization13  ⊢  
11conjecture  ⊢  
 proveit.core_expr_types.conditionals.satisfied_condition_reduction
12conjecture  ⊢  
 proveit.core_expr_types.lambda_maps.general_lambda_substitution
13instantiation16, 14, 15,  ⊢  
  : , : , :
14instantiation16, 17, 18,  ⊢  
  : , : , :
15instantiation82, 19, 20,  ⊢  
  : , : , :
16theorem  ⊢  
 proveit.logic.equality.sub_left_side_into
17instantiation21, 89, 22, 23, 24, 25*, 26*,  ⊢  
  : , : , :
18instantiation82, 27, 28,  ⊢  
  : , : , :
19instantiation57, 29,  ⊢  
  : , : , :
20instantiation41, 89, 49,  ⊢  
  : , :
21theorem  ⊢  
 proveit.numbers.exponentiation.exp_eq
22instantiation30, 31, 35  ⊢  
  : , :
23instantiation30, 31, 38  ⊢  
  : , :
24instantiation32, 121, 105, 33*, 34*  ⊢  
  : , :
25instantiation37, 54, 35, 89, 36*,  ⊢  
  : , : , :
26instantiation37, 54, 38, 89, 39*,  ⊢  
  : , : , :
27instantiation57, 40,  ⊢  
  : , : , :
28instantiation41, 89, 46,  ⊢  
  : , :
29instantiation98, 42, 43,  ⊢  
  : , : , :
30conjecture  ⊢  
 proveit.numbers.exponentiation.exp_complex_closure
31instantiation158, 132, 44  ⊢  
  : , : , :
32conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.exp_neg2pi_i_x
33instantiation45, 68, 91, 56  ⊢  
  : , :
34instantiation45, 63, 91, 56  ⊢  
  : , :
35instantiation47, 46  ⊢  
  :
36instantiation48, 46, 89,  ⊢  
  : , :
37conjecture  ⊢  
 proveit.numbers.exponentiation.complex_power_of_complex_power
38instantiation47, 49  ⊢  
  :
39instantiation48, 49, 89,  ⊢  
  : , :
40instantiation98, 50, 51,  ⊢  
  : , : , :
41conjecture  ⊢  
 proveit.numbers.multiplication.commutation
42instantiation57, 52,  ⊢  
  : , : , :
43instantiation59, 53,  ⊢  
  : , :
44instantiation158, 138, 54  ⊢  
  : , : , :
45conjecture  ⊢  
 proveit.numbers.division.neg_frac_neg_numerator
46instantiation55, 68, 91, 56  ⊢  
  : , :
47conjecture  ⊢  
 proveit.numbers.negation.complex_closure
48conjecture  ⊢  
 proveit.numbers.multiplication.mult_neg_left
49instantiation55, 63, 91, 56  ⊢  
  : , :
50instantiation57, 58,  ⊢  
  : , : , :
51instantiation59, 60,  ⊢  
  : , :
52instantiation98, 61, 62,  ⊢  
  : , : , :
53instantiation67, 89, 63, 69, 70, 71*, 72*,  ⊢  
  : , : , : , :
54conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.e_is_real_pos
55conjecture  ⊢  
 proveit.numbers.division.div_complex_closure
56instantiation64, 155  ⊢  
  :
57axiom  ⊢  
 proveit.logic.equality.substitution
58instantiation98, 65, 66,  ⊢  
  : , : , :
59theorem  ⊢  
 proveit.logic.equality.equals_reversal
60instantiation67, 89, 68, 69, 70, 71*, 72*,  ⊢  
  : , : , : , :
61instantiation76, 110, 77, 160, 111, 78, 123, 124, 114, 89, 107,  ⊢  
  : , : , : , : , : , : , :
62instantiation79, 160, 80, 110, 73, 111, 89, 123, 124, 114, 107,  ⊢  
  : , : , : , : , : , :
63instantiation82, 74, 75  ⊢  
  : , : , :
64conjecture  ⊢  
 proveit.numbers.number_sets.natural_numbers.nonzero_if_is_nat_pos
65instantiation76, 110, 77, 160, 111, 78, 123, 124, 114, 89, 115,  ⊢  
  : , : , : , : , : , : , :
66instantiation79, 160, 80, 110, 81, 111, 89, 123, 124, 114, 115,  ⊢  
  : , : , : , : , : , :
67conjecture  ⊢  
 proveit.numbers.division.prod_of_fracs
68instantiation82, 83, 84  ⊢  
  : , : , :
69instantiation158, 86, 85  ⊢  
  : , : , :
70instantiation158, 86, 87  ⊢  
  : , : , :
71instantiation88, 89  ⊢  
  :
72instantiation90, 91  ⊢  
  :
73instantiation96  ⊢  
  : , : , : , :
74instantiation122, 108, 92  ⊢  
  : , :
75instantiation98, 93, 94  ⊢  
  : , : , :
76conjecture  ⊢  
 proveit.numbers.multiplication.leftward_commutation
77conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat3
78instantiation95  ⊢  
  : , : , :
79conjecture  ⊢  
 proveit.numbers.multiplication.association
80conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat4
81instantiation96  ⊢  
  : , : , : , :
82theorem  ⊢  
 proveit.logic.equality.sub_right_side_into
83instantiation122, 108, 97  ⊢  
  : , :
84instantiation98, 99, 100  ⊢  
  : , : , :
85instantiation158, 102, 101  ⊢  
  : , : , :
86conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_nonzero_within_complex_nonzero
87instantiation158, 102, 103  ⊢  
  : , : , :
88conjecture  ⊢  
 proveit.numbers.division.frac_one_denom
89instantiation158, 132, 104  ⊢  
  : , : , :
90conjecture  ⊢  
 proveit.numbers.multiplication.elim_one_left
91instantiation158, 132, 105  ⊢  
  : , : , :
92instantiation122, 114, 107  ⊢  
  : , :
93instantiation109, 160, 145, 110, 106, 111, 108, 114, 107  ⊢  
  : , : , : , : , : , :
94instantiation109, 110, 145, 111, 112, 106, 123, 124, 114, 107  ⊢  
  : , : , : , : , : , :
95conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_3_typical_eq
96conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_4_typical_eq
97instantiation122, 114, 115  ⊢  
  : , :
98axiom  ⊢  
 proveit.logic.equality.equals_transitivity
99instantiation109, 160, 145, 110, 113, 111, 108, 114, 115  ⊢  
  : , : , : , : , : , :
100instantiation109, 110, 145, 111, 112, 113, 123, 124, 114, 115  ⊢  
  : , : , : , : , : , :
101instantiation158, 117, 116  ⊢  
  : , : , :
102conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_nonzero_within_real_nonzero
103instantiation158, 117, 118  ⊢  
  : , : , :
104instantiation158, 136, 119  ⊢  
  : , : , :
105instantiation158, 136, 120  ⊢  
  : , : , :
106instantiation125  ⊢  
  : , :
107instantiation158, 132, 121  ⊢  
  : , : , :
108instantiation122, 123, 124  ⊢  
  : , :
109conjecture  ⊢  
 proveit.numbers.multiplication.disassociation
110axiom  ⊢  
 proveit.numbers.number_sets.natural_numbers.zero_in_nats
111conjecture  ⊢  
 proveit.core_expr_types.tuples.tuple_len_0_typical_eq
112instantiation125  ⊢  
  : , :
113instantiation125  ⊢  
  : , :
114conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.i_is_complex
115instantiation158, 132, 126  ⊢  
  : , : , :
116instantiation158, 128, 127  ⊢  
  : , : , :
117conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.nonzero_int_within_rational_nonzero
118instantiation158, 128, 155  ⊢  
  : , : , :
119instantiation158, 141, 129  ⊢  
  : , : , :
120instantiation158, 141, 152  ⊢  
  : , : , :
121instantiation158, 136, 130  ⊢  
  : , : , :
122conjecture  ⊢  
 proveit.numbers.multiplication.mult_complex_closure_bin
123instantiation158, 132, 131  ⊢  
  : , : , :
124instantiation158, 132, 133  ⊢  
  : , : , :
125conjecture  ⊢  
 proveit.numbers.numerals.decimals.tuple_len_2_typical_eq
126instantiation158, 136, 134  ⊢  
  : , : , :
127conjecture  ⊢  
 proveit.numbers.numerals.decimals.posnat1
128conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_nonzero_int
129instantiation158, 143, 135  ⊢  
  : , : , :
130instantiation158, 141, 150  ⊢  
  : , : , :
131instantiation158, 136, 137  ⊢  
  : , : , :
132conjecture  ⊢  
 proveit.numbers.number_sets.complex_numbers.real_within_complex
133instantiation158, 138, 139  ⊢  
  : , : , :
134instantiation158, 141, 140  ⊢  
  : , : , :
135assumption  ⊢  
136conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.rational_within_real
137instantiation158, 141, 142  ⊢  
  : , : , :
138conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.real_pos_within_real
139conjecture  ⊢  
 proveit.numbers.number_sets.real_numbers.pi_is_real_pos
140instantiation158, 143, 144  ⊢  
  : , : , :
141conjecture  ⊢  
 proveit.numbers.number_sets.rational_numbers.int_within_rational
142instantiation158, 159, 145  ⊢  
  : , : , :
143instantiation146, 147, 148  ⊢  
  : , :
144instantiation149, 150, 155  ⊢  
  : , :
145conjecture  ⊢  
 proveit.numbers.numerals.decimals.nat2
146conjecture  ⊢  
 proveit.numbers.number_sets.integers.int_interval_within_int
147conjecture  ⊢  
 proveit.numbers.number_sets.integers.zero_is_int
148instantiation151, 152, 153  ⊢  
  : , :
149conjecture  ⊢  
 proveit.numbers.modular.mod_natpos_in_interval
150assumption  ⊢  
151conjecture  ⊢  
 proveit.numbers.addition.add_int_closure_bin
152instantiation158, 154, 155  ⊢  
  : , : , :
153instantiation156, 157  ⊢  
  :
154conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_pos_within_int
155conjecture  ⊢  
 proveit.physics.quantum.QPE._two_pow_t_is_nat_pos
156conjecture  ⊢  
 proveit.numbers.negation.int_closure
157instantiation158, 159, 160  ⊢  
  : , : , :
158theorem  ⊢  
 proveit.logic.sets.inclusion.superset_membership_from_proper_subset
159conjecture  ⊢  
 proveit.numbers.number_sets.integers.nat_within_int
160theorem  ⊢  
 proveit.numbers.numerals.decimals.nat1
*equality replacement requirements