equal
deleted
inserted
replaced
42 |
42 |
43 |
43 |
44 subsection {* Real vector spaces *} |
44 subsection {* Real vector spaces *} |
45 |
45 |
46 class scaleR = type + |
46 class scaleR = type + |
47 fixes scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a" |
47 fixes scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "\<^loc>*#" 75) |
48 |
48 begin |
49 notation |
|
50 scaleR (infixr "*#" 75) |
|
51 |
49 |
52 abbreviation |
50 abbreviation |
53 divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a::scaleR" (infixl "'/#" 70) where |
51 divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a" (infixl "\<^loc>'/#" 70) |
|
52 where |
|
53 "x \<^loc>/# r == scaleR (inverse r) x" |
|
54 |
|
55 end |
|
56 |
|
57 abbreviation |
|
58 divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a\<Colon>scaleR" (infixl "'/#" 70) |
|
59 where |
54 "x /# r == scaleR (inverse r) x" |
60 "x /# r == scaleR (inverse r) x" |
55 |
61 |
56 notation (xsymbols) |
62 notation (xsymbols) |
57 scaleR (infixr "*\<^sub>R" 75) and |
63 scaleR (infixr "*\<^sub>R" 75) and |
58 divideR (infixl "'/\<^sub>R" 70) |
64 divideR (infixl "'/\<^sub>R" 70) |
376 |
382 |
377 instance real :: norm |
383 instance real :: norm |
378 real_norm_def [simp]: "norm r \<equiv> \<bar>r\<bar>" .. |
384 real_norm_def [simp]: "norm r \<equiv> \<bar>r\<bar>" .. |
379 |
385 |
380 class sgn_div_norm = scaleR + norm + sgn + |
386 class sgn_div_norm = scaleR + norm + sgn + |
381 assumes sgn_div_norm: "sgn x = x /# norm x" |
387 assumes sgn_div_norm: "sgn x = x \<^loc>/# norm x" |
382 |
388 |
383 class real_normed_vector = real_vector + sgn_div_norm + |
389 class real_normed_vector = real_vector + sgn_div_norm + |
384 assumes norm_ge_zero [simp]: "0 \<le> norm x" |
390 assumes norm_ge_zero [simp]: "0 \<le> norm x" |
385 and norm_eq_zero [simp]: "norm x = 0 \<longleftrightarrow> x = \<^loc>0" |
391 and norm_eq_zero [simp]: "norm x = 0 \<longleftrightarrow> x = \<^loc>0" |
386 and norm_triangle_ineq: "norm (x \<^loc>+ y) \<le> norm x + norm y" |
392 and norm_triangle_ineq: "norm (x \<^loc>+ y) \<le> norm x + norm y" |