2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "arithmetics/div_and_mod.ma".
14 let rec exp n m on m ≝
17 | S p ⇒ (exp n p) * n].
19 interpretation "natural exponent" 'exp a b = (exp a b).
21 theorem exp_plus_times : ∀n,p,q:nat.
22 n^(p + q) = n^p * n^q.
23 #n #p #q elim p normalize //
26 theorem exp_n_O : ∀n:nat. 1 = n^O.
30 theorem exp_n_1 : ∀n:nat. n = n^1.
34 theorem exp_1_n : ∀n:nat. 1 = 1^n.
35 #n (elim n) normalize //
38 theorem exp_2: ∀n. n^2 = n*n.
42 theorem exp_exp_times : ∀n,p,q:nat.
44 #n #p #q (elim q) normalize
45 (* [applyS exp_n_O funziona ma non lo trova *)
49 theorem lt_O_exp: ∀n,m:nat. O < n → O < n^m.
50 #n #m (elim m) normalize // #a #Hind #posn
54 theorem lt_m_exp_nm: ∀n,m:nat. 1 < n → m < n^m.
55 #n #m #lt1n (elim m) normalize //
56 #n #Hind @(transitive_le ? ((S n)*2)) // @le_times //
59 theorem exp_to_eq_O: ∀n,m:nat. 1 < n →
61 #n #m #ltin #eq1 @le_to_le_to_eq //
62 @le_S_S_to_le <eq1 @lt_m_exp_nm //
65 theorem injective_exp_r: ∀b:nat. 1 < b →
66 injective nat nat (λi:nat. b^i).
67 #b #lt1b @nat_elim2 normalize
68 [#n #H @sym_eq @(exp_to_eq_O b n lt1b) //
69 |#n #H @False_ind @(absurd (1 < 1) ? (not_le_Sn_n 1))
70 <H in ⊢ (??%) @(lt_to_le_to_lt ? (1*b)) //
71 @le_times // @lt_O_exp /2/
72 |#n #m #Hind #H @eq_f @Hind @(injective_times_l … H) /2/
76 theorem le_exp: ∀n,m,p:nat. O < p →
79 [#ltm #len @lt_O_exp //
80 |#_ #len @False_ind /2/
81 |#Hind #p #posp #lenm normalize @le_times // @Hind /2/
85 theorem le_exp1: ∀n,m,a:nat. O < a →
87 #n #m #a #posa #lenm (elim posa) //
88 #a #posa #Hind @le_times //
91 theorem lt_exp: ∀n,m,p:nat. 1 < p →
94 cut (p \sup n ≤ p \sup m) [@le_exp /2/] #H
95 cases(le_to_or_lt_eq … H) // #eqexp
96 @False_ind @(absurd (n=m)) /2/
99 theorem lt_exp1: ∀n,m,p:nat. 0 < p →
101 #n #m #p #posp #ltnm (elim posp) //
102 #p #posp #Hind @lt_times //
105 theorem le_exp_to_le:
106 ∀b,n,m. 1 < b → b^n ≤ b^m → n ≤ m.
107 #b #n #m #lt1b #leexp cases(decidable_le n m) //
108 #notle @False_ind @(absurd … leexp) @lt_to_not_le
112 theorem le_exp_to_le1 : ∀n,m,p.O < p →
114 #n #m #p #posp #leexp @not_lt_to_le
115 @(not_to_not … (lt_exp1 ??? posp)) @le_to_not_lt //
118 theorem lt_exp_to_lt:
119 ∀a,n,m. 0 < a → a^n < a^m → n < m.
120 #a #n #m #lt1a #ltexp cases(decidable_le (S n) m) //
121 #H @False_ind @(absurd … ltexp) @le_to_not_lt
122 @le_exp // @not_lt_to_le @H
125 theorem lt_exp_to_lt1:
126 ∀a,n,m. O < a → n^a < m^a → n < m.
127 #a #n #m #posa #ltexp cases(decidable_le (S n) m) //
128 #H @False_ind @(absurd … ltexp) @le_to_not_lt
129 @le_exp1 // @not_lt_to_le @H
132 theorem times_exp: ∀n,m,p.
134 #n #m #p (elim p) // #p #Hind normalize //