src/HOL/Real/RealVector.thy
author huffman
Thu, 14 Sep 2006 03:25:17 +0200
changeset 20533 49442b3024bb
parent 20504 6342e872e71d
child 20551 ba543692bfa1
permissions -rw-r--r--
remove conflicting norm syntax
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     1
(*  Title       : RealVector.thy
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     2
    ID:         $Id$
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     3
    Author      : Brian Huffman
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     4
*)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     5
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     6
header {* Vector Spaces and Algebras over the Reals *}
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     7
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     8
theory RealVector
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
     9
imports RealDef
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    10
begin
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    11
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    12
subsection {* Locale for additive functions *}
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    13
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    14
locale additive =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    15
  fixes f :: "'a::ab_group_add \<Rightarrow> 'b::ab_group_add"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    16
  assumes add: "f (x + y) = f x + f y"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    17
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    18
lemma (in additive) zero: "f 0 = 0"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    19
proof -
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    20
  have "f 0 = f (0 + 0)" by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    21
  also have "\<dots> = f 0 + f 0" by (rule add)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    22
  finally show "f 0 = 0" by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    23
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    24
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    25
lemma (in additive) minus: "f (- x) = - f x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    26
proof -
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    27
  have "f (- x) + f x = f (- x + x)" by (rule add [symmetric])
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    28
  also have "\<dots> = - f x + f x" by (simp add: zero)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    29
  finally show "f (- x) = - f x" by (rule add_right_imp_eq)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    30
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    31
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    32
lemma (in additive) diff: "f (x - y) = f x - f y"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    33
by (simp add: diff_def add minus)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    34
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    35
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    36
subsection {* Real vector spaces *}
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    37
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    38
axclass scaleR < type
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    39
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    40
consts
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    41
  scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a::scaleR" (infixr "*#" 75)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    42
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    43
syntax (xsymbols)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    44
  scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a::scaleR" (infixr "*\<^sub>R" 75)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    45
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    46
axclass real_vector < scaleR, ab_group_add
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    47
  scaleR_right_distrib: "a *# (x + y) = a *# x + a *# y"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    48
  scaleR_left_distrib: "(a + b) *# x = a *# x + b *# x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    49
  scaleR_assoc: "(a * b) *# x = a *# b *# x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    50
  scaleR_one [simp]: "1 *# x = x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    51
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    52
axclass real_algebra < real_vector, ring
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    53
  mult_scaleR_left: "a *# x * y = a *# (x * y)"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    54
  mult_scaleR_right: "x * a *# y = a *# (x * y)"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    55
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    56
lemmas scaleR_scaleR = scaleR_assoc [symmetric]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    57
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    58
lemma scaleR_left_commute:
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    59
  fixes x :: "'a::real_vector"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    60
  shows "a *# b *# x = b *# a *# x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    61
by (simp add: scaleR_scaleR mult_commute)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    62
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    63
lemma additive_scaleR_right: "additive (\<lambda>x. a *# x :: 'a::real_vector)"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    64
by (rule additive.intro, rule scaleR_right_distrib)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    65
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    66
lemma additive_scaleR_left: "additive (\<lambda>a. a *# x :: 'a::real_vector)"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    67
by (rule additive.intro, rule scaleR_left_distrib)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    68
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    69
lemmas scaleR_zero_left [simp] =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    70
  additive.zero [OF additive_scaleR_left, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    71
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    72
lemmas scaleR_zero_right [simp] =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    73
  additive.zero [OF additive_scaleR_right, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    74
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    75
lemmas scaleR_minus_left [simp] =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    76
  additive.minus [OF additive_scaleR_left, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    77
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    78
lemmas scaleR_minus_right [simp] =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    79
  additive.minus [OF additive_scaleR_right, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    80
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    81
lemmas scaleR_left_diff_distrib =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    82
  additive.diff [OF additive_scaleR_left, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    83
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    84
lemmas scaleR_right_diff_distrib =
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    85
  additive.diff [OF additive_scaleR_right, standard]
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    86
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    87
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    88
subsection {* Real normed vector spaces *}
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    89
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    90
axclass norm < type
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
    91
consts norm :: "'a::norm \<Rightarrow> real"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    92
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    93
axclass real_normed_vector < real_vector, norm
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
    94
  norm_ge_zero [simp]: "0 \<le> norm x"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
    95
  norm_eq_zero [simp]: "(norm x = 0) = (x = 0)"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
    96
  norm_triangle_ineq: "norm (x + y) \<le> norm x + norm y"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
    97
  norm_scaleR: "norm (a *# x) = \<bar>a\<bar> * norm x"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    98
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
    99
axclass real_normed_algebra < real_normed_vector, real_algebra
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   100
  norm_mult_ineq: "norm (x * y) \<le> norm x * norm y"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   101
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   102
axclass real_normed_div_algebra
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   103
          < real_normed_vector, real_algebra, division_ring
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   104
  norm_mult: "norm (x * y) = norm x * norm y"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   105
  norm_one [simp]: "norm 1 = 1"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   106
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   107
instance real_normed_div_algebra < real_normed_algebra
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   108
by (intro_classes, simp add: norm_mult)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   109
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   110
lemma norm_zero [simp]: "norm (0::'a::real_normed_vector) = 0"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   111
by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   112
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   113
lemma zero_less_norm_iff [simp]:
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   114
  fixes x :: "'a::real_normed_vector" shows "(0 < norm x) = (x \<noteq> 0)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   115
by (simp add: order_less_le)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   116
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   117
lemma norm_minus_cancel [simp]:
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   118
  fixes x :: "'a::real_normed_vector" shows "norm (- x) = norm x"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   119
proof -
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   120
  have "norm (- x) = norm (- 1 *# x)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   121
    by (simp only: scaleR_minus_left scaleR_one)
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   122
  also have "\<dots> = \<bar>- 1\<bar> * norm x"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   123
    by (rule norm_scaleR)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   124
  finally show ?thesis by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   125
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   126
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   127
lemma norm_minus_commute:
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   128
  fixes a b :: "'a::real_normed_vector" shows "norm (a - b) = norm (b - a)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   129
proof -
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   130
  have "norm (a - b) = norm (- (a - b))"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   131
    by (simp only: norm_minus_cancel)
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   132
  also have "\<dots> = norm (b - a)" by simp
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   133
  finally show ?thesis .
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   134
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   135
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   136
lemma norm_triangle_ineq2:
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   137
  fixes a :: "'a::real_normed_vector"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   138
  shows "norm a - norm b \<le> norm (a - b)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   139
proof -
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   140
  have "norm (a - b + b) \<le> norm (a - b) + norm b"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   141
    by (rule norm_triangle_ineq)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   142
  also have "(a - b + b) = a"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   143
    by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   144
  finally show ?thesis
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   145
    by (simp add: compare_rls)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   146
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   147
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   148
lemma norm_triangle_ineq4:
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   149
  fixes a :: "'a::real_normed_vector"
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   150
  shows "norm (a - b) \<le> norm a + norm b"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   151
proof -
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   152
  have "norm (a - b) = norm (a + - b)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   153
    by (simp only: diff_minus)
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   154
  also have "\<dots> \<le> norm a + norm (- b)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   155
    by (rule norm_triangle_ineq)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   156
  finally show ?thesis
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   157
    by simp
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   158
qed
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   159
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   160
lemma nonzero_norm_inverse:
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   161
  fixes a :: "'a::real_normed_div_algebra"
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   162
  shows "a \<noteq> 0 \<Longrightarrow> norm (inverse a) = inverse (norm a)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   163
apply (rule inverse_unique [symmetric])
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   164
apply (simp add: norm_mult [symmetric])
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   165
done
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   166
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   167
lemma norm_inverse:
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   168
  fixes a :: "'a::{real_normed_div_algebra,division_by_zero}"
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   169
  shows "norm (inverse a) = inverse (norm a)"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   170
apply (case_tac "a = 0", simp)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   171
apply (erule nonzero_norm_inverse)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   172
done
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   173
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   174
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   175
subsection {* Instances for type @{typ real} *}
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   176
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   177
instance real :: scaleR ..
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   178
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   179
defs (overloaded)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   180
  real_scaleR_def: "a *# x \<equiv> a * x"
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   181
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   182
instance real :: real_algebra
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   183
apply (intro_classes, unfold real_scaleR_def)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   184
apply (rule right_distrib)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   185
apply (rule left_distrib)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   186
apply (rule mult_assoc)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   187
apply (rule mult_1_left)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   188
apply (rule mult_assoc)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   189
apply (rule mult_left_commute)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   190
done
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   191
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   192
instance real :: norm ..
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   193
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   194
defs (overloaded)
20533
49442b3024bb remove conflicting norm syntax
huffman
parents: 20504
diff changeset
   195
  real_norm_def: "norm r \<equiv> \<bar>r\<bar>"
20504
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   196
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   197
instance real :: real_normed_div_algebra
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   198
apply (intro_classes, unfold real_norm_def real_scaleR_def)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   199
apply (rule abs_ge_zero)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   200
apply (rule abs_eq_0)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   201
apply (rule abs_triangle_ineq)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   202
apply (rule abs_mult)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   203
apply (rule abs_mult)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   204
apply (rule abs_one)
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   205
done
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   206
6342e872e71d formalization of vector spaces and algebras over the real numbers
huffman
parents:
diff changeset
   207
end