src/HOL/Real/HahnBanach/Linearform.thy
author wenzelm
Tue Jul 15 19:39:37 2008 +0200 (2008-07-15)
changeset 27612 d3eb431db035
parent 27611 2c01c0bdb385
child 29234 60f7fb56f8cd
permissions -rw-r--r--
modernized specifications and proofs;
tuned document;
wenzelm@7566
     1
(*  Title:      HOL/Real/HahnBanach/Linearform.thy
wenzelm@7566
     2
    ID:         $Id$
wenzelm@7566
     3
    Author:     Gertrud Bauer, TU Munich
wenzelm@7566
     4
*)
wenzelm@7535
     5
wenzelm@9035
     6
header {* Linearforms *}
wenzelm@7535
     7
wenzelm@27612
     8
theory Linearform
wenzelm@27612
     9
imports VectorSpace
wenzelm@27612
    10
begin
wenzelm@7917
    11
wenzelm@10687
    12
text {*
wenzelm@10687
    13
  A \emph{linear form} is a function on a vector space into the reals
wenzelm@10687
    14
  that is additive and multiplicative.
wenzelm@10687
    15
*}
wenzelm@7535
    16
wenzelm@13515
    17
locale linearform = var V + var f +
haftmann@25762
    18
  constrains V :: "'a\<Colon>{minus, plus, zero, uminus} set"
wenzelm@13515
    19
  assumes add [iff]: "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> f (x + y) = f x + f y"
wenzelm@13515
    20
    and mult [iff]: "x \<in> V \<Longrightarrow> f (a \<cdot> x) = a * f x"
wenzelm@7535
    21
ballarin@14254
    22
declare linearform.intro [intro?]
ballarin@14254
    23
wenzelm@13547
    24
lemma (in linearform) neg [iff]:
ballarin@27611
    25
  assumes "vectorspace V"
wenzelm@13547
    26
  shows "x \<in> V \<Longrightarrow> f (- x) = - f x"
wenzelm@10687
    27
proof -
ballarin@27611
    28
  interpret vectorspace [V] by fact
wenzelm@13515
    29
  assume x: "x \<in> V"
wenzelm@27612
    30
  then have "f (- x) = f ((- 1) \<cdot> x)" by (simp add: negate_eq1)
wenzelm@27612
    31
  also from x have "\<dots> = (- 1) * (f x)" by (rule mult)
wenzelm@27612
    32
  also from x have "\<dots> = - (f x)" by simp
wenzelm@9035
    33
  finally show ?thesis .
wenzelm@9035
    34
qed
wenzelm@7535
    35
wenzelm@13547
    36
lemma (in linearform) diff [iff]:
ballarin@27611
    37
  assumes "vectorspace V"
wenzelm@13547
    38
  shows "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> f (x - y) = f x - f y"
wenzelm@9035
    39
proof -
ballarin@27611
    40
  interpret vectorspace [V] by fact
wenzelm@13515
    41
  assume x: "x \<in> V" and y: "y \<in> V"
wenzelm@27612
    42
  then have "x - y = x + - y" by (rule diff_eq1)
wenzelm@27612
    43
  also have "f \<dots> = f x + f (- y)" by (rule add) (simp_all add: x y)
wenzelm@23378
    44
  also have "f (- y) = - f y" using `vectorspace V` y by (rule neg)
wenzelm@13515
    45
  finally show ?thesis by simp
wenzelm@9035
    46
qed
wenzelm@7535
    47
wenzelm@10687
    48
text {* Every linear form yields @{text 0} for the @{text 0} vector. *}
wenzelm@7917
    49
wenzelm@13547
    50
lemma (in linearform) zero [iff]:
ballarin@27611
    51
  assumes "vectorspace V"
wenzelm@13547
    52
  shows "f 0 = 0"
wenzelm@10687
    53
proof -
ballarin@27611
    54
  interpret vectorspace [V] by fact
wenzelm@13515
    55
  have "f 0 = f (0 - 0)" by simp
wenzelm@23378
    56
  also have "\<dots> = f 0 - f 0" using `vectorspace V` by (rule diff) simp_all
wenzelm@13515
    57
  also have "\<dots> = 0" by simp
wenzelm@13515
    58
  finally show ?thesis .
wenzelm@10687
    59
qed
wenzelm@7535
    60
wenzelm@10687
    61
end