src/HOL/Analysis/Linear_Algebra.thy
 author immler Tue Jul 10 09:38:35 2018 +0200 (10 months ago) changeset 68607 67bb59e49834 parent 68224 1f7308050349 child 68901 4824cc40f42e permissions -rw-r--r--
make theorem, corollary, and proposition %important for HOL-Analysis manual
 hoelzl@63627 ` 1` ```(* Title: HOL/Analysis/Linear_Algebra.thy ``` huffman@44133 ` 2` ``` Author: Amine Chaieb, University of Cambridge ``` huffman@44133 ` 3` ```*) ``` huffman@44133 ` 4` wenzelm@60420 ` 5` ```section \Elementary linear algebra on Euclidean spaces\ ``` huffman@44133 ` 6` huffman@44133 ` 7` ```theory Linear_Algebra ``` huffman@44133 ` 8` ```imports ``` huffman@44133 ` 9` ``` Euclidean_Space ``` wenzelm@66453 ` 10` ``` "HOL-Library.Infinite_Set" ``` huffman@44133 ` 11` ```begin ``` huffman@44133 ` 12` hoelzl@63886 ` 13` ```lemma linear_simps: ``` hoelzl@63886 ` 14` ``` assumes "bounded_linear f" ``` hoelzl@63886 ` 15` ``` shows ``` hoelzl@63886 ` 16` ``` "f (a + b) = f a + f b" ``` hoelzl@63886 ` 17` ``` "f (a - b) = f a - f b" ``` hoelzl@63886 ` 18` ``` "f 0 = 0" ``` hoelzl@63886 ` 19` ``` "f (- a) = - f a" ``` hoelzl@63886 ` 20` ``` "f (s *\<^sub>R v) = s *\<^sub>R (f v)" ``` hoelzl@63886 ` 21` ```proof - ``` hoelzl@63886 ` 22` ``` interpret f: bounded_linear f by fact ``` hoelzl@63886 ` 23` ``` show "f (a + b) = f a + f b" by (rule f.add) ``` hoelzl@63886 ` 24` ``` show "f (a - b) = f a - f b" by (rule f.diff) ``` hoelzl@63886 ` 25` ``` show "f 0 = 0" by (rule f.zero) ``` immler@68072 ` 26` ``` show "f (- a) = - f a" by (rule f.neg) ``` immler@68072 ` 27` ``` show "f (s *\<^sub>R v) = s *\<^sub>R (f v)" by (rule f.scale) ``` huffman@44133 ` 28` ```qed ``` huffman@44133 ` 29` lp15@68069 ` 30` ```lemma finite_Atleast_Atmost_nat[simp]: "finite {f x |x. x \ (UNIV::'a::finite set)}" ``` lp15@68069 ` 31` ``` using finite finite_image_set by blast ``` huffman@44133 ` 32` wenzelm@53406 ` 33` immler@67962 ` 34` ```subsection%unimportant \More interesting properties of the norm.\ ``` hoelzl@63050 ` 35` hoelzl@63050 ` 36` ```notation inner (infix "\" 70) ``` hoelzl@63050 ` 37` nipkow@67399 ` 38` ```text\Equality of vectors in terms of @{term "(\)"} products.\ ``` hoelzl@63050 ` 39` hoelzl@63050 ` 40` ```lemma linear_componentwise: ``` hoelzl@63050 ` 41` ``` fixes f:: "'a::euclidean_space \ 'b::real_inner" ``` hoelzl@63050 ` 42` ``` assumes lf: "linear f" ``` hoelzl@63050 ` 43` ``` shows "(f x) \ j = (\i\Basis. (x\i) * (f i\j))" (is "?lhs = ?rhs") ``` hoelzl@63050 ` 44` ```proof - ``` immler@68072 ` 45` ``` interpret linear f by fact ``` hoelzl@63050 ` 46` ``` have "?rhs = (\i\Basis. (x\i) *\<^sub>R (f i))\j" ``` nipkow@64267 ` 47` ``` by (simp add: inner_sum_left) ``` hoelzl@63050 ` 48` ``` then show ?thesis ``` immler@68072 ` 49` ``` by (simp add: euclidean_representation sum[symmetric] scale[symmetric]) ``` hoelzl@63050 ` 50` ```qed ``` hoelzl@63050 ` 51` hoelzl@63050 ` 52` ```lemma vector_eq: "x = y \ x \ x = x \ y \ y \ y = x \ x" ``` hoelzl@63050 ` 53` ``` (is "?lhs \ ?rhs") ``` hoelzl@63050 ` 54` ```proof ``` hoelzl@63050 ` 55` ``` assume ?lhs ``` hoelzl@63050 ` 56` ``` then show ?rhs by simp ``` hoelzl@63050 ` 57` ```next ``` hoelzl@63050 ` 58` ``` assume ?rhs ``` hoelzl@63050 ` 59` ``` then have "x \ x - x \ y = 0 \ x \ y - y \ y = 0" ``` hoelzl@63050 ` 60` ``` by simp ``` hoelzl@63050 ` 61` ``` then have "x \ (x - y) = 0 \ y \ (x - y) = 0" ``` hoelzl@63050 ` 62` ``` by (simp add: inner_diff inner_commute) ``` hoelzl@63050 ` 63` ``` then have "(x - y) \ (x - y) = 0" ``` hoelzl@63050 ` 64` ``` by (simp add: field_simps inner_diff inner_commute) ``` hoelzl@63050 ` 65` ``` then show "x = y" by simp ``` hoelzl@63050 ` 66` ```qed ``` hoelzl@63050 ` 67` hoelzl@63050 ` 68` ```lemma norm_triangle_half_r: ``` hoelzl@63050 ` 69` ``` "norm (y - x1) < e / 2 \ norm (y - x2) < e / 2 \ norm (x1 - x2) < e" ``` hoelzl@63050 ` 70` ``` using dist_triangle_half_r unfolding dist_norm[symmetric] by auto ``` hoelzl@63050 ` 71` hoelzl@63050 ` 72` ```lemma norm_triangle_half_l: ``` hoelzl@63050 ` 73` ``` assumes "norm (x - y) < e / 2" ``` hoelzl@63050 ` 74` ``` and "norm (x' - y) < e / 2" ``` hoelzl@63050 ` 75` ``` shows "norm (x - x') < e" ``` hoelzl@63050 ` 76` ``` using dist_triangle_half_l[OF assms[unfolded dist_norm[symmetric]]] ``` hoelzl@63050 ` 77` ``` unfolding dist_norm[symmetric] . ``` hoelzl@63050 ` 78` hoelzl@63050 ` 79` ```lemma norm_triangle_le: "norm x + norm y \ e \ norm (x + y) \ e" ``` hoelzl@63050 ` 80` ``` by (rule norm_triangle_ineq [THEN order_trans]) ``` hoelzl@63050 ` 81` hoelzl@63050 ` 82` ```lemma norm_triangle_lt: "norm x + norm y < e \ norm (x + y) < e" ``` hoelzl@63050 ` 83` ``` by (rule norm_triangle_ineq [THEN le_less_trans]) ``` hoelzl@63050 ` 84` lp15@66420 ` 85` ```lemma abs_triangle_half_r: ``` lp15@66420 ` 86` ``` fixes y :: "'a::linordered_field" ``` lp15@66420 ` 87` ``` shows "abs (y - x1) < e / 2 \ abs (y - x2) < e / 2 \ abs (x1 - x2) < e" ``` lp15@66420 ` 88` ``` by linarith ``` lp15@66420 ` 89` lp15@66420 ` 90` ```lemma abs_triangle_half_l: ``` lp15@66420 ` 91` ``` fixes y :: "'a::linordered_field" ``` lp15@66420 ` 92` ``` assumes "abs (x - y) < e / 2" ``` lp15@66420 ` 93` ``` and "abs (x' - y) < e / 2" ``` lp15@66420 ` 94` ``` shows "abs (x - x') < e" ``` lp15@66420 ` 95` ``` using assms by linarith ``` lp15@66420 ` 96` nipkow@64267 ` 97` ```lemma sum_clauses: ``` nipkow@64267 ` 98` ``` shows "sum f {} = 0" ``` nipkow@64267 ` 99` ``` and "finite S \ sum f (insert x S) = (if x \ S then sum f S else f x + sum f S)" ``` hoelzl@63050 ` 100` ``` by (auto simp add: insert_absorb) ``` hoelzl@63050 ` 101` nipkow@64267 ` 102` ```lemma sum_norm_bound: ``` hoelzl@63050 ` 103` ``` fixes f :: "'a \ 'b::real_normed_vector" ``` lp15@64773 ` 104` ``` assumes K: "\x. x \ S \ norm (f x) \ K" ``` lp15@64773 ` 105` ``` shows "norm (sum f S) \ of_nat (card S)*K" ``` nipkow@64267 ` 106` ``` using sum_norm_le[OF K] sum_constant[symmetric] ``` hoelzl@63050 ` 107` ``` by simp ``` hoelzl@63050 ` 108` nipkow@64267 ` 109` ```lemma sum_group: ``` hoelzl@63050 ` 110` ``` assumes fS: "finite S" and fT: "finite T" and fST: "f ` S \ T" ``` nipkow@64267 ` 111` ``` shows "sum (\y. sum g {x. x \ S \ f x = y}) T = sum g S" ``` lp15@68069 ` 112` ``` unfolding sum_image_gen[OF fS, of g f] ``` lp15@68069 ` 113` ``` by (auto intro: sum.neutral sum.mono_neutral_right[OF fT fST]) ``` hoelzl@63050 ` 114` hoelzl@63050 ` 115` ```lemma vector_eq_ldot: "(\x. x \ y = x \ z) \ y = z" ``` hoelzl@63050 ` 116` ```proof ``` hoelzl@63050 ` 117` ``` assume "\x. x \ y = x \ z" ``` hoelzl@63050 ` 118` ``` then have "\x. x \ (y - z) = 0" ``` hoelzl@63050 ` 119` ``` by (simp add: inner_diff) ``` hoelzl@63050 ` 120` ``` then have "(y - z) \ (y - z) = 0" .. ``` hoelzl@63050 ` 121` ``` then show "y = z" by simp ``` hoelzl@63050 ` 122` ```qed simp ``` hoelzl@63050 ` 123` hoelzl@63050 ` 124` ```lemma vector_eq_rdot: "(\z. x \ z = y \ z) \ x = y" ``` hoelzl@63050 ` 125` ```proof ``` hoelzl@63050 ` 126` ``` assume "\z. x \ z = y \ z" ``` hoelzl@63050 ` 127` ``` then have "\z. (x - y) \ z = 0" ``` hoelzl@63050 ` 128` ``` by (simp add: inner_diff) ``` hoelzl@63050 ` 129` ``` then have "(x - y) \ (x - y) = 0" .. ``` hoelzl@63050 ` 130` ``` then show "x = y" by simp ``` hoelzl@63050 ` 131` ```qed simp ``` hoelzl@63050 ` 132` hoelzl@63050 ` 133` hoelzl@63050 ` 134` ```subsection \Orthogonality.\ ``` hoelzl@63050 ` 135` immler@67962 ` 136` ```definition%important (in real_inner) "orthogonal x y \ x \ y = 0" ``` immler@67962 ` 137` hoelzl@63050 ` 138` ```context real_inner ``` hoelzl@63050 ` 139` ```begin ``` hoelzl@63050 ` 140` lp15@63072 ` 141` ```lemma orthogonal_self: "orthogonal x x \ x = 0" ``` lp15@63072 ` 142` ``` by (simp add: orthogonal_def) ``` lp15@63072 ` 143` hoelzl@63050 ` 144` ```lemma orthogonal_clauses: ``` hoelzl@63050 ` 145` ``` "orthogonal a 0" ``` hoelzl@63050 ` 146` ``` "orthogonal a x \ orthogonal a (c *\<^sub>R x)" ``` hoelzl@63050 ` 147` ``` "orthogonal a x \ orthogonal a (- x)" ``` hoelzl@63050 ` 148` ``` "orthogonal a x \ orthogonal a y \ orthogonal a (x + y)" ``` hoelzl@63050 ` 149` ``` "orthogonal a x \ orthogonal a y \ orthogonal a (x - y)" ``` hoelzl@63050 ` 150` ``` "orthogonal 0 a" ``` hoelzl@63050 ` 151` ``` "orthogonal x a \ orthogonal (c *\<^sub>R x) a" ``` hoelzl@63050 ` 152` ``` "orthogonal x a \ orthogonal (- x) a" ``` hoelzl@63050 ` 153` ``` "orthogonal x a \ orthogonal y a \ orthogonal (x + y) a" ``` hoelzl@63050 ` 154` ``` "orthogonal x a \ orthogonal y a \ orthogonal (x - y) a" ``` hoelzl@63050 ` 155` ``` unfolding orthogonal_def inner_add inner_diff by auto ``` hoelzl@63050 ` 156` hoelzl@63050 ` 157` ```end ``` hoelzl@63050 ` 158` hoelzl@63050 ` 159` ```lemma orthogonal_commute: "orthogonal x y \ orthogonal y x" ``` hoelzl@63050 ` 160` ``` by (simp add: orthogonal_def inner_commute) ``` hoelzl@63050 ` 161` lp15@63114 ` 162` ```lemma orthogonal_scaleR [simp]: "c \ 0 \ orthogonal (c *\<^sub>R x) = orthogonal x" ``` lp15@63114 ` 163` ``` by (rule ext) (simp add: orthogonal_def) ``` lp15@63114 ` 164` lp15@63114 ` 165` ```lemma pairwise_ortho_scaleR: ``` lp15@63114 ` 166` ``` "pairwise (\i j. orthogonal (f i) (g j)) B ``` lp15@63114 ` 167` ``` \ pairwise (\i j. orthogonal (a i *\<^sub>R f i) (a j *\<^sub>R g j)) B" ``` lp15@63114 ` 168` ``` by (auto simp: pairwise_def orthogonal_clauses) ``` lp15@63114 ` 169` lp15@63114 ` 170` ```lemma orthogonal_rvsum: ``` nipkow@64267 ` 171` ``` "\finite s; \y. y \ s \ orthogonal x (f y)\ \ orthogonal x (sum f s)" ``` lp15@63114 ` 172` ``` by (induction s rule: finite_induct) (auto simp: orthogonal_clauses) ``` lp15@63114 ` 173` lp15@63114 ` 174` ```lemma orthogonal_lvsum: ``` nipkow@64267 ` 175` ``` "\finite s; \x. x \ s \ orthogonal (f x) y\ \ orthogonal (sum f s) y" ``` lp15@63114 ` 176` ``` by (induction s rule: finite_induct) (auto simp: orthogonal_clauses) ``` lp15@63114 ` 177` lp15@63114 ` 178` ```lemma norm_add_Pythagorean: ``` lp15@63114 ` 179` ``` assumes "orthogonal a b" ``` lp15@63114 ` 180` ``` shows "norm(a + b) ^ 2 = norm a ^ 2 + norm b ^ 2" ``` lp15@63114 ` 181` ```proof - ``` lp15@63114 ` 182` ``` from assms have "(a - (0 - b)) \ (a - (0 - b)) = a \ a - (0 - b \ b)" ``` lp15@63114 ` 183` ``` by (simp add: algebra_simps orthogonal_def inner_commute) ``` lp15@63114 ` 184` ``` then show ?thesis ``` lp15@63114 ` 185` ``` by (simp add: power2_norm_eq_inner) ``` lp15@63114 ` 186` ```qed ``` lp15@63114 ` 187` nipkow@64267 ` 188` ```lemma norm_sum_Pythagorean: ``` lp15@63114 ` 189` ``` assumes "finite I" "pairwise (\i j. orthogonal (f i) (f j)) I" ``` nipkow@64267 ` 190` ``` shows "(norm (sum f I))\<^sup>2 = (\i\I. (norm (f i))\<^sup>2)" ``` lp15@63114 ` 191` ```using assms ``` lp15@63114 ` 192` ```proof (induction I rule: finite_induct) ``` lp15@63114 ` 193` ``` case empty then show ?case by simp ``` lp15@63114 ` 194` ```next ``` lp15@63114 ` 195` ``` case (insert x I) ``` nipkow@64267 ` 196` ``` then have "orthogonal (f x) (sum f I)" ``` lp15@63114 ` 197` ``` by (metis pairwise_insert orthogonal_rvsum) ``` lp15@63114 ` 198` ``` with insert show ?case ``` lp15@63114 ` 199` ``` by (simp add: pairwise_insert norm_add_Pythagorean) ``` lp15@63114 ` 200` ```qed ``` lp15@63114 ` 201` hoelzl@63050 ` 202` hoelzl@63050 ` 203` ```subsection \Bilinear functions.\ ``` hoelzl@63050 ` 204` immler@67962 ` 205` ```definition%important "bilinear f \ (\x. linear (\y. f x y)) \ (\y. linear (\x. f x y))" ``` hoelzl@63050 ` 206` hoelzl@63050 ` 207` ```lemma bilinear_ladd: "bilinear h \ h (x + y) z = h x z + h y z" ``` hoelzl@63050 ` 208` ``` by (simp add: bilinear_def linear_iff) ``` hoelzl@63050 ` 209` hoelzl@63050 ` 210` ```lemma bilinear_radd: "bilinear h \ h x (y + z) = h x y + h x z" ``` hoelzl@63050 ` 211` ``` by (simp add: bilinear_def linear_iff) ``` hoelzl@63050 ` 212` hoelzl@63050 ` 213` ```lemma bilinear_lmul: "bilinear h \ h (c *\<^sub>R x) y = c *\<^sub>R h x y" ``` hoelzl@63050 ` 214` ``` by (simp add: bilinear_def linear_iff) ``` hoelzl@63050 ` 215` hoelzl@63050 ` 216` ```lemma bilinear_rmul: "bilinear h \ h x (c *\<^sub>R y) = c *\<^sub>R h x y" ``` hoelzl@63050 ` 217` ``` by (simp add: bilinear_def linear_iff) ``` hoelzl@63050 ` 218` hoelzl@63050 ` 219` ```lemma bilinear_lneg: "bilinear h \ h (- x) y = - h x y" ``` hoelzl@63050 ` 220` ``` by (drule bilinear_lmul [of _ "- 1"]) simp ``` hoelzl@63050 ` 221` hoelzl@63050 ` 222` ```lemma bilinear_rneg: "bilinear h \ h x (- y) = - h x y" ``` hoelzl@63050 ` 223` ``` by (drule bilinear_rmul [of _ _ "- 1"]) simp ``` hoelzl@63050 ` 224` hoelzl@63050 ` 225` ```lemma (in ab_group_add) eq_add_iff: "x = x + y \ y = 0" ``` hoelzl@63050 ` 226` ``` using add_left_imp_eq[of x y 0] by auto ``` hoelzl@63050 ` 227` hoelzl@63050 ` 228` ```lemma bilinear_lzero: ``` hoelzl@63050 ` 229` ``` assumes "bilinear h" ``` hoelzl@63050 ` 230` ``` shows "h 0 x = 0" ``` hoelzl@63050 ` 231` ``` using bilinear_ladd [OF assms, of 0 0 x] by (simp add: eq_add_iff field_simps) ``` hoelzl@63050 ` 232` hoelzl@63050 ` 233` ```lemma bilinear_rzero: ``` hoelzl@63050 ` 234` ``` assumes "bilinear h" ``` hoelzl@63050 ` 235` ``` shows "h x 0 = 0" ``` hoelzl@63050 ` 236` ``` using bilinear_radd [OF assms, of x 0 0 ] by (simp add: eq_add_iff field_simps) ``` hoelzl@63050 ` 237` hoelzl@63050 ` 238` ```lemma bilinear_lsub: "bilinear h \ h (x - y) z = h x z - h y z" ``` hoelzl@63050 ` 239` ``` using bilinear_ladd [of h x "- y"] by (simp add: bilinear_lneg) ``` hoelzl@63050 ` 240` hoelzl@63050 ` 241` ```lemma bilinear_rsub: "bilinear h \ h z (x - y) = h z x - h z y" ``` hoelzl@63050 ` 242` ``` using bilinear_radd [of h _ x "- y"] by (simp add: bilinear_rneg) ``` hoelzl@63050 ` 243` nipkow@64267 ` 244` ```lemma bilinear_sum: ``` immler@68072 ` 245` ``` assumes "bilinear h" ``` nipkow@64267 ` 246` ``` shows "h (sum f S) (sum g T) = sum (\(i,j). h (f i) (g j)) (S \ T) " ``` hoelzl@63050 ` 247` ```proof - ``` immler@68072 ` 248` ``` interpret l: linear "\x. h x y" for y using assms by (simp add: bilinear_def) ``` immler@68072 ` 249` ``` interpret r: linear "\y. h x y" for x using assms by (simp add: bilinear_def) ``` nipkow@64267 ` 250` ``` have "h (sum f S) (sum g T) = sum (\x. h (f x) (sum g T)) S" ``` immler@68072 ` 251` ``` by (simp add: l.sum) ``` nipkow@64267 ` 252` ``` also have "\ = sum (\x. sum (\y. h (f x) (g y)) T) S" ``` immler@68072 ` 253` ``` by (rule sum.cong) (simp_all add: r.sum) ``` hoelzl@63050 ` 254` ``` finally show ?thesis ``` nipkow@64267 ` 255` ``` unfolding sum.cartesian_product . ``` hoelzl@63050 ` 256` ```qed ``` hoelzl@63050 ` 257` hoelzl@63050 ` 258` hoelzl@63050 ` 259` ```subsection \Adjoints.\ ``` hoelzl@63050 ` 260` immler@67962 ` 261` ```definition%important "adjoint f = (SOME f'. \x y. f x \ y = x \ f' y)" ``` hoelzl@63050 ` 262` hoelzl@63050 ` 263` ```lemma adjoint_unique: ``` hoelzl@63050 ` 264` ``` assumes "\x y. inner (f x) y = inner x (g y)" ``` hoelzl@63050 ` 265` ``` shows "adjoint f = g" ``` hoelzl@63050 ` 266` ``` unfolding adjoint_def ``` hoelzl@63050 ` 267` ```proof (rule some_equality) ``` hoelzl@63050 ` 268` ``` show "\x y. inner (f x) y = inner x (g y)" ``` hoelzl@63050 ` 269` ``` by (rule assms) ``` hoelzl@63050 ` 270` ```next ``` hoelzl@63050 ` 271` ``` fix h ``` hoelzl@63050 ` 272` ``` assume "\x y. inner (f x) y = inner x (h y)" ``` hoelzl@63050 ` 273` ``` then have "\x y. inner x (g y) = inner x (h y)" ``` hoelzl@63050 ` 274` ``` using assms by simp ``` hoelzl@63050 ` 275` ``` then have "\x y. inner x (g y - h y) = 0" ``` hoelzl@63050 ` 276` ``` by (simp add: inner_diff_right) ``` hoelzl@63050 ` 277` ``` then have "\y. inner (g y - h y) (g y - h y) = 0" ``` hoelzl@63050 ` 278` ``` by simp ``` hoelzl@63050 ` 279` ``` then have "\y. h y = g y" ``` hoelzl@63050 ` 280` ``` by simp ``` hoelzl@63050 ` 281` ``` then show "h = g" by (simp add: ext) ``` hoelzl@63050 ` 282` ```qed ``` hoelzl@63050 ` 283` hoelzl@63050 ` 284` ```text \TODO: The following lemmas about adjoints should hold for any ``` wenzelm@63680 ` 285` ``` Hilbert space (i.e. complete inner product space). ``` wenzelm@68224 ` 286` ``` (see \<^url>\https://en.wikipedia.org/wiki/Hermitian_adjoint\) ``` hoelzl@63050 ` 287` ```\ ``` hoelzl@63050 ` 288` hoelzl@63050 ` 289` ```lemma adjoint_works: ``` hoelzl@63050 ` 290` ``` fixes f :: "'n::euclidean_space \ 'm::euclidean_space" ``` hoelzl@63050 ` 291` ``` assumes lf: "linear f" ``` hoelzl@63050 ` 292` ``` shows "x \ adjoint f y = f x \ y" ``` hoelzl@63050 ` 293` ```proof - ``` immler@68072 ` 294` ``` interpret linear f by fact ``` hoelzl@63050 ` 295` ``` have "\y. \w. \x. f x \ y = x \ w" ``` hoelzl@63050 ` 296` ``` proof (intro allI exI) ``` hoelzl@63050 ` 297` ``` fix y :: "'m" and x ``` hoelzl@63050 ` 298` ``` let ?w = "(\i\Basis. (f i \ y) *\<^sub>R i) :: 'n" ``` hoelzl@63050 ` 299` ``` have "f x \ y = f (\i\Basis. (x \ i) *\<^sub>R i) \ y" ``` hoelzl@63050 ` 300` ``` by (simp add: euclidean_representation) ``` hoelzl@63050 ` 301` ``` also have "\ = (\i\Basis. (x \ i) *\<^sub>R f i) \ y" ``` immler@68072 ` 302` ``` by (simp add: sum scale) ``` hoelzl@63050 ` 303` ``` finally show "f x \ y = x \ ?w" ``` nipkow@64267 ` 304` ``` by (simp add: inner_sum_left inner_sum_right mult.commute) ``` hoelzl@63050 ` 305` ``` qed ``` hoelzl@63050 ` 306` ``` then show ?thesis ``` hoelzl@63050 ` 307` ``` unfolding adjoint_def choice_iff ``` hoelzl@63050 ` 308` ``` by (intro someI2_ex[where Q="\f'. x \ f' y = f x \ y"]) auto ``` hoelzl@63050 ` 309` ```qed ``` hoelzl@63050 ` 310` hoelzl@63050 ` 311` ```lemma adjoint_clauses: ``` hoelzl@63050 ` 312` ``` fixes f :: "'n::euclidean_space \ 'm::euclidean_space" ``` hoelzl@63050 ` 313` ``` assumes lf: "linear f" ``` hoelzl@63050 ` 314` ``` shows "x \ adjoint f y = f x \ y" ``` hoelzl@63050 ` 315` ``` and "adjoint f y \ x = y \ f x" ``` hoelzl@63050 ` 316` ``` by (simp_all add: adjoint_works[OF lf] inner_commute) ``` hoelzl@63050 ` 317` hoelzl@63050 ` 318` ```lemma adjoint_linear: ``` hoelzl@63050 ` 319` ``` fixes f :: "'n::euclidean_space \ 'm::euclidean_space" ``` hoelzl@63050 ` 320` ``` assumes lf: "linear f" ``` hoelzl@63050 ` 321` ``` shows "linear (adjoint f)" ``` hoelzl@63050 ` 322` ``` by (simp add: lf linear_iff euclidean_eq_iff[where 'a='n] euclidean_eq_iff[where 'a='m] ``` hoelzl@63050 ` 323` ``` adjoint_clauses[OF lf] inner_distrib) ``` hoelzl@63050 ` 324` hoelzl@63050 ` 325` ```lemma adjoint_adjoint: ``` hoelzl@63050 ` 326` ``` fixes f :: "'n::euclidean_space \ 'm::euclidean_space" ``` hoelzl@63050 ` 327` ``` assumes lf: "linear f" ``` hoelzl@63050 ` 328` ``` shows "adjoint (adjoint f) = f" ``` hoelzl@63050 ` 329` ``` by (rule adjoint_unique, simp add: adjoint_clauses [OF lf]) ``` hoelzl@63050 ` 330` hoelzl@63050 ` 331` immler@67962 ` 332` ```subsection%unimportant \Interlude: Some properties of real sets\ ``` hoelzl@63050 ` 333` hoelzl@63050 ` 334` ```lemma seq_mono_lemma: ``` hoelzl@63050 ` 335` ``` assumes "\(n::nat) \ m. (d n :: real) < e n" ``` hoelzl@63050 ` 336` ``` and "\n \ m. e n \ e m" ``` hoelzl@63050 ` 337` ``` shows "\n \ m. d n < e m" ``` lp15@68069 ` 338` ``` using assms by force ``` hoelzl@63050 ` 339` hoelzl@63050 ` 340` ```lemma infinite_enumerate: ``` hoelzl@63050 ` 341` ``` assumes fS: "infinite S" ``` eberlm@66447 ` 342` ``` shows "\r::nat\nat. strict_mono r \ (\n. r n \ S)" ``` eberlm@66447 ` 343` ``` unfolding strict_mono_def ``` hoelzl@63050 ` 344` ``` using enumerate_in_set[OF fS] enumerate_mono[of _ _ S] fS by auto ``` hoelzl@63050 ` 345` hoelzl@63050 ` 346` ```lemma approachable_lt_le: "(\(d::real) > 0. \x. f x < d \ P x) \ (\d>0. \x. f x \ d \ P x)" ``` hoelzl@63050 ` 347` ``` apply auto ``` hoelzl@63050 ` 348` ``` apply (rule_tac x="d/2" in exI) ``` hoelzl@63050 ` 349` ``` apply auto ``` hoelzl@63050 ` 350` ``` done ``` hoelzl@63050 ` 351` wenzelm@67443 ` 352` ```lemma approachable_lt_le2: \ \like the above, but pushes aside an extra formula\ ``` hoelzl@63050 ` 353` ``` "(\(d::real) > 0. \x. Q x \ f x < d \ P x) \ (\d>0. \x. f x \ d \ Q x \ P x)" ``` hoelzl@63050 ` 354` ``` apply auto ``` hoelzl@63050 ` 355` ``` apply (rule_tac x="d/2" in exI, auto) ``` hoelzl@63050 ` 356` ``` done ``` hoelzl@63050 ` 357` hoelzl@63050 ` 358` ```lemma triangle_lemma: ``` hoelzl@63050 ` 359` ``` fixes x y z :: real ``` hoelzl@63050 ` 360` ``` assumes x: "0 \ x" ``` hoelzl@63050 ` 361` ``` and y: "0 \ y" ``` hoelzl@63050 ` 362` ``` and z: "0 \ z" ``` hoelzl@63050 ` 363` ``` and xy: "x\<^sup>2 \ y\<^sup>2 + z\<^sup>2" ``` hoelzl@63050 ` 364` ``` shows "x \ y + z" ``` hoelzl@63050 ` 365` ```proof - ``` hoelzl@63050 ` 366` ``` have "y\<^sup>2 + z\<^sup>2 \ y\<^sup>2 + 2 * y * z + z\<^sup>2" ``` hoelzl@63050 ` 367` ``` using z y by simp ``` hoelzl@63050 ` 368` ``` with xy have th: "x\<^sup>2 \ (y + z)\<^sup>2" ``` hoelzl@63050 ` 369` ``` by (simp add: power2_eq_square field_simps) ``` hoelzl@63050 ` 370` ``` from y z have yz: "y + z \ 0" ``` hoelzl@63050 ` 371` ``` by arith ``` hoelzl@63050 ` 372` ``` from power2_le_imp_le[OF th yz] show ?thesis . ``` hoelzl@63050 ` 373` ```qed ``` hoelzl@63050 ` 374` hoelzl@63050 ` 375` hoelzl@63050 ` 376` hoelzl@63050 ` 377` ```subsection \Archimedean properties and useful consequences\ ``` hoelzl@63050 ` 378` hoelzl@63050 ` 379` ```text\Bernoulli's inequality\ ``` immler@68607 ` 380` ```proposition Bernoulli_inequality: ``` hoelzl@63050 ` 381` ``` fixes x :: real ``` hoelzl@63050 ` 382` ``` assumes "-1 \ x" ``` hoelzl@63050 ` 383` ``` shows "1 + n * x \ (1 + x) ^ n" ``` immler@68607 ` 384` ```proof (induct n) ``` hoelzl@63050 ` 385` ``` case 0 ``` hoelzl@63050 ` 386` ``` then show ?case by simp ``` hoelzl@63050 ` 387` ```next ``` hoelzl@63050 ` 388` ``` case (Suc n) ``` hoelzl@63050 ` 389` ``` have "1 + Suc n * x \ 1 + (Suc n)*x + n * x^2" ``` hoelzl@63050 ` 390` ``` by (simp add: algebra_simps) ``` hoelzl@63050 ` 391` ``` also have "... = (1 + x) * (1 + n*x)" ``` hoelzl@63050 ` 392` ``` by (auto simp: power2_eq_square algebra_simps of_nat_Suc) ``` hoelzl@63050 ` 393` ``` also have "... \ (1 + x) ^ Suc n" ``` hoelzl@63050 ` 394` ``` using Suc.hyps assms mult_left_mono by fastforce ``` hoelzl@63050 ` 395` ``` finally show ?case . ``` hoelzl@63050 ` 396` ```qed ``` hoelzl@63050 ` 397` hoelzl@63050 ` 398` ```corollary Bernoulli_inequality_even: ``` hoelzl@63050 ` 399` ``` fixes x :: real ``` hoelzl@63050 ` 400` ``` assumes "even n" ``` hoelzl@63050 ` 401` ``` shows "1 + n * x \ (1 + x) ^ n" ``` hoelzl@63050 ` 402` ```proof (cases "-1 \ x \ n=0") ``` hoelzl@63050 ` 403` ``` case True ``` hoelzl@63050 ` 404` ``` then show ?thesis ``` hoelzl@63050 ` 405` ``` by (auto simp: Bernoulli_inequality) ``` hoelzl@63050 ` 406` ```next ``` hoelzl@63050 ` 407` ``` case False ``` hoelzl@63050 ` 408` ``` then have "real n \ 1" ``` hoelzl@63050 ` 409` ``` by simp ``` hoelzl@63050 ` 410` ``` with False have "n * x \ -1" ``` hoelzl@63050 ` 411` ``` by (metis linear minus_zero mult.commute mult.left_neutral mult_left_mono_neg neg_le_iff_le order_trans zero_le_one) ``` hoelzl@63050 ` 412` ``` then have "1 + n * x \ 0" ``` hoelzl@63050 ` 413` ``` by auto ``` hoelzl@63050 ` 414` ``` also have "... \ (1 + x) ^ n" ``` hoelzl@63050 ` 415` ``` using assms ``` hoelzl@63050 ` 416` ``` using zero_le_even_power by blast ``` hoelzl@63050 ` 417` ``` finally show ?thesis . ``` hoelzl@63050 ` 418` ```qed ``` hoelzl@63050 ` 419` hoelzl@63050 ` 420` ```corollary real_arch_pow: ``` hoelzl@63050 ` 421` ``` fixes x :: real ``` hoelzl@63050 ` 422` ``` assumes x: "1 < x" ``` hoelzl@63050 ` 423` ``` shows "\n. y < x^n" ``` hoelzl@63050 ` 424` ```proof - ``` hoelzl@63050 ` 425` ``` from x have x0: "x - 1 > 0" ``` hoelzl@63050 ` 426` ``` by arith ``` hoelzl@63050 ` 427` ``` from reals_Archimedean3[OF x0, rule_format, of y] ``` hoelzl@63050 ` 428` ``` obtain n :: nat where n: "y < real n * (x - 1)" by metis ``` hoelzl@63050 ` 429` ``` from x0 have x00: "x- 1 \ -1" by arith ``` hoelzl@63050 ` 430` ``` from Bernoulli_inequality[OF x00, of n] n ``` hoelzl@63050 ` 431` ``` have "y < x^n" by auto ``` hoelzl@63050 ` 432` ``` then show ?thesis by metis ``` hoelzl@63050 ` 433` ```qed ``` hoelzl@63050 ` 434` hoelzl@63050 ` 435` ```corollary real_arch_pow_inv: ``` hoelzl@63050 ` 436` ``` fixes x y :: real ``` hoelzl@63050 ` 437` ``` assumes y: "y > 0" ``` hoelzl@63050 ` 438` ``` and x1: "x < 1" ``` hoelzl@63050 ` 439` ``` shows "\n. x^n < y" ``` hoelzl@63050 ` 440` ```proof (cases "x > 0") ``` hoelzl@63050 ` 441` ``` case True ``` hoelzl@63050 ` 442` ``` with x1 have ix: "1 < 1/x" by (simp add: field_simps) ``` hoelzl@63050 ` 443` ``` from real_arch_pow[OF ix, of "1/y"] ``` hoelzl@63050 ` 444` ``` obtain n where n: "1/y < (1/x)^n" by blast ``` hoelzl@63050 ` 445` ``` then show ?thesis using y \x > 0\ ``` hoelzl@63050 ` 446` ``` by (auto simp add: field_simps) ``` hoelzl@63050 ` 447` ```next ``` hoelzl@63050 ` 448` ``` case False ``` hoelzl@63050 ` 449` ``` with y x1 show ?thesis ``` lp15@68069 ` 450` ``` by (metis less_le_trans not_less power_one_right) ``` hoelzl@63050 ` 451` ```qed ``` hoelzl@63050 ` 452` hoelzl@63050 ` 453` ```lemma forall_pos_mono: ``` hoelzl@63050 ` 454` ``` "(\d e::real. d < e \ P d \ P e) \ ``` hoelzl@63050 ` 455` ``` (\n::nat. n \ 0 \ P (inverse (real n))) \ (\e. 0 < e \ P e)" ``` hoelzl@63050 ` 456` ``` by (metis real_arch_inverse) ``` hoelzl@63050 ` 457` hoelzl@63050 ` 458` ```lemma forall_pos_mono_1: ``` hoelzl@63050 ` 459` ``` "(\d e::real. d < e \ P d \ P e) \ ``` hoelzl@63050 ` 460` ``` (\n. P (inverse (real (Suc n)))) \ 0 < e \ P e" ``` hoelzl@63050 ` 461` ``` apply (rule forall_pos_mono) ``` hoelzl@63050 ` 462` ``` apply auto ``` hoelzl@63050 ` 463` ``` apply (metis Suc_pred of_nat_Suc) ``` hoelzl@63050 ` 464` ``` done ``` hoelzl@63050 ` 465` hoelzl@63050 ` 466` immler@67962 ` 467` ```subsection%unimportant \Euclidean Spaces as Typeclass\ ``` huffman@44133 ` 468` hoelzl@50526 ` 469` ```lemma independent_Basis: "independent Basis" ``` immler@68072 ` 470` ``` by (rule independent_Basis) ``` hoelzl@50526 ` 471` huffman@53939 ` 472` ```lemma span_Basis [simp]: "span Basis = UNIV" ``` immler@68072 ` 473` ``` by (rule span_Basis) ``` huffman@44133 ` 474` hoelzl@50526 ` 475` ```lemma in_span_Basis: "x \ span Basis" ``` hoelzl@50526 ` 476` ``` unfolding span_Basis .. ``` hoelzl@50526 ` 477` wenzelm@53406 ` 478` immler@67962 ` 479` ```subsection%unimportant \Linearity and Bilinearity continued\ ``` huffman@44133 ` 480` huffman@44133 ` 481` ```lemma linear_bounded: ``` wenzelm@56444 ` 482` ``` fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" ``` huffman@44133 ` 483` ``` assumes lf: "linear f" ``` huffman@44133 ` 484` ``` shows "\B. \x. norm (f x) \ B * norm x" ``` huffman@53939 ` 485` ```proof ``` immler@68072 ` 486` ``` interpret linear f by fact ``` hoelzl@50526 ` 487` ``` let ?B = "\b\Basis. norm (f b)" ``` huffman@53939 ` 488` ``` show "\x. norm (f x) \ ?B * norm x" ``` huffman@53939 ` 489` ``` proof ``` wenzelm@53406 ` 490` ``` fix x :: 'a ``` hoelzl@50526 ` 491` ``` let ?g = "\b. (x \ b) *\<^sub>R f b" ``` hoelzl@50526 ` 492` ``` have "norm (f x) = norm (f (\b\Basis. (x \ b) *\<^sub>R b))" ``` hoelzl@50526 ` 493` ``` unfolding euclidean_representation .. ``` nipkow@64267 ` 494` ``` also have "\ = norm (sum ?g Basis)" ``` immler@68072 ` 495` ``` by (simp add: sum scale) ``` nipkow@64267 ` 496` ``` finally have th0: "norm (f x) = norm (sum ?g Basis)" . ``` lp15@64773 ` 497` ``` have th: "norm (?g i) \ norm (f i) * norm x" if "i \ Basis" for i ``` lp15@64773 ` 498` ``` proof - ``` lp15@64773 ` 499` ``` from Basis_le_norm[OF that, of x] ``` huffman@53939 ` 500` ``` show "norm (?g i) \ norm (f i) * norm x" ``` lp15@68069 ` 501` ``` unfolding norm_scaleR by (metis mult.commute mult_left_mono norm_ge_zero) ``` huffman@53939 ` 502` ``` qed ``` nipkow@64267 ` 503` ``` from sum_norm_le[of _ ?g, OF th] ``` huffman@53939 ` 504` ``` show "norm (f x) \ ?B * norm x" ``` nipkow@64267 ` 505` ``` unfolding th0 sum_distrib_right by metis ``` huffman@53939 ` 506` ``` qed ``` huffman@44133 ` 507` ```qed ``` huffman@44133 ` 508` huffman@44133 ` 509` ```lemma linear_conv_bounded_linear: ``` huffman@44133 ` 510` ``` fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" ``` huffman@44133 ` 511` ``` shows "linear f \ bounded_linear f" ``` huffman@44133 ` 512` ```proof ``` huffman@44133 ` 513` ``` assume "linear f" ``` huffman@53939 ` 514` ``` then interpret f: linear f . ``` huffman@44133 ` 515` ``` show "bounded_linear f" ``` huffman@44133 ` 516` ``` proof ``` huffman@44133 ` 517` ``` have "\B. \x. norm (f x) \ B * norm x" ``` wenzelm@60420 ` 518` ``` using \linear f\ by (rule linear_bounded) ``` wenzelm@49522 ` 519` ``` then show "\K. \x. norm (f x) \ norm x * K" ``` haftmann@57512 ` 520` ``` by (simp add: mult.commute) ``` huffman@44133 ` 521` ``` qed ``` huffman@44133 ` 522` ```next ``` huffman@44133 ` 523` ``` assume "bounded_linear f" ``` huffman@44133 ` 524` ``` then interpret f: bounded_linear f . ``` huffman@53939 ` 525` ``` show "linear f" .. ``` huffman@53939 ` 526` ```qed ``` huffman@53939 ` 527` paulson@61518 ` 528` ```lemmas linear_linear = linear_conv_bounded_linear[symmetric] ``` paulson@61518 ` 529` huffman@53939 ` 530` ```lemma linear_bounded_pos: ``` wenzelm@56444 ` 531` ``` fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" ``` huffman@53939 ` 532` ``` assumes lf: "linear f" ``` lp15@67982 ` 533` ``` obtains B where "B > 0" "\x. norm (f x) \ B * norm x" ``` huffman@53939 ` 534` ```proof - ``` huffman@53939 ` 535` ``` have "\B > 0. \x. norm (f x) \ norm x * B" ``` huffman@53939 ` 536` ``` using lf unfolding linear_conv_bounded_linear ``` huffman@53939 ` 537` ``` by (rule bounded_linear.pos_bounded) ``` lp15@67982 ` 538` ``` with that show ?thesis ``` lp15@67982 ` 539` ``` by (auto simp: mult.commute) ``` huffman@44133 ` 540` ```qed ``` huffman@44133 ` 541` lp15@67982 ` 542` ```lemma linear_invertible_bounded_below_pos: ``` lp15@67982 ` 543` ``` fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" ``` lp15@67982 ` 544` ``` assumes "linear f" "linear g" "g \ f = id" ``` lp15@67982 ` 545` ``` obtains B where "B > 0" "\x. B * norm x \ norm(f x)" ``` lp15@67982 ` 546` ```proof - ``` lp15@67982 ` 547` ``` obtain B where "B > 0" and B: "\x. norm (g x) \ B * norm x" ``` lp15@67982 ` 548` ``` using linear_bounded_pos [OF \linear g\] by blast ``` lp15@67982 ` 549` ``` show thesis ``` lp15@67982 ` 550` ``` proof ``` lp15@67982 ` 551` ``` show "0 < 1/B" ``` lp15@67982 ` 552` ``` by (simp add: \B > 0\) ``` lp15@67982 ` 553` ``` show "1/B * norm x \ norm (f x)" for x ``` lp15@67982 ` 554` ``` proof - ``` lp15@67982 ` 555` ``` have "1/B * norm x = 1/B * norm (g (f x))" ``` lp15@67982 ` 556` ``` using assms by (simp add: pointfree_idE) ``` lp15@67982 ` 557` ``` also have "\ \ norm (f x)" ``` lp15@67982 ` 558` ``` using B [of "f x"] by (simp add: \B > 0\ mult.commute pos_divide_le_eq) ``` lp15@67982 ` 559` ``` finally show ?thesis . ``` lp15@67982 ` 560` ``` qed ``` lp15@67982 ` 561` ``` qed ``` lp15@67982 ` 562` ```qed ``` lp15@67982 ` 563` lp15@67982 ` 564` ```lemma linear_inj_bounded_below_pos: ``` lp15@67982 ` 565` ``` fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" ``` lp15@67982 ` 566` ``` assumes "linear f" "inj f" ``` lp15@67982 ` 567` ``` obtains B where "B > 0" "\x. B * norm x \ norm(f x)" ``` immler@68072 ` 568` ``` using linear_injective_left_inverse [OF assms] ``` immler@68072 ` 569` ``` linear_invertible_bounded_below_pos assms by blast ``` lp15@67982 ` 570` wenzelm@49522 ` 571` ```lemma bounded_linearI': ``` wenzelm@56444 ` 572` ``` fixes f ::"'a::euclidean_space \ 'b::real_normed_vector" ``` wenzelm@53406 ` 573` ``` assumes "\x y. f (x + y) = f x + f y" ``` wenzelm@53406 ` 574` ``` and "\c x. f (c *\<^sub>R x) = c *\<^sub>R f x" ``` wenzelm@49522 ` 575` ``` shows "bounded_linear f" ``` immler@68072 ` 576` ``` using assms linearI linear_conv_bounded_linear by blast ``` huffman@44133 ` 577` huffman@44133 ` 578` ```lemma bilinear_bounded: ``` wenzelm@56444 ` 579` ``` fixes h :: "'m::euclidean_space \ 'n::euclidean_space \ 'k::real_normed_vector" ``` huffman@44133 ` 580` ``` assumes bh: "bilinear h" ``` huffman@44133 ` 581` ``` shows "\B. \x y. norm (h x y) \ B * norm x * norm y" ``` hoelzl@50526 ` 582` ```proof (clarify intro!: exI[of _ "\i\Basis. \j\Basis. norm (h i j)"]) ``` wenzelm@53406 ` 583` ``` fix x :: 'm ``` wenzelm@53406 ` 584` ``` fix y :: 'n ``` nipkow@64267 ` 585` ``` have "norm (h x y) = norm (h (sum (\i. (x \ i) *\<^sub>R i) Basis) (sum (\i. (y \ i) *\<^sub>R i) Basis))" ``` lp15@68069 ` 586` ``` by (simp add: euclidean_representation) ``` nipkow@64267 ` 587` ``` also have "\ = norm (sum (\ (i,j). h ((x \ i) *\<^sub>R i) ((y \ j) *\<^sub>R j)) (Basis \ Basis))" ``` immler@68072 ` 588` ``` unfolding bilinear_sum[OF bh] .. ``` hoelzl@50526 ` 589` ``` finally have th: "norm (h x y) = \" . ``` lp15@68069 ` 590` ``` have "\i j. \i \ Basis; j \ Basis\ ``` lp15@68069 ` 591` ``` \ \x \ i\ * (\y \ j\ * norm (h i j)) \ norm x * (norm y * norm (h i j))" ``` lp15@68069 ` 592` ``` by (auto simp add: zero_le_mult_iff Basis_le_norm mult_mono) ``` lp15@68069 ` 593` ``` then show "norm (h x y) \ (\i\Basis. \j\Basis. norm (h i j)) * norm x * norm y" ``` lp15@68069 ` 594` ``` unfolding sum_distrib_right th sum.cartesian_product ``` lp15@68069 ` 595` ``` by (clarsimp simp add: bilinear_rmul[OF bh] bilinear_lmul[OF bh] ``` lp15@68069 ` 596` ``` field_simps simp del: scaleR_scaleR intro!: sum_norm_le) ``` huffman@44133 ` 597` ```qed ``` huffman@44133 ` 598` huffman@44133 ` 599` ```lemma bilinear_conv_bounded_bilinear: ``` huffman@44133 ` 600` ``` fixes h :: "'a::euclidean_space \ 'b::euclidean_space \ 'c::real_normed_vector" ``` huffman@44133 ` 601` ``` shows "bilinear h \ bounded_bilinear h" ``` huffman@44133 ` 602` ```proof ``` huffman@44133 ` 603` ``` assume "bilinear h" ``` huffman@44133 ` 604` ``` show "bounded_bilinear h" ``` huffman@44133 ` 605` ``` proof ``` wenzelm@53406 ` 606` ``` fix x y z ``` wenzelm@53406 ` 607` ``` show "h (x + y) z = h x z + h y z" ``` wenzelm@60420 ` 608` ``` using \bilinear h\ unfolding bilinear_def linear_iff by simp ``` huffman@44133 ` 609` ``` next ``` wenzelm@53406 ` 610` ``` fix x y z ``` wenzelm@53406 ` 611` ``` show "h x (y + z) = h x y + h x z" ``` wenzelm@60420 ` 612` ``` using \bilinear h\ unfolding bilinear_def linear_iff by simp ``` huffman@44133 ` 613` ``` next ``` lp15@68069 ` 614` ``` show "h (scaleR r x) y = scaleR r (h x y)" "h x (scaleR r y) = scaleR r (h x y)" for r x y ``` wenzelm@60420 ` 615` ``` using \bilinear h\ unfolding bilinear_def linear_iff ``` lp15@68069 ` 616` ``` by simp_all ``` huffman@44133 ` 617` ``` next ``` huffman@44133 ` 618` ``` have "\B. \x y. norm (h x y) \ B * norm x * norm y" ``` wenzelm@60420 ` 619` ``` using \bilinear h\ by (rule bilinear_bounded) ``` wenzelm@49522 ` 620` ``` then show "\K. \x y. norm (h x y) \ norm x * norm y * K" ``` haftmann@57514 ` 621` ``` by (simp add: ac_simps) ``` huffman@44133 ` 622` ``` qed ``` huffman@44133 ` 623` ```next ``` huffman@44133 ` 624` ``` assume "bounded_bilinear h" ``` huffman@44133 ` 625` ``` then interpret h: bounded_bilinear h . ``` huffman@44133 ` 626` ``` show "bilinear h" ``` huffman@44133 ` 627` ``` unfolding bilinear_def linear_conv_bounded_linear ``` wenzelm@49522 ` 628` ``` using h.bounded_linear_left h.bounded_linear_right by simp ``` huffman@44133 ` 629` ```qed ``` huffman@44133 ` 630` huffman@53939 ` 631` ```lemma bilinear_bounded_pos: ``` wenzelm@56444 ` 632` ``` fixes h :: "'a::euclidean_space \ 'b::euclidean_space \ 'c::real_normed_vector" ``` huffman@53939 ` 633` ``` assumes bh: "bilinear h" ``` huffman@53939 ` 634` ``` shows "\B > 0. \x y. norm (h x y) \ B * norm x * norm y" ``` huffman@53939 ` 635` ```proof - ``` huffman@53939 ` 636` ``` have "\B > 0. \x y. norm (h x y) \ norm x * norm y * B" ``` huffman@53939 ` 637` ``` using bh [unfolded bilinear_conv_bounded_bilinear] ``` huffman@53939 ` 638` ``` by (rule bounded_bilinear.pos_bounded) ``` huffman@53939 ` 639` ``` then show ?thesis ``` haftmann@57514 ` 640` ``` by (simp only: ac_simps) ``` huffman@53939 ` 641` ```qed ``` huffman@53939 ` 642` immler@68072 ` 643` ```lemma bounded_linear_imp_has_derivative: "bounded_linear f \ (f has_derivative f) net" ``` immler@68072 ` 644` ``` by (auto simp add: has_derivative_def linear_diff linear_linear linear_def ``` immler@68072 ` 645` ``` dest: bounded_linear.linear) ``` lp15@63469 ` 646` lp15@63469 ` 647` ```lemma linear_imp_has_derivative: ``` lp15@63469 ` 648` ``` fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" ``` lp15@63469 ` 649` ``` shows "linear f \ (f has_derivative f) net" ``` immler@68072 ` 650` ``` by (simp add: bounded_linear_imp_has_derivative linear_conv_bounded_linear) ``` lp15@63469 ` 651` lp15@63469 ` 652` ```lemma bounded_linear_imp_differentiable: "bounded_linear f \ f differentiable net" ``` lp15@63469 ` 653` ``` using bounded_linear_imp_has_derivative differentiable_def by blast ``` lp15@63469 ` 654` lp15@63469 ` 655` ```lemma linear_imp_differentiable: ``` lp15@63469 ` 656` ``` fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" ``` lp15@63469 ` 657` ``` shows "linear f \ f differentiable net" ``` immler@68072 ` 658` ``` by (metis linear_imp_has_derivative differentiable_def) ``` lp15@63469 ` 659` wenzelm@49522 ` 660` immler@67962 ` 661` ```subsection%unimportant \We continue.\ ``` huffman@44133 ` 662` huffman@44133 ` 663` ```lemma independent_bound: ``` wenzelm@53716 ` 664` ``` fixes S :: "'a::euclidean_space set" ``` wenzelm@53716 ` 665` ``` shows "independent S \ finite S \ card S \ DIM('a)" ``` immler@68072 ` 666` ``` by (metis dim_subset_UNIV finiteI_independent dim_span_eq_card_independent) ``` immler@68072 ` 667` immler@68072 ` 668` ```lemmas independent_imp_finite = finiteI_independent ``` huffman@44133 ` 669` lp15@61609 ` 670` ```corollary ``` paulson@60303 ` 671` ``` fixes S :: "'a::euclidean_space set" ``` paulson@60303 ` 672` ``` assumes "independent S" ``` immler@68072 ` 673` ``` shows independent_card_le:"card S \ DIM('a)" ``` immler@68072 ` 674` ``` using assms independent_bound by auto ``` lp15@63075 ` 675` wenzelm@49663 ` 676` ```lemma dependent_biggerset: ``` wenzelm@56444 ` 677` ``` fixes S :: "'a::euclidean_space set" ``` wenzelm@56444 ` 678` ``` shows "(finite S \ card S > DIM('a)) \ dependent S" ``` huffman@44133 ` 679` ``` by (metis independent_bound not_less) ``` huffman@44133 ` 680` wenzelm@60420 ` 681` ```text \Picking an orthogonal replacement for a spanning set.\ ``` huffman@44133 ` 682` wenzelm@53406 ` 683` ```lemma vector_sub_project_orthogonal: ``` wenzelm@53406 ` 684` ``` fixes b x :: "'a::euclidean_space" ``` wenzelm@53406 ` 685` ``` shows "b \ (x - ((b \ x) / (b \ b)) *\<^sub>R b) = 0" ``` huffman@44133 ` 686` ``` unfolding inner_simps by auto ``` huffman@44133 ` 687` huffman@44528 ` 688` ```lemma pairwise_orthogonal_insert: ``` huffman@44528 ` 689` ``` assumes "pairwise orthogonal S" ``` wenzelm@49522 ` 690` ``` and "\y. y \ S \ orthogonal x y" ``` huffman@44528 ` 691` ``` shows "pairwise orthogonal (insert x S)" ``` huffman@44528 ` 692` ``` using assms unfolding pairwise_def ``` huffman@44528 ` 693` ``` by (auto simp add: orthogonal_commute) ``` huffman@44528 ` 694` huffman@44133 ` 695` ```lemma basis_orthogonal: ``` wenzelm@53406 ` 696` ``` fixes B :: "'a::real_inner set" ``` huffman@44133 ` 697` ``` assumes fB: "finite B" ``` huffman@44133 ` 698` ``` shows "\C. finite C \ card C \ card B \ span C = span B \ pairwise orthogonal C" ``` huffman@44133 ` 699` ``` (is " \C. ?P B C") ``` wenzelm@49522 ` 700` ``` using fB ``` wenzelm@49522 ` 701` ```proof (induct rule: finite_induct) ``` wenzelm@49522 ` 702` ``` case empty ``` wenzelm@53406 ` 703` ``` then show ?case ``` wenzelm@53406 ` 704` ``` apply (rule exI[where x="{}"]) ``` wenzelm@53406 ` 705` ``` apply (auto simp add: pairwise_def) ``` wenzelm@53406 ` 706` ``` done ``` huffman@44133 ` 707` ```next ``` wenzelm@49522 ` 708` ``` case (insert a B) ``` wenzelm@60420 ` 709` ``` note fB = \finite B\ and aB = \a \ B\ ``` wenzelm@60420 ` 710` ``` from \\C. finite C \ card C \ card B \ span C = span B \ pairwise orthogonal C\ ``` huffman@44133 ` 711` ``` obtain C where C: "finite C" "card C \ card B" ``` huffman@44133 ` 712` ``` "span C = span B" "pairwise orthogonal C" by blast ``` nipkow@64267 ` 713` ``` let ?a = "a - sum (\x. (x \ a / (x \ x)) *\<^sub>R x) C" ``` huffman@44133 ` 714` ``` let ?C = "insert ?a C" ``` wenzelm@53406 ` 715` ``` from C(1) have fC: "finite ?C" ``` wenzelm@53406 ` 716` ``` by simp ``` wenzelm@49522 ` 717` ``` from fB aB C(1,2) have cC: "card ?C \ card (insert a B)" ``` wenzelm@49522 ` 718` ``` by (simp add: card_insert_if) ``` wenzelm@53406 ` 719` ``` { ``` wenzelm@53406 ` 720` ``` fix x k ``` wenzelm@49522 ` 721` ``` have th0: "\(a::'a) b c. a - (b - c) = c + (a - b)" ``` wenzelm@49522 ` 722` ``` by (simp add: field_simps) ``` huffman@44133 ` 723` ``` have "x - k *\<^sub>R (a - (\x\C. (x \ a / (x \ x)) *\<^sub>R x)) \ span C \ x - k *\<^sub>R a \ span C" ``` huffman@44133 ` 724` ``` apply (simp only: scaleR_right_diff_distrib th0) ``` huffman@44133 ` 725` ``` apply (rule span_add_eq) ``` immler@68072 ` 726` ``` apply (rule span_scale) ``` nipkow@64267 ` 727` ``` apply (rule span_sum) ``` immler@68072 ` 728` ``` apply (rule span_scale) ``` immler@68072 ` 729` ``` apply (rule span_base) ``` wenzelm@49522 ` 730` ``` apply assumption ``` wenzelm@53406 ` 731` ``` done ``` wenzelm@53406 ` 732` ``` } ``` huffman@44133 ` 733` ``` then have SC: "span ?C = span (insert a B)" ``` huffman@44133 ` 734` ``` unfolding set_eq_iff span_breakdown_eq C(3)[symmetric] by auto ``` wenzelm@53406 ` 735` ``` { ``` wenzelm@53406 ` 736` ``` fix y ``` wenzelm@53406 ` 737` ``` assume yC: "y \ C" ``` wenzelm@53406 ` 738` ``` then have Cy: "C = insert y (C - {y})" ``` wenzelm@53406 ` 739` ``` by blast ``` wenzelm@53406 ` 740` ``` have fth: "finite (C - {y})" ``` wenzelm@53406 ` 741` ``` using C by simp ``` huffman@44528 ` 742` ``` have "orthogonal ?a y" ``` huffman@44528 ` 743` ``` unfolding orthogonal_def ``` nipkow@64267 ` 744` ``` unfolding inner_diff inner_sum_left right_minus_eq ``` nipkow@64267 ` 745` ``` unfolding sum.remove [OF \finite C\ \y \ C\] ``` huffman@44528 ` 746` ``` apply (clarsimp simp add: inner_commute[of y a]) ``` nipkow@64267 ` 747` ``` apply (rule sum.neutral) ``` huffman@44528 ` 748` ``` apply clarsimp ``` huffman@44528 ` 749` ``` apply (rule C(4)[unfolded pairwise_def orthogonal_def, rule_format]) ``` wenzelm@60420 ` 750` ``` using \y \ C\ by auto ``` wenzelm@53406 ` 751` ``` } ``` wenzelm@60420 ` 752` ``` with \pairwise orthogonal C\ have CPO: "pairwise orthogonal ?C" ``` huffman@44528 ` 753` ``` by (rule pairwise_orthogonal_insert) ``` wenzelm@53406 ` 754` ``` from fC cC SC CPO have "?P (insert a B) ?C" ``` wenzelm@53406 ` 755` ``` by blast ``` huffman@44133 ` 756` ``` then show ?case by blast ``` huffman@44133 ` 757` ```qed ``` huffman@44133 ` 758` huffman@44133 ` 759` ```lemma orthogonal_basis_exists: ``` huffman@44133 ` 760` ``` fixes V :: "('a::euclidean_space) set" ``` immler@68072 ` 761` ``` shows "\B. independent B \ B \ span V \ V \ span B \ ``` immler@68072 ` 762` ``` (card B = dim V) \ pairwise orthogonal B" ``` wenzelm@49663 ` 763` ```proof - ``` wenzelm@49522 ` 764` ``` from basis_exists[of V] obtain B where ``` wenzelm@53406 ` 765` ``` B: "B \ V" "independent B" "V \ span B" "card B = dim V" ``` immler@68073 ` 766` ``` by force ``` wenzelm@53406 ` 767` ``` from B have fB: "finite B" "card B = dim V" ``` wenzelm@53406 ` 768` ``` using independent_bound by auto ``` huffman@44133 ` 769` ``` from basis_orthogonal[OF fB(1)] obtain C where ``` wenzelm@53406 ` 770` ``` C: "finite C" "card C \ card B" "span C = span B" "pairwise orthogonal C" ``` wenzelm@53406 ` 771` ``` by blast ``` wenzelm@53406 ` 772` ``` from C B have CSV: "C \ span V" ``` immler@68072 ` 773` ``` by (metis span_superset span_mono subset_trans) ``` wenzelm@53406 ` 774` ``` from span_mono[OF B(3)] C have SVC: "span V \ span C" ``` wenzelm@53406 ` 775` ``` by (simp add: span_span) ``` huffman@44133 ` 776` ``` from card_le_dim_spanning[OF CSV SVC C(1)] C(2,3) fB ``` wenzelm@53406 ` 777` ``` have iC: "independent C" ``` huffman@44133 ` 778` ``` by (simp add: dim_span) ``` wenzelm@53406 ` 779` ``` from C fB have "card C \ dim V" ``` wenzelm@53406 ` 780` ``` by simp ``` wenzelm@53406 ` 781` ``` moreover have "dim V \ card C" ``` wenzelm@53406 ` 782` ``` using span_card_ge_dim[OF CSV SVC C(1)] ``` immler@68072 ` 783` ``` by simp ``` wenzelm@53406 ` 784` ``` ultimately have CdV: "card C = dim V" ``` wenzelm@53406 ` 785` ``` using C(1) by simp ``` wenzelm@53406 ` 786` ``` from C B CSV CdV iC show ?thesis ``` wenzelm@53406 ` 787` ``` by auto ``` huffman@44133 ` 788` ```qed ``` huffman@44133 ` 789` wenzelm@60420 ` 790` ```text \Low-dimensional subset is in a hyperplane (weak orthogonal complement).\ ``` huffman@44133 ` 791` wenzelm@49522 ` 792` ```lemma span_not_univ_orthogonal: ``` wenzelm@53406 ` 793` ``` fixes S :: "'a::euclidean_space set" ``` huffman@44133 ` 794` ``` assumes sU: "span S \ UNIV" ``` wenzelm@56444 ` 795` ``` shows "\a::'a. a \ 0 \ (\x \ span S. a \ x = 0)" ``` wenzelm@49522 ` 796` ```proof - ``` wenzelm@53406 ` 797` ``` from sU obtain a where a: "a \ span S" ``` wenzelm@53406 ` 798` ``` by blast ``` huffman@44133 ` 799` ``` from orthogonal_basis_exists obtain B where ``` immler@68072 ` 800` ``` B: "independent B" "B \ span S" "S \ span B" ``` immler@68072 ` 801` ``` "card B = dim S" "pairwise orthogonal B" ``` huffman@44133 ` 802` ``` by blast ``` wenzelm@53406 ` 803` ``` from B have fB: "finite B" "card B = dim S" ``` wenzelm@53406 ` 804` ``` using independent_bound by auto ``` huffman@44133 ` 805` ``` from span_mono[OF B(2)] span_mono[OF B(3)] ``` wenzelm@53406 ` 806` ``` have sSB: "span S = span B" ``` wenzelm@53406 ` 807` ``` by (simp add: span_span) ``` nipkow@64267 ` 808` ``` let ?a = "a - sum (\b. (a \ b / (b \ b)) *\<^sub>R b) B" ``` nipkow@64267 ` 809` ``` have "sum (\b. (a \ b / (b \ b)) *\<^sub>R b) B \ span S" ``` huffman@44133 ` 810` ``` unfolding sSB ``` nipkow@64267 ` 811` ``` apply (rule span_sum) ``` immler@68072 ` 812` ``` apply (rule span_scale) ``` immler@68072 ` 813` ``` apply (rule span_base) ``` wenzelm@49522 ` 814` ``` apply assumption ``` wenzelm@49522 ` 815` ``` done ``` wenzelm@53406 ` 816` ``` with a have a0:"?a \ 0" ``` wenzelm@53406 ` 817` ``` by auto ``` lp15@68058 ` 818` ``` have "?a \ x = 0" if "x\span B" for x ``` lp15@68058 ` 819` ``` proof (rule span_induct [OF that]) ``` wenzelm@49522 ` 820` ``` show "subspace {x. ?a \ x = 0}" ``` wenzelm@49522 ` 821` ``` by (auto simp add: subspace_def inner_add) ``` wenzelm@49522 ` 822` ``` next ``` wenzelm@53406 ` 823` ``` { ``` wenzelm@53406 ` 824` ``` fix x ``` wenzelm@53406 ` 825` ``` assume x: "x \ B" ``` wenzelm@53406 ` 826` ``` from x have B': "B = insert x (B - {x})" ``` wenzelm@53406 ` 827` ``` by blast ``` wenzelm@53406 ` 828` ``` have fth: "finite (B - {x})" ``` wenzelm@53406 ` 829` ``` using fB by simp ``` huffman@44133 ` 830` ``` have "?a \ x = 0" ``` wenzelm@53406 ` 831` ``` apply (subst B') ``` wenzelm@53406 ` 832` ``` using fB fth ``` nipkow@64267 ` 833` ``` unfolding sum_clauses(2)[OF fth] ``` huffman@44133 ` 834` ``` apply simp unfolding inner_simps ``` nipkow@64267 ` 835` ``` apply (clarsimp simp add: inner_add inner_sum_left) ``` nipkow@64267 ` 836` ``` apply (rule sum.neutral, rule ballI) ``` wenzelm@63170 ` 837` ``` apply (simp only: inner_commute) ``` wenzelm@49711 ` 838` ``` apply (auto simp add: x field_simps ``` wenzelm@49711 ` 839` ``` intro: B(5)[unfolded pairwise_def orthogonal_def, rule_format]) ``` wenzelm@53406 ` 840` ``` done ``` wenzelm@53406 ` 841` ``` } ``` lp15@68058 ` 842` ``` then show "?a \ x = 0" if "x \ B" for x ``` lp15@68058 ` 843` ``` using that by blast ``` lp15@68058 ` 844` ``` qed ``` wenzelm@53406 ` 845` ``` with a0 show ?thesis ``` wenzelm@53406 ` 846` ``` unfolding sSB by (auto intro: exI[where x="?a"]) ``` huffman@44133 ` 847` ```qed ``` huffman@44133 ` 848` huffman@44133 ` 849` ```lemma span_not_univ_subset_hyperplane: ``` wenzelm@53406 ` 850` ``` fixes S :: "'a::euclidean_space set" ``` wenzelm@53406 ` 851` ``` assumes SU: "span S \ UNIV" ``` huffman@44133 ` 852` ``` shows "\ a. a \0 \ span S \ {x. a \ x = 0}" ``` huffman@44133 ` 853` ``` using span_not_univ_orthogonal[OF SU] by auto ``` huffman@44133 ` 854` wenzelm@49663 ` 855` ```lemma lowdim_subset_hyperplane: ``` wenzelm@53406 ` 856` ``` fixes S :: "'a::euclidean_space set" ``` huffman@44133 ` 857` ``` assumes d: "dim S < DIM('a)" ``` wenzelm@56444 ` 858` ``` shows "\a::'a. a \ 0 \ span S \ {x. a \ x = 0}" ``` wenzelm@49522 ` 859` ```proof - ``` wenzelm@53406 ` 860` ``` { ``` wenzelm@53406 ` 861` ``` assume "span S = UNIV" ``` wenzelm@53406 ` 862` ``` then have "dim (span S) = dim (UNIV :: ('a) set)" ``` wenzelm@53406 ` 863` ``` by simp ``` wenzelm@53406 ` 864` ``` then have "dim S = DIM('a)" ``` immler@68072 ` 865` ``` by (metis Euclidean_Space.dim_UNIV dim_span) ``` wenzelm@53406 ` 866` ``` with d have False by arith ``` wenzelm@53406 ` 867` ``` } ``` wenzelm@53406 ` 868` ``` then have th: "span S \ UNIV" ``` wenzelm@53406 ` 869` ``` by blast ``` huffman@44133 ` 870` ``` from span_not_univ_subset_hyperplane[OF th] show ?thesis . ``` huffman@44133 ` 871` ```qed ``` huffman@44133 ` 872` huffman@44133 ` 873` ```lemma linear_eq_stdbasis: ``` wenzelm@56444 ` 874` ``` fixes f :: "'a::euclidean_space \ _" ``` wenzelm@56444 ` 875` ``` assumes lf: "linear f" ``` wenzelm@49663 ` 876` ``` and lg: "linear g" ``` lp15@68058 ` 877` ``` and fg: "\b. b \ Basis \ f b = g b" ``` huffman@44133 ` 878` ``` shows "f = g" ``` immler@68072 ` 879` ``` using linear_eq_on_span[OF lf lg, of Basis] fg ``` immler@68072 ` 880` ``` by auto ``` immler@68072 ` 881` huffman@44133 ` 882` wenzelm@60420 ` 883` ```text \Similar results for bilinear functions.\ ``` huffman@44133 ` 884` huffman@44133 ` 885` ```lemma bilinear_eq: ``` huffman@44133 ` 886` ``` assumes bf: "bilinear f" ``` wenzelm@49522 ` 887` ``` and bg: "bilinear g" ``` wenzelm@53406 ` 888` ``` and SB: "S \ span B" ``` wenzelm@53406 ` 889` ``` and TC: "T \ span C" ``` lp15@68058 ` 890` ``` and "x\S" "y\T" ``` lp15@68058 ` 891` ``` and fg: "\x y. \x \ B; y\ C\ \ f x y = g x y" ``` lp15@68058 ` 892` ``` shows "f x y = g x y" ``` wenzelm@49663 ` 893` ```proof - ``` huffman@44170 ` 894` ``` let ?P = "{x. \y\ span C. f x y = g x y}" ``` huffman@44133 ` 895` ``` from bf bg have sp: "subspace ?P" ``` huffman@53600 ` 896` ``` unfolding bilinear_def linear_iff subspace_def bf bg ``` immler@68072 ` 897` ``` by (auto simp add: span_zero bilinear_lzero[OF bf] bilinear_lzero[OF bg] ``` immler@68072 ` 898` ``` span_add Ball_def ``` wenzelm@49663 ` 899` ``` intro: bilinear_ladd[OF bf]) ``` lp15@68058 ` 900` ``` have sfg: "\x. x \ B \ subspace {a. f x a = g x a}" ``` huffman@44133 ` 901` ``` apply (auto simp add: subspace_def) ``` huffman@53600 ` 902` ``` using bf bg unfolding bilinear_def linear_iff ``` immler@68072 ` 903` ``` apply (auto simp add: span_zero bilinear_rzero[OF bf] bilinear_rzero[OF bg] ``` immler@68072 ` 904` ``` span_add Ball_def ``` wenzelm@49663 ` 905` ``` intro: bilinear_ladd[OF bf]) ``` wenzelm@49522 ` 906` ``` done ``` lp15@68058 ` 907` ``` have "\y\ span C. f x y = g x y" if "x \ span B" for x ``` lp15@68058 ` 908` ``` apply (rule span_induct [OF that sp]) ``` lp15@68062 ` 909` ``` using fg sfg span_induct by blast ``` wenzelm@53406 ` 910` ``` then show ?thesis ``` lp15@68058 ` 911` ``` using SB TC assms by auto ``` huffman@44133 ` 912` ```qed ``` huffman@44133 ` 913` wenzelm@49522 ` 914` ```lemma bilinear_eq_stdbasis: ``` wenzelm@53406 ` 915` ``` fixes f :: "'a::euclidean_space \ 'b::euclidean_space \ _" ``` huffman@44133 ` 916` ``` assumes bf: "bilinear f" ``` wenzelm@49522 ` 917` ``` and bg: "bilinear g" ``` lp15@68058 ` 918` ``` and fg: "\i j. i \ Basis \ j \ Basis \ f i j = g i j" ``` huffman@44133 ` 919` ``` shows "f = g" ``` immler@68074 ` 920` ``` using bilinear_eq[OF bf bg equalityD2[OF span_Basis] equalityD2[OF span_Basis]] fg by blast ``` wenzelm@49522 ` 921` wenzelm@60420 ` 922` ```subsection \Infinity norm\ ``` huffman@44133 ` 923` immler@67962 ` 924` ```definition%important "infnorm (x::'a::euclidean_space) = Sup {\x \ b\ |b. b \ Basis}" ``` huffman@44133 ` 925` huffman@44133 ` 926` ```lemma infnorm_set_image: ``` wenzelm@53716 ` 927` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@56444 ` 928` ``` shows "{\x \ i\ |i. i \ Basis} = (\i. \x \ i\) ` Basis" ``` hoelzl@50526 ` 929` ``` by blast ``` huffman@44133 ` 930` wenzelm@53716 ` 931` ```lemma infnorm_Max: ``` wenzelm@53716 ` 932` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@56444 ` 933` ``` shows "infnorm x = Max ((\i. \x \ i\) ` Basis)" ``` haftmann@62343 ` 934` ``` by (simp add: infnorm_def infnorm_set_image cSup_eq_Max) ``` hoelzl@51475 ` 935` huffman@44133 ` 936` ```lemma infnorm_set_lemma: ``` wenzelm@53716 ` 937` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@56444 ` 938` ``` shows "finite {\x \ i\ |i. i \ Basis}" ``` wenzelm@56444 ` 939` ``` and "{\x \ i\ |i. i \ Basis} \ {}" ``` huffman@44133 ` 940` ``` unfolding infnorm_set_image ``` huffman@44133 ` 941` ``` by auto ``` huffman@44133 ` 942` wenzelm@53406 ` 943` ```lemma infnorm_pos_le: ``` wenzelm@53406 ` 944` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@53406 ` 945` ``` shows "0 \ infnorm x" ``` hoelzl@51475 ` 946` ``` by (simp add: infnorm_Max Max_ge_iff ex_in_conv) ``` huffman@44133 ` 947` wenzelm@53406 ` 948` ```lemma infnorm_triangle: ``` wenzelm@53406 ` 949` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@53406 ` 950` ``` shows "infnorm (x + y) \ infnorm x + infnorm y" ``` wenzelm@49522 ` 951` ```proof - ``` hoelzl@51475 ` 952` ``` have *: "\a b c d :: real. \a\ \ c \ \b\ \ d \ \a + b\ \ c + d" ``` hoelzl@51475 ` 953` ``` by simp ``` huffman@44133 ` 954` ``` show ?thesis ``` hoelzl@51475 ` 955` ``` by (auto simp: infnorm_Max inner_add_left intro!: *) ``` huffman@44133 ` 956` ```qed ``` huffman@44133 ` 957` wenzelm@53406 ` 958` ```lemma infnorm_eq_0: ``` wenzelm@53406 ` 959` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@53406 ` 960` ``` shows "infnorm x = 0 \ x = 0" ``` wenzelm@49522 ` 961` ```proof - ``` hoelzl@51475 ` 962` ``` have "infnorm x \ 0 \ x = 0" ``` hoelzl@51475 ` 963` ``` unfolding infnorm_Max by (simp add: euclidean_all_zero_iff) ``` hoelzl@51475 ` 964` ``` then show ?thesis ``` hoelzl@51475 ` 965` ``` using infnorm_pos_le[of x] by simp ``` huffman@44133 ` 966` ```qed ``` huffman@44133 ` 967` huffman@44133 ` 968` ```lemma infnorm_0: "infnorm 0 = 0" ``` huffman@44133 ` 969` ``` by (simp add: infnorm_eq_0) ``` huffman@44133 ` 970` huffman@44133 ` 971` ```lemma infnorm_neg: "infnorm (- x) = infnorm x" ``` lp15@68062 ` 972` ``` unfolding infnorm_def by simp ``` huffman@44133 ` 973` huffman@44133 ` 974` ```lemma infnorm_sub: "infnorm (x - y) = infnorm (y - x)" ``` lp15@68062 ` 975` ``` by (metis infnorm_neg minus_diff_eq) ``` lp15@68062 ` 976` lp15@68062 ` 977` ```lemma absdiff_infnorm: "\infnorm x - infnorm y\ \ infnorm (x - y)" ``` wenzelm@49522 ` 978` ```proof - ``` lp15@68062 ` 979` ``` have *: "\(nx::real) n ny. nx \ n + ny \ ny \ n + nx \ \nx - ny\ \ n" ``` huffman@44133 ` 980` ``` by arith ``` lp15@68062 ` 981` ``` show ?thesis ``` lp15@68062 ` 982` ``` proof (rule *) ``` lp15@68062 ` 983` ``` from infnorm_triangle[of "x - y" " y"] infnorm_triangle[of "x - y" "-x"] ``` lp15@68062 ` 984` ``` show "infnorm x \ infnorm (x - y) + infnorm y" "infnorm y \ infnorm (x - y) + infnorm x" ``` lp15@68062 ` 985` ``` by (simp_all add: field_simps infnorm_neg) ``` lp15@68062 ` 986` ``` qed ``` huffman@44133 ` 987` ```qed ``` huffman@44133 ` 988` wenzelm@53406 ` 989` ```lemma real_abs_infnorm: "\infnorm x\ = infnorm x" ``` huffman@44133 ` 990` ``` using infnorm_pos_le[of x] by arith ``` huffman@44133 ` 991` hoelzl@50526 ` 992` ```lemma Basis_le_infnorm: ``` wenzelm@53406 ` 993` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@53406 ` 994` ``` shows "b \ Basis \ \x \ b\ \ infnorm x" ``` hoelzl@51475 ` 995` ``` by (simp add: infnorm_Max) ``` huffman@44133 ` 996` wenzelm@56444 ` 997` ```lemma infnorm_mul: "infnorm (a *\<^sub>R x) = \a\ * infnorm x" ``` hoelzl@51475 ` 998` ``` unfolding infnorm_Max ``` hoelzl@51475 ` 999` ```proof (safe intro!: Max_eqI) ``` hoelzl@51475 ` 1000` ``` let ?B = "(\i. \x \ i\) ` Basis" ``` lp15@68062 ` 1001` ``` { fix b :: 'a ``` wenzelm@53406 ` 1002` ``` assume "b \ Basis" ``` wenzelm@53406 ` 1003` ``` then show "\a *\<^sub>R x \ b\ \ \a\ * Max ?B" ``` wenzelm@53406 ` 1004` ``` by (simp add: abs_mult mult_left_mono) ``` wenzelm@53406 ` 1005` ``` next ``` wenzelm@53406 ` 1006` ``` from Max_in[of ?B] obtain b where "b \ Basis" "Max ?B = \x \ b\" ``` wenzelm@53406 ` 1007` ``` by (auto simp del: Max_in) ``` wenzelm@53406 ` 1008` ``` then show "\a\ * Max ((\i. \x \ i\) ` Basis) \ (\i. \a *\<^sub>R x \ i\) ` Basis" ``` wenzelm@53406 ` 1009` ``` by (intro image_eqI[where x=b]) (auto simp: abs_mult) ``` wenzelm@53406 ` 1010` ``` } ``` hoelzl@51475 ` 1011` ```qed simp ``` hoelzl@51475 ` 1012` wenzelm@53406 ` 1013` ```lemma infnorm_mul_lemma: "infnorm (a *\<^sub>R x) \ \a\ * infnorm x" ``` hoelzl@51475 ` 1014` ``` unfolding infnorm_mul .. ``` huffman@44133 ` 1015` huffman@44133 ` 1016` ```lemma infnorm_pos_lt: "infnorm x > 0 \ x \ 0" ``` huffman@44133 ` 1017` ``` using infnorm_pos_le[of x] infnorm_eq_0[of x] by arith ``` huffman@44133 ` 1018` wenzelm@60420 ` 1019` ```text \Prove that it differs only up to a bound from Euclidean norm.\ ``` huffman@44133 ` 1020` huffman@44133 ` 1021` ```lemma infnorm_le_norm: "infnorm x \ norm x" ``` hoelzl@51475 ` 1022` ``` by (simp add: Basis_le_norm infnorm_Max) ``` hoelzl@50526 ` 1023` wenzelm@53716 ` 1024` ```lemma norm_le_infnorm: ``` wenzelm@53716 ` 1025` ``` fixes x :: "'a::euclidean_space" ``` wenzelm@53716 ` 1026` ``` shows "norm x \ sqrt DIM('a) * infnorm x" ``` lp15@68062 ` 1027` ``` unfolding norm_eq_sqrt_inner id_def ``` lp15@68062 ` 1028` ```proof (rule real_le_lsqrt[OF inner_ge_zero]) ``` lp15@68062 ` 1029` ``` show "sqrt DIM('a) * infnorm x \ 0" ``` huffman@44133 ` 1030` ``` by (simp add: zero_le_mult_iff infnorm_pos_le) ``` lp15@68062 ` 1031` ``` have "x \ x \ (\b\Basis. x \ b * (x \ b))" ``` lp15@68062 ` 1032` ``` by (metis euclidean_inner order_refl) ``` lp15@68062 ` 1033` ``` also have "... \ DIM('a) * \infnorm x\\<^sup>2" ``` lp15@68062 ` 1034` ``` by (rule sum_bounded_above) (metis Basis_le_infnorm abs_le_square_iff power2_eq_square real_abs_infnorm) ``` lp15@68062 ` 1035` ``` also have "... \ (sqrt DIM('a) * infnorm x)\<^sup>2" ``` lp15@68062 ` 1036` ``` by (simp add: power_mult_distrib) ``` lp15@68062 ` 1037` ``` finally show "x \ x \ (sqrt DIM('a) * infnorm x)\<^sup>2" . ``` huffman@44133 ` 1038` ```qed ``` huffman@44133 ` 1039` huffman@44646 ` 1040` ```lemma tendsto_infnorm [tendsto_intros]: ``` wenzelm@61973 ` 1041` ``` assumes "(f \ a) F" ``` wenzelm@61973 ` 1042` ``` shows "((\x. infnorm (f x)) \ infnorm a) F" ``` huffman@44646 ` 1043` ```proof (rule tendsto_compose [OF LIM_I assms]) ``` wenzelm@53406 ` 1044` ``` fix r :: real ``` wenzelm@53406 ` 1045` ``` assume "r > 0" ``` wenzelm@49522 ` 1046` ``` then show "\s>0. \x. x \ a \ norm (x - a) < s \ norm (infnorm x - infnorm a) < r" ``` lp15@68062 ` 1047` ``` by (metis real_norm_def le_less_trans absdiff_infnorm infnorm_le_norm) ``` huffman@44646 ` 1048` ```qed ``` huffman@44646 ` 1049` wenzelm@60420 ` 1050` ```text \Equality in Cauchy-Schwarz and triangle inequalities.\ ``` huffman@44133 ` 1051` wenzelm@53406 ` 1052` ```lemma norm_cauchy_schwarz_eq: "x \ y = norm x * norm y \ norm x *\<^sub>R y = norm y *\<^sub>R x" ``` wenzelm@53406 ` 1053` ``` (is "?lhs \ ?rhs") ``` lp15@68062 ` 1054` ```proof (cases "x=0") ``` lp15@68062 ` 1055` ``` case True ``` lp15@68062 ` 1056` ``` then show ?thesis ``` lp15@68062 ` 1057` ``` by auto ``` lp15@68062 ` 1058` ```next ``` lp15@68062 ` 1059` ``` case False ``` lp15@68062 ` 1060` ``` from inner_eq_zero_iff[of "norm y *\<^sub>R x - norm x *\<^sub>R y"] ``` lp15@68062 ` 1061` ``` have "?rhs \ ``` wenzelm@49522 ` 1062` ``` (norm y * (norm y * norm x * norm x - norm x * (x \ y)) - ``` wenzelm@49522 ` 1063` ``` norm x * (norm y * (y \ x) - norm x * norm y * norm y) = 0)" ``` lp15@68062 ` 1064` ``` using False unfolding inner_simps ``` lp15@68062 ` 1065` ``` by (auto simp add: power2_norm_eq_inner[symmetric] power2_eq_square inner_commute field_simps) ``` lp15@68062 ` 1066` ``` also have "\ \ (2 * norm x * norm y * (norm x * norm y - x \ y) = 0)" ``` lp15@68062 ` 1067` ``` using False by (simp add: field_simps inner_commute) ``` lp15@68062 ` 1068` ``` also have "\ \ ?lhs" ``` lp15@68062 ` 1069` ``` using False by auto ``` lp15@68062 ` 1070` ``` finally show ?thesis by metis ``` huffman@44133 ` 1071` ```qed ``` huffman@44133 ` 1072` huffman@44133 ` 1073` ```lemma norm_cauchy_schwarz_abs_eq: ``` wenzelm@56444 ` 1074` ``` "\x \ y\ = norm x * norm y \ ``` wenzelm@53716 ` 1075` ``` norm x *\<^sub>R y = norm y *\<^sub>R x \ norm x *\<^sub>R y = - norm y *\<^sub>R x" ``` wenzelm@53406 ` 1076` ``` (is "?lhs \ ?rhs") ``` wenzelm@49522 ` 1077` ```proof - ``` wenzelm@56444 ` 1078` ``` have th: "\(x::real) a. a \ 0 \ \x\ = a \ x = a \ x = - a" ``` wenzelm@53406 ` 1079` ``` by arith ``` huffman@44133 ` 1080` ``` have "?rhs \ norm x *\<^sub>R y = norm y *\<^sub>R x \ norm (- x) *\<^sub>R y = norm y *\<^sub>R (- x)" ``` huffman@44133 ` 1081` ``` by simp ``` lp15@68062 ` 1082` ``` also have "\ \ (x \ y = norm x * norm y \ (- x) \ y = norm x * norm y)" ``` huffman@44133 ` 1083` ``` unfolding norm_cauchy_schwarz_eq[symmetric] ``` huffman@44133 ` 1084` ``` unfolding norm_minus_cancel norm_scaleR .. ``` huffman@44133 ` 1085` ``` also have "\ \ ?lhs" ``` wenzelm@53406 ` 1086` ``` unfolding th[OF mult_nonneg_nonneg, OF norm_ge_zero[of x] norm_ge_zero[of y]] inner_simps ``` wenzelm@53406 ` 1087` ``` by auto ``` huffman@44133 ` 1088` ``` finally show ?thesis .. ``` huffman@44133 ` 1089` ```qed ``` huffman@44133 ` 1090` huffman@44133 ` 1091` ```lemma norm_triangle_eq: ``` huffman@44133 ` 1092` ``` fixes x y :: "'a::real_inner" ``` wenzelm@53406 ` 1093` ``` shows "norm (x + y) = norm x + norm y \ norm x *\<^sub>R y = norm y *\<^sub>R x" ``` lp15@68062 ` 1094` ```proof (cases "x = 0 \ y = 0") ``` lp15@68062 ` 1095` ``` case True ``` lp15@68062 ` 1096` ``` then show ?thesis ``` lp15@68062 ` 1097` ``` by force ``` lp15@68062 ` 1098` ```next ``` lp15@68062 ` 1099` ``` case False ``` lp15@68062 ` 1100` ``` then have n: "norm x > 0" "norm y > 0" ``` lp15@68062 ` 1101` ``` by auto ``` lp15@68062 ` 1102` ``` have "norm (x + y) = norm x + norm y \ (norm (x + y))\<^sup>2 = (norm x + norm y)\<^sup>2" ``` lp15@68062 ` 1103` ``` by simp ``` lp15@68062 ` 1104` ``` also have "\ \ norm x *\<^sub>R y = norm y *\<^sub>R x" ``` lp15@68062 ` 1105` ``` unfolding norm_cauchy_schwarz_eq[symmetric] ``` lp15@68062 ` 1106` ``` unfolding power2_norm_eq_inner inner_simps ``` lp15@68062 ` 1107` ``` by (simp add: power2_norm_eq_inner[symmetric] power2_eq_square inner_commute field_simps) ``` lp15@68062 ` 1108` ``` finally show ?thesis . ``` huffman@44133 ` 1109` ```qed ``` huffman@44133 ` 1110` wenzelm@49522 ` 1111` wenzelm@60420 ` 1112` ```subsection \Collinearity\ ``` huffman@44133 ` 1113` immler@67962 ` 1114` ```definition%important collinear :: "'a::real_vector set \ bool" ``` wenzelm@49522 ` 1115` ``` where "collinear S \ (\u. \x \ S. \ y \ S. \c. x - y = c *\<^sub>R u)" ``` huffman@44133 ` 1116` lp15@66287 ` 1117` ```lemma collinear_alt: ``` lp15@66287 ` 1118` ``` "collinear S \ (\u v. \x \ S. \c. x = u + c *\<^sub>R v)" (is "?lhs = ?rhs") ``` lp15@66287 ` 1119` ```proof ``` lp15@66287 ` 1120` ``` assume ?lhs ``` lp15@66287 ` 1121` ``` then show ?rhs ``` lp15@66287 ` 1122` ``` unfolding collinear_def by (metis Groups.add_ac(2) diff_add_cancel) ``` lp15@66287 ` 1123` ```next ``` lp15@66287 ` 1124` ``` assume ?rhs ``` lp15@66287 ` 1125` ``` then obtain u v where *: "\x. x \ S \ \c. x = u + c *\<^sub>R v" ``` lp15@66287 ` 1126` ``` by (auto simp: ) ``` lp15@66287 ` 1127` ``` have "\c. x - y = c *\<^sub>R v" if "x \ S" "y \ S" for x y ``` lp15@66287 ` 1128` ``` by (metis *[OF \x \ S\] *[OF \y \ S\] scaleR_left.diff add_diff_cancel_left) ``` lp15@66287 ` 1129` ``` then show ?lhs ``` lp15@66287 ` 1130` ``` using collinear_def by blast ``` lp15@66287 ` 1131` ```qed ``` lp15@66287 ` 1132` lp15@66287 ` 1133` ```lemma collinear: ``` lp15@66287 ` 1134` ``` fixes S :: "'a::{perfect_space,real_vector} set" ``` lp15@66287 ` 1135` ``` shows "collinear S \ (\u. u \ 0 \ (\x \ S. \ y \ S. \c. x - y = c *\<^sub>R u))" ``` lp15@66287 ` 1136` ```proof - ``` lp15@66287 ` 1137` ``` have "\v. v \ 0 \ (\x\S. \y\S. \c. x - y = c *\<^sub>R v)" ``` lp15@66287 ` 1138` ``` if "\x\S. \y\S. \c. x - y = c *\<^sub>R u" "u=0" for u ``` lp15@66287 ` 1139` ``` proof - ``` lp15@66287 ` 1140` ``` have "\x\S. \y\S. x = y" ``` lp15@66287 ` 1141` ``` using that by auto ``` lp15@66287 ` 1142` ``` moreover ``` lp15@66287 ` 1143` ``` obtain v::'a where "v \ 0" ``` lp15@66287 ` 1144` ``` using UNIV_not_singleton [of 0] by auto ``` lp15@66287 ` 1145` ``` ultimately have "\x\S. \y\S. \c. x - y = c *\<^sub>R v" ``` lp15@66287 ` 1146` ``` by auto ``` lp15@66287 ` 1147` ``` then show ?thesis ``` lp15@66287 ` 1148` ``` using \v \ 0\ by blast ``` lp15@66287 ` 1149` ``` qed ``` lp15@66287 ` 1150` ``` then show ?thesis ``` lp15@66287 ` 1151` ``` apply (clarsimp simp: collinear_def) ``` immler@68072 ` 1152` ``` by (metis scaleR_zero_right vector_fraction_eq_iff) ``` lp15@66287 ` 1153` ```qed ``` lp15@66287 ` 1154` lp15@63881 ` 1155` ```lemma collinear_subset: "\collinear T; S \ T\ \ collinear S" ``` lp15@63881 ` 1156` ``` by (meson collinear_def subsetCE) ``` lp15@63881 ` 1157` paulson@60762 ` 1158` ```lemma collinear_empty [iff]: "collinear {}" ``` wenzelm@53406 ` 1159` ``` by (simp add: collinear_def) ``` huffman@44133 ` 1160` paulson@60762 ` 1161` ```lemma collinear_sing [iff]: "collinear {x}" ``` huffman@44133 ` 1162` ``` by (simp add: collinear_def) ``` huffman@44133 ` 1163` paulson@60762 ` 1164` ```lemma collinear_2 [iff]: "collinear {x, y}" ``` huffman@44133 ` 1165` ``` apply (simp add: collinear_def) ``` huffman@44133 ` 1166` ``` apply (rule exI[where x="x - y"]) ``` lp15@68062 ` 1167` ``` by (metis minus_diff_eq scaleR_left.minus scaleR_one) ``` huffman@44133 ` 1168` wenzelm@56444 ` 1169` ```lemma collinear_lemma: "collinear {0, x, y} \ x = 0 \ y = 0 \ (\c. y = c *\<^sub>R x)" ``` wenzelm@53406 ` 1170` ``` (is "?lhs \ ?rhs") ``` lp15@68062 ` 1171` ```proof (cases "x = 0 \ y = 0") ``` lp15@68062 ` 1172` ``` case True ``` lp15@68062 ` 1173` ``` then show ?thesis ``` lp15@68062 ` 1174` ``` by (auto simp: insert_commute) ``` lp15@68062 ` 1175` ```next ``` lp15@68062 ` 1176` ``` case False ``` lp15@68062 ` 1177` ``` show ?thesis ``` lp15@68062 ` 1178` ``` proof ``` lp15@68062 ` 1179` ``` assume h: "?lhs" ``` lp15@68062 ` 1180` ``` then obtain u where u: "\ x\ {0,x,y}. \y\ {0,x,y}. \c. x - y = c *\<^sub>R u" ``` lp15@68062 ` 1181` ``` unfolding collinear_def by blast ``` lp15@68062 ` 1182` ``` from u[rule_format, of x 0] u[rule_format, of y 0] ``` lp15@68062 ` 1183` ``` obtain cx and cy where ``` lp15@68062 ` 1184` ``` cx: "x = cx *\<^sub>R u" and cy: "y = cy *\<^sub>R u" ``` lp15@68062 ` 1185` ``` by auto ``` lp15@68062 ` 1186` ``` from cx cy False have cx0: "cx \ 0" and cy0: "cy \ 0" by auto ``` lp15@68062 ` 1187` ``` let ?d = "cy / cx" ``` lp15@68062 ` 1188` ``` from cx cy cx0 have "y = ?d *\<^sub>R x" ``` lp15@68062 ` 1189` ``` by simp ``` lp15@68062 ` 1190` ``` then show ?rhs using False by blast ``` lp15@68062 ` 1191` ``` next ``` lp15@68062 ` 1192` ``` assume h: "?rhs" ``` lp15@68062 ` 1193` ``` then obtain c where c: "y = c *\<^sub>R x" ``` lp15@68062 ` 1194` ``` using False by blast ``` lp15@68062 ` 1195` ``` show ?lhs ``` lp15@68062 ` 1196` ``` unfolding collinear_def c ``` lp15@68062 ` 1197` ``` apply (rule exI[where x=x]) ``` lp15@68062 ` 1198` ``` apply auto ``` lp15@68062 ` 1199` ``` apply (rule exI[where x="- 1"], simp) ``` lp15@68062 ` 1200` ``` apply (rule exI[where x= "-c"], simp) ``` huffman@44133 ` 1201` ``` apply (rule exI[where x=1], simp) ``` lp15@68062 ` 1202` ``` apply (rule exI[where x="1 - c"], simp add: scaleR_left_diff_distrib) ``` lp15@68062 ` 1203` ``` apply (rule exI[where x="c - 1"], simp add: scaleR_left_diff_distrib) ``` lp15@68062 ` 1204` ``` done ``` lp15@68062 ` 1205` ``` qed ``` huffman@44133 ` 1206` ```qed ``` huffman@44133 ` 1207` wenzelm@56444 ` 1208` ```lemma norm_cauchy_schwarz_equal: "\x \ y\ = norm x * norm y \ collinear {0, x, y}" ``` lp15@68062 ` 1209` ```proof (cases "x=0") ``` lp15@68062 ` 1210` ``` case True ``` lp15@68062 ` 1211` ``` then show ?thesis ``` lp15@68062 ` 1212` ``` by (auto simp: insert_commute) ``` lp15@68062 ` 1213` ```next ``` lp15@68062 ` 1214` ``` case False ``` lp15@68062 ` 1215` ``` then have nnz: "norm x \ 0" ``` lp15@68062 ` 1216` ``` by auto ``` lp15@68062 ` 1217` ``` show ?thesis ``` lp15@68062 ` 1218` ``` proof ``` lp15@68062 ` 1219` ``` assume "\x \ y\ = norm x * norm y" ``` lp15@68062 ` 1220` ``` then show "collinear {0, x, y}" ``` lp15@68062 ` 1221` ``` unfolding norm_cauchy_schwarz_abs_eq collinear_lemma ``` lp15@68062 ` 1222` ``` by (meson eq_vector_fraction_iff nnz) ``` lp15@68062 ` 1223` ``` next ``` lp15@68062 ` 1224` ``` assume "collinear {0, x, y}" ``` lp15@68062 ` 1225` ``` with False show "\x \ y\ = norm x * norm y" ``` lp15@68062 ` 1226` ``` unfolding norm_cauchy_schwarz_abs_eq collinear_lemma by (auto simp: abs_if) ``` lp15@68062 ` 1227` ``` qed ``` lp15@68062 ` 1228` ```qed ``` wenzelm@49522 ` 1229` immler@54776 ` 1230` ```end ```