author | haftmann |
Mon, 13 Sep 2021 14:18:24 +0000 | |
changeset 74309 | 42523fbf643b |
parent 71175 | a1e94be66bd6 |
child 75078 | ec86cb2418e1 |
permissions | -rw-r--r-- |
68038
20b713cff87a
new material on matricies by Tim Makarios (from Tarskis_Geometry in the AFP)
paulson <lp15@cam.ac.uk>
parents:
67986
diff
changeset
|
1 |
(* Title: HOL/Analysis/Cartesian_Euclidean_Space.thy |
68043
d345e9c35ae1
some of Jose Divasón's material from Rank_Nullity_Theorem/Miscellaneous
paulson <lp15@cam.ac.uk>
parents:
68041
diff
changeset
|
2 |
Some material by Jose Divasón, Tim Makarios and L C Paulson |
68038
20b713cff87a
new material on matricies by Tim Makarios (from Tarskis_Geometry in the AFP)
paulson <lp15@cam.ac.uk>
parents:
67986
diff
changeset
|
3 |
*) |
20b713cff87a
new material on matricies by Tim Makarios (from Tarskis_Geometry in the AFP)
paulson <lp15@cam.ac.uk>
parents:
67986
diff
changeset
|
4 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
5 |
section \<open>Finite Cartesian Products of Euclidean Spaces\<close> |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
6 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
7 |
theory Cartesian_Euclidean_Space |
71175
a1e94be66bd6
reduced imports; deleted unusewd minor lemmas for that purpose
nipkow
parents:
71172
diff
changeset
|
8 |
imports Derivative |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
9 |
begin |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
10 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
11 |
lemma subspace_special_hyperplane: "subspace {x. x $ k = 0}" |
63016
3590590699b1
numerous theorems about affine hulls, hyperplanes, etc.
paulson <lp15@cam.ac.uk>
parents:
62397
diff
changeset
|
12 |
by (simp add: subspace_def) |
3590590699b1
numerous theorems about affine hulls, hyperplanes, etc.
paulson <lp15@cam.ac.uk>
parents:
62397
diff
changeset
|
13 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
14 |
lemma sum_mult_product: |
64267 | 15 |
"sum h {..<A * B :: nat} = (\<Sum>i\<in>{..<A}. \<Sum>j\<in>{..<B}. h (j + i * B))" |
70113
c8deb8ba6d05
Fixing the main Homology theory; also moving a lot of sum/prod lemmas into their generic context
paulson <lp15@cam.ac.uk>
parents:
69723
diff
changeset
|
16 |
unfolding sum.nat_group[of h B A, unfolded atLeast0LessThan, symmetric] |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
17 |
proof (rule sum.cong, simp, rule sum.reindex_cong) |
49644 | 18 |
fix i |
19 |
show "inj_on (\<lambda>j. j + i * B) {..<B}" by (auto intro!: inj_onI) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
20 |
show "{i * B..<i * B + B} = (\<lambda>j. j + i * B) ` {..<B}" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
21 |
proof safe |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
22 |
fix j assume "j \<in> {i * B..<i * B + B}" |
49644 | 23 |
then show "j \<in> (\<lambda>j. j + i * B) ` {..<B}" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
24 |
by (auto intro!: image_eqI[of _ _ "j - i * B"]) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
25 |
qed simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
26 |
qed simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
27 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
28 |
lemma interval_cbox_cart: "{a::real^'n..b} = cbox a b" |
56188 | 29 |
by (auto simp add: less_eq_vec_def mem_box Basis_vec_def inner_axis) |
30 |
||
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
31 |
lemma differentiable_vec: |
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
32 |
fixes S :: "'a::euclidean_space set" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
33 |
shows "vec differentiable_on S" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
34 |
by (simp add: linear_linear bounded_linear_imp_differentiable_on) |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
35 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
36 |
lemma continuous_vec [continuous_intros]: |
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
37 |
fixes x :: "'a::euclidean_space" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
38 |
shows "isCont vec x" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
39 |
apply (clarsimp simp add: continuous_def LIM_def dist_vec_def L2_set_def) |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
40 |
apply (rule_tac x="r / sqrt (real CARD('b))" in exI) |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
41 |
by (simp add: mult.commute pos_less_divide_eq real_sqrt_mult) |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
42 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
43 |
lemma box_vec_eq_empty [simp]: |
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
44 |
shows "cbox (vec a) (vec b) = {} \<longleftrightarrow> cbox a b = {}" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
45 |
"box (vec a) (vec b) = {} \<longleftrightarrow> box a b = {}" |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
46 |
by (auto simp: Basis_vec_def mem_box box_eq_empty inner_axis) |
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67971
diff
changeset
|
47 |
|
69683 | 48 |
subsection\<open>Closures and interiors of halfspaces\<close> |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
49 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
50 |
lemma interior_halfspace_component_le [simp]: |
67731 | 51 |
"interior {x. x$k \<le> a} = {x :: (real^'n). x$k < a}" (is "?LE") |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
52 |
and interior_halfspace_component_ge [simp]: |
67731 | 53 |
"interior {x. x$k \<ge> a} = {x :: (real^'n). x$k > a}" (is "?GE") |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
54 |
proof - |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
55 |
have "axis k (1::real) \<noteq> 0" |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
56 |
by (simp add: axis_def vec_eq_iff) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
57 |
moreover have "axis k (1::real) \<bullet> x = x$k" for x |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
58 |
by (simp add: cart_eq_inner_axis inner_commute) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
59 |
ultimately show ?LE ?GE |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
60 |
using interior_halfspace_le [of "axis k (1::real)" a] |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
61 |
interior_halfspace_ge [of "axis k (1::real)" a] by auto |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
62 |
qed |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
63 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
64 |
lemma closure_halfspace_component_lt [simp]: |
67731 | 65 |
"closure {x. x$k < a} = {x :: (real^'n). x$k \<le> a}" (is "?LE") |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
66 |
and closure_halfspace_component_gt [simp]: |
67731 | 67 |
"closure {x. x$k > a} = {x :: (real^'n). x$k \<ge> a}" (is "?GE") |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
68 |
proof - |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
69 |
have "axis k (1::real) \<noteq> 0" |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
70 |
by (simp add: axis_def vec_eq_iff) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
71 |
moreover have "axis k (1::real) \<bullet> x = x$k" for x |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
72 |
by (simp add: cart_eq_inner_axis inner_commute) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
73 |
ultimately show ?LE ?GE |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
74 |
using closure_halfspace_lt [of "axis k (1::real)" a] |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
75 |
closure_halfspace_gt [of "axis k (1::real)" a] by auto |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
76 |
qed |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
77 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
78 |
lemma interior_standard_hyperplane: |
67731 | 79 |
"interior {x :: (real^'n). x$k = a} = {}" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
80 |
proof - |
62397
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
81 |
have "axis k (1::real) \<noteq> 0" |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
82 |
by (simp add: axis_def vec_eq_iff) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
83 |
moreover have "axis k (1::real) \<bullet> x = x$k" for x |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
84 |
by (simp add: cart_eq_inner_axis inner_commute) |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
85 |
ultimately show ?thesis |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
86 |
using interior_hyperplane [of "axis k (1::real)" a] |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
87 |
by force |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
88 |
qed |
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
paulson <lp15@cam.ac.uk>
parents:
62127
diff
changeset
|
89 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
90 |
lemma matrix_vector_mul_bounded_linear[intro, simp]: "bounded_linear ((*v) A)" for A :: "'a::{euclidean_space,real_algebra_1}^'n^'m" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
91 |
using matrix_vector_mul_linear[of A] |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
92 |
by (simp add: linear_conv_bounded_linear linear_matrix_vector_mul_eq) |
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
93 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
94 |
lemma |
68073
fad29d2a17a5
merged; resolved conflicts manually (esp. lemmas that have been moved from Linear_Algebra and Cartesian_Euclidean_Space)
immler
diff
changeset
|
95 |
fixes A :: "'a::{euclidean_space,real_algebra_1}^'n^'m" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
96 |
shows matrix_vector_mult_linear_continuous_at [continuous_intros]: "isCont ((*v) A) z" |
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
97 |
and matrix_vector_mult_linear_continuous_on [continuous_intros]: "continuous_on S ((*v) A)" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
98 |
by (simp_all add: linear_continuous_at linear_continuous_on) |
67981
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
99 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
100 |
|
69683 | 101 |
subsection\<open>Bounds on components etc.\ relative to operator norm\<close> |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
102 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
103 |
lemma norm_column_le_onorm: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
104 |
fixes A :: "real^'n^'m" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
105 |
shows "norm(column i A) \<le> onorm((*v) A)" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
106 |
proof - |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
107 |
have "norm (\<chi> j. A $ j $ i) \<le> norm (A *v axis i 1)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
108 |
by (simp add: matrix_mult_dot cart_eq_inner_axis) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
109 |
also have "\<dots> \<le> onorm ((*v) A)" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
110 |
using onorm [OF matrix_vector_mul_bounded_linear, of A "axis i 1"] by auto |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
111 |
finally have "norm (\<chi> j. A $ j $ i) \<le> onorm ((*v) A)" . |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
112 |
then show ?thesis |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
113 |
unfolding column_def . |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
114 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
115 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
116 |
lemma matrix_component_le_onorm: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
117 |
fixes A :: "real^'n^'m" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
118 |
shows "\<bar>A $ i $ j\<bar> \<le> onorm((*v) A)" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
119 |
proof - |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
120 |
have "\<bar>A $ i $ j\<bar> \<le> norm (\<chi> n. (A $ n $ j))" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
121 |
by (metis (full_types, lifting) component_le_norm_cart vec_lambda_beta) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
122 |
also have "\<dots> \<le> onorm ((*v) A)" |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
123 |
by (metis (no_types) column_def norm_column_le_onorm) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
124 |
finally show ?thesis . |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
125 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
126 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
127 |
lemma component_le_onorm: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
128 |
fixes f :: "real^'m \<Rightarrow> real^'n" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
129 |
shows "linear f \<Longrightarrow> \<bar>matrix f $ i $ j\<bar> \<le> onorm f" |
71172 | 130 |
by (metis matrix_component_le_onorm matrix_vector_mul(2)) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
131 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
132 |
lemma onorm_le_matrix_component_sum: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
133 |
fixes A :: "real^'n^'m" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
134 |
shows "onorm((*v) A) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>)" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
135 |
proof (rule onorm_le) |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
136 |
fix x |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
137 |
have "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
138 |
by (rule norm_le_l1_cart) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
139 |
also have "\<dots> \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
140 |
proof (rule sum_mono) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
141 |
fix i |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
142 |
have "\<bar>(A *v x) $ i\<bar> \<le> \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar>" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
143 |
by (simp add: matrix_vector_mult_def) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
144 |
also have "\<dots> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
145 |
by (rule sum_abs) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
146 |
also have "\<dots> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
147 |
by (rule sum_mono) (simp add: abs_mult component_le_norm_cart mult_left_mono) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
148 |
finally show "\<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)" . |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
149 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
150 |
finally show "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
151 |
by (simp add: sum_distrib_right) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
152 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
153 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
154 |
lemma onorm_le_matrix_component: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
155 |
fixes A :: "real^'n^'m" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
156 |
assumes "\<And>i j. abs(A$i$j) \<le> B" |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
157 |
shows "onorm((*v) A) \<le> real (CARD('m)) * real (CARD('n)) * B" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
158 |
proof (rule onorm_le) |
67731 | 159 |
fix x :: "real^'n::_" |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
160 |
have "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
161 |
by (rule norm_le_l1_cart) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
162 |
also have "\<dots> \<le> (\<Sum>i::'m \<in>UNIV. real (CARD('n)) * B * norm x)" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
163 |
proof (rule sum_mono) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
164 |
fix i |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
165 |
have "\<bar>(A *v x) $ i\<bar> \<le> norm(A $ i) * norm x" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
166 |
by (simp add: matrix_mult_dot Cauchy_Schwarz_ineq2) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
167 |
also have "\<dots> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
168 |
by (simp add: mult_right_mono norm_le_l1_cart) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
169 |
also have "\<dots> \<le> real (CARD('n)) * B * norm x" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
170 |
by (simp add: assms sum_bounded_above mult_right_mono) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
171 |
finally show "\<bar>(A *v x) $ i\<bar> \<le> real (CARD('n)) * B * norm x" . |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
172 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
173 |
also have "\<dots> \<le> CARD('m) * real (CARD('n)) * B * norm x" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
174 |
by simp |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
175 |
finally show "norm (A *v x) \<le> CARD('m) * real (CARD('n)) * B * norm x" . |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
176 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
177 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
178 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
179 |
lemma rational_approximation: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
180 |
assumes "e > 0" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
181 |
obtains r::real where "r \<in> \<rat>" "\<bar>r - x\<bar> < e" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
182 |
using Rats_dense_in_real [of "x - e/2" "x + e/2"] assms by auto |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
183 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
184 |
proposition matrix_rational_approximation: |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
185 |
fixes A :: "real^'n^'m" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
186 |
assumes "e > 0" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
187 |
obtains B where "\<And>i j. B$i$j \<in> \<rat>" "onorm(\<lambda>x. (A - B) *v x) < e" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
188 |
proof - |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
189 |
have "\<forall>i j. \<exists>q \<in> \<rat>. \<bar>q - A $ i $ j\<bar> < e / (2 * CARD('m) * CARD('n))" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
190 |
using assms by (force intro: rational_approximation [of "e / (2 * CARD('m) * CARD('n))"]) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
191 |
then obtain B where B: "\<And>i j. B$i$j \<in> \<rat>" and Bclo: "\<And>i j. \<bar>B$i$j - A $ i $ j\<bar> < e / (2 * CARD('m) * CARD('n))" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
192 |
by (auto simp: lambda_skolem Bex_def) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
193 |
show ?thesis |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
194 |
proof |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
195 |
have "onorm ((*v) (A - B)) \<le> real CARD('m) * real CARD('n) * |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
196 |
(e / (2 * real CARD('m) * real CARD('n)))" |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
197 |
apply (rule onorm_le_matrix_component) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
198 |
using Bclo by (simp add: abs_minus_commute less_imp_le) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
199 |
also have "\<dots> < e" |
70817
dd675800469d
dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents:
70136
diff
changeset
|
200 |
using \<open>0 < e\<close> by (simp add: field_split_simps) |
69064
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents:
68833
diff
changeset
|
201 |
finally show "onorm ((*v) (A - B)) < e" . |
67719
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
202 |
qed (use B in auto) |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
203 |
qed |
bffb7482faaa
new material on matrices, etc., and consolidating duplicate results about of_nat
paulson <lp15@cam.ac.uk>
parents:
67686
diff
changeset
|
204 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
205 |
lemma vector_sub_project_orthogonal_cart: "(b::real^'n) \<bullet> (x - ((b \<bullet> x) / (b \<bullet> b)) *s b) = 0" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
206 |
unfolding inner_simps scalar_mult_eq_scaleR by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
207 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
208 |
lemma infnorm_cart:"infnorm (x::real^'n) = Sup {\<bar>x$i\<bar> |i. i\<in>UNIV}" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
209 |
by (simp add: infnorm_def inner_axis Basis_vec_def) (metis (lifting) inner_axis real_inner_1_right) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
210 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
211 |
lemma component_le_infnorm_cart: "\<bar>x$i\<bar> \<le> infnorm (x::real^'n)" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
212 |
using Basis_le_infnorm[of "axis i 1" x] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
213 |
by (simp add: Basis_vec_def axis_eq_axis inner_axis) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
214 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
215 |
lemma continuous_component[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. f x $ i)" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44571
diff
changeset
|
216 |
unfolding continuous_def by (rule tendsto_vec_nth) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
217 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
218 |
lemma continuous_on_component[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. f x $ i)" |
44647
e4de7750cdeb
modernize lemmas about 'continuous' and 'continuous_on';
huffman
parents:
44571
diff
changeset
|
219 |
unfolding continuous_on_def by (fast intro: tendsto_vec_nth) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
220 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
221 |
lemma continuous_on_vec_lambda[continuous_intros]: |
63334
bd37a72a940a
Multivariate_Analysis: add continuous_on_vec_lambda
hoelzl
parents:
63332
diff
changeset
|
222 |
"(\<And>i. continuous_on S (f i)) \<Longrightarrow> continuous_on S (\<lambda>x. \<chi> i. f i x)" |
bd37a72a940a
Multivariate_Analysis: add continuous_on_vec_lambda
hoelzl
parents:
63332
diff
changeset
|
223 |
unfolding continuous_on_def by (auto intro: tendsto_vec_lambda) |
bd37a72a940a
Multivariate_Analysis: add continuous_on_vec_lambda
hoelzl
parents:
63332
diff
changeset
|
224 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
225 |
lemma closed_positive_orthant: "closed {x::real^'n. \<forall>i. 0 \<le>x$i}" |
71172 | 226 |
by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_component) |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
227 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
228 |
lemma bounded_component_cart: "bounded s \<Longrightarrow> bounded ((\<lambda>x. x $ i) ` s)" |
49644 | 229 |
unfolding bounded_def |
230 |
apply clarify |
|
231 |
apply (rule_tac x="x $ i" in exI) |
|
232 |
apply (rule_tac x="e" in exI) |
|
233 |
apply clarify |
|
234 |
apply (rule order_trans [OF dist_vec_nth_le], simp) |
|
235 |
done |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
236 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
237 |
lemma compact_lemma_cart: |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
238 |
fixes f :: "nat \<Rightarrow> 'a::heine_borel ^ 'n" |
50998 | 239 |
assumes f: "bounded (range f)" |
66447
a1f5c5c26fa6
Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents:
64267
diff
changeset
|
240 |
shows "\<exists>l r. strict_mono r \<and> |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
241 |
(\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) $ i) (l $ i) < e) sequentially)" |
62127 | 242 |
(is "?th d") |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
243 |
proof - |
62127 | 244 |
have "\<forall>d' \<subseteq> d. ?th d'" |
245 |
by (rule compact_lemma_general[where unproj=vec_lambda]) |
|
71172 | 246 |
(auto intro!: f bounded_component_cart) |
62127 | 247 |
then show "?th d" by simp |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
248 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
249 |
|
44136
e63ad7d5158d
more uniform naming scheme for finite cartesian product type and related theorems
huffman
parents:
44135
diff
changeset
|
250 |
instance vec :: (heine_borel, finite) heine_borel |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
251 |
proof |
50998 | 252 |
fix f :: "nat \<Rightarrow> 'a ^ 'b" |
253 |
assume f: "bounded (range f)" |
|
66447
a1f5c5c26fa6
Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents:
64267
diff
changeset
|
254 |
then obtain l r where r: "strict_mono r" |
49644 | 255 |
and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>UNIV. dist (f (r n) $ i) (l $ i) < e) sequentially" |
50998 | 256 |
using compact_lemma_cart [OF f] by blast |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
257 |
let ?d = "UNIV::'b set" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
258 |
{ fix e::real assume "e>0" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
259 |
hence "0 < e / (real_of_nat (card ?d))" |
49644 | 260 |
using zero_less_card_finite divide_pos_pos[of e, of "real_of_nat (card ?d)"] by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
261 |
with l have "eventually (\<lambda>n. \<forall>i. dist (f (r n) $ i) (l $ i) < e / (real_of_nat (card ?d))) sequentially" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
262 |
by simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
263 |
moreover |
49644 | 264 |
{ fix n |
265 |
assume n: "\<forall>i. dist (f (r n) $ i) (l $ i) < e / (real_of_nat (card ?d))" |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
266 |
have "dist (f (r n)) l \<le> (\<Sum>i\<in>?d. dist (f (r n) $ i) (l $ i))" |
67155 | 267 |
unfolding dist_vec_def using zero_le_dist by (rule L2_set_le_sum) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
268 |
also have "\<dots> < (\<Sum>i\<in>?d. e / (real_of_nat (card ?d)))" |
64267 | 269 |
by (rule sum_strict_mono) (simp_all add: n) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
270 |
finally have "dist (f (r n)) l < e" by simp |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
271 |
} |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
272 |
ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially" |
61810 | 273 |
by (rule eventually_mono) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
274 |
} |
61973 | 275 |
hence "((f \<circ> r) \<longlongrightarrow> l) sequentially" unfolding o_def tendsto_iff by simp |
66447
a1f5c5c26fa6
Replaced subseq with strict_mono
eberlm <eberlm@in.tum.de>
parents:
64267
diff
changeset
|
276 |
with r show "\<exists>l r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
277 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
278 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
279 |
lemma interval_cart: |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
280 |
fixes a :: "real^'n" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
281 |
shows "box a b = {x::real^'n. \<forall>i. a$i < x$i \<and> x$i < b$i}" |
56188 | 282 |
and "cbox a b = {x::real^'n. \<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i}" |
283 |
by (auto simp add: set_eq_iff less_vec_def less_eq_vec_def mem_box Basis_vec_def inner_axis) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
284 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
285 |
lemma mem_box_cart: |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
286 |
fixes a :: "real^'n" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
287 |
shows "x \<in> box a b \<longleftrightarrow> (\<forall>i. a$i < x$i \<and> x$i < b$i)" |
56188 | 288 |
and "x \<in> cbox a b \<longleftrightarrow> (\<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i)" |
49644 | 289 |
using interval_cart[of a b] by (auto simp add: set_eq_iff less_vec_def less_eq_vec_def) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
290 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
291 |
lemma interval_eq_empty_cart: |
49644 | 292 |
fixes a :: "real^'n" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
293 |
shows "(box a b = {} \<longleftrightarrow> (\<exists>i. b$i \<le> a$i))" (is ?th1) |
56188 | 294 |
and "(cbox a b = {} \<longleftrightarrow> (\<exists>i. b$i < a$i))" (is ?th2) |
49644 | 295 |
proof - |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
296 |
{ fix i x assume as:"b$i \<le> a$i" and x:"x\<in>box a b" |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
297 |
hence "a $ i < x $ i \<and> x $ i < b $ i" unfolding mem_box_cart by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
298 |
hence "a$i < b$i" by auto |
49644 | 299 |
hence False using as by auto } |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
300 |
moreover |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
301 |
{ assume as:"\<forall>i. \<not> (b$i \<le> a$i)" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
302 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
303 |
{ fix i |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
304 |
have "a$i < b$i" using as[THEN spec[where x=i]] by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
305 |
hence "a$i < ((1/2) *\<^sub>R (a+b)) $ i" "((1/2) *\<^sub>R (a+b)) $ i < b$i" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
306 |
unfolding vector_smult_component and vector_add_component |
49644 | 307 |
by auto } |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
308 |
hence "box a b \<noteq> {}" using mem_box_cart(1)[of "?x" a b] by auto } |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
309 |
ultimately show ?th1 by blast |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
310 |
|
56188 | 311 |
{ fix i x assume as:"b$i < a$i" and x:"x\<in>cbox a b" |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
312 |
hence "a $ i \<le> x $ i \<and> x $ i \<le> b $ i" unfolding mem_box_cart by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
313 |
hence "a$i \<le> b$i" by auto |
49644 | 314 |
hence False using as by auto } |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
315 |
moreover |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
316 |
{ assume as:"\<forall>i. \<not> (b$i < a$i)" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
317 |
let ?x = "(1/2) *\<^sub>R (a + b)" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
318 |
{ fix i |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
319 |
have "a$i \<le> b$i" using as[THEN spec[where x=i]] by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
320 |
hence "a$i \<le> ((1/2) *\<^sub>R (a+b)) $ i" "((1/2) *\<^sub>R (a+b)) $ i \<le> b$i" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
321 |
unfolding vector_smult_component and vector_add_component |
49644 | 322 |
by auto } |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
323 |
hence "cbox a b \<noteq> {}" using mem_box_cart(2)[of "?x" a b] by auto } |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
324 |
ultimately show ?th2 by blast |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
325 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
326 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
327 |
lemma interval_ne_empty_cart: |
49644 | 328 |
fixes a :: "real^'n" |
56188 | 329 |
shows "cbox a b \<noteq> {} \<longleftrightarrow> (\<forall>i. a$i \<le> b$i)" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
330 |
and "box a b \<noteq> {} \<longleftrightarrow> (\<forall>i. a$i < b$i)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
331 |
unfolding interval_eq_empty_cart[of a b] by (auto simp add: not_less not_le) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
332 |
(* BH: Why doesn't just "auto" work here? *) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
333 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
334 |
lemma subset_interval_imp_cart: |
49644 | 335 |
fixes a :: "real^'n" |
56188 | 336 |
shows "(\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i) \<Longrightarrow> cbox c d \<subseteq> cbox a b" |
337 |
and "(\<forall>i. a$i < c$i \<and> d$i < b$i) \<Longrightarrow> cbox c d \<subseteq> box a b" |
|
338 |
and "(\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i) \<Longrightarrow> box c d \<subseteq> cbox a b" |
|
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
339 |
and "(\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i) \<Longrightarrow> box c d \<subseteq> box a b" |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
340 |
unfolding subset_eq[unfolded Ball_def] unfolding mem_box_cart |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
341 |
by (auto intro: order_trans less_le_trans le_less_trans less_imp_le) (* BH: Why doesn't just "auto" work here? *) |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
342 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
343 |
lemma interval_sing: |
49644 | 344 |
fixes a :: "'a::linorder^'n" |
345 |
shows "{a .. a} = {a} \<and> {a<..<a} = {}" |
|
346 |
apply (auto simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff) |
|
347 |
done |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
348 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
349 |
lemma subset_interval_cart: |
49644 | 350 |
fixes a :: "real^'n" |
56188 | 351 |
shows "cbox c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i. c$i \<le> d$i) --> (\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i)" (is ?th1) |
352 |
and "cbox c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i. c$i \<le> d$i) --> (\<forall>i. a$i < c$i \<and> d$i < b$i)" (is ?th2) |
|
353 |
and "box c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i. c$i < d$i) --> (\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i)" (is ?th3) |
|
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
354 |
and "box c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i. c$i < d$i) --> (\<forall>i. a$i \<le> c$i \<and> d$i \<le> b$i)" (is ?th4) |
56188 | 355 |
using subset_box[of c d a b] by (simp_all add: Basis_vec_def inner_axis) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
356 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
357 |
lemma disjoint_interval_cart: |
49644 | 358 |
fixes a::"real^'n" |
56188 | 359 |
shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i. (b$i < a$i \<or> d$i < c$i \<or> b$i < c$i \<or> d$i < a$i))" (is ?th1) |
360 |
and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b$i < a$i \<or> d$i \<le> c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th2) |
|
361 |
and "box a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i. (b$i \<le> a$i \<or> d$i < c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th3) |
|
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
362 |
and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b$i \<le> a$i \<or> d$i \<le> c$i \<or> b$i \<le> c$i \<or> d$i \<le> a$i))" (is ?th4) |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
363 |
using disjoint_interval[of a b c d] by (simp_all add: Basis_vec_def inner_axis) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
364 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
365 |
lemma Int_interval_cart: |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54489
diff
changeset
|
366 |
fixes a :: "real^'n" |
56188 | 367 |
shows "cbox a b \<inter> cbox c d = {(\<chi> i. max (a$i) (c$i)) .. (\<chi> i. min (b$i) (d$i))}" |
63945
444eafb6e864
a few new theorems and a renaming
paulson <lp15@cam.ac.uk>
parents:
63938
diff
changeset
|
368 |
unfolding Int_interval |
56188 | 369 |
by (auto simp: mem_box less_eq_vec_def) |
370 |
(auto simp: Basis_vec_def inner_axis) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
371 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
372 |
lemma closed_interval_left_cart: |
49644 | 373 |
fixes b :: "real^'n" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
374 |
shows "closed {x::real^'n. \<forall>i. x$i \<le> b$i}" |
71172 | 375 |
by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_component) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
376 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
377 |
lemma closed_interval_right_cart: |
49644 | 378 |
fixes a::"real^'n" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
379 |
shows "closed {x::real^'n. \<forall>i. a$i \<le> x$i}" |
71172 | 380 |
by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_component) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
381 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
382 |
lemma is_interval_cart: |
49644 | 383 |
"is_interval (s::(real^'n) set) \<longleftrightarrow> |
384 |
(\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i. ((a$i \<le> x$i \<and> x$i \<le> b$i) \<or> (b$i \<le> x$i \<and> x$i \<le> a$i))) \<longrightarrow> x \<in> s)" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
385 |
by (simp add: is_interval_def Ball_def Basis_vec_def inner_axis imp_ex) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
386 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
387 |
lemma closed_halfspace_component_le_cart: "closed {x::real^'n. x$i \<le> a}" |
69669 | 388 |
by (simp add: closed_Collect_le continuous_on_component) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
389 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
390 |
lemma closed_halfspace_component_ge_cart: "closed {x::real^'n. x$i \<ge> a}" |
69669 | 391 |
by (simp add: closed_Collect_le continuous_on_component) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
392 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
393 |
lemma open_halfspace_component_lt_cart: "open {x::real^'n. x$i < a}" |
69669 | 394 |
by (simp add: open_Collect_less continuous_on_component) |
49644 | 395 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
396 |
lemma open_halfspace_component_gt_cart: "open {x::real^'n. x$i > a}" |
69669 | 397 |
by (simp add: open_Collect_less continuous_on_component) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
398 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
399 |
lemma Lim_component_le_cart: |
49644 | 400 |
fixes f :: "'a \<Rightarrow> real^'n" |
61973 | 401 |
assumes "(f \<longlongrightarrow> l) net" "\<not> (trivial_limit net)" "eventually (\<lambda>x. f x $i \<le> b) net" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
402 |
shows "l$i \<le> b" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
403 |
by (rule tendsto_le[OF assms(2) tendsto_const tendsto_vec_nth, OF assms(1, 3)]) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
404 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
405 |
lemma Lim_component_ge_cart: |
49644 | 406 |
fixes f :: "'a \<Rightarrow> real^'n" |
61973 | 407 |
assumes "(f \<longlongrightarrow> l) net" "\<not> (trivial_limit net)" "eventually (\<lambda>x. b \<le> (f x)$i) net" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
408 |
shows "b \<le> l$i" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
409 |
by (rule tendsto_le[OF assms(2) tendsto_vec_nth tendsto_const, OF assms(1, 3)]) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
410 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
411 |
lemma Lim_component_eq_cart: |
49644 | 412 |
fixes f :: "'a \<Rightarrow> real^'n" |
69508 | 413 |
assumes net: "(f \<longlongrightarrow> l) net" "\<not> trivial_limit net" and ev:"eventually (\<lambda>x. f(x)$i = b) net" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
414 |
shows "l$i = b" |
49644 | 415 |
using ev[unfolded order_eq_iff eventually_conj_iff] and |
416 |
Lim_component_ge_cart[OF net, of b i] and |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
417 |
Lim_component_le_cart[OF net, of i b] by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
418 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
419 |
lemma connected_ivt_component_cart: |
49644 | 420 |
fixes x :: "real^'n" |
421 |
shows "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x$k \<le> a \<Longrightarrow> a \<le> y$k \<Longrightarrow> (\<exists>z\<in>s. z$k = a)" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
422 |
using connected_ivt_hyperplane[of s x y "axis k 1" a] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
423 |
by (auto simp add: inner_axis inner_commute) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
424 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
425 |
lemma subspace_substandard_cart: "vec.subspace {x. (\<forall>i. P i \<longrightarrow> x$i = 0)}" |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67986
diff
changeset
|
426 |
unfolding vec.subspace_def by auto |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
427 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
428 |
lemma closed_substandard_cart: |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
429 |
"closed {x::'a::real_normed_vector ^ 'n. \<forall>i. P i \<longrightarrow> x$i = 0}" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
430 |
proof - |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
431 |
{ fix i::'n |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
432 |
have "closed {x::'a ^ 'n. P i \<longrightarrow> x$i = 0}" |
71172 | 433 |
by (cases "P i") (simp_all add: closed_Collect_eq continuous_on_component) } |
44213
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
434 |
thus ?thesis |
6fb54701a11b
add lemmas open_Collect_less, closed_Collect_le, closed_Collect_eq;
huffman
parents:
44211
diff
changeset
|
435 |
unfolding Collect_all_eq by (simp add: closed_INT) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
436 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
437 |
|
69683 | 438 |
subsection "Convex Euclidean Space" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
439 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
440 |
lemma Cart_1:"(1::real^'n) = \<Sum>Basis" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
441 |
using const_vector_cart[of 1] by (simp add: one_vec_def) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
442 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
443 |
declare vector_add_ldistrib[simp] vector_ssub_ldistrib[simp] vector_smult_assoc[simp] vector_smult_rneg[simp] |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
444 |
declare vector_sadd_rdistrib[simp] vector_sub_rdistrib[simp] |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
445 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
446 |
lemmas vector_component_simps = vector_minus_component vector_smult_component vector_add_component less_eq_vec_def vec_lambda_beta vector_uminus_component |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
447 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
448 |
lemma convex_box_cart: |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
449 |
assumes "\<And>i. convex {x. P i x}" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
450 |
shows "convex {x. \<forall>i. P i (x$i)}" |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
451 |
using assms unfolding convex_def by auto |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
452 |
|
71175
a1e94be66bd6
reduced imports; deleted unusewd minor lemmas for that purpose
nipkow
parents:
71172
diff
changeset
|
453 |
(* Unused |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
454 |
lemma convex_positive_orthant_cart: "convex {x::real^'n. (\<forall>i. 0 \<le> x$i)}" |
63334
bd37a72a940a
Multivariate_Analysis: add continuous_on_vec_lambda
hoelzl
parents:
63332
diff
changeset
|
455 |
by (rule convex_box_cart) (simp add: atLeast_def[symmetric]) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
456 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
457 |
lemma unit_interval_convex_hull_cart: |
56188 | 458 |
"cbox (0::real^'n) 1 = convex hull {x. \<forall>i. (x$i = 0) \<or> (x$i = 1)}" |
459 |
unfolding Cart_1 unit_interval_convex_hull[where 'a="real^'n"] box_real[symmetric] |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
460 |
by (rule arg_cong[where f="\<lambda>x. convex hull x"]) (simp add: Basis_vec_def inner_axis) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
461 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
462 |
proposition cube_convex_hull_cart: |
49644 | 463 |
assumes "0 < d" |
464 |
obtains s::"(real^'n) set" |
|
56188 | 465 |
where "finite s" "cbox (x - (\<chi> i. d)) (x + (\<chi> i. d)) = convex hull s" |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
466 |
proof - |
55522 | 467 |
from assms obtain s where "finite s" |
71175
a1e94be66bd6
reduced imports; deleted unusewd minor lemmas for that purpose
nipkow
parents:
71172
diff
changeset
|
468 |
and "cbox (x - sum (( *\<^sub>R) d) Basis) (x + sum (( *\<^sub>R) d) Basis) = convex hull s" |
55522 | 469 |
by (rule cube_convex_hull) |
470 |
with that[of s] show thesis |
|
471 |
by (simp add: const_vector_cart) |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
472 |
qed |
71175
a1e94be66bd6
reduced imports; deleted unusewd minor lemmas for that purpose
nipkow
parents:
71172
diff
changeset
|
473 |
*) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
474 |
|
69683 | 475 |
subsection "Derivative" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
476 |
|
70136 | 477 |
definition\<^marker>\<open>tag important\<close> "jacobian f net = matrix(frechet_derivative f net)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
478 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
479 |
proposition jacobian_works: |
49644 | 480 |
"(f::(real^'a) \<Rightarrow> (real^'b)) differentiable net \<longleftrightarrow> |
67986
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
481 |
(f has_derivative (\<lambda>h. (jacobian f net) *v h)) net" (is "?lhs = ?rhs") |
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
482 |
proof |
67986
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
483 |
assume ?lhs then show ?rhs |
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
484 |
by (simp add: frechet_derivative_works has_derivative_linear jacobian_def) |
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
485 |
next |
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
486 |
assume ?rhs then show ?lhs |
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
487 |
by (rule differentiableI) |
b65c4a6a015e
quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
67982
diff
changeset
|
488 |
qed |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
489 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
490 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
491 |
text \<open>Component of the differential must be zero if it exists at a local |
67968 | 492 |
maximum or minimum for that corresponding component\<close> |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
493 |
|
69723
9b9f203e0ba3
tagged 2 theories ie Cartesian_Euclidean_Space Cartesian_Space
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69686
diff
changeset
|
494 |
proposition differential_zero_maxmin_cart: |
49644 | 495 |
fixes f::"real^'a \<Rightarrow> real^'b" |
496 |
assumes "0 < e" "((\<forall>y \<in> ball x e. (f y)$k \<le> (f x)$k) \<or> (\<forall>y\<in>ball x e. (f x)$k \<le> (f y)$k))" |
|
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
497 |
"f differentiable (at x)" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
498 |
shows "jacobian f (at x) $ k = 0" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
499 |
using differential_zero_maxmin_component[of "axis k 1" e x f] assms |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
500 |
vector_cart[of "\<lambda>j. frechet_derivative f (at x) j $ k"] |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
49962
diff
changeset
|
501 |
by (simp add: Basis_vec_def axis_eq_axis inner_axis jacobian_def matrix_def) |
49644 | 502 |
|
70136 | 503 |
subsection\<^marker>\<open>tag unimportant\<close>\<open>Routine results connecting the types \<^typ>\<open>real^1\<close> and \<^typ>\<open>real\<close>\<close> |
67981
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
504 |
|
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
505 |
lemma vec_cbox_1_eq [simp]: |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
506 |
shows "vec ` cbox u v = cbox (vec u) (vec v ::real^1)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
507 |
by (force simp: Basis_vec_def cart_eq_inner_axis [symmetric] mem_box) |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
508 |
|
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
509 |
lemma vec_nth_cbox_1_eq [simp]: |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
510 |
fixes u v :: "'a::euclidean_space^1" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
511 |
shows "(\<lambda>x. x $ 1) ` cbox u v = cbox (u$1) (v$1)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
512 |
by (auto simp: Basis_vec_def cart_eq_inner_axis [symmetric] mem_box image_iff Bex_def inner_axis) (metis vec_component) |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
513 |
|
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
514 |
lemma vec_nth_1_iff_cbox [simp]: |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
515 |
fixes a b :: "'a::euclidean_space" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
516 |
shows "(\<lambda>x::'a^1. x $ 1) ` S = cbox a b \<longleftrightarrow> S = cbox (vec a) (vec b)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
517 |
(is "?lhs = ?rhs") |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
518 |
proof |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
519 |
assume L: ?lhs show ?rhs |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
520 |
proof (intro equalityI subsetI) |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
521 |
fix x |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
522 |
assume "x \<in> S" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
523 |
then have "x $ 1 \<in> (\<lambda>v. v $ (1::1)) ` cbox (vec a) (vec b)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
524 |
using L by auto |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
525 |
then show "x \<in> cbox (vec a) (vec b)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
526 |
by (metis (no_types, lifting) imageE vector_one_nth) |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
527 |
next |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
528 |
fix x :: "'a^1" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
529 |
assume "x \<in> cbox (vec a) (vec b)" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
530 |
then show "x \<in> S" |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
531 |
by (metis (no_types, lifting) L imageE imageI vec_component vec_nth_cbox_1_eq vector_one_nth) |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
532 |
qed |
349c639e593c
more new theorems on real^1, matrices, etc.
paulson <lp15@cam.ac.uk>
parents:
67979
diff
changeset
|
533 |
qed simp |
49644 | 534 |
|
71025
be8cec1abcbb
reduce dependencies of Ordered_Euclidean_Space; move more general material from Cartesian_Euclidean_Space
immler
parents:
70817
diff
changeset
|
535 |
lemma vec_nth_real_1_iff_cbox [simp]: |
be8cec1abcbb
reduce dependencies of Ordered_Euclidean_Space; move more general material from Cartesian_Euclidean_Space
immler
parents:
70817
diff
changeset
|
536 |
fixes a b :: real |
be8cec1abcbb
reduce dependencies of Ordered_Euclidean_Space; move more general material from Cartesian_Euclidean_Space
immler
parents:
70817
diff
changeset
|
537 |
shows "(\<lambda>x::real^1. x $ 1) ` S = {a..b} \<longleftrightarrow> S = cbox (vec a) (vec b)" |
be8cec1abcbb
reduce dependencies of Ordered_Euclidean_Space; move more general material from Cartesian_Euclidean_Space
immler
parents:
70817
diff
changeset
|
538 |
using vec_nth_1_iff_cbox[of S a b] |
be8cec1abcbb
reduce dependencies of Ordered_Euclidean_Space; move more general material from Cartesian_Euclidean_Space
immler
parents:
70817
diff
changeset
|
539 |
by simp |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
540 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
541 |
lemma interval_split_cart: |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
542 |
"{a..b::real^'n} \<inter> {x. x$k \<le> c} = {a .. (\<chi> i. if i = k then min (b$k) c else b$i)}" |
56188 | 543 |
"cbox a b \<inter> {x. x$k \<ge> c} = {(\<chi> i. if i = k then max (a$k) c else a$i) .. b}" |
49644 | 544 |
apply (rule_tac[!] set_eqI) |
67673
c8caefb20564
lots of new material, ultimately related to measure theory
paulson <lp15@cam.ac.uk>
parents:
67399
diff
changeset
|
545 |
unfolding Int_iff mem_box_cart mem_Collect_eq interval_cbox_cart |
49644 | 546 |
unfolding vec_lambda_beta |
547 |
by auto |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
548 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67673
diff
changeset
|
549 |
lemmas cartesian_euclidean_space_uniform_limit_intros[uniform_limit_intros] = |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67673
diff
changeset
|
550 |
bounded_linear.uniform_limit[OF blinfun.bounded_linear_right] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67673
diff
changeset
|
551 |
bounded_linear.uniform_limit[OF bounded_linear_vec_nth] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67673
diff
changeset
|
552 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
diff
changeset
|
553 |
end |