src/HOL/Complex/NSComplex.thy
author huffman
Fri, 13 Apr 2007 01:06:12 +0200
changeset 22655 83878e551c8c
parent 21864 2ecfd8985982
child 22860 107b54207dae
permissions -rw-r--r--
minimize imports
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     1
(*  Title:       NSComplex.thy
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14421
diff changeset
     2
    ID:      $Id$
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     3
    Author:      Jacques D. Fleuriot
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     4
    Copyright:   2001  University of Edinburgh
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14421
diff changeset
     5
    Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     6
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     7
14430
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14421
diff changeset
     8
header{*Nonstandard Complex Numbers*}
5cb24165a2e1 new material from Avigad, and simplified treatment of division by 0
paulson
parents: 14421
diff changeset
     9
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15085
diff changeset
    10
theory NSComplex
22655
83878e551c8c minimize imports
huffman
parents: 21864
diff changeset
    11
imports Complex "../Hyperreal/NSA"
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15085
diff changeset
    12
begin
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    13
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
    14
types hcomplex = "complex star"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    15
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    16
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    17
  hcomplex_of_complex :: "complex => complex star" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    18
  "hcomplex_of_complex == star_of"
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
    19
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    20
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    21
  hcmod :: "complex star => real star" where
20558
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
    22
  "hcmod == hnorm"
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
    23
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    24
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    25
  (*--- real and Imaginary parts ---*)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    26
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    27
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    28
  hRe :: "hcomplex => hypreal" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    29
  "hRe = *f* Re"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    30
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    31
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    32
  hIm :: "hcomplex => hypreal" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    33
  "hIm = *f* Im"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    34
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    35
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    36
  (*------ imaginary unit ----------*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    37
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    38
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    39
  iii :: hcomplex where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    40
  "iii = star_of ii"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    41
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    42
  (*------- complex conjugate ------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    43
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    44
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    45
  hcnj :: "hcomplex => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    46
  "hcnj = *f* cnj"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    47
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    48
  (*------------ Argand -------------*)
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    49
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    50
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    51
  hsgn :: "hcomplex => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    52
  "hsgn = *f* sgn"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    53
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    54
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    55
  harg :: "hcomplex => hypreal" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    56
  "harg = *f* arg"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    57
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    58
definition
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    59
  (* abbreviation for (cos a + i sin a) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    60
  hcis :: "hypreal => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    61
  "hcis = *f* cis"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    62
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    63
  (*----- injection from hyperreals -----*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    64
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    65
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    66
  hcomplex_of_hypreal :: "hypreal => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    67
  "hcomplex_of_hypreal = *f* complex_of_real"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    68
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    69
definition
14653
0848ab6fe5fc constdefs: proper order;
wenzelm
parents: 14641
diff changeset
    70
  (* abbreviation for r*(cos a + i sin a) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    71
  hrcis :: "[hypreal, hypreal] => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    72
  "hrcis = *f2* rcis"
14653
0848ab6fe5fc constdefs: proper order;
wenzelm
parents: 14641
diff changeset
    73
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    74
  (*------------ e ^ (x + iy) ------------*)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    75
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    76
  hexpi :: "hcomplex => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    77
  "hexpi = *f* expi"
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
    78
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    79
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    80
  HComplex :: "[hypreal,hypreal] => hcomplex" where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    81
  "HComplex = *f2* Complex"
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
    82
(*
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    83
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 20730
diff changeset
    84
  hcpow :: "[hcomplex,hypnat] => hcomplex"  (infixr "hcpow" 80) where
19765
dfe940911617 misc cleanup;
wenzelm
parents: 17429
diff changeset
    85
  "(z::hcomplex) hcpow (n::hypnat) = ( *f2* op ^) z n"
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
    86
*)
17332
4910cf8c0cd2 added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents: 17318
diff changeset
    87
lemmas hcomplex_defs [transfer_unfold] =
20558
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
    88
  hRe_def hIm_def iii_def hcnj_def hsgn_def harg_def hcis_def
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
    89
  hcomplex_of_hypreal_def hrcis_def hexpi_def HComplex_def
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
    90
21839
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    91
lemma Standard_hRe [simp]: "x \<in> Standard \<Longrightarrow> hRe x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    92
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    93
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    94
lemma Standard_hIm [simp]: "x \<in> Standard \<Longrightarrow> hIm x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    95
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    96
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    97
lemma Standard_iii [simp]: "iii \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    98
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
    99
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   100
lemma Standard_hcnj [simp]: "x \<in> Standard \<Longrightarrow> hcnj x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   101
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   102
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   103
lemma Standard_hsgn [simp]: "x \<in> Standard \<Longrightarrow> hsgn x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   104
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   105
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   106
lemma Standard_harg [simp]: "x \<in> Standard \<Longrightarrow> harg x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   107
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   108
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   109
lemma Standard_hcis [simp]: "r \<in> Standard \<Longrightarrow> hcis r \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   110
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   111
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   112
lemma Standard_hexpi [simp]: "x \<in> Standard \<Longrightarrow> hexpi x \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   113
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   114
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   115
lemma Standard_hrcis [simp]:
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   116
  "\<lbrakk>r \<in> Standard; s \<in> Standard\<rbrakk> \<Longrightarrow> hrcis r s \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   117
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   118
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   119
lemma Standard_HComplex [simp]:
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   120
  "\<lbrakk>r \<in> Standard; s \<in> Standard\<rbrakk> \<Longrightarrow> HComplex r s \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   121
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   122
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   123
lemma Standard_hcomplex_of_hypreal [simp]:
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   124
  "r \<in> Standard \<Longrightarrow> hcomplex_of_hypreal r \<in> Standard"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   125
by (simp add: hcomplex_defs)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   126
20558
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
   127
lemma hcmod_def: "hcmod = *f* cmod"
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
   128
by (rule hnorm_def)
759c8f2ead69 hcmod abbreviates hnorm :: hcomplex => hypreal
huffman
parents: 20485
diff changeset
   129
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   130
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   131
subsection{*Properties of Nonstandard Real and Imaginary Parts*}
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   132
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   133
lemma hcomplex_hRe_hIm_cancel_iff:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   134
     "!!w z. (w=z) = (hRe(w) = hRe(z) & hIm(w) = hIm(z))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   135
by transfer (rule complex_Re_Im_cancel_iff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   136
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   137
lemma hcomplex_equality [intro?]:
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   138
  "!!z w. hRe z = hRe w ==> hIm z = hIm w ==> z = w"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   139
by transfer (rule complex_equality)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   140
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   141
lemma hcomplex_hRe_zero [simp]: "hRe 0 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   142
by transfer (rule complex_Re_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   143
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   144
lemma hcomplex_hIm_zero [simp]: "hIm 0 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   145
by transfer (rule complex_Im_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   146
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   147
lemma hcomplex_hRe_one [simp]: "hRe 1 = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   148
by transfer (rule complex_Re_one)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   149
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   150
lemma hcomplex_hIm_one [simp]: "hIm 1 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   151
by transfer (rule complex_Im_one)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   152
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   153
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   154
subsection{*Addition for Nonstandard Complex Numbers*}
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   155
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   156
lemma hRe_add: "!!x y. hRe(x + y) = hRe(x) + hRe(y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   157
by transfer (rule complex_Re_add)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   158
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   159
lemma hIm_add: "!!x y. hIm(x + y) = hIm(x) + hIm(y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   160
by transfer (rule complex_Im_add)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   161
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   162
subsection{*More Minus Laws*}
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   163
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   164
lemma hRe_minus: "!!z. hRe(-z) = - hRe(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   165
by transfer (rule complex_Re_minus)
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   166
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   167
lemma hIm_minus: "!!z. hIm(-z) = - hIm(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   168
by transfer (rule complex_Im_minus)
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   169
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   170
lemma hcomplex_add_minus_eq_minus:
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   171
      "x + y = (0::hcomplex) ==> x = -y"
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents: 14691
diff changeset
   172
apply (drule OrderedGroup.equals_zero_I)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   173
apply (simp add: minus_equation_iff [of x y])
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   174
done
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   175
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   176
lemma hcomplex_i_mult_eq [simp]: "iii * iii = - 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   177
by transfer (rule i_mult_eq2)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   178
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   179
lemma hcomplex_i_mult_left [simp]: "!!z. iii * (iii * z) = -z"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   180
by transfer (rule complex_i_mult_minus)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   181
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   182
lemma hcomplex_i_not_zero [simp]: "iii \<noteq> 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   183
by transfer (rule complex_i_not_zero)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   184
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   185
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   186
subsection{*More Multiplication Laws*}
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   187
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   188
lemma hcomplex_mult_minus_one: "- 1 * (z::hcomplex) = -z"
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   189
by simp
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   190
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   191
lemma hcomplex_mult_minus_one_right: "(z::hcomplex) * - 1 = -z"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   192
by simp
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   193
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   194
lemma hcomplex_mult_left_cancel:
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   195
     "(c::hcomplex) \<noteq> (0::hcomplex) ==> (c*a=c*b) = (a=b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   196
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   197
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   198
lemma hcomplex_mult_right_cancel:
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   199
     "(c::hcomplex) \<noteq> (0::hcomplex) ==> (a*c=b*c) = (a=b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   200
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   201
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   202
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   203
subsection{*Subraction and Division*}
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   204
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   205
lemma hcomplex_diff_eq_eq [simp]: "((x::hcomplex) - y = z) = (x = z + y)"
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents: 14691
diff changeset
   206
by (rule OrderedGroup.diff_eq_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   207
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   208
lemma hcomplex_add_divide_distrib: "(x+y)/(z::hcomplex) = x/z + y/z"
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   209
by (rule Ring_and_Field.add_divide_distrib)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   210
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   211
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   212
subsection{*Embedding Properties for @{term hcomplex_of_hypreal} Map*}
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   213
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   214
lemma hcomplex_of_hypreal_cancel_iff [iff]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   215
     "!!x y. (hcomplex_of_hypreal x = hcomplex_of_hypreal y) = (x = y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   216
by transfer (rule of_real_eq_iff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   217
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   218
lemma hcomplex_of_hypreal_one [simp]: "hcomplex_of_hypreal 1 = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   219
by transfer (rule of_real_1)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   220
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   221
lemma hcomplex_of_hypreal_zero [simp]: "hcomplex_of_hypreal 0 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   222
by transfer (rule of_real_0)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   223
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   224
lemma hcomplex_of_hypreal_minus [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   225
     "!!x. hcomplex_of_hypreal(-x) = - hcomplex_of_hypreal x"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   226
by transfer (rule of_real_minus)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   227
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   228
lemma hcomplex_of_hypreal_inverse [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   229
     "!!x. hcomplex_of_hypreal(inverse x) = inverse(hcomplex_of_hypreal x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   230
by transfer (rule of_real_inverse)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   231
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   232
lemma hcomplex_of_hypreal_add [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   233
     "!!x y. hcomplex_of_hypreal (x + y) =
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   234
      hcomplex_of_hypreal x + hcomplex_of_hypreal y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   235
by transfer (rule of_real_add)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   236
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   237
lemma hcomplex_of_hypreal_diff [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   238
     "!!x y. hcomplex_of_hypreal (x - y) =
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   239
      hcomplex_of_hypreal x - hcomplex_of_hypreal y "
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   240
by transfer (rule of_real_diff)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   241
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   242
lemma hcomplex_of_hypreal_mult [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   243
     "!!x y. hcomplex_of_hypreal (x * y) =
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   244
      hcomplex_of_hypreal x * hcomplex_of_hypreal y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   245
by transfer (rule of_real_mult)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   246
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   247
lemma hcomplex_of_hypreal_divide [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   248
     "!!x y. hcomplex_of_hypreal(x/y) =
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   249
      hcomplex_of_hypreal x / hcomplex_of_hypreal y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   250
by transfer (rule of_real_divide)
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   251
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   252
lemma hRe_hcomplex_of_hypreal [simp]: "!!z. hRe(hcomplex_of_hypreal z) = z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   253
by transfer (rule Re_complex_of_real)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   254
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   255
lemma hIm_hcomplex_of_hypreal [simp]: "!!z. hIm(hcomplex_of_hypreal z) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   256
by transfer (rule Im_complex_of_real)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   257
21839
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   258
lemma hcomplex_of_hypreal_zero_iff [simp]:
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   259
  "\<And>x. (hcomplex_of_hypreal x = 0) = (x = 0)"
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   260
by transfer (rule of_real_eq_0_iff)
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   261
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   262
lemma hcomplex_of_hypreal_epsilon_not_zero [simp]:
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   263
     "hcomplex_of_hypreal epsilon \<noteq> 0"
21839
54018ed3b99d added lemmas about hRe, hIm, HComplex; removed all uses of star_n
huffman
parents: 21404
diff changeset
   264
by (simp add: hypreal_epsilon_not_zero)
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   265
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   266
subsection{*HComplex theorems*}
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   267
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   268
lemma hRe_HComplex [simp]: "!!x y. hRe (HComplex x y) = x"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   269
by transfer (rule Re)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   270
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   271
lemma hIm_HComplex [simp]: "!!x y. hIm (HComplex x y) = y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   272
by transfer (rule Im)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   273
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   274
lemma hcomplex_surj [simp]: "!!z. HComplex (hRe z) (hIm z) = z"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   275
by transfer (rule complex_surj)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   276
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   277
lemma hcomplex_induct [case_names rect(*, induct type: hcomplex*)]:
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   278
     "(\<And>x y. P (HComplex x y)) ==> P z"
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   279
by (rule hcomplex_surj [THEN subst], blast)
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   280
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   281
14318
7dbd3988b15b type hcomplex is now in class field
paulson
parents: 14314
diff changeset
   282
subsection{*Modulus (Absolute Value) of Nonstandard Complex Number*}
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   283
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   284
lemma hcmod_zero [simp]: "hcmod(0) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   285
by (rule hnorm_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   286
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   287
lemma hcmod_one [simp]: "hcmod(1) = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   288
by (rule hnorm_one)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   289
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   290
lemma hcmod_hcomplex_of_hypreal [simp]:
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   291
  "!!x. hcmod(hcomplex_of_hypreal x) = abs x"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   292
by transfer (rule norm_of_real)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   293
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   294
lemma hcomplex_of_hypreal_abs:
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   295
     "hcomplex_of_hypreal (abs x) =
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   296
      hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))"
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   297
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   298
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   299
lemma HComplex_inject [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   300
  "!!x y x' y'. HComplex x y = HComplex x' y' = (x=x' & y=y')"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   301
by transfer (rule complex.inject)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   302
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   303
lemma HComplex_add [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   304
  "!!x1 y1 x2 y2. HComplex x1 y1 + HComplex x2 y2 = HComplex (x1+x2) (y1+y2)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   305
by transfer (rule complex_add)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   306
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   307
lemma HComplex_minus [simp]: "!!x y. - HComplex x y = HComplex (-x) (-y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   308
by transfer (rule complex_minus)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   309
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   310
lemma HComplex_diff [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   311
  "!!x1 y1 x2 y2. HComplex x1 y1 - HComplex x2 y2 = HComplex (x1-x2) (y1-y2)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   312
by transfer (rule complex_diff)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   313
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   314
lemma HComplex_mult [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   315
  "!!x1 y1 x2 y2. HComplex x1 y1 * HComplex x2 y2 =
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   316
   HComplex (x1*x2 - y1*y2) (x1*y2 + y1*x2)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   317
by transfer (rule complex_mult)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   318
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   319
(*HComplex_inverse is proved below*)
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   320
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   321
lemma hcomplex_of_hypreal_eq: "!!r. hcomplex_of_hypreal r = HComplex r 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   322
by transfer (rule complex_of_real_def)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   323
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   324
lemma HComplex_add_hcomplex_of_hypreal [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   325
     "!!x y r. HComplex x y + hcomplex_of_hypreal r = HComplex (x+r) y"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   326
by transfer (rule Complex_add_complex_of_real)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   327
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   328
lemma hcomplex_of_hypreal_add_HComplex [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   329
     "!!r x y. hcomplex_of_hypreal r + HComplex x y = HComplex (r+x) y"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   330
by transfer (rule complex_of_real_add_Complex)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   331
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   332
lemma HComplex_mult_hcomplex_of_hypreal:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   333
     "!!x y r. HComplex x y * hcomplex_of_hypreal r = HComplex (x*r) (y*r)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   334
by transfer (rule Complex_mult_complex_of_real)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   335
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   336
lemma hcomplex_of_hypreal_mult_HComplex:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   337
     "!!r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r*x) (r*y)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   338
by transfer (rule complex_of_real_mult_Complex)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   339
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   340
lemma i_hcomplex_of_hypreal [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   341
     "!!r. iii * hcomplex_of_hypreal r = HComplex 0 r"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   342
by transfer (rule i_complex_of_real)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   343
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   344
lemma hcomplex_of_hypreal_i [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   345
     "!!r. hcomplex_of_hypreal r * iii = HComplex 0 r"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   346
by transfer (rule complex_of_real_i)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   347
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   348
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   349
subsection{*Conjugation*}
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   350
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   351
lemma hcomplex_hcnj_cancel_iff [iff]: "!!x y. (hcnj x = hcnj y) = (x = y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   352
by transfer (rule complex_cnj_cancel_iff)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   353
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   354
lemma hcomplex_hcnj_hcnj [simp]: "!!z. hcnj (hcnj z) = z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   355
by transfer (rule complex_cnj_cnj)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   356
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   357
lemma hcomplex_hcnj_hcomplex_of_hypreal [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   358
     "!!x. hcnj (hcomplex_of_hypreal x) = hcomplex_of_hypreal x"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   359
by transfer (rule complex_cnj_complex_of_real)
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   360
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   361
lemma hcomplex_hmod_hcnj [simp]: "!!z. hcmod (hcnj z) = hcmod z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   362
by transfer (rule complex_mod_cnj)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   363
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   364
lemma hcomplex_hcnj_minus: "!!z. hcnj (-z) = - hcnj z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   365
by transfer (rule complex_cnj_minus)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   366
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   367
lemma hcomplex_hcnj_inverse: "!!z. hcnj(inverse z) = inverse(hcnj z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   368
by transfer (rule complex_cnj_inverse)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   369
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   370
lemma hcomplex_hcnj_add: "!!w z. hcnj(w + z) = hcnj(w) + hcnj(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   371
by transfer (rule complex_cnj_add)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   372
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   373
lemma hcomplex_hcnj_diff: "!!w z. hcnj(w - z) = hcnj(w) - hcnj(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   374
by transfer (rule complex_cnj_diff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   375
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   376
lemma hcomplex_hcnj_mult: "!!w z. hcnj(w * z) = hcnj(w) * hcnj(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   377
by transfer (rule complex_cnj_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   378
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   379
lemma hcomplex_hcnj_divide: "!!w z. hcnj(w / z) = (hcnj w)/(hcnj z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   380
by transfer (rule complex_cnj_divide)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   381
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   382
lemma hcnj_one [simp]: "hcnj 1 = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   383
by transfer (rule complex_cnj_one)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   384
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   385
lemma hcomplex_hcnj_zero [simp]: "hcnj 0 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   386
by transfer (rule complex_cnj_zero)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   387
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   388
lemma hcomplex_hcnj_zero_iff [iff]: "!!z. (hcnj z = 0) = (z = 0)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   389
by transfer (rule complex_cnj_zero_iff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   390
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   391
lemma hcomplex_mult_hcnj:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   392
     "!!z. z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   393
by transfer (rule complex_mult_cnj)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   394
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   395
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   396
subsection{*More Theorems about the Function @{term hcmod}*}
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   397
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   398
lemma hcomplex_hcmod_eq_zero_cancel [simp]: "!!x. (hcmod x = 0) = (x = 0)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   399
by transfer (rule complex_mod_eq_zero_cancel)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   400
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   401
lemma hcmod_hcomplex_of_hypreal_of_nat [simp]:
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   402
     "hcmod (hcomplex_of_hypreal(hypreal_of_nat n)) = hypreal_of_nat n"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   403
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   404
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   405
lemma hcmod_hcomplex_of_hypreal_of_hypnat [simp]:
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   406
     "hcmod (hcomplex_of_hypreal(hypreal_of_hypnat n)) = hypreal_of_hypnat n"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   407
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   408
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   409
lemma hcmod_minus [simp]: "!!x. hcmod (-x) = hcmod(x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   410
by transfer (rule complex_mod_minus)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   411
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   412
lemma hcmod_mult_hcnj: "!!z. hcmod(z * hcnj(z)) = hcmod(z) ^ 2"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   413
by transfer (rule complex_mod_mult_cnj)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   414
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   415
lemma hcmod_ge_zero [simp]: "!!x. (0::hypreal) \<le> hcmod x"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   416
by transfer (rule complex_mod_ge_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   417
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   418
lemma hrabs_hcmod_cancel [simp]: "abs(hcmod x) = hcmod x"
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   419
by (simp add: abs_if linorder_not_less)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   420
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   421
lemma hcmod_mult: "!!x y. hcmod(x*y) = hcmod(x) * hcmod(y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   422
by transfer (rule complex_mod_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   423
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   424
lemma hcmod_add_squared_eq:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   425
  "!!x y. hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   426
by transfer (rule complex_mod_add_squared_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   427
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   428
lemma hcomplex_hRe_mult_hcnj_le_hcmod [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   429
  "!!x y. hRe(x * hcnj y) \<le> hcmod(x * hcnj y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   430
by transfer (rule complex_Re_mult_cnj_le_cmod)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   431
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   432
lemma hcomplex_hRe_mult_hcnj_le_hcmod2 [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   433
  "!!x y. hRe(x * hcnj y) \<le> hcmod(x * y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   434
by transfer (rule complex_Re_mult_cnj_le_cmod2)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   435
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   436
lemma hcmod_triangle_squared [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   437
  "!!x y. hcmod (x + y) ^ 2 \<le> (hcmod(x) + hcmod(y)) ^ 2"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   438
by transfer (rule complex_mod_triangle_squared)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   439
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   440
lemma hcmod_triangle_ineq [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   441
  "!!x y. hcmod (x + y) \<le> hcmod(x) + hcmod(y)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   442
by transfer (rule complex_mod_triangle_ineq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   443
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   444
lemma hcmod_triangle_ineq2 [simp]:
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   445
  "!!a b. hcmod(b + a) - hcmod b \<le> hcmod a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   446
by transfer (rule complex_mod_triangle_ineq2)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   447
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   448
lemma hcmod_diff_commute: "!!x y. hcmod (x - y) = hcmod (y - x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   449
by transfer (rule complex_mod_diff_commute)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   450
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   451
lemma hcmod_add_less:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   452
  "!!x y r s. [| hcmod x < r; hcmod y < s |] ==> hcmod (x + y) < r + s"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   453
by transfer (rule complex_mod_add_less)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   454
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   455
lemma hcmod_mult_less:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   456
  "!!x y r s. [| hcmod x < r; hcmod y < s |] ==> hcmod (x * y) < r * s"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   457
by transfer (rule complex_mod_mult_less)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   458
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   459
lemma hcmod_diff_ineq [simp]: "!!a b. hcmod(a) - hcmod(b) \<le> hcmod(a + b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   460
by transfer (rule complex_mod_diff_ineq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   461
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   462
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   463
subsection{*A Few Nonlinear Theorems*}
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   464
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   465
lemma hcomplex_of_hypreal_hyperpow:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   466
     "!!x n. hcomplex_of_hypreal (x pow n) = (hcomplex_of_hypreal x) pow n"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   467
by transfer (rule complex_of_real_pow)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   468
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   469
lemma hcmod_hcpow: "!!x n. hcmod(x pow n) = hcmod(x) pow n"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   470
by transfer (rule complex_mod_complexpow)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   471
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   472
lemma hcmod_hcomplex_inverse: "!!x. hcmod(inverse x) = inverse(hcmod x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   473
by transfer (rule complex_mod_inverse)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   474
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   475
lemma hcmod_divide: "!!x y. hcmod(x/y) = hcmod(x)/(hcmod y)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   476
by transfer (rule norm_divide)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   477
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   478
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   479
subsection{*Exponentiation*}
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   480
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   481
lemma hcomplexpow_0 [simp]:   "z ^ 0       = (1::hcomplex)"
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   482
by (rule power_0)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   483
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   484
lemma hcomplexpow_Suc [simp]: "z ^ (Suc n) = (z::hcomplex) * (z ^ n)"
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   485
by (rule power_Suc)
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   486
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   487
lemma hcomplexpow_i_squared [simp]: "iii ^ 2 = - 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   488
by transfer (rule complexpow_i_squared)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   489
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   490
lemma hcomplex_of_hypreal_pow:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   491
     "!!x. hcomplex_of_hypreal (x ^ n) = (hcomplex_of_hypreal x) ^ n"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   492
by transfer (rule of_real_power)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   493
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   494
lemma hcomplex_hcnj_pow: "!!z. hcnj(z ^ n) = hcnj(z) ^ n"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   495
by transfer (rule complex_cnj_pow)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   496
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   497
lemma hcmod_hcomplexpow: "!!x. hcmod(x ^ n) = hcmod(x) ^ n"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   498
by transfer (rule norm_power)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   499
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   500
lemma hcpow_minus:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   501
     "!!x n. (-x::hcomplex) pow n =
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   502
      (if ( *p* even) n then (x pow n) else -(x pow n))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   503
by transfer (rule neg_power_if)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   504
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   505
lemma hcpow_mult:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   506
  "!!r s n. ((r::hcomplex) * s) pow n = (r pow n) * (s pow n)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   507
by transfer (rule power_mult_distrib)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   508
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   509
lemma hcpow_zero2 [simp]:
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   510
  "\<And>n. 0 pow (hSuc n) = (0::'a::{recpower,semiring_0} star)"
21847
59a68ed9f2f2 redefine hSuc as *f* Suc, and move to HyperNat.thy
huffman
parents: 21839
diff changeset
   511
by transfer (rule power_0_Suc)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   512
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   513
lemma hcpow_not_zero [simp,intro]:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   514
  "!!r n. r \<noteq> 0 ==> r pow n \<noteq> (0::hcomplex)"
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   515
by (rule hyperpow_not_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   516
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   517
lemma hcpow_zero_zero: "r pow n = (0::hcomplex) ==> r = 0"
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   518
by (blast intro: ccontr dest: hcpow_not_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   519
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   520
subsection{*The Function @{term hsgn}*}
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   521
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   522
lemma hsgn_zero [simp]: "hsgn 0 = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   523
by transfer (rule sgn_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   524
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   525
lemma hsgn_one [simp]: "hsgn 1 = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   526
by transfer (rule sgn_one)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   527
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   528
lemma hsgn_minus: "!!z. hsgn (-z) = - hsgn(z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   529
by transfer (rule sgn_minus)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   530
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   531
lemma hsgn_eq: "!!z. hsgn z = z / hcomplex_of_hypreal (hcmod z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   532
by transfer (rule sgn_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   533
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   534
lemma hcmod_i: "!!x y. hcmod (HComplex x y) = ( *f* sqrt) (x ^ 2 + y ^ 2)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   535
by transfer (rule complex_mod)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   536
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   537
lemma hcomplex_eq_cancel_iff1 [simp]:
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   538
     "(hcomplex_of_hypreal xa = HComplex x y) = (xa = x & y = 0)"
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   539
by (simp add: hcomplex_of_hypreal_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   540
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   541
lemma hcomplex_eq_cancel_iff2 [simp]:
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   542
     "(HComplex x y = hcomplex_of_hypreal xa) = (x = xa & y = 0)"
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   543
by (simp add: hcomplex_of_hypreal_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   544
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   545
lemma HComplex_eq_0 [simp]: "!!x y. (HComplex x y = 0) = (x = 0 & y = 0)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   546
by transfer (rule Complex_eq_0)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   547
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   548
lemma HComplex_eq_1 [simp]: "!!x y. (HComplex x y = 1) = (x = 1 & y = 0)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   549
by transfer (rule Complex_eq_1)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   550
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   551
lemma i_eq_HComplex_0_1: "iii = HComplex 0 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   552
by transfer (rule i_def [THEN meta_eq_to_obj_eq])
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   553
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   554
lemma HComplex_eq_i [simp]: "!!x y. (HComplex x y = iii) = (x = 0 & y = 1)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   555
by transfer (rule Complex_eq_i)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   556
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   557
lemma hRe_hsgn [simp]: "!!z. hRe(hsgn z) = hRe(z)/hcmod z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   558
by transfer (rule Re_sgn)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   559
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   560
lemma hIm_hsgn [simp]: "!!z. hIm(hsgn z) = hIm(z)/hcmod z"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   561
by transfer (rule Im_sgn)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   562
15085
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15013
diff changeset
   563
(*????move to RealDef????*)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   564
lemma real_two_squares_add_zero_iff [simp]: "(x*x + y*y = 0) = ((x::real) = 0 & y = 0)"
15085
5693a977a767 removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents: 15013
diff changeset
   565
by (auto intro: real_sum_squares_cancel iff: real_add_eq_0_iff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   566
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   567
lemma hcomplex_inverse_complex_split:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   568
     "!!x y. inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) =
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   569
      hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) -
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   570
      iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   571
by transfer (rule complex_inverse_complex_split)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   572
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   573
lemma HComplex_inverse:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   574
     "!!x y. inverse (HComplex x y) =
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   575
      HComplex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   576
by transfer (rule complex_inverse)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   577
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   578
lemma hRe_mult_i_eq[simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   579
    "!!y. hRe (iii * hcomplex_of_hypreal y) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   580
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   581
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   582
lemma hIm_mult_i_eq [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   583
    "!!y. hIm (iii * hcomplex_of_hypreal y) = y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   584
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   585
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   586
lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = abs y"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   587
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   588
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   589
lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = abs y"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   590
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   591
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   592
(*---------------------------------------------------------------------------*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   593
(*  harg                                                                     *)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   594
(*---------------------------------------------------------------------------*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   595
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   596
lemma cos_harg_i_mult_zero_pos:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   597
     "!!y. 0 < y ==> ( *f* cos) (harg(HComplex 0 y)) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   598
by transfer (rule cos_arg_i_mult_zero_pos)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   599
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   600
lemma cos_harg_i_mult_zero_neg:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   601
     "!!y. y < 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   602
by transfer (rule cos_arg_i_mult_zero_neg)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   603
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   604
lemma cos_harg_i_mult_zero [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   605
     "!!y. y \<noteq> 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   606
by transfer (rule cos_arg_i_mult_zero)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   607
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   608
lemma hcomplex_of_hypreal_zero_iff [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   609
     "!!y. (hcomplex_of_hypreal y = 0) = (y = 0)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   610
by transfer (rule of_real_eq_0_iff)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   611
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   612
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   613
subsection{*Polar Form for Nonstandard Complex Numbers*}
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   614
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   615
lemma complex_split_polar2:
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   616
     "\<forall>n. \<exists>r a. (z n) =  complex_of_real r * (Complex (cos a) (sin a))"
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   617
by (blast intro: complex_split_polar)
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   618
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   619
lemma hcomplex_split_polar:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   620
  "!!z. \<exists>r a. z = hcomplex_of_hypreal r * (HComplex(( *f* cos) a)(( *f* sin) a))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   621
by transfer (rule complex_split_polar)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   622
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   623
lemma hcis_eq:
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   624
   "!!a. hcis a =
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   625
    (hcomplex_of_hypreal(( *f* cos) a) +
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   626
    iii * hcomplex_of_hypreal(( *f* sin) a))"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   627
by transfer (simp add: cis_def)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   628
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   629
lemma hrcis_Ex: "!!z. \<exists>r a. z = hrcis r a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   630
by transfer (rule rcis_Ex)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   631
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   632
lemma hRe_hcomplex_polar [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   633
  "!!r a. hRe (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = 
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   634
      r * ( *f* cos) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   635
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   636
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   637
lemma hRe_hrcis [simp]: "!!r a. hRe(hrcis r a) = r * ( *f* cos) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   638
by transfer (rule Re_rcis)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   639
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   640
lemma hIm_hcomplex_polar [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   641
  "!!r a. hIm (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = 
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   642
      r * ( *f* sin) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   643
by transfer simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   644
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   645
lemma hIm_hrcis [simp]: "!!r a. hIm(hrcis r a) = r * ( *f* sin) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   646
by transfer (rule Im_rcis)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   647
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   648
lemma hcmod_unit_one [simp]:
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   649
     "!!a. hcmod (HComplex (( *f* cos) a) (( *f* sin) a)) = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   650
by transfer (rule cmod_unit_one)
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   651
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   652
lemma hcmod_complex_polar [simp]:
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   653
  "!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) =
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   654
      abs r"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   655
by transfer (rule cmod_complex_polar)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   656
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   657
lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = abs r"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   658
by transfer (rule complex_mod_rcis)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   659
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   660
(*---------------------------------------------------------------------------*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   661
(*  (r1 * hrcis a) * (r2 * hrcis b) = r1 * r2 * hrcis (a + b)                *)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   662
(*---------------------------------------------------------------------------*)
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   663
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   664
lemma hcis_hrcis_eq: "!!a. hcis a = hrcis 1 a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   665
by transfer (rule cis_rcis_eq)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   666
declare hcis_hrcis_eq [symmetric, simp]
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   667
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   668
lemma hrcis_mult:
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   669
  "!!a b r1 r2. hrcis r1 a * hrcis r2 b = hrcis (r1*r2) (a + b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   670
by transfer (rule rcis_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   671
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   672
lemma hcis_mult: "!!a b. hcis a * hcis b = hcis (a + b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   673
by transfer (rule cis_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   674
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   675
lemma hcis_zero [simp]: "hcis 0 = 1"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   676
by transfer (rule cis_zero)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   677
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   678
lemma hrcis_zero_mod [simp]: "!!a. hrcis 0 a = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   679
by transfer (rule rcis_zero_mod)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   680
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   681
lemma hrcis_zero_arg [simp]: "!!r. hrcis r 0 = hcomplex_of_hypreal r"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   682
by transfer (rule rcis_zero_arg)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   683
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   684
lemma hcomplex_i_mult_minus [simp]: "!!x. iii * (iii * x) = - x"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   685
by transfer (rule complex_i_mult_minus)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   686
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   687
lemma hcomplex_i_mult_minus2 [simp]: "iii * iii * x = - x"
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   688
by simp
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   689
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   690
lemma hcis_hypreal_of_nat_Suc_mult:
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   691
   "!!a. hcis (hypreal_of_nat (Suc n) * a) =
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   692
     hcis a * hcis (hypreal_of_nat n * a)"
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   693
apply transfer
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   694
apply (fold real_of_nat_def)
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   695
apply (rule cis_real_of_nat_Suc_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   696
done
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   697
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   698
lemma NSDeMoivre: "!!a. (hcis a) ^ n = hcis (hypreal_of_nat n * a)"
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   699
apply transfer
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   700
apply (fold real_of_nat_def)
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   701
apply (rule DeMoivre)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   702
done
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   703
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14331
diff changeset
   704
lemma hcis_hypreal_of_hypnat_Suc_mult:
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   705
     "!! a n. hcis (hypreal_of_hypnat (n + 1) * a) =
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   706
      hcis a * hcis (hypreal_of_hypnat n * a)"
21864
2ecfd8985982 hypreal_of_hypnat abbreviates more general of_hypnat
huffman
parents: 21848
diff changeset
   707
by transfer (fold real_of_nat_def, simp add: cis_real_of_nat_Suc_mult)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   708
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   709
lemma NSDeMoivre_ext:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   710
  "!!a n. (hcis a) pow n = hcis (hypreal_of_hypnat n * a)"
21864
2ecfd8985982 hypreal_of_hypnat abbreviates more general of_hypnat
huffman
parents: 21848
diff changeset
   711
by transfer (fold real_of_nat_def, rule DeMoivre)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   712
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   713
lemma NSDeMoivre2:
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   714
  "!!a r. (hrcis r a) ^ n = hrcis (r ^ n) (hypreal_of_nat n * a)"
21864
2ecfd8985982 hypreal_of_hypnat abbreviates more general of_hypnat
huffman
parents: 21848
diff changeset
   715
by transfer (fold real_of_nat_def, rule DeMoivre2)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   716
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   717
lemma DeMoivre2_ext:
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   718
  "!! a r n. (hrcis r a) pow n = hrcis (r pow n) (hypreal_of_hypnat n * a)"
21864
2ecfd8985982 hypreal_of_hypnat abbreviates more general of_hypnat
huffman
parents: 21848
diff changeset
   719
by transfer (fold real_of_nat_def, rule DeMoivre2)
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   720
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   721
lemma hcis_inverse [simp]: "!!a. inverse(hcis a) = hcis (-a)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   722
by transfer (rule cis_inverse)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   723
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   724
lemma hrcis_inverse: "!!a r. inverse(hrcis r a) = hrcis (inverse r) (-a)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   725
by transfer (simp add: rcis_inverse inverse_eq_divide [symmetric])
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   726
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   727
lemma hRe_hcis [simp]: "!!a. hRe(hcis a) = ( *f* cos) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   728
by transfer (rule Re_cis)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   729
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   730
lemma hIm_hcis [simp]: "!!a. hIm(hcis a) = ( *f* sin) a"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   731
by transfer (rule Im_cis)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   732
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   733
lemma cos_n_hRe_hcis_pow_n: "( *f* cos) (hypreal_of_nat n * a) = hRe(hcis a ^ n)"
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   734
by (simp add: NSDeMoivre)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   735
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   736
lemma sin_n_hIm_hcis_pow_n: "( *f* sin) (hypreal_of_nat n * a) = hIm(hcis a ^ n)"
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   737
by (simp add: NSDeMoivre)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   738
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   739
lemma cos_n_hRe_hcis_hcpow_n: "( *f* cos) (hypreal_of_hypnat n * a) = hRe(hcis a pow n)"
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   740
by (simp add: NSDeMoivre_ext)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   741
21848
b35faf14a89f generalized type of hyperpow; removed hcpow
huffman
parents: 21847
diff changeset
   742
lemma sin_n_hIm_hcis_hcpow_n: "( *f* sin) (hypreal_of_hypnat n * a) = hIm(hcis a pow n)"
14377
f454b3004f8f tidying up, especially the Complex numbers
paulson
parents: 14374
diff changeset
   743
by (simp add: NSDeMoivre_ext)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   744
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   745
lemma hexpi_add: "!!a b. hexpi(a + b) = hexpi(a) * hexpi(b)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   746
by transfer (rule expi_add)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   747
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   748
14374
61de62096768 further tidying of the complex numbers
paulson
parents: 14373
diff changeset
   749
subsection{*@{term hcomplex_of_complex}: the Injection from
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   750
  type @{typ complex} to to @{typ hcomplex}*}
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   751
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   752
lemma inj_hcomplex_of_complex: "inj(hcomplex_of_complex)"
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   753
by (rule inj_onI, simp)
14354
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   754
988aa4648597 types complex and hcomplex are now instances of class ringpower:
paulson
parents: 14341
diff changeset
   755
lemma hcomplex_of_complex_i: "iii = hcomplex_of_complex ii"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   756
by (rule iii_def)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   757
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   758
lemma hRe_hcomplex_of_complex:
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   759
   "hRe (hcomplex_of_complex z) = hypreal_of_real (Re z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   760
by transfer (rule refl)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   761
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   762
lemma hIm_hcomplex_of_complex:
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   763
   "hIm (hcomplex_of_complex z) = hypreal_of_real (Im z)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   764
by transfer (rule refl)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   765
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   766
lemma hcmod_hcomplex_of_complex:
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   767
     "hcmod (hcomplex_of_complex x) = hypreal_of_real (cmod x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   768
by transfer (rule refl)
14314
314da085adf3 converted Complex/NSComplex to Isar script
paulson
parents: 13957
diff changeset
   769
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   770
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   771
subsection{*Numerals and Arithmetic*}
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   772
20485
3078fd2eec7b got rid of Numeral.bin type
haftmann
parents: 19765
diff changeset
   773
lemma hcomplex_number_of_def: "(number_of w :: hcomplex) == of_int w"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   774
by transfer (rule number_of_eq [THEN eq_reflection])
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   775
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   776
lemma hcomplex_of_hypreal_eq_hcomplex_of_complex: 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   777
     "hcomplex_of_hypreal (hypreal_of_real x) =  
15013
34264f5e4691 new treatment of binary numerals
paulson
parents: 15003
diff changeset
   778
      hcomplex_of_complex (complex_of_real x)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   779
by transfer (rule refl)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   780
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   781
lemma hcomplex_hypreal_number_of: 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   782
  "hcomplex_of_complex (number_of w) = hcomplex_of_hypreal(number_of w)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   783
by transfer (rule complex_number_of [symmetric])
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   784
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   785
text{*This theorem is necessary because theorems such as
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   786
   @{text iszero_number_of_0} only hold for ordered rings. They cannot
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   787
   be generalized to fields in general because they fail for finite fields.
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   788
   They work for type complex because the reals can be embedded in them.*}
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   789
lemma iszero_hcomplex_number_of [simp]:
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   790
     "iszero (number_of w :: hcomplex) = iszero (number_of w :: real)"
17373
27509e72f29e removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents: 17332
diff changeset
   791
by (transfer iszero_def, simp)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   792
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   793
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   794
(*
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   795
Goal "z + hcnj z =  
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   796
      hcomplex_of_hypreal (2 * hRe(z))"
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   797
by (res_inst_tac [("z","z")] eq_Abs_star 1);
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   798
by (auto_tac (claset(),HOL_ss addsimps [hRe,hcnj,star_n_add,
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   799
    hypreal_mult,hcomplex_of_hypreal,complex_add_cnj]));
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   800
qed "star_n_add_hcnj";
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   801
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   802
Goal "z - hcnj z = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   803
\     hcomplex_of_hypreal (hypreal_of_real #2 * hIm(z)) * iii";
17300
5798fbf42a6a replace type hcomplex with complex star
huffman
parents: 17299
diff changeset
   804
by (res_inst_tac [("z","z")] eq_Abs_star 1);
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   805
by (auto_tac (claset(),simpset() addsimps [hIm,hcnj,hcomplex_diff,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   806
    hypreal_of_real_def,hypreal_mult,hcomplex_of_hypreal,
17318
bc1c75855f3d starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents: 17300
diff changeset
   807
    complex_diff_cnj,iii_def,star_n_mult]));
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   808
qed "hcomplex_diff_hcnj";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   809
*)
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   810
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   811
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   812
(*** Real and imaginary stuff ***)
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   813
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   814
(*Convert???
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   815
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   816
  "((number_of xa :: hcomplex) + iii * number_of ya =  
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   817
        number_of xb + iii * number_of yb) =  
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   818
   (((number_of xa :: hcomplex) = number_of xb) &  
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   819
    ((number_of ya :: hcomplex) = number_of yb))"
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   820
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   821
     hcomplex_hypreal_number_of]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   822
qed "hcomplex_number_of_eq_cancel_iff";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   823
Addsimps [hcomplex_number_of_eq_cancel_iff];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   824
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   825
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   826
  "((number_of xa :: hcomplex) + number_of ya * iii = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   827
\       number_of xb + number_of yb * iii) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   828
\  (((number_of xa :: hcomplex) = number_of xb) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   829
\   ((number_of ya :: hcomplex) = number_of yb))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   830
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffA,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   831
    hcomplex_hypreal_number_of]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   832
qed "hcomplex_number_of_eq_cancel_iffA";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   833
Addsimps [hcomplex_number_of_eq_cancel_iffA];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   834
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   835
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   836
  "((number_of xa :: hcomplex) + number_of ya * iii = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   837
\       number_of xb + iii * number_of yb) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   838
\  (((number_of xa :: hcomplex) = number_of xb) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   839
\   ((number_of ya :: hcomplex) = number_of yb))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   840
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffB,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   841
    hcomplex_hypreal_number_of]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   842
qed "hcomplex_number_of_eq_cancel_iffB";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   843
Addsimps [hcomplex_number_of_eq_cancel_iffB];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   844
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   845
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   846
  "((number_of xa :: hcomplex) + iii * number_of ya = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   847
\       number_of xb + number_of yb * iii) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   848
\  (((number_of xa :: hcomplex) = number_of xb) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   849
\   ((number_of ya :: hcomplex) = number_of yb))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   850
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffC,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   851
     hcomplex_hypreal_number_of]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   852
qed "hcomplex_number_of_eq_cancel_iffC";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   853
Addsimps [hcomplex_number_of_eq_cancel_iffC];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   854
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   855
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   856
  "((number_of xa :: hcomplex) + iii * number_of ya = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   857
\       number_of xb) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   858
\  (((number_of xa :: hcomplex) = number_of xb) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   859
\   ((number_of ya :: hcomplex) = 0))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   860
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   861
    hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   862
qed "hcomplex_number_of_eq_cancel_iff2";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   863
Addsimps [hcomplex_number_of_eq_cancel_iff2];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   864
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   865
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   866
  "((number_of xa :: hcomplex) + number_of ya * iii = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   867
\       number_of xb) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   868
\  (((number_of xa :: hcomplex) = number_of xb) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   869
\   ((number_of ya :: hcomplex) = 0))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   870
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2a,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   871
    hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   872
qed "hcomplex_number_of_eq_cancel_iff2a";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   873
Addsimps [hcomplex_number_of_eq_cancel_iff2a];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   874
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   875
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   876
  "((number_of xa :: hcomplex) + iii * number_of ya = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   877
\    iii * number_of yb) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   878
\  (((number_of xa :: hcomplex) = 0) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   879
\   ((number_of ya :: hcomplex) = number_of yb))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   880
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   881
    hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   882
qed "hcomplex_number_of_eq_cancel_iff3";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   883
Addsimps [hcomplex_number_of_eq_cancel_iff3];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   884
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   885
Goalw [hcomplex_number_of_def] 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   886
  "((number_of xa :: hcomplex) + number_of ya * iii= \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   887
\    iii * number_of yb) = \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   888
\  (((number_of xa :: hcomplex) = 0) & \
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   889
\   ((number_of ya :: hcomplex) = number_of yb))";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   890
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3a,
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   891
    hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff]));
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   892
qed "hcomplex_number_of_eq_cancel_iff3a";
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   893
Addsimps [hcomplex_number_of_eq_cancel_iff3a];
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   894
*)
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   895
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   896
lemma hcomplex_number_of_hcnj [simp]:
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   897
     "hcnj (number_of v :: hcomplex) = number_of v"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   898
by transfer (rule complex_number_of_cnj)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   899
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   900
lemma hcomplex_number_of_hcmod [simp]: 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   901
      "hcmod(number_of v :: hcomplex) = abs (number_of v :: hypreal)"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   902
by transfer (rule complex_number_of_cmod)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   903
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   904
lemma hcomplex_number_of_hRe [simp]: 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   905
      "hRe(number_of v :: hcomplex) = number_of v"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   906
by transfer (rule complex_number_of_Re)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   907
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   908
lemma hcomplex_number_of_hIm [simp]: 
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   909
      "hIm(number_of v :: hcomplex) = 0"
20727
3ca92a58ebd7 convert more proofs to transfer principle
huffman
parents: 20558
diff changeset
   910
by transfer (rule complex_number_of_Im)
14387
e96d5c42c4b0 Polymorphic treatment of binary arithmetic using axclasses
paulson
parents: 14377
diff changeset
   911
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   912
end