1395 done |
1395 done |
1396 |
1396 |
1397 lemma norm_eq_1: "norm x = 1 \<longleftrightarrow> x \<bullet> x = 1" |
1397 lemma norm_eq_1: "norm x = 1 \<longleftrightarrow> x \<bullet> x = 1" |
1398 by (simp add: norm_eq_sqrt_inner) |
1398 by (simp add: norm_eq_sqrt_inner) |
1399 |
1399 |
1400 text\<open>Squaring equations and inequalities involving norms.\<close> |
|
1401 |
|
1402 lemma dot_square_norm: "x \<bullet> x = (norm x)\<^sup>2" |
|
1403 by (simp only: power2_norm_eq_inner) (* TODO: move? *) |
|
1404 |
|
1405 lemma norm_eq_square: "norm x = a \<longleftrightarrow> 0 \<le> a \<and> x \<bullet> x = a\<^sup>2" |
|
1406 by (auto simp add: norm_eq_sqrt_inner) |
|
1407 |
|
1408 lemma norm_le_square: "norm x \<le> a \<longleftrightarrow> 0 \<le> a \<and> x \<bullet> x \<le> a\<^sup>2" |
|
1409 apply (simp add: dot_square_norm abs_le_square_iff[symmetric]) |
|
1410 using norm_ge_zero[of x] |
|
1411 apply arith |
|
1412 done |
|
1413 |
|
1414 lemma norm_ge_square: "norm x \<ge> a \<longleftrightarrow> a \<le> 0 \<or> x \<bullet> x \<ge> a\<^sup>2" |
|
1415 apply (simp add: dot_square_norm abs_le_square_iff[symmetric]) |
|
1416 using norm_ge_zero[of x] |
|
1417 apply arith |
|
1418 done |
|
1419 |
|
1420 lemma norm_lt_square: "norm x < a \<longleftrightarrow> 0 < a \<and> x \<bullet> x < a\<^sup>2" |
|
1421 by (metis not_le norm_ge_square) |
|
1422 |
|
1423 lemma norm_gt_square: "norm x > a \<longleftrightarrow> a < 0 \<or> x \<bullet> x > a\<^sup>2" |
|
1424 by (metis norm_le_square not_less) |
|
1425 |
|
1426 text\<open>Dot product in terms of the norm rather than conversely.\<close> |
|
1427 |
|
1428 lemmas inner_simps = inner_add_left inner_add_right inner_diff_right inner_diff_left |
|
1429 inner_scaleR_left inner_scaleR_right |
|
1430 |
|
1431 lemma dot_norm: "x \<bullet> y = ((norm (x + y))\<^sup>2 - (norm x)\<^sup>2 - (norm y)\<^sup>2) / 2" |
|
1432 by (simp only: power2_norm_eq_inner inner_simps inner_commute) auto |
|
1433 |
|
1434 lemma dot_norm_neg: "x \<bullet> y = (((norm x)\<^sup>2 + (norm y)\<^sup>2) - (norm (x - y))\<^sup>2) / 2" |
|
1435 by (simp only: power2_norm_eq_inner inner_simps inner_commute) |
|
1436 (auto simp add: algebra_simps) |
|
1437 |
1400 |
1438 text\<open>Equality of vectors in terms of @{term "op \<bullet>"} products.\<close> |
1401 text\<open>Equality of vectors in terms of @{term "op \<bullet>"} products.\<close> |
1439 |
1402 |
1440 lemma linear_componentwise: |
1403 lemma linear_componentwise: |
1441 fixes f:: "'a::euclidean_space \<Rightarrow> 'b::real_inner" |
1404 fixes f:: "'a::euclidean_space \<Rightarrow> 'b::real_inner" |