author | wenzelm |
Mon, 28 Dec 2015 01:26:34 +0100 | |
changeset 61944 | 5d06ecfdb472 |
parent 61942 | f02b26f7d39d |
child 61969 | e01015e49041 |
permissions | -rw-r--r-- |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1 |
(* Title: HOL/Transcendental.thy |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
2 |
Author: Jacques D. Fleuriot, University of Cambridge, University of Edinburgh |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
3 |
Author: Lawrence C Paulson |
51527 | 4 |
Author: Jeremy Avigad |
12196 | 5 |
*) |
6 |
||
60758 | 7 |
section\<open>Power Series, Transcendental Functions etc.\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
8 |
|
15131 | 9 |
theory Transcendental |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
10 |
imports Binomial Series Deriv NthRoot |
15131 | 11 |
begin |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
12 |
|
61762
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
13 |
lemma of_int_leD: |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
14 |
fixes x :: "'a :: linordered_idom" |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
15 |
shows "\<bar>of_int n\<bar> \<le> x \<Longrightarrow> n=0 \<or> x\<ge>1" |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
16 |
by (metis (no_types) le_less_trans not_less of_int_abs of_int_less_1_iff zabs_less_one_iff) |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
17 |
|
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
18 |
lemma of_int_lessD: |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
19 |
fixes x :: "'a :: linordered_idom" |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
20 |
shows "\<bar>of_int n\<bar> < x \<Longrightarrow> n=0 \<or> x>1" |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
21 |
by (metis less_le_trans not_less of_int_abs of_int_less_1_iff zabs_less_one_iff) |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
22 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
23 |
lemma fact_in_Reals: "fact n \<in> \<real>" by (induction n) auto |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
24 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
25 |
lemma pochhammer_of_real: "pochhammer (of_real x) n = of_real (pochhammer x n)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
26 |
by (simp add: pochhammer_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
27 |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
28 |
lemma of_real_fact [simp]: "of_real (fact n) = fact n" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
29 |
by (metis of_nat_fact of_real_of_nat_eq) |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
30 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
31 |
lemma of_int_fact [simp]: "of_int (fact n :: int) = fact n" |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
32 |
by (metis of_int_of_nat_eq of_nat_fact) |
59731 | 33 |
|
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
34 |
lemma norm_fact [simp]: |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
35 |
"norm (fact n :: 'a :: {real_normed_algebra_1}) = fact n" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
36 |
proof - |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
37 |
have "(fact n :: 'a) = of_real (fact n)" by simp |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
38 |
also have "norm \<dots> = fact n" by (subst norm_of_real) simp |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
39 |
finally show ?thesis . |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
40 |
qed |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
41 |
|
57025 | 42 |
lemma root_test_convergence: |
43 |
fixes f :: "nat \<Rightarrow> 'a::banach" |
|
61799 | 44 |
assumes f: "(\<lambda>n. root n (norm (f n))) ----> x" \<comment> "could be weakened to lim sup" |
57025 | 45 |
assumes "x < 1" |
46 |
shows "summable f" |
|
47 |
proof - |
|
48 |
have "0 \<le> x" |
|
49 |
by (rule LIMSEQ_le[OF tendsto_const f]) (auto intro!: exI[of _ 1]) |
|
60758 | 50 |
from \<open>x < 1\<close> obtain z where z: "x < z" "z < 1" |
57025 | 51 |
by (metis dense) |
60758 | 52 |
from f \<open>x < z\<close> |
57025 | 53 |
have "eventually (\<lambda>n. root n (norm (f n)) < z) sequentially" |
54 |
by (rule order_tendstoD) |
|
55 |
then have "eventually (\<lambda>n. norm (f n) \<le> z^n) sequentially" |
|
56 |
using eventually_ge_at_top |
|
57 |
proof eventually_elim |
|
58 |
fix n assume less: "root n (norm (f n)) < z" and n: "1 \<le> n" |
|
59 |
from power_strict_mono[OF less, of n] n |
|
60 |
show "norm (f n) \<le> z ^ n" |
|
61 |
by simp |
|
62 |
qed |
|
63 |
then show "summable f" |
|
64 |
unfolding eventually_sequentially |
|
60758 | 65 |
using z \<open>0 \<le> x\<close> by (auto intro!: summable_comparison_test[OF _ summable_geometric]) |
57025 | 66 |
qed |
67 |
||
60758 | 68 |
subsection \<open>Properties of Power Series\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
69 |
|
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
70 |
lemma powser_zero: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
71 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_algebra_1" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
72 |
shows "(\<Sum>n. f n * 0 ^ n) = f 0" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
73 |
proof - |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
74 |
have "(\<Sum>n<1. f n * 0 ^ n) = (\<Sum>n. f n * 0 ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
75 |
by (subst suminf_finite[where N="{0}"]) (auto simp: power_0_left) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
76 |
thus ?thesis unfolding One_nat_def by simp |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
77 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
78 |
|
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
79 |
lemma powser_sums_zero: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
80 |
fixes a :: "nat \<Rightarrow> 'a::real_normed_div_algebra" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
81 |
shows "(\<lambda>n. a n * 0^n) sums a 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
82 |
using sums_finite [of "{0}" "\<lambda>n. a n * 0 ^ n"] |
54573 | 83 |
by simp |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
84 |
|
60758 | 85 |
text\<open>Power series has a circle or radius of convergence: if it sums for @{term |
86 |
x}, then it sums absolutely for @{term z} with @{term "\<bar>z\<bar> < \<bar>x\<bar>"}.\<close> |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
87 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
88 |
lemma powser_insidea: |
53599 | 89 |
fixes x z :: "'a::real_normed_div_algebra" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
90 |
assumes 1: "summable (\<lambda>n. f n * x^n)" |
53079 | 91 |
and 2: "norm z < norm x" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
92 |
shows "summable (\<lambda>n. norm (f n * z ^ n))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
93 |
proof - |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
94 |
from 2 have x_neq_0: "x \<noteq> 0" by clarsimp |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
95 |
from 1 have "(\<lambda>n. f n * x^n) ----> 0" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
96 |
by (rule summable_LIMSEQ_zero) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
97 |
hence "convergent (\<lambda>n. f n * x^n)" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
98 |
by (rule convergentI) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
99 |
hence "Cauchy (\<lambda>n. f n * x^n)" |
44726 | 100 |
by (rule convergent_Cauchy) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
101 |
hence "Bseq (\<lambda>n. f n * x^n)" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
102 |
by (rule Cauchy_Bseq) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
103 |
then obtain K where 3: "0 < K" and 4: "\<forall>n. norm (f n * x^n) \<le> K" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
104 |
by (simp add: Bseq_def, safe) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
105 |
have "\<exists>N. \<forall>n\<ge>N. norm (norm (f n * z ^ n)) \<le> |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
106 |
K * norm (z ^ n) * inverse (norm (x^n))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
107 |
proof (intro exI allI impI) |
53079 | 108 |
fix n::nat |
109 |
assume "0 \<le> n" |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
110 |
have "norm (norm (f n * z ^ n)) * norm (x^n) = |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
111 |
norm (f n * x^n) * norm (z ^ n)" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
112 |
by (simp add: norm_mult abs_mult) |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
113 |
also have "\<dots> \<le> K * norm (z ^ n)" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
114 |
by (simp only: mult_right_mono 4 norm_ge_zero) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
115 |
also have "\<dots> = K * norm (z ^ n) * (inverse (norm (x^n)) * norm (x^n))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
116 |
by (simp add: x_neq_0) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
117 |
also have "\<dots> = K * norm (z ^ n) * inverse (norm (x^n)) * norm (x^n)" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
118 |
by (simp only: mult.assoc) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
119 |
finally show "norm (norm (f n * z ^ n)) \<le> |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
120 |
K * norm (z ^ n) * inverse (norm (x^n))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
121 |
by (simp add: mult_le_cancel_right x_neq_0) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
122 |
qed |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
123 |
moreover have "summable (\<lambda>n. K * norm (z ^ n) * inverse (norm (x^n)))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
124 |
proof - |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
125 |
from 2 have "norm (norm (z * inverse x)) < 1" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
126 |
using x_neq_0 |
53599 | 127 |
by (simp add: norm_mult nonzero_norm_inverse divide_inverse [where 'a=real, symmetric]) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
128 |
hence "summable (\<lambda>n. norm (z * inverse x) ^ n)" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
129 |
by (rule summable_geometric) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
130 |
hence "summable (\<lambda>n. K * norm (z * inverse x) ^ n)" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
131 |
by (rule summable_mult) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
132 |
thus "summable (\<lambda>n. K * norm (z ^ n) * inverse (norm (x^n)))" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
133 |
using x_neq_0 |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
134 |
by (simp add: norm_mult nonzero_norm_inverse power_mult_distrib |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
135 |
power_inverse norm_power mult.assoc) |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
136 |
qed |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
137 |
ultimately show "summable (\<lambda>n. norm (f n * z ^ n))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
138 |
by (rule summable_comparison_test) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
139 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
140 |
|
15229 | 141 |
lemma powser_inside: |
53599 | 142 |
fixes f :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}" |
53079 | 143 |
shows |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
144 |
"summable (\<lambda>n. f n * (x^n)) \<Longrightarrow> norm z < norm x \<Longrightarrow> |
53079 | 145 |
summable (\<lambda>n. f n * (z ^ n))" |
146 |
by (rule powser_insidea [THEN summable_norm_cancel]) |
|
147 |
||
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
148 |
lemma powser_times_n_limit_0: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
149 |
fixes x :: "'a::{real_normed_div_algebra,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
150 |
assumes "norm x < 1" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
151 |
shows "(\<lambda>n. of_nat n * x ^ n) ----> 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
152 |
proof - |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
153 |
have "norm x / (1 - norm x) \<ge> 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
154 |
using assms |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
155 |
by (auto simp: divide_simps) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
156 |
moreover obtain N where N: "norm x / (1 - norm x) < of_int N" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
157 |
using ex_le_of_int |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
158 |
by (meson ex_less_of_int) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
159 |
ultimately have N0: "N>0" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
160 |
by auto |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
161 |
then have *: "real_of_int (N + 1) * norm x / real_of_int N < 1" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
162 |
using N assms |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
163 |
by (auto simp: field_simps) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
164 |
{ fix n::nat |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
165 |
assume "N \<le> int n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
166 |
then have "real_of_int N * real_of_nat (Suc n) \<le> real_of_nat n * real_of_int (1 + N)" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
167 |
by (simp add: algebra_simps) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
168 |
then have "(real_of_int N * real_of_nat (Suc n)) * (norm x * norm (x ^ n)) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
169 |
\<le> (real_of_nat n * (1 + N)) * (norm x * norm (x ^ n))" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
170 |
using N0 mult_mono by fastforce |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
171 |
then have "real_of_int N * (norm x * (real_of_nat (Suc n) * norm (x ^ n))) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
172 |
\<le> real_of_nat n * (norm x * ((1 + N) * norm (x ^ n)))" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
173 |
by (simp add: algebra_simps) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
174 |
} note ** = this |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
175 |
show ?thesis using * |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
176 |
apply (rule summable_LIMSEQ_zero [OF summable_ratio_test, where N1="nat N"]) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
177 |
apply (simp add: N0 norm_mult field_simps ** |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
178 |
del: of_nat_Suc of_int_add) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
179 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
180 |
qed |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
181 |
|
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
182 |
corollary lim_n_over_pown: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
183 |
fixes x :: "'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
184 |
shows "1 < norm x \<Longrightarrow> ((\<lambda>n. of_nat n / x^n) ---> 0) sequentially" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
185 |
using powser_times_n_limit_0 [of "inverse x"] |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
186 |
by (simp add: norm_divide divide_simps) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
187 |
|
53079 | 188 |
lemma sum_split_even_odd: |
189 |
fixes f :: "nat \<Rightarrow> real" |
|
190 |
shows |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
191 |
"(\<Sum>i<2 * n. if even i then f i else g i) = |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
192 |
(\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1))" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
193 |
proof (induct n) |
53079 | 194 |
case 0 |
195 |
then show ?case by simp |
|
196 |
next |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
197 |
case (Suc n) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
198 |
have "(\<Sum>i<2 * Suc n. if even i then f i else g i) = |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
199 |
(\<Sum>i<n. f (2 * i)) + (\<Sum>i<n. g (2 * i + 1)) + (f (2 * n) + g (2 * n + 1))" |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
200 |
using Suc.hyps unfolding One_nat_def by auto |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
201 |
also have "\<dots> = (\<Sum>i<Suc n. f (2 * i)) + (\<Sum>i<Suc n. g (2 * i + 1))" |
53079 | 202 |
by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
203 |
finally show ?case . |
53079 | 204 |
qed |
205 |
||
206 |
lemma sums_if': |
|
207 |
fixes g :: "nat \<Rightarrow> real" |
|
208 |
assumes "g sums x" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
209 |
shows "(\<lambda> n. if even n then 0 else g ((n - 1) div 2)) sums x" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
210 |
unfolding sums_def |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
211 |
proof (rule LIMSEQ_I) |
53079 | 212 |
fix r :: real |
213 |
assume "0 < r" |
|
60758 | 214 |
from \<open>g sums x\<close>[unfolded sums_def, THEN LIMSEQ_D, OF this] |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
215 |
obtain no where no_eq: "\<And> n. n \<ge> no \<Longrightarrow> (norm (setsum g {..<n} - x) < r)" by blast |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
216 |
|
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
217 |
let ?SUM = "\<lambda> m. \<Sum>i<m. if even i then 0 else g ((i - 1) div 2)" |
53079 | 218 |
{ |
219 |
fix m |
|
220 |
assume "m \<ge> 2 * no" |
|
221 |
hence "m div 2 \<ge> no" by auto |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
222 |
have sum_eq: "?SUM (2 * (m div 2)) = setsum g {..< m div 2}" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
223 |
using sum_split_even_odd by auto |
53079 | 224 |
hence "(norm (?SUM (2 * (m div 2)) - x) < r)" |
60758 | 225 |
using no_eq unfolding sum_eq using \<open>m div 2 \<ge> no\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
226 |
moreover |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
227 |
have "?SUM (2 * (m div 2)) = ?SUM m" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
228 |
proof (cases "even m") |
53079 | 229 |
case True |
58710
7216a10d69ba
augmented and tuned facts on even/odd and division
haftmann
parents:
58709
diff
changeset
|
230 |
then show ?thesis by (auto simp add: even_two_times_div_two) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
231 |
next |
53079 | 232 |
case False |
58834 | 233 |
then have eq: "Suc (2 * (m div 2)) = m" by simp |
60758 | 234 |
hence "even (2 * (m div 2))" using \<open>odd m\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
235 |
have "?SUM m = ?SUM (Suc (2 * (m div 2)))" unfolding eq .. |
60758 | 236 |
also have "\<dots> = ?SUM (2 * (m div 2))" using \<open>even (2 * (m div 2))\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
237 |
finally show ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
238 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
239 |
ultimately have "(norm (?SUM m - x) < r)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
240 |
} |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
241 |
thus "\<exists> no. \<forall> m \<ge> no. norm (?SUM m - x) < r" by blast |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
242 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
243 |
|
53079 | 244 |
lemma sums_if: |
245 |
fixes g :: "nat \<Rightarrow> real" |
|
246 |
assumes "g sums x" and "f sums y" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
247 |
shows "(\<lambda> n. if even n then f (n div 2) else g ((n - 1) div 2)) sums (x + y)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
248 |
proof - |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
249 |
let ?s = "\<lambda> n. if even n then 0 else f ((n - 1) div 2)" |
53079 | 250 |
{ |
251 |
fix B T E |
|
252 |
have "(if B then (0 :: real) else E) + (if B then T else 0) = (if B then T else E)" |
|
253 |
by (cases B) auto |
|
254 |
} note if_sum = this |
|
255 |
have g_sums: "(\<lambda> n. if even n then 0 else g ((n - 1) div 2)) sums x" |
|
60758 | 256 |
using sums_if'[OF \<open>g sums x\<close>] . |
41970 | 257 |
{ |
41550 | 258 |
have if_eq: "\<And>B T E. (if \<not> B then T else E) = (if B then E else T)" by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
259 |
|
60758 | 260 |
have "?s sums y" using sums_if'[OF \<open>f sums y\<close>] . |
41970 | 261 |
from this[unfolded sums_def, THEN LIMSEQ_Suc] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
262 |
have "(\<lambda> n. if even n then f (n div 2) else 0) sums y" |
57418 | 263 |
by (simp add: lessThan_Suc_eq_insert_0 image_iff setsum.reindex if_eq sums_def cong del: if_cong) |
53079 | 264 |
} |
265 |
from sums_add[OF g_sums this] show ?thesis unfolding if_sum . |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
266 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
267 |
|
60758 | 268 |
subsection \<open>Alternating series test / Leibniz formula\<close> |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
269 |
text\<open>FIXME: generalise these results from the reals via type classes?\<close> |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
270 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
271 |
lemma sums_alternating_upper_lower: |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
272 |
fixes a :: "nat \<Rightarrow> real" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
273 |
assumes mono: "\<And>n. a (Suc n) \<le> a n" and a_pos: "\<And>n. 0 \<le> a n" and "a ----> 0" |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
274 |
shows "\<exists>l. ((\<forall>n. (\<Sum>i<2*n. (- 1)^i*a i) \<le> l) \<and> (\<lambda> n. \<Sum>i<2*n. (- 1)^i*a i) ----> l) \<and> |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
275 |
((\<forall>n. l \<le> (\<Sum>i<2*n + 1. (- 1)^i*a i)) \<and> (\<lambda> n. \<Sum>i<2*n + 1. (- 1)^i*a i) ----> l)" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
276 |
(is "\<exists>l. ((\<forall>n. ?f n \<le> l) \<and> _) \<and> ((\<forall>n. l \<le> ?g n) \<and> _)") |
53079 | 277 |
proof (rule nested_sequence_unique) |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
278 |
have fg_diff: "\<And>n. ?f n - ?g n = - a (2 * n)" unfolding One_nat_def by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
279 |
|
53079 | 280 |
show "\<forall>n. ?f n \<le> ?f (Suc n)" |
281 |
proof |
|
282 |
fix n |
|
283 |
show "?f n \<le> ?f (Suc n)" using mono[of "2*n"] by auto |
|
284 |
qed |
|
285 |
show "\<forall>n. ?g (Suc n) \<le> ?g n" |
|
286 |
proof |
|
287 |
fix n |
|
288 |
show "?g (Suc n) \<le> ?g n" using mono[of "Suc (2*n)"] |
|
289 |
unfolding One_nat_def by auto |
|
290 |
qed |
|
291 |
show "\<forall>n. ?f n \<le> ?g n" |
|
292 |
proof |
|
293 |
fix n |
|
294 |
show "?f n \<le> ?g n" using fg_diff a_pos |
|
295 |
unfolding One_nat_def by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
296 |
qed |
53079 | 297 |
show "(\<lambda>n. ?f n - ?g n) ----> 0" unfolding fg_diff |
298 |
proof (rule LIMSEQ_I) |
|
299 |
fix r :: real |
|
300 |
assume "0 < r" |
|
60758 | 301 |
with \<open>a ----> 0\<close>[THEN LIMSEQ_D] obtain N where "\<And> n. n \<ge> N \<Longrightarrow> norm (a n - 0) < r" |
53079 | 302 |
by auto |
303 |
hence "\<forall>n \<ge> N. norm (- a (2 * n) - 0) < r" by auto |
|
304 |
thus "\<exists>N. \<forall>n \<ge> N. norm (- a (2 * n) - 0) < r" by auto |
|
305 |
qed |
|
41970 | 306 |
qed |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
307 |
|
53079 | 308 |
lemma summable_Leibniz': |
309 |
fixes a :: "nat \<Rightarrow> real" |
|
310 |
assumes a_zero: "a ----> 0" |
|
311 |
and a_pos: "\<And> n. 0 \<le> a n" |
|
312 |
and a_monotone: "\<And> n. a (Suc n) \<le> a n" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
313 |
shows summable: "summable (\<lambda> n. (-1)^n * a n)" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
314 |
and "\<And>n. (\<Sum>i<2*n. (-1)^i*a i) \<le> (\<Sum>i. (-1)^i*a i)" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
315 |
and "(\<lambda>n. \<Sum>i<2*n. (-1)^i*a i) ----> (\<Sum>i. (-1)^i*a i)" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
316 |
and "\<And>n. (\<Sum>i. (-1)^i*a i) \<le> (\<Sum>i<2*n+1. (-1)^i*a i)" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
317 |
and "(\<lambda>n. \<Sum>i<2*n+1. (-1)^i*a i) ----> (\<Sum>i. (-1)^i*a i)" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
318 |
proof - |
53079 | 319 |
let ?S = "\<lambda>n. (-1)^n * a n" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
320 |
let ?P = "\<lambda>n. \<Sum>i<n. ?S i" |
53079 | 321 |
let ?f = "\<lambda>n. ?P (2 * n)" |
322 |
let ?g = "\<lambda>n. ?P (2 * n + 1)" |
|
323 |
obtain l :: real |
|
324 |
where below_l: "\<forall> n. ?f n \<le> l" |
|
325 |
and "?f ----> l" |
|
326 |
and above_l: "\<forall> n. l \<le> ?g n" |
|
327 |
and "?g ----> l" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
328 |
using sums_alternating_upper_lower[OF a_monotone a_pos a_zero] by blast |
41970 | 329 |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
330 |
let ?Sa = "\<lambda>m. \<Sum>n<m. ?S n" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
331 |
have "?Sa ----> l" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
332 |
proof (rule LIMSEQ_I) |
53079 | 333 |
fix r :: real |
334 |
assume "0 < r" |
|
60758 | 335 |
with \<open>?f ----> l\<close>[THEN LIMSEQ_D] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
336 |
obtain f_no where f: "\<And> n. n \<ge> f_no \<Longrightarrow> norm (?f n - l) < r" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
337 |
|
60758 | 338 |
from \<open>0 < r\<close> \<open>?g ----> l\<close>[THEN LIMSEQ_D] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
339 |
obtain g_no where g: "\<And> n. n \<ge> g_no \<Longrightarrow> norm (?g n - l) < r" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
340 |
|
53079 | 341 |
{ |
342 |
fix n :: nat |
|
343 |
assume "n \<ge> (max (2 * f_no) (2 * g_no))" |
|
344 |
hence "n \<ge> 2 * f_no" and "n \<ge> 2 * g_no" by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
345 |
have "norm (?Sa n - l) < r" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
346 |
proof (cases "even n") |
53079 | 347 |
case True |
58710
7216a10d69ba
augmented and tuned facts on even/odd and division
haftmann
parents:
58709
diff
changeset
|
348 |
then have n_eq: "2 * (n div 2) = n" by (simp add: even_two_times_div_two) |
60758 | 349 |
with \<open>n \<ge> 2 * f_no\<close> have "n div 2 \<ge> f_no" |
53079 | 350 |
by auto |
351 |
from f[OF this] show ?thesis |
|
352 |
unfolding n_eq atLeastLessThanSuc_atLeastAtMost . |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
353 |
next |
53079 | 354 |
case False |
355 |
hence "even (n - 1)" by simp |
|
58710
7216a10d69ba
augmented and tuned facts on even/odd and division
haftmann
parents:
58709
diff
changeset
|
356 |
then have n_eq: "2 * ((n - 1) div 2) = n - 1" |
7216a10d69ba
augmented and tuned facts on even/odd and division
haftmann
parents:
58709
diff
changeset
|
357 |
by (simp add: even_two_times_div_two) |
53079 | 358 |
hence range_eq: "n - 1 + 1 = n" |
359 |
using odd_pos[OF False] by auto |
|
360 |
||
60758 | 361 |
from n_eq \<open>n \<ge> 2 * g_no\<close> have "(n - 1) div 2 \<ge> g_no" |
53079 | 362 |
by auto |
363 |
from g[OF this] show ?thesis |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
364 |
unfolding n_eq range_eq . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
365 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
366 |
} |
53079 | 367 |
thus "\<exists>no. \<forall>n \<ge> no. norm (?Sa n - l) < r" by blast |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
368 |
qed |
53079 | 369 |
hence sums_l: "(\<lambda>i. (-1)^i * a i) sums l" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
370 |
unfolding sums_def . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
371 |
thus "summable ?S" using summable_def by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
372 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
373 |
have "l = suminf ?S" using sums_unique[OF sums_l] . |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
374 |
|
53079 | 375 |
fix n |
376 |
show "suminf ?S \<le> ?g n" |
|
377 |
unfolding sums_unique[OF sums_l, symmetric] using above_l by auto |
|
378 |
show "?f n \<le> suminf ?S" |
|
379 |
unfolding sums_unique[OF sums_l, symmetric] using below_l by auto |
|
380 |
show "?g ----> suminf ?S" |
|
60758 | 381 |
using \<open>?g ----> l\<close> \<open>l = suminf ?S\<close> by auto |
53079 | 382 |
show "?f ----> suminf ?S" |
60758 | 383 |
using \<open>?f ----> l\<close> \<open>l = suminf ?S\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
384 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
385 |
|
53079 | 386 |
theorem summable_Leibniz: |
387 |
fixes a :: "nat \<Rightarrow> real" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
388 |
assumes a_zero: "a ----> 0" and "monoseq a" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
389 |
shows "summable (\<lambda> n. (-1)^n * a n)" (is "?summable") |
53079 | 390 |
and "0 < a 0 \<longrightarrow> |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
391 |
(\<forall>n. (\<Sum>i. (- 1)^i*a i) \<in> { \<Sum>i<2*n. (- 1)^i * a i .. \<Sum>i<2*n+1. (- 1)^i * a i})" (is "?pos") |
53079 | 392 |
and "a 0 < 0 \<longrightarrow> |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
393 |
(\<forall>n. (\<Sum>i. (- 1)^i*a i) \<in> { \<Sum>i<2*n+1. (- 1)^i * a i .. \<Sum>i<2*n. (- 1)^i * a i})" (is "?neg") |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
394 |
and "(\<lambda>n. \<Sum>i<2*n. (- 1)^i*a i) ----> (\<Sum>i. (- 1)^i*a i)" (is "?f") |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
395 |
and "(\<lambda>n. \<Sum>i<2*n+1. (- 1)^i*a i) ----> (\<Sum>i. (- 1)^i*a i)" (is "?g") |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
396 |
proof - |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
397 |
have "?summable \<and> ?pos \<and> ?neg \<and> ?f \<and> ?g" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
398 |
proof (cases "(\<forall> n. 0 \<le> a n) \<and> (\<forall>m. \<forall>n\<ge>m. a n \<le> a m)") |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
399 |
case True |
53079 | 400 |
hence ord: "\<And>n m. m \<le> n \<Longrightarrow> a n \<le> a m" and ge0: "\<And> n. 0 \<le> a n" |
401 |
by auto |
|
402 |
{ |
|
403 |
fix n |
|
404 |
have "a (Suc n) \<le> a n" |
|
405 |
using ord[where n="Suc n" and m=n] by auto |
|
406 |
} note mono = this |
|
60758 | 407 |
note leibniz = summable_Leibniz'[OF \<open>a ----> 0\<close> ge0] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
408 |
from leibniz[OF mono] |
60758 | 409 |
show ?thesis using \<open>0 \<le> a 0\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
410 |
next |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
411 |
let ?a = "\<lambda> n. - a n" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
412 |
case False |
60758 | 413 |
with monoseq_le[OF \<open>monoseq a\<close> \<open>a ----> 0\<close>] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
414 |
have "(\<forall> n. a n \<le> 0) \<and> (\<forall>m. \<forall>n\<ge>m. a m \<le> a n)" by auto |
53079 | 415 |
hence ord: "\<And>n m. m \<le> n \<Longrightarrow> ?a n \<le> ?a m" and ge0: "\<And> n. 0 \<le> ?a n" |
416 |
by auto |
|
417 |
{ |
|
418 |
fix n |
|
419 |
have "?a (Suc n) \<le> ?a n" using ord[where n="Suc n" and m=n] |
|
420 |
by auto |
|
421 |
} note monotone = this |
|
422 |
note leibniz = |
|
423 |
summable_Leibniz'[OF _ ge0, of "\<lambda>x. x", |
|
60758 | 424 |
OF tendsto_minus[OF \<open>a ----> 0\<close>, unfolded minus_zero] monotone] |
53079 | 425 |
have "summable (\<lambda> n. (-1)^n * ?a n)" |
426 |
using leibniz(1) by auto |
|
427 |
then obtain l where "(\<lambda> n. (-1)^n * ?a n) sums l" |
|
428 |
unfolding summable_def by auto |
|
429 |
from this[THEN sums_minus] have "(\<lambda> n. (-1)^n * a n) sums -l" |
|
430 |
by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
431 |
hence ?summable unfolding summable_def by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
432 |
moreover |
53079 | 433 |
have "\<And>a b :: real. \<bar>- a - - b\<bar> = \<bar>a - b\<bar>" |
434 |
unfolding minus_diff_minus by auto |
|
41970 | 435 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
436 |
from suminf_minus[OF leibniz(1), unfolded mult_minus_right minus_minus] |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
437 |
have move_minus: "(\<Sum>n. - ((- 1) ^ n * a n)) = - (\<Sum>n. (- 1) ^ n * a n)" |
53079 | 438 |
by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
439 |
|
60758 | 440 |
have ?pos using \<open>0 \<le> ?a 0\<close> by auto |
53079 | 441 |
moreover have ?neg |
442 |
using leibniz(2,4) |
|
443 |
unfolding mult_minus_right setsum_negf move_minus neg_le_iff_le |
|
444 |
by auto |
|
445 |
moreover have ?f and ?g |
|
446 |
using leibniz(3,5)[unfolded mult_minus_right setsum_negf move_minus, THEN tendsto_minus_cancel] |
|
447 |
by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
448 |
ultimately show ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
449 |
qed |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
450 |
then show ?summable and ?pos and ?neg and ?f and ?g |
54573 | 451 |
by safe |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
452 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
453 |
|
60758 | 454 |
subsection \<open>Term-by-Term Differentiability of Power Series\<close> |
23043 | 455 |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
456 |
definition diffs :: "(nat \<Rightarrow> 'a::ring_1) \<Rightarrow> nat \<Rightarrow> 'a" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
457 |
where "diffs c = (\<lambda>n. of_nat (Suc n) * c (Suc n))" |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
458 |
|
60758 | 459 |
text\<open>Lemma about distributing negation over it\<close> |
53079 | 460 |
lemma diffs_minus: "diffs (\<lambda>n. - c n) = (\<lambda>n. - diffs c n)" |
461 |
by (simp add: diffs_def) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
462 |
|
29163 | 463 |
lemma sums_Suc_imp: |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
464 |
"(f::nat \<Rightarrow> 'a::real_normed_vector) 0 = 0 \<Longrightarrow> (\<lambda>n. f (Suc n)) sums s \<Longrightarrow> (\<lambda>n. f n) sums s" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
465 |
using sums_Suc_iff[of f] by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
466 |
|
15229 | 467 |
lemma diffs_equiv: |
41970 | 468 |
fixes x :: "'a::{real_normed_vector, ring_1}" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
469 |
shows "summable (\<lambda>n. diffs c n * x^n) \<Longrightarrow> |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
470 |
(\<lambda>n. of_nat n * c n * x^(n - Suc 0)) sums (\<Sum>n. diffs c n * x^n)" |
53079 | 471 |
unfolding diffs_def |
54573 | 472 |
by (simp add: summable_sums sums_Suc_imp) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
473 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
474 |
lemma lemma_termdiff1: |
31017 | 475 |
fixes z :: "'a :: {monoid_mult,comm_ring}" shows |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
476 |
"(\<Sum>p<m. (((z + h) ^ (m - p)) * (z ^ p)) - (z ^ m)) = |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
477 |
(\<Sum>p<m. (z ^ p) * (((z + h) ^ (m - p)) - (z ^ (m - p))))" |
53079 | 478 |
by (auto simp add: algebra_simps power_add [symmetric]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
479 |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
480 |
lemma sumr_diff_mult_const2: |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
481 |
"setsum f {..<n} - of_nat n * (r::'a::ring_1) = (\<Sum>i<n. f i - r)" |
53079 | 482 |
by (simp add: setsum_subtractf) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
483 |
|
60162 | 484 |
lemma lemma_realpow_rev_sumr: |
485 |
"(\<Sum>p<Suc n. (x ^ p) * (y ^ (n - p))) = |
|
486 |
(\<Sum>p<Suc n. (x ^ (n - p)) * (y ^ p))" |
|
487 |
by (subst nat_diff_setsum_reindex[symmetric]) simp |
|
488 |
||
15229 | 489 |
lemma lemma_termdiff2: |
31017 | 490 |
fixes h :: "'a :: {field}" |
53079 | 491 |
assumes h: "h \<noteq> 0" |
492 |
shows |
|
493 |
"((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0) = |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
494 |
h * (\<Sum>p< n - Suc 0. \<Sum>q< n - Suc 0 - p. |
53079 | 495 |
(z + h) ^ q * z ^ (n - 2 - q))" (is "?lhs = ?rhs") |
496 |
apply (subgoal_tac "h * ?lhs = h * ?rhs", simp add: h) |
|
497 |
apply (simp add: right_diff_distrib diff_divide_distrib h) |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
498 |
apply (simp add: mult.assoc [symmetric]) |
53079 | 499 |
apply (cases "n", simp) |
60162 | 500 |
apply (simp add: diff_power_eq_setsum h |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
501 |
right_diff_distrib [symmetric] mult.assoc |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
502 |
del: power_Suc setsum_lessThan_Suc of_nat_Suc) |
53079 | 503 |
apply (subst lemma_realpow_rev_sumr) |
504 |
apply (subst sumr_diff_mult_const2) |
|
505 |
apply simp |
|
506 |
apply (simp only: lemma_termdiff1 setsum_right_distrib) |
|
57418 | 507 |
apply (rule setsum.cong [OF refl]) |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53602
diff
changeset
|
508 |
apply (simp add: less_iff_Suc_add) |
53079 | 509 |
apply (clarify) |
60162 | 510 |
apply (simp add: setsum_right_distrib diff_power_eq_setsum ac_simps |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
511 |
del: setsum_lessThan_Suc power_Suc) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
512 |
apply (subst mult.assoc [symmetric], subst power_add [symmetric]) |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
513 |
apply (simp add: ac_simps) |
53079 | 514 |
done |
20860 | 515 |
|
516 |
lemma real_setsum_nat_ivl_bounded2: |
|
35028
108662d50512
more consistent naming of type classes involving orderings (and lattices) -- c.f. NEWS
haftmann
parents:
34974
diff
changeset
|
517 |
fixes K :: "'a::linordered_semidom" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
518 |
assumes f: "\<And>p::nat. p < n \<Longrightarrow> f p \<le> K" |
53079 | 519 |
and K: "0 \<le> K" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
520 |
shows "setsum f {..<n-k} \<le> of_nat n * K" |
53079 | 521 |
apply (rule order_trans [OF setsum_mono]) |
522 |
apply (rule f, simp) |
|
523 |
apply (simp add: mult_right_mono K) |
|
524 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
525 |
|
15229 | 526 |
lemma lemma_termdiff3: |
31017 | 527 |
fixes h z :: "'a::{real_normed_field}" |
20860 | 528 |
assumes 1: "h \<noteq> 0" |
53079 | 529 |
and 2: "norm z \<le> K" |
530 |
and 3: "norm (z + h) \<le> K" |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
531 |
shows "norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
532 |
\<le> of_nat n * of_nat (n - Suc 0) * K ^ (n - 2) * norm h" |
20860 | 533 |
proof - |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
534 |
have "norm (((z + h) ^ n - z ^ n) / h - of_nat n * z ^ (n - Suc 0)) = |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
535 |
norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
536 |
(z + h) ^ q * z ^ (n - 2 - q)) * norm h" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
537 |
by (metis (lifting, no_types) lemma_termdiff2 [OF 1] mult.commute norm_mult) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
538 |
also have "\<dots> \<le> of_nat n * (of_nat (n - Suc 0) * K ^ (n - 2)) * norm h" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
539 |
proof (rule mult_right_mono [OF _ norm_ge_zero]) |
53079 | 540 |
from norm_ge_zero 2 have K: "0 \<le> K" |
541 |
by (rule order_trans) |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
542 |
have le_Kn: "\<And>i j n. i + j = n \<Longrightarrow> norm ((z + h) ^ i * z ^ j) \<le> K ^ n" |
20860 | 543 |
apply (erule subst) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
544 |
apply (simp only: norm_mult norm_power power_add) |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
545 |
apply (intro mult_mono power_mono 2 3 norm_ge_zero zero_le_power K) |
20860 | 546 |
done |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
547 |
show "norm (\<Sum>p<n - Suc 0. \<Sum>q<n - Suc 0 - p. (z + h) ^ q * z ^ (n - 2 - q)) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
548 |
\<le> of_nat n * (of_nat (n - Suc 0) * K ^ (n - 2))" |
20860 | 549 |
apply (intro |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
550 |
order_trans [OF norm_setsum] |
20860 | 551 |
real_setsum_nat_ivl_bounded2 |
552 |
mult_nonneg_nonneg |
|
47489 | 553 |
of_nat_0_le_iff |
20860 | 554 |
zero_le_power K) |
555 |
apply (rule le_Kn, simp) |
|
556 |
done |
|
557 |
qed |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
558 |
also have "\<dots> = of_nat n * of_nat (n - Suc 0) * K ^ (n - 2) * norm h" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
559 |
by (simp only: mult.assoc) |
20860 | 560 |
finally show ?thesis . |
561 |
qed |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
562 |
|
20860 | 563 |
lemma lemma_termdiff4: |
56167 | 564 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
20860 | 565 |
assumes k: "0 < (k::real)" |
53079 | 566 |
and le: "\<And>h. \<lbrakk>h \<noteq> 0; norm h < k\<rbrakk> \<Longrightarrow> norm (f h) \<le> K * norm h" |
20860 | 567 |
shows "f -- 0 --> 0" |
56167 | 568 |
proof (rule tendsto_norm_zero_cancel) |
569 |
show "(\<lambda>h. norm (f h)) -- 0 --> 0" |
|
570 |
proof (rule real_tendsto_sandwich) |
|
571 |
show "eventually (\<lambda>h. 0 \<le> norm (f h)) (at 0)" |
|
20860 | 572 |
by simp |
56167 | 573 |
show "eventually (\<lambda>h. norm (f h) \<le> K * norm h) (at 0)" |
574 |
using k by (auto simp add: eventually_at dist_norm le) |
|
575 |
show "(\<lambda>h. 0) -- (0::'a) --> (0::real)" |
|
576 |
by (rule tendsto_const) |
|
577 |
have "(\<lambda>h. K * norm h) -- (0::'a) --> K * norm (0::'a)" |
|
578 |
by (intro tendsto_intros) |
|
579 |
then show "(\<lambda>h. K * norm h) -- (0::'a) --> 0" |
|
580 |
by simp |
|
20860 | 581 |
qed |
582 |
qed |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
583 |
|
15229 | 584 |
lemma lemma_termdiff5: |
56167 | 585 |
fixes g :: "'a::real_normed_vector \<Rightarrow> nat \<Rightarrow> 'b::banach" |
20860 | 586 |
assumes k: "0 < (k::real)" |
587 |
assumes f: "summable f" |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
588 |
assumes le: "\<And>h n. \<lbrakk>h \<noteq> 0; norm h < k\<rbrakk> \<Longrightarrow> norm (g h n) \<le> f n * norm h" |
20860 | 589 |
shows "(\<lambda>h. suminf (g h)) -- 0 --> 0" |
590 |
proof (rule lemma_termdiff4 [OF k]) |
|
53079 | 591 |
fix h::'a |
592 |
assume "h \<noteq> 0" and "norm h < k" |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
593 |
hence A: "\<forall>n. norm (g h n) \<le> f n * norm h" |
20860 | 594 |
by (simp add: le) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
595 |
hence "\<exists>N. \<forall>n\<ge>N. norm (norm (g h n)) \<le> f n * norm h" |
20860 | 596 |
by simp |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
597 |
moreover from f have B: "summable (\<lambda>n. f n * norm h)" |
20860 | 598 |
by (rule summable_mult2) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
599 |
ultimately have C: "summable (\<lambda>n. norm (g h n))" |
20860 | 600 |
by (rule summable_comparison_test) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
601 |
hence "norm (suminf (g h)) \<le> (\<Sum>n. norm (g h n))" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
602 |
by (rule summable_norm) |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
603 |
also from A C B have "(\<Sum>n. norm (g h n)) \<le> (\<Sum>n. f n * norm h)" |
56213 | 604 |
by (rule suminf_le) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
605 |
also from f have "(\<Sum>n. f n * norm h) = suminf f * norm h" |
20860 | 606 |
by (rule suminf_mult2 [symmetric]) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
607 |
finally show "norm (suminf (g h)) \<le> suminf f * norm h" . |
20860 | 608 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
609 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
610 |
|
60758 | 611 |
text\<open>FIXME: Long proofs\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
612 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
613 |
lemma termdiffs_aux: |
31017 | 614 |
fixes x :: "'a::{real_normed_field,banach}" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
615 |
assumes 1: "summable (\<lambda>n. diffs (diffs c) n * K ^ n)" |
53079 | 616 |
and 2: "norm x < norm K" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
617 |
shows "(\<lambda>h. \<Sum>n. c n * (((x + h) ^ n - x^n) / h |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
618 |
- of_nat n * x ^ (n - Suc 0))) -- 0 --> 0" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
619 |
proof - |
20860 | 620 |
from dense [OF 2] |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
621 |
obtain r where r1: "norm x < r" and r2: "r < norm K" by fast |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
622 |
from norm_ge_zero r1 have r: "0 < r" |
20860 | 623 |
by (rule order_le_less_trans) |
624 |
hence r_neq_0: "r \<noteq> 0" by simp |
|
625 |
show ?thesis |
|
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
626 |
proof (rule lemma_termdiff5) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
627 |
show "0 < r - norm x" using r1 by simp |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
628 |
from r r2 have "norm (of_real r::'a) < norm K" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
629 |
by simp |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
630 |
with 1 have "summable (\<lambda>n. norm (diffs (diffs c) n * (of_real r ^ n)))" |
20860 | 631 |
by (rule powser_insidea) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
632 |
hence "summable (\<lambda>n. diffs (diffs (\<lambda>n. norm (c n))) n * r ^ n)" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
633 |
using r |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
634 |
by (simp add: diffs_def norm_mult norm_power del: of_nat_Suc) |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
635 |
hence "summable (\<lambda>n. of_nat n * diffs (\<lambda>n. norm (c n)) n * r ^ (n - Suc 0))" |
20860 | 636 |
by (rule diffs_equiv [THEN sums_summable]) |
53079 | 637 |
also have "(\<lambda>n. of_nat n * diffs (\<lambda>n. norm (c n)) n * r ^ (n - Suc 0)) = |
638 |
(\<lambda>n. diffs (\<lambda>m. of_nat (m - Suc 0) * norm (c m) * inverse r) n * (r ^ n))" |
|
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
639 |
apply (rule ext) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
640 |
apply (simp add: diffs_def) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
641 |
apply (case_tac n, simp_all add: r_neq_0) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
642 |
done |
41970 | 643 |
finally have "summable |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
644 |
(\<lambda>n. of_nat n * (of_nat (n - Suc 0) * norm (c n) * inverse r) * r ^ (n - Suc 0))" |
20860 | 645 |
by (rule diffs_equiv [THEN sums_summable]) |
646 |
also have |
|
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
647 |
"(\<lambda>n. of_nat n * (of_nat (n - Suc 0) * norm (c n) * inverse r) * |
20860 | 648 |
r ^ (n - Suc 0)) = |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
649 |
(\<lambda>n. norm (c n) * of_nat n * of_nat (n - Suc 0) * r ^ (n - 2))" |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
650 |
apply (rule ext) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
651 |
apply (case_tac "n", simp) |
55417
01fbfb60c33e
adapted to 'xxx_{case,rec}' renaming, to new theorem names, and to new variable names in theorems
blanchet
parents:
54576
diff
changeset
|
652 |
apply (rename_tac nat) |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
653 |
apply (case_tac "nat", simp) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
654 |
apply (simp add: r_neq_0) |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
655 |
done |
53079 | 656 |
finally |
657 |
show "summable (\<lambda>n. norm (c n) * of_nat n * of_nat (n - Suc 0) * r ^ (n - 2))" . |
|
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
658 |
next |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
659 |
fix h::'a and n::nat |
20860 | 660 |
assume h: "h \<noteq> 0" |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
661 |
assume "norm h < r - norm x" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
662 |
hence "norm x + norm h < r" by simp |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
663 |
with norm_triangle_ineq have xh: "norm (x + h) < r" |
20860 | 664 |
by (rule order_le_less_trans) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
665 |
show "norm (c n * (((x + h) ^ n - x^n) / h - of_nat n * x ^ (n - Suc 0))) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
666 |
\<le> norm (c n) * of_nat n * of_nat (n - Suc 0) * r ^ (n - 2) * norm h" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
667 |
apply (simp only: norm_mult mult.assoc) |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
668 |
apply (rule mult_left_mono [OF _ norm_ge_zero]) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
669 |
apply (simp add: mult.assoc [symmetric]) |
54575 | 670 |
apply (metis h lemma_termdiff3 less_eq_real_def r1 xh) |
20860 | 671 |
done |
20849
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
672 |
qed |
389cd9c8cfe1
rewrite proofs of powser_insidea and termdiffs_aux
huffman
parents:
20692
diff
changeset
|
673 |
qed |
20217
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
webertj
parents:
19765
diff
changeset
|
674 |
|
20860 | 675 |
lemma termdiffs: |
31017 | 676 |
fixes K x :: "'a::{real_normed_field,banach}" |
20860 | 677 |
assumes 1: "summable (\<lambda>n. c n * K ^ n)" |
54575 | 678 |
and 2: "summable (\<lambda>n. (diffs c) n * K ^ n)" |
679 |
and 3: "summable (\<lambda>n. (diffs (diffs c)) n * K ^ n)" |
|
680 |
and 4: "norm x < norm K" |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
681 |
shows "DERIV (\<lambda>x. \<Sum>n. c n * x^n) x :> (\<Sum>n. (diffs c) n * x^n)" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
682 |
unfolding DERIV_def |
29163 | 683 |
proof (rule LIM_zero_cancel) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
684 |
show "(\<lambda>h. (suminf (\<lambda>n. c n * (x + h) ^ n) - suminf (\<lambda>n. c n * x^n)) / h |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
685 |
- suminf (\<lambda>n. diffs c n * x^n)) -- 0 --> 0" |
20860 | 686 |
proof (rule LIM_equal2) |
29163 | 687 |
show "0 < norm K - norm x" using 4 by (simp add: less_diff_eq) |
20860 | 688 |
next |
23082
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
689 |
fix h :: 'a |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
690 |
assume "norm (h - 0) < norm K - norm x" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
691 |
hence "norm x + norm h < norm K" by simp |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
692 |
hence 5: "norm (x + h) < norm K" |
ffef77eed382
generalize powerseries and termdiffs lemmas using axclasses
huffman
parents:
23069
diff
changeset
|
693 |
by (rule norm_triangle_ineq [THEN order_le_less_trans]) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
694 |
have "summable (\<lambda>n. c n * x^n)" |
56167 | 695 |
and "summable (\<lambda>n. c n * (x + h) ^ n)" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
696 |
and "summable (\<lambda>n. diffs c n * x^n)" |
56167 | 697 |
using 1 2 4 5 by (auto elim: powser_inside) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
698 |
then have "((\<Sum>n. c n * (x + h) ^ n) - (\<Sum>n. c n * x^n)) / h - (\<Sum>n. diffs c n * x^n) = |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
699 |
(\<Sum>n. (c n * (x + h) ^ n - c n * x^n) / h - of_nat n * c n * x ^ (n - Suc 0))" |
56167 | 700 |
by (intro sums_unique sums_diff sums_divide diffs_equiv summable_sums) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
701 |
then show "((\<Sum>n. c n * (x + h) ^ n) - (\<Sum>n. c n * x^n)) / h - (\<Sum>n. diffs c n * x^n) = |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
702 |
(\<Sum>n. c n * (((x + h) ^ n - x^n) / h - of_nat n * x ^ (n - Suc 0)))" |
54575 | 703 |
by (simp add: algebra_simps) |
20860 | 704 |
next |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
705 |
show "(\<lambda>h. \<Sum>n. c n * (((x + h) ^ n - x^n) / h - of_nat n * x ^ (n - Suc 0))) -- 0 --> 0" |
53079 | 706 |
by (rule termdiffs_aux [OF 3 4]) |
20860 | 707 |
qed |
708 |
qed |
|
709 |
||
60758 | 710 |
subsection \<open>The Derivative of a Power Series Has the Same Radius of Convergence\<close> |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
711 |
|
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
712 |
lemma termdiff_converges: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
713 |
fixes x :: "'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
714 |
assumes K: "norm x < K" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
715 |
and sm: "\<And>x. norm x < K \<Longrightarrow> summable(\<lambda>n. c n * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
716 |
shows "summable (\<lambda>n. diffs c n * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
717 |
proof (cases "x = 0") |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
718 |
case True then show ?thesis |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
719 |
using powser_sums_zero sums_summable by auto |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
720 |
next |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
721 |
case False |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
722 |
then have "K>0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
723 |
using K less_trans zero_less_norm_iff by blast |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
724 |
then obtain r::real where r: "norm x < norm r" "norm r < K" "r>0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
725 |
using K False |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
726 |
by (auto simp: field_simps abs_less_iff add_pos_pos intro: that [of "(norm x + K) / 2"]) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
727 |
have "(\<lambda>n. of_nat n * (x / of_real r) ^ n) ----> 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
728 |
using r by (simp add: norm_divide powser_times_n_limit_0 [of "x / of_real r"]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
729 |
then obtain N where N: "\<And>n. n\<ge>N \<Longrightarrow> real_of_nat n * norm x ^ n < r ^ n" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
730 |
using r unfolding LIMSEQ_iff |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
731 |
apply (drule_tac x=1 in spec) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
732 |
apply (auto simp: norm_divide norm_mult norm_power field_simps) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
733 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
734 |
have "summable (\<lambda>n. (of_nat n * c n) * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
735 |
apply (rule summable_comparison_test' [of "\<lambda>n. norm(c n * (of_real r) ^ n)" N]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
736 |
apply (rule powser_insidea [OF sm [of "of_real ((r+K)/2)"]]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
737 |
using N r norm_of_real [of "r+K", where 'a = 'a] |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
738 |
apply (auto simp add: norm_divide norm_mult norm_power field_simps) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
739 |
using less_eq_real_def by fastforce |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
740 |
then have "summable (\<lambda>n. (of_nat (Suc n) * c(Suc n)) * x ^ Suc n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
741 |
using summable_iff_shift [of "\<lambda>n. of_nat n * c n * x ^ n" 1] |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
742 |
by simp |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
743 |
then have "summable (\<lambda>n. (of_nat (Suc n) * c(Suc n)) * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
744 |
using False summable_mult2 [of "\<lambda>n. (of_nat (Suc n) * c(Suc n) * x ^ n) * x" "inverse x"] |
60867 | 745 |
by (simp add: mult.assoc) (auto simp: ac_simps) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
746 |
then show ?thesis |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
747 |
by (simp add: diffs_def) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
748 |
qed |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
749 |
|
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
750 |
lemma termdiff_converges_all: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
751 |
fixes x :: "'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
752 |
assumes "\<And>x. summable (\<lambda>n. c n * x^n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
753 |
shows "summable (\<lambda>n. diffs c n * x^n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
754 |
apply (rule termdiff_converges [where K = "1 + norm x"]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
755 |
using assms |
60762 | 756 |
apply auto |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
757 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
758 |
|
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
759 |
lemma termdiffs_strong: |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
760 |
fixes K x :: "'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
761 |
assumes sm: "summable (\<lambda>n. c n * K ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
762 |
and K: "norm x < norm K" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
763 |
shows "DERIV (\<lambda>x. \<Sum>n. c n * x^n) x :> (\<Sum>n. diffs c n * x^n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
764 |
proof - |
60762 | 765 |
have K2: "norm ((of_real (norm K) + of_real (norm x)) / 2 :: 'a) < norm K" |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
766 |
using K |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
767 |
apply (auto simp: norm_divide field_simps) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
768 |
apply (rule le_less_trans [of _ "of_real (norm K) + of_real (norm x)"]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
769 |
apply (auto simp: mult_2_right norm_triangle_mono) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
770 |
done |
60762 | 771 |
then have [simp]: "norm ((of_real (norm K) + of_real (norm x)) :: 'a) < norm K * 2" |
772 |
by simp |
|
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
773 |
have "summable (\<lambda>n. c n * (of_real (norm x + norm K) / 2) ^ n)" |
60762 | 774 |
by (metis K2 summable_norm_cancel [OF powser_insidea [OF sm]] add.commute of_real_add) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
775 |
moreover have "\<And>x. norm x < norm K \<Longrightarrow> summable (\<lambda>n. diffs c n * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
776 |
by (blast intro: sm termdiff_converges powser_inside) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
777 |
moreover have "\<And>x. norm x < norm K \<Longrightarrow> summable (\<lambda>n. diffs(diffs c) n * x ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
778 |
by (blast intro: sm termdiff_converges powser_inside) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
779 |
ultimately show ?thesis |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
780 |
apply (rule termdiffs [where K = "of_real (norm x + norm K) / 2"]) |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
781 |
apply (auto simp: field_simps) |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
782 |
using K |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
783 |
apply (simp_all add: of_real_add [symmetric] del: of_real_add) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
784 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
785 |
qed |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
786 |
|
61552
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
787 |
lemma termdiffs_strong_converges_everywhere: |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
788 |
fixes K x :: "'a::{real_normed_field,banach}" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
789 |
assumes "\<And>y. summable (\<lambda>n. c n * y ^ n)" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
790 |
shows "((\<lambda>x. \<Sum>n. c n * x^n) has_field_derivative (\<Sum>n. diffs c n * x^n)) (at x)" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
791 |
using termdiffs_strong[OF assms[of "of_real (norm x + 1)"], of x] |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
792 |
by (force simp del: of_real_add) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
793 |
|
61552
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
794 |
lemma isCont_powser: |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
795 |
fixes K x :: "'a::{real_normed_field,banach}" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
796 |
assumes "summable (\<lambda>n. c n * K ^ n)" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
797 |
assumes "norm x < norm K" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
798 |
shows "isCont (\<lambda>x. \<Sum>n. c n * x^n) x" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
799 |
using termdiffs_strong[OF assms] by (blast intro!: DERIV_isCont) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
800 |
|
61552
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
801 |
lemmas isCont_powser' = isCont_o2[OF _ isCont_powser] |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
802 |
|
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
803 |
lemma isCont_powser_converges_everywhere: |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
804 |
fixes K x :: "'a::{real_normed_field,banach}" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
805 |
assumes "\<And>y. summable (\<lambda>n. c n * y ^ n)" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
806 |
shows "isCont (\<lambda>x. \<Sum>n. c n * x^n) x" |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
807 |
using termdiffs_strong[OF assms[of "of_real (norm x + 1)"], of x] |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
808 |
by (force intro!: DERIV_isCont simp del: of_real_add) |
980dd46a03fb
Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents:
61531
diff
changeset
|
809 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
810 |
lemma powser_limit_0: |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
811 |
fixes a :: "nat \<Rightarrow> 'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
812 |
assumes s: "0 < s" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
813 |
and sm: "\<And>x. norm x < s \<Longrightarrow> (\<lambda>n. a n * x ^ n) sums (f x)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
814 |
shows "(f ---> a 0) (at 0)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
815 |
proof - |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
816 |
have "summable (\<lambda>n. a n * (of_real s / 2) ^ n)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
817 |
apply (rule sums_summable [where l = "f (of_real s / 2)", OF sm]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
818 |
using s |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
819 |
apply (auto simp: norm_divide) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
820 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
821 |
then have "((\<lambda>x. \<Sum>n. a n * x ^ n) has_field_derivative (\<Sum>n. diffs a n * 0 ^ n)) (at 0)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
822 |
apply (rule termdiffs_strong) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
823 |
using s |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
824 |
apply (auto simp: norm_divide) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
825 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
826 |
then have "isCont (\<lambda>x. \<Sum>n. a n * x ^ n) 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
827 |
by (blast intro: DERIV_continuous) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
828 |
then have "((\<lambda>x. \<Sum>n. a n * x ^ n) ---> a 0) (at 0)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
829 |
by (simp add: continuous_within powser_zero) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
830 |
then show ?thesis |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
831 |
apply (rule Lim_transform) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
832 |
apply (auto simp add: LIM_eq) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
833 |
apply (rule_tac x="s" in exI) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
834 |
using s |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
835 |
apply (auto simp: sm [THEN sums_unique]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
836 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
837 |
qed |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
838 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
839 |
lemma powser_limit_0_strong: |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
840 |
fixes a :: "nat \<Rightarrow> 'a::{real_normed_field,banach}" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
841 |
assumes s: "0 < s" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
842 |
and sm: "\<And>x. x \<noteq> 0 \<Longrightarrow> norm x < s \<Longrightarrow> (\<lambda>n. a n * x ^ n) sums (f x)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
843 |
shows "(f ---> a 0) (at 0)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
844 |
proof - |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
845 |
have *: "((\<lambda>x. if x = 0 then a 0 else f x) ---> a 0) (at 0)" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
846 |
apply (rule powser_limit_0 [OF s]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
847 |
apply (case_tac "x=0") |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
848 |
apply (auto simp add: powser_sums_zero sm) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
849 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
850 |
show ?thesis |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
851 |
apply (subst LIM_equal [where g = "(\<lambda>x. if x = 0 then a 0 else f x)"]) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
852 |
apply (simp_all add: *) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
853 |
done |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
854 |
qed |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
855 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
856 |
|
60758 | 857 |
subsection \<open>Derivability of power series\<close> |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
858 |
|
53079 | 859 |
lemma DERIV_series': |
860 |
fixes f :: "real \<Rightarrow> nat \<Rightarrow> real" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
861 |
assumes DERIV_f: "\<And> n. DERIV (\<lambda> x. f x n) x0 :> (f' x0 n)" |
53079 | 862 |
and allf_summable: "\<And> x. x \<in> {a <..< b} \<Longrightarrow> summable (f x)" and x0_in_I: "x0 \<in> {a <..< b}" |
863 |
and "summable (f' x0)" |
|
864 |
and "summable L" |
|
865 |
and L_def: "\<And>n x y. \<lbrakk> x \<in> { a <..< b} ; y \<in> { a <..< b} \<rbrakk> \<Longrightarrow> \<bar>f x n - f y n\<bar> \<le> L n * \<bar>x - y\<bar>" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
866 |
shows "DERIV (\<lambda> x. suminf (f x)) x0 :> (suminf (f' x0))" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
867 |
unfolding DERIV_def |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
868 |
proof (rule LIM_I) |
53079 | 869 |
fix r :: real |
870 |
assume "0 < r" hence "0 < r/3" by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
871 |
|
41970 | 872 |
obtain N_L where N_L: "\<And> n. N_L \<le> n \<Longrightarrow> \<bar> \<Sum> i. L (i + n) \<bar> < r/3" |
60758 | 873 |
using suminf_exist_split[OF \<open>0 < r/3\<close> \<open>summable L\<close>] by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
874 |
|
41970 | 875 |
obtain N_f' where N_f': "\<And> n. N_f' \<le> n \<Longrightarrow> \<bar> \<Sum> i. f' x0 (i + n) \<bar> < r/3" |
60758 | 876 |
using suminf_exist_split[OF \<open>0 < r/3\<close> \<open>summable (f' x0)\<close>] by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
877 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
878 |
let ?N = "Suc (max N_L N_f')" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
879 |
have "\<bar> \<Sum> i. f' x0 (i + ?N) \<bar> < r/3" (is "?f'_part < r/3") and |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
880 |
L_estimate: "\<bar> \<Sum> i. L (i + ?N) \<bar> < r/3" using N_L[of "?N"] and N_f' [of "?N"] by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
881 |
|
53079 | 882 |
let ?diff = "\<lambda>i x. (f (x0 + x) i - f x0 i) / x" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
883 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
884 |
let ?r = "r / (3 * real ?N)" |
60758 | 885 |
from \<open>0 < r\<close> have "0 < ?r" by simp |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
886 |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
887 |
let ?s = "\<lambda>n. SOME s. 0 < s \<and> (\<forall> x. x \<noteq> 0 \<and> \<bar> x \<bar> < s \<longrightarrow> \<bar> ?diff n x - f' x0 n \<bar> < ?r)" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
888 |
def S' \<equiv> "Min (?s ` {..< ?N })" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
889 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
890 |
have "0 < S'" unfolding S'_def |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
891 |
proof (rule iffD2[OF Min_gr_iff]) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
892 |
show "\<forall>x \<in> (?s ` {..< ?N }). 0 < x" |
53079 | 893 |
proof |
894 |
fix x |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
895 |
assume "x \<in> ?s ` {..<?N}" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
896 |
then obtain n where "x = ?s n" and "n \<in> {..<?N}" |
53079 | 897 |
using image_iff[THEN iffD1] by blast |
60758 | 898 |
from DERIV_D[OF DERIV_f[where n=n], THEN LIM_D, OF \<open>0 < ?r\<close>, unfolded real_norm_def] |
53079 | 899 |
obtain s where s_bound: "0 < s \<and> (\<forall>x. x \<noteq> 0 \<and> \<bar>x\<bar> < s \<longrightarrow> \<bar>?diff n x - f' x0 n\<bar> < ?r)" |
900 |
by auto |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
901 |
have "0 < ?s n" by (rule someI2[where a=s]) (auto simp add: s_bound simp del: of_nat_Suc) |
60758 | 902 |
thus "0 < x" unfolding \<open>x = ?s n\<close> . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
903 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
904 |
qed auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
905 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
906 |
def S \<equiv> "min (min (x0 - a) (b - x0)) S'" |
53079 | 907 |
hence "0 < S" and S_a: "S \<le> x0 - a" and S_b: "S \<le> b - x0" |
60758 | 908 |
and "S \<le> S'" using x0_in_I and \<open>0 < S'\<close> |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
909 |
by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
910 |
|
53079 | 911 |
{ |
912 |
fix x |
|
913 |
assume "x \<noteq> 0" and "\<bar> x \<bar> < S" |
|
914 |
hence x_in_I: "x0 + x \<in> { a <..< b }" |
|
915 |
using S_a S_b by auto |
|
41970 | 916 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
917 |
note diff_smbl = summable_diff[OF allf_summable[OF x_in_I] allf_summable[OF x0_in_I]] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
918 |
note div_smbl = summable_divide[OF diff_smbl] |
60758 | 919 |
note all_smbl = summable_diff[OF div_smbl \<open>summable (f' x0)\<close>] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
920 |
note ign = summable_ignore_initial_segment[where k="?N"] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
921 |
note diff_shft_smbl = summable_diff[OF ign[OF allf_summable[OF x_in_I]] ign[OF allf_summable[OF x0_in_I]]] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
922 |
note div_shft_smbl = summable_divide[OF diff_shft_smbl] |
60758 | 923 |
note all_shft_smbl = summable_diff[OF div_smbl ign[OF \<open>summable (f' x0)\<close>]] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
924 |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
925 |
{ fix n |
41970 | 926 |
have "\<bar> ?diff (n + ?N) x \<bar> \<le> L (n + ?N) * \<bar> (x0 + x) - x0 \<bar> / \<bar> x \<bar>" |
53079 | 927 |
using divide_right_mono[OF L_def[OF x_in_I x0_in_I] abs_ge_zero] |
928 |
unfolding abs_divide . |
|
929 |
hence "\<bar> (\<bar>?diff (n + ?N) x \<bar>) \<bar> \<le> L (n + ?N)" |
|
60758 | 930 |
using \<open>x \<noteq> 0\<close> by auto } |
931 |
note 1 = this and 2 = summable_rabs_comparison_test[OF _ ign[OF \<open>summable L\<close>]] |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
932 |
then have "\<bar> \<Sum> i. ?diff (i + ?N) x \<bar> \<le> (\<Sum> i. L (i + ?N))" |
60758 | 933 |
by (metis (lifting) abs_idempotent order_trans[OF summable_rabs[OF 2] suminf_le[OF _ 2 ign[OF \<open>summable L\<close>]]]) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
934 |
then have "\<bar> \<Sum> i. ?diff (i + ?N) x \<bar> \<le> r / 3" (is "?L_part \<le> r/3") |
53079 | 935 |
using L_estimate by auto |
936 |
||
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
937 |
have "\<bar>\<Sum>n<?N. ?diff n x - f' x0 n \<bar> \<le> (\<Sum>n<?N. \<bar>?diff n x - f' x0 n \<bar>)" .. |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
938 |
also have "\<dots> < (\<Sum>n<?N. ?r)" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
939 |
proof (rule setsum_strict_mono) |
53079 | 940 |
fix n |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
941 |
assume "n \<in> {..< ?N}" |
60758 | 942 |
have "\<bar>x\<bar> < S" using \<open>\<bar>x\<bar> < S\<close> . |
943 |
also have "S \<le> S'" using \<open>S \<le> S'\<close> . |
|
41970 | 944 |
also have "S' \<le> ?s n" unfolding S'_def |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
945 |
proof (rule Min_le_iff[THEN iffD2]) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
946 |
have "?s n \<in> (?s ` {..<?N}) \<and> ?s n \<le> ?s n" |
60758 | 947 |
using \<open>n \<in> {..< ?N}\<close> by auto |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
948 |
thus "\<exists> a \<in> (?s ` {..<?N}). a \<le> ?s n" by blast |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
949 |
qed auto |
53079 | 950 |
finally have "\<bar>x\<bar> < ?s n" . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
951 |
|
60758 | 952 |
from DERIV_D[OF DERIV_f[where n=n], THEN LIM_D, OF \<open>0 < ?r\<close>, unfolded real_norm_def diff_0_right, unfolded some_eq_ex[symmetric], THEN conjunct2] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
953 |
have "\<forall>x. x \<noteq> 0 \<and> \<bar>x\<bar> < ?s n \<longrightarrow> \<bar>?diff n x - f' x0 n\<bar> < ?r" . |
60758 | 954 |
with \<open>x \<noteq> 0\<close> and \<open>\<bar>x\<bar> < ?s n\<close> show "\<bar>?diff n x - f' x0 n\<bar> < ?r" |
53079 | 955 |
by blast |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
956 |
qed auto |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
957 |
also have "\<dots> = of_nat (card {..<?N}) * ?r" |
53079 | 958 |
by (rule setsum_constant) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
959 |
also have "\<dots> = real ?N * ?r" by simp |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
960 |
also have "\<dots> = r/3" by (auto simp del: of_nat_Suc) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
961 |
finally have "\<bar>\<Sum>n<?N. ?diff n x - f' x0 n \<bar> < r / 3" (is "?diff_part < r / 3") . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
962 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
963 |
from suminf_diff[OF allf_summable[OF x_in_I] allf_summable[OF x0_in_I]] |
53079 | 964 |
have "\<bar>(suminf (f (x0 + x)) - (suminf (f x0))) / x - suminf (f' x0)\<bar> = |
965 |
\<bar>\<Sum>n. ?diff n x - f' x0 n\<bar>" |
|
60758 | 966 |
unfolding suminf_diff[OF div_smbl \<open>summable (f' x0)\<close>, symmetric] |
53079 | 967 |
using suminf_divide[OF diff_smbl, symmetric] by auto |
968 |
also have "\<dots> \<le> ?diff_part + \<bar> (\<Sum>n. ?diff (n + ?N) x) - (\<Sum> n. f' x0 (n + ?N)) \<bar>" |
|
969 |
unfolding suminf_split_initial_segment[OF all_smbl, where k="?N"] |
|
60758 | 970 |
unfolding suminf_diff[OF div_shft_smbl ign[OF \<open>summable (f' x0)\<close>]] |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
971 |
apply (subst (5) add.commute) |
53079 | 972 |
by (rule abs_triangle_ineq) |
973 |
also have "\<dots> \<le> ?diff_part + ?L_part + ?f'_part" |
|
974 |
using abs_triangle_ineq4 by auto |
|
41970 | 975 |
also have "\<dots> < r /3 + r/3 + r/3" |
60758 | 976 |
using \<open>?diff_part < r/3\<close> \<open>?L_part \<le> r/3\<close> and \<open>?f'_part < r/3\<close> |
36842 | 977 |
by (rule add_strict_mono [OF add_less_le_mono]) |
53079 | 978 |
finally have "\<bar>(suminf (f (x0 + x)) - suminf (f x0)) / x - suminf (f' x0)\<bar> < r" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
979 |
by auto |
53079 | 980 |
} |
981 |
thus "\<exists> s > 0. \<forall> x. x \<noteq> 0 \<and> norm (x - 0) < s \<longrightarrow> |
|
982 |
norm (((\<Sum>n. f (x0 + x) n) - (\<Sum>n. f x0 n)) / x - (\<Sum>n. f' x0 n)) < r" |
|
60758 | 983 |
using \<open>0 < S\<close> unfolding real_norm_def diff_0_right by blast |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
984 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
985 |
|
53079 | 986 |
lemma DERIV_power_series': |
987 |
fixes f :: "nat \<Rightarrow> real" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
988 |
assumes converges: "\<And> x. x \<in> {-R <..< R} \<Longrightarrow> summable (\<lambda> n. f n * real (Suc n) * x^n)" |
53079 | 989 |
and x0_in_I: "x0 \<in> {-R <..< R}" and "0 < R" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
990 |
shows "DERIV (\<lambda> x. (\<Sum> n. f n * x^(Suc n))) x0 :> (\<Sum> n. f n * real (Suc n) * x0^n)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
991 |
(is "DERIV (\<lambda> x. (suminf (?f x))) x0 :> (suminf (?f' x0))") |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
992 |
proof - |
53079 | 993 |
{ |
994 |
fix R' |
|
995 |
assume "0 < R'" and "R' < R" and "-R' < x0" and "x0 < R'" |
|
996 |
hence "x0 \<in> {-R' <..< R'}" and "R' \<in> {-R <..< R}" and "x0 \<in> {-R <..< R}" |
|
997 |
by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
998 |
have "DERIV (\<lambda> x. (suminf (?f x))) x0 :> (suminf (?f' x0))" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
999 |
proof (rule DERIV_series') |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1000 |
show "summable (\<lambda> n. \<bar>f n * real (Suc n) * R'^n\<bar>)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1001 |
proof - |
53079 | 1002 |
have "(R' + R) / 2 < R" and "0 < (R' + R) / 2" |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
1003 |
using \<open>0 < R'\<close> \<open>0 < R\<close> \<open>R' < R\<close> by (auto simp: field_simps) |
53079 | 1004 |
hence in_Rball: "(R' + R) / 2 \<in> {-R <..< R}" |
60758 | 1005 |
using \<open>R' < R\<close> by auto |
53079 | 1006 |
have "norm R' < norm ((R' + R) / 2)" |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
1007 |
using \<open>0 < R'\<close> \<open>0 < R\<close> \<open>R' < R\<close> by (auto simp: field_simps) |
53079 | 1008 |
from powser_insidea[OF converges[OF in_Rball] this] show ?thesis |
1009 |
by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1010 |
qed |
53079 | 1011 |
{ |
1012 |
fix n x y |
|
1013 |
assume "x \<in> {-R' <..< R'}" and "y \<in> {-R' <..< R'}" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1014 |
show "\<bar>?f x n - ?f y n\<bar> \<le> \<bar>f n * real (Suc n) * R'^n\<bar> * \<bar>x-y\<bar>" |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1015 |
proof - |
53079 | 1016 |
have "\<bar>f n * x ^ (Suc n) - f n * y ^ (Suc n)\<bar> = |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1017 |
(\<bar>f n\<bar> * \<bar>x-y\<bar>) * \<bar>\<Sum>p<Suc n. x ^ p * y ^ (n - p)\<bar>" |
60162 | 1018 |
unfolding right_diff_distrib[symmetric] diff_power_eq_setsum abs_mult |
53079 | 1019 |
by auto |
41970 | 1020 |
also have "\<dots> \<le> (\<bar>f n\<bar> * \<bar>x-y\<bar>) * (\<bar>real (Suc n)\<bar> * \<bar>R' ^ n\<bar>)" |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1021 |
proof (rule mult_left_mono) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1022 |
have "\<bar>\<Sum>p<Suc n. x ^ p * y ^ (n - p)\<bar> \<le> (\<Sum>p<Suc n. \<bar>x ^ p * y ^ (n - p)\<bar>)" |
53079 | 1023 |
by (rule setsum_abs) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1024 |
also have "\<dots> \<le> (\<Sum>p<Suc n. R' ^ n)" |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1025 |
proof (rule setsum_mono) |
53079 | 1026 |
fix p |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1027 |
assume "p \<in> {..<Suc n}" |
53079 | 1028 |
hence "p \<le> n" by auto |
1029 |
{ |
|
1030 |
fix n |
|
1031 |
fix x :: real |
|
1032 |
assume "x \<in> {-R'<..<R'}" |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1033 |
hence "\<bar>x\<bar> \<le> R'" by auto |
53079 | 1034 |
hence "\<bar>x^n\<bar> \<le> R'^n" |
1035 |
unfolding power_abs by (rule power_mono, auto) |
|
1036 |
} |
|
60758 | 1037 |
from mult_mono[OF this[OF \<open>x \<in> {-R'<..<R'}\<close>, of p] this[OF \<open>y \<in> {-R'<..<R'}\<close>, of "n-p"]] \<open>0 < R'\<close> |
53079 | 1038 |
have "\<bar>x^p * y^(n-p)\<bar> \<le> R'^p * R'^(n-p)" |
1039 |
unfolding abs_mult by auto |
|
1040 |
thus "\<bar>x^p * y^(n-p)\<bar> \<le> R'^n" |
|
60758 | 1041 |
unfolding power_add[symmetric] using \<open>p \<le> n\<close> by auto |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1042 |
qed |
53079 | 1043 |
also have "\<dots> = real (Suc n) * R' ^ n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1044 |
unfolding setsum_constant card_atLeastLessThan by auto |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1045 |
finally show "\<bar>\<Sum>p<Suc n. x ^ p * y ^ (n - p)\<bar> \<le> \<bar>real (Suc n)\<bar> * \<bar>R' ^ n\<bar>" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1046 |
unfolding abs_of_nonneg[OF zero_le_power[OF less_imp_le[OF \<open>0 < R'\<close>]]] |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1047 |
by linarith |
53079 | 1048 |
show "0 \<le> \<bar>f n\<bar> * \<bar>x - y\<bar>" |
1049 |
unfolding abs_mult[symmetric] by auto |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1050 |
qed |
53079 | 1051 |
also have "\<dots> = \<bar>f n * real (Suc n) * R' ^ n\<bar> * \<bar>x - y\<bar>" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
1052 |
unfolding abs_mult mult.assoc[symmetric] by algebra |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1053 |
finally show ?thesis . |
53079 | 1054 |
qed |
1055 |
} |
|
1056 |
{ |
|
1057 |
fix n |
|
1058 |
show "DERIV (\<lambda> x. ?f x n) x0 :> (?f' x0 n)" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1059 |
by (auto intro!: derivative_eq_intros simp del: power_Suc) |
53079 | 1060 |
} |
1061 |
{ |
|
1062 |
fix x |
|
1063 |
assume "x \<in> {-R' <..< R'}" |
|
1064 |
hence "R' \<in> {-R <..< R}" and "norm x < norm R'" |
|
60758 | 1065 |
using assms \<open>R' < R\<close> by auto |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1066 |
have "summable (\<lambda> n. f n * x^n)" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1067 |
proof (rule summable_comparison_test, intro exI allI impI) |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
1068 |
fix n |
53079 | 1069 |
have le: "\<bar>f n\<bar> * 1 \<le> \<bar>f n\<bar> * real (Suc n)" |
1070 |
by (rule mult_left_mono) auto |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1071 |
show "norm (f n * x^n) \<le> norm (f n * real (Suc n) * x^n)" |
53079 | 1072 |
unfolding real_norm_def abs_mult |
61284
2314c2f62eb1
real_of_nat_Suc is now a simprule
paulson <lp15@cam.ac.uk>
parents:
61076
diff
changeset
|
1073 |
using le mult_right_mono by fastforce |
60758 | 1074 |
qed (rule powser_insidea[OF converges[OF \<open>R' \<in> {-R <..< R}\<close>] \<open>norm x < norm R'\<close>]) |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
1075 |
from this[THEN summable_mult2[where c=x], unfolded mult.assoc, unfolded mult.commute] |
53079 | 1076 |
show "summable (?f x)" by auto |
1077 |
} |
|
1078 |
show "summable (?f' x0)" |
|
60758 | 1079 |
using converges[OF \<open>x0 \<in> {-R <..< R}\<close>] . |
53079 | 1080 |
show "x0 \<in> {-R' <..< R'}" |
60758 | 1081 |
using \<open>x0 \<in> {-R' <..< R'}\<close> . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1082 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1083 |
} note for_subinterval = this |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1084 |
let ?R = "(R + \<bar>x0\<bar>) / 2" |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
1085 |
have "\<bar>x0\<bar> < ?R" using assms by (auto simp: field_simps) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1086 |
hence "- ?R < x0" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1087 |
proof (cases "x0 < 0") |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1088 |
case True |
60758 | 1089 |
hence "- x0 < ?R" using \<open>\<bar>x0\<bar> < ?R\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1090 |
thus ?thesis unfolding neg_less_iff_less[symmetric, of "- x0"] by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1091 |
next |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1092 |
case False |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1093 |
have "- ?R < 0" using assms by auto |
41970 | 1094 |
also have "\<dots> \<le> x0" using False by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1095 |
finally show ?thesis . |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1096 |
qed |
53079 | 1097 |
hence "0 < ?R" "?R < R" "- ?R < x0" and "x0 < ?R" |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
1098 |
using assms by (auto simp: field_simps) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1099 |
from for_subinterval[OF this] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1100 |
show ?thesis . |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1101 |
qed |
29695 | 1102 |
|
53079 | 1103 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1104 |
lemma isCont_pochhammer [continuous_intros]: "isCont (\<lambda>z::'a::real_normed_field. pochhammer z n) z" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1105 |
by (induction n) (auto intro!: continuous_intros simp: pochhammer_rec') |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1106 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1107 |
lemma continuous_on_pochhammer [continuous_intros]: |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1108 |
fixes A :: "'a :: real_normed_field set" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1109 |
shows "continuous_on A (\<lambda>z. pochhammer z n)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1110 |
by (intro continuous_at_imp_continuous_on ballI isCont_pochhammer) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1111 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1112 |
|
60758 | 1113 |
subsection \<open>Exponential Function\<close> |
23043 | 1114 |
|
58656 | 1115 |
definition exp :: "'a \<Rightarrow> 'a::{real_normed_algebra_1,banach}" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1116 |
where "exp = (\<lambda>x. \<Sum>n. x^n /\<^sub>R fact n)" |
23043 | 1117 |
|
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1118 |
lemma summable_exp_generic: |
31017 | 1119 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1120 |
defines S_def: "S \<equiv> \<lambda>n. x^n /\<^sub>R fact n" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1121 |
shows "summable S" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1122 |
proof - |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1123 |
have S_Suc: "\<And>n. S (Suc n) = (x * S n) /\<^sub>R (Suc n)" |
30273
ecd6f0ca62ea
declare power_Suc [simp]; remove redundant type-specific versions of power_Suc
huffman
parents:
30082
diff
changeset
|
1124 |
unfolding S_def by (simp del: mult_Suc) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1125 |
obtain r :: real where r0: "0 < r" and r1: "r < 1" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1126 |
using dense [OF zero_less_one] by fast |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1127 |
obtain N :: nat where N: "norm x < real N * r" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1128 |
using ex_less_of_nat_mult r0 by auto |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1129 |
from r1 show ?thesis |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1130 |
proof (rule summable_ratio_test [rule_format]) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1131 |
fix n :: nat |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1132 |
assume n: "N \<le> n" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1133 |
have "norm x \<le> real N * r" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1134 |
using N by (rule order_less_imp_le) |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1135 |
also have "real N * r \<le> real (Suc n) * r" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1136 |
using r0 n by (simp add: mult_right_mono) |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1137 |
finally have "norm x * norm (S n) \<le> real (Suc n) * r * norm (S n)" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1138 |
using norm_ge_zero by (rule mult_right_mono) |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1139 |
hence "norm (x * S n) \<le> real (Suc n) * r * norm (S n)" |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1140 |
by (rule order_trans [OF norm_mult_ineq]) |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1141 |
hence "norm (x * S n) / real (Suc n) \<le> r * norm (S n)" |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
1142 |
by (simp add: pos_divide_le_eq ac_simps) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1143 |
thus "norm (S (Suc n)) \<le> r * norm (S n)" |
35216 | 1144 |
by (simp add: S_Suc inverse_eq_divide) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1145 |
qed |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1146 |
qed |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1147 |
|
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1148 |
lemma summable_norm_exp: |
31017 | 1149 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1150 |
shows "summable (\<lambda>n. norm (x^n /\<^sub>R fact n))" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1151 |
proof (rule summable_norm_comparison_test [OF exI, rule_format]) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1152 |
show "summable (\<lambda>n. norm x^n /\<^sub>R fact n)" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1153 |
by (rule summable_exp_generic) |
53079 | 1154 |
fix n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1155 |
show "norm (x^n /\<^sub>R fact n) \<le> norm x^n /\<^sub>R fact n" |
35216 | 1156 |
by (simp add: norm_power_ineq) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1157 |
qed |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1158 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1159 |
lemma summable_exp: |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1160 |
fixes x :: "'a::{real_normed_field,banach}" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1161 |
shows "summable (\<lambda>n. inverse (fact n) * x^n)" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1162 |
using summable_exp_generic [where x=x] |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1163 |
by (simp add: scaleR_conv_of_real nonzero_of_real_inverse) |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1164 |
|
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1165 |
lemma exp_converges: "(\<lambda>n. x^n /\<^sub>R fact n) sums exp x" |
53079 | 1166 |
unfolding exp_def by (rule summable_exp_generic [THEN summable_sums]) |
23043 | 1167 |
|
41970 | 1168 |
lemma exp_fdiffs: |
60241 | 1169 |
"diffs (\<lambda>n. inverse (fact n)) = (\<lambda>n. inverse (fact n :: 'a::{real_normed_field,banach}))" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1170 |
by (simp add: diffs_def mult_ac nonzero_inverse_mult_distrib nonzero_of_real_inverse |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1171 |
del: mult_Suc of_nat_Suc) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1172 |
|
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1173 |
lemma diffs_of_real: "diffs (\<lambda>n. of_real (f n)) = (\<lambda>n. of_real (diffs f n))" |
53079 | 1174 |
by (simp add: diffs_def) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1175 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1176 |
lemma DERIV_exp [simp]: "DERIV exp x :> exp(x)" |
53079 | 1177 |
unfolding exp_def scaleR_conv_of_real |
1178 |
apply (rule DERIV_cong) |
|
1179 |
apply (rule termdiffs [where K="of_real (1 + norm x)"]) |
|
1180 |
apply (simp_all only: diffs_of_real scaleR_conv_of_real exp_fdiffs) |
|
1181 |
apply (rule exp_converges [THEN sums_summable, unfolded scaleR_conv_of_real])+ |
|
1182 |
apply (simp del: of_real_add) |
|
1183 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1184 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1185 |
declare DERIV_exp[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
1186 |
DERIV_exp[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
51527 | 1187 |
|
58656 | 1188 |
lemma norm_exp: "norm (exp x) \<le> exp (norm x)" |
1189 |
proof - |
|
1190 |
from summable_norm[OF summable_norm_exp, of x] |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1191 |
have "norm (exp x) \<le> (\<Sum>n. inverse (fact n) * norm (x^n))" |
58656 | 1192 |
by (simp add: exp_def) |
1193 |
also have "\<dots> \<le> exp (norm x)" |
|
1194 |
using summable_exp_generic[of "norm x"] summable_norm_exp[of x] |
|
1195 |
by (auto simp: exp_def intro!: suminf_le norm_power_ineq) |
|
1196 |
finally show ?thesis . |
|
1197 |
qed |
|
1198 |
||
1199 |
lemma isCont_exp: |
|
1200 |
fixes x::"'a::{real_normed_field,banach}" |
|
1201 |
shows "isCont exp x" |
|
44311 | 1202 |
by (rule DERIV_exp [THEN DERIV_isCont]) |
1203 |
||
58656 | 1204 |
lemma isCont_exp' [simp]: |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1205 |
fixes f:: "_ \<Rightarrow>'a::{real_normed_field,banach}" |
58656 | 1206 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. exp (f x)) a" |
44311 | 1207 |
by (rule isCont_o2 [OF _ isCont_exp]) |
1208 |
||
1209 |
lemma tendsto_exp [tendsto_intros]: |
|
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1210 |
fixes f:: "_ \<Rightarrow>'a::{real_normed_field,banach}" |
58656 | 1211 |
shows "(f ---> a) F \<Longrightarrow> ((\<lambda>x. exp (f x)) ---> exp a) F" |
44311 | 1212 |
by (rule isCont_tendsto_compose [OF isCont_exp]) |
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
1213 |
|
53079 | 1214 |
lemma continuous_exp [continuous_intros]: |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1215 |
fixes f:: "_ \<Rightarrow>'a::{real_normed_field,banach}" |
58656 | 1216 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. exp (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1217 |
unfolding continuous_def by (rule tendsto_exp) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1218 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
1219 |
lemma continuous_on_exp [continuous_intros]: |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1220 |
fixes f:: "_ \<Rightarrow>'a::{real_normed_field,banach}" |
58656 | 1221 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. exp (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1222 |
unfolding continuous_on_def by (auto intro: tendsto_exp) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1223 |
|
53079 | 1224 |
|
60758 | 1225 |
subsubsection \<open>Properties of the Exponential Function\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1226 |
|
23278 | 1227 |
lemma exp_zero [simp]: "exp 0 = 1" |
53079 | 1228 |
unfolding exp_def by (simp add: scaleR_conv_of_real powser_zero) |
23278 | 1229 |
|
58656 | 1230 |
lemma exp_series_add_commuting: |
1231 |
fixes x y :: "'a::{real_normed_algebra_1, banach}" |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1232 |
defines S_def: "S \<equiv> \<lambda>x n. x^n /\<^sub>R fact n" |
58656 | 1233 |
assumes comm: "x * y = y * x" |
56213 | 1234 |
shows "S (x + y) n = (\<Sum>i\<le>n. S x i * S y (n - i))" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1235 |
proof (induct n) |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1236 |
case 0 |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1237 |
show ?case |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1238 |
unfolding S_def by simp |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1239 |
next |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1240 |
case (Suc n) |
25062 | 1241 |
have S_Suc: "\<And>x n. S x (Suc n) = (x * S x n) /\<^sub>R real (Suc n)" |
30273
ecd6f0ca62ea
declare power_Suc [simp]; remove redundant type-specific versions of power_Suc
huffman
parents:
30082
diff
changeset
|
1242 |
unfolding S_def by (simp del: mult_Suc) |
25062 | 1243 |
hence times_S: "\<And>x n. x * S x n = real (Suc n) *\<^sub>R S x (Suc n)" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1244 |
by simp |
58656 | 1245 |
have S_comm: "\<And>n. S x n * y = y * S x n" |
1246 |
by (simp add: power_commuting_commutes comm S_def) |
|
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1247 |
|
25062 | 1248 |
have "real (Suc n) *\<^sub>R S (x + y) (Suc n) = (x + y) * S (x + y) n" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1249 |
by (simp only: times_S) |
56213 | 1250 |
also have "\<dots> = (x + y) * (\<Sum>i\<le>n. S x i * S y (n-i))" |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1251 |
by (simp only: Suc) |
56213 | 1252 |
also have "\<dots> = x * (\<Sum>i\<le>n. S x i * S y (n-i)) |
1253 |
+ y * (\<Sum>i\<le>n. S x i * S y (n-i))" |
|
49962
a8cc904a6820
Renamed {left,right}_distrib to distrib_{right,left}.
webertj
parents:
47489
diff
changeset
|
1254 |
by (rule distrib_right) |
58656 | 1255 |
also have "\<dots> = (\<Sum>i\<le>n. x * S x i * S y (n-i)) |
1256 |
+ (\<Sum>i\<le>n. S x i * y * S y (n-i))" |
|
1257 |
by (simp add: setsum_right_distrib ac_simps S_comm) |
|
1258 |
also have "\<dots> = (\<Sum>i\<le>n. x * S x i * S y (n-i)) |
|
56213 | 1259 |
+ (\<Sum>i\<le>n. S x i * (y * S y (n-i)))" |
58656 | 1260 |
by (simp add: ac_simps) |
56213 | 1261 |
also have "\<dots> = (\<Sum>i\<le>n. real (Suc i) *\<^sub>R (S x (Suc i) * S y (n-i))) |
1262 |
+ (\<Sum>i\<le>n. real (Suc n-i) *\<^sub>R (S x i * S y (Suc n-i)))" |
|
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1263 |
by (simp add: times_S Suc_diff_le) |
56213 | 1264 |
also have "(\<Sum>i\<le>n. real (Suc i) *\<^sub>R (S x (Suc i) * S y (n-i))) = |
1265 |
(\<Sum>i\<le>Suc n. real i *\<^sub>R (S x i * S y (Suc n-i)))" |
|
1266 |
by (subst setsum_atMost_Suc_shift) simp |
|
1267 |
also have "(\<Sum>i\<le>n. real (Suc n-i) *\<^sub>R (S x i * S y (Suc n-i))) = |
|
1268 |
(\<Sum>i\<le>Suc n. real (Suc n-i) *\<^sub>R (S x i * S y (Suc n-i)))" |
|
1269 |
by simp |
|
1270 |
also have "(\<Sum>i\<le>Suc n. real i *\<^sub>R (S x i * S y (Suc n-i))) + |
|
1271 |
(\<Sum>i\<le>Suc n. real (Suc n-i) *\<^sub>R (S x i * S y (Suc n-i))) = |
|
1272 |
(\<Sum>i\<le>Suc n. real (Suc n) *\<^sub>R (S x i * S y (Suc n-i)))" |
|
57418 | 1273 |
by (simp only: setsum.distrib [symmetric] scaleR_left_distrib [symmetric] |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1274 |
of_nat_add [symmetric]) simp |
56213 | 1275 |
also have "\<dots> = real (Suc n) *\<^sub>R (\<Sum>i\<le>Suc n. S x i * S y (Suc n-i))" |
23127 | 1276 |
by (simp only: scaleR_right.setsum) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1277 |
finally show |
56213 | 1278 |
"S (x + y) (Suc n) = (\<Sum>i\<le>Suc n. S x i * S y (Suc n - i))" |
35216 | 1279 |
by (simp del: setsum_cl_ivl_Suc) |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1280 |
qed |
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1281 |
|
58656 | 1282 |
lemma exp_add_commuting: "x * y = y * x \<Longrightarrow> exp (x + y) = exp x * exp y" |
53079 | 1283 |
unfolding exp_def |
58656 | 1284 |
by (simp only: Cauchy_product summable_norm_exp exp_series_add_commuting) |
1285 |
||
1286 |
lemma exp_add: |
|
1287 |
fixes x y::"'a::{real_normed_field,banach}" |
|
1288 |
shows "exp (x + y) = exp x * exp y" |
|
1289 |
by (rule exp_add_commuting) (simp add: ac_simps) |
|
1290 |
||
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1291 |
lemma exp_double: "exp(2 * z) = exp z ^ 2" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1292 |
by (simp add: exp_add_commuting mult_2 power2_eq_square) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1293 |
|
58656 | 1294 |
lemmas mult_exp_exp = exp_add [symmetric] |
29170 | 1295 |
|
23241 | 1296 |
lemma exp_of_real: "exp (of_real x) = of_real (exp x)" |
53079 | 1297 |
unfolding exp_def |
1298 |
apply (subst suminf_of_real) |
|
1299 |
apply (rule summable_exp_generic) |
|
1300 |
apply (simp add: scaleR_conv_of_real) |
|
1301 |
done |
|
23241 | 1302 |
|
59862 | 1303 |
corollary exp_in_Reals [simp]: "z \<in> \<real> \<Longrightarrow> exp z \<in> \<real>" |
1304 |
by (metis Reals_cases Reals_of_real exp_of_real) |
|
1305 |
||
29170 | 1306 |
lemma exp_not_eq_zero [simp]: "exp x \<noteq> 0" |
1307 |
proof |
|
58656 | 1308 |
have "exp x * exp (- x) = 1" by (simp add: exp_add_commuting[symmetric]) |
29170 | 1309 |
also assume "exp x = 0" |
1310 |
finally show "False" by simp |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1311 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1312 |
|
58656 | 1313 |
lemma exp_minus_inverse: |
1314 |
shows "exp x * exp (- x) = 1" |
|
1315 |
by (simp add: exp_add_commuting[symmetric]) |
|
1316 |
||
1317 |
lemma exp_minus: |
|
1318 |
fixes x :: "'a::{real_normed_field, banach}" |
|
1319 |
shows "exp (- x) = inverse (exp x)" |
|
1320 |
by (intro inverse_unique [symmetric] exp_minus_inverse) |
|
1321 |
||
1322 |
lemma exp_diff: |
|
1323 |
fixes x :: "'a::{real_normed_field, banach}" |
|
1324 |
shows "exp (x - y) = exp x / exp y" |
|
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53602
diff
changeset
|
1325 |
using exp_add [of x "- y"] by (simp add: exp_minus divide_inverse) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1326 |
|
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1327 |
lemma exp_of_nat_mult: |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1328 |
fixes x :: "'a::{real_normed_field,banach}" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1329 |
shows "exp(of_nat n * x) = exp(x) ^ n" |
60867 | 1330 |
by (induct n) (auto simp add: distrib_left exp_add mult.commute) |
60162 | 1331 |
|
1332 |
corollary exp_real_of_nat_mult: "exp(real n * x) = exp(x) ^ n" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1333 |
by (simp add: exp_of_nat_mult) |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1334 |
|
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1335 |
lemma exp_setsum: "finite I \<Longrightarrow> exp(setsum f I) = setprod (\<lambda>x. exp(f x)) I" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1336 |
by (induction I rule: finite_induct) (auto simp: exp_add_commuting mult.commute) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1337 |
|
29167 | 1338 |
|
60758 | 1339 |
subsubsection \<open>Properties of the Exponential Function on Reals\<close> |
1340 |
||
1341 |
text \<open>Comparisons of @{term "exp x"} with zero.\<close> |
|
1342 |
||
1343 |
text\<open>Proof: because every exponential can be seen as a square.\<close> |
|
29167 | 1344 |
lemma exp_ge_zero [simp]: "0 \<le> exp (x::real)" |
1345 |
proof - |
|
1346 |
have "0 \<le> exp (x/2) * exp (x/2)" by simp |
|
1347 |
thus ?thesis by (simp add: exp_add [symmetric]) |
|
1348 |
qed |
|
1349 |
||
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1350 |
lemma exp_gt_zero [simp]: "0 < exp (x::real)" |
53079 | 1351 |
by (simp add: order_less_le) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1352 |
|
29170 | 1353 |
lemma not_exp_less_zero [simp]: "\<not> exp (x::real) < 0" |
53079 | 1354 |
by (simp add: not_less) |
29170 | 1355 |
|
1356 |
lemma not_exp_le_zero [simp]: "\<not> exp (x::real) \<le> 0" |
|
53079 | 1357 |
by (simp add: not_le) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1358 |
|
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1359 |
lemma abs_exp_cancel [simp]: "\<bar>exp x::real\<bar> = exp x" |
53079 | 1360 |
by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1361 |
|
60758 | 1362 |
text \<open>Strict monotonicity of exponential.\<close> |
29170 | 1363 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1364 |
lemma exp_ge_add_one_self_aux: |
54575 | 1365 |
assumes "0 \<le> (x::real)" shows "1+x \<le> exp(x)" |
1366 |
using order_le_imp_less_or_eq [OF assms] |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1367 |
proof |
54575 | 1368 |
assume "0 < x" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1369 |
have "1+x \<le> (\<Sum>n<2. inverse (fact n) * x^n)" |
54575 | 1370 |
by (auto simp add: numeral_2_eq_2) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1371 |
also have "... \<le> (\<Sum>n. inverse (fact n) * x^n)" |
56213 | 1372 |
apply (rule setsum_le_suminf [OF summable_exp]) |
60758 | 1373 |
using \<open>0 < x\<close> |
54575 | 1374 |
apply (auto simp add: zero_le_mult_iff) |
1375 |
done |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1376 |
finally show "1+x \<le> exp x" |
54575 | 1377 |
by (simp add: exp_def) |
1378 |
next |
|
1379 |
assume "0 = x" |
|
1380 |
then show "1 + x \<le> exp x" |
|
1381 |
by auto |
|
1382 |
qed |
|
29170 | 1383 |
|
1384 |
lemma exp_gt_one: "0 < (x::real) \<Longrightarrow> 1 < exp x" |
|
1385 |
proof - |
|
1386 |
assume x: "0 < x" |
|
1387 |
hence "1 < 1 + x" by simp |
|
1388 |
also from x have "1 + x \<le> exp x" |
|
1389 |
by (simp add: exp_ge_add_one_self_aux) |
|
1390 |
finally show ?thesis . |
|
1391 |
qed |
|
1392 |
||
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1393 |
lemma exp_less_mono: |
23115
4615b2078592
generalized exp to work over any complete field; new proof of exp_add
huffman
parents:
23112
diff
changeset
|
1394 |
fixes x y :: real |
53079 | 1395 |
assumes "x < y" |
1396 |
shows "exp x < exp y" |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1397 |
proof - |
60758 | 1398 |
from \<open>x < y\<close> have "0 < y - x" by simp |
29165
562f95f06244
cleaned up some proofs; removed redundant simp rules
huffman
parents:
29164
diff
changeset
|
1399 |
hence "1 < exp (y - x)" by (rule exp_gt_one) |
562f95f06244
cleaned up some proofs; removed redundant simp rules
huffman
parents:
29164
diff
changeset
|
1400 |
hence "1 < exp y / exp x" by (simp only: exp_diff) |
562f95f06244
cleaned up some proofs; removed redundant simp rules
huffman
parents:
29164
diff
changeset
|
1401 |
thus "exp x < exp y" by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1402 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1403 |
|
53079 | 1404 |
lemma exp_less_cancel: "exp (x::real) < exp y \<Longrightarrow> x < y" |
54575 | 1405 |
unfolding linorder_not_le [symmetric] |
1406 |
by (auto simp add: order_le_less exp_less_mono) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1407 |
|
29170 | 1408 |
lemma exp_less_cancel_iff [iff]: "exp (x::real) < exp y \<longleftrightarrow> x < y" |
53079 | 1409 |
by (auto intro: exp_less_mono exp_less_cancel) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1410 |
|
29170 | 1411 |
lemma exp_le_cancel_iff [iff]: "exp (x::real) \<le> exp y \<longleftrightarrow> x \<le> y" |
53079 | 1412 |
by (auto simp add: linorder_not_less [symmetric]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1413 |
|
29170 | 1414 |
lemma exp_inj_iff [iff]: "exp (x::real) = exp y \<longleftrightarrow> x = y" |
53079 | 1415 |
by (simp add: order_eq_iff) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1416 |
|
60758 | 1417 |
text \<open>Comparisons of @{term "exp x"} with one.\<close> |
29170 | 1418 |
|
1419 |
lemma one_less_exp_iff [simp]: "1 < exp (x::real) \<longleftrightarrow> 0 < x" |
|
1420 |
using exp_less_cancel_iff [where x=0 and y=x] by simp |
|
1421 |
||
1422 |
lemma exp_less_one_iff [simp]: "exp (x::real) < 1 \<longleftrightarrow> x < 0" |
|
1423 |
using exp_less_cancel_iff [where x=x and y=0] by simp |
|
1424 |
||
1425 |
lemma one_le_exp_iff [simp]: "1 \<le> exp (x::real) \<longleftrightarrow> 0 \<le> x" |
|
1426 |
using exp_le_cancel_iff [where x=0 and y=x] by simp |
|
1427 |
||
1428 |
lemma exp_le_one_iff [simp]: "exp (x::real) \<le> 1 \<longleftrightarrow> x \<le> 0" |
|
1429 |
using exp_le_cancel_iff [where x=x and y=0] by simp |
|
1430 |
||
1431 |
lemma exp_eq_one_iff [simp]: "exp (x::real) = 1 \<longleftrightarrow> x = 0" |
|
1432 |
using exp_inj_iff [where x=x and y=0] by simp |
|
1433 |
||
53079 | 1434 |
lemma lemma_exp_total: "1 \<le> y \<Longrightarrow> \<exists>x. 0 \<le> x & x \<le> y - 1 & exp(x::real) = y" |
44755 | 1435 |
proof (rule IVT) |
1436 |
assume "1 \<le> y" |
|
1437 |
hence "0 \<le> y - 1" by simp |
|
1438 |
hence "1 + (y - 1) \<le> exp (y - 1)" by (rule exp_ge_add_one_self_aux) |
|
1439 |
thus "y \<le> exp (y - 1)" by simp |
|
1440 |
qed (simp_all add: le_diff_eq) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1441 |
|
53079 | 1442 |
lemma exp_total: "0 < (y::real) \<Longrightarrow> \<exists>x. exp x = y" |
44755 | 1443 |
proof (rule linorder_le_cases [of 1 y]) |
53079 | 1444 |
assume "1 \<le> y" |
1445 |
thus "\<exists>x. exp x = y" by (fast dest: lemma_exp_total) |
|
44755 | 1446 |
next |
1447 |
assume "0 < y" and "y \<le> 1" |
|
1448 |
hence "1 \<le> inverse y" by (simp add: one_le_inverse_iff) |
|
1449 |
then obtain x where "exp x = inverse y" by (fast dest: lemma_exp_total) |
|
1450 |
hence "exp (- x) = y" by (simp add: exp_minus) |
|
1451 |
thus "\<exists>x. exp x = y" .. |
|
1452 |
qed |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1453 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1454 |
|
60758 | 1455 |
subsection \<open>Natural Logarithm\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1456 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1457 |
class ln = real_normed_algebra_1 + banach + |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1458 |
fixes ln :: "'a \<Rightarrow> 'a" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1459 |
assumes ln_one [simp]: "ln 1 = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1460 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1461 |
definition powr :: "['a,'a] => 'a::ln" (infixr "powr" 80) |
61799 | 1462 |
\<comment> \<open>exponentation via ln and exp\<close> |
60020
065ecea354d0
Complex roots of unity. Better definition of ln for complex numbers. Used [code del] to stop code generation for powr.
paulson <lp15@cam.ac.uk>
parents:
60017
diff
changeset
|
1463 |
where [code del]: "x powr a \<equiv> if x = 0 then 0 else exp(a * ln x)" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1464 |
|
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1465 |
lemma powr_0 [simp]: "0 powr z = 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1466 |
by (simp add: powr_def) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1467 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1468 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1469 |
instantiation real :: ln |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1470 |
begin |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1471 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1472 |
definition ln_real :: "real \<Rightarrow> real" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1473 |
where "ln_real x = (THE u. exp u = x)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1474 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1475 |
instance |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1476 |
by intro_classes (simp add: ln_real_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1477 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1478 |
end |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1479 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1480 |
lemma powr_eq_0_iff [simp]: "w powr z = 0 \<longleftrightarrow> w = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1481 |
by (simp add: powr_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1482 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1483 |
lemma ln_exp [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1484 |
fixes x::real shows "ln (exp x) = x" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1485 |
by (simp add: ln_real_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1486 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1487 |
lemma exp_ln [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1488 |
fixes x::real shows "0 < x \<Longrightarrow> exp (ln x) = x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1489 |
by (auto dest: exp_total) |
22654
c2b6b5a9e136
new simp rule exp_ln; new standard proof of DERIV_exp_ln_one; changed imports
huffman
parents:
22653
diff
changeset
|
1490 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1491 |
lemma exp_ln_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1492 |
fixes x::real shows "exp (ln x) = x \<longleftrightarrow> 0 < x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1493 |
by (metis exp_gt_zero exp_ln) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1494 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1495 |
lemma ln_unique: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1496 |
fixes x::real shows "exp y = x \<Longrightarrow> ln x = y" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1497 |
by (erule subst, rule ln_exp) |
29171 | 1498 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1499 |
lemma ln_mult: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1500 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln (x * y) = ln x + ln y" |
53079 | 1501 |
by (rule ln_unique) (simp add: exp_add) |
29171 | 1502 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1503 |
lemma ln_setprod: |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1504 |
fixes f:: "'a => real" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1505 |
shows |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
1506 |
"\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i > 0\<rbrakk> \<Longrightarrow> ln(setprod f I) = setsum (\<lambda>x. ln(f x)) I" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
1507 |
by (induction I rule: finite_induct) (auto simp: ln_mult setprod_pos) |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
1508 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1509 |
lemma ln_inverse: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1510 |
fixes x::real shows "0 < x \<Longrightarrow> ln (inverse x) = - ln x" |
53079 | 1511 |
by (rule ln_unique) (simp add: exp_minus) |
1512 |
||
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1513 |
lemma ln_div: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1514 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln (x / y) = ln x - ln y" |
53079 | 1515 |
by (rule ln_unique) (simp add: exp_diff) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1516 |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1517 |
lemma ln_realpow: "0 < x \<Longrightarrow> ln (x^n) = real n * ln x" |
53079 | 1518 |
by (rule ln_unique) (simp add: exp_real_of_nat_mult) |
1519 |
||
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1520 |
lemma ln_less_cancel_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1521 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln x < ln y \<longleftrightarrow> x < y" |
53079 | 1522 |
by (subst exp_less_cancel_iff [symmetric]) simp |
1523 |
||
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1524 |
lemma ln_le_cancel_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1525 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln x \<le> ln y \<longleftrightarrow> x \<le> y" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1526 |
by (simp add: linorder_not_less [symmetric]) |
29171 | 1527 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1528 |
lemma ln_inj_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1529 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln x = ln y \<longleftrightarrow> x = y" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1530 |
by (simp add: order_eq_iff) |
29171 | 1531 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1532 |
lemma ln_add_one_self_le_self [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1533 |
fixes x::real shows "0 \<le> x \<Longrightarrow> ln (1 + x) \<le> x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1534 |
apply (rule exp_le_cancel_iff [THEN iffD1]) |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1535 |
apply (simp add: exp_ge_add_one_self_aux) |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1536 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1537 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1538 |
lemma ln_less_self [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1539 |
fixes x::real shows "0 < x \<Longrightarrow> ln x < x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1540 |
by (rule order_less_le_trans [where y="ln (1 + x)"]) simp_all |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1541 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1542 |
lemma ln_ge_zero [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1543 |
fixes x::real shows "1 \<le> x \<Longrightarrow> 0 \<le> ln x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1544 |
using ln_le_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1545 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1546 |
lemma ln_ge_zero_imp_ge_one: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1547 |
fixes x::real shows "0 \<le> ln x \<Longrightarrow> 0 < x \<Longrightarrow> 1 \<le> x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1548 |
using ln_le_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1549 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1550 |
lemma ln_ge_zero_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1551 |
fixes x::real shows "0 < x \<Longrightarrow> 0 \<le> ln x \<longleftrightarrow> 1 \<le> x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1552 |
using ln_le_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1553 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1554 |
lemma ln_less_zero_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1555 |
fixes x::real shows "0 < x \<Longrightarrow> ln x < 0 \<longleftrightarrow> x < 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1556 |
using ln_less_cancel_iff [of x 1] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1557 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1558 |
lemma ln_gt_zero: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1559 |
fixes x::real shows "1 < x \<Longrightarrow> 0 < ln x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1560 |
using ln_less_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1561 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1562 |
lemma ln_gt_zero_imp_gt_one: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1563 |
fixes x::real shows "0 < ln x \<Longrightarrow> 0 < x \<Longrightarrow> 1 < x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1564 |
using ln_less_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1565 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1566 |
lemma ln_gt_zero_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1567 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < ln x \<longleftrightarrow> 1 < x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1568 |
using ln_less_cancel_iff [of 1 x] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1569 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1570 |
lemma ln_eq_zero_iff [simp]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1571 |
fixes x::real shows "0 < x \<Longrightarrow> ln x = 0 \<longleftrightarrow> x = 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1572 |
using ln_inj_iff [of x 1] by simp |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1573 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1574 |
lemma ln_less_zero: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1575 |
fixes x::real shows "0 < x \<Longrightarrow> x < 1 \<Longrightarrow> ln x < 0" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1576 |
by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1577 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1578 |
lemma ln_neg_is_const: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1579 |
fixes x::real shows "x \<le> 0 \<Longrightarrow> ln x = (THE x. False)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1580 |
by (auto simp add: ln_real_def intro!: arg_cong[where f=The]) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1581 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1582 |
lemma isCont_ln: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1583 |
fixes x::real assumes "x \<noteq> 0" shows "isCont ln x" |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1584 |
proof cases |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1585 |
assume "0 < x" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1586 |
moreover then have "isCont ln (exp (ln x))" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1587 |
by (intro isCont_inv_fun[where d="\<bar>x\<bar>" and f=exp]) auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1588 |
ultimately show ?thesis |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1589 |
by simp |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1590 |
next |
60758 | 1591 |
assume "\<not> 0 < x" with \<open>x \<noteq> 0\<close> show "isCont ln x" |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1592 |
unfolding isCont_def |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1593 |
by (subst filterlim_cong[OF _ refl, of _ "nhds (ln 0)" _ "\<lambda>_. ln 0"]) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1594 |
(auto simp: ln_neg_is_const not_less eventually_at dist_real_def |
58729
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents:
58710
diff
changeset
|
1595 |
intro!: exI[of _ "\<bar>x\<bar>"]) |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1596 |
qed |
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
1597 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1598 |
lemma tendsto_ln [tendsto_intros]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1599 |
fixes a::real shows |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
1600 |
"(f ---> a) F \<Longrightarrow> a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. ln (f x)) ---> ln a) F" |
45915 | 1601 |
by (rule isCont_tendsto_compose [OF isCont_ln]) |
1602 |
||
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1603 |
lemma continuous_ln: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1604 |
"continuous F f \<Longrightarrow> f (Lim F (\<lambda>x. x)) \<noteq> 0 \<Longrightarrow> continuous F (\<lambda>x. ln (f x :: real))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1605 |
unfolding continuous_def by (rule tendsto_ln) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1606 |
|
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1607 |
lemma isCont_ln' [continuous_intros]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1608 |
"continuous (at x) f \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow> continuous (at x) (\<lambda>x. ln (f x :: real))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1609 |
unfolding continuous_at by (rule tendsto_ln) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1610 |
|
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1611 |
lemma continuous_within_ln [continuous_intros]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1612 |
"continuous (at x within s) f \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow> continuous (at x within s) (\<lambda>x. ln (f x :: real))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1613 |
unfolding continuous_within by (rule tendsto_ln) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1614 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
1615 |
lemma continuous_on_ln [continuous_intros]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1616 |
"continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. f x \<noteq> 0) \<Longrightarrow> continuous_on s (\<lambda>x. ln (f x :: real))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1617 |
unfolding continuous_on_def by (auto intro: tendsto_ln) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
1618 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1619 |
lemma DERIV_ln: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1620 |
fixes x::real shows "0 < x \<Longrightarrow> DERIV ln x :> inverse x" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1621 |
apply (rule DERIV_inverse_function [where f=exp and a=0 and b="x+1"]) |
54576 | 1622 |
apply (auto intro: DERIV_cong [OF DERIV_exp exp_ln] isCont_ln) |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
1623 |
done |
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
1624 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1625 |
lemma DERIV_ln_divide: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1626 |
fixes x::real shows "0 < x \<Longrightarrow> DERIV ln x :> 1 / x" |
33667 | 1627 |
by (rule DERIV_ln[THEN DERIV_cong], simp, simp add: divide_inverse) |
1628 |
||
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1629 |
declare DERIV_ln_divide[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
1630 |
DERIV_ln_divide[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
1631 |
|
51527 | 1632 |
|
53079 | 1633 |
lemma ln_series: |
1634 |
assumes "0 < x" and "x < 2" |
|
1635 |
shows "ln x = (\<Sum> n. (-1)^n * (1 / real (n + 1)) * (x - 1)^(Suc n))" |
|
1636 |
(is "ln x = suminf (?f (x - 1))") |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1637 |
proof - |
53079 | 1638 |
let ?f' = "\<lambda>x n. (-1)^n * (x - 1)^n" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1639 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1640 |
have "ln x - suminf (?f (x - 1)) = ln 1 - suminf (?f (1 - 1))" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1641 |
proof (rule DERIV_isconst3[where x=x]) |
53079 | 1642 |
fix x :: real |
1643 |
assume "x \<in> {0 <..< 2}" |
|
1644 |
hence "0 < x" and "x < 2" by auto |
|
1645 |
have "norm (1 - x) < 1" |
|
60758 | 1646 |
using \<open>0 < x\<close> and \<open>x < 2\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1647 |
have "1 / x = 1 / (1 - (1 - x))" by auto |
53079 | 1648 |
also have "\<dots> = (\<Sum> n. (1 - x)^n)" |
60758 | 1649 |
using geometric_sums[OF \<open>norm (1 - x) < 1\<close>] by (rule sums_unique) |
53079 | 1650 |
also have "\<dots> = suminf (?f' x)" |
1651 |
unfolding power_mult_distrib[symmetric] |
|
1652 |
by (rule arg_cong[where f=suminf], rule arg_cong[where f="op ^"], auto) |
|
1653 |
finally have "DERIV ln x :> suminf (?f' x)" |
|
60758 | 1654 |
using DERIV_ln[OF \<open>0 < x\<close>] unfolding divide_inverse by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1655 |
moreover |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1656 |
have repos: "\<And> h x :: real. h - 1 + x = h + x - 1" by auto |
53079 | 1657 |
have "DERIV (\<lambda>x. suminf (?f x)) (x - 1) :> |
1658 |
(\<Sum>n. (-1)^n * (1 / real (n + 1)) * real (Suc n) * (x - 1) ^ n)" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1659 |
proof (rule DERIV_power_series') |
53079 | 1660 |
show "x - 1 \<in> {- 1<..<1}" and "(0 :: real) < 1" |
60758 | 1661 |
using \<open>0 < x\<close> \<open>x < 2\<close> by auto |
53079 | 1662 |
fix x :: real |
1663 |
assume "x \<in> {- 1<..<1}" |
|
1664 |
hence "norm (-x) < 1" by auto |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1665 |
show "summable (\<lambda>n. (- 1) ^ n * (1 / real (n + 1)) * real (Suc n) * x^n)" |
53079 | 1666 |
unfolding One_nat_def |
60758 | 1667 |
by (auto simp add: power_mult_distrib[symmetric] summable_geometric[OF \<open>norm (-x) < 1\<close>]) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1668 |
qed |
53079 | 1669 |
hence "DERIV (\<lambda>x. suminf (?f x)) (x - 1) :> suminf (?f' x)" |
1670 |
unfolding One_nat_def by auto |
|
1671 |
hence "DERIV (\<lambda>x. suminf (?f (x - 1))) x :> suminf (?f' x)" |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1672 |
unfolding DERIV_def repos . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1673 |
ultimately have "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> (suminf (?f' x) - suminf (?f' x))" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1674 |
by (rule DERIV_diff) |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1675 |
thus "DERIV (\<lambda>x. ln x - suminf (?f (x - 1))) x :> 0" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1676 |
qed (auto simp add: assms) |
44289 | 1677 |
thus ?thesis by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
1678 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
1679 |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1680 |
lemma exp_first_two_terms: |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1681 |
fixes x :: "'a::{real_normed_field,banach}" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1682 |
shows "exp x = 1 + x + (\<Sum> n. inverse(fact (n+2)) * (x ^ (n+2)))" |
50326 | 1683 |
proof - |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1684 |
have "exp x = suminf (\<lambda>n. inverse(fact n) * (x^n))" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1685 |
by (simp add: exp_def scaleR_conv_of_real nonzero_of_real_inverse) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1686 |
also from summable_exp have "... = (\<Sum> n. inverse(fact(n+2)) * (x ^ (n+2))) + |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1687 |
(\<Sum> n::nat<2. inverse(fact n) * (x^n))" (is "_ = _ + ?a") |
50326 | 1688 |
by (rule suminf_split_initial_segment) |
1689 |
also have "?a = 1 + x" |
|
1690 |
by (simp add: numeral_2_eq_2) |
|
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1691 |
finally show ?thesis |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
1692 |
by simp |
50326 | 1693 |
qed |
1694 |
||
53079 | 1695 |
lemma exp_bound: "0 <= (x::real) \<Longrightarrow> x <= 1 \<Longrightarrow> exp x <= 1 + x + x\<^sup>2" |
50326 | 1696 |
proof - |
1697 |
assume a: "0 <= x" |
|
1698 |
assume b: "x <= 1" |
|
53079 | 1699 |
{ |
1700 |
fix n :: nat |
|
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1701 |
have "(2::nat) * 2 ^ n \<le> fact (n + 2)" |
53079 | 1702 |
by (induct n) simp_all |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1703 |
hence "real ((2::nat) * 2 ^ n) \<le> real_of_nat (fact (n + 2))" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1704 |
by (simp only: of_nat_le_iff) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1705 |
hence "((2::real) * 2 ^ n) \<le> fact (n + 2)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1706 |
unfolding of_nat_fact |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1707 |
by (simp add: of_nat_mult of_nat_power) |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1708 |
hence "inverse (fact (n + 2)) \<le> inverse ((2::real) * 2 ^ n)" |
50326 | 1709 |
by (rule le_imp_inverse_le) simp |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1710 |
hence "inverse (fact (n + 2)) \<le> 1/(2::real) * (1/2)^n" |
60867 | 1711 |
by (simp add: power_inverse [symmetric]) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
1712 |
hence "inverse (fact (n + 2)) * (x^n * x\<^sup>2) \<le> 1/2 * (1/2)^n * (1 * x\<^sup>2)" |
50326 | 1713 |
by (rule mult_mono) |
56536 | 1714 |
(rule mult_mono, simp_all add: power_le_one a b) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
1715 |
hence "inverse (fact (n + 2)) * x ^ (n + 2) \<le> (x\<^sup>2/2) * ((1/2)^n)" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
1716 |
unfolding power_add by (simp add: ac_simps del: fact.simps) } |
50326 | 1717 |
note aux1 = this |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
1718 |
have "(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))" |
50326 | 1719 |
by (intro sums_mult geometric_sums, simp) |
53076 | 1720 |
hence aux2: "(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums x\<^sup>2" |
50326 | 1721 |
by simp |
53079 | 1722 |
have "suminf (\<lambda>n. inverse(fact (n+2)) * (x ^ (n+2))) <= x\<^sup>2" |
50326 | 1723 |
proof - |
53079 | 1724 |
have "suminf (\<lambda>n. inverse(fact (n+2)) * (x ^ (n+2))) <= |
1725 |
suminf (\<lambda>n. (x\<^sup>2/2) * ((1/2)^n))" |
|
56213 | 1726 |
apply (rule suminf_le) |
50326 | 1727 |
apply (rule allI, rule aux1) |
1728 |
apply (rule summable_exp [THEN summable_ignore_initial_segment]) |
|
1729 |
by (rule sums_summable, rule aux2) |
|
53076 | 1730 |
also have "... = x\<^sup>2" |
50326 | 1731 |
by (rule sums_unique [THEN sym], rule aux2) |
1732 |
finally show ?thesis . |
|
1733 |
qed |
|
1734 |
thus ?thesis unfolding exp_first_two_terms by auto |
|
1735 |
qed |
|
1736 |
||
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1737 |
corollary exp_half_le2: "exp(1/2) \<le> (2::real)" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1738 |
using exp_bound [of "1/2"] |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1739 |
by (simp add: field_simps) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1740 |
|
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
1741 |
corollary exp_le: "exp 1 \<le> (3::real)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
1742 |
using exp_bound [of 1] |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
1743 |
by (simp add: field_simps) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
1744 |
|
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1745 |
lemma exp_bound_half: "norm(z) \<le> 1/2 \<Longrightarrow> norm(exp z) \<le> 2" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1746 |
by (blast intro: order_trans intro!: exp_half_le2 norm_exp) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1747 |
|
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1748 |
lemma exp_bound_lemma: |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1749 |
assumes "norm(z) \<le> 1/2" shows "norm(exp z) \<le> 1 + 2 * norm(z)" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1750 |
proof - |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1751 |
have n: "(norm z)\<^sup>2 \<le> norm z * 1" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1752 |
unfolding power2_eq_square |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1753 |
apply (rule mult_left_mono) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1754 |
using assms |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1755 |
apply auto |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1756 |
done |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1757 |
show ?thesis |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1758 |
apply (rule order_trans [OF norm_exp]) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1759 |
apply (rule order_trans [OF exp_bound]) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1760 |
using assms n |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1761 |
apply auto |
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1762 |
done |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1763 |
qed |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1764 |
|
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1765 |
lemma real_exp_bound_lemma: |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1766 |
fixes x :: real |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1767 |
shows "0 \<le> x \<Longrightarrow> x \<le> 1/2 \<Longrightarrow> exp(x) \<le> 1 + 2 * x" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1768 |
using exp_bound_lemma [of x] |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1769 |
by simp |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
1770 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1771 |
lemma ln_one_minus_pos_upper_bound: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1772 |
fixes x::real shows "0 <= x \<Longrightarrow> x < 1 \<Longrightarrow> ln (1 - x) <= - x" |
50326 | 1773 |
proof - |
1774 |
assume a: "0 <= (x::real)" and b: "x < 1" |
|
53076 | 1775 |
have "(1 - x) * (1 + x + x\<^sup>2) = (1 - x^3)" |
50326 | 1776 |
by (simp add: algebra_simps power2_eq_square power3_eq_cube) |
1777 |
also have "... <= 1" |
|
1778 |
by (auto simp add: a) |
|
53076 | 1779 |
finally have "(1 - x) * (1 + x + x\<^sup>2) <= 1" . |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
1780 |
moreover have c: "0 < 1 + x + x\<^sup>2" |
50326 | 1781 |
by (simp add: add_pos_nonneg a) |
53076 | 1782 |
ultimately have "1 - x <= 1 / (1 + x + x\<^sup>2)" |
50326 | 1783 |
by (elim mult_imp_le_div_pos) |
1784 |
also have "... <= 1 / exp x" |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1785 |
by (metis a abs_one b exp_bound exp_gt_zero frac_le less_eq_real_def real_sqrt_abs |
54576 | 1786 |
real_sqrt_pow2_iff real_sqrt_power) |
50326 | 1787 |
also have "... = exp (-x)" |
1788 |
by (auto simp add: exp_minus divide_inverse) |
|
1789 |
finally have "1 - x <= exp (- x)" . |
|
1790 |
also have "1 - x = exp (ln (1 - x))" |
|
54576 | 1791 |
by (metis b diff_0 exp_ln_iff less_iff_diff_less_0 minus_diff_eq) |
50326 | 1792 |
finally have "exp (ln (1 - x)) <= exp (- x)" . |
1793 |
thus ?thesis by (auto simp only: exp_le_cancel_iff) |
|
1794 |
qed |
|
1795 |
||
1796 |
lemma exp_ge_add_one_self [simp]: "1 + (x::real) <= exp x" |
|
1797 |
apply (case_tac "0 <= x") |
|
1798 |
apply (erule exp_ge_add_one_self_aux) |
|
1799 |
apply (case_tac "x <= -1") |
|
1800 |
apply (subgoal_tac "1 + x <= 0") |
|
1801 |
apply (erule order_trans) |
|
1802 |
apply simp |
|
1803 |
apply simp |
|
1804 |
apply (subgoal_tac "1 + x = exp(ln (1 + x))") |
|
1805 |
apply (erule ssubst) |
|
1806 |
apply (subst exp_le_cancel_iff) |
|
1807 |
apply (subgoal_tac "ln (1 - (- x)) <= - (- x)") |
|
1808 |
apply simp |
|
1809 |
apply (rule ln_one_minus_pos_upper_bound) |
|
1810 |
apply auto |
|
1811 |
done |
|
1812 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1813 |
lemma ln_one_plus_pos_lower_bound: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1814 |
fixes x::real shows "0 <= x \<Longrightarrow> x <= 1 \<Longrightarrow> x - x\<^sup>2 <= ln (1 + x)" |
51527 | 1815 |
proof - |
1816 |
assume a: "0 <= x" and b: "x <= 1" |
|
53076 | 1817 |
have "exp (x - x\<^sup>2) = exp x / exp (x\<^sup>2)" |
51527 | 1818 |
by (rule exp_diff) |
53076 | 1819 |
also have "... <= (1 + x + x\<^sup>2) / exp (x \<^sup>2)" |
54576 | 1820 |
by (metis a b divide_right_mono exp_bound exp_ge_zero) |
53076 | 1821 |
also have "... <= (1 + x + x\<^sup>2) / (1 + x\<^sup>2)" |
56544 | 1822 |
by (simp add: a divide_left_mono add_pos_nonneg) |
51527 | 1823 |
also from a have "... <= 1 + x" |
1824 |
by (simp add: field_simps add_strict_increasing zero_le_mult_iff) |
|
53076 | 1825 |
finally have "exp (x - x\<^sup>2) <= 1 + x" . |
51527 | 1826 |
also have "... = exp (ln (1 + x))" |
1827 |
proof - |
|
1828 |
from a have "0 < 1 + x" by auto |
|
1829 |
thus ?thesis |
|
1830 |
by (auto simp only: exp_ln_iff [THEN sym]) |
|
1831 |
qed |
|
53076 | 1832 |
finally have "exp (x - x\<^sup>2) <= exp (ln (1 + x))" . |
54576 | 1833 |
thus ?thesis |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1834 |
by (metis exp_le_cancel_iff) |
51527 | 1835 |
qed |
1836 |
||
53079 | 1837 |
lemma ln_one_minus_pos_lower_bound: |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1838 |
fixes x::real |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1839 |
shows "0 <= x \<Longrightarrow> x <= (1 / 2) \<Longrightarrow> - x - 2 * x\<^sup>2 <= ln (1 - x)" |
51527 | 1840 |
proof - |
1841 |
assume a: "0 <= x" and b: "x <= (1 / 2)" |
|
53079 | 1842 |
from b have c: "x < 1" by auto |
51527 | 1843 |
then have "ln (1 - x) = - ln (1 + x / (1 - x))" |
54576 | 1844 |
apply (subst ln_inverse [symmetric]) |
1845 |
apply (simp add: field_simps) |
|
1846 |
apply (rule arg_cong [where f=ln]) |
|
1847 |
apply (simp add: field_simps) |
|
1848 |
done |
|
51527 | 1849 |
also have "- (x / (1 - x)) <= ..." |
53079 | 1850 |
proof - |
51527 | 1851 |
have "ln (1 + x / (1 - x)) <= x / (1 - x)" |
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
1852 |
using a c by (intro ln_add_one_self_le_self) auto |
51527 | 1853 |
thus ?thesis |
1854 |
by auto |
|
1855 |
qed |
|
1856 |
also have "- (x / (1 - x)) = -x / (1 - x)" |
|
1857 |
by auto |
|
1858 |
finally have d: "- x / (1 - x) <= ln (1 - x)" . |
|
1859 |
have "0 < 1 - x" using a b by simp |
|
53076 | 1860 |
hence e: "-x - 2 * x\<^sup>2 <= - x / (1 - x)" |
51527 | 1861 |
using mult_right_le_one_le[of "x*x" "2*x"] a b |
53079 | 1862 |
by (simp add: field_simps power2_eq_square) |
53076 | 1863 |
from e d show "- x - 2 * x\<^sup>2 <= ln (1 - x)" |
51527 | 1864 |
by (rule order_trans) |
1865 |
qed |
|
1866 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1867 |
lemma ln_add_one_self_le_self2: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1868 |
fixes x::real shows "-1 < x \<Longrightarrow> ln(1 + x) <= x" |
51527 | 1869 |
apply (subgoal_tac "ln (1 + x) \<le> ln (exp x)", simp) |
1870 |
apply (subst ln_le_cancel_iff) |
|
1871 |
apply auto |
|
53079 | 1872 |
done |
51527 | 1873 |
|
1874 |
lemma abs_ln_one_plus_x_minus_x_bound_nonneg: |
|
61944 | 1875 |
fixes x::real shows "0 <= x \<Longrightarrow> x <= 1 \<Longrightarrow> \<bar>ln (1 + x) - x\<bar> <= x\<^sup>2" |
51527 | 1876 |
proof - |
1877 |
assume x: "0 <= x" |
|
1878 |
assume x1: "x <= 1" |
|
1879 |
from x have "ln (1 + x) <= x" |
|
1880 |
by (rule ln_add_one_self_le_self) |
|
53079 | 1881 |
then have "ln (1 + x) - x <= 0" |
51527 | 1882 |
by simp |
61944 | 1883 |
then have "\<bar>ln(1 + x) - x\<bar> = - (ln(1 + x) - x)" |
51527 | 1884 |
by (rule abs_of_nonpos) |
53079 | 1885 |
also have "... = x - ln (1 + x)" |
51527 | 1886 |
by simp |
53076 | 1887 |
also have "... <= x\<^sup>2" |
51527 | 1888 |
proof - |
53076 | 1889 |
from x x1 have "x - x\<^sup>2 <= ln (1 + x)" |
51527 | 1890 |
by (intro ln_one_plus_pos_lower_bound) |
1891 |
thus ?thesis |
|
1892 |
by simp |
|
1893 |
qed |
|
1894 |
finally show ?thesis . |
|
1895 |
qed |
|
1896 |
||
1897 |
lemma abs_ln_one_plus_x_minus_x_bound_nonpos: |
|
61944 | 1898 |
fixes x::real shows "-(1 / 2) <= x \<Longrightarrow> x <= 0 \<Longrightarrow> \<bar>ln (1 + x) - x\<bar> <= 2 * x\<^sup>2" |
51527 | 1899 |
proof - |
1900 |
assume a: "-(1 / 2) <= x" |
|
1901 |
assume b: "x <= 0" |
|
61944 | 1902 |
have "\<bar>ln (1 + x) - x\<bar> = x - ln(1 - (-x))" |
51527 | 1903 |
apply (subst abs_of_nonpos) |
1904 |
apply simp |
|
1905 |
apply (rule ln_add_one_self_le_self2) |
|
1906 |
using a apply auto |
|
1907 |
done |
|
53076 | 1908 |
also have "... <= 2 * x\<^sup>2" |
1909 |
apply (subgoal_tac "- (-x) - 2 * (-x)\<^sup>2 <= ln (1 - (-x))") |
|
51527 | 1910 |
apply (simp add: algebra_simps) |
1911 |
apply (rule ln_one_minus_pos_lower_bound) |
|
1912 |
using a b apply auto |
|
1913 |
done |
|
1914 |
finally show ?thesis . |
|
1915 |
qed |
|
1916 |
||
1917 |
lemma abs_ln_one_plus_x_minus_x_bound: |
|
61944 | 1918 |
fixes x::real shows "\<bar>x\<bar> <= 1 / 2 \<Longrightarrow> \<bar>ln (1 + x) - x\<bar> <= 2 * x\<^sup>2" |
51527 | 1919 |
apply (case_tac "0 <= x") |
1920 |
apply (rule order_trans) |
|
1921 |
apply (rule abs_ln_one_plus_x_minus_x_bound_nonneg) |
|
1922 |
apply auto |
|
1923 |
apply (rule abs_ln_one_plus_x_minus_x_bound_nonpos) |
|
1924 |
apply auto |
|
53079 | 1925 |
done |
1926 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1927 |
lemma ln_x_over_x_mono: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1928 |
fixes x::real shows "exp 1 <= x \<Longrightarrow> x <= y \<Longrightarrow> (ln y / y) <= (ln x / x)" |
51527 | 1929 |
proof - |
1930 |
assume x: "exp 1 <= x" "x <= y" |
|
1931 |
moreover have "0 < exp (1::real)" by simp |
|
1932 |
ultimately have a: "0 < x" and b: "0 < y" |
|
1933 |
by (fast intro: less_le_trans order_trans)+ |
|
1934 |
have "x * ln y - x * ln x = x * (ln y - ln x)" |
|
1935 |
by (simp add: algebra_simps) |
|
1936 |
also have "... = x * ln(y / x)" |
|
1937 |
by (simp only: ln_div a b) |
|
1938 |
also have "y / x = (x + (y - x)) / x" |
|
1939 |
by simp |
|
1940 |
also have "... = 1 + (y - x) / x" |
|
1941 |
using x a by (simp add: field_simps) |
|
1942 |
also have "x * ln(1 + (y - x) / x) <= x * ((y - x) / x)" |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
1943 |
using x a |
56571
f4635657d66f
added divide_nonneg_nonneg and co; made it a simp rule
hoelzl
parents:
56544
diff
changeset
|
1944 |
by (intro mult_left_mono ln_add_one_self_le_self) simp_all |
51527 | 1945 |
also have "... = y - x" using a by simp |
1946 |
also have "... = (y - x) * ln (exp 1)" by simp |
|
1947 |
also have "... <= (y - x) * ln x" |
|
1948 |
apply (rule mult_left_mono) |
|
1949 |
apply (subst ln_le_cancel_iff) |
|
1950 |
apply fact |
|
1951 |
apply (rule a) |
|
1952 |
apply (rule x) |
|
1953 |
using x apply simp |
|
1954 |
done |
|
1955 |
also have "... = y * ln x - x * ln x" |
|
1956 |
by (rule left_diff_distrib) |
|
1957 |
finally have "x * ln y <= y * ln x" |
|
1958 |
by arith |
|
1959 |
then have "ln y <= (y * ln x) / x" using a by (simp add: field_simps) |
|
1960 |
also have "... = y * (ln x / x)" by simp |
|
1961 |
finally show ?thesis using b by (simp add: field_simps) |
|
1962 |
qed |
|
1963 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1964 |
lemma ln_le_minus_one: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1965 |
fixes x::real shows "0 < x \<Longrightarrow> ln x \<le> x - 1" |
51527 | 1966 |
using exp_ge_add_one_self[of "ln x"] by simp |
1967 |
||
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1968 |
corollary ln_diff_le: |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1969 |
fixes x::real |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1970 |
shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln x - ln y \<le> (x - y) / y" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1971 |
by (simp add: ln_div [symmetric] diff_divide_distrib ln_le_minus_one) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
1972 |
|
51527 | 1973 |
lemma ln_eq_minus_one: |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
1974 |
fixes x::real |
53079 | 1975 |
assumes "0 < x" "ln x = x - 1" |
1976 |
shows "x = 1" |
|
51527 | 1977 |
proof - |
53079 | 1978 |
let ?l = "\<lambda>y. ln y - y + 1" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
1979 |
have D: "\<And>x::real. 0 < x \<Longrightarrow> DERIV ?l x :> (1 / x - 1)" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1980 |
by (auto intro!: derivative_eq_intros) |
51527 | 1981 |
|
1982 |
show ?thesis |
|
1983 |
proof (cases rule: linorder_cases) |
|
1984 |
assume "x < 1" |
|
60758 | 1985 |
from dense[OF \<open>x < 1\<close>] obtain a where "x < a" "a < 1" by blast |
1986 |
from \<open>x < a\<close> have "?l x < ?l a" |
|
51527 | 1987 |
proof (rule DERIV_pos_imp_increasing, safe) |
53079 | 1988 |
fix y |
1989 |
assume "x \<le> y" "y \<le> a" |
|
60758 | 1990 |
with \<open>0 < x\<close> \<open>a < 1\<close> have "0 < 1 / y - 1" "0 < y" |
51527 | 1991 |
by (auto simp: field_simps) |
61762
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
1992 |
with D show "\<exists>z. DERIV ?l y :> z \<and> 0 < z" by blast |
51527 | 1993 |
qed |
1994 |
also have "\<dots> \<le> 0" |
|
60758 | 1995 |
using ln_le_minus_one \<open>0 < x\<close> \<open>x < a\<close> by (auto simp: field_simps) |
51527 | 1996 |
finally show "x = 1" using assms by auto |
1997 |
next |
|
1998 |
assume "1 < x" |
|
53079 | 1999 |
from dense[OF this] obtain a where "1 < a" "a < x" by blast |
60758 | 2000 |
from \<open>a < x\<close> have "?l x < ?l a" |
51527 | 2001 |
proof (rule DERIV_neg_imp_decreasing, safe) |
53079 | 2002 |
fix y |
2003 |
assume "a \<le> y" "y \<le> x" |
|
60758 | 2004 |
with \<open>1 < a\<close> have "1 / y - 1 < 0" "0 < y" |
51527 | 2005 |
by (auto simp: field_simps) |
2006 |
with D show "\<exists>z. DERIV ?l y :> z \<and> z < 0" |
|
2007 |
by blast |
|
2008 |
qed |
|
2009 |
also have "\<dots> \<le> 0" |
|
60758 | 2010 |
using ln_le_minus_one \<open>1 < a\<close> by (auto simp: field_simps) |
51527 | 2011 |
finally show "x = 1" using assms by auto |
53079 | 2012 |
next |
2013 |
assume "x = 1" |
|
2014 |
then show ?thesis by simp |
|
2015 |
qed |
|
51527 | 2016 |
qed |
2017 |
||
50326 | 2018 |
lemma exp_at_bot: "(exp ---> (0::real)) at_bot" |
2019 |
unfolding tendsto_Zfun_iff |
|
2020 |
proof (rule ZfunI, simp add: eventually_at_bot_dense) |
|
2021 |
fix r :: real assume "0 < r" |
|
53079 | 2022 |
{ |
2023 |
fix x |
|
2024 |
assume "x < ln r" |
|
50326 | 2025 |
then have "exp x < exp (ln r)" |
2026 |
by simp |
|
60758 | 2027 |
with \<open>0 < r\<close> have "exp x < r" |
53079 | 2028 |
by simp |
2029 |
} |
|
50326 | 2030 |
then show "\<exists>k. \<forall>n<k. exp n < r" by auto |
2031 |
qed |
|
2032 |
||
2033 |
lemma exp_at_top: "LIM x at_top. exp x :: real :> at_top" |
|
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
2034 |
by (rule filterlim_at_top_at_top[where Q="\<lambda>x. True" and P="\<lambda>x. 0 < x" and g="ln"]) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
2035 |
(auto intro: eventually_gt_at_top) |
50326 | 2036 |
|
59613
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2037 |
lemma lim_exp_minus_1: |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2038 |
fixes x :: "'a::{real_normed_field,banach}" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2039 |
shows "((\<lambda>z::'a. (exp(z) - 1) / z) ---> 1) (at 0)" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2040 |
proof - |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2041 |
have "((\<lambda>z::'a. exp(z) - 1) has_field_derivative 1) (at 0)" |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2042 |
by (intro derivative_eq_intros | simp)+ |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2043 |
then show ?thesis |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2044 |
by (simp add: Deriv.DERIV_iff2) |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2045 |
qed |
7103019278f0
The function frac. Various lemmas about limits, series, the exp function, etc.
paulson <lp15@cam.ac.uk>
parents:
59587
diff
changeset
|
2046 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2047 |
lemma ln_at_0: "LIM x at_right 0. ln (x::real) :> at_bot" |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
2048 |
by (rule filterlim_at_bot_at_right[where Q="\<lambda>x. 0 < x" and P="\<lambda>x. True" and g="exp"]) |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51527
diff
changeset
|
2049 |
(auto simp: eventually_at_filter) |
50326 | 2050 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2051 |
lemma ln_at_top: "LIM x at_top. ln (x::real) :> at_top" |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
2052 |
by (rule filterlim_at_top_at_top[where Q="\<lambda>x. 0 < x" and P="\<lambda>x. True" and g="exp"]) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
2053 |
(auto intro: eventually_gt_at_top) |
50326 | 2054 |
|
60721
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2055 |
lemma filtermap_ln_at_top: "filtermap (ln::real \<Rightarrow> real) at_top = at_top" |
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2056 |
by (intro filtermap_fun_inverse[of exp] exp_at_top ln_at_top) auto |
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2057 |
|
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2058 |
lemma filtermap_exp_at_top: "filtermap (exp::real \<Rightarrow> real) at_top = at_top" |
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2059 |
by (intro filtermap_fun_inverse[of ln] exp_at_top ln_at_top) |
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2060 |
(auto simp: eventually_at_top_dense) |
c1b7793c23a3
generalized filtermap_homeomorph to filtermap_fun_inverse; add eventually_at_top/bot_not_equal
hoelzl
parents:
60688
diff
changeset
|
2061 |
|
50347 | 2062 |
lemma tendsto_power_div_exp_0: "((\<lambda>x. x ^ k / exp x) ---> (0::real)) at_top" |
2063 |
proof (induct k) |
|
53079 | 2064 |
case 0 |
50347 | 2065 |
show "((\<lambda>x. x ^ 0 / exp x) ---> (0::real)) at_top" |
2066 |
by (simp add: inverse_eq_divide[symmetric]) |
|
2067 |
(metis filterlim_compose[OF tendsto_inverse_0] exp_at_top filterlim_mono |
|
2068 |
at_top_le_at_infinity order_refl) |
|
2069 |
next |
|
2070 |
case (Suc k) |
|
2071 |
show ?case |
|
2072 |
proof (rule lhospital_at_top_at_top) |
|
2073 |
show "eventually (\<lambda>x. DERIV (\<lambda>x. x ^ Suc k) x :> (real (Suc k) * x^k)) at_top" |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2074 |
by eventually_elim (intro derivative_eq_intros, auto) |
50347 | 2075 |
show "eventually (\<lambda>x. DERIV exp x :> exp x) at_top" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2076 |
by eventually_elim auto |
50347 | 2077 |
show "eventually (\<lambda>x. exp x \<noteq> 0) at_top" |
2078 |
by auto |
|
2079 |
from tendsto_mult[OF tendsto_const Suc, of "real (Suc k)"] |
|
2080 |
show "((\<lambda>x. real (Suc k) * x ^ k / exp x) ---> 0) at_top" |
|
2081 |
by simp |
|
2082 |
qed (rule exp_at_top) |
|
2083 |
qed |
|
2084 |
||
51527 | 2085 |
|
53079 | 2086 |
definition log :: "[real,real] => real" |
61799 | 2087 |
\<comment> \<open>logarithm of @{term x} to base @{term a}\<close> |
53079 | 2088 |
where "log a x = ln x / ln a" |
51527 | 2089 |
|
2090 |
||
2091 |
lemma tendsto_log [tendsto_intros]: |
|
2092 |
"\<lbrakk>(f ---> a) F; (g ---> b) F; 0 < a; a \<noteq> 1; 0 < b\<rbrakk> \<Longrightarrow> ((\<lambda>x. log (f x) (g x)) ---> log a b) F" |
|
2093 |
unfolding log_def by (intro tendsto_intros) auto |
|
2094 |
||
2095 |
lemma continuous_log: |
|
53079 | 2096 |
assumes "continuous F f" |
2097 |
and "continuous F g" |
|
2098 |
and "0 < f (Lim F (\<lambda>x. x))" |
|
2099 |
and "f (Lim F (\<lambda>x. x)) \<noteq> 1" |
|
2100 |
and "0 < g (Lim F (\<lambda>x. x))" |
|
51527 | 2101 |
shows "continuous F (\<lambda>x. log (f x) (g x))" |
2102 |
using assms unfolding continuous_def by (rule tendsto_log) |
|
2103 |
||
2104 |
lemma continuous_at_within_log[continuous_intros]: |
|
53079 | 2105 |
assumes "continuous (at a within s) f" |
2106 |
and "continuous (at a within s) g" |
|
2107 |
and "0 < f a" |
|
2108 |
and "f a \<noteq> 1" |
|
2109 |
and "0 < g a" |
|
51527 | 2110 |
shows "continuous (at a within s) (\<lambda>x. log (f x) (g x))" |
2111 |
using assms unfolding continuous_within by (rule tendsto_log) |
|
2112 |
||
2113 |
lemma isCont_log[continuous_intros, simp]: |
|
2114 |
assumes "isCont f a" "isCont g a" "0 < f a" "f a \<noteq> 1" "0 < g a" |
|
2115 |
shows "isCont (\<lambda>x. log (f x) (g x)) a" |
|
2116 |
using assms unfolding continuous_at by (rule tendsto_log) |
|
2117 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
2118 |
lemma continuous_on_log[continuous_intros]: |
53079 | 2119 |
assumes "continuous_on s f" "continuous_on s g" |
2120 |
and "\<forall>x\<in>s. 0 < f x" "\<forall>x\<in>s. f x \<noteq> 1" "\<forall>x\<in>s. 0 < g x" |
|
51527 | 2121 |
shows "continuous_on s (\<lambda>x. log (f x) (g x))" |
2122 |
using assms unfolding continuous_on_def by (fast intro: tendsto_log) |
|
2123 |
||
2124 |
lemma powr_one_eq_one [simp]: "1 powr a = 1" |
|
53079 | 2125 |
by (simp add: powr_def) |
51527 | 2126 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2127 |
lemma powr_zero_eq_one [simp]: "x powr 0 = (if x=0 then 0 else 1)" |
53079 | 2128 |
by (simp add: powr_def) |
51527 | 2129 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2130 |
lemma powr_one_gt_zero_iff [simp]: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2131 |
fixes x::real shows "(x powr 1 = x) = (0 \<le> x)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2132 |
by (auto simp: powr_def) |
51527 | 2133 |
declare powr_one_gt_zero_iff [THEN iffD2, simp] |
2134 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2135 |
lemma powr_mult: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2136 |
fixes x::real shows "0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> (x * y) powr a = (x powr a) * (y powr a)" |
53079 | 2137 |
by (simp add: powr_def exp_add [symmetric] ln_mult distrib_left) |
51527 | 2138 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2139 |
lemma powr_ge_pzero [simp]: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2140 |
fixes x::real shows "0 <= x powr y" |
53079 | 2141 |
by (simp add: powr_def) |
51527 | 2142 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2143 |
lemma powr_divide: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2144 |
fixes x::real shows "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> (x / y) powr a = (x powr a) / (y powr a)" |
53079 | 2145 |
apply (simp add: divide_inverse positive_imp_inverse_positive powr_mult) |
2146 |
apply (simp add: powr_def exp_minus [symmetric] exp_add [symmetric] ln_inverse) |
|
2147 |
done |
|
51527 | 2148 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2149 |
lemma powr_divide2: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2150 |
fixes x::real shows "x powr a / x powr b = x powr (a - b)" |
51527 | 2151 |
apply (simp add: powr_def) |
2152 |
apply (subst exp_diff [THEN sym]) |
|
2153 |
apply (simp add: left_diff_distrib) |
|
53079 | 2154 |
done |
51527 | 2155 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2156 |
lemma powr_add: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2157 |
fixes x::real shows "x powr (a + b) = (x powr a) * (x powr b)" |
53079 | 2158 |
by (simp add: powr_def exp_add [symmetric] distrib_right) |
2159 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2160 |
lemma powr_mult_base: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2161 |
fixes x::real shows "0 < x \<Longrightarrow>x * x powr y = x powr (1 + y)" |
53079 | 2162 |
using assms by (auto simp: powr_add) |
51527 | 2163 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2164 |
lemma powr_powr: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2165 |
fixes x::real shows "(x powr a) powr b = x powr (a * b)" |
53079 | 2166 |
by (simp add: powr_def) |
51527 | 2167 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2168 |
lemma powr_powr_swap: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2169 |
fixes x::real shows "(x powr a) powr b = (x powr b) powr a" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
2170 |
by (simp add: powr_powr mult.commute) |
51527 | 2171 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2172 |
lemma powr_minus: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2173 |
fixes x::real shows "x powr (-a) = inverse (x powr a)" |
53079 | 2174 |
by (simp add: powr_def exp_minus [symmetric]) |
51527 | 2175 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2176 |
lemma powr_minus_divide: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2177 |
fixes x::real shows "x powr (-a) = 1/(x powr a)" |
53079 | 2178 |
by (simp add: divide_inverse powr_minus) |
2179 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2180 |
lemma divide_powr_uminus: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2181 |
fixes a::real shows "a / b powr c = a * b powr (- c)" |
58984
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2182 |
by (simp add: powr_minus_divide) |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2183 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2184 |
lemma powr_less_mono: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2185 |
fixes x::real shows "a < b \<Longrightarrow> 1 < x \<Longrightarrow> x powr a < x powr b" |
53079 | 2186 |
by (simp add: powr_def) |
2187 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2188 |
lemma powr_less_cancel: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2189 |
fixes x::real shows "x powr a < x powr b \<Longrightarrow> 1 < x \<Longrightarrow> a < b" |
53079 | 2190 |
by (simp add: powr_def) |
2191 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2192 |
lemma powr_less_cancel_iff [simp]: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2193 |
fixes x::real shows "1 < x \<Longrightarrow> (x powr a < x powr b) = (a < b)" |
53079 | 2194 |
by (blast intro: powr_less_cancel powr_less_mono) |
2195 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2196 |
lemma powr_le_cancel_iff [simp]: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2197 |
fixes x::real shows "1 < x \<Longrightarrow> (x powr a \<le> x powr b) = (a \<le> b)" |
53079 | 2198 |
by (simp add: linorder_not_less [symmetric]) |
51527 | 2199 |
|
2200 |
lemma log_ln: "ln x = log (exp(1)) x" |
|
53079 | 2201 |
by (simp add: log_def) |
2202 |
||
2203 |
lemma DERIV_log: |
|
2204 |
assumes "x > 0" |
|
2205 |
shows "DERIV (\<lambda>y. log b y) x :> 1 / (ln b * x)" |
|
51527 | 2206 |
proof - |
2207 |
def lb \<equiv> "1 / ln b" |
|
2208 |
moreover have "DERIV (\<lambda>y. lb * ln y) x :> lb / x" |
|
60758 | 2209 |
using \<open>x > 0\<close> by (auto intro!: derivative_eq_intros) |
51527 | 2210 |
ultimately show ?thesis |
2211 |
by (simp add: log_def) |
|
2212 |
qed |
|
2213 |
||
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2214 |
lemmas DERIV_log[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
2215 |
DERIV_log[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
51527 | 2216 |
|
53079 | 2217 |
lemma powr_log_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> a powr (log a x) = x" |
2218 |
by (simp add: powr_def log_def) |
|
2219 |
||
2220 |
lemma log_powr_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log a (a powr y) = y" |
|
2221 |
by (simp add: log_def powr_def) |
|
2222 |
||
2223 |
lemma log_mult: |
|
2224 |
"0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> |
|
2225 |
log a (x * y) = log a x + log a y" |
|
2226 |
by (simp add: log_def ln_mult divide_inverse distrib_right) |
|
2227 |
||
2228 |
lemma log_eq_div_ln_mult_log: |
|
2229 |
"0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> |
|
2230 |
log a x = (ln b/ln a) * log b x" |
|
2231 |
by (simp add: log_def divide_inverse) |
|
51527 | 2232 |
|
60758 | 2233 |
text\<open>Base 10 logarithms\<close> |
53079 | 2234 |
lemma log_base_10_eq1: "0 < x \<Longrightarrow> log 10 x = (ln (exp 1) / ln 10) * ln x" |
2235 |
by (simp add: log_def) |
|
2236 |
||
2237 |
lemma log_base_10_eq2: "0 < x \<Longrightarrow> log 10 x = (log 10 (exp 1)) * ln x" |
|
2238 |
by (simp add: log_def) |
|
51527 | 2239 |
|
2240 |
lemma log_one [simp]: "log a 1 = 0" |
|
53079 | 2241 |
by (simp add: log_def) |
51527 | 2242 |
|
2243 |
lemma log_eq_one [simp]: "[| 0 < a; a \<noteq> 1 |] ==> log a a = 1" |
|
53079 | 2244 |
by (simp add: log_def) |
2245 |
||
2246 |
lemma log_inverse: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> log a (inverse x) = - log a x" |
|
2247 |
apply (rule_tac a1 = "log a x" in add_left_cancel [THEN iffD1]) |
|
2248 |
apply (simp add: log_mult [symmetric]) |
|
2249 |
done |
|
2250 |
||
2251 |
lemma log_divide: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> log a (x/y) = log a x - log a y" |
|
2252 |
by (simp add: log_mult divide_inverse log_inverse) |
|
51527 | 2253 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2254 |
lemma powr_gt_zero [simp]: "0 < x powr a \<longleftrightarrow> (x::real) \<noteq> 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2255 |
by (simp add: powr_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2256 |
|
58984
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2257 |
lemma log_add_eq_powr: "0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> log b x + y = log b (x * b powr y)" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2258 |
and add_log_eq_powr: "0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> y + log b x = log b (b powr y * x)" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2259 |
and log_minus_eq_powr: "0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> log b x - y = log b (x * b powr -y)" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2260 |
and minus_log_eq_powr: "0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> y - log b x = log b (b powr y / x)" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2261 |
by (simp_all add: log_mult log_divide) |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2262 |
|
51527 | 2263 |
lemma log_less_cancel_iff [simp]: |
53079 | 2264 |
"1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> log a x < log a y \<longleftrightarrow> x < y" |
2265 |
apply safe |
|
2266 |
apply (rule_tac [2] powr_less_cancel) |
|
2267 |
apply (drule_tac a = "log a x" in powr_less_mono, auto) |
|
2268 |
done |
|
2269 |
||
2270 |
lemma log_inj: |
|
2271 |
assumes "1 < b" |
|
2272 |
shows "inj_on (log b) {0 <..}" |
|
51527 | 2273 |
proof (rule inj_onI, simp) |
53079 | 2274 |
fix x y |
2275 |
assume pos: "0 < x" "0 < y" and *: "log b x = log b y" |
|
51527 | 2276 |
show "x = y" |
2277 |
proof (cases rule: linorder_cases) |
|
53079 | 2278 |
assume "x = y" |
2279 |
then show ?thesis by simp |
|
2280 |
next |
|
51527 | 2281 |
assume "x < y" hence "log b x < log b y" |
60758 | 2282 |
using log_less_cancel_iff[OF \<open>1 < b\<close>] pos by simp |
53079 | 2283 |
then show ?thesis using * by simp |
51527 | 2284 |
next |
2285 |
assume "y < x" hence "log b y < log b x" |
|
60758 | 2286 |
using log_less_cancel_iff[OF \<open>1 < b\<close>] pos by simp |
53079 | 2287 |
then show ?thesis using * by simp |
2288 |
qed |
|
51527 | 2289 |
qed |
2290 |
||
2291 |
lemma log_le_cancel_iff [simp]: |
|
53079 | 2292 |
"1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> (log a x \<le> log a y) = (x \<le> y)" |
2293 |
by (simp add: linorder_not_less [symmetric]) |
|
51527 | 2294 |
|
2295 |
lemma zero_less_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 < log a x \<longleftrightarrow> 1 < x" |
|
2296 |
using log_less_cancel_iff[of a 1 x] by simp |
|
2297 |
||
2298 |
lemma zero_le_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 \<le> log a x \<longleftrightarrow> 1 \<le> x" |
|
2299 |
using log_le_cancel_iff[of a 1 x] by simp |
|
2300 |
||
2301 |
lemma log_less_zero_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x < 0 \<longleftrightarrow> x < 1" |
|
2302 |
using log_less_cancel_iff[of a x 1] by simp |
|
2303 |
||
2304 |
lemma log_le_zero_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x \<le> 0 \<longleftrightarrow> x \<le> 1" |
|
2305 |
using log_le_cancel_iff[of a x 1] by simp |
|
2306 |
||
2307 |
lemma one_less_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 1 < log a x \<longleftrightarrow> a < x" |
|
2308 |
using log_less_cancel_iff[of a a x] by simp |
|
2309 |
||
2310 |
lemma one_le_log_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 1 \<le> log a x \<longleftrightarrow> a \<le> x" |
|
2311 |
using log_le_cancel_iff[of a a x] by simp |
|
2312 |
||
2313 |
lemma log_less_one_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x < 1 \<longleftrightarrow> x < a" |
|
2314 |
using log_less_cancel_iff[of a x a] by simp |
|
2315 |
||
2316 |
lemma log_le_one_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x \<le> 1 \<longleftrightarrow> x \<le> a" |
|
2317 |
using log_le_cancel_iff[of a x a] by simp |
|
2318 |
||
58984
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2319 |
lemma le_log_iff: |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2320 |
assumes "1 < b" "x > 0" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2321 |
shows "y \<le> log b x \<longleftrightarrow> b powr y \<le> (x::real)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2322 |
using assms |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2323 |
apply auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2324 |
apply (metis (no_types, hide_lams) less_irrefl less_le_trans linear powr_le_cancel_iff |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2325 |
powr_log_cancel zero_less_one) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2326 |
apply (metis not_less order.trans order_refl powr_le_cancel_iff powr_log_cancel zero_le_one) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2327 |
done |
58984
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2328 |
|
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2329 |
lemma less_log_iff: |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2330 |
assumes "1 < b" "x > 0" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2331 |
shows "y < log b x \<longleftrightarrow> b powr y < x" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2332 |
by (metis assms dual_order.strict_trans less_irrefl powr_less_cancel_iff |
58984
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2333 |
powr_log_cancel zero_less_one) |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2334 |
|
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2335 |
lemma |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2336 |
assumes "1 < b" "x > 0" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2337 |
shows log_less_iff: "log b x < y \<longleftrightarrow> x < b powr y" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2338 |
and log_le_iff: "log b x \<le> y \<longleftrightarrow> x \<le> b powr y" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2339 |
using le_log_iff[OF assms, of y] less_log_iff[OF assms, of y] |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2340 |
by auto |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2341 |
|
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2342 |
lemmas powr_le_iff = le_log_iff[symmetric] |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2343 |
and powr_less_iff = le_log_iff[symmetric] |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2344 |
and less_powr_iff = log_less_iff[symmetric] |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2345 |
and le_powr_iff = log_le_iff[symmetric] |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2346 |
|
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2347 |
lemma |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2348 |
floor_log_eq_powr_iff: "x > 0 \<Longrightarrow> b > 1 \<Longrightarrow> \<lfloor>log b x\<rfloor> = k \<longleftrightarrow> b powr k \<le> x \<and> x < b powr (k + 1)" |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2349 |
by (auto simp add: floor_eq_iff powr_le_iff less_powr_iff) |
ae0c56c485ae
added lemmas: convert between powr and log in comparisons, pull log out of addition/subtraction
immler
parents:
58981
diff
changeset
|
2350 |
|
51527 | 2351 |
lemma powr_realpow: "0 < x ==> x powr (real n) = x^n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2352 |
by (induct n) (simp_all add: ac_simps powr_add of_nat_Suc) |
51527 | 2353 |
|
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
2354 |
lemma powr_numeral: "0 < x \<Longrightarrow> x powr (numeral n :: real) = x ^ (numeral n)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2355 |
by (metis of_nat_numeral powr_realpow) |
52139 | 2356 |
|
57180 | 2357 |
lemma powr2_sqrt[simp]: "0 < x \<Longrightarrow> sqrt x powr 2 = x" |
61738
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
paulson <lp15@cam.ac.uk>
parents:
61694
diff
changeset
|
2358 |
by(simp add: powr_numeral) |
57180 | 2359 |
|
51527 | 2360 |
lemma powr_realpow2: "0 <= x ==> 0 < n ==> x^n = (if (x = 0) then 0 else x powr (real n))" |
2361 |
apply (case_tac "x = 0", simp, simp) |
|
2362 |
apply (rule powr_realpow [THEN sym], simp) |
|
53079 | 2363 |
done |
51527 | 2364 |
|
2365 |
lemma powr_int: |
|
2366 |
assumes "x > 0" |
|
2367 |
shows "x powr i = (if i \<ge> 0 then x ^ nat i else 1 / x ^ nat (-i))" |
|
53079 | 2368 |
proof (cases "i < 0") |
2369 |
case True |
|
51527 | 2370 |
have r: "x powr i = 1 / x powr (-i)" by (simp add: powr_minus field_simps) |
60758 | 2371 |
show ?thesis using \<open>i < 0\<close> \<open>x > 0\<close> by (simp add: r field_simps powr_realpow[symmetric]) |
53079 | 2372 |
next |
2373 |
case False |
|
2374 |
then show ?thesis by (simp add: assms powr_realpow[symmetric]) |
|
2375 |
qed |
|
51527 | 2376 |
|
58981 | 2377 |
lemma compute_powr[code]: |
2378 |
fixes i::real |
|
2379 |
shows "b powr i = |
|
2380 |
(if b \<le> 0 then Code.abort (STR ''op powr with nonpositive base'') (\<lambda>_. b powr i) |
|
61942 | 2381 |
else if \<lfloor>i\<rfloor> = i then (if 0 \<le> i then b ^ nat \<lfloor>i\<rfloor> else 1 / b ^ nat \<lfloor>- i\<rfloor>) |
58981 | 2382 |
else Code.abort (STR ''op powr with non-integer exponent'') (\<lambda>_. b powr i))" |
59587
8ea7b22525cb
Removed the obsolete functions "natfloor" and "natceiling"
nipkow
parents:
58984
diff
changeset
|
2383 |
by (auto simp: powr_int) |
58981 | 2384 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2385 |
lemma powr_one: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2386 |
fixes x::real shows "0 \<le> x \<Longrightarrow> x powr 1 = x" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2387 |
using powr_realpow [of x 1] |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2388 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2389 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2390 |
lemma powr_neg_one: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2391 |
fixes x::real shows "0 < x \<Longrightarrow> x powr - 1 = 1 / x" |
54489
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54230
diff
changeset
|
2392 |
using powr_int [of x "- 1"] by simp |
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54230
diff
changeset
|
2393 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2394 |
lemma powr_neg_numeral: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2395 |
fixes x::real shows "0 < x \<Longrightarrow> x powr - numeral n = 1 / x ^ numeral n" |
54489
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54230
diff
changeset
|
2396 |
using powr_int [of x "- numeral n"] by simp |
51527 | 2397 |
|
53079 | 2398 |
lemma root_powr_inverse: "0 < n \<Longrightarrow> 0 < x \<Longrightarrow> root n x = x powr (1/n)" |
51527 | 2399 |
by (rule real_root_pos_unique) (auto simp: powr_realpow[symmetric] powr_powr) |
2400 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2401 |
lemma ln_powr: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2402 |
fixes x::real shows "x \<noteq> 0 \<Longrightarrow> ln (x powr y) = y * ln x" |
56483 | 2403 |
by (simp add: powr_def) |
2404 |
||
56952 | 2405 |
lemma ln_root: "\<lbrakk> n > 0; b > 0 \<rbrakk> \<Longrightarrow> ln (root n b) = ln b / n" |
2406 |
by(simp add: root_powr_inverse ln_powr) |
|
2407 |
||
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2408 |
lemma ln_sqrt: "0 < x \<Longrightarrow> ln (sqrt x) = ln x / 2" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
2409 |
by (simp add: ln_powr powr_numeral ln_powr[symmetric] mult.commute) |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2410 |
|
56952 | 2411 |
lemma log_root: "\<lbrakk> n > 0; a > 0 \<rbrakk> \<Longrightarrow> log b (root n a) = log b a / n" |
2412 |
by(simp add: log_def ln_root) |
|
2413 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2414 |
lemma log_powr: "x \<noteq> 0 \<Longrightarrow> log b (x powr y) = y * log b x" |
56483 | 2415 |
by (simp add: log_def ln_powr) |
2416 |
||
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2417 |
lemma log_nat_power: "0 < x \<Longrightarrow> log b (x^n) = real n * log b x" |
56483 | 2418 |
by (simp add: log_powr powr_realpow [symmetric]) |
2419 |
||
2420 |
lemma log_base_change: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log b x = log a x / log a b" |
|
2421 |
by (simp add: log_def) |
|
2422 |
||
2423 |
lemma log_base_pow: "0 < a \<Longrightarrow> log (a ^ n) x = log a x / n" |
|
2424 |
by (simp add: log_def ln_realpow) |
|
2425 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2426 |
lemma log_base_powr: "a \<noteq> 0 \<Longrightarrow> log (a powr b) x = log a x / b" |
56483 | 2427 |
by (simp add: log_def ln_powr) |
51527 | 2428 |
|
56952 | 2429 |
lemma log_base_root: "\<lbrakk> n > 0; b > 0 \<rbrakk> \<Longrightarrow> log (root n b) x = n * (log b x)" |
2430 |
by(simp add: log_def ln_root) |
|
2431 |
||
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2432 |
lemma ln_bound: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2433 |
fixes x::real shows "1 <= x ==> ln x <= x" |
51527 | 2434 |
apply (subgoal_tac "ln(1 + (x - 1)) <= x - 1") |
2435 |
apply simp |
|
2436 |
apply (rule ln_add_one_self_le_self, simp) |
|
53079 | 2437 |
done |
51527 | 2438 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2439 |
lemma powr_mono: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2440 |
fixes x::real shows "a <= b ==> 1 <= x ==> x powr a <= x powr b" |
53079 | 2441 |
apply (cases "x = 1", simp) |
2442 |
apply (cases "a = b", simp) |
|
51527 | 2443 |
apply (rule order_less_imp_le) |
2444 |
apply (rule powr_less_mono, auto) |
|
53079 | 2445 |
done |
51527 | 2446 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2447 |
lemma ge_one_powr_ge_zero: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2448 |
fixes x::real shows "1 <= x ==> 0 <= a ==> 1 <= x powr a" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2449 |
using powr_mono by fastforce |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2450 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2451 |
lemma powr_less_mono2: |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2452 |
fixes x::real shows "0 < a ==> 0 \<le> x ==> x < y ==> x powr a < y powr a" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2453 |
by (simp add: powr_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2454 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2455 |
lemma powr_less_mono2_neg: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2456 |
fixes x::real shows "a < 0 ==> 0 < x ==> x < y ==> y powr a < x powr a" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2457 |
by (simp add: powr_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2458 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2459 |
lemma powr_mono2: |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2460 |
fixes x::real shows "0 <= a ==> 0 \<le> x ==> x <= y ==> x powr a <= y powr a" |
51527 | 2461 |
apply (case_tac "a = 0", simp) |
2462 |
apply (case_tac "x = y", simp) |
|
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2463 |
apply (metis dual_order.strict_iff_order powr_less_mono2) |
53079 | 2464 |
done |
2465 |
||
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2466 |
lemma powr_mono2': |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2467 |
assumes "a \<le> 0" "x > 0" "x \<le> (y::real)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2468 |
shows "x powr a \<ge> y powr a" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2469 |
proof - |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2470 |
from assms have "x powr -a \<le> y powr -a" by (intro powr_mono2) simp_all |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2471 |
with assms show ?thesis by (auto simp add: powr_minus field_simps) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2472 |
qed |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2473 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2474 |
lemma powr_inj: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2475 |
fixes x::real shows "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> a powr x = a powr y \<longleftrightarrow> x = y" |
51527 | 2476 |
unfolding powr_def exp_inj_iff by simp |
2477 |
||
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2478 |
lemma powr_half_sqrt: "0 \<le> x \<Longrightarrow> x powr (1/2) = sqrt x" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2479 |
by (simp add: powr_def root_powr_inverse sqrt_def) |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2480 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2481 |
lemma ln_powr_bound: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2482 |
fixes x::real shows "1 <= x ==> 0 < a ==> ln x <= (x powr a) / a" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2483 |
by (metis exp_gt_zero linear ln_eq_zero_iff ln_exp ln_less_self ln_powr mult.commute mult_imp_le_div_pos not_less powr_gt_zero) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2484 |
|
51527 | 2485 |
|
2486 |
lemma ln_powr_bound2: |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2487 |
fixes x::real |
51527 | 2488 |
assumes "1 < x" and "0 < a" |
2489 |
shows "(ln x) powr a <= (a powr a) * x" |
|
2490 |
proof - |
|
2491 |
from assms have "ln x <= (x powr (1 / a)) / (1 / a)" |
|
54575 | 2492 |
by (metis less_eq_real_def ln_powr_bound zero_less_divide_1_iff) |
51527 | 2493 |
also have "... = a * (x powr (1 / a))" |
2494 |
by simp |
|
2495 |
finally have "(ln x) powr a <= (a * (x powr (1 / a))) powr a" |
|
54575 | 2496 |
by (metis assms less_imp_le ln_gt_zero powr_mono2) |
51527 | 2497 |
also have "... = (a powr a) * ((x powr (1 / a)) powr a)" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2498 |
using assms powr_mult by auto |
51527 | 2499 |
also have "(x powr (1 / a)) powr a = x powr ((1 / a) * a)" |
2500 |
by (rule powr_powr) |
|
54575 | 2501 |
also have "... = x" using assms |
2502 |
by auto |
|
51527 | 2503 |
finally show ?thesis . |
2504 |
qed |
|
2505 |
||
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2506 |
lemma tendsto_powr [tendsto_intros]: |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2507 |
fixes a::real |
60141
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2508 |
assumes f: "(f ---> a) F" and g: "(g ---> b) F" and a: "a \<noteq> 0" |
833adf7db7d8
New material, mostly about limits. Consolidation.
paulson <lp15@cam.ac.uk>
parents:
60036
diff
changeset
|
2509 |
shows "((\<lambda>x. f x powr g x) ---> a powr b) F" |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2510 |
unfolding powr_def |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2511 |
proof (rule filterlim_If) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2512 |
from f show "((\<lambda>x. 0) ---> (if a = 0 then 0 else exp (b * ln a))) (inf F (principal {x. f x = 0}))" |
61810 | 2513 |
by simp (auto simp: filterlim_iff eventually_inf_principal elim: eventually_mono dest: t1_space_nhds) |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2514 |
qed (insert f g a, auto intro!: tendsto_intros intro: tendsto_mono inf_le1) |
51527 | 2515 |
|
2516 |
lemma continuous_powr: |
|
53079 | 2517 |
assumes "continuous F f" |
2518 |
and "continuous F g" |
|
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2519 |
and "f (Lim F (\<lambda>x. x)) \<noteq> 0" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2520 |
shows "continuous F (\<lambda>x. (f x) powr (g x :: real))" |
51527 | 2521 |
using assms unfolding continuous_def by (rule tendsto_powr) |
2522 |
||
2523 |
lemma continuous_at_within_powr[continuous_intros]: |
|
53079 | 2524 |
assumes "continuous (at a within s) f" |
2525 |
and "continuous (at a within s) g" |
|
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2526 |
and "f a \<noteq> 0" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2527 |
shows "continuous (at a within s) (\<lambda>x. (f x) powr (g x :: real))" |
51527 | 2528 |
using assms unfolding continuous_within by (rule tendsto_powr) |
2529 |
||
2530 |
lemma isCont_powr[continuous_intros, simp]: |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2531 |
assumes "isCont f a" "isCont g a" "f a \<noteq> (0::real)" |
51527 | 2532 |
shows "isCont (\<lambda>x. (f x) powr g x) a" |
2533 |
using assms unfolding continuous_at by (rule tendsto_powr) |
|
2534 |
||
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
2535 |
lemma continuous_on_powr[continuous_intros]: |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2536 |
assumes "continuous_on s f" "continuous_on s g" and "\<forall>x\<in>s. f x \<noteq> (0::real)" |
51527 | 2537 |
shows "continuous_on s (\<lambda>x. (f x) powr (g x))" |
2538 |
using assms unfolding continuous_on_def by (fast intro: tendsto_powr) |
|
2539 |
||
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2540 |
lemma tendsto_powr2: |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2541 |
fixes a::real |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2542 |
assumes f: "(f ---> a) F" and g: "(g ---> b) F" and f_nonneg: "\<forall>\<^sub>F x in F. 0 \<le> f x" and b: "0 < b" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2543 |
shows "((\<lambda>x. f x powr g x) ---> a powr b) F" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2544 |
unfolding powr_def |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2545 |
proof (rule filterlim_If) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2546 |
from f show "((\<lambda>x. 0) ---> (if a = 0 then 0 else exp (b * ln a))) (inf F (principal {x. f x = 0}))" |
61810 | 2547 |
by simp (auto simp: filterlim_iff eventually_inf_principal elim: eventually_mono dest: t1_space_nhds) |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2548 |
next |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2549 |
{ assume "a = 0" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2550 |
with f f_nonneg have "LIM x inf F (principal {x. f x \<noteq> 0}). f x :> at_right 0" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2551 |
by (auto simp add: filterlim_at eventually_inf_principal le_less |
61810 | 2552 |
elim: eventually_mono intro: tendsto_mono inf_le1) |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2553 |
then have "((\<lambda>x. exp (g x * ln (f x))) ---> 0) (inf F (principal {x. f x \<noteq> 0}))" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2554 |
by (auto intro!: filterlim_compose[OF exp_at_bot] filterlim_compose[OF ln_at_0] |
60758 | 2555 |
filterlim_tendsto_pos_mult_at_bot[OF _ \<open>0 < b\<close>] |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2556 |
intro: tendsto_mono inf_le1 g) } |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2557 |
then show "((\<lambda>x. exp (g x * ln (f x))) ---> (if a = 0 then 0 else exp (b * ln a))) (inf F (principal {x. f x \<noteq> 0}))" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2558 |
using f g by (auto intro!: tendsto_intros intro: tendsto_mono inf_le1) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2559 |
qed |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2560 |
|
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2561 |
lemma DERIV_powr: |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2562 |
fixes r::real |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2563 |
assumes g: "DERIV g x :> m" and pos: "g x > 0" and f: "DERIV f x :> r" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2564 |
shows "DERIV (\<lambda>x. g x powr f x) x :> (g x powr f x) * (r * ln (g x) + m * f x / g x)" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2565 |
proof - |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2566 |
have "DERIV (\<lambda>x. exp (f x * ln (g x))) x :> (g x powr f x) * (r * ln (g x) + m * f x / g x)" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2567 |
using pos |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2568 |
by (auto intro!: derivative_eq_intros g pos f simp: powr_def field_simps exp_diff) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2569 |
then show ?thesis |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2570 |
proof (rule DERIV_cong_ev[OF refl _ refl, THEN iffD1, rotated]) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2571 |
from DERIV_isCont[OF g] pos have "\<forall>\<^sub>F x in at x. 0 < g x" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2572 |
unfolding isCont_def by (rule order_tendstoD(1)) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2573 |
with pos show "\<forall>\<^sub>F x in nhds x. exp (f x * ln (g x)) = g x powr f x" |
61810 | 2574 |
by (auto simp: eventually_at_filter powr_def elim: eventually_mono) |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2575 |
qed |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2576 |
qed |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2577 |
|
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2578 |
lemma DERIV_fun_powr: |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2579 |
fixes r::real |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2580 |
assumes g: "DERIV g x :> m" and pos: "g x > 0" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2581 |
shows "DERIV (\<lambda>x. (g x) powr r) x :> r * (g x) powr (r - of_nat 1) * m" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2582 |
using DERIV_powr[OF g pos DERIV_const, of r] pos |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2583 |
by (simp add: powr_divide2[symmetric] field_simps) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2584 |
|
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2585 |
lemma has_real_derivative_powr: |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2586 |
assumes "z > 0" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2587 |
shows "((\<lambda>z. z powr r) has_real_derivative r * z powr (r - 1)) (at z)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2588 |
proof (subst DERIV_cong_ev[OF refl _ refl]) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2589 |
from assms have "eventually (\<lambda>z. z \<noteq> 0) (nhds z)" by (intro t1_space_nhds) auto |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2590 |
thus "eventually (\<lambda>z. z powr r = exp (r * ln z)) (nhds z)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2591 |
unfolding powr_def by eventually_elim simp |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2592 |
from assms show "((\<lambda>z. exp (r * ln z)) has_real_derivative r * z powr (r - 1)) (at z)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2593 |
by (auto intro!: derivative_eq_intros simp: powr_def field_simps exp_diff) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2594 |
qed |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2595 |
|
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2596 |
declare has_real_derivative_powr[THEN DERIV_chain2, derivative_intros] |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61518
diff
changeset
|
2597 |
|
51527 | 2598 |
lemma tendsto_zero_powrI: |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2599 |
assumes "(f ---> (0::real)) F" "(g ---> b) F" "\<forall>\<^sub>F x in F. 0 \<le> f x" "0 < b" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2600 |
shows "((\<lambda>x. f x powr g x) ---> 0) F" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2601 |
using tendsto_powr2[OF assms] by simp |
51527 | 2602 |
|
2603 |
lemma tendsto_neg_powr: |
|
53079 | 2604 |
assumes "s < 0" |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2605 |
and f: "LIM x F. f x :> at_top" |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2606 |
shows "((\<lambda>x. f x powr s) ---> (0::real)) F" |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2607 |
proof - |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2608 |
have "((\<lambda>x. exp (s * ln (f x))) ---> (0::real)) F" (is "?X") |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2609 |
by (auto intro!: filterlim_compose[OF exp_at_bot] filterlim_compose[OF ln_at_top] |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2610 |
filterlim_tendsto_neg_mult_at_bot assms) |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2611 |
also have "?X \<longleftrightarrow> ((\<lambda>x. f x powr s) ---> (0::real)) F" |
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2612 |
using f filterlim_at_top_dense[of f F] |
61810 | 2613 |
by (intro filterlim_cong[OF refl refl]) (auto simp: neq_iff powr_def elim: eventually_mono) |
60182
e1ea5a6379c9
generalized tends over powr; added DERIV rule for powr
hoelzl
parents:
60162
diff
changeset
|
2614 |
finally show ?thesis . |
51527 | 2615 |
qed |
2616 |
||
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2617 |
lemma tendsto_exp_limit_at_right: |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2618 |
fixes x :: real |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2619 |
shows "((\<lambda>y. (1 + x * y) powr (1 / y)) ---> exp x) (at_right 0)" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2620 |
proof cases |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2621 |
assume "x \<noteq> 0" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2622 |
have "((\<lambda>y. ln (1 + x * y)::real) has_real_derivative 1 * x) (at 0)" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2623 |
by (auto intro!: derivative_eq_intros) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2624 |
then have "((\<lambda>y. ln (1 + x * y) / y) ---> x) (at 0)" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2625 |
by (auto simp add: has_field_derivative_def field_has_derivative_at) |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2626 |
then have *: "((\<lambda>y. exp (ln (1 + x * y) / y)) ---> exp x) (at 0)" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2627 |
by (rule tendsto_intros) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2628 |
then show ?thesis |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2629 |
proof (rule filterlim_mono_eventually) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2630 |
show "eventually (\<lambda>xa. exp (ln (1 + x * xa) / xa) = (1 + x * xa) powr (1 / xa)) (at_right 0)" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2631 |
unfolding eventually_at_right[OF zero_less_one] |
60758 | 2632 |
using \<open>x \<noteq> 0\<close> |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2633 |
apply (intro exI[of _ "1 / \<bar>x\<bar>"]) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2634 |
apply (auto simp: field_simps powr_def abs_if) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
2635 |
by (metis add_less_same_cancel1 mult_less_0_iff not_less_iff_gr_or_eq zero_less_one) |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2636 |
qed (simp_all add: at_eq_sup_left_right) |
58729
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents:
58710
diff
changeset
|
2637 |
qed simp |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2638 |
|
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2639 |
lemma tendsto_exp_limit_at_top: |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2640 |
fixes x :: real |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2641 |
shows "((\<lambda>y. (1 + x / y) powr y) ---> exp x) at_top" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2642 |
apply (subst filterlim_at_top_to_right) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2643 |
apply (simp add: inverse_eq_divide) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2644 |
apply (rule tendsto_exp_limit_at_right) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2645 |
done |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2646 |
|
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2647 |
lemma tendsto_exp_limit_sequentially: |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2648 |
fixes x :: real |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2649 |
shows "(\<lambda>n. (1 + x / n) ^ n) ----> exp x" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2650 |
proof (rule filterlim_mono_eventually) |
61944 | 2651 |
from reals_Archimedean2 [of "\<bar>x\<bar>"] obtain n :: nat where *: "real n > \<bar>x\<bar>" .. |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2652 |
hence "eventually (\<lambda>n :: nat. 0 < 1 + x / real n) at_top" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2653 |
apply (intro eventually_sequentiallyI [of n]) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2654 |
apply (case_tac "x \<ge> 0") |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2655 |
apply (rule add_pos_nonneg, auto intro: divide_nonneg_nonneg) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2656 |
apply (subgoal_tac "x / real xa > -1") |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2657 |
apply (auto simp add: field_simps) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2658 |
done |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2659 |
then show "eventually (\<lambda>n. (1 + x / n) powr n = (1 + x / n) ^ n) at_top" |
61810 | 2660 |
by (rule eventually_mono) (erule powr_realpow) |
57275
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2661 |
show "(\<lambda>n. (1 + x / real n) powr real n) ----> exp x" |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2662 |
by (rule filterlim_compose [OF tendsto_exp_limit_at_top filterlim_real_sequentially]) |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2663 |
qed auto |
0ddb5b755cdc
moved lemmas from the proof of the Central Limit Theorem by Jeremy Avigad and Luke Serafin
hoelzl
parents:
57180
diff
changeset
|
2664 |
|
60758 | 2665 |
subsection \<open>Sine and Cosine\<close> |
29164 | 2666 |
|
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
2667 |
definition sin_coeff :: "nat \<Rightarrow> real" where |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2668 |
"sin_coeff = (\<lambda>n. if even n then 0 else (- 1) ^ ((n - Suc 0) div 2) / (fact n))" |
31271 | 2669 |
|
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
2670 |
definition cos_coeff :: "nat \<Rightarrow> real" where |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2671 |
"cos_coeff = (\<lambda>n. if even n then ((- 1) ^ (n div 2)) / (fact n) else 0)" |
31271 | 2672 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2673 |
definition sin :: "'a \<Rightarrow> 'a::{real_normed_algebra_1,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2674 |
where "sin = (\<lambda>x. \<Sum>n. sin_coeff n *\<^sub>R x^n)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2675 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2676 |
definition cos :: "'a \<Rightarrow> 'a::{real_normed_algebra_1,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2677 |
where "cos = (\<lambda>x. \<Sum>n. cos_coeff n *\<^sub>R x^n)" |
31271 | 2678 |
|
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2679 |
lemma sin_coeff_0 [simp]: "sin_coeff 0 = 0" |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2680 |
unfolding sin_coeff_def by simp |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2681 |
|
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2682 |
lemma cos_coeff_0 [simp]: "cos_coeff 0 = 1" |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2683 |
unfolding cos_coeff_def by simp |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2684 |
|
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2685 |
lemma sin_coeff_Suc: "sin_coeff (Suc n) = cos_coeff n / real (Suc n)" |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2686 |
unfolding cos_coeff_def sin_coeff_def |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2687 |
by (simp del: mult_Suc) |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2688 |
|
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2689 |
lemma cos_coeff_Suc: "cos_coeff (Suc n) = - sin_coeff n / real (Suc n)" |
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2690 |
unfolding cos_coeff_def sin_coeff_def |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
2691 |
by (simp del: mult_Suc) (auto elim: oddE) |
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2692 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2693 |
lemma summable_norm_sin: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2694 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2695 |
shows "summable (\<lambda>n. norm (sin_coeff n *\<^sub>R x^n))" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2696 |
unfolding sin_coeff_def |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2697 |
apply (rule summable_comparison_test [OF _ summable_norm_exp [where x=x]]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2698 |
apply (auto simp: divide_inverse abs_mult power_abs [symmetric] zero_le_mult_iff) |
53079 | 2699 |
done |
29164 | 2700 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2701 |
lemma summable_norm_cos: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2702 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2703 |
shows "summable (\<lambda>n. norm (cos_coeff n *\<^sub>R x^n))" |
53079 | 2704 |
unfolding cos_coeff_def |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2705 |
apply (rule summable_comparison_test [OF _ summable_norm_exp [where x=x]]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2706 |
apply (auto simp: divide_inverse abs_mult power_abs [symmetric] zero_le_mult_iff) |
53079 | 2707 |
done |
29164 | 2708 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2709 |
lemma sin_converges: "(\<lambda>n. sin_coeff n *\<^sub>R x^n) sums sin(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2710 |
unfolding sin_def |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2711 |
by (metis (full_types) summable_norm_cancel summable_norm_sin summable_sums) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2712 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2713 |
lemma cos_converges: "(\<lambda>n. cos_coeff n *\<^sub>R x^n) sums cos(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2714 |
unfolding cos_def |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2715 |
by (metis (full_types) summable_norm_cancel summable_norm_cos summable_sums) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2716 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2717 |
lemma sin_of_real: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2718 |
fixes x::real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2719 |
shows "sin (of_real x) = of_real (sin x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2720 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2721 |
have "(\<lambda>n. of_real (sin_coeff n *\<^sub>R x^n)) = (\<lambda>n. sin_coeff n *\<^sub>R (of_real x)^n)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2722 |
proof |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2723 |
fix n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2724 |
show "of_real (sin_coeff n *\<^sub>R x^n) = sin_coeff n *\<^sub>R of_real x^n" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2725 |
by (simp add: scaleR_conv_of_real) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2726 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2727 |
also have "... sums (sin (of_real x))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2728 |
by (rule sin_converges) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2729 |
finally have "(\<lambda>n. of_real (sin_coeff n *\<^sub>R x^n)) sums (sin (of_real x))" . |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2730 |
then show ?thesis |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2731 |
using sums_unique2 sums_of_real [OF sin_converges] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2732 |
by blast |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2733 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2734 |
|
59862 | 2735 |
corollary sin_in_Reals [simp]: "z \<in> \<real> \<Longrightarrow> sin z \<in> \<real>" |
2736 |
by (metis Reals_cases Reals_of_real sin_of_real) |
|
2737 |
||
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2738 |
lemma cos_of_real: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2739 |
fixes x::real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2740 |
shows "cos (of_real x) = of_real (cos x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2741 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2742 |
have "(\<lambda>n. of_real (cos_coeff n *\<^sub>R x^n)) = (\<lambda>n. cos_coeff n *\<^sub>R (of_real x)^n)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2743 |
proof |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2744 |
fix n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2745 |
show "of_real (cos_coeff n *\<^sub>R x^n) = cos_coeff n *\<^sub>R of_real x^n" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2746 |
by (simp add: scaleR_conv_of_real) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2747 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2748 |
also have "... sums (cos (of_real x))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2749 |
by (rule cos_converges) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2750 |
finally have "(\<lambda>n. of_real (cos_coeff n *\<^sub>R x^n)) sums (cos (of_real x))" . |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2751 |
then show ?thesis |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2752 |
using sums_unique2 sums_of_real [OF cos_converges] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2753 |
by blast |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2754 |
qed |
29164 | 2755 |
|
59862 | 2756 |
corollary cos_in_Reals [simp]: "z \<in> \<real> \<Longrightarrow> cos z \<in> \<real>" |
2757 |
by (metis Reals_cases Reals_of_real cos_of_real) |
|
2758 |
||
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2759 |
lemma diffs_sin_coeff: "diffs sin_coeff = cos_coeff" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2760 |
by (simp add: diffs_def sin_coeff_Suc del: of_nat_Suc) |
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2761 |
|
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2762 |
lemma diffs_cos_coeff: "diffs cos_coeff = (\<lambda>n. - sin_coeff n)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2763 |
by (simp add: diffs_def cos_coeff_Suc del: of_nat_Suc) |
29164 | 2764 |
|
60758 | 2765 |
text\<open>Now at last we can get the derivatives of exp, sin and cos\<close> |
29164 | 2766 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2767 |
lemma DERIV_sin [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2768 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2769 |
shows "DERIV sin x :> cos(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2770 |
unfolding sin_def cos_def scaleR_conv_of_real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2771 |
apply (rule DERIV_cong) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2772 |
apply (rule termdiffs [where K="of_real (norm x) + 1 :: 'a"]) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2773 |
apply (simp_all add: norm_less_p1 diffs_of_real diffs_sin_coeff diffs_cos_coeff |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2774 |
summable_minus_iff scaleR_conv_of_real [symmetric] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2775 |
summable_norm_sin [THEN summable_norm_cancel] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2776 |
summable_norm_cos [THEN summable_norm_cancel]) |
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2777 |
done |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2778 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2779 |
declare DERIV_sin[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
2780 |
DERIV_sin[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
51527 | 2781 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2782 |
lemma DERIV_cos [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2783 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2784 |
shows "DERIV cos x :> -sin(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2785 |
unfolding sin_def cos_def scaleR_conv_of_real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2786 |
apply (rule DERIV_cong) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2787 |
apply (rule termdiffs [where K="of_real (norm x) + 1 :: 'a"]) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2788 |
apply (simp_all add: norm_less_p1 diffs_of_real diffs_minus suminf_minus |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2789 |
diffs_sin_coeff diffs_cos_coeff |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2790 |
summable_minus_iff scaleR_conv_of_real [symmetric] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2791 |
summable_norm_sin [THEN summable_norm_cancel] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2792 |
summable_norm_cos [THEN summable_norm_cancel]) |
44319
806e0390de53
move sin_coeff and cos_coeff lemmas to Transcendental.thy; simplify some proofs
huffman
parents:
44318
diff
changeset
|
2793 |
done |
29164 | 2794 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2795 |
declare DERIV_cos[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
2796 |
DERIV_cos[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
51527 | 2797 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2798 |
lemma isCont_sin: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2799 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2800 |
shows "isCont sin x" |
44311 | 2801 |
by (rule DERIV_sin [THEN DERIV_isCont]) |
2802 |
||
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2803 |
lemma isCont_cos: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2804 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2805 |
shows "isCont cos x" |
44311 | 2806 |
by (rule DERIV_cos [THEN DERIV_isCont]) |
2807 |
||
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2808 |
lemma isCont_sin' [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2809 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2810 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. sin (f x)) a" |
44311 | 2811 |
by (rule isCont_o2 [OF _ isCont_sin]) |
2812 |
||
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2813 |
(*FIXME A CONTEXT FOR F WOULD BE BETTER*) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2814 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2815 |
lemma isCont_cos' [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2816 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2817 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. cos (f x)) a" |
44311 | 2818 |
by (rule isCont_o2 [OF _ isCont_cos]) |
2819 |
||
2820 |
lemma tendsto_sin [tendsto_intros]: |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2821 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2822 |
shows "(f ---> a) F \<Longrightarrow> ((\<lambda>x. sin (f x)) ---> sin a) F" |
44311 | 2823 |
by (rule isCont_tendsto_compose [OF isCont_sin]) |
2824 |
||
2825 |
lemma tendsto_cos [tendsto_intros]: |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2826 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2827 |
shows "(f ---> a) F \<Longrightarrow> ((\<lambda>x. cos (f x)) ---> cos a) F" |
44311 | 2828 |
by (rule isCont_tendsto_compose [OF isCont_cos]) |
29164 | 2829 |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2830 |
lemma continuous_sin [continuous_intros]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2831 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2832 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. sin (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2833 |
unfolding continuous_def by (rule tendsto_sin) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2834 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
2835 |
lemma continuous_on_sin [continuous_intros]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2836 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2837 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. sin (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2838 |
unfolding continuous_on_def by (auto intro: tendsto_sin) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2839 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2840 |
lemma continuous_within_sin: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2841 |
fixes z :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2842 |
shows "continuous (at z within s) sin" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2843 |
by (simp add: continuous_within tendsto_sin) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2844 |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2845 |
lemma continuous_cos [continuous_intros]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2846 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2847 |
shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. cos (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2848 |
unfolding continuous_def by (rule tendsto_cos) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2849 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
2850 |
lemma continuous_on_cos [continuous_intros]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2851 |
fixes f:: "_ \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2852 |
shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. cos (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2853 |
unfolding continuous_on_def by (auto intro: tendsto_cos) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
2854 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2855 |
lemma continuous_within_cos: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2856 |
fixes z :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2857 |
shows "continuous (at z within s) cos" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2858 |
by (simp add: continuous_within tendsto_cos) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2859 |
|
60758 | 2860 |
subsection \<open>Properties of Sine and Cosine\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
2861 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
2862 |
lemma sin_zero [simp]: "sin 0 = 0" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2863 |
unfolding sin_def sin_coeff_def by (simp add: scaleR_conv_of_real powser_zero) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
2864 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
2865 |
lemma cos_zero [simp]: "cos 0 = 1" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2866 |
unfolding cos_def cos_coeff_def by (simp add: scaleR_conv_of_real powser_zero) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2867 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2868 |
lemma DERIV_fun_sin: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2869 |
"DERIV g x :> m \<Longrightarrow> DERIV (\<lambda>x. sin(g x)) x :> cos(g x) * m" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2870 |
by (auto intro!: derivative_intros) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2871 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2872 |
lemma DERIV_fun_cos: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2873 |
"DERIV g x :> m \<Longrightarrow> DERIV (\<lambda>x. cos(g x)) x :> -sin(g x) * m" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2874 |
by (auto intro!: derivative_eq_intros) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2875 |
|
60758 | 2876 |
subsection \<open>Deriving the Addition Formulas\<close> |
2877 |
||
2878 |
text\<open>The the product of two cosine series\<close> |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2879 |
lemma cos_x_cos_y: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2880 |
fixes x :: "'a::{real_normed_field,banach}" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2881 |
shows "(\<lambda>p. \<Sum>n\<le>p. |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2882 |
if even p \<and> even n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2883 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2884 |
sums (cos x * cos y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2885 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2886 |
{ fix n p::nat |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2887 |
assume "n\<le>p" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2888 |
then have *: "even n \<Longrightarrow> even p \<Longrightarrow> (-1) ^ (n div 2) * (-1) ^ ((p - n) div 2) = (-1 :: real) ^ (p div 2)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2889 |
by (metis div_add power_add le_add_diff_inverse odd_add) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2890 |
have "(cos_coeff n * cos_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)) = |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2891 |
(if even p \<and> even n then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0)" |
60758 | 2892 |
using \<open>n\<le>p\<close> |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2893 |
by (auto simp: * algebra_simps cos_coeff_def binomial_fact) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2894 |
} |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2895 |
then have "(\<lambda>p. \<Sum>n\<le>p. if even p \<and> even n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2896 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) = |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2897 |
(\<lambda>p. \<Sum>n\<le>p. (cos_coeff n * cos_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2898 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2899 |
also have "... = (\<lambda>p. \<Sum>n\<le>p. (cos_coeff n *\<^sub>R x^n) * (cos_coeff (p - n) *\<^sub>R y^(p-n)))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2900 |
by (simp add: algebra_simps) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2901 |
also have "... sums (cos x * cos y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2902 |
using summable_norm_cos |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2903 |
by (auto simp: cos_def scaleR_conv_of_real intro!: Cauchy_product_sums) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2904 |
finally show ?thesis . |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2905 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2906 |
|
60758 | 2907 |
text\<open>The product of two sine series\<close> |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2908 |
lemma sin_x_sin_y: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2909 |
fixes x :: "'a::{real_normed_field,banach}" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2910 |
shows "(\<lambda>p. \<Sum>n\<le>p. |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2911 |
if even p \<and> odd n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2912 |
then - ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2913 |
sums (sin x * sin y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2914 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2915 |
{ fix n p::nat |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2916 |
assume "n\<le>p" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2917 |
{ assume np: "odd n" "even p" |
60758 | 2918 |
with \<open>n\<le>p\<close> have "n - Suc 0 + (p - Suc n) = p - Suc (Suc 0)" "Suc (Suc 0) \<le> p" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2919 |
by arith+ |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2920 |
moreover have "(p - Suc (Suc 0)) div 2 = p div 2 - Suc 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2921 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2922 |
ultimately have *: "(-1) ^ ((n - Suc 0) div 2) * (-1) ^ ((p - Suc n) div 2) = - ((-1 :: real) ^ (p div 2))" |
60758 | 2923 |
using np \<open>n\<le>p\<close> |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2924 |
apply (simp add: power_add [symmetric] div_add [symmetric] del: div_add) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2925 |
apply (metis (no_types) One_nat_def Suc_1 le_div_geq minus_minus mult.left_neutral mult_minus_left power.simps(2) zero_less_Suc) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2926 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2927 |
} then |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2928 |
have "(sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)) = |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2929 |
(if even p \<and> odd n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2930 |
then -((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0)" |
60758 | 2931 |
using \<open>n\<le>p\<close> |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2932 |
by (auto simp: algebra_simps sin_coeff_def binomial_fact) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2933 |
} |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2934 |
then have "(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2935 |
then - ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) = |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2936 |
(\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2937 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2938 |
also have "... = (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n *\<^sub>R x^n) * (sin_coeff (p - n) *\<^sub>R y^(p-n)))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2939 |
by (simp add: algebra_simps) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2940 |
also have "... sums (sin x * sin y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2941 |
using summable_norm_sin |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2942 |
by (auto simp: sin_def scaleR_conv_of_real intro!: Cauchy_product_sums) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2943 |
finally show ?thesis . |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2944 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2945 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2946 |
lemma sums_cos_x_plus_y: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2947 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2948 |
shows |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2949 |
"(\<lambda>p. \<Sum>n\<le>p. if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2950 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2951 |
else 0) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2952 |
sums cos (x + y)" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
2953 |
proof - |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2954 |
{ fix p::nat |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2955 |
have "(\<Sum>n\<le>p. if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2956 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2957 |
else 0) = |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2958 |
(if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2959 |
then \<Sum>n\<le>p. ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2960 |
else 0)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2961 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2962 |
also have "... = (if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2963 |
then of_real ((-1) ^ (p div 2) / (fact p)) * (\<Sum>n\<le>p. (p choose n) *\<^sub>R (x^n) * y^(p-n)) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2964 |
else 0)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2965 |
by (auto simp: setsum_right_distrib field_simps scaleR_conv_of_real nonzero_of_real_divide) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2966 |
also have "... = cos_coeff p *\<^sub>R ((x + y) ^ p)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
2967 |
by (simp add: cos_coeff_def binomial_ring [of x y] scaleR_conv_of_real atLeast0AtMost) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2968 |
finally have "(\<Sum>n\<le>p. if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2969 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2970 |
else 0) = cos_coeff p *\<^sub>R ((x + y) ^ p)" . |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2971 |
} |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2972 |
then have "(\<lambda>p. \<Sum>n\<le>p. |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2973 |
if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2974 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2975 |
else 0) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2976 |
= (\<lambda>p. cos_coeff p *\<^sub>R ((x+y)^p))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2977 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2978 |
also have "... sums cos (x + y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2979 |
by (rule cos_converges) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2980 |
finally show ?thesis . |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2981 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2982 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2983 |
theorem cos_add: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2984 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2985 |
shows "cos (x + y) = cos x * cos y - sin x * sin y" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2986 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2987 |
{ fix n p::nat |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2988 |
assume "n\<le>p" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2989 |
then have "(if even p \<and> even n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2990 |
then ((- 1) ^ (p div 2) * int (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) - |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2991 |
(if even p \<and> odd n |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2992 |
then - ((- 1) ^ (p div 2) * int (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2993 |
= (if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2994 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0)" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2995 |
by simp |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2996 |
} |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
2997 |
then have "(\<lambda>p. \<Sum>n\<le>p. (if even p |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
2998 |
then ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0)) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
2999 |
sums (cos x * cos y - sin x * sin y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3000 |
using sums_diff [OF cos_x_cos_y [of x y] sin_x_sin_y [of x y]] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3001 |
by (simp add: setsum_subtractf [symmetric]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3002 |
then show ?thesis |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3003 |
by (blast intro: sums_cos_x_plus_y sums_unique2) |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3004 |
qed |
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3005 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3006 |
lemma sin_minus_converges: "(\<lambda>n. - (sin_coeff n *\<^sub>R (-x)^n)) sums sin(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3007 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3008 |
have [simp]: "\<And>n. - (sin_coeff n *\<^sub>R (-x)^n) = (sin_coeff n *\<^sub>R x^n)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3009 |
by (auto simp: sin_coeff_def elim!: oddE) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3010 |
show ?thesis |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3011 |
by (simp add: sin_def summable_norm_sin [THEN summable_norm_cancel, THEN summable_sums]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3012 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3013 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3014 |
lemma sin_minus [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3015 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3016 |
shows "sin (-x) = -sin(x)" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3017 |
using sin_minus_converges [of x] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3018 |
by (auto simp: sin_def summable_norm_sin [THEN summable_norm_cancel] suminf_minus sums_iff equation_minus_iff) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3019 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3020 |
lemma cos_minus_converges: "(\<lambda>n. (cos_coeff n *\<^sub>R (-x)^n)) sums cos(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3021 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3022 |
have [simp]: "\<And>n. (cos_coeff n *\<^sub>R (-x)^n) = (cos_coeff n *\<^sub>R x^n)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3023 |
by (auto simp: Transcendental.cos_coeff_def elim!: evenE) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3024 |
show ?thesis |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3025 |
by (simp add: cos_def summable_norm_cos [THEN summable_norm_cancel, THEN summable_sums]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3026 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3027 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3028 |
lemma cos_minus [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3029 |
fixes x :: "'a::{real_normed_algebra_1,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3030 |
shows "cos (-x) = cos(x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3031 |
using cos_minus_converges [of x] |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3032 |
by (simp add: cos_def summable_norm_cos [THEN summable_norm_cancel] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3033 |
suminf_minus sums_iff equation_minus_iff) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3034 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3035 |
lemma sin_cos_squared_add [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3036 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3037 |
shows "(sin x)\<^sup>2 + (cos x)\<^sup>2 = 1" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3038 |
using cos_add [of x "-x"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3039 |
by (simp add: power2_eq_square algebra_simps) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3040 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3041 |
lemma sin_cos_squared_add2 [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3042 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3043 |
shows "(cos x)\<^sup>2 + (sin x)\<^sup>2 = 1" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
3044 |
by (subst add.commute, rule sin_cos_squared_add) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3045 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3046 |
lemma sin_cos_squared_add3 [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3047 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3048 |
shows "cos x * cos x + sin x * sin x = 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3049 |
using sin_cos_squared_add2 [unfolded power2_eq_square] . |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3050 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3051 |
lemma sin_squared_eq: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3052 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3053 |
shows "(sin x)\<^sup>2 = 1 - (cos x)\<^sup>2" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3054 |
unfolding eq_diff_eq by (rule sin_cos_squared_add) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3055 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3056 |
lemma cos_squared_eq: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3057 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3058 |
shows "(cos x)\<^sup>2 = 1 - (sin x)\<^sup>2" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3059 |
unfolding eq_diff_eq by (rule sin_cos_squared_add2) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3060 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3061 |
lemma abs_sin_le_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3062 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3063 |
shows "\<bar>sin x\<bar> \<le> 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3064 |
by (rule power2_le_imp_le, simp_all add: sin_squared_eq) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3065 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3066 |
lemma sin_ge_minus_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3067 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3068 |
shows "-1 \<le> sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3069 |
using abs_sin_le_one [of x] unfolding abs_le_iff by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3070 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3071 |
lemma sin_le_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3072 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3073 |
shows "sin x \<le> 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3074 |
using abs_sin_le_one [of x] unfolding abs_le_iff by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3075 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3076 |
lemma abs_cos_le_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3077 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3078 |
shows "\<bar>cos x\<bar> \<le> 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3079 |
by (rule power2_le_imp_le, simp_all add: cos_squared_eq) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3080 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3081 |
lemma cos_ge_minus_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3082 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3083 |
shows "-1 \<le> cos x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3084 |
using abs_cos_le_one [of x] unfolding abs_le_iff by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3085 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3086 |
lemma cos_le_one [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3087 |
fixes x :: real |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3088 |
shows "cos x \<le> 1" |
44308
d2a6f9af02f4
Transcendental.thy: remove several unused lemmas and simplify some proofs
huffman
parents:
44307
diff
changeset
|
3089 |
using abs_cos_le_one [of x] unfolding abs_le_iff by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3090 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3091 |
lemma cos_diff: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3092 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3093 |
shows "cos (x - y) = cos x * cos y + sin x * sin y" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3094 |
using cos_add [of x "- y"] by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3095 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3096 |
lemma cos_double: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3097 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3098 |
shows "cos(2*x) = (cos x)\<^sup>2 - (sin x)\<^sup>2" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3099 |
using cos_add [where x=x and y=x] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3100 |
by (simp add: power2_eq_square) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3101 |
|
61762
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
3102 |
lemma sin_cos_le1: |
61944 | 3103 |
fixes x::real shows "\<bar>sin x * sin y + cos x * cos y\<bar> \<le> 1" |
61762
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
3104 |
using cos_diff [of x y] |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
3105 |
by (metis abs_cos_le_one add.commute) |
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61738
diff
changeset
|
3106 |
|
41970 | 3107 |
lemma DERIV_fun_pow: "DERIV g x :> m ==> |
53079 | 3108 |
DERIV (\<lambda>x. (g x) ^ n) x :> real n * (g x) ^ (n - 1) * m" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3109 |
by (auto intro!: derivative_eq_intros simp:) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3110 |
|
15229 | 3111 |
lemma DERIV_fun_exp: |
53079 | 3112 |
"DERIV g x :> m ==> DERIV (\<lambda>x. exp(g x)) x :> exp(g x) * m" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
3113 |
by (auto intro!: derivative_intros) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3114 |
|
60758 | 3115 |
subsection \<open>The Constant Pi\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3116 |
|
53079 | 3117 |
definition pi :: real |
3118 |
where "pi = 2 * (THE x. 0 \<le> (x::real) & x \<le> 2 & cos x = 0)" |
|
23043 | 3119 |
|
60758 | 3120 |
text\<open>Show that there's a least positive @{term x} with @{term "cos(x) = 0"}; |
3121 |
hence define pi.\<close> |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3122 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3123 |
lemma sin_paired: |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3124 |
fixes x :: real |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3125 |
shows "(\<lambda>n. (- 1) ^ n / (fact (2 * n + 1)) * x ^ (2 * n + 1)) sums sin x" |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3126 |
proof - |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3127 |
have "(\<lambda>n. \<Sum>k = n*2..<n * 2 + 2. sin_coeff k * x ^ k) sums sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3128 |
apply (rule sums_group) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3129 |
using sin_converges [of x, unfolded scaleR_conv_of_real] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3130 |
by auto |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
3131 |
thus ?thesis unfolding One_nat_def sin_coeff_def by (simp add: ac_simps) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3132 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3133 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3134 |
lemma sin_gt_zero_02: |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3135 |
fixes x :: real |
53079 | 3136 |
assumes "0 < x" and "x < 2" |
3137 |
shows "0 < sin x" |
|
44728 | 3138 |
proof - |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3139 |
let ?f = "\<lambda>n::nat. \<Sum>k = n*2..<n*2+2. (- 1) ^ k / (fact (2*k+1)) * x^(2*k+1)" |
44728 | 3140 |
have pos: "\<forall>n. 0 < ?f n" |
3141 |
proof |
|
3142 |
fix n :: nat |
|
3143 |
let ?k2 = "real (Suc (Suc (4 * n)))" |
|
3144 |
let ?k3 = "real (Suc (Suc (Suc (4 * n))))" |
|
3145 |
have "x * x < ?k2 * ?k3" |
|
3146 |
using assms by (intro mult_strict_mono', simp_all) |
|
3147 |
hence "x * x * x * x ^ (n * 4) < ?k2 * ?k3 * x * x ^ (n * 4)" |
|
60758 | 3148 |
by (intro mult_strict_right_mono zero_less_power \<open>0 < x\<close>) |
44728 | 3149 |
thus "0 < ?f n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3150 |
by (simp add: divide_simps mult_ac del: mult_Suc) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3151 |
qed |
44728 | 3152 |
have sums: "?f sums sin x" |
3153 |
by (rule sin_paired [THEN sums_group], simp) |
|
3154 |
show "0 < sin x" |
|
3155 |
unfolding sums_unique [OF sums] |
|
3156 |
using sums_summable [OF sums] pos |
|
56213 | 3157 |
by (rule suminf_pos) |
44728 | 3158 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3159 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3160 |
lemma cos_double_less_one: |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3161 |
fixes x :: real |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3162 |
shows "0 < x \<Longrightarrow> x < 2 \<Longrightarrow> cos (2 * x) < 1" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3163 |
using sin_gt_zero_02 [where x = x] by (auto simp: cos_squared_eq cos_double) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3164 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3165 |
lemma cos_paired: |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3166 |
fixes x :: real |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3167 |
shows "(\<lambda>n. (- 1) ^ n / (fact (2 * n)) * x ^ (2 * n)) sums cos x" |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3168 |
proof - |
31271 | 3169 |
have "(\<lambda>n. \<Sum>k = n * 2..<n * 2 + 2. cos_coeff k * x ^ k) sums cos x" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3170 |
apply (rule sums_group) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3171 |
using cos_converges [of x, unfolded scaleR_conv_of_real] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3172 |
by auto |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
3173 |
thus ?thesis unfolding cos_coeff_def by (simp add: ac_simps) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3174 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3175 |
|
53602 | 3176 |
lemmas realpow_num_eq_if = power_eq_if |
3177 |
||
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3178 |
lemma sumr_pos_lt_pair: |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3179 |
fixes f :: "nat \<Rightarrow> real" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3180 |
shows "\<lbrakk>summable f; |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3181 |
\<And>d. 0 < f (k + (Suc(Suc 0) * d)) + f (k + ((Suc(Suc 0) * d) + 1))\<rbrakk> |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3182 |
\<Longrightarrow> setsum f {..<k} < suminf f" |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3183 |
unfolding One_nat_def |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3184 |
apply (subst suminf_split_initial_segment [where k=k], assumption, simp) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3185 |
apply (drule_tac k=k in summable_ignore_initial_segment) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3186 |
apply (drule_tac k="Suc (Suc 0)" in sums_group [OF summable_sums], simp) |
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3187 |
apply simp |
60162 | 3188 |
by (metis (no_types, lifting) add.commute suminf_pos summable_def sums_unique) |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
3189 |
|
53602 | 3190 |
lemma cos_two_less_zero [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3191 |
"cos 2 < (0::real)" |
53602 | 3192 |
proof - |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3193 |
note fact.simps(2) [simp del] |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3194 |
from sums_minus [OF cos_paired] |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3195 |
have *: "(\<lambda>n. - ((- 1) ^ n * 2 ^ (2 * n) / fact (2 * n))) sums - cos (2::real)" |
53602 | 3196 |
by simp |
60162 | 3197 |
then have sm: "summable (\<lambda>n. - ((- 1::real) ^ n * 2 ^ (2 * n) / (fact (2 * n))))" |
53602 | 3198 |
by (rule sums_summable) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3199 |
have "0 < (\<Sum>n<Suc (Suc (Suc 0)). - ((- 1::real) ^ n * 2 ^ (2 * n) / (fact (2 * n))))" |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3200 |
by (simp add: fact_num_eq_if realpow_num_eq_if) |
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3201 |
moreover have "(\<Sum>n<Suc (Suc (Suc 0)). - ((- 1::real) ^ n * 2 ^ (2 * n) / (fact (2 * n)))) |
60162 | 3202 |
< (\<Sum>n. - ((- 1) ^ n * 2 ^ (2 * n) / (fact (2 * n))))" |
53602 | 3203 |
proof - |
3204 |
{ fix d |
|
60162 | 3205 |
let ?six4d = "Suc (Suc (Suc (Suc (Suc (Suc (4 * d))))))" |
3206 |
have "(4::real) * (fact (?six4d)) < (Suc (Suc (?six4d)) * fact (Suc (?six4d)))" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3207 |
unfolding of_nat_mult by (rule mult_strict_mono) (simp_all add: fact_less_mono) |
60162 | 3208 |
then have "(4::real) * (fact (?six4d)) < (fact (Suc (Suc (?six4d))))" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3209 |
by (simp only: fact.simps(2) [of "Suc (?six4d)"] of_nat_mult of_nat_fact) |
60162 | 3210 |
then have "(4::real) * inverse (fact (Suc (Suc (?six4d)))) < inverse (fact (?six4d))" |
53602 | 3211 |
by (simp add: inverse_eq_divide less_divide_eq) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3212 |
} |
60162 | 3213 |
then show ?thesis |
60867 | 3214 |
by (force intro!: sumr_pos_lt_pair [OF sm] simp add: divide_inverse algebra_simps) |
53602 | 3215 |
qed |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3216 |
ultimately have "0 < (\<Sum>n. - ((- 1::real) ^ n * 2 ^ (2 * n) / (fact (2 * n))))" |
53602 | 3217 |
by (rule order_less_trans) |
59730
b7c394c7a619
The factorial function, "fact", now has type "nat => 'a"
paulson <lp15@cam.ac.uk>
parents:
59669
diff
changeset
|
3218 |
moreover from * have "- cos 2 = (\<Sum>n. - ((- 1::real) ^ n * 2 ^ (2 * n) / (fact (2 * n))))" |
53602 | 3219 |
by (rule sums_unique) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3220 |
ultimately have "(0::real) < - cos 2" by simp |
53602 | 3221 |
then show ?thesis by simp |
3222 |
qed |
|
23053 | 3223 |
|
3224 |
lemmas cos_two_neq_zero [simp] = cos_two_less_zero [THEN less_imp_neq] |
|
3225 |
lemmas cos_two_le_zero [simp] = cos_two_less_zero [THEN order_less_imp_le] |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3226 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3227 |
lemma cos_is_zero: "EX! x::real. 0 \<le> x & x \<le> 2 \<and> cos x = 0" |
44730 | 3228 |
proof (rule ex_ex1I) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3229 |
show "\<exists>x::real. 0 \<le> x & x \<le> 2 & cos x = 0" |
44730 | 3230 |
by (rule IVT2, simp_all) |
3231 |
next |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3232 |
fix x::real and y::real |
44730 | 3233 |
assume x: "0 \<le> x \<and> x \<le> 2 \<and> cos x = 0" |
3234 |
assume y: "0 \<le> y \<and> y \<le> 2 \<and> cos y = 0" |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3235 |
have [simp]: "\<forall>x::real. cos differentiable (at x)" |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56167
diff
changeset
|
3236 |
unfolding real_differentiable_def by (auto intro: DERIV_cos) |
44730 | 3237 |
from x y show "x = y" |
3238 |
apply (cut_tac less_linear [of x y], auto) |
|
3239 |
apply (drule_tac f = cos in Rolle) |
|
3240 |
apply (drule_tac [5] f = cos in Rolle) |
|
3241 |
apply (auto dest!: DERIV_cos [THEN DERIV_unique]) |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3242 |
apply (metis order_less_le_trans less_le sin_gt_zero_02) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3243 |
apply (metis order_less_le_trans less_le sin_gt_zero_02) |
44730 | 3244 |
done |
3245 |
qed |
|
31880 | 3246 |
|
23053 | 3247 |
lemma pi_half: "pi/2 = (THE x. 0 \<le> x & x \<le> 2 & cos x = 0)" |
53079 | 3248 |
by (simp add: pi_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3249 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3250 |
lemma cos_pi_half [simp]: "cos (pi / 2) = 0" |
53079 | 3251 |
by (simp add: pi_half cos_is_zero [THEN theI']) |
23053 | 3252 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3253 |
lemma cos_of_real_pi_half [simp]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3254 |
fixes x :: "'a :: {real_field,banach,real_normed_algebra_1}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3255 |
shows "cos ((of_real pi / 2) :: 'a) = 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3256 |
by (metis cos_pi_half cos_of_real eq_numeral_simps(4) nonzero_of_real_divide of_real_0 of_real_numeral) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3257 |
|
23053 | 3258 |
lemma pi_half_gt_zero [simp]: "0 < pi / 2" |
53079 | 3259 |
apply (rule order_le_neq_trans) |
3260 |
apply (simp add: pi_half cos_is_zero [THEN theI']) |
|
54575 | 3261 |
apply (metis cos_pi_half cos_zero zero_neq_one) |
53079 | 3262 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3263 |
|
23053 | 3264 |
lemmas pi_half_neq_zero [simp] = pi_half_gt_zero [THEN less_imp_neq, symmetric] |
3265 |
lemmas pi_half_ge_zero [simp] = pi_half_gt_zero [THEN order_less_imp_le] |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3266 |
|
23053 | 3267 |
lemma pi_half_less_two [simp]: "pi / 2 < 2" |
53079 | 3268 |
apply (rule order_le_neq_trans) |
3269 |
apply (simp add: pi_half cos_is_zero [THEN theI']) |
|
54575 | 3270 |
apply (metis cos_pi_half cos_two_neq_zero) |
53079 | 3271 |
done |
23053 | 3272 |
|
3273 |
lemmas pi_half_neq_two [simp] = pi_half_less_two [THEN less_imp_neq] |
|
3274 |
lemmas pi_half_le_two [simp] = pi_half_less_two [THEN order_less_imp_le] |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3275 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3276 |
lemma pi_gt_zero [simp]: "0 < pi" |
53079 | 3277 |
using pi_half_gt_zero by simp |
23053 | 3278 |
|
3279 |
lemma pi_ge_zero [simp]: "0 \<le> pi" |
|
53079 | 3280 |
by (rule pi_gt_zero [THEN order_less_imp_le]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3281 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3282 |
lemma pi_neq_zero [simp]: "pi \<noteq> 0" |
53079 | 3283 |
by (rule pi_gt_zero [THEN less_imp_neq, symmetric]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3284 |
|
23053 | 3285 |
lemma pi_not_less_zero [simp]: "\<not> pi < 0" |
53079 | 3286 |
by (simp add: linorder_not_less) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3287 |
|
29165
562f95f06244
cleaned up some proofs; removed redundant simp rules
huffman
parents:
29164
diff
changeset
|
3288 |
lemma minus_pi_half_less_zero: "-(pi/2) < 0" |
53079 | 3289 |
by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3290 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3291 |
lemma m2pi_less_pi: "- (2*pi) < pi" |
53079 | 3292 |
by simp |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3293 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3294 |
lemma sin_pi_half [simp]: "sin(pi/2) = 1" |
53079 | 3295 |
using sin_cos_squared_add2 [where x = "pi/2"] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3296 |
using sin_gt_zero_02 [OF pi_half_gt_zero pi_half_less_two] |
53079 | 3297 |
by (simp add: power2_eq_1_iff) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3298 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3299 |
lemma sin_of_real_pi_half [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3300 |
fixes x :: "'a :: {real_field,banach,real_normed_algebra_1}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3301 |
shows "sin ((of_real pi / 2) :: 'a) = 1" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3302 |
using sin_pi_half |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3303 |
by (metis sin_pi_half eq_numeral_simps(4) nonzero_of_real_divide of_real_1 of_real_numeral sin_of_real) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3304 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3305 |
lemma sin_cos_eq: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3306 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3307 |
shows "sin x = cos (of_real pi / 2 - x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3308 |
by (simp add: cos_diff) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3309 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3310 |
lemma minus_sin_cos_eq: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3311 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3312 |
shows "-sin x = cos (x + of_real pi / 2)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3313 |
by (simp add: cos_add nonzero_of_real_divide) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3314 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3315 |
lemma cos_sin_eq: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3316 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3317 |
shows "cos x = sin (of_real pi / 2 - x)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3318 |
using sin_cos_eq [of "of_real pi / 2 - x"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3319 |
by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3320 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3321 |
lemma sin_add: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3322 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3323 |
shows "sin (x + y) = sin x * cos y + cos x * sin y" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3324 |
using cos_add [of "of_real pi / 2 - x" "-y"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3325 |
by (simp add: cos_sin_eq) (simp add: sin_cos_eq) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3326 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3327 |
lemma sin_diff: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3328 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3329 |
shows "sin (x - y) = sin x * cos y - cos x * sin y" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3330 |
using sin_add [of x "- y"] by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3331 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3332 |
lemma sin_double: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3333 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3334 |
shows "sin(2 * x) = 2 * sin x * cos x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3335 |
using sin_add [where x=x and y=x] by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3336 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3337 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3338 |
lemma cos_of_real_pi [simp]: "cos (of_real pi) = -1" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3339 |
using cos_add [where x = "pi/2" and y = "pi/2"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3340 |
by (simp add: cos_of_real) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3341 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3342 |
lemma sin_of_real_pi [simp]: "sin (of_real pi) = 0" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3343 |
using sin_add [where x = "pi/2" and y = "pi/2"] |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3344 |
by (simp add: sin_of_real) |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3345 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3346 |
lemma cos_pi [simp]: "cos pi = -1" |
53079 | 3347 |
using cos_add [where x = "pi/2" and y = "pi/2"] by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3348 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3349 |
lemma sin_pi [simp]: "sin pi = 0" |
53079 | 3350 |
using sin_add [where x = "pi/2" and y = "pi/2"] by simp |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3351 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3352 |
lemma sin_periodic_pi [simp]: "sin (x + pi) = - sin x" |
53079 | 3353 |
by (simp add: sin_add) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3354 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3355 |
lemma sin_periodic_pi2 [simp]: "sin (pi + x) = - sin x" |
53079 | 3356 |
by (simp add: sin_add) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3357 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3358 |
lemma cos_periodic_pi [simp]: "cos (x + pi) = - cos x" |
53079 | 3359 |
by (simp add: cos_add) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3360 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3361 |
lemma cos_periodic_pi2 [simp]: "cos (pi + x) = - cos x" |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3362 |
by (simp add: cos_add) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3363 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3364 |
lemma sin_periodic [simp]: "sin (x + 2*pi) = sin x" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3365 |
by (simp add: sin_add sin_double cos_double) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3366 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3367 |
lemma cos_periodic [simp]: "cos (x + 2*pi) = cos x" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3368 |
by (simp add: cos_add sin_double cos_double) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3369 |
|
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
3370 |
lemma cos_npi [simp]: "cos (real n * pi) = (- 1) ^ n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3371 |
by (induct n) (auto simp: distrib_right) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3372 |
|
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
3373 |
lemma cos_npi2 [simp]: "cos (pi * real n) = (- 1) ^ n" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
3374 |
by (metis cos_npi mult.commute) |
15383 | 3375 |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3376 |
lemma sin_npi [simp]: "sin (real (n::nat) * pi) = 0" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3377 |
by (induct n) (auto simp: of_nat_Suc distrib_right) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3378 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3379 |
lemma sin_npi2 [simp]: "sin (pi * real (n::nat)) = 0" |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
3380 |
by (simp add: mult.commute [of pi]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3381 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3382 |
lemma cos_two_pi [simp]: "cos (2*pi) = 1" |
53079 | 3383 |
by (simp add: cos_double) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3384 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3385 |
lemma sin_two_pi [simp]: "sin (2*pi) = 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3386 |
by (simp add: sin_double) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3387 |
|
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3388 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3389 |
lemma sin_times_sin: |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3390 |
fixes w :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3391 |
shows "sin(w) * sin(z) = (cos(w - z) - cos(w + z)) / 2" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3392 |
by (simp add: cos_diff cos_add) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3393 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3394 |
lemma sin_times_cos: |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3395 |
fixes w :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3396 |
shows "sin(w) * cos(z) = (sin(w + z) + sin(w - z)) / 2" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3397 |
by (simp add: sin_diff sin_add) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3398 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3399 |
lemma cos_times_sin: |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3400 |
fixes w :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3401 |
shows "cos(w) * sin(z) = (sin(w + z) - sin(w - z)) / 2" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3402 |
by (simp add: sin_diff sin_add) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3403 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3404 |
lemma cos_times_cos: |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3405 |
fixes w :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3406 |
shows "cos(w) * cos(z) = (cos(w - z) + cos(w + z)) / 2" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3407 |
by (simp add: cos_diff cos_add) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3408 |
|
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3409 |
lemma sin_plus_sin: (*FIXME field should not be necessary*) |
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3410 |
fixes w :: "'a::{real_normed_field,banach,field}" |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3411 |
shows "sin(w) + sin(z) = 2 * sin((w + z) / 2) * cos((w - z) / 2)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3412 |
apply (simp add: mult.assoc sin_times_cos) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3413 |
apply (simp add: field_simps) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3414 |
done |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3415 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3416 |
lemma sin_diff_sin: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3417 |
fixes w :: "'a::{real_normed_field,banach,field}" |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3418 |
shows "sin(w) - sin(z) = 2 * sin((w - z) / 2) * cos((w + z) / 2)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3419 |
apply (simp add: mult.assoc sin_times_cos) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3420 |
apply (simp add: field_simps) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3421 |
done |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3422 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3423 |
lemma cos_plus_cos: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3424 |
fixes w :: "'a::{real_normed_field,banach,field}" |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3425 |
shows "cos(w) + cos(z) = 2 * cos((w + z) / 2) * cos((w - z) / 2)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3426 |
apply (simp add: mult.assoc cos_times_cos) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3427 |
apply (simp add: field_simps) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3428 |
done |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3429 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3430 |
lemma cos_diff_cos: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3431 |
fixes w :: "'a::{real_normed_field,banach,field}" |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3432 |
shows "cos(w) - cos(z) = 2 * sin((w + z) / 2) * sin((z - w) / 2)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3433 |
apply (simp add: mult.assoc sin_times_sin) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3434 |
apply (simp add: field_simps) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3435 |
done |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3436 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3437 |
lemma cos_double_cos: |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3438 |
fixes z :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3439 |
shows "cos(2 * z) = 2 * cos z ^ 2 - 1" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3440 |
by (simp add: cos_double sin_squared_eq) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3441 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3442 |
lemma cos_double_sin: |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3443 |
fixes z :: "'a::{real_normed_field,banach}" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3444 |
shows "cos(2 * z) = 1 - 2 * sin z ^ 2" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3445 |
by (simp add: cos_double sin_squared_eq) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3446 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3447 |
lemma sin_pi_minus [simp]: "sin (pi - x) = sin x" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3448 |
by (metis sin_minus sin_periodic_pi minus_minus uminus_add_conv_diff) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3449 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3450 |
lemma cos_pi_minus [simp]: "cos (pi - x) = -(cos x)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3451 |
by (metis cos_minus cos_periodic_pi uminus_add_conv_diff) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3452 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3453 |
lemma sin_minus_pi [simp]: "sin (x - pi) = - (sin x)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3454 |
by (simp add: sin_diff) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3455 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3456 |
lemma cos_minus_pi [simp]: "cos (x - pi) = -(cos x)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3457 |
by (simp add: cos_diff) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3458 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3459 |
lemma sin_2pi_minus [simp]: "sin (2*pi - x) = -(sin x)" |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3460 |
by (metis sin_periodic_pi2 add_diff_eq mult_2 sin_pi_minus) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3461 |
|
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3462 |
lemma cos_2pi_minus [simp]: "cos (2*pi - x) = cos x" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3463 |
by (metis (no_types, hide_lams) cos_add cos_minus cos_two_pi sin_minus sin_two_pi |
59741
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3464 |
diff_0_right minus_diff_eq mult_1 mult_zero_left uminus_add_conv_diff) |
5b762cd73a8e
Lots of new material on complex-valued functions. Modified simplification of (x/n)^k
paulson <lp15@cam.ac.uk>
parents:
59731
diff
changeset
|
3465 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3466 |
lemma sin_gt_zero2: "\<lbrakk>0 < x; x < pi/2\<rbrakk> \<Longrightarrow> 0 < sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3467 |
by (metis sin_gt_zero_02 order_less_trans pi_half_less_two) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3468 |
|
41970 | 3469 |
lemma sin_less_zero: |
53079 | 3470 |
assumes "- pi/2 < x" and "x < 0" |
3471 |
shows "sin x < 0" |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3472 |
proof - |
41970 | 3473 |
have "0 < sin (- x)" using assms by (simp only: sin_gt_zero2) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3474 |
thus ?thesis by simp |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3475 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3476 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3477 |
lemma pi_less_4: "pi < 4" |
53079 | 3478 |
using pi_half_less_two by auto |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3479 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3480 |
lemma cos_gt_zero: "\<lbrakk>0 < x; x < pi/2\<rbrakk> \<Longrightarrow> 0 < cos x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3481 |
by (simp add: cos_sin_eq sin_gt_zero2) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3482 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3483 |
lemma cos_gt_zero_pi: "\<lbrakk>-(pi/2) < x; x < pi/2\<rbrakk> \<Longrightarrow> 0 < cos x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3484 |
using cos_gt_zero [of x] cos_gt_zero [of "-x"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3485 |
by (cases rule: linorder_cases [of x 0]) auto |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3486 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3487 |
lemma cos_ge_zero: "\<lbrakk>-(pi/2) \<le> x; x \<le> pi/2\<rbrakk> \<Longrightarrow> 0 \<le> cos x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3488 |
apply (auto simp: order_le_less cos_gt_zero_pi) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3489 |
by (metis cos_pi_half eq_divide_eq eq_numeral_simps(4)) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3490 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3491 |
lemma sin_gt_zero: "\<lbrakk>0 < x; x < pi \<rbrakk> \<Longrightarrow> 0 < sin x" |
53079 | 3492 |
by (simp add: sin_cos_eq cos_gt_zero_pi) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3493 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3494 |
lemma sin_lt_zero: "pi < x \<Longrightarrow> x < 2*pi \<Longrightarrow> sin x < 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3495 |
using sin_gt_zero [of "x-pi"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3496 |
by (simp add: sin_diff) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3497 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3498 |
lemma pi_ge_two: "2 \<le> pi" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3499 |
proof (rule ccontr) |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3500 |
assume "\<not> 2 \<le> pi" hence "pi < 2" by auto |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3501 |
have "\<exists>y > pi. y < 2 \<and> y < 2*pi" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3502 |
proof (cases "2 < 2*pi") |
60758 | 3503 |
case True with dense[OF \<open>pi < 2\<close>] show ?thesis by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3504 |
next |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3505 |
case False have "pi < 2*pi" by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3506 |
from dense[OF this] and False show ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3507 |
qed |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3508 |
then obtain y where "pi < y" and "y < 2" and "y < 2*pi" by blast |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3509 |
hence "0 < sin y" using sin_gt_zero_02 by auto |
41970 | 3510 |
moreover |
60758 | 3511 |
have "sin y < 0" using sin_gt_zero[of "y - pi"] \<open>pi < y\<close> and \<open>y < 2*pi\<close> sin_periodic_pi[of "y - pi"] by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3512 |
ultimately show False by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3513 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3514 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3515 |
lemma sin_ge_zero: "\<lbrakk>0 \<le> x; x \<le> pi\<rbrakk> \<Longrightarrow> 0 \<le> sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3516 |
by (auto simp: order_le_less sin_gt_zero) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3517 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3518 |
lemma sin_le_zero: "pi \<le> x \<Longrightarrow> x < 2*pi \<Longrightarrow> sin x \<le> 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3519 |
using sin_ge_zero [of "x-pi"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3520 |
by (simp add: sin_diff) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3521 |
|
61799 | 3522 |
text \<open>FIXME: This proof is almost identical to lemma \<open>cos_is_zero\<close>. |
60758 | 3523 |
It should be possible to factor out some of the common parts.\<close> |
44745 | 3524 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3525 |
lemma cos_total: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> EX! x. 0 \<le> x & x \<le> pi & (cos x = y)" |
44745 | 3526 |
proof (rule ex_ex1I) |
3527 |
assume y: "-1 \<le> y" "y \<le> 1" |
|
3528 |
show "\<exists>x. 0 \<le> x & x \<le> pi & cos x = y" |
|
3529 |
by (rule IVT2, simp_all add: y) |
|
3530 |
next |
|
3531 |
fix a b |
|
3532 |
assume a: "0 \<le> a \<and> a \<le> pi \<and> cos a = y" |
|
3533 |
assume b: "0 \<le> b \<and> b \<le> pi \<and> cos b = y" |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3534 |
have [simp]: "\<forall>x::real. cos differentiable (at x)" |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56167
diff
changeset
|
3535 |
unfolding real_differentiable_def by (auto intro: DERIV_cos) |
44745 | 3536 |
from a b show "a = b" |
3537 |
apply (cut_tac less_linear [of a b], auto) |
|
3538 |
apply (drule_tac f = cos in Rolle) |
|
3539 |
apply (drule_tac [5] f = cos in Rolle) |
|
3540 |
apply (auto dest!: DERIV_cos [THEN DERIV_unique]) |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3541 |
apply (metis order_less_le_trans less_le sin_gt_zero) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3542 |
apply (metis order_less_le_trans less_le sin_gt_zero) |
44745 | 3543 |
done |
3544 |
qed |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3545 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3546 |
lemma sin_total: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3547 |
assumes y: "-1 \<le> y" "y \<le> 1" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3548 |
shows "\<exists>! x. -(pi/2) \<le> x & x \<le> pi/2 & (sin x = y)" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3549 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3550 |
from cos_total [OF y] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3551 |
obtain x where x: "0 \<le> x" "x \<le> pi" "cos x = y" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3552 |
and uniq: "\<And>x'. 0 \<le> x' \<Longrightarrow> x' \<le> pi \<Longrightarrow> cos x' = y \<Longrightarrow> x' = x " |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3553 |
by blast |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3554 |
show ?thesis |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3555 |
apply (simp add: sin_cos_eq) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3556 |
apply (rule ex1I [where a="pi/2 - x"]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3557 |
apply (cut_tac [2] x'="pi/2 - xa" in uniq) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3558 |
using x |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3559 |
apply auto |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3560 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3561 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3562 |
|
15229 | 3563 |
lemma cos_zero_lemma: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3564 |
assumes "0 \<le> x" "cos x = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3565 |
shows "\<exists>n. odd n \<and> x = of_nat n * (pi/2) \<and> n > 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3566 |
proof - |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3567 |
have xle: "x < (1 + real_of_int \<lfloor>x/pi\<rfloor>) * pi" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3568 |
using floor_correct [of "x/pi"] |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3569 |
by (simp add: add.commute divide_less_eq) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3570 |
obtain n where "real n * pi \<le> x" "x < real (Suc n) * pi" |
61942 | 3571 |
apply (rule that [of "nat \<lfloor>x/pi\<rfloor>"]) |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3572 |
using assms |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3573 |
apply (simp_all add: xle) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3574 |
apply (metis floor_less_iff less_irrefl mult_imp_div_pos_less not_le pi_gt_zero) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3575 |
done |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3576 |
then have x: "0 \<le> x - n * pi" "(x - n * pi) \<le> pi" "cos (x - n * pi) = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3577 |
by (auto simp: algebra_simps cos_diff assms) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3578 |
then have "\<exists>!x. 0 \<le> x \<and> x \<le> pi \<and> cos x = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3579 |
by (auto simp: intro!: cos_total) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3580 |
then obtain \<theta> where \<theta>: "0 \<le> \<theta>" "\<theta> \<le> pi" "cos \<theta> = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3581 |
and uniq: "\<And>\<phi>. \<lbrakk>0 \<le> \<phi>; \<phi> \<le> pi; cos \<phi> = 0\<rbrakk> \<Longrightarrow> \<phi> = \<theta>" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3582 |
by blast |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3583 |
then have "x - real n * pi = \<theta>" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3584 |
using x by blast |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3585 |
moreover have "pi/2 = \<theta>" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3586 |
using pi_half_ge_zero uniq by fastforce |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3587 |
ultimately show ?thesis |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3588 |
by (rule_tac x = "Suc (2 * n)" in exI) (simp add: algebra_simps) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3589 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3590 |
|
15229 | 3591 |
lemma sin_zero_lemma: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3592 |
"\<lbrakk>0 \<le> x; sin x = 0\<rbrakk> \<Longrightarrow> \<exists>n::nat. even n & x = real n * (pi/2)" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3593 |
using cos_zero_lemma [of "x + pi/2"] |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3594 |
apply (clarsimp simp add: cos_add) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3595 |
apply (rule_tac x = "n - 1" in exI) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3596 |
apply (simp add: algebra_simps of_nat_diff) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3597 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3598 |
|
15229 | 3599 |
lemma cos_zero_iff: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3600 |
"(cos x = 0) \<longleftrightarrow> |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3601 |
((\<exists>n. odd n & (x = real n * (pi/2))) \<or> (\<exists>n. odd n & (x = -(real n * (pi/2)))))" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3602 |
(is "?lhs = ?rhs") |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3603 |
proof - |
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3604 |
{ fix n :: nat |
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3605 |
assume "odd n" |
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3606 |
then obtain m where "n = 2 * m + 1" .. |
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3607 |
then have "cos (real n * pi / 2) = 0" |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3608 |
by (simp add: field_simps) (simp add: cos_add add_divide_distrib) |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3609 |
} note * = this |
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3610 |
show ?thesis |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3611 |
proof |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3612 |
assume "cos x = 0" then show ?rhs |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3613 |
using cos_zero_lemma [of x] cos_zero_lemma [of "-x"] by force |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3614 |
next |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3615 |
assume ?rhs then show "cos x = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3616 |
by (auto dest: * simp del: eq_divide_eq_numeral1) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3617 |
qed |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
3618 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3619 |
|
15229 | 3620 |
lemma sin_zero_iff: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3621 |
"(sin x = 0) \<longleftrightarrow> |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3622 |
((\<exists>n. even n & (x = real n * (pi/2))) \<or> (\<exists>n. even n & (x = -(real n * (pi/2)))))" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3623 |
(is "?lhs = ?rhs") |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3624 |
proof |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3625 |
assume "sin x = 0" then show ?rhs |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3626 |
using sin_zero_lemma [of x] sin_zero_lemma [of "-x"] by force |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3627 |
next |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3628 |
assume ?rhs then show "sin x = 0" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3629 |
by (auto elim: evenE) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3630 |
qed |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3631 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3632 |
lemma cos_zero_iff_int: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3633 |
"cos x = 0 \<longleftrightarrow> (\<exists>n. odd n \<and> x = of_int n * (pi/2))" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3634 |
proof safe |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3635 |
assume "cos x = 0" |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3636 |
then show "\<exists>n. odd n & x = of_int n * (pi/2)" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3637 |
apply (simp add: cos_zero_iff, safe) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3638 |
apply (metis even_int_iff of_int_of_nat_eq) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3639 |
apply (rule_tac x="- (int n)" in exI, simp) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3640 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3641 |
next |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3642 |
fix n::int |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3643 |
assume "odd n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3644 |
then show "cos (of_int n * (pi / 2)) = 0" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3645 |
apply (simp add: cos_zero_iff) |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3646 |
apply (case_tac n rule: int_cases2, simp_all) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3647 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3648 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3649 |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3650 |
lemma sin_zero_iff_int: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3651 |
"sin x = 0 \<longleftrightarrow> (\<exists>n. even n & (x = of_int n * (pi/2)))" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3652 |
proof safe |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3653 |
assume "sin x = 0" |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3654 |
then show "\<exists>n. even n \<and> x = of_int n * (pi / 2)" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3655 |
apply (simp add: sin_zero_iff, safe) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3656 |
apply (metis even_int_iff of_int_of_nat_eq) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3657 |
apply (rule_tac x="- (int n)" in exI, simp) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3658 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3659 |
next |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3660 |
fix n::int |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3661 |
assume "even n" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3662 |
then show "sin (of_int n * (pi / 2)) = 0" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3663 |
apply (simp add: sin_zero_iff) |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
3664 |
apply (case_tac n rule: int_cases2, simp_all) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3665 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3666 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3667 |
|
60688
01488b559910
avoid explicit definition of the relation of associated elements in a ring -- prefer explicit normalization instead
haftmann
parents:
60301
diff
changeset
|
3668 |
lemma sin_zero_iff_int2: |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3669 |
"sin x = 0 \<longleftrightarrow> (\<exists>n::int. x = of_int n * pi)" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3670 |
apply (simp only: sin_zero_iff_int) |
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3671 |
apply (safe elim!: evenE) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3672 |
apply (simp_all add: field_simps) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3673 |
using dvd_triv_left apply fastforce |
60688
01488b559910
avoid explicit definition of the relation of associated elements in a ring -- prefer explicit normalization instead
haftmann
parents:
60301
diff
changeset
|
3674 |
done |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3675 |
|
53079 | 3676 |
lemma cos_monotone_0_pi: |
3677 |
assumes "0 \<le> y" and "y < x" and "x \<le> pi" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3678 |
shows "cos x < cos y" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3679 |
proof - |
33549 | 3680 |
have "- (x - y) < 0" using assms by auto |
60758 | 3681 |
from MVT2[OF \<open>y < x\<close> DERIV_cos[THEN impI, THEN allI]] |
53079 | 3682 |
obtain z where "y < z" and "z < x" and cos_diff: "cos x - cos y = (x - y) * - sin z" |
3683 |
by auto |
|
33549 | 3684 |
hence "0 < z" and "z < pi" using assms by auto |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3685 |
hence "0 < sin z" using sin_gt_zero by auto |
53079 | 3686 |
hence "cos x - cos y < 0" |
3687 |
unfolding cos_diff minus_mult_commute[symmetric] |
|
60758 | 3688 |
using \<open>- (x - y) < 0\<close> by (rule mult_pos_neg2) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3689 |
thus ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3690 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3691 |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3692 |
lemma cos_monotone_0_pi_le: |
53079 | 3693 |
assumes "0 \<le> y" and "y \<le> x" and "x \<le> pi" |
3694 |
shows "cos x \<le> cos y" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3695 |
proof (cases "y < x") |
53079 | 3696 |
case True |
3697 |
show ?thesis |
|
60758 | 3698 |
using cos_monotone_0_pi[OF \<open>0 \<le> y\<close> True \<open>x \<le> pi\<close>] by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3699 |
next |
53079 | 3700 |
case False |
60758 | 3701 |
hence "y = x" using \<open>y \<le> x\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3702 |
thus ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3703 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3704 |
|
53079 | 3705 |
lemma cos_monotone_minus_pi_0: |
3706 |
assumes "-pi \<le> y" and "y < x" and "x \<le> 0" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3707 |
shows "cos y < cos x" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3708 |
proof - |
53079 | 3709 |
have "0 \<le> -x" and "-x < -y" and "-y \<le> pi" |
3710 |
using assms by auto |
|
3711 |
from cos_monotone_0_pi[OF this] show ?thesis |
|
3712 |
unfolding cos_minus . |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3713 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3714 |
|
53079 | 3715 |
lemma cos_monotone_minus_pi_0': |
3716 |
assumes "-pi \<le> y" and "y \<le> x" and "x \<le> 0" |
|
3717 |
shows "cos y \<le> cos x" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3718 |
proof (cases "y < x") |
53079 | 3719 |
case True |
60758 | 3720 |
show ?thesis using cos_monotone_minus_pi_0[OF \<open>-pi \<le> y\<close> True \<open>x \<le> 0\<close>] |
53079 | 3721 |
by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3722 |
next |
53079 | 3723 |
case False |
60758 | 3724 |
hence "y = x" using \<open>y \<le> x\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3725 |
thus ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3726 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3727 |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3728 |
lemma sin_monotone_2pi: |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3729 |
assumes "- (pi/2) \<le> y" and "y < x" and "x \<le> pi/2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3730 |
shows "sin y < sin x" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3731 |
apply (simp add: sin_cos_eq) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3732 |
apply (rule cos_monotone_0_pi) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3733 |
using assms |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3734 |
apply auto |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3735 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3736 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3737 |
lemma sin_monotone_2pi_le: |
53079 | 3738 |
assumes "- (pi / 2) \<le> y" and "y \<le> x" and "x \<le> pi / 2" |
3739 |
shows "sin y \<le> sin x" |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3740 |
by (metis assms le_less sin_monotone_2pi) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3741 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3742 |
lemma sin_x_le_x: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3743 |
fixes x::real assumes x: "x \<ge> 0" shows "sin x \<le> x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3744 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3745 |
let ?f = "\<lambda>x. x - sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3746 |
from x have "?f x \<ge> ?f 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3747 |
apply (rule DERIV_nonneg_imp_nondecreasing) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3748 |
apply (intro allI impI exI[of _ "1 - cos x" for x]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3749 |
apply (auto intro!: derivative_eq_intros simp: field_simps) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3750 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3751 |
thus "sin x \<le> x" by simp |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
3752 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3753 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3754 |
lemma sin_x_ge_neg_x: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3755 |
fixes x::real assumes x: "x \<ge> 0" shows "sin x \<ge> - x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3756 |
proof - |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3757 |
let ?f = "\<lambda>x. x + sin x" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3758 |
from x have "?f x \<ge> ?f 0" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3759 |
apply (rule DERIV_nonneg_imp_nondecreasing) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3760 |
apply (intro allI impI exI[of _ "1 + cos x" for x]) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3761 |
apply (auto intro!: derivative_eq_intros simp: field_simps real_0_le_add_iff) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3762 |
done |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3763 |
thus "sin x \<ge> -x" by simp |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3764 |
qed |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3765 |
|
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3766 |
lemma abs_sin_x_le_abs_x: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3767 |
fixes x::real shows "\<bar>sin x\<bar> \<le> \<bar>x\<bar>" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3768 |
using sin_x_ge_neg_x [of x] sin_x_le_x [of x] sin_x_ge_neg_x [of "-x"] sin_x_le_x [of "-x"] |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3769 |
by (auto simp: abs_real_def) |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3770 |
|
53079 | 3771 |
|
60758 | 3772 |
subsection \<open>More Corollaries about Sine and Cosine\<close> |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3773 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3774 |
lemma sin_cos_npi [simp]: "sin (real (Suc (2 * n)) * pi / 2) = (-1) ^ n" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3775 |
proof - |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3776 |
have "sin ((real n + 1/2) * pi) = cos (real n * pi)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3777 |
by (auto simp: algebra_simps sin_add) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3778 |
thus ?thesis |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3779 |
by (simp add: distrib_right add_divide_distrib add.commute mult.commute [of pi]) |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3780 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3781 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3782 |
lemma cos_2npi [simp]: "cos (2 * real (n::nat) * pi) = 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3783 |
by (cases "even n") (simp_all add: cos_double mult.assoc) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3784 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3785 |
lemma cos_3over2_pi [simp]: "cos (3/2*pi) = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3786 |
apply (subgoal_tac "cos (pi + pi/2) = 0", simp) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3787 |
apply (subst cos_add, simp) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3788 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3789 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3790 |
lemma sin_2npi [simp]: "sin (2 * real (n::nat) * pi) = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3791 |
by (auto simp: mult.assoc sin_double) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3792 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3793 |
lemma sin_3over2_pi [simp]: "sin (3/2*pi) = - 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3794 |
apply (subgoal_tac "sin (pi + pi/2) = - 1", simp) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3795 |
apply (subst sin_add, simp) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3796 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3797 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3798 |
lemma cos_pi_eq_zero [simp]: "cos (pi * real (Suc (2 * m)) / 2) = 0" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3799 |
by (simp only: cos_add sin_add of_nat_Suc distrib_right distrib_left add_divide_distrib, auto) |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3800 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3801 |
lemma DERIV_cos_add [simp]: "DERIV (\<lambda>x. cos (x + k)) xa :> - sin (xa + k)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3802 |
by (auto intro!: derivative_eq_intros) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3803 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3804 |
lemma sin_zero_norm_cos_one: |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3805 |
fixes x :: "'a::{real_normed_field,banach}" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3806 |
assumes "sin x = 0" shows "norm (cos x) = 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3807 |
using sin_cos_squared_add [of x, unfolded assms] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3808 |
by (simp add: square_norm_one) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3809 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3810 |
lemma sin_zero_abs_cos_one: "sin x = 0 \<Longrightarrow> \<bar>cos x\<bar> = (1::real)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3811 |
using sin_zero_norm_cos_one by fastforce |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3812 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3813 |
lemma cos_one_sin_zero: |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3814 |
fixes x :: "'a::{real_normed_field,banach}" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3815 |
assumes "cos x = 1" shows "sin x = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3816 |
using sin_cos_squared_add [of x, unfolded assms] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3817 |
by simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3818 |
|
61070 | 3819 |
lemma sin_times_pi_eq_0: "sin(x * pi) = 0 \<longleftrightarrow> x \<in> \<int>" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3820 |
by (simp add: sin_zero_iff_int2) (metis Ints_cases Ints_of_int) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3821 |
|
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3822 |
lemma cos_one_2pi: |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3823 |
"cos(x) = 1 \<longleftrightarrow> (\<exists>n::nat. x = n * 2*pi) | (\<exists>n::nat. x = -(n * 2*pi))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3824 |
(is "?lhs = ?rhs") |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3825 |
proof |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3826 |
assume "cos(x) = 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3827 |
then have "sin x = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3828 |
by (simp add: cos_one_sin_zero) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3829 |
then show ?rhs |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3830 |
proof (simp only: sin_zero_iff, elim exE disjE conjE) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3831 |
fix n::nat |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3832 |
assume n: "even n" "x = real n * (pi/2)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3833 |
then obtain m where m: "n = 2 * m" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3834 |
using dvdE by blast |
60758 | 3835 |
then have me: "even m" using \<open>?lhs\<close> n |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3836 |
by (auto simp: field_simps) (metis one_neq_neg_one power_minus_odd power_one) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3837 |
show ?rhs |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3838 |
using m me n |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3839 |
by (auto simp: field_simps elim!: evenE) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3840 |
next |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3841 |
fix n::nat |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3842 |
assume n: "even n" "x = - (real n * (pi/2))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3843 |
then obtain m where m: "n = 2 * m" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3844 |
using dvdE by blast |
60758 | 3845 |
then have me: "even m" using \<open>?lhs\<close> n |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3846 |
by (auto simp: field_simps) (metis one_neq_neg_one power_minus_odd power_one) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3847 |
show ?rhs |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3848 |
using m me n |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3849 |
by (auto simp: field_simps elim!: evenE) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3850 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3851 |
next |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3852 |
assume "?rhs" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3853 |
then show "cos x = 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3854 |
by (metis cos_2npi cos_minus mult.assoc mult.left_commute) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3855 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3856 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3857 |
lemma cos_one_2pi_int: "cos(x) = 1 \<longleftrightarrow> (\<exists>n::int. x = n * 2*pi)" |
61799 | 3858 |
apply auto \<comment>\<open>FIXME simproc bug\<close> |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3859 |
apply (auto simp: cos_one_2pi) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3860 |
apply (metis of_int_of_nat_eq) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3861 |
apply (metis mult_minus_right of_int_minus of_int_of_nat_eq) |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3862 |
by (metis mult_minus_right of_int_of_nat ) |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3863 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3864 |
lemma sin_cos_sqrt: "0 \<le> sin(x) \<Longrightarrow> (sin(x) = sqrt(1 - (cos(x) ^ 2)))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3865 |
using sin_squared_eq real_sqrt_unique by fastforce |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3866 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3867 |
lemma sin_eq_0_pi: "-pi < x \<Longrightarrow> x < pi \<Longrightarrow> sin(x) = 0 \<Longrightarrow> x = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3868 |
by (metis sin_gt_zero sin_minus minus_less_iff neg_0_less_iff_less not_less_iff_gr_or_eq) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3869 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3870 |
lemma cos_treble_cos: |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3871 |
fixes x :: "'a::{real_normed_field,banach}" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3872 |
shows "cos(3 * x) = 4 * cos(x) ^ 3 - 3 * cos x" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3873 |
proof - |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3874 |
have *: "(sin x * (sin x * 3)) = 3 - (cos x * (cos x * 3))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3875 |
by (simp add: mult.assoc [symmetric] sin_squared_eq [unfolded power2_eq_square]) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3876 |
have "cos(3 * x) = cos(2*x + x)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3877 |
by simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3878 |
also have "... = 4 * cos(x) ^ 3 - 3 * cos x" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3879 |
apply (simp only: cos_add cos_double sin_double) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3880 |
apply (simp add: * field_simps power2_eq_square power3_eq_cube) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3881 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3882 |
finally show ?thesis . |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3883 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3884 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3885 |
lemma cos_45: "cos (pi / 4) = sqrt 2 / 2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3886 |
proof - |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3887 |
let ?c = "cos (pi / 4)" and ?s = "sin (pi / 4)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3888 |
have nonneg: "0 \<le> ?c" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3889 |
by (simp add: cos_ge_zero) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3890 |
have "0 = cos (pi / 4 + pi / 4)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3891 |
by simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3892 |
also have "cos (pi / 4 + pi / 4) = ?c\<^sup>2 - ?s\<^sup>2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3893 |
by (simp only: cos_add power2_eq_square) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3894 |
also have "\<dots> = 2 * ?c\<^sup>2 - 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3895 |
by (simp add: sin_squared_eq) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3896 |
finally have "?c\<^sup>2 = (sqrt 2 / 2)\<^sup>2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3897 |
by (simp add: power_divide) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3898 |
thus ?thesis |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3899 |
using nonneg by (rule power2_eq_imp_eq) simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3900 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3901 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3902 |
lemma cos_30: "cos (pi / 6) = sqrt 3/2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3903 |
proof - |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3904 |
let ?c = "cos (pi / 6)" and ?s = "sin (pi / 6)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3905 |
have pos_c: "0 < ?c" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3906 |
by (rule cos_gt_zero, simp, simp) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3907 |
have "0 = cos (pi / 6 + pi / 6 + pi / 6)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3908 |
by simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3909 |
also have "\<dots> = (?c * ?c - ?s * ?s) * ?c - (?s * ?c + ?c * ?s) * ?s" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3910 |
by (simp only: cos_add sin_add) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3911 |
also have "\<dots> = ?c * (?c\<^sup>2 - 3 * ?s\<^sup>2)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3912 |
by (simp add: algebra_simps power2_eq_square) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3913 |
finally have "?c\<^sup>2 = (sqrt 3/2)\<^sup>2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3914 |
using pos_c by (simp add: sin_squared_eq power_divide) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3915 |
thus ?thesis |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3916 |
using pos_c [THEN order_less_imp_le] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3917 |
by (rule power2_eq_imp_eq) simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3918 |
qed |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3919 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3920 |
lemma sin_45: "sin (pi / 4) = sqrt 2 / 2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3921 |
by (simp add: sin_cos_eq cos_45) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3922 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3923 |
lemma sin_60: "sin (pi / 3) = sqrt 3/2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3924 |
by (simp add: sin_cos_eq cos_30) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3925 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3926 |
lemma cos_60: "cos (pi / 3) = 1 / 2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3927 |
apply (rule power2_eq_imp_eq) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3928 |
apply (simp add: cos_squared_eq sin_60 power_divide) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3929 |
apply (rule cos_ge_zero, rule order_trans [where y=0], simp_all) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3930 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3931 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3932 |
lemma sin_30: "sin (pi / 6) = 1 / 2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3933 |
by (simp add: sin_cos_eq cos_60) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3934 |
|
61070 | 3935 |
lemma cos_integer_2pi: "n \<in> \<int> \<Longrightarrow> cos(2*pi * n) = 1" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3936 |
by (metis Ints_cases cos_one_2pi_int mult.assoc mult.commute) |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3937 |
|
61070 | 3938 |
lemma sin_integer_2pi: "n \<in> \<int> \<Longrightarrow> sin(2*pi * n) = 0" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3939 |
by (metis sin_two_pi Ints_mult mult.assoc mult.commute sin_times_pi_eq_0) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3940 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3941 |
lemma cos_int_2npi [simp]: "cos (2 * of_int (n::int) * pi) = 1" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3942 |
by (simp add: cos_one_2pi_int) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3943 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3944 |
lemma sin_int_2npi [simp]: "sin (2 * of_int (n::int) * pi) = 0" |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
3945 |
by (metis Ints_of_int mult.assoc mult.commute sin_integer_2pi) |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3946 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3947 |
lemma sincos_principal_value: "\<exists>y. (-pi < y \<and> y \<le> pi) \<and> (sin(y) = sin(x) \<and> cos(y) = cos(x))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3948 |
apply (rule exI [where x="pi - (2*pi) * frac((pi - x) / (2*pi))"]) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3949 |
apply (auto simp: field_simps frac_lt_1) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3950 |
apply (simp_all add: frac_def divide_simps) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3951 |
apply (simp_all add: add_divide_distrib diff_divide_distrib) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3952 |
apply (simp_all add: sin_diff cos_diff mult.assoc [symmetric] cos_integer_2pi sin_integer_2pi) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3953 |
done |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3954 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
3955 |
|
60758 | 3956 |
subsection \<open>Tangent\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3957 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3958 |
definition tan :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
53079 | 3959 |
where "tan = (\<lambda>x. sin x / cos x)" |
23043 | 3960 |
|
59862 | 3961 |
lemma tan_of_real: |
60241 | 3962 |
"of_real (tan x) = (tan (of_real x) :: 'a::{real_normed_field,banach})" |
59862 | 3963 |
by (simp add: tan_def sin_of_real cos_of_real) |
3964 |
||
3965 |
lemma tan_in_Reals [simp]: |
|
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
3966 |
fixes z :: "'a::{real_normed_field,banach}" |
59862 | 3967 |
shows "z \<in> \<real> \<Longrightarrow> tan z \<in> \<real>" |
3968 |
by (simp add: tan_def) |
|
3969 |
||
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3970 |
lemma tan_zero [simp]: "tan 0 = 0" |
44311 | 3971 |
by (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3972 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3973 |
lemma tan_pi [simp]: "tan pi = 0" |
44311 | 3974 |
by (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3975 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3976 |
lemma tan_npi [simp]: "tan (real (n::nat) * pi) = 0" |
44311 | 3977 |
by (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3978 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3979 |
lemma tan_minus [simp]: "tan (-x) = - tan x" |
44311 | 3980 |
by (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3981 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3982 |
lemma tan_periodic [simp]: "tan (x + 2*pi) = tan x" |
44311 | 3983 |
by (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3984 |
|
41970 | 3985 |
lemma lemma_tan_add1: |
44311 | 3986 |
"\<lbrakk>cos x \<noteq> 0; cos y \<noteq> 0\<rbrakk> \<Longrightarrow> 1 - tan x * tan y = cos (x + y)/(cos x * cos y)" |
3987 |
by (simp add: tan_def cos_add field_simps) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3988 |
|
41970 | 3989 |
lemma add_tan_eq: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3990 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3991 |
shows "\<lbrakk>cos x \<noteq> 0; cos y \<noteq> 0\<rbrakk> \<Longrightarrow> tan x + tan y = sin(x + y)/(cos x * cos y)" |
44311 | 3992 |
by (simp add: tan_def sin_add field_simps) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
3993 |
|
15229 | 3994 |
lemma tan_add: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3995 |
fixes x :: "'a::{real_normed_field,banach}" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
3996 |
shows |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3997 |
"\<lbrakk>cos x \<noteq> 0; cos y \<noteq> 0; cos (x + y) \<noteq> 0\<rbrakk> |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3998 |
\<Longrightarrow> tan(x + y) = (tan(x) + tan(y))/(1 - tan(x) * tan(y))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
3999 |
by (simp add: add_tan_eq lemma_tan_add1 field_simps) (simp add: tan_def) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4000 |
|
15229 | 4001 |
lemma tan_double: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4002 |
fixes x :: "'a::{real_normed_field,banach}" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
4003 |
shows |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4004 |
"\<lbrakk>cos x \<noteq> 0; cos (2 * x) \<noteq> 0\<rbrakk> |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4005 |
\<Longrightarrow> tan (2 * x) = (2 * tan x) / (1 - (tan x)\<^sup>2)" |
44311 | 4006 |
using tan_add [of x x] by (simp add: power2_eq_square) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4007 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4008 |
lemma tan_gt_zero: "\<lbrakk>0 < x; x < pi/2\<rbrakk> \<Longrightarrow> 0 < tan x" |
53079 | 4009 |
by (simp add: tan_def zero_less_divide_iff sin_gt_zero2 cos_gt_zero_pi) |
41970 | 4010 |
|
4011 |
lemma tan_less_zero: |
|
53079 | 4012 |
assumes lb: "- pi/2 < x" and "x < 0" |
4013 |
shows "tan x < 0" |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4014 |
proof - |
41970 | 4015 |
have "0 < tan (- x)" using assms by (simp only: tan_gt_zero) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4016 |
thus ?thesis by simp |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4017 |
qed |
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4018 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4019 |
lemma tan_half: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
4020 |
fixes x :: "'a::{real_normed_field,banach,field}" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4021 |
shows "tan x = sin (2 * x) / (cos (2 * x) + 1)" |
44756
efcd71fbaeec
simplify proof of tan_half, removing unused assumptions
huffman
parents:
44755
diff
changeset
|
4022 |
unfolding tan_def sin_double cos_double sin_squared_eq |
efcd71fbaeec
simplify proof of tan_half, removing unused assumptions
huffman
parents:
44755
diff
changeset
|
4023 |
by (simp add: power2_eq_square) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4024 |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4025 |
lemma tan_30: "tan (pi / 6) = 1 / sqrt 3" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4026 |
unfolding tan_def by (simp add: sin_30 cos_30) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4027 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4028 |
lemma tan_45: "tan (pi / 4) = 1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4029 |
unfolding tan_def by (simp add: sin_45 cos_45) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4030 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4031 |
lemma tan_60: "tan (pi / 3) = sqrt 3" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4032 |
unfolding tan_def by (simp add: sin_60 cos_60) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4033 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4034 |
lemma DERIV_tan [simp]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4035 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4036 |
shows "cos x \<noteq> 0 \<Longrightarrow> DERIV tan x :> inverse ((cos x)\<^sup>2)" |
44311 | 4037 |
unfolding tan_def |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
4038 |
by (auto intro!: derivative_eq_intros, simp add: divide_inverse power2_eq_square) |
44311 | 4039 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4040 |
lemma isCont_tan: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4041 |
fixes x :: "'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4042 |
shows "cos x \<noteq> 0 \<Longrightarrow> isCont tan x" |
44311 | 4043 |
by (rule DERIV_tan [THEN DERIV_isCont]) |
4044 |
||
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4045 |
lemma isCont_tan' [simp,continuous_intros]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4046 |
fixes a :: "'a::{real_normed_field,banach}" and f :: "'a \<Rightarrow> 'a" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4047 |
shows "\<lbrakk>isCont f a; cos (f a) \<noteq> 0\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. tan (f x)) a" |
44311 | 4048 |
by (rule isCont_o2 [OF _ isCont_tan]) |
4049 |
||
4050 |
lemma tendsto_tan [tendsto_intros]: |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4051 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4052 |
shows "\<lbrakk>(f ---> a) F; cos a \<noteq> 0\<rbrakk> \<Longrightarrow> ((\<lambda>x. tan (f x)) ---> tan a) F" |
44311 | 4053 |
by (rule isCont_tendsto_compose [OF isCont_tan]) |
4054 |
||
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4055 |
lemma continuous_tan: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4056 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4057 |
shows "continuous F f \<Longrightarrow> cos (f (Lim F (\<lambda>x. x))) \<noteq> 0 \<Longrightarrow> continuous F (\<lambda>x. tan (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4058 |
unfolding continuous_def by (rule tendsto_tan) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4059 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4060 |
lemma continuous_on_tan [continuous_intros]: |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4061 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4062 |
shows "continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. cos (f x) \<noteq> 0) \<Longrightarrow> continuous_on s (\<lambda>x. tan (f x))" |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4063 |
unfolding continuous_on_def by (auto intro: tendsto_tan) |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4064 |
|
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4065 |
lemma continuous_within_tan [continuous_intros]: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4066 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
4067 |
shows |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4068 |
"continuous (at x within s) f \<Longrightarrow> cos (f x) \<noteq> 0 \<Longrightarrow> continuous (at x within s) (\<lambda>x. tan (f x))" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4069 |
unfolding continuous_within by (rule tendsto_tan) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4070 |
|
53079 | 4071 |
lemma LIM_cos_div_sin: "(\<lambda>x. cos(x)/sin(x)) -- pi/2 --> 0" |
44311 | 4072 |
by (rule LIM_cong_limit, (rule tendsto_intros)+, simp_all) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4073 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4074 |
lemma lemma_tan_total: "0 < y ==> \<exists>x. 0 < x & x < pi/2 & y < tan x" |
53079 | 4075 |
apply (cut_tac LIM_cos_div_sin) |
4076 |
apply (simp only: LIM_eq) |
|
4077 |
apply (drule_tac x = "inverse y" in spec, safe, force) |
|
4078 |
apply (drule_tac ?d1.0 = s in pi_half_gt_zero [THEN [2] real_lbound_gt_zero], safe) |
|
4079 |
apply (rule_tac x = "(pi/2) - e" in exI) |
|
4080 |
apply (simp (no_asm_simp)) |
|
4081 |
apply (drule_tac x = "(pi/2) - e" in spec) |
|
4082 |
apply (auto simp add: tan_def sin_diff cos_diff) |
|
4083 |
apply (rule inverse_less_iff_less [THEN iffD1]) |
|
4084 |
apply (auto simp add: divide_inverse) |
|
4085 |
apply (rule mult_pos_pos) |
|
4086 |
apply (subgoal_tac [3] "0 < sin e & 0 < cos e") |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
4087 |
apply (auto intro: cos_gt_zero sin_gt_zero2 simp add: mult.commute) |
53079 | 4088 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4089 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4090 |
lemma tan_total_pos: "0 \<le> y ==> \<exists>x. 0 \<le> x & x < pi/2 & tan x = y" |
53079 | 4091 |
apply (frule order_le_imp_less_or_eq, safe) |
4092 |
prefer 2 apply force |
|
4093 |
apply (drule lemma_tan_total, safe) |
|
4094 |
apply (cut_tac f = tan and a = 0 and b = x and y = y in IVT_objl) |
|
4095 |
apply (auto intro!: DERIV_tan [THEN DERIV_isCont]) |
|
4096 |
apply (drule_tac y = xa in order_le_imp_less_or_eq) |
|
4097 |
apply (auto dest: cos_gt_zero) |
|
4098 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4099 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4100 |
lemma lemma_tan_total1: "\<exists>x. -(pi/2) < x & x < (pi/2) & tan x = y" |
53079 | 4101 |
apply (cut_tac linorder_linear [of 0 y], safe) |
4102 |
apply (drule tan_total_pos) |
|
4103 |
apply (cut_tac [2] y="-y" in tan_total_pos, safe) |
|
4104 |
apply (rule_tac [3] x = "-x" in exI) |
|
4105 |
apply (auto del: exI intro!: exI) |
|
4106 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4107 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4108 |
lemma tan_total: "EX! x. -(pi/2) < x & x < (pi/2) & tan x = y" |
53079 | 4109 |
apply (cut_tac y = y in lemma_tan_total1, auto) |
57492
74bf65a1910a
Hypsubst preserves equality hypotheses
Thomas Sewell <thomas.sewell@nicta.com.au>
parents:
57418
diff
changeset
|
4110 |
apply hypsubst_thin |
53079 | 4111 |
apply (cut_tac x = xa and y = y in linorder_less_linear, auto) |
4112 |
apply (subgoal_tac [2] "\<exists>z. y < z & z < xa & DERIV tan z :> 0") |
|
4113 |
apply (subgoal_tac "\<exists>z. xa < z & z < y & DERIV tan z :> 0") |
|
4114 |
apply (rule_tac [4] Rolle) |
|
4115 |
apply (rule_tac [2] Rolle) |
|
4116 |
apply (auto del: exI intro!: DERIV_tan DERIV_isCont exI |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56167
diff
changeset
|
4117 |
simp add: real_differentiable_def) |
60758 | 4118 |
txt\<open>Now, simulate TRYALL\<close> |
53079 | 4119 |
apply (rule_tac [!] DERIV_tan asm_rl) |
4120 |
apply (auto dest!: DERIV_unique [OF _ DERIV_tan] |
|
4121 |
simp add: cos_gt_zero_pi [THEN less_imp_neq, THEN not_sym]) |
|
4122 |
done |
|
4123 |
||
4124 |
lemma tan_monotone: |
|
4125 |
assumes "- (pi / 2) < y" and "y < x" and "x < pi / 2" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4126 |
shows "tan y < tan x" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4127 |
proof - |
53079 | 4128 |
have "\<forall>x'. y \<le> x' \<and> x' \<le> x \<longrightarrow> DERIV tan x' :> inverse ((cos x')\<^sup>2)" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4129 |
proof (rule allI, rule impI) |
53079 | 4130 |
fix x' :: real |
4131 |
assume "y \<le> x' \<and> x' \<le> x" |
|
33549 | 4132 |
hence "-(pi/2) < x'" and "x' < pi/2" using assms by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4133 |
from cos_gt_zero_pi[OF this] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4134 |
have "cos x' \<noteq> 0" by auto |
53076 | 4135 |
thus "DERIV tan x' :> inverse ((cos x')\<^sup>2)" by (rule DERIV_tan) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4136 |
qed |
60758 | 4137 |
from MVT2[OF \<open>y < x\<close> this] |
53079 | 4138 |
obtain z where "y < z" and "z < x" |
4139 |
and tan_diff: "tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)" by auto |
|
33549 | 4140 |
hence "- (pi / 2) < z" and "z < pi / 2" using assms by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4141 |
hence "0 < cos z" using cos_gt_zero_pi by auto |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4142 |
hence inv_pos: "0 < inverse ((cos z)\<^sup>2)" by auto |
60758 | 4143 |
have "0 < x - y" using \<open>y < x\<close> by auto |
56544 | 4144 |
with inv_pos have "0 < tan x - tan y" unfolding tan_diff by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4145 |
thus ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4146 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4147 |
|
53079 | 4148 |
lemma tan_monotone': |
4149 |
assumes "- (pi / 2) < y" |
|
4150 |
and "y < pi / 2" |
|
4151 |
and "- (pi / 2) < x" |
|
4152 |
and "x < pi / 2" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4153 |
shows "(y < x) = (tan y < tan x)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4154 |
proof |
53079 | 4155 |
assume "y < x" |
4156 |
thus "tan y < tan x" |
|
60758 | 4157 |
using tan_monotone and \<open>- (pi / 2) < y\<close> and \<open>x < pi / 2\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4158 |
next |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4159 |
assume "tan y < tan x" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4160 |
show "y < x" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4161 |
proof (rule ccontr) |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4162 |
assume "\<not> y < x" hence "x \<le> y" by auto |
41970 | 4163 |
hence "tan x \<le> tan y" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4164 |
proof (cases "x = y") |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4165 |
case True thus ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4166 |
next |
60758 | 4167 |
case False hence "x < y" using \<open>x \<le> y\<close> by auto |
4168 |
from tan_monotone[OF \<open>- (pi/2) < x\<close> this \<open>y < pi / 2\<close>] show ?thesis by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4169 |
qed |
60758 | 4170 |
thus False using \<open>tan y < tan x\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4171 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4172 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4173 |
|
53079 | 4174 |
lemma tan_inverse: "1 / (tan y) = tan (pi / 2 - y)" |
4175 |
unfolding tan_def sin_cos_eq[of y] cos_sin_eq[of y] by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4176 |
|
41970 | 4177 |
lemma tan_periodic_pi[simp]: "tan (x + pi) = tan x" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4178 |
by (simp add: tan_def) |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4179 |
|
53079 | 4180 |
lemma tan_periodic_nat[simp]: |
4181 |
fixes n :: nat |
|
4182 |
shows "tan (x + real n * pi) = tan x" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4183 |
proof (induct n arbitrary: x) |
53079 | 4184 |
case 0 |
4185 |
then show ?case by simp |
|
4186 |
next |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4187 |
case (Suc n) |
53079 | 4188 |
have split_pi_off: "x + real (Suc n) * pi = (x + real n * pi) + pi" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4189 |
unfolding Suc_eq_plus1 of_nat_add distrib_right by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4190 |
show ?case unfolding split_pi_off using Suc by auto |
53079 | 4191 |
qed |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4192 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4193 |
lemma tan_periodic_int[simp]: fixes i :: int shows "tan (x + of_int i * pi) = tan x" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4194 |
proof (cases "0 \<le> i") |
53079 | 4195 |
case True |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4196 |
hence i_nat: "of_int i = of_int (nat i)" by auto |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4197 |
show ?thesis unfolding i_nat |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4198 |
by (metis of_int_of_nat_eq tan_periodic_nat) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4199 |
next |
53079 | 4200 |
case False |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4201 |
hence i_nat: "of_int i = - of_int (nat (-i))" by auto |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4202 |
have "tan x = tan (x + of_int i * pi - of_int i * pi)" |
53079 | 4203 |
by auto |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4204 |
also have "\<dots> = tan (x + of_int i * pi)" |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4205 |
unfolding i_nat mult_minus_left diff_minus_eq_add |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4206 |
by (metis of_int_of_nat_eq tan_periodic_nat) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4207 |
finally show ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4208 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4209 |
|
47108
2a1953f0d20d
merged fork with new numeral representation (see NEWS)
huffman
parents:
46240
diff
changeset
|
4210 |
lemma tan_periodic_n[simp]: "tan (x + numeral n * pi) = tan x" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4211 |
using tan_periodic_int[of _ "numeral n" ] by simp |
23043 | 4212 |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4213 |
lemma tan_minus_45: "tan (-(pi/4)) = -1" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4214 |
unfolding tan_def by (simp add: sin_45 cos_45) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4215 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4216 |
lemma tan_diff: |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4217 |
fixes x :: "'a::{real_normed_field,banach}" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4218 |
shows |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4219 |
"\<lbrakk>cos x \<noteq> 0; cos y \<noteq> 0; cos (x - y) \<noteq> 0\<rbrakk> |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4220 |
\<Longrightarrow> tan(x - y) = (tan(x) - tan(y))/(1 + tan(x) * tan(y))" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4221 |
using tan_add [of x "-y"] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4222 |
by simp |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4223 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4224 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4225 |
lemma tan_pos_pi2_le: "0 \<le> x ==> x < pi/2 \<Longrightarrow> 0 \<le> tan x" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4226 |
using less_eq_real_def tan_gt_zero by auto |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4227 |
|
61944 | 4228 |
lemma cos_tan: "\<bar>x\<bar> < pi/2 \<Longrightarrow> cos(x) = 1 / sqrt(1 + tan(x) ^ 2)" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4229 |
using cos_gt_zero_pi [of x] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4230 |
by (simp add: divide_simps tan_def real_sqrt_divide abs_if split: split_if_asm) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4231 |
|
61944 | 4232 |
lemma sin_tan: "\<bar>x\<bar> < pi/2 \<Longrightarrow> sin(x) = tan(x) / sqrt(1 + tan(x) ^ 2)" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4233 |
using cos_gt_zero [of "x"] cos_gt_zero [of "-x"] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4234 |
by (force simp add: divide_simps tan_def real_sqrt_divide abs_if split: split_if_asm) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4235 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4236 |
lemma tan_mono_le: "-(pi/2) < x ==> x \<le> y ==> y < pi/2 \<Longrightarrow> tan(x) \<le> tan(y)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4237 |
using less_eq_real_def tan_monotone by auto |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4238 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4239 |
lemma tan_mono_lt_eq: "-(pi/2) < x ==> x < pi/2 ==> -(pi/2) < y ==> y < pi/2 |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4240 |
\<Longrightarrow> (tan(x) < tan(y) \<longleftrightarrow> x < y)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4241 |
using tan_monotone' by blast |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4242 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4243 |
lemma tan_mono_le_eq: "-(pi/2) < x ==> x < pi/2 ==> -(pi/2) < y ==> y < pi/2 |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4244 |
\<Longrightarrow> (tan(x) \<le> tan(y) \<longleftrightarrow> x \<le> y)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4245 |
by (meson tan_mono_le not_le tan_monotone) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4246 |
|
61944 | 4247 |
lemma tan_bound_pi2: "\<bar>x\<bar> < pi/4 \<Longrightarrow> \<bar>tan x\<bar> < 1" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4248 |
using tan_45 tan_monotone [of x "pi/4"] tan_monotone [of "-x" "pi/4"] |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4249 |
by (auto simp: abs_if split: split_if_asm) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4250 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4251 |
lemma tan_cot: "tan(pi/2 - x) = inverse(tan x)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4252 |
by (simp add: tan_def sin_diff cos_diff) |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4253 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4254 |
subsection \<open>Cotangent\<close> |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4255 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4256 |
definition cot :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4257 |
where "cot = (\<lambda>x. cos x / sin x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4258 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4259 |
lemma cot_of_real: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4260 |
"of_real (cot x) = (cot (of_real x) :: 'a::{real_normed_field,banach})" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4261 |
by (simp add: cot_def sin_of_real cos_of_real) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4262 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4263 |
lemma cot_in_Reals [simp]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4264 |
fixes z :: "'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4265 |
shows "z \<in> \<real> \<Longrightarrow> cot z \<in> \<real>" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4266 |
by (simp add: cot_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4267 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4268 |
lemma cot_zero [simp]: "cot 0 = 0" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4269 |
by (simp add: cot_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4270 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4271 |
lemma cot_pi [simp]: "cot pi = 0" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4272 |
by (simp add: cot_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4273 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4274 |
lemma cot_npi [simp]: "cot (real (n::nat) * pi) = 0" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4275 |
by (simp add: cot_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4276 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4277 |
lemma cot_minus [simp]: "cot (-x) = - cot x" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4278 |
by (simp add: cot_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4279 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4280 |
lemma cot_periodic [simp]: "cot (x + 2*pi) = cot x" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4281 |
by (simp add: cot_def) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4282 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4283 |
lemma cot_altdef: "cot x = inverse (tan x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4284 |
by (simp add: cot_def tan_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4285 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4286 |
lemma tan_altdef: "tan x = inverse (cot x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4287 |
by (simp add: cot_def tan_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4288 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4289 |
lemma tan_cot': "tan(pi/2 - x) = cot x" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4290 |
by (simp add: tan_cot cot_altdef) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4291 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4292 |
lemma cot_gt_zero: "\<lbrakk>0 < x; x < pi/2\<rbrakk> \<Longrightarrow> 0 < cot x" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4293 |
by (simp add: cot_def zero_less_divide_iff sin_gt_zero2 cos_gt_zero_pi) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4294 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4295 |
lemma cot_less_zero: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4296 |
assumes lb: "- pi/2 < x" and "x < 0" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4297 |
shows "cot x < 0" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4298 |
proof - |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4299 |
have "0 < cot (- x)" using assms by (simp only: cot_gt_zero) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4300 |
thus ?thesis by simp |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4301 |
qed |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4302 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4303 |
lemma DERIV_cot [simp]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4304 |
fixes x :: "'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4305 |
shows "sin x \<noteq> 0 \<Longrightarrow> DERIV cot x :> -inverse ((sin x)\<^sup>2)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4306 |
unfolding cot_def using cos_squared_eq[of x] |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4307 |
by (auto intro!: derivative_eq_intros, simp add: divide_inverse power2_eq_square) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4308 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4309 |
lemma isCont_cot: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4310 |
fixes x :: "'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4311 |
shows "sin x \<noteq> 0 \<Longrightarrow> isCont cot x" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4312 |
by (rule DERIV_cot [THEN DERIV_isCont]) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4313 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4314 |
lemma isCont_cot' [simp,continuous_intros]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4315 |
fixes a :: "'a::{real_normed_field,banach}" and f :: "'a \<Rightarrow> 'a" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4316 |
shows "\<lbrakk>isCont f a; sin (f a) \<noteq> 0\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. cot (f x)) a" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4317 |
by (rule isCont_o2 [OF _ isCont_cot]) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4318 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4319 |
lemma tendsto_cot [tendsto_intros]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4320 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4321 |
shows "\<lbrakk>(f ---> a) F; sin a \<noteq> 0\<rbrakk> \<Longrightarrow> ((\<lambda>x. cot (f x)) ---> cot a) F" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4322 |
by (rule isCont_tendsto_compose [OF isCont_cot]) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4323 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4324 |
lemma continuous_cot: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4325 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4326 |
shows "continuous F f \<Longrightarrow> sin (f (Lim F (\<lambda>x. x))) \<noteq> 0 \<Longrightarrow> continuous F (\<lambda>x. cot (f x))" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4327 |
unfolding continuous_def by (rule tendsto_cot) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4328 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4329 |
lemma continuous_on_cot [continuous_intros]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4330 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4331 |
shows "continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. sin (f x) \<noteq> 0) \<Longrightarrow> continuous_on s (\<lambda>x. cot (f x))" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4332 |
unfolding continuous_on_def by (auto intro: tendsto_cot) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4333 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4334 |
lemma continuous_within_cot [continuous_intros]: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4335 |
fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4336 |
shows |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4337 |
"continuous (at x within s) f \<Longrightarrow> sin (f x) \<noteq> 0 \<Longrightarrow> continuous (at x within s) (\<lambda>x. cot (f x))" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4338 |
unfolding continuous_within by (rule tendsto_cot) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4339 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
4340 |
|
60758 | 4341 |
subsection \<open>Inverse Trigonometric Functions\<close> |
23043 | 4342 |
|
53079 | 4343 |
definition arcsin :: "real => real" |
4344 |
where "arcsin y = (THE x. -(pi/2) \<le> x & x \<le> pi/2 & sin x = y)" |
|
4345 |
||
4346 |
definition arccos :: "real => real" |
|
4347 |
where "arccos y = (THE x. 0 \<le> x & x \<le> pi & cos x = y)" |
|
4348 |
||
4349 |
definition arctan :: "real => real" |
|
4350 |
where "arctan y = (THE x. -(pi/2) < x & x < pi/2 & tan x = y)" |
|
23043 | 4351 |
|
15229 | 4352 |
lemma arcsin: |
53079 | 4353 |
"-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> |
4354 |
-(pi/2) \<le> arcsin y & arcsin y \<le> pi/2 & sin(arcsin y) = y" |
|
4355 |
unfolding arcsin_def by (rule theI' [OF sin_total]) |
|
23011 | 4356 |
|
4357 |
lemma arcsin_pi: |
|
53079 | 4358 |
"-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> -(pi/2) \<le> arcsin y & arcsin y \<le> pi & sin(arcsin y) = y" |
4359 |
apply (drule (1) arcsin) |
|
4360 |
apply (force intro: order_trans) |
|
4361 |
done |
|
4362 |
||
4363 |
lemma sin_arcsin [simp]: "-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> sin(arcsin y) = y" |
|
4364 |
by (blast dest: arcsin) |
|
4365 |
||
4366 |
lemma arcsin_bounded: "-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> -(pi/2) \<le> arcsin y & arcsin y \<le> pi/2" |
|
4367 |
by (blast dest: arcsin) |
|
4368 |
||
4369 |
lemma arcsin_lbound: "-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> -(pi/2) \<le> arcsin y" |
|
4370 |
by (blast dest: arcsin) |
|
4371 |
||
4372 |
lemma arcsin_ubound: "-1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arcsin y \<le> pi/2" |
|
4373 |
by (blast dest: arcsin) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4374 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4375 |
lemma arcsin_lt_bounded: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4376 |
"\<lbrakk>-1 < y; y < 1\<rbrakk> \<Longrightarrow> -(pi/2) < arcsin y & arcsin y < pi/2" |
53079 | 4377 |
apply (frule order_less_imp_le) |
4378 |
apply (frule_tac y = y in order_less_imp_le) |
|
4379 |
apply (frule arcsin_bounded) |
|
4380 |
apply (safe, simp) |
|
4381 |
apply (drule_tac y = "arcsin y" in order_le_imp_less_or_eq) |
|
4382 |
apply (drule_tac [2] y = "pi/2" in order_le_imp_less_or_eq, safe) |
|
4383 |
apply (drule_tac [!] f = sin in arg_cong, auto) |
|
4384 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4385 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4386 |
lemma arcsin_sin: "\<lbrakk>-(pi/2) \<le> x; x \<le> pi/2\<rbrakk> \<Longrightarrow> arcsin(sin x) = x" |
53079 | 4387 |
apply (unfold arcsin_def) |
4388 |
apply (rule the1_equality) |
|
4389 |
apply (rule sin_total, auto) |
|
4390 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4391 |
|
59869 | 4392 |
lemma arcsin_0 [simp]: "arcsin 0 = 0" |
4393 |
using arcsin_sin [of 0] |
|
4394 |
by simp |
|
4395 |
||
4396 |
lemma arcsin_1 [simp]: "arcsin 1 = pi/2" |
|
4397 |
using arcsin_sin [of "pi/2"] |
|
4398 |
by simp |
|
4399 |
||
4400 |
lemma arcsin_minus_1 [simp]: "arcsin (-1) = - (pi/2)" |
|
4401 |
using arcsin_sin [of "-pi/2"] |
|
4402 |
by simp |
|
4403 |
||
4404 |
lemma arcsin_minus: "-1 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> arcsin(-x) = -arcsin x" |
|
4405 |
by (metis (no_types, hide_lams) arcsin arcsin_sin minus_minus neg_le_iff_le sin_minus) |
|
4406 |
||
61944 | 4407 |
lemma arcsin_eq_iff: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> (arcsin x = arcsin y \<longleftrightarrow> x = y)" |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61609
diff
changeset
|
4408 |
by (metis abs_le_iff arcsin minus_le_iff) |
59869 | 4409 |
|
4410 |
lemma cos_arcsin_nonzero: "-1 < x \<Longrightarrow> x < 1 \<Longrightarrow> cos(arcsin x) \<noteq> 0" |
|
4411 |
using arcsin_lt_bounded cos_gt_zero_pi by force |
|
4412 |
||
22975 | 4413 |
lemma arccos: |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4414 |
"\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> |
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4415 |
\<Longrightarrow> 0 \<le> arccos y & arccos y \<le> pi & cos(arccos y) = y" |
53079 | 4416 |
unfolding arccos_def by (rule theI' [OF cos_total]) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4417 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4418 |
lemma cos_arccos [simp]: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> cos(arccos y) = y" |
53079 | 4419 |
by (blast dest: arccos) |
41970 | 4420 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4421 |
lemma arccos_bounded: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> arccos y & arccos y \<le> pi" |
53079 | 4422 |
by (blast dest: arccos) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4423 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4424 |
lemma arccos_lbound: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> arccos y" |
53079 | 4425 |
by (blast dest: arccos) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4426 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4427 |
lemma arccos_ubound: "\<lbrakk>-1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y \<le> pi" |
53079 | 4428 |
by (blast dest: arccos) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4429 |
|
22975 | 4430 |
lemma arccos_lt_bounded: |
59869 | 4431 |
"\<lbrakk>-1 < y; y < 1\<rbrakk> \<Longrightarrow> 0 < arccos y & arccos y < pi" |
53079 | 4432 |
apply (frule order_less_imp_le) |
4433 |
apply (frule_tac y = y in order_less_imp_le) |
|
4434 |
apply (frule arccos_bounded, auto) |
|
4435 |
apply (drule_tac y = "arccos y" in order_le_imp_less_or_eq) |
|
4436 |
apply (drule_tac [2] y = pi in order_le_imp_less_or_eq, auto) |
|
4437 |
apply (drule_tac [!] f = cos in arg_cong, auto) |
|
4438 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4439 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4440 |
lemma arccos_cos: "\<lbrakk>0 \<le> x; x \<le> pi\<rbrakk> \<Longrightarrow> arccos(cos x) = x" |
53079 | 4441 |
apply (simp add: arccos_def) |
4442 |
apply (auto intro!: the1_equality cos_total) |
|
4443 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4444 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4445 |
lemma arccos_cos2: "\<lbrakk>x \<le> 0; -pi \<le> x\<rbrakk> \<Longrightarrow> arccos(cos x) = -x" |
53079 | 4446 |
apply (simp add: arccos_def) |
4447 |
apply (auto intro!: the1_equality cos_total) |
|
4448 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4449 |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4450 |
lemma cos_arcsin: "\<lbrakk>-1 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> cos (arcsin x) = sqrt (1 - x\<^sup>2)" |
53079 | 4451 |
apply (subgoal_tac "x\<^sup>2 \<le> 1") |
4452 |
apply (rule power2_eq_imp_eq) |
|
4453 |
apply (simp add: cos_squared_eq) |
|
4454 |
apply (rule cos_ge_zero) |
|
4455 |
apply (erule (1) arcsin_lbound) |
|
4456 |
apply (erule (1) arcsin_ubound) |
|
4457 |
apply simp |
|
4458 |
apply (subgoal_tac "\<bar>x\<bar>\<^sup>2 \<le> 1\<^sup>2", simp) |
|
4459 |
apply (rule power_mono, simp, simp) |
|
4460 |
done |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4461 |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4462 |
lemma sin_arccos: "\<lbrakk>-1 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> sin (arccos x) = sqrt (1 - x\<^sup>2)" |
53079 | 4463 |
apply (subgoal_tac "x\<^sup>2 \<le> 1") |
4464 |
apply (rule power2_eq_imp_eq) |
|
4465 |
apply (simp add: sin_squared_eq) |
|
4466 |
apply (rule sin_ge_zero) |
|
4467 |
apply (erule (1) arccos_lbound) |
|
4468 |
apply (erule (1) arccos_ubound) |
|
4469 |
apply simp |
|
4470 |
apply (subgoal_tac "\<bar>x\<bar>\<^sup>2 \<le> 1\<^sup>2", simp) |
|
4471 |
apply (rule power_mono, simp, simp) |
|
4472 |
done |
|
4473 |
||
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4474 |
lemma arccos_0 [simp]: "arccos 0 = pi/2" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4475 |
by (metis arccos_cos cos_gt_zero cos_pi cos_pi_half pi_gt_zero pi_half_ge_zero not_le not_zero_less_neg_numeral numeral_One) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4476 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4477 |
lemma arccos_1 [simp]: "arccos 1 = 0" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4478 |
using arccos_cos by force |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4479 |
|
59869 | 4480 |
lemma arccos_minus_1 [simp]: "arccos(-1) = pi" |
4481 |
by (metis arccos_cos cos_pi order_refl pi_ge_zero) |
|
4482 |
||
4483 |
lemma arccos_minus: "-1 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> arccos(-x) = pi - arccos x" |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4484 |
by (metis arccos_cos arccos_cos2 cos_minus_pi cos_total diff_le_0_iff_le le_add_same_cancel1 |
59869 | 4485 |
minus_diff_eq uminus_add_conv_diff) |
4486 |
||
4487 |
lemma sin_arccos_nonzero: "-1 < x \<Longrightarrow> x < 1 \<Longrightarrow> ~(sin(arccos x) = 0)" |
|
4488 |
using arccos_lt_bounded sin_gt_zero by force |
|
4489 |
||
4490 |
lemma arctan: "- (pi/2) < arctan y & arctan y < pi/2 & tan (arctan y) = y" |
|
53079 | 4491 |
unfolding arctan_def by (rule theI' [OF tan_total]) |
4492 |
||
4493 |
lemma tan_arctan: "tan (arctan y) = y" |
|
59869 | 4494 |
by (simp add: arctan) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4495 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4496 |
lemma arctan_bounded: "- (pi/2) < arctan y & arctan y < pi/2" |
53079 | 4497 |
by (auto simp only: arctan) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4498 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4499 |
lemma arctan_lbound: "- (pi/2) < arctan y" |
59869 | 4500 |
by (simp add: arctan) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4501 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4502 |
lemma arctan_ubound: "arctan y < pi/2" |
53079 | 4503 |
by (auto simp only: arctan) |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4504 |
|
44746 | 4505 |
lemma arctan_unique: |
53079 | 4506 |
assumes "-(pi/2) < x" |
4507 |
and "x < pi/2" |
|
4508 |
and "tan x = y" |
|
44746 | 4509 |
shows "arctan y = x" |
4510 |
using assms arctan [of y] tan_total [of y] by (fast elim: ex1E) |
|
4511 |
||
53079 | 4512 |
lemma arctan_tan: "-(pi/2) < x \<Longrightarrow> x < pi/2 \<Longrightarrow> arctan (tan x) = x" |
4513 |
by (rule arctan_unique) simp_all |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4514 |
|
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4515 |
lemma arctan_zero_zero [simp]: "arctan 0 = 0" |
53079 | 4516 |
by (rule arctan_unique) simp_all |
44746 | 4517 |
|
4518 |
lemma arctan_minus: "arctan (- x) = - arctan x" |
|
4519 |
apply (rule arctan_unique) |
|
4520 |
apply (simp only: neg_less_iff_less arctan_ubound) |
|
59869 | 4521 |
apply (metis minus_less_iff arctan_lbound, simp add: arctan) |
44746 | 4522 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4523 |
|
44725 | 4524 |
lemma cos_arctan_not_zero [simp]: "cos (arctan x) \<noteq> 0" |
4525 |
by (intro less_imp_neq [symmetric] cos_gt_zero_pi |
|
4526 |
arctan_lbound arctan_ubound) |
|
4527 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4528 |
lemma cos_arctan: "cos (arctan x) = 1 / sqrt (1 + x\<^sup>2)" |
44725 | 4529 |
proof (rule power2_eq_imp_eq) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4530 |
have "0 < 1 + x\<^sup>2" by (simp add: add_pos_nonneg) |
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4531 |
show "0 \<le> 1 / sqrt (1 + x\<^sup>2)" by simp |
44725 | 4532 |
show "0 \<le> cos (arctan x)" |
4533 |
by (intro less_imp_le cos_gt_zero_pi arctan_lbound arctan_ubound) |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4534 |
have "(cos (arctan x))\<^sup>2 * (1 + (tan (arctan x))\<^sup>2) = 1" |
49962
a8cc904a6820
Renamed {left,right}_distrib to distrib_{right,left}.
webertj
parents:
47489
diff
changeset
|
4535 |
unfolding tan_def by (simp add: distrib_left power_divide) |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4536 |
thus "(cos (arctan x))\<^sup>2 = (1 / sqrt (1 + x\<^sup>2))\<^sup>2" |
60758 | 4537 |
using \<open>0 < 1 + x\<^sup>2\<close> by (simp add: arctan power_divide eq_divide_eq) |
44725 | 4538 |
qed |
4539 |
||
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4540 |
lemma sin_arctan: "sin (arctan x) = x / sqrt (1 + x\<^sup>2)" |
44725 | 4541 |
using add_pos_nonneg [OF zero_less_one zero_le_power2 [of x]] |
4542 |
using tan_arctan [of x] unfolding tan_def cos_arctan |
|
4543 |
by (simp add: eq_divide_eq) |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4544 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4545 |
lemma tan_sec: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59865
diff
changeset
|
4546 |
fixes x :: "'a::{real_normed_field,banach,field}" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4547 |
shows "cos x \<noteq> 0 \<Longrightarrow> 1 + (tan x)\<^sup>2 = (inverse (cos x))\<^sup>2" |
53079 | 4548 |
apply (rule power_inverse [THEN subst]) |
56217
dc429a5b13c4
Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents:
56213
diff
changeset
|
4549 |
apply (rule_tac c1 = "(cos x)\<^sup>2" in mult_right_cancel [THEN iffD1]) |
60867 | 4550 |
apply (auto simp add: tan_def field_simps) |
53079 | 4551 |
done |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
4552 |
|
44746 | 4553 |
lemma arctan_less_iff: "arctan x < arctan y \<longleftrightarrow> x < y" |
4554 |
by (metis tan_monotone' arctan_lbound arctan_ubound tan_arctan) |
|
4555 |
||
4556 |
lemma arctan_le_iff: "arctan x \<le> arctan y \<longleftrightarrow> x \<le> y" |
|
4557 |
by (simp only: not_less [symmetric] arctan_less_iff) |
|
4558 |
||
4559 |
lemma arctan_eq_iff: "arctan x = arctan y \<longleftrightarrow> x = y" |
|
4560 |
by (simp only: eq_iff [where 'a=real] arctan_le_iff) |
|
4561 |
||
4562 |
lemma zero_less_arctan_iff [simp]: "0 < arctan x \<longleftrightarrow> 0 < x" |
|
4563 |
using arctan_less_iff [of 0 x] by simp |
|
4564 |
||
4565 |
lemma arctan_less_zero_iff [simp]: "arctan x < 0 \<longleftrightarrow> x < 0" |
|
4566 |
using arctan_less_iff [of x 0] by simp |
|
4567 |
||
4568 |
lemma zero_le_arctan_iff [simp]: "0 \<le> arctan x \<longleftrightarrow> 0 \<le> x" |
|
4569 |
using arctan_le_iff [of 0 x] by simp |
|
4570 |
||
4571 |
lemma arctan_le_zero_iff [simp]: "arctan x \<le> 0 \<longleftrightarrow> x \<le> 0" |
|
4572 |
using arctan_le_iff [of x 0] by simp |
|
4573 |
||
4574 |
lemma arctan_eq_zero_iff [simp]: "arctan x = 0 \<longleftrightarrow> x = 0" |
|
4575 |
using arctan_eq_iff [of x 0] by simp |
|
4576 |
||
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4577 |
lemma continuous_on_arcsin': "continuous_on {-1 .. 1} arcsin" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4578 |
proof - |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4579 |
have "continuous_on (sin ` {- pi / 2 .. pi / 2}) arcsin" |
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
4580 |
by (rule continuous_on_inv) (auto intro: continuous_intros simp: arcsin_sin) |
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4581 |
also have "sin ` {- pi / 2 .. pi / 2} = {-1 .. 1}" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4582 |
proof safe |
53079 | 4583 |
fix x :: real |
4584 |
assume "x \<in> {-1..1}" |
|
4585 |
then show "x \<in> sin ` {- pi / 2..pi / 2}" |
|
4586 |
using arcsin_lbound arcsin_ubound |
|
56479
91958d4b30f7
revert c1bbd3e22226, a14831ac3023, and 36489d77c484: divide_minus_left/right are again simp rules
hoelzl
parents:
56409
diff
changeset
|
4587 |
by (intro image_eqI[where x="arcsin x"]) auto |
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4588 |
qed simp |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4589 |
finally show ?thesis . |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4590 |
qed |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4591 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
4592 |
lemma continuous_on_arcsin [continuous_intros]: |
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4593 |
"continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. -1 \<le> f x \<and> f x \<le> 1) \<Longrightarrow> continuous_on s (\<lambda>x. arcsin (f x))" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4594 |
using continuous_on_compose[of s f, OF _ continuous_on_subset[OF continuous_on_arcsin']] |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4595 |
by (auto simp: comp_def subset_eq) |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4596 |
|
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4597 |
lemma isCont_arcsin: "-1 < x \<Longrightarrow> x < 1 \<Longrightarrow> isCont arcsin x" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4598 |
using continuous_on_arcsin'[THEN continuous_on_subset, of "{ -1 <..< 1 }"] |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4599 |
by (auto simp: continuous_on_eq_continuous_at subset_eq) |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4600 |
|
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4601 |
lemma continuous_on_arccos': "continuous_on {-1 .. 1} arccos" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4602 |
proof - |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4603 |
have "continuous_on (cos ` {0 .. pi}) arccos" |
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
4604 |
by (rule continuous_on_inv) (auto intro: continuous_intros simp: arccos_cos) |
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4605 |
also have "cos ` {0 .. pi} = {-1 .. 1}" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4606 |
proof safe |
53079 | 4607 |
fix x :: real |
4608 |
assume "x \<in> {-1..1}" |
|
4609 |
then show "x \<in> cos ` {0..pi}" |
|
4610 |
using arccos_lbound arccos_ubound |
|
4611 |
by (intro image_eqI[where x="arccos x"]) auto |
|
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4612 |
qed simp |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4613 |
finally show ?thesis . |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4614 |
qed |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4615 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
4616 |
lemma continuous_on_arccos [continuous_intros]: |
51482
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4617 |
"continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. -1 \<le> f x \<and> f x \<le> 1) \<Longrightarrow> continuous_on s (\<lambda>x. arccos (f x))" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4618 |
using continuous_on_compose[of s f, OF _ continuous_on_subset[OF continuous_on_arccos']] |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4619 |
by (auto simp: comp_def subset_eq) |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4620 |
|
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4621 |
lemma isCont_arccos: "-1 < x \<Longrightarrow> x < 1 \<Longrightarrow> isCont arccos x" |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4622 |
using continuous_on_arccos'[THEN continuous_on_subset, of "{ -1 <..< 1 }"] |
80efd8c49f52
arcsin and arccos are continuous on {0 .. 1} (including the endpoints)
hoelzl
parents:
51481
diff
changeset
|
4623 |
by (auto simp: continuous_on_eq_continuous_at subset_eq) |
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4624 |
|
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4625 |
lemma isCont_arctan: "isCont arctan x" |
53079 | 4626 |
apply (rule arctan_lbound [of x, THEN dense, THEN exE], clarify) |
4627 |
apply (rule arctan_ubound [of x, THEN dense, THEN exE], clarify) |
|
59869 | 4628 |
apply (subgoal_tac "isCont arctan (tan (arctan x))", simp add: arctan) |
53079 | 4629 |
apply (erule (1) isCont_inverse_function2 [where f=tan]) |
4630 |
apply (metis arctan_tan order_le_less_trans order_less_le_trans) |
|
4631 |
apply (metis cos_gt_zero_pi isCont_tan order_less_le_trans less_le) |
|
4632 |
done |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4633 |
|
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4634 |
lemma tendsto_arctan [tendsto_intros]: "(f ---> x) F \<Longrightarrow> ((\<lambda>x. arctan (f x)) ---> arctan x) F" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4635 |
by (rule isCont_tendsto_compose [OF isCont_arctan]) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4636 |
|
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4637 |
lemma continuous_arctan [continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. arctan (f x))" |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4638 |
unfolding continuous_def by (rule tendsto_arctan) |
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4639 |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56261
diff
changeset
|
4640 |
lemma continuous_on_arctan [continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. arctan (f x))" |
51478
270b21f3ae0a
move continuous and continuous_on to the HOL image; isCont is an abbreviation for continuous (at x) (isCont is now restricted to a T2 space)
hoelzl
parents:
51477
diff
changeset
|
4641 |
unfolding continuous_on_def by (auto intro: tendsto_arctan) |
53079 | 4642 |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4643 |
lemma DERIV_arcsin: |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4644 |
"\<lbrakk>-1 < x; x < 1\<rbrakk> \<Longrightarrow> DERIV arcsin x :> inverse (sqrt (1 - x\<^sup>2))" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4645 |
apply (rule DERIV_inverse_function [where f=sin and a="-1" and b=1]) |
53079 | 4646 |
apply (rule DERIV_cong [OF DERIV_sin]) |
4647 |
apply (simp add: cos_arcsin) |
|
4648 |
apply (subgoal_tac "\<bar>x\<bar>\<^sup>2 < 1\<^sup>2", simp) |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4649 |
apply (rule power_strict_mono, simp, simp, simp, assumption, assumption) |
53079 | 4650 |
apply simp |
4651 |
apply (erule (1) isCont_arcsin) |
|
4652 |
done |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4653 |
|
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4654 |
lemma DERIV_arccos: |
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4655 |
"\<lbrakk>-1 < x; x < 1\<rbrakk> \<Longrightarrow> DERIV arccos x :> inverse (- sqrt (1 - x\<^sup>2))" |
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4656 |
apply (rule DERIV_inverse_function [where f=cos and a="-1" and b=1]) |
53079 | 4657 |
apply (rule DERIV_cong [OF DERIV_cos]) |
4658 |
apply (simp add: sin_arccos) |
|
4659 |
apply (subgoal_tac "\<bar>x\<bar>\<^sup>2 < 1\<^sup>2", simp) |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
4660 |
apply (rule power_strict_mono, simp, simp, simp, assumption, assumption) |
53079 | 4661 |
apply simp |
4662 |
apply (erule (1) isCont_arccos) |
|
4663 |
done |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4664 |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
4665 |
lemma DERIV_arctan: "DERIV arctan x :> inverse (1 + x\<^sup>2)" |
53079 | 4666 |
apply (rule DERIV_inverse_function [where f=tan and a="x - 1" and b="x + 1"]) |
4667 |
apply (rule DERIV_cong [OF DERIV_tan]) |
|
4668 |
apply (rule cos_arctan_not_zero) |
|
60867 | 4669 |
apply (simp_all add: add_pos_nonneg arctan isCont_arctan) |
4670 |
apply (simp add: arctan power_inverse [symmetric] tan_sec [symmetric]) |
|
53079 | 4671 |
apply (subgoal_tac "0 < 1 + x\<^sup>2", simp) |
59869 | 4672 |
apply (simp_all add: add_pos_nonneg arctan isCont_arctan) |
53079 | 4673 |
done |
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
4674 |
|
31880 | 4675 |
declare |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
4676 |
DERIV_arcsin[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
4677 |
DERIV_arcsin[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
4678 |
DERIV_arccos[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
4679 |
DERIV_arccos[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
4680 |
DERIV_arctan[THEN DERIV_chain2, derivative_intros] |
61518
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
paulson
parents:
61284
diff
changeset
|
4681 |
DERIV_arctan[THEN DERIV_chain2, unfolded has_field_derivative_def, derivative_intros] |
31880 | 4682 |
|
61881
b4bfa62e799d
Transcendental: use [simp]-canonical form - (pi/2)
hoelzl
parents:
61810
diff
changeset
|
4683 |
lemma filterlim_tan_at_right: "filterlim tan at_bot (at_right (- (pi/2)))" |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4684 |
by (rule filterlim_at_bot_at_right[where Q="\<lambda>x. - pi/2 < x \<and> x < pi/2" and P="\<lambda>x. True" and g=arctan]) |
59869 | 4685 |
(auto simp: arctan le_less eventually_at dist_real_def simp del: less_divide_eq_numeral1 |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4686 |
intro!: tan_monotone exI[of _ "pi/2"]) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4687 |
|
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4688 |
lemma filterlim_tan_at_left: "filterlim tan at_top (at_left (pi/2))" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4689 |
by (rule filterlim_at_top_at_left[where Q="\<lambda>x. - pi/2 < x \<and> x < pi/2" and P="\<lambda>x. True" and g=arctan]) |
59869 | 4690 |
(auto simp: arctan le_less eventually_at dist_real_def simp del: less_divide_eq_numeral1 |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4691 |
intro!: tan_monotone exI[of _ "pi/2"]) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4692 |
|
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4693 |
lemma tendsto_arctan_at_top: "(arctan ---> (pi/2)) at_top" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4694 |
proof (rule tendstoI) |
53079 | 4695 |
fix e :: real |
4696 |
assume "0 < e" |
|
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4697 |
def y \<equiv> "pi/2 - min (pi/2) e" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4698 |
then have y: "0 \<le> y" "y < pi/2" "pi/2 \<le> e + y" |
60758 | 4699 |
using \<open>0 < e\<close> by auto |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4700 |
|
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4701 |
show "eventually (\<lambda>x. dist (arctan x) (pi / 2) < e) at_top" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4702 |
proof (intro eventually_at_top_dense[THEN iffD2] exI allI impI) |
53079 | 4703 |
fix x |
4704 |
assume "tan y < x" |
|
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4705 |
then have "arctan (tan y) < arctan x" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4706 |
by (simp add: arctan_less_iff) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4707 |
with y have "y < arctan x" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4708 |
by (subst (asm) arctan_tan) simp_all |
60758 | 4709 |
with arctan_ubound[of x, arith] y \<open>0 < e\<close> |
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4710 |
show "dist (arctan x) (pi / 2) < e" |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4711 |
by (simp add: dist_real_def) |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4712 |
qed |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4713 |
qed |
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4714 |
|
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4715 |
lemma tendsto_arctan_at_bot: "(arctan ---> - (pi/2)) at_bot" |
53079 | 4716 |
unfolding filterlim_at_bot_mirror arctan_minus |
4717 |
by (intro tendsto_minus tendsto_arctan_at_top) |
|
4718 |
||
50346
a75c6429c3c3
add filterlim rules for eventually monotone bijective functions; mirror rules for at_top, at_bot; apply them to prove convergence of arctan at infinity and tan at pi/2
hoelzl
parents:
50326
diff
changeset
|
4719 |
|
60758 | 4720 |
subsection\<open>Prove Totality of the Trigonometric Functions\<close> |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4721 |
|
59869 | 4722 |
lemma cos_arccos_abs: "\<bar>y\<bar> \<le> 1 \<Longrightarrow> cos (arccos y) = y" |
4723 |
by (simp add: abs_le_iff) |
|
4724 |
||
4725 |
lemma sin_arccos_abs: "\<bar>y\<bar> \<le> 1 \<Longrightarrow> sin (arccos y) = sqrt (1 - y\<^sup>2)" |
|
4726 |
by (simp add: sin_arccos abs_le_iff) |
|
4727 |
||
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4728 |
lemma sin_mono_less_eq: "\<lbrakk>-(pi/2) \<le> x; x \<le> pi/2; -(pi/2) \<le> y; y \<le> pi/2\<rbrakk> |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4729 |
\<Longrightarrow> (sin(x) < sin(y) \<longleftrightarrow> x < y)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4730 |
by (metis not_less_iff_gr_or_eq sin_monotone_2pi) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4731 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4732 |
lemma sin_mono_le_eq: "\<lbrakk>-(pi/2) \<le> x; x \<le> pi/2; -(pi/2) \<le> y; y \<le> pi/2\<rbrakk> |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4733 |
\<Longrightarrow> (sin(x) \<le> sin(y) \<longleftrightarrow> x \<le> y)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4734 |
by (meson leD le_less_linear sin_monotone_2pi sin_monotone_2pi_le) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4735 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4736 |
lemma sin_inj_pi: |
59869 | 4737 |
"\<lbrakk>-(pi/2) \<le> x; x \<le> pi/2;-(pi/2) \<le> y; y \<le> pi/2; sin(x) = sin(y)\<rbrakk> \<Longrightarrow> x = y" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4738 |
by (metis arcsin_sin) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4739 |
|
59869 | 4740 |
lemma cos_mono_less_eq: |
4741 |
"0 \<le> x ==> x \<le> pi ==> 0 \<le> y ==> y \<le> pi \<Longrightarrow> (cos(x) < cos(y) \<longleftrightarrow> y < x)" |
|
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4742 |
by (meson cos_monotone_0_pi cos_monotone_0_pi_le leD le_less_linear) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4743 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4744 |
lemma cos_mono_le_eq: "0 \<le> x ==> x \<le> pi ==> 0 \<le> y ==> y \<le> pi |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4745 |
\<Longrightarrow> (cos(x) \<le> cos(y) \<longleftrightarrow> y \<le> x)" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4746 |
by (metis arccos_cos cos_monotone_0_pi_le eq_iff linear) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4747 |
|
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4748 |
lemma cos_inj_pi: "0 \<le> x ==> x \<le> pi ==> 0 \<le> y ==> y \<le> pi ==> cos(x) = cos(y) |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4749 |
\<Longrightarrow> x = y" |
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4750 |
by (metis arccos_cos) |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4751 |
|
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4752 |
lemma arccos_le_pi2: "\<lbrakk>0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y \<le> pi/2" |
59751
916c0f6c83e3
New material for complex sin, cos, tan, Ln, also some reorganisation
paulson <lp15@cam.ac.uk>
parents:
59746
diff
changeset
|
4753 |
by (metis (mono_tags) arccos_0 arccos cos_le_one cos_monotone_0_pi_le |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4754 |
cos_pi cos_pi_half pi_half_ge_zero antisym_conv less_eq_neg_nonpos linear minus_minus order.trans order_refl) |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4755 |
|
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4756 |
lemma sincos_total_pi_half: |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4757 |
assumes "0 \<le> x" "0 \<le> y" "x\<^sup>2 + y\<^sup>2 = 1" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4758 |
shows "\<exists>t. 0 \<le> t \<and> t \<le> pi/2 \<and> x = cos t \<and> y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4759 |
proof - |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4760 |
have x1: "x \<le> 1" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4761 |
using assms |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4762 |
by (metis le_add_same_cancel1 power2_le_imp_le power_one zero_le_power2) |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4763 |
moreover with assms have ax: "0 \<le> arccos x" "cos(arccos x) = x" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4764 |
by (auto simp: arccos) |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4765 |
moreover have "y = sqrt (1 - x\<^sup>2)" using assms |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4766 |
by (metis abs_of_nonneg add.commute add_diff_cancel real_sqrt_abs) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4767 |
ultimately show ?thesis using assms arccos_le_pi2 [of x] |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4768 |
by (rule_tac x="arccos x" in exI) (auto simp: sin_arccos) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4769 |
qed |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4770 |
|
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4771 |
lemma sincos_total_pi: |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4772 |
assumes "0 \<le> y" and "x\<^sup>2 + y\<^sup>2 = 1" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4773 |
shows "\<exists>t. 0 \<le> t \<and> t \<le> pi \<and> x = cos t \<and> y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4774 |
proof (cases rule: le_cases [of 0 x]) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4775 |
case le from sincos_total_pi_half [OF le] |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4776 |
show ?thesis |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4777 |
by (metis pi_ge_two pi_half_le_two add.commute add_le_cancel_left add_mono assms) |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4778 |
next |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4779 |
case ge |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4780 |
then have "0 \<le> -x" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4781 |
by simp |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4782 |
then obtain t where "t\<ge>0" "t \<le> pi/2" "-x = cos t" "y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4783 |
using sincos_total_pi_half assms |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4784 |
apply auto |
60758 | 4785 |
by (metis \<open>0 \<le> - x\<close> power2_minus) |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4786 |
then show ?thesis |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4787 |
by (rule_tac x="pi-t" in exI, auto) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4788 |
qed |
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4789 |
|
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4790 |
lemma sincos_total_2pi_le: |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4791 |
assumes "x\<^sup>2 + y\<^sup>2 = 1" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4792 |
shows "\<exists>t. 0 \<le> t \<and> t \<le> 2*pi \<and> x = cos t \<and> y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4793 |
proof (cases rule: le_cases [of 0 y]) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4794 |
case le from sincos_total_pi [OF le] |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4795 |
show ?thesis |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4796 |
by (metis assms le_add_same_cancel1 mult.commute mult_2_right order.trans) |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4797 |
next |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4798 |
case ge |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4799 |
then have "0 \<le> -y" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4800 |
by simp |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4801 |
then obtain t where "t\<ge>0" "t \<le> pi" "x = cos t" "-y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4802 |
using sincos_total_pi assms |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4803 |
apply auto |
60758 | 4804 |
by (metis \<open>0 \<le> - y\<close> power2_minus) |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4805 |
then show ?thesis |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4806 |
by (rule_tac x="2*pi-t" in exI, auto) |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4807 |
qed |
59746
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4808 |
|
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4809 |
lemma sincos_total_2pi: |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4810 |
assumes "x\<^sup>2 + y\<^sup>2 = 1" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4811 |
obtains t where "0 \<le> t" "t < 2*pi" "x = cos t" "y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4812 |
proof - |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4813 |
from sincos_total_2pi_le [OF assms] |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4814 |
obtain t where t: "0 \<le> t" "t \<le> 2*pi" "x = cos t" "y = sin t" |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4815 |
by blast |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4816 |
show ?thesis |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4817 |
apply (cases "t = 2*pi") |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4818 |
using t that |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4819 |
apply force+ |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4820 |
done |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4821 |
qed |
ddae5727c5a9
new HOL Light material about exp, sin, cos
paulson <lp15@cam.ac.uk>
parents:
59741
diff
changeset
|
4822 |
|
61944 | 4823 |
lemma arcsin_less_mono: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> arcsin x < arcsin y \<longleftrightarrow> x < y" |
59869 | 4824 |
apply (rule trans [OF sin_mono_less_eq [symmetric]]) |
4825 |
using arcsin_ubound arcsin_lbound |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
4826 |
apply auto |
59869 | 4827 |
done |
4828 |
||
61944 | 4829 |
lemma arcsin_le_mono: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> arcsin x \<le> arcsin y \<longleftrightarrow> x \<le> y" |
59869 | 4830 |
using arcsin_less_mono not_le by blast |
4831 |
||
4832 |
lemma arcsin_less_arcsin: "-1 \<le> x \<Longrightarrow> x < y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arcsin x < arcsin y" |
|
4833 |
using arcsin_less_mono by auto |
|
4834 |
||
4835 |
lemma arcsin_le_arcsin: "-1 \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arcsin x \<le> arcsin y" |
|
4836 |
using arcsin_le_mono by auto |
|
4837 |
||
61944 | 4838 |
lemma arccos_less_mono: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> (arccos x < arccos y \<longleftrightarrow> y < x)" |
59869 | 4839 |
apply (rule trans [OF cos_mono_less_eq [symmetric]]) |
4840 |
using arccos_ubound arccos_lbound |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
4841 |
apply auto |
59869 | 4842 |
done |
4843 |
||
61944 | 4844 |
lemma arccos_le_mono: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> arccos x \<le> arccos y \<longleftrightarrow> y \<le> x" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4845 |
using arccos_less_mono [of y x] |
59869 | 4846 |
by (simp add: not_le [symmetric]) |
4847 |
||
4848 |
lemma arccos_less_arccos: "-1 \<le> x \<Longrightarrow> x < y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arccos y < arccos x" |
|
4849 |
using arccos_less_mono by auto |
|
4850 |
||
4851 |
lemma arccos_le_arccos: "-1 \<le> x \<Longrightarrow> x \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> arccos y \<le> arccos x" |
|
4852 |
using arccos_le_mono by auto |
|
4853 |
||
61944 | 4854 |
lemma arccos_eq_iff: "\<bar>x\<bar> \<le> 1 & \<bar>y\<bar> \<le> 1 \<Longrightarrow> (arccos x = arccos y \<longleftrightarrow> x = y)" |
59869 | 4855 |
using cos_arccos_abs by fastforce |
4856 |
||
60758 | 4857 |
subsection \<open>Machins formula\<close> |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4858 |
|
44746 | 4859 |
lemma arctan_one: "arctan 1 = pi / 4" |
4860 |
by (rule arctan_unique, simp_all add: tan_45 m2pi_less_pi) |
|
4861 |
||
53079 | 4862 |
lemma tan_total_pi4: |
4863 |
assumes "\<bar>x\<bar> < 1" |
|
4864 |
shows "\<exists>z. - (pi / 4) < z \<and> z < pi / 4 \<and> tan z = x" |
|
44746 | 4865 |
proof |
4866 |
show "- (pi / 4) < arctan x \<and> arctan x < pi / 4 \<and> tan (arctan x) = x" |
|
4867 |
unfolding arctan_one [symmetric] arctan_minus [symmetric] |
|
59869 | 4868 |
unfolding arctan_less_iff using assms by (auto simp add: arctan) |
4869 |
||
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4870 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4871 |
|
53079 | 4872 |
lemma arctan_add: |
4873 |
assumes "\<bar>x\<bar> \<le> 1" and "\<bar>y\<bar> < 1" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4874 |
shows "arctan x + arctan y = arctan ((x + y) / (1 - x * y))" |
44746 | 4875 |
proof (rule arctan_unique [symmetric]) |
4876 |
have "- (pi / 4) \<le> arctan x" and "- (pi / 4) < arctan y" |
|
4877 |
unfolding arctan_one [symmetric] arctan_minus [symmetric] |
|
4878 |
unfolding arctan_le_iff arctan_less_iff using assms by auto |
|
4879 |
from add_le_less_mono [OF this] |
|
4880 |
show 1: "- (pi / 2) < arctan x + arctan y" by simp |
|
4881 |
have "arctan x \<le> pi / 4" and "arctan y < pi / 4" |
|
4882 |
unfolding arctan_one [symmetric] |
|
4883 |
unfolding arctan_le_iff arctan_less_iff using assms by auto |
|
4884 |
from add_le_less_mono [OF this] |
|
4885 |
show 2: "arctan x + arctan y < pi / 2" by simp |
|
4886 |
show "tan (arctan x + arctan y) = (x + y) / (1 - x * y)" |
|
59869 | 4887 |
using cos_gt_zero_pi [OF 1 2] by (simp add: arctan tan_add) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4888 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4889 |
|
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4890 |
lemma arctan_double: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4891 |
assumes "\<bar>x\<bar> < 1" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4892 |
shows "2 * arctan x = arctan ((2*x) / (1 - x\<^sup>2))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4893 |
by (metis assms arctan_add linear mult_2 not_less power2_eq_square) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4894 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4895 |
theorem machin: "pi / 4 = 4 * arctan (1/5) - arctan (1 / 239)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4896 |
proof - |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4897 |
have "\<bar>1 / 5\<bar> < (1 :: real)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4898 |
from arctan_add[OF less_imp_le[OF this] this] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4899 |
have "2 * arctan (1 / 5) = arctan (5 / 12)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4900 |
moreover |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4901 |
have "\<bar>5 / 12\<bar> < (1 :: real)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4902 |
from arctan_add[OF less_imp_le[OF this] this] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4903 |
have "2 * arctan (5 / 12) = arctan (120 / 119)" by auto |
41970 | 4904 |
moreover |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4905 |
have "\<bar>1\<bar> \<le> (1::real)" and "\<bar>1 / 239\<bar> < (1::real)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4906 |
from arctan_add[OF this] |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4907 |
have "arctan 1 + arctan (1 / 239) = arctan (120 / 119)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4908 |
ultimately have "arctan 1 + arctan (1 / 239) = 4 * arctan (1 / 5)" by auto |
44746 | 4909 |
thus ?thesis unfolding arctan_one by algebra |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4910 |
qed |
44746 | 4911 |
|
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4912 |
lemma machin_Euler: "5 * arctan(1/7) + 2 * arctan(3/79) = pi/4" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4913 |
proof - |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4914 |
have 17: "\<bar>1/7\<bar> < (1 :: real)" by auto |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4915 |
with arctan_double have "2 * arctan (1/7) = arctan (7/24)" |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4916 |
by simp (simp add: field_simps) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4917 |
moreover have "\<bar>7/24\<bar> < (1 :: real)" by auto |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4918 |
with arctan_double have "2 * arctan (7/24) = arctan (336/527)" by simp (simp add: field_simps) |
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4919 |
moreover have "\<bar>336/527\<bar> < (1 :: real)" by auto |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4920 |
from arctan_add[OF less_imp_le[OF 17] this] |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
4921 |
have "arctan(1/7) + arctan (336/527) = arctan (2879/3353)" by auto |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4922 |
ultimately have I: "5 * arctan(1/7) = arctan (2879/3353)" by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4923 |
have 379: "\<bar>3/79\<bar> < (1 :: real)" by auto |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
4924 |
with arctan_double have II: "2 * arctan (3/79) = arctan (237/3116)" by simp (simp add: field_simps) |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4925 |
have *: "\<bar>2879/3353\<bar> < (1 :: real)" by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4926 |
have "\<bar>237/3116\<bar> < (1 :: real)" by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4927 |
from arctan_add[OF less_imp_le[OF *] this] |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4928 |
have "arctan (2879/3353) + arctan (237/3116) = pi/4" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4929 |
by (simp add: arctan_one) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4930 |
then show ?thesis using I II |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4931 |
by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4932 |
qed |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4933 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4934 |
(*But could also prove MACHIN_GAUSS: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4935 |
12 * arctan(1/18) + 8 * arctan(1/57) - 5 * arctan(1/239) = pi/4*) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
4936 |
|
53079 | 4937 |
|
60758 | 4938 |
subsection \<open>Introducing the inverse tangent power series\<close> |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4939 |
|
53079 | 4940 |
lemma monoseq_arctan_series: |
4941 |
fixes x :: real |
|
4942 |
assumes "\<bar>x\<bar> \<le> 1" |
|
4943 |
shows "monoseq (\<lambda> n. 1 / real (n*2+1) * x^(n*2+1))" (is "monoseq ?a") |
|
4944 |
proof (cases "x = 0") |
|
4945 |
case True |
|
4946 |
thus ?thesis unfolding monoseq_def One_nat_def by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4947 |
next |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4948 |
case False |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4949 |
have "norm x \<le> 1" and "x \<le> 1" and "-1 \<le> x" using assms by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4950 |
show "monoseq ?a" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4951 |
proof - |
53079 | 4952 |
{ |
4953 |
fix n |
|
4954 |
fix x :: real |
|
4955 |
assume "0 \<le> x" and "x \<le> 1" |
|
4956 |
have "1 / real (Suc (Suc n * 2)) * x ^ Suc (Suc n * 2) \<le> |
|
4957 |
1 / real (Suc (n * 2)) * x ^ Suc (n * 2)" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4958 |
proof (rule mult_mono) |
53079 | 4959 |
show "1 / real (Suc (Suc n * 2)) \<le> 1 / real (Suc (n * 2))" |
4960 |
by (rule frac_le) simp_all |
|
4961 |
show "0 \<le> 1 / real (Suc (n * 2))" |
|
4962 |
by auto |
|
4963 |
show "x ^ Suc (Suc n * 2) \<le> x ^ Suc (n * 2)" |
|
60758 | 4964 |
by (rule power_decreasing) (simp_all add: \<open>0 \<le> x\<close> \<open>x \<le> 1\<close>) |
53079 | 4965 |
show "0 \<le> x ^ Suc (Suc n * 2)" |
60758 | 4966 |
by (rule zero_le_power) (simp add: \<open>0 \<le> x\<close>) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4967 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4968 |
} note mono = this |
41970 | 4969 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4970 |
show ?thesis |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4971 |
proof (cases "0 \<le> x") |
60758 | 4972 |
case True from mono[OF this \<open>x \<le> 1\<close>, THEN allI] |
53079 | 4973 |
show ?thesis unfolding Suc_eq_plus1[symmetric] |
4974 |
by (rule mono_SucI2) |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4975 |
next |
53079 | 4976 |
case False |
60758 | 4977 |
hence "0 \<le> -x" and "-x \<le> 1" using \<open>-1 \<le> x\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4978 |
from mono[OF this] |
53079 | 4979 |
have "\<And>n. 1 / real (Suc (Suc n * 2)) * x ^ Suc (Suc n * 2) \<ge> |
60758 | 4980 |
1 / real (Suc (n * 2)) * x ^ Suc (n * 2)" using \<open>0 \<le> -x\<close> by auto |
31790 | 4981 |
thus ?thesis unfolding Suc_eq_plus1[symmetric] by (rule mono_SucI1[OF allI]) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4982 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4983 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4984 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4985 |
|
53079 | 4986 |
lemma zeroseq_arctan_series: |
4987 |
fixes x :: real |
|
4988 |
assumes "\<bar>x\<bar> \<le> 1" |
|
4989 |
shows "(\<lambda> n. 1 / real (n*2+1) * x^(n*2+1)) ----> 0" (is "?a ----> 0") |
|
4990 |
proof (cases "x = 0") |
|
4991 |
case True |
|
4992 |
thus ?thesis |
|
58729
e8ecc79aee43
add tendsto_const and tendsto_ident_at as simp and intro rules
hoelzl
parents:
58710
diff
changeset
|
4993 |
unfolding One_nat_def by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4994 |
next |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4995 |
case False |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4996 |
have "norm x \<le> 1" and "x \<le> 1" and "-1 \<le> x" using assms by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4997 |
show "?a ----> 0" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
4998 |
proof (cases "\<bar>x\<bar> < 1") |
53079 | 4999 |
case True |
5000 |
hence "norm x < 1" by auto |
|
60758 | 5001 |
from tendsto_mult[OF LIMSEQ_inverse_real_of_nat LIMSEQ_power_zero[OF \<open>norm x < 1\<close>, THEN LIMSEQ_Suc]] |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
5002 |
have "(\<lambda>n. 1 / real (n + 1) * x ^ (n + 1)) ----> 0" |
31790 | 5003 |
unfolding inverse_eq_divide Suc_eq_plus1 by simp |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
5004 |
then show ?thesis using pos2 by (rule LIMSEQ_linear) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5005 |
next |
53079 | 5006 |
case False |
60758 | 5007 |
hence "x = -1 \<or> x = 1" using \<open>\<bar>x\<bar> \<le> 1\<close> by auto |
53079 | 5008 |
hence n_eq: "\<And> n. x ^ (n * 2 + 1) = x" |
5009 |
unfolding One_nat_def by auto |
|
44568
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
huffman
parents:
44319
diff
changeset
|
5010 |
from tendsto_mult[OF LIMSEQ_inverse_real_of_nat[THEN LIMSEQ_linear, OF pos2, unfolded inverse_eq_divide] tendsto_const[of x]] |
31790 | 5011 |
show ?thesis unfolding n_eq Suc_eq_plus1 by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5012 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5013 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5014 |
|
53079 | 5015 |
lemma summable_arctan_series: |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
5016 |
fixes n :: nat |
53079 | 5017 |
assumes "\<bar>x\<bar> \<le> 1" |
5018 |
shows "summable (\<lambda> k. (-1)^k * (1 / real (k*2+1) * x ^ (k*2+1)))" |
|
5019 |
(is "summable (?c x)") |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5020 |
by (rule summable_Leibniz(1), rule zeroseq_arctan_series[OF assms], rule monoseq_arctan_series[OF assms]) |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5021 |
|
53079 | 5022 |
lemma DERIV_arctan_series: |
5023 |
assumes "\<bar> x \<bar> < 1" |
|
5024 |
shows "DERIV (\<lambda> x'. \<Sum> k. (-1)^k * (1 / real (k*2+1) * x' ^ (k*2+1))) x :> (\<Sum> k. (-1)^k * x^(k*2))" |
|
5025 |
(is "DERIV ?arctan _ :> ?Int") |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5026 |
proof - |
53079 | 5027 |
let ?f = "\<lambda>n. if even n then (-1)^(n div 2) * 1 / real (Suc n) else 0" |
5028 |
||
5029 |
have n_even: "\<And>n :: nat. even n \<Longrightarrow> 2 * (n div 2) = n" |
|
5030 |
by presburger |
|
5031 |
then have if_eq: "\<And>n x'. ?f n * real (Suc n) * x'^n = |
|
5032 |
(if even n then (-1)^(n div 2) * x'^(2 * (n div 2)) else 0)" |
|
5033 |
by auto |
|
5034 |
||
5035 |
{ |
|
5036 |
fix x :: real |
|
5037 |
assume "\<bar>x\<bar> < 1" |
|
59865
8a20dd967385
rationalised and generalised some theorems concerning abs and x^2.
paulson <lp15@cam.ac.uk>
parents:
59862
diff
changeset
|
5038 |
hence "x\<^sup>2 < 1" by (simp add: abs_square_less_1) |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5039 |
have "summable (\<lambda> n. (- 1) ^ n * (x\<^sup>2) ^n)" |
60758 | 5040 |
by (rule summable_Leibniz(1), auto intro!: LIMSEQ_realpow_zero monoseq_realpow \<open>x\<^sup>2 < 1\<close> order_less_imp_le[OF \<open>x\<^sup>2 < 1\<close>]) |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5041 |
hence "summable (\<lambda> n. (- 1) ^ n * x^(2*n))" unfolding power_mult . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5042 |
} note summable_Integral = this |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5043 |
|
53079 | 5044 |
{ |
5045 |
fix f :: "nat \<Rightarrow> real" |
|
5046 |
have "\<And>x. f sums x = (\<lambda> n. if even n then f (n div 2) else 0) sums x" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5047 |
proof |
53079 | 5048 |
fix x :: real |
5049 |
assume "f sums x" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5050 |
from sums_if[OF sums_zero this] |
53079 | 5051 |
show "(\<lambda>n. if even n then f (n div 2) else 0) sums x" |
5052 |
by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5053 |
next |
53079 | 5054 |
fix x :: real |
5055 |
assume "(\<lambda> n. if even n then f (n div 2) else 0) sums x" |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
5056 |
from LIMSEQ_linear[OF this[unfolded sums_def] pos2, unfolded sum_split_even_odd[unfolded mult.commute]] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5057 |
show "f sums x" unfolding sums_def by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5058 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5059 |
hence "op sums f = op sums (\<lambda> n. if even n then f (n div 2) else 0)" .. |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5060 |
} note sums_even = this |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5061 |
|
53079 | 5062 |
have Int_eq: "(\<Sum>n. ?f n * real (Suc n) * x^n) = ?Int" |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5063 |
unfolding if_eq mult.commute[of _ 2] suminf_def sums_even[of "\<lambda> n. (- 1) ^ n * x ^ (2 * n)", symmetric] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5064 |
by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5065 |
|
53079 | 5066 |
{ |
5067 |
fix x :: real |
|
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5068 |
have if_eq': "\<And>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n = |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5069 |
(if even n then (- 1) ^ (n div 2) * (1 / real (Suc (2 * (n div 2))) * x ^ Suc (2 * (n div 2))) else 0)" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5070 |
using n_even by auto |
53079 | 5071 |
have idx_eq: "\<And>n. n * 2 + 1 = Suc (2 * n)" by auto |
5072 |
have "(\<Sum>n. ?f n * x^(Suc n)) = ?arctan x" |
|
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5073 |
unfolding if_eq' idx_eq suminf_def sums_even[of "\<lambda> n. (- 1) ^ n * (1 / real (Suc (2 * n)) * x ^ Suc (2 * n))", symmetric] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5074 |
by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5075 |
} note arctan_eq = this |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5076 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5077 |
have "DERIV (\<lambda> x. \<Sum> n. ?f n * x^(Suc n)) x :> (\<Sum> n. ?f n * real (Suc n) * x^n)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5078 |
proof (rule DERIV_power_series') |
60758 | 5079 |
show "x \<in> {- 1 <..< 1}" using \<open>\<bar> x \<bar> < 1\<close> by auto |
53079 | 5080 |
{ |
5081 |
fix x' :: real |
|
5082 |
assume x'_bounds: "x' \<in> {- 1 <..< 1}" |
|
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5083 |
then have "\<bar>x'\<bar> < 1" by auto |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5084 |
then |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5085 |
have *: "summable (\<lambda>n. (- 1) ^ n * x' ^ (2 * n))" |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5086 |
by (rule summable_Integral) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5087 |
let ?S = "\<Sum> n. (-1)^n * x'^(2 * n)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5088 |
show "summable (\<lambda> n. ?f n * real (Suc n) * x'^n)" unfolding if_eq |
58410
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5089 |
apply (rule sums_summable [where l="0 + ?S"]) |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5090 |
apply (rule sums_if) |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5091 |
apply (rule sums_zero) |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5092 |
apply (rule summable_sums) |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5093 |
apply (rule *) |
6d46ad54a2ab
explicit separation of signed and unsigned numerals using existing lexical categories num and xnum
haftmann
parents:
57514
diff
changeset
|
5094 |
done |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5095 |
} |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5096 |
qed auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5097 |
thus ?thesis unfolding Int_eq arctan_eq . |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5098 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5099 |
|
53079 | 5100 |
lemma arctan_series: |
5101 |
assumes "\<bar> x \<bar> \<le> 1" |
|
5102 |
shows "arctan x = (\<Sum>k. (-1)^k * (1 / real (k*2+1) * x ^ (k*2+1)))" |
|
5103 |
(is "_ = suminf (\<lambda> n. ?c x n)") |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5104 |
proof - |
53079 | 5105 |
let ?c' = "\<lambda>x n. (-1)^n * x^(n*2)" |
5106 |
||
5107 |
{ |
|
5108 |
fix r x :: real |
|
5109 |
assume "0 < r" and "r < 1" and "\<bar> x \<bar> < r" |
|
60758 | 5110 |
have "\<bar>x\<bar> < 1" using \<open>r < 1\<close> and \<open>\<bar>x\<bar> < r\<close> by auto |
53079 | 5111 |
from DERIV_arctan_series[OF this] have "DERIV (\<lambda> x. suminf (?c x)) x :> (suminf (?c' x))" . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5112 |
} note DERIV_arctan_suminf = this |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5113 |
|
53079 | 5114 |
{ |
5115 |
fix x :: real |
|
5116 |
assume "\<bar>x\<bar> \<le> 1" |
|
5117 |
note summable_Leibniz[OF zeroseq_arctan_series[OF this] monoseq_arctan_series[OF this]] |
|
5118 |
} note arctan_series_borders = this |
|
5119 |
||
5120 |
{ |
|
5121 |
fix x :: real |
|
5122 |
assume "\<bar>x\<bar> < 1" |
|
5123 |
have "arctan x = (\<Sum>k. ?c x k)" |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5124 |
proof - |
53079 | 5125 |
obtain r where "\<bar>x\<bar> < r" and "r < 1" |
60758 | 5126 |
using dense[OF \<open>\<bar>x\<bar> < 1\<close>] by blast |
53079 | 5127 |
hence "0 < r" and "-r < x" and "x < r" by auto |
5128 |
||
5129 |
have suminf_eq_arctan_bounded: "\<And>x a b. \<lbrakk> -r < a ; b < r ; a < b ; a \<le> x ; x \<le> b \<rbrakk> \<Longrightarrow> |
|
5130 |
suminf (?c x) - arctan x = suminf (?c a) - arctan a" |
|
5131 |
proof - |
|
5132 |
fix x a b |
|
5133 |
assume "-r < a" and "b < r" and "a < b" and "a \<le> x" and "x \<le> b" |
|
5134 |
hence "\<bar>x\<bar> < r" by auto |
|
5135 |
show "suminf (?c x) - arctan x = suminf (?c a) - arctan a" |
|
5136 |
proof (rule DERIV_isconst2[of "a" "b"]) |
|
5137 |
show "a < b" and "a \<le> x" and "x \<le> b" |
|
60758 | 5138 |
using \<open>a < b\<close> \<open>a \<le> x\<close> \<open>x \<le> b\<close> by auto |
53079 | 5139 |
have "\<forall>x. -r < x \<and> x < r \<longrightarrow> DERIV (\<lambda> x. suminf (?c x) - arctan x) x :> 0" |
5140 |
proof (rule allI, rule impI) |
|
5141 |
fix x |
|
5142 |
assume "-r < x \<and> x < r" |
|
5143 |
hence "\<bar>x\<bar> < r" by auto |
|
60758 | 5144 |
hence "\<bar>x\<bar> < 1" using \<open>r < 1\<close> by auto |
53079 | 5145 |
have "\<bar> - (x\<^sup>2) \<bar> < 1" |
60758 | 5146 |
using abs_square_less_1 \<open>\<bar>x\<bar> < 1\<close> by auto |
53079 | 5147 |
hence "(\<lambda> n. (- (x\<^sup>2)) ^ n) sums (1 / (1 - (- (x\<^sup>2))))" |
5148 |
unfolding real_norm_def[symmetric] by (rule geometric_sums) |
|
5149 |
hence "(?c' x) sums (1 / (1 - (- (x\<^sup>2))))" |
|
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57492
diff
changeset
|
5150 |
unfolding power_mult_distrib[symmetric] power_mult mult.commute[of _ 2] by auto |
53079 | 5151 |
hence suminf_c'_eq_geom: "inverse (1 + x\<^sup>2) = suminf (?c' x)" |
5152 |
using sums_unique unfolding inverse_eq_divide by auto |
|
5153 |
have "DERIV (\<lambda> x. suminf (?c x)) x :> (inverse (1 + x\<^sup>2))" |
|
5154 |
unfolding suminf_c'_eq_geom |
|
60758 | 5155 |
by (rule DERIV_arctan_suminf[OF \<open>0 < r\<close> \<open>r < 1\<close> \<open>\<bar>x\<bar> < r\<close>]) |
56261 | 5156 |
from DERIV_diff [OF this DERIV_arctan] |
53079 | 5157 |
show "DERIV (\<lambda> x. suminf (?c x) - arctan x) x :> 0" |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53602
diff
changeset
|
5158 |
by auto |
53079 | 5159 |
qed |
5160 |
hence DERIV_in_rball: "\<forall> y. a \<le> y \<and> y \<le> b \<longrightarrow> DERIV (\<lambda> x. suminf (?c x) - arctan x) y :> 0" |
|
60758 | 5161 |
using \<open>-r < a\<close> \<open>b < r\<close> by auto |
53079 | 5162 |
thus "\<forall> y. a < y \<and> y < b \<longrightarrow> DERIV (\<lambda> x. suminf (?c x) - arctan x) y :> 0" |
60758 | 5163 |
using \<open>\<bar>x\<bar> < r\<close> by auto |
53079 | 5164 |
show "\<forall> y. a \<le> y \<and> y \<le> b \<longrightarrow> isCont (\<lambda> x. suminf (?c x) - arctan x) y" |
5165 |
using DERIV_in_rball DERIV_isCont by auto |
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5166 |
qed |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5167 |
qed |
53079 | 5168 |
|
5169 |
have suminf_arctan_zero: "suminf (?c 0) - arctan 0 = 0" |
|
5170 |
unfolding Suc_eq_plus1[symmetric] power_Suc2 mult_zero_right arctan_zero_zero suminf_zero |
|
5171 |
by auto |
|
5172 |
||
5173 |
have "suminf (?c x) - arctan x = 0" |
|
5174 |
proof (cases "x = 0") |
|
5175 |
case True |
|
5176 |
thus ?thesis using suminf_arctan_zero by auto |
|
5177 |
next |
|
5178 |
case False |
|
5179 |
hence "0 < \<bar>x\<bar>" and "- \<bar>x\<bar> < \<bar>x\<bar>" by auto |
|
5180 |
have "suminf (?c (-\<bar>x\<bar>)) - arctan (-\<bar>x\<bar>) = suminf (?c 0) - arctan 0" |
|
59647
c6f413b660cf
clarified Drule.gen_all: observe context more carefully;
wenzelm
parents:
59613
diff
changeset
|
5181 |
by (rule suminf_eq_arctan_bounded[where x1="0" and a1="-\<bar>x\<bar>" and b1="\<bar>x\<bar>", symmetric]) |
60758 | 5182 |
(simp_all only: \<open>\<bar>x\<bar> < r\<close> \<open>-\<bar>x\<bar> < \<bar>x\<bar>\<close> neg_less_iff_less) |
53079 | 5183 |
moreover |
5184 |
have "suminf (?c x) - arctan x = suminf (?c (-\<bar>x\<bar>)) - arctan (-\<bar>x\<bar>)" |
|
59647
c6f413b660cf
clarified Drule.gen_all: observe context more carefully;
wenzelm
parents:
59613
diff
changeset
|
5185 |
by (rule suminf_eq_arctan_bounded[where x1="x" and a1="-\<bar>x\<bar>" and b1="\<bar>x\<bar>"]) |
60758 | 5186 |
(simp_all only: \<open>\<bar>x\<bar> < r\<close> \<open>-\<bar>x\<bar> < \<bar>x\<bar>\<close> neg_less_iff_less) |
53079 | 5187 |
ultimately |
5188 |
show ?thesis using suminf_arctan_zero by auto |
|
5189 |
qed |
|
5190 |
thus ?thesis by auto |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5191 |
qed |
53079 | 5192 |
} note when_less_one = this |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5193 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5194 |
show "arctan x = suminf (\<lambda> n. ?c x n)" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5195 |
proof (cases "\<bar>x\<bar> < 1") |
53079 | 5196 |
case True |
5197 |
thus ?thesis by (rule when_less_one) |
|
5198 |
next |
|
5199 |
case False |
|
60758 | 5200 |
hence "\<bar>x\<bar> = 1" using \<open>\<bar>x\<bar> \<le> 1\<close> by auto |
53079 | 5201 |
let ?a = "\<lambda>x n. \<bar>1 / real (n*2+1) * x^(n*2+1)\<bar>" |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
5202 |
let ?diff = "\<lambda> x n. \<bar> arctan x - (\<Sum> i<n. ?c x i)\<bar>" |
53079 | 5203 |
{ |
5204 |
fix n :: nat |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5205 |
have "0 < (1 :: real)" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5206 |
moreover |
53079 | 5207 |
{ |
5208 |
fix x :: real |
|
5209 |
assume "0 < x" and "x < 1" |
|
5210 |
hence "\<bar>x\<bar> \<le> 1" and "\<bar>x\<bar> < 1" by auto |
|
60758 | 5211 |
from \<open>0 < x\<close> have "0 < 1 / real (0 * 2 + (1::nat)) * x ^ (0 * 2 + 1)" |
53079 | 5212 |
by auto |
60758 | 5213 |
note bounds = mp[OF arctan_series_borders(2)[OF \<open>\<bar>x\<bar> \<le> 1\<close>] this, unfolded when_less_one[OF \<open>\<bar>x\<bar> < 1\<close>, symmetric], THEN spec] |
53079 | 5214 |
have "0 < 1 / real (n*2+1) * x^(n*2+1)" |
60758 | 5215 |
by (rule mult_pos_pos, auto simp only: zero_less_power[OF \<open>0 < x\<close>], auto) |
53079 | 5216 |
hence a_pos: "?a x n = 1 / real (n*2+1) * x^(n*2+1)" |
5217 |
by (rule abs_of_pos) |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5218 |
have "?diff x n \<le> ?a x n" |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5219 |
proof (cases "even n") |
53079 | 5220 |
case True |
5221 |
hence sgn_pos: "(-1)^n = (1::real)" by auto |
|
60758 | 5222 |
from \<open>even n\<close> obtain m where "n = 2 * m" .. |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
5223 |
then have "2 * m = n" .. |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5224 |
from bounds[of m, unfolded this atLeastAtMost_iff] |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
5225 |
have "\<bar>arctan x - (\<Sum>i<n. (?c x i))\<bar> \<le> (\<Sum>i<n + 1. (?c x i)) - (\<Sum>i<n. (?c x i))" |
53079 | 5226 |
by auto |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5227 |
also have "\<dots> = ?c x n" unfolding One_nat_def by auto |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5228 |
also have "\<dots> = ?a x n" unfolding sgn_pos a_pos by auto |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5229 |
finally show ?thesis . |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5230 |
next |
53079 | 5231 |
case False |
5232 |
hence sgn_neg: "(-1)^n = (-1::real)" by auto |
|
60758 | 5233 |
from \<open>odd n\<close> obtain m where "n = 2 * m + 1" .. |
58709
efdc6c533bd3
prefer generic elimination rules for even/odd over specialized unfold rules for nat
haftmann
parents:
58656
diff
changeset
|
5234 |
then have m_def: "2 * m + 1 = n" .. |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5235 |
hence m_plus: "2 * (m + 1) = n + 1" by auto |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5236 |
from bounds[of "m + 1", unfolded this atLeastAtMost_iff, THEN conjunct1] bounds[of m, unfolded m_def atLeastAtMost_iff, THEN conjunct2] |
56193
c726ecfb22b6
cleanup Series: sorted according to typeclass hierarchy, use {..<_} instead of {0..<_}
hoelzl
parents:
56181
diff
changeset
|
5237 |
have "\<bar>arctan x - (\<Sum>i<n. (?c x i))\<bar> \<le> (\<Sum>i<n. (?c x i)) - (\<Sum>i<n+1. (?c x i))" |
53079 | 5238 |
by auto |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5239 |
also have "\<dots> = - ?c x n" unfolding One_nat_def by auto |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5240 |
also have "\<dots> = ?a x n" unfolding sgn_neg a_pos by auto |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5241 |
finally show ?thesis . |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32047
diff
changeset
|
5242 |
qed |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5243 |
hence "0 \<le> ?a x n - ?diff x n" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5244 |
} |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5245 |
hence "\<forall> x \<in> { 0 <..< 1 }. 0 \<le> ?a x n - ?diff x n" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5246 |
moreover have "\<And>x. isCont (\<lambda> x. ?a x n - ?diff x n) x" |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53602
diff
changeset
|
5247 |
unfolding diff_conv_add_uminus divide_inverse |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5248 |
by (auto intro!: isCont_add isCont_rabs continuous_ident isCont_minus isCont_arctan |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5249 |
isCont_inverse isCont_mult isCont_power continuous_const isCont_setsum |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53602
diff
changeset
|
5250 |
simp del: add_uminus_conv_diff) |
53079 | 5251 |
ultimately have "0 \<le> ?a 1 n - ?diff 1 n" |
5252 |
by (rule LIM_less_bound) |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5253 |
hence "?diff 1 n \<le> ?a 1 n" by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5254 |
} |
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
5255 |
have "?a 1 ----> 0" |
44568
e6f291cb5810
discontinue many legacy theorems about LIM and LIMSEQ, in favor of tendsto theorems
huffman
parents:
44319
diff
changeset
|
5256 |
unfolding tendsto_rabs_zero_iff power_one divide_inverse One_nat_def |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
5257 |
by (auto intro!: tendsto_mult LIMSEQ_linear LIMSEQ_inverse_real_of_nat simp del: of_nat_Suc) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5258 |
have "?diff 1 ----> 0" |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5259 |
proof (rule LIMSEQ_I) |
53079 | 5260 |
fix r :: real |
5261 |
assume "0 < r" |
|
5262 |
obtain N :: nat where N_I: "\<And>n. N \<le> n \<Longrightarrow> ?a 1 n < r" |
|
60758 | 5263 |
using LIMSEQ_D[OF \<open>?a 1 ----> 0\<close> \<open>0 < r\<close>] by auto |
53079 | 5264 |
{ |
5265 |
fix n |
|
60758 | 5266 |
assume "N \<le> n" from \<open>?diff 1 n \<le> ?a 1 n\<close> N_I[OF this] |
53079 | 5267 |
have "norm (?diff 1 n - 0) < r" by auto |
5268 |
} |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5269 |
thus "\<exists> N. \<forall> n \<ge> N. norm (?diff 1 n - 0) < r" by blast |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5270 |
qed |
44710 | 5271 |
from this [unfolded tendsto_rabs_zero_iff, THEN tendsto_add [OF _ tendsto_const], of "- arctan 1", THEN tendsto_minus] |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5272 |
have "(?c 1) sums (arctan 1)" unfolding sums_def by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5273 |
hence "arctan 1 = (\<Sum> i. ?c 1 i)" by (rule sums_unique) |
41970 | 5274 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5275 |
show ?thesis |
53079 | 5276 |
proof (cases "x = 1") |
5277 |
case True |
|
60758 | 5278 |
then show ?thesis by (simp add: \<open>arctan 1 = (\<Sum> i. ?c 1 i)\<close>) |
53079 | 5279 |
next |
5280 |
case False |
|
60758 | 5281 |
hence "x = -1" using \<open>\<bar>x\<bar> = 1\<close> by auto |
41970 | 5282 |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5283 |
have "- (pi / 2) < 0" using pi_gt_zero by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5284 |
have "- (2 * pi) < 0" using pi_gt_zero by auto |
41970 | 5285 |
|
53079 | 5286 |
have c_minus_minus: "\<And>i. ?c (- 1) i = - ?c 1 i" |
5287 |
unfolding One_nat_def by auto |
|
5288 |
||
5289 |
have "arctan (- 1) = arctan (tan (-(pi / 4)))" |
|
5290 |
unfolding tan_45 tan_minus .. |
|
5291 |
also have "\<dots> = - (pi / 4)" |
|
60758 | 5292 |
by (rule arctan_tan, auto simp add: order_less_trans[OF \<open>- (pi / 2) < 0\<close> pi_gt_zero]) |
53079 | 5293 |
also have "\<dots> = - (arctan (tan (pi / 4)))" |
60758 | 5294 |
unfolding neg_equal_iff_equal by (rule arctan_tan[symmetric], auto simp add: order_less_trans[OF \<open>- (2 * pi) < 0\<close> pi_gt_zero]) |
53079 | 5295 |
also have "\<dots> = - (arctan 1)" |
5296 |
unfolding tan_45 .. |
|
5297 |
also have "\<dots> = - (\<Sum> i. ?c 1 i)" |
|
60758 | 5298 |
using \<open>arctan 1 = (\<Sum> i. ?c 1 i)\<close> by auto |
53079 | 5299 |
also have "\<dots> = (\<Sum> i. ?c (- 1) i)" |
60758 | 5300 |
using suminf_minus[OF sums_summable[OF \<open>(?c 1) sums (arctan 1)\<close>]] |
53079 | 5301 |
unfolding c_minus_minus by auto |
60758 | 5302 |
finally show ?thesis using \<open>x = -1\<close> by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5303 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5304 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5305 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5306 |
|
53079 | 5307 |
lemma arctan_half: |
5308 |
fixes x :: real |
|
53076 | 5309 |
shows "arctan x = 2 * arctan (x / (1 + sqrt(1 + x\<^sup>2)))" |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5310 |
proof - |
53079 | 5311 |
obtain y where low: "- (pi / 2) < y" and high: "y < pi / 2" and y_eq: "tan y = x" |
5312 |
using tan_total by blast |
|
5313 |
hence low2: "- (pi / 2) < y / 2" and high2: "y / 2 < pi / 2" |
|
5314 |
by auto |
|
5315 |
||
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5316 |
have "0 < cos y" using cos_gt_zero_pi[OF low high] . |
53079 | 5317 |
hence "cos y \<noteq> 0" and cos_sqrt: "sqrt ((cos y)\<^sup>2) = cos y" |
5318 |
by auto |
|
5319 |
||
5320 |
have "1 + (tan y)\<^sup>2 = 1 + (sin y)\<^sup>2 / (cos y)\<^sup>2" |
|
5321 |
unfolding tan_def power_divide .. |
|
5322 |
also have "\<dots> = (cos y)\<^sup>2 / (cos y)\<^sup>2 + (sin y)\<^sup>2 / (cos y)\<^sup>2" |
|
60758 | 5323 |
using \<open>cos y \<noteq> 0\<close> by auto |
53079 | 5324 |
also have "\<dots> = 1 / (cos y)\<^sup>2" |
5325 |
unfolding add_divide_distrib[symmetric] sin_cos_squared_add2 .. |
|
53076 | 5326 |
finally have "1 + (tan y)\<^sup>2 = 1 / (cos y)\<^sup>2" . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5327 |
|
53079 | 5328 |
have "sin y / (cos y + 1) = tan y / ((cos y + 1) / cos y)" |
60758 | 5329 |
unfolding tan_def using \<open>cos y \<noteq> 0\<close> by (simp add: field_simps) |
53079 | 5330 |
also have "\<dots> = tan y / (1 + 1 / cos y)" |
60758 | 5331 |
using \<open>cos y \<noteq> 0\<close> unfolding add_divide_distrib by auto |
53079 | 5332 |
also have "\<dots> = tan y / (1 + 1 / sqrt ((cos y)\<^sup>2))" |
5333 |
unfolding cos_sqrt .. |
|
5334 |
also have "\<dots> = tan y / (1 + sqrt (1 / (cos y)\<^sup>2))" |
|
5335 |
unfolding real_sqrt_divide by auto |
|
5336 |
finally have eq: "sin y / (cos y + 1) = tan y / (1 + sqrt(1 + (tan y)\<^sup>2))" |
|
60758 | 5337 |
unfolding \<open>1 + (tan y)\<^sup>2 = 1 / (cos y)\<^sup>2\<close> . |
53079 | 5338 |
|
5339 |
have "arctan x = y" |
|
5340 |
using arctan_tan low high y_eq by auto |
|
5341 |
also have "\<dots> = 2 * (arctan (tan (y/2)))" |
|
5342 |
using arctan_tan[OF low2 high2] by auto |
|
5343 |
also have "\<dots> = 2 * (arctan (sin y / (cos y + 1)))" |
|
5344 |
unfolding tan_half by auto |
|
5345 |
finally show ?thesis |
|
60758 | 5346 |
unfolding eq \<open>tan y = x\<close> . |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5347 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5348 |
|
53079 | 5349 |
lemma arctan_monotone: "x < y \<Longrightarrow> arctan x < arctan y" |
5350 |
by (simp only: arctan_less_iff) |
|
5351 |
||
5352 |
lemma arctan_monotone': "x \<le> y \<Longrightarrow> arctan x \<le> arctan y" |
|
5353 |
by (simp only: arctan_le_iff) |
|
44746 | 5354 |
|
5355 |
lemma arctan_inverse: |
|
53079 | 5356 |
assumes "x \<noteq> 0" |
5357 |
shows "arctan (1 / x) = sgn x * pi / 2 - arctan x" |
|
44746 | 5358 |
proof (rule arctan_unique) |
5359 |
show "- (pi / 2) < sgn x * pi / 2 - arctan x" |
|
5360 |
using arctan_bounded [of x] assms |
|
5361 |
unfolding sgn_real_def |
|
59869 | 5362 |
apply (auto simp add: arctan algebra_simps) |
44746 | 5363 |
apply (drule zero_less_arctan_iff [THEN iffD2]) |
5364 |
apply arith |
|
5365 |
done |
|
5366 |
show "sgn x * pi / 2 - arctan x < pi / 2" |
|
5367 |
using arctan_bounded [of "- x"] assms |
|
5368 |
unfolding sgn_real_def arctan_minus |
|
54489
03ff4d1e6784
eliminiated neg_numeral in favour of - (numeral _)
haftmann
parents:
54230
diff
changeset
|
5369 |
by (auto simp add: algebra_simps) |
44746 | 5370 |
show "tan (sgn x * pi / 2 - arctan x) = 1 / x" |
5371 |
unfolding tan_inverse [of "arctan x", unfolded tan_arctan] |
|
5372 |
unfolding sgn_real_def |
|
56479
91958d4b30f7
revert c1bbd3e22226, a14831ac3023, and 36489d77c484: divide_minus_left/right are again simp rules
hoelzl
parents:
56409
diff
changeset
|
5373 |
by (simp add: tan_def cos_arctan sin_arctan sin_diff cos_diff) |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5374 |
qed |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5375 |
|
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5376 |
theorem pi_series: "pi / 4 = (\<Sum> k. (-1)^k * 1 / real (k*2+1))" (is "_ = ?SUM") |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5377 |
proof - |
44746 | 5378 |
have "pi / 4 = arctan 1" using arctan_one by auto |
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5379 |
also have "\<dots> = ?SUM" using arctan_series[of 1] by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5380 |
finally show ?thesis by auto |
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29695
diff
changeset
|
5381 |
qed |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
5382 |
|
53079 | 5383 |
|
60758 | 5384 |
subsection \<open>Existence of Polar Coordinates\<close> |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
5385 |
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
52139
diff
changeset
|
5386 |
lemma cos_x_y_le_one: "\<bar>x / sqrt (x\<^sup>2 + y\<^sup>2)\<bar> \<le> 1" |
53079 | 5387 |
apply (rule power2_le_imp_le [OF _ zero_le_one]) |
5388 |
apply (simp add: power_divide divide_le_eq not_sum_power2_lt_zero) |
|
5389 |
done |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
5390 |
|
22978
1cd8cc21a7c3
clean up polar_Ex proofs; remove unnecessary lemmas
huffman
parents:
22977
diff
changeset
|
5391 |
lemmas cos_arccos_lemma1 = cos_arccos_abs [OF cos_x_y_le_one] |
15228 | 5392 |
|
23045
95e04f335940
add lemmas about inverse functions; cleaned up proof of polar_ex
huffman
parents:
23043
diff
changeset
|
5393 |
lemmas sin_arccos_lemma1 = sin_arccos_abs [OF cos_x_y_le_one] |
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
5394 |
|
59658
0cc388370041
sin, cos generalised from type real to any "'a::{real_normed_field,banach}", including complex
paulson <lp15@cam.ac.uk>
parents:
59647
diff
changeset
|
5395 |
lemma polar_Ex: "\<exists>r::real. \<exists>a. x = r * cos a & y = r * sin a" |
54573 | 5396 |
proof - |
5397 |
have polar_ex1: "\<And>y. 0 < y \<Longrightarrow> \<exists>r a. x = r * cos a & y = r * sin a" |
|
5398 |
apply (rule_tac x = "sqrt (x\<^sup>2 + y\<^sup>2)" in exI) |
|
5399 |
apply (rule_tac x = "arccos (x / sqrt (x\<^sup>2 + y\<^sup>2))" in exI) |
|
5400 |
apply (simp add: cos_arccos_lemma1 sin_arccos_lemma1 power_divide |
|
5401 |
real_sqrt_mult [symmetric] right_diff_distrib) |
|
5402 |
done |
|
5403 |
show ?thesis |
|
5404 |
proof (cases "0::real" y rule: linorder_cases) |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
5405 |
case less |
54573 | 5406 |
then show ?thesis by (rule polar_ex1) |
5407 |
next |
|
5408 |
case equal |
|
5409 |
then show ?thesis |
|
5410 |
by (force simp add: intro!: cos_zero sin_zero) |
|
5411 |
next |
|
5412 |
case greater |
|
59669
de7792ea4090
renaming HOL/Fact.thy -> Binomial.thy
paulson <lp15@cam.ac.uk>
parents:
59658
diff
changeset
|
5413 |
then show ?thesis |
54573 | 5414 |
using polar_ex1 [where y="-y"] |
5415 |
by auto (metis cos_minus minus_minus minus_mult_right sin_minus) |
|
5416 |
qed |
|
5417 |
qed |
|
15077
89840837108e
converting Hyperreal/Transcendental to Isar script
paulson
parents:
15013
diff
changeset
|
5418 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5419 |
|
60758 | 5420 |
subsection\<open>Basics about polynomial functions: products, extremal behaviour and root counts\<close> |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5421 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5422 |
lemma pairs_le_eq_Sigma: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5423 |
fixes m::nat |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5424 |
shows "{(i,j). i+j \<le> m} = Sigma (atMost m) (\<lambda>r. atMost (m-r))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5425 |
by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5426 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5427 |
lemma setsum_up_index_split: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5428 |
"(\<Sum>k\<le>m + n. f k) = (\<Sum>k\<le>m. f k) + (\<Sum>k = Suc m..m + n. f k)" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5429 |
by (metis atLeast0AtMost Suc_eq_plus1 le0 setsum_ub_add_nat) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5430 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5431 |
lemma Sigma_interval_disjoint: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5432 |
fixes w :: "'a::order" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5433 |
shows "(SIGMA i:A. {..v i}) \<inter> (SIGMA i:A.{v i<..w}) = {}" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5434 |
by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5435 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5436 |
lemma product_atMost_eq_Un: |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5437 |
fixes m :: nat |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5438 |
shows "A \<times> {..m} = (SIGMA i:A.{..m - i}) \<union> (SIGMA i:A.{m - i<..m})" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5439 |
by auto |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5440 |
|
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5441 |
lemma polynomial_product: (*with thanks to Chaitanya Mangla*) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5442 |
fixes x:: "'a :: idom" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5443 |
assumes m: "\<And>i. i>m \<Longrightarrow> (a i) = 0" and n: "\<And>j. j>n \<Longrightarrow> (b j) = 0" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
5444 |
shows "(\<Sum>i\<le>m. (a i) * x ^ i) * (\<Sum>j\<le>n. (b j) * x ^ j) = |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5445 |
(\<Sum>r\<le>m + n. (\<Sum>k\<le>r. (a k) * (b (r - k))) * x ^ r)" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5446 |
proof - |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5447 |
have "(\<Sum>i\<le>m. (a i) * x ^ i) * (\<Sum>j\<le>n. (b j) * x ^ j) = (\<Sum>i\<le>m. \<Sum>j\<le>n. (a i * x ^ i) * (b j * x ^ j))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5448 |
by (rule setsum_product) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5449 |
also have "... = (\<Sum>i\<le>m + n. \<Sum>j\<le>n + m. a i * x ^ i * (b j * x ^ j))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5450 |
using assms by (auto simp: setsum_up_index_split) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5451 |
also have "... = (\<Sum>r\<le>m + n. \<Sum>j\<le>m + n - r. a r * x ^ r * (b j * x ^ j))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5452 |
apply (simp add: add_ac setsum.Sigma product_atMost_eq_Un) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5453 |
apply (clarsimp simp add: setsum_Un Sigma_interval_disjoint intro!: setsum.neutral) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5454 |
by (metis add_diff_assoc2 add.commute add_lessD1 leD m n nat_le_linear neqE) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5455 |
also have "... = (\<Sum>(i,j)\<in>{(i,j). i+j \<le> m+n}. (a i * x ^ i) * (b j * x ^ j))" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5456 |
by (auto simp: pairs_le_eq_Sigma setsum.Sigma) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5457 |
also have "... = (\<Sum>r\<le>m + n. (\<Sum>k\<le>r. (a k) * (b (r - k))) * x ^ r)" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
5458 |
apply (subst setsum_triangle_reindex_eq) |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5459 |
apply (auto simp: algebra_simps setsum_right_distrib intro!: setsum.cong) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5460 |
by (metis le_add_diff_inverse power_add) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5461 |
finally show ?thesis . |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5462 |
qed |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5463 |
|
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
5464 |
lemma polynomial_product_nat: |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5465 |
fixes x:: nat |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5466 |
assumes m: "\<And>i. i>m \<Longrightarrow> (a i) = 0" and n: "\<And>j. j>n \<Longrightarrow> (b j) = 0" |
61609
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents:
61552
diff
changeset
|
5467 |
shows "(\<Sum>i\<le>m. (a i) * x ^ i) * (\<Sum>j\<le>n. (b j) * x ^ j) = |
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5468 |
(\<Sum>r\<le>m + n. (\<Sum>k\<le>r. (a k) * (b (r - k))) * x ^ r)" |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5469 |
using polynomial_product [of m a n b x] assms |
61694
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
5470 |
by (simp only: of_nat_mult [symmetric] of_nat_power [symmetric] of_nat_eq_iff Int.int_setsum [symmetric]) |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5471 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5472 |
lemma polyfun_diff: (*COMPLEX_SUB_POLYFUN in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5473 |
fixes x :: "'a::idom" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5474 |
assumes "1 \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5475 |
shows "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5476 |
(x - y) * (\<Sum>j<n. (\<Sum>i=Suc j..n. a i * y^(i - j - 1)) * x^j)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5477 |
proof - |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5478 |
have h: "bij_betw (\<lambda>(i,j). (j,i)) ((SIGMA i : atMost n. lessThan i)) (SIGMA j : lessThan n. {Suc j..n})" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5479 |
by (auto simp: bij_betw_def inj_on_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5480 |
have "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5481 |
(\<Sum>i\<le>n. a i * (x^i - y^i))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5482 |
by (simp add: right_diff_distrib setsum_subtractf) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5483 |
also have "... = (\<Sum>i\<le>n. a i * (x - y) * (\<Sum>j<i. y^(i - Suc j) * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5484 |
by (simp add: power_diff_sumr2 mult.assoc) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5485 |
also have "... = (\<Sum>i\<le>n. \<Sum>j<i. a i * (x - y) * (y^(i - Suc j) * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5486 |
by (simp add: setsum_right_distrib) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5487 |
also have "... = (\<Sum>(i,j) \<in> (SIGMA i : atMost n. lessThan i). a i * (x - y) * (y^(i - Suc j) * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5488 |
by (simp add: setsum.Sigma) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5489 |
also have "... = (\<Sum>(j,i) \<in> (SIGMA j : lessThan n. {Suc j..n}). a i * (x - y) * (y^(i - Suc j) * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5490 |
by (auto simp add: setsum.reindex_bij_betw [OF h, symmetric] intro: setsum.strong_cong) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5491 |
also have "... = (\<Sum>j<n. \<Sum>i=Suc j..n. a i * (x - y) * (y^(i - Suc j) * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5492 |
by (simp add: setsum.Sigma) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5493 |
also have "... = (x - y) * (\<Sum>j<n. (\<Sum>i=Suc j..n. a i * y^(i - j - 1)) * x^j)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5494 |
by (simp add: setsum_right_distrib mult_ac) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5495 |
finally show ?thesis . |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5496 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5497 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5498 |
lemma polyfun_diff_alt: (*COMPLEX_SUB_POLYFUN_ALT in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5499 |
fixes x :: "'a::idom" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5500 |
assumes "1 \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5501 |
shows "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5502 |
(x - y) * ((\<Sum>j<n. \<Sum>k<n-j. a(j+k+1) * y^k * x^j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5503 |
proof - |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5504 |
{ fix j::nat |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5505 |
assume "j<n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5506 |
have h: "bij_betw (\<lambda>i. i - (j + 1)) {Suc j..n} (lessThan (n-j))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5507 |
apply (auto simp: bij_betw_def inj_on_def) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5508 |
apply (rule_tac x="x + Suc j" in image_eqI) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5509 |
apply (auto simp: ) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5510 |
done |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5511 |
have "(\<Sum>i=Suc j..n. a i * y^(i - j - 1)) = (\<Sum>k<n-j. a(j+k+1) * y^k)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5512 |
by (auto simp add: setsum.reindex_bij_betw [OF h, symmetric] intro: setsum.strong_cong) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5513 |
} |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5514 |
then show ?thesis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5515 |
by (simp add: polyfun_diff [OF assms] setsum_left_distrib) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5516 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5517 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5518 |
lemma polyfun_linear_factor: (*COMPLEX_POLYFUN_LINEAR_FACTOR in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5519 |
fixes a :: "'a::idom" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5520 |
shows "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c(i) * z^i) = (z - a) * (\<Sum>i<n. b(i) * z^i) + (\<Sum>i\<le>n. c(i) * a^i)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5521 |
proof (cases "n=0") |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5522 |
case True then show ?thesis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5523 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5524 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5525 |
case False |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5526 |
have "(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c(i) * z^i) = (z - a) * (\<Sum>i<n. b(i) * z^i) + (\<Sum>i\<le>n. c(i) * a^i)) = |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5527 |
(\<exists>b. \<forall>z. (\<Sum>i\<le>n. c(i) * z^i) - (\<Sum>i\<le>n. c(i) * a^i) = (z - a) * (\<Sum>i<n. b(i) * z^i))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5528 |
by (simp add: algebra_simps) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5529 |
also have "... = (\<exists>b. \<forall>z. (z - a) * (\<Sum>j<n. (\<Sum>i = Suc j..n. c i * a^(i - Suc j)) * z^j) = (z - a) * (\<Sum>i<n. b(i) * z^i))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5530 |
using False by (simp add: polyfun_diff) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5531 |
also have "... = True" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5532 |
by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5533 |
finally show ?thesis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5534 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5535 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5536 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5537 |
lemma polyfun_linear_factor_root: (*COMPLEX_POLYFUN_LINEAR_FACTOR_ROOT in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5538 |
fixes a :: "'a::idom" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5539 |
assumes "(\<Sum>i\<le>n. c(i) * a^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5540 |
obtains b where "\<And>z. (\<Sum>i\<le>n. c(i) * z^i) = (z - a) * (\<Sum>i<n. b(i) * z^i)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5541 |
using polyfun_linear_factor [of c n a] assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5542 |
by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5543 |
|
60150
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5544 |
(*The material of this section, up until this point, could go into a new theory of polynomials |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5545 |
based on Main alone. The remaining material involves limits, continuity, series, etc.*) |
bd773c47ad0b
New material about complex transcendental functions (especially Ln, Arg) and polynomials
paulson <lp15@cam.ac.uk>
parents:
60141
diff
changeset
|
5546 |
|
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5547 |
lemma isCont_polynom: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5548 |
fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5549 |
shows "isCont (\<lambda>w. \<Sum>i\<le>n. c i * w^i) a" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5550 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5551 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5552 |
lemma zero_polynom_imp_zero_coeffs: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5553 |
fixes c :: "nat \<Rightarrow> 'a::{ab_semigroup_mult,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5554 |
assumes "\<And>w. (\<Sum>i\<le>n. c i * w^i) = 0" "k \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5555 |
shows "c k = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5556 |
using assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5557 |
proof (induction n arbitrary: c k) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5558 |
case 0 |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5559 |
then show ?case |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5560 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5561 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5562 |
case (Suc n c k) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5563 |
have [simp]: "c 0 = 0" using Suc.prems(1) [of 0] |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5564 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5565 |
{ fix w |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5566 |
have "(\<Sum>i\<le>Suc n. c i * w^i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5567 |
unfolding Set_Interval.setsum_atMost_Suc_shift |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5568 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5569 |
also have "... = w * (\<Sum>i\<le>n. c (Suc i) * w^i)" |
60867 | 5570 |
by (simp add: setsum_right_distrib ac_simps) |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5571 |
finally have "(\<Sum>i\<le>Suc n. c i * w^i) = w * (\<Sum>i\<le>n. c (Suc i) * w^i)" . |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5572 |
} |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5573 |
then have wnz: "\<And>w. w \<noteq> 0 \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * w^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5574 |
using Suc by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5575 |
then have "(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h^i) -- 0 --> 0" |
61799 | 5576 |
by (simp cong: LIM_cong) \<comment>\<open>the case @{term"w=0"} by continuity\<close> |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5577 |
then have "(\<Sum>i\<le>n. c (Suc i) * 0^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5578 |
using isCont_polynom [of 0 "\<lambda>i. c (Suc i)" n] LIM_unique |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5579 |
by (force simp add: Limits.isCont_iff) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5580 |
then have "\<And>w. (\<Sum>i\<le>n. c (Suc i) * w^i) = 0" using wnz |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5581 |
by metis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5582 |
then have "\<And>i. i\<le>n \<Longrightarrow> c (Suc i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5583 |
using Suc.IH [of "\<lambda>i. c (Suc i)"] |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5584 |
by blast |
60758 | 5585 |
then show ?case using \<open>k \<le> Suc n\<close> |
60017
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5586 |
by (cases k) auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5587 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5588 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5589 |
lemma polyfun_rootbound: (*COMPLEX_POLYFUN_ROOTBOUND in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5590 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5591 |
assumes "c k \<noteq> 0" "k\<le>n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5592 |
shows "finite {z. (\<Sum>i\<le>n. c(i) * z^i) = 0} \<and> |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5593 |
card {z. (\<Sum>i\<le>n. c(i) * z^i) = 0} \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5594 |
using assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5595 |
proof (induction n arbitrary: c k) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5596 |
case 0 |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5597 |
then show ?case |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5598 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5599 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5600 |
case (Suc m c k) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5601 |
let ?succase = ?case |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5602 |
show ?case |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5603 |
proof (cases "{z. (\<Sum>i\<le>Suc m. c(i) * z^i) = 0} = {}") |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5604 |
case True |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5605 |
then show ?succase |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5606 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5607 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5608 |
case False |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5609 |
then obtain z0 where z0: "(\<Sum>i\<le>Suc m. c(i) * z0^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5610 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5611 |
then obtain b where b: "\<And>w. (\<Sum>i\<le>Suc m. c i * w^i) = (w - z0) * (\<Sum>i\<le>m. b i * w^i)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5612 |
using polyfun_linear_factor_root [OF z0, unfolded lessThan_Suc_atMost] |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5613 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5614 |
then have eq: "{z. (\<Sum>i\<le>Suc m. c(i) * z^i) = 0} = insert z0 {z. (\<Sum>i\<le>m. b(i) * z^i) = 0}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5615 |
by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5616 |
have "~(\<forall>k\<le>m. b k = 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5617 |
proof |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5618 |
assume [simp]: "\<forall>k\<le>m. b k = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5619 |
then have "\<And>w. (\<Sum>i\<le>m. b i * w^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5620 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5621 |
then have "\<And>w. (\<Sum>i\<le>Suc m. c i * w^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5622 |
using b by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5623 |
then have "\<And>k. k \<le> Suc m \<Longrightarrow> c k = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5624 |
using zero_polynom_imp_zero_coeffs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5625 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5626 |
then show False using Suc.prems |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5627 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5628 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5629 |
then obtain k' where bk': "b k' \<noteq> 0" "k' \<le> m" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5630 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5631 |
show ?succase |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5632 |
using Suc.IH [of b k'] bk' |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5633 |
by (simp add: eq card_insert_if del: setsum_atMost_Suc) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5634 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5635 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5636 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5637 |
lemma |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5638 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5639 |
assumes "c k \<noteq> 0" "k\<le>n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5640 |
shows polyfun_roots_finite: "finite {z. (\<Sum>i\<le>n. c(i) * z^i) = 0}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5641 |
and polyfun_roots_card: "card {z. (\<Sum>i\<le>n. c(i) * z^i) = 0} \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5642 |
using polyfun_rootbound assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5643 |
by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5644 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5645 |
lemma polyfun_finite_roots: (*COMPLEX_POLYFUN_FINITE_ROOTS in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5646 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5647 |
shows "finite {x. (\<Sum>i\<le>n. c i * x^i) = 0} \<longleftrightarrow> (\<exists>i\<le>n. c i \<noteq> 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5648 |
(is "?lhs = ?rhs") |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5649 |
proof |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5650 |
assume ?lhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5651 |
moreover |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5652 |
{ assume "\<forall>i\<le>n. c i = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5653 |
then have "\<And>x. (\<Sum>i\<le>n. c i * x^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5654 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5655 |
then have "\<not> finite {x. (\<Sum>i\<le>n. c i * x^i) = 0}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5656 |
using ex_new_if_finite [OF infinite_UNIV_char_0 [where 'a='a]] |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5657 |
by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5658 |
} |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5659 |
ultimately show ?rhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5660 |
by metis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5661 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5662 |
assume ?rhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5663 |
then show ?lhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5664 |
using polyfun_rootbound |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5665 |
by blast |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5666 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5667 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5668 |
lemma polyfun_eq_0: (*COMPLEX_POLYFUN_EQ_0 in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5669 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5670 |
shows "(\<forall>x. (\<Sum>i\<le>n. c i * x^i) = 0) \<longleftrightarrow> (\<forall>i\<le>n. c i = 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5671 |
using zero_polynom_imp_zero_coeffs by auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5672 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5673 |
lemma polyfun_eq_coeffs: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5674 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5675 |
shows "(\<forall>x. (\<Sum>i\<le>n. c i * x^i) = (\<Sum>i\<le>n. d i * x^i)) \<longleftrightarrow> (\<forall>i\<le>n. c i = d i)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5676 |
proof - |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5677 |
have "(\<forall>x. (\<Sum>i\<le>n. c i * x^i) = (\<Sum>i\<le>n. d i * x^i)) \<longleftrightarrow> (\<forall>x. (\<Sum>i\<le>n. (c i - d i) * x^i) = 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5678 |
by (simp add: left_diff_distrib Groups_Big.setsum_subtractf) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5679 |
also have "... \<longleftrightarrow> (\<forall>i\<le>n. c i - d i = 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5680 |
by (rule polyfun_eq_0) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5681 |
finally show ?thesis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5682 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5683 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5684 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5685 |
lemma polyfun_eq_const: (*COMPLEX_POLYFUN_EQ_CONST in HOL Light*) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5686 |
fixes c :: "nat \<Rightarrow> 'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5687 |
shows "(\<forall>x. (\<Sum>i\<le>n. c i * x^i) = k) \<longleftrightarrow> c 0 = k \<and> (\<forall>i \<in> {1..n}. c i = 0)" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5688 |
(is "?lhs = ?rhs") |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5689 |
proof - |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5690 |
have *: "\<forall>x. (\<Sum>i\<le>n. (if i=0 then k else 0) * x^i) = k" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5691 |
by (induct n) auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5692 |
show ?thesis |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5693 |
proof |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5694 |
assume ?lhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5695 |
with * have "(\<forall>i\<le>n. c i = (if i=0 then k else 0))" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5696 |
by (simp add: polyfun_eq_coeffs [symmetric]) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5697 |
then show ?rhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5698 |
by simp |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5699 |
next |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5700 |
assume ?rhs then show ?lhs |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5701 |
by (induct n) auto |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5702 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5703 |
qed |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5704 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5705 |
lemma root_polyfun: |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5706 |
fixes z:: "'a::idom" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5707 |
assumes "1 \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5708 |
shows "z^n = a \<longleftrightarrow> (\<Sum>i\<le>n. (if i = 0 then -a else if i=n then 1 else 0) * z^i) = 0" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5709 |
using assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5710 |
by (cases n; simp add: setsum_head_Suc atLeast0AtMost [symmetric]) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5711 |
|
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5712 |
lemma |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5713 |
fixes zz :: "'a::{idom,real_normed_div_algebra}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5714 |
assumes "1 \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5715 |
shows finite_roots_unity: "finite {z::'a. z^n = 1}" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5716 |
and card_roots_unity: "card {z::'a. z^n = 1} \<le> n" |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5717 |
using polyfun_rootbound [of "\<lambda>i. if i = 0 then -1 else if i=n then 1 else 0" n n] assms |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5718 |
by (auto simp add: root_polyfun [OF assms]) |
b785d6d06430
Overloading of ln and powr, but "approximation" no longer works for powr. Code generation also fails due to type ambiguity in scala.
paulson <lp15@cam.ac.uk>
parents:
59869
diff
changeset
|
5719 |
|
30082
43c5b7bfc791
make more proofs work whether or not One_nat_def is a simp rule
huffman
parents:
29803
diff
changeset
|
5720 |
end |