src/HOL/Real/HahnBanach/Linearform.thy
author wenzelm
Mon Feb 07 18:38:51 2000 +0100 (2000-02-07)
changeset 8203 2fcc6017cb72
parent 7978 1b99ee57d131
child 8703 816d8f6513be
permissions -rw-r--r--
intro/elim/dest attributes: changed ! / !! flags to ? / ??;
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@7808
     6
header {* Linearforms *};
wenzelm@7535
     7
wenzelm@7917
     8
theory Linearform = VectorSpace:;
wenzelm@7917
     9
wenzelm@7978
    10
text{* A \emph{linear form} is a function on a vector
wenzelm@7978
    11
space into the reals that is additive and multiplicative. *};
wenzelm@7535
    12
wenzelm@7535
    13
constdefs
wenzelm@7917
    14
  is_linearform :: "['a::{minus, plus} set, 'a => real] => bool" 
wenzelm@7535
    15
  "is_linearform V f == 
wenzelm@7917
    16
      (ALL x: V. ALL y: V. f (x + y) = f x + f y) &
wenzelm@7917
    17
      (ALL x: V. ALL a. f (a <*> x) = a * (f x))"; 
wenzelm@7535
    18
wenzelm@7808
    19
lemma is_linearformI [intro]: 
wenzelm@7917
    20
  "[| !! x y. [| x : V; y : V |] ==> f (x + y) = f x + f y;
wenzelm@7917
    21
    !! x c. x : V ==> f (c <*> x) = c * f x |]
wenzelm@7535
    22
 ==> is_linearform V f";
wenzelm@7566
    23
 by (unfold is_linearform_def) force;
wenzelm@7535
    24
wenzelm@8203
    25
lemma linearform_add [intro??]: 
wenzelm@7917
    26
  "[| is_linearform V f; x:V; y:V |] ==> f (x + y) = f x + f y";
wenzelm@7917
    27
  by (unfold is_linearform_def) fast;
wenzelm@7535
    28
wenzelm@8203
    29
lemma linearform_mult [intro??]: 
wenzelm@7917
    30
  "[| is_linearform V f; x:V |] ==>  f (a <*> x) = a * (f x)"; 
wenzelm@7917
    31
  by (unfold is_linearform_def) fast;
wenzelm@7535
    32
wenzelm@8203
    33
lemma linearform_neg [intro??]:
wenzelm@7917
    34
  "[|  is_vectorspace V; is_linearform V f; x:V|] 
wenzelm@7917
    35
  ==> f (- x) = - f x";
wenzelm@7535
    36
proof -; 
wenzelm@7535
    37
  assume "is_linearform V f" "is_vectorspace V" "x:V"; 
wenzelm@7917
    38
  have "f (- x) = f ((- 1r) <*> x)"; by (simp! add: negate_eq1);
wenzelm@7978
    39
  also; have "... = (- 1r) * (f x)"; by (rule linearform_mult);
wenzelm@7566
    40
  also; have "... = - (f x)"; by (simp!);
wenzelm@7535
    41
  finally; show ?thesis; .;
wenzelm@7535
    42
qed;
wenzelm@7535
    43
wenzelm@8203
    44
lemma linearform_diff [intro??]: 
wenzelm@7808
    45
  "[| is_vectorspace V; is_linearform V f; x:V; y:V |] 
wenzelm@7917
    46
  ==> f (x - y) = f x - f y";  
wenzelm@7535
    47
proof -;
wenzelm@7535
    48
  assume "is_vectorspace V" "is_linearform V f" "x:V" "y:V";
wenzelm@7917
    49
  have "f (x - y) = f (x + - y)"; by (simp! only: diff_eq1);
wenzelm@7917
    50
  also; have "... = f x + f (- y)"; 
wenzelm@7978
    51
    by (rule linearform_add) (simp!)+;
wenzelm@7978
    52
  also; have "f (- y) = - f y"; by (rule linearform_neg);
wenzelm@7917
    53
  finally; show "f (x - y) = f x - f y"; by (simp!);
wenzelm@7535
    54
qed;
wenzelm@7535
    55
wenzelm@7978
    56
text{* Every linear form yields $0$ for the $\zero$ vector.*};
wenzelm@7917
    57
wenzelm@8203
    58
lemma linearform_zero [intro??, simp]: 
wenzelm@7808
    59
  "[| is_vectorspace V; is_linearform V f |] ==> f <0> = 0r"; 
wenzelm@7535
    60
proof -; 
wenzelm@7535
    61
  assume "is_vectorspace V" "is_linearform V f";
wenzelm@7917
    62
  have "f <0> = f (<0> - <0>)"; by (simp!);
wenzelm@7808
    63
  also; have "... = f <0> - f <0>"; 
wenzelm@7978
    64
    by (rule linearform_diff) (simp!)+;
wenzelm@7535
    65
  also; have "... = 0r"; by simp;
wenzelm@7535
    66
  finally; show "f <0> = 0r"; .;
wenzelm@7535
    67
qed; 
wenzelm@7535
    68
wenzelm@7808
    69
end;