equal
deleted
inserted
replaced
1640 |
1640 |
1641 subsection{* Linear functions. *} |
1641 subsection{* Linear functions. *} |
1642 |
1642 |
1643 definition "linear f \<longleftrightarrow> (\<forall>x y. f(x + y) = f x + f y) \<and> (\<forall>c x. f(c *s x) = c *s f x)" |
1643 definition "linear f \<longleftrightarrow> (\<forall>x y. f(x + y) = f x + f y) \<and> (\<forall>c x. f(c *s x) = c *s f x)" |
1644 |
1644 |
|
1645 lemma linearI: assumes "\<And>x y. f (x + y) = f x + f y" "\<And>c x. f (c *s x) = c *s f x" |
|
1646 shows "linear f" using assms unfolding linear_def by auto |
|
1647 |
1645 lemma linear_compose_cmul: "linear f ==> linear (\<lambda>x. (c::'a::comm_semiring) *s f x)" |
1648 lemma linear_compose_cmul: "linear f ==> linear (\<lambda>x. (c::'a::comm_semiring) *s f x)" |
1646 by (vector linear_def Cart_eq ring_simps) |
1649 by (vector linear_def Cart_eq ring_simps) |
1647 |
1650 |
1648 lemma linear_compose_neg: "linear (f :: 'a ^'n \<Rightarrow> 'a::comm_ring ^'m) ==> linear (\<lambda>x. -(f(x)))" by (vector linear_def Cart_eq) |
1651 lemma linear_compose_neg: "linear (f :: 'a ^'n \<Rightarrow> 'a::comm_ring ^'m) ==> linear (\<lambda>x. -(f(x)))" by (vector linear_def Cart_eq) |
1649 |
1652 |
1809 then interpret f: bounded_linear f . |
1812 then interpret f: bounded_linear f . |
1810 show "linear f" |
1813 show "linear f" |
1811 unfolding linear_def smult_conv_scaleR |
1814 unfolding linear_def smult_conv_scaleR |
1812 by (simp add: f.add f.scaleR) |
1815 by (simp add: f.add f.scaleR) |
1813 qed |
1816 qed |
|
1817 |
|
1818 lemma bounded_linearI': fixes f::"real^'n::finite \<Rightarrow> real^'m::finite" |
|
1819 assumes "\<And>x y. f (x + y) = f x + f y" "\<And>c x. f (c *s x) = c *s f x" |
|
1820 shows "bounded_linear f" unfolding linear_conv_bounded_linear[THEN sym] |
|
1821 by(rule linearI[OF assms]) |
1814 |
1822 |
1815 subsection{* Bilinear functions. *} |
1823 subsection{* Bilinear functions. *} |
1816 |
1824 |
1817 definition "bilinear f \<longleftrightarrow> (\<forall>x. linear(\<lambda>y. f x y)) \<and> (\<forall>y. linear(\<lambda>x. f x y))" |
1825 definition "bilinear f \<longleftrightarrow> (\<forall>x. linear(\<lambda>y. f x y)) \<and> (\<forall>y. linear(\<lambda>x. f x y))" |
1818 |
1826 |
2468 lemma vec1_add: "vec1(x + y) = vec1 x + vec1 y" by (vector vec1_def) |
2476 lemma vec1_add: "vec1(x + y) = vec1 x + vec1 y" by (vector vec1_def) |
2469 lemma vec1_sub: "vec1(x - y) = vec1 x - vec1 y" by (vector vec1_def) |
2477 lemma vec1_sub: "vec1(x - y) = vec1 x - vec1 y" by (vector vec1_def) |
2470 lemma vec1_cmul: "vec1(c* x) = c *s vec1 x " by (vector vec1_def) |
2478 lemma vec1_cmul: "vec1(c* x) = c *s vec1 x " by (vector vec1_def) |
2471 lemma vec1_neg: "vec1(- x) = - vec1 x " by (vector vec1_def) |
2479 lemma vec1_neg: "vec1(- x) = - vec1 x " by (vector vec1_def) |
2472 |
2480 |
|
2481 lemma vec1_0[simp]:"vec1 0 = 0" unfolding vec1_def Cart_eq by auto |
|
2482 |
|
2483 lemma range_vec1[simp]:"range vec1 = UNIV" apply(rule set_ext,rule) unfolding image_iff defer |
|
2484 apply(rule_tac x="dest_vec1 x" in bexI) by auto |
|
2485 |
2473 lemma vec1_setsum: assumes fS: "finite S" |
2486 lemma vec1_setsum: assumes fS: "finite S" |
2474 shows "vec1(setsum f S) = setsum (vec1 o f) S" |
2487 shows "vec1(setsum f S) = setsum (vec1 o f) S" |
2475 apply (induct rule: finite_induct[OF fS]) |
2488 apply (induct rule: finite_induct[OF fS]) |
2476 apply (simp add: vec1_vec) |
2489 apply (simp add: vec1_vec) |
2477 apply (auto simp add: vec1_add) |
2490 apply (auto simp add: vec1_add) |
2509 |
2522 |
2510 lemma dist_vec1: "dist(vec1 x) (vec1 y) = abs(x - y)" |
2523 lemma dist_vec1: "dist(vec1 x) (vec1 y) = abs(x - y)" |
2511 by (simp only: dist_real vec1_component) |
2524 by (simp only: dist_real vec1_component) |
2512 lemma abs_dest_vec1: "norm x = \<bar>dest_vec1 x\<bar>" |
2525 lemma abs_dest_vec1: "norm x = \<bar>dest_vec1 x\<bar>" |
2513 by (metis vec1_dest_vec1 norm_vec1) |
2526 by (metis vec1_dest_vec1 norm_vec1) |
|
2527 |
|
2528 lemmas vec1_dest_vec1_simps = forall_vec1 vec1_add[THEN sym] dist_vec1 vec1_sub[THEN sym] vec1_dest_vec1 norm_vec1 dest_vec1_cmul |
|
2529 vec1_eq vec1_cmul[THEN sym] smult_conv_scaleR[THEN sym] o_def dist_real_def norm_vec1 real_norm_def |
|
2530 |
|
2531 lemma bounded_linear_vec1:"bounded_linear (vec1::real\<Rightarrow>real^1)" |
|
2532 unfolding bounded_linear_def additive_def bounded_linear_axioms_def |
|
2533 unfolding smult_conv_scaleR[THEN sym] unfolding vec1_dest_vec1_simps |
|
2534 apply(rule conjI) defer apply(rule conjI) defer apply(rule_tac x=1 in exI) by auto |
2514 |
2535 |
2515 lemma linear_vmul_dest_vec1: |
2536 lemma linear_vmul_dest_vec1: |
2516 fixes f:: "'a::semiring_1^'n \<Rightarrow> 'a^1" |
2537 fixes f:: "'a::semiring_1^'n \<Rightarrow> 'a^1" |
2517 shows "linear f \<Longrightarrow> linear (\<lambda>x. dest_vec1(f x) *s v)" |
2538 shows "linear f \<Longrightarrow> linear (\<lambda>x. dest_vec1(f x) *s v)" |
2518 unfolding dest_vec1_def |
2539 unfolding dest_vec1_def |