src/HOL/Import/HOL4Compat.thy
 author wenzelm Fri Jan 14 15:44:47 2011 +0100 (2011-01-14) changeset 41550 efa734d9b221 parent 41413 64cd30d6b0b8 child 44690 b6d8b11ed399 permissions -rw-r--r--
eliminated global prems;
tuned proofs;
```     1 (*  Title:      HOL/Import/HOL4Compat.thy
```
```     2     Author:     Sebastian Skalberg (TU Muenchen)
```
```     3 *)
```
```     4
```
```     5 theory HOL4Compat
```
```     6 imports
```
```     7   HOL4Setup
```
```     8   Complex_Main
```
```     9   "~~/src/HOL/Old_Number_Theory/Primes"
```
```    10   "~~/src/HOL/Library/ContNotDenum"
```
```    11 begin
```
```    12
```
```    13 abbreviation (input) mem (infixl "mem" 55) where "x mem xs \<equiv> List.member xs x"
```
```    14 no_notation differentiable (infixl "differentiable" 60)
```
```    15 no_notation sums (infixr "sums" 80)
```
```    16
```
```    17 lemma EXISTS_UNIQUE_DEF: "(Ex1 P) = (Ex P & (ALL x y. P x & P y --> (x = y)))"
```
```    18   by auto
```
```    19
```
```    20 lemma COND_DEF:"(If b t f) = (@x. ((b = True) --> (x = t)) & ((b = False) --> (x = f)))"
```
```    21   by auto
```
```    22
```
```    23 definition LET :: "['a \<Rightarrow> 'b,'a] \<Rightarrow> 'b" where
```
```    24   "LET f s == f s"
```
```    25
```
```    26 lemma [hol4rew]: "LET f s = Let s f"
```
```    27   by (simp add: LET_def Let_def)
```
```    28
```
```    29 lemmas [hol4rew] = ONE_ONE_rew
```
```    30
```
```    31 lemma bool_case_DEF: "(bool_case x y b) = (if b then x else y)"
```
```    32   by simp
```
```    33
```
```    34 lemma INR_INL_11: "(ALL y x. (Inl x = Inl y) = (x = y)) & (ALL y x. (Inr x = Inr y) = (x = y))"
```
```    35   by safe
```
```    36
```
```    37 (*lemma INL_neq_INR: "ALL v1 v2. Sum_Type.Inr v2 ~= Sum_Type.Inl v1"
```
```    38   by simp*)
```
```    39
```
```    40 primrec ISL :: "'a + 'b => bool" where
```
```    41   "ISL (Inl x) = True"
```
```    42 | "ISL (Inr x) = False"
```
```    43
```
```    44 primrec ISR :: "'a + 'b => bool" where
```
```    45   "ISR (Inl x) = False"
```
```    46 | "ISR (Inr x) = True"
```
```    47
```
```    48 lemma ISL: "(ALL x. ISL (Inl x)) & (ALL y. ~ISL (Inr y))"
```
```    49   by simp
```
```    50
```
```    51 lemma ISR: "(ALL x. ISR (Inr x)) & (ALL y. ~ISR (Inl y))"
```
```    52   by simp
```
```    53
```
```    54 primrec OUTL :: "'a + 'b => 'a" where
```
```    55   "OUTL (Inl x) = x"
```
```    56
```
```    57 primrec OUTR :: "'a + 'b => 'b" where
```
```    58   "OUTR (Inr x) = x"
```
```    59
```
```    60 lemma OUTL: "OUTL (Inl x) = x"
```
```    61   by simp
```
```    62
```
```    63 lemma OUTR: "OUTR (Inr x) = x"
```
```    64   by simp
```
```    65
```
```    66 lemma sum_case_def: "(ALL f g x. sum_case f g (Inl x) = f x) & (ALL f g y. sum_case f g (Inr y) = g y)"
```
```    67   by simp
```
```    68
```
```    69 lemma one: "ALL v. v = ()"
```
```    70   by simp
```
```    71
```
```    72 lemma option_case_def: "(!u f. option_case u f None = u) & (!u f x. option_case u f (Some x) = f x)"
```
```    73   by simp
```
```    74
```
```    75 lemma OPTION_MAP_DEF: "(!f x. Option.map f (Some x) = Some (f x)) & (!f. Option.map f None = None)"
```
```    76   by simp
```
```    77
```
```    78 primrec IS_SOME :: "'a option => bool" where
```
```    79   "IS_SOME (Some x) = True"
```
```    80 | "IS_SOME None = False"
```
```    81
```
```    82 primrec IS_NONE :: "'a option => bool" where
```
```    83   "IS_NONE (Some x) = False"
```
```    84 | "IS_NONE None = True"
```
```    85
```
```    86 lemma IS_NONE_DEF: "(!x. IS_NONE (Some x) = False) & (IS_NONE None = True)"
```
```    87   by simp
```
```    88
```
```    89 lemma IS_SOME_DEF: "(!x. IS_SOME (Some x) = True) & (IS_SOME None = False)"
```
```    90   by simp
```
```    91
```
```    92 primrec OPTION_JOIN :: "'a option option => 'a option" where
```
```    93   "OPTION_JOIN None = None"
```
```    94 | "OPTION_JOIN (Some x) = x"
```
```    95
```
```    96 lemma OPTION_JOIN_DEF: "(OPTION_JOIN None = None) & (ALL x. OPTION_JOIN (Some x) = x)"
```
```    97   by simp
```
```    98
```
```    99 lemma PAIR: "(fst x,snd x) = x"
```
```   100   by simp
```
```   101
```
```   102 lemma PAIR_MAP: "map_pair f g p = (f (fst p),g (snd p))"
```
```   103   by (simp add: map_pair_def split_def)
```
```   104
```
```   105 lemma pair_case_def: "split = split"
```
```   106   ..
```
```   107
```
```   108 lemma LESS_OR_EQ: "m <= (n::nat) = (m < n | m = n)"
```
```   109   by auto
```
```   110
```
```   111 definition nat_gt :: "nat => nat => bool" where
```
```   112   "nat_gt == %m n. n < m"
```
```   113
```
```   114 definition nat_ge :: "nat => nat => bool" where
```
```   115   "nat_ge == %m n. nat_gt m n | m = n"
```
```   116
```
```   117 lemma [hol4rew]: "nat_gt m n = (n < m)"
```
```   118   by (simp add: nat_gt_def)
```
```   119
```
```   120 lemma [hol4rew]: "nat_ge m n = (n <= m)"
```
```   121   by (auto simp add: nat_ge_def nat_gt_def)
```
```   122
```
```   123 lemma GREATER_DEF: "ALL m n. (n < m) = (n < m)"
```
```   124   by simp
```
```   125
```
```   126 lemma GREATER_OR_EQ: "ALL m n. n <= (m::nat) = (n < m | m = n)"
```
```   127   by auto
```
```   128
```
```   129 lemma LESS_DEF: "m < n = (? P. (!n. P (Suc n) --> P n) & P m & ~P n)"
```
```   130 proof safe
```
```   131   assume 1: "m < n"
```
```   132   def P == "%n. n <= m"
```
```   133   have "(!n. P (Suc n) \<longrightarrow> P n) & P m & ~P n"
```
```   134   proof (auto simp add: P_def)
```
```   135     assume "n <= m"
```
```   136     with 1
```
```   137     show False
```
```   138       by auto
```
```   139   qed
```
```   140   thus "? P. (!n. P (Suc n) \<longrightarrow> P n) & P m & ~P n"
```
```   141     by auto
```
```   142 next
```
```   143   fix P
```
```   144   assume alln: "!n. P (Suc n) \<longrightarrow> P n"
```
```   145   assume pm: "P m"
```
```   146   assume npn: "~P n"
```
```   147   have "!k q. q + k = m \<longrightarrow> P q"
```
```   148   proof
```
```   149     fix k
```
```   150     show "!q. q + k = m \<longrightarrow> P q"
```
```   151     proof (induct k,simp_all)
```
```   152       show "P m" by fact
```
```   153     next
```
```   154       fix k
```
```   155       assume ind: "!q. q + k = m \<longrightarrow> P q"
```
```   156       show "!q. Suc (q + k) = m \<longrightarrow> P q"
```
```   157       proof (rule+)
```
```   158         fix q
```
```   159         assume "Suc (q + k) = m"
```
```   160         hence "(Suc q) + k = m"
```
```   161           by simp
```
```   162         with ind
```
```   163         have psq: "P (Suc q)"
```
```   164           by simp
```
```   165         from alln
```
```   166         have "P (Suc q) --> P q"
```
```   167           ..
```
```   168         with psq
```
```   169         show "P q"
```
```   170           by simp
```
```   171       qed
```
```   172     qed
```
```   173   qed
```
```   174   hence "!q. q + (m - n) = m \<longrightarrow> P q"
```
```   175     ..
```
```   176   hence hehe: "n + (m - n) = m \<longrightarrow> P n"
```
```   177     ..
```
```   178   show "m < n"
```
```   179   proof (rule classical)
```
```   180     assume "~(m<n)"
```
```   181     hence "n <= m"
```
```   182       by simp
```
```   183     with hehe
```
```   184     have "P n"
```
```   185       by simp
```
```   186     with npn
```
```   187     show "m < n"
```
```   188       ..
```
```   189   qed
```
```   190 qed
```
```   191
```
```   192 definition FUNPOW :: "('a => 'a) => nat => 'a => 'a" where
```
```   193   "FUNPOW f n == f ^^ n"
```
```   194
```
```   195 lemma FUNPOW: "(ALL f x. (f ^^ 0) x = x) &
```
```   196   (ALL f n x. (f ^^ Suc n) x = (f ^^ n) (f x))"
```
```   197   by (simp add: funpow_swap1)
```
```   198
```
```   199 lemma [hol4rew]: "FUNPOW f n = f ^^ n"
```
```   200   by (simp add: FUNPOW_def)
```
```   201
```
```   202 lemma ADD: "(!n. (0::nat) + n = n) & (!m n. Suc m + n = Suc (m + n))"
```
```   203   by simp
```
```   204
```
```   205 lemma MULT: "(!n. (0::nat) * n = 0) & (!m n. Suc m * n = m * n + n)"
```
```   206   by simp
```
```   207
```
```   208 lemma SUB: "(!m. (0::nat) - m = 0) & (!m n. (Suc m) - n = (if m < n then 0 else Suc (m - n)))"
```
```   209   by (simp) arith
```
```   210
```
```   211 lemma MAX_DEF: "max (m::nat) n = (if m < n then n else m)"
```
```   212   by (simp add: max_def)
```
```   213
```
```   214 lemma MIN_DEF: "min (m::nat) n = (if m < n then m else n)"
```
```   215   by (simp add: min_def)
```
```   216
```
```   217 lemma DIVISION: "(0::nat) < n --> (!k. (k = k div n * n + k mod n) & k mod n < n)"
```
```   218   by simp
```
```   219
```
```   220 definition ALT_ZERO :: nat where
```
```   221   "ALT_ZERO == 0"
```
```   222
```
```   223 definition NUMERAL_BIT1 :: "nat \<Rightarrow> nat" where
```
```   224   "NUMERAL_BIT1 n == n + (n + Suc 0)"
```
```   225
```
```   226 definition NUMERAL_BIT2 :: "nat \<Rightarrow> nat" where
```
```   227   "NUMERAL_BIT2 n == n + (n + Suc (Suc 0))"
```
```   228
```
```   229 definition NUMERAL :: "nat \<Rightarrow> nat" where
```
```   230   "NUMERAL x == x"
```
```   231
```
```   232 lemma [hol4rew]: "NUMERAL ALT_ZERO = 0"
```
```   233   by (simp add: ALT_ZERO_def NUMERAL_def)
```
```   234
```
```   235 lemma [hol4rew]: "NUMERAL (NUMERAL_BIT1 ALT_ZERO) = 1"
```
```   236   by (simp add: ALT_ZERO_def NUMERAL_BIT1_def NUMERAL_def)
```
```   237
```
```   238 lemma [hol4rew]: "NUMERAL (NUMERAL_BIT2 ALT_ZERO) = 2"
```
```   239   by (simp add: ALT_ZERO_def NUMERAL_BIT2_def NUMERAL_def)
```
```   240
```
```   241 lemma EXP: "(!m. m ^ 0 = (1::nat)) & (!m n. m ^ Suc n = m * (m::nat) ^ n)"
```
```   242   by auto
```
```   243
```
```   244 lemma num_case_def: "(!b f. nat_case b f 0 = b) & (!b f n. nat_case b f (Suc n) = f n)"
```
```   245   by simp
```
```   246
```
```   247 lemma divides_def: "(a::nat) dvd b = (? q. b = q * a)"
```
```   248   by (auto simp add: dvd_def)
```
```   249
```
```   250 lemma list_case_def: "(!v f. list_case v f [] = v) & (!v f a0 a1. list_case v f (a0#a1) = f a0 a1)"
```
```   251   by simp
```
```   252
```
```   253 primrec list_size :: "('a \<Rightarrow> nat) \<Rightarrow> 'a list \<Rightarrow> nat" where
```
```   254   "list_size f [] = 0"
```
```   255 | "list_size f (a0#a1) = 1 + (f a0 + list_size f a1)"
```
```   256
```
```   257 lemma list_size_def': "(!f. list_size f [] = 0) &
```
```   258          (!f a0 a1. list_size f (a0#a1) = 1 + (f a0 + list_size f a1))"
```
```   259   by simp
```
```   260
```
```   261 lemma list_case_cong: "! M M' v f. M = M' & (M' = [] \<longrightarrow>  v = v') &
```
```   262            (!a0 a1. (M' = a0#a1) \<longrightarrow> (f a0 a1 = f' a0 a1)) -->
```
```   263            (list_case v f M = list_case v' f' M')"
```
```   264 proof clarify
```
```   265   fix M M' v f
```
```   266   assume 1: "M' = [] \<longrightarrow> v = v'"
```
```   267     and 2: "!a0 a1. M' = a0 # a1 \<longrightarrow> f a0 a1 = f' a0 a1"
```
```   268   show "list_case v f M' = list_case v' f' M'"
```
```   269   proof (rule List.list.case_cong)
```
```   270     show "M' = M'"
```
```   271       ..
```
```   272   next
```
```   273     assume "M' = []"
```
```   274     with 1 2
```
```   275     show "v = v'"
```
```   276       by auto
```
```   277   next
```
```   278     fix a0 a1
```
```   279     assume "M' = a0 # a1"
```
```   280     with 1 2
```
```   281     show "f a0 a1 = f' a0 a1"
```
```   282       by auto
```
```   283   qed
```
```   284 qed
```
```   285
```
```   286 lemma list_Axiom: "ALL f0 f1. EX fn. (fn [] = f0) & (ALL a0 a1. fn (a0#a1) = f1 a0 a1 (fn a1))"
```
```   287 proof safe
```
```   288   fix f0 f1
```
```   289   def fn == "list_rec f0 f1"
```
```   290   have "fn [] = f0 & (ALL a0 a1. fn (a0 # a1) = f1 a0 a1 (fn a1))"
```
```   291     by (simp add: fn_def)
```
```   292   thus "EX fn. fn [] = f0 & (ALL a0 a1. fn (a0 # a1) = f1 a0 a1 (fn a1))"
```
```   293     by auto
```
```   294 qed
```
```   295
```
```   296 lemma list_Axiom_old: "EX! fn. (fn [] = x) & (ALL h t. fn (h#t) = f (fn t) h t)"
```
```   297 proof safe
```
```   298   def fn == "list_rec x (%h t r. f r h t)"
```
```   299   have "fn [] = x & (ALL h t. fn (h # t) = f (fn t) h t)"
```
```   300     by (simp add: fn_def)
```
```   301   thus "EX fn. fn [] = x & (ALL h t. fn (h # t) = f (fn t) h t)"
```
```   302     by auto
```
```   303 next
```
```   304   fix fn1 fn2
```
```   305   assume 1: "ALL h t. fn1 (h # t) = f (fn1 t) h t"
```
```   306   assume 2: "ALL h t. fn2 (h # t) = f (fn2 t) h t"
```
```   307   assume 3: "fn2 [] = fn1 []"
```
```   308   show "fn1 = fn2"
```
```   309   proof
```
```   310     fix xs
```
```   311     show "fn1 xs = fn2 xs"
```
```   312       by (induct xs) (simp_all add: 1 2 3)
```
```   313   qed
```
```   314 qed
```
```   315
```
```   316 lemma NULL_DEF: "(List.null [] = True) & (!h t. List.null (h # t) = False)"
```
```   317   by (simp add: null_def)
```
```   318
```
```   319 definition sum :: "nat list \<Rightarrow> nat" where
```
```   320   "sum l == foldr (op +) l 0"
```
```   321
```
```   322 lemma SUM: "(sum [] = 0) & (!h t. sum (h#t) = h + sum t)"
```
```   323   by (simp add: sum_def)
```
```   324
```
```   325 lemma APPEND: "(!l. [] @ l = l) & (!l1 l2 h. (h#l1) @ l2 = h# l1 @ l2)"
```
```   326   by simp
```
```   327
```
```   328 lemma FLAT: "(concat [] = []) & (!h t. concat (h#t) = h @ (concat t))"
```
```   329   by simp
```
```   330
```
```   331 lemma LENGTH: "(length [] = 0) & (!h t. length (h#t) = Suc (length t))"
```
```   332   by simp
```
```   333
```
```   334 lemma MAP: "(!f. map f [] = []) & (!f h t. map f (h#t) = f h#map f t)"
```
```   335   by simp
```
```   336
```
```   337 lemma MEM: "(!x. List.member [] x = False) & (!x h t. List.member (h#t) x = ((x = h) | List.member t x))"
```
```   338   by (simp add: member_def)
```
```   339
```
```   340 lemma FILTER: "(!P. filter P [] = []) & (!P h t.
```
```   341            filter P (h#t) = (if P h then h#filter P t else filter P t))"
```
```   342   by simp
```
```   343
```
```   344 lemma REPLICATE: "(ALL x. replicate 0 x = []) &
```
```   345   (ALL n x. replicate (Suc n) x = x # replicate n x)"
```
```   346   by simp
```
```   347
```
```   348 definition FOLDR :: "[['a,'b]\<Rightarrow>'b,'b,'a list] \<Rightarrow> 'b" where
```
```   349   "FOLDR f e l == foldr f l e"
```
```   350
```
```   351 lemma [hol4rew]: "FOLDR f e l = foldr f l e"
```
```   352   by (simp add: FOLDR_def)
```
```   353
```
```   354 lemma FOLDR: "(!f e. foldr f [] e = e) & (!f e x l. foldr f (x#l) e = f x (foldr f l e))"
```
```   355   by simp
```
```   356
```
```   357 lemma FOLDL: "(!f e. foldl f e [] = e) & (!f e x l. foldl f e (x#l) = foldl f (f e x) l)"
```
```   358   by simp
```
```   359
```
```   360 lemma EVERY_DEF: "(!P. list_all P [] = True) & (!P h t. list_all P (h#t) = (P h & list_all P t))"
```
```   361   by simp
```
```   362
```
```   363 lemma list_exists_DEF: "(!P. list_ex P [] = False) & (!P h t. list_ex P (h#t) = (P h | list_ex P t))"
```
```   364   by simp
```
```   365
```
```   366 primrec map2 :: "[['a,'b]\<Rightarrow>'c,'a list,'b list] \<Rightarrow> 'c list" where
```
```   367   map2_Nil: "map2 f [] l2 = []"
```
```   368 | map2_Cons: "map2 f (x#xs) l2 = f x (hd l2) # map2 f xs (tl l2)"
```
```   369
```
```   370 lemma MAP2: "(!f. map2 f [] [] = []) & (!f h1 t1 h2 t2. map2 f (h1#t1) (h2#t2) = f h1 h2#map2 f t1 t2)"
```
```   371   by simp
```
```   372
```
```   373 lemma list_INDUCT: "\<lbrakk> P [] ; !t. P t \<longrightarrow> (!h. P (h#t)) \<rbrakk> \<Longrightarrow> !l. P l"
```
```   374 proof
```
```   375   fix l
```
```   376   assume "P []"
```
```   377   assume allt: "!t. P t \<longrightarrow> (!h. P (h # t))"
```
```   378   show "P l"
```
```   379   proof (induct l)
```
```   380     show "P []" by fact
```
```   381   next
```
```   382     fix h t
```
```   383     assume "P t"
```
```   384     with allt
```
```   385     have "!h. P (h # t)"
```
```   386       by auto
```
```   387     thus "P (h # t)"
```
```   388       ..
```
```   389   qed
```
```   390 qed
```
```   391
```
```   392 lemma list_CASES: "(l = []) | (? t h. l = h#t)"
```
```   393   by (induct l,auto)
```
```   394
```
```   395 definition ZIP :: "'a list * 'b list \<Rightarrow> ('a * 'b) list" where
```
```   396   "ZIP == %(a,b). zip a b"
```
```   397
```
```   398 lemma ZIP: "(zip [] [] = []) &
```
```   399   (!x1 l1 x2 l2. zip (x1#l1) (x2#l2) = (x1,x2)#zip l1 l2)"
```
```   400   by simp
```
```   401
```
```   402 lemma [hol4rew]: "ZIP (a,b) = zip a b"
```
```   403   by (simp add: ZIP_def)
```
```   404
```
```   405 primrec unzip :: "('a * 'b) list \<Rightarrow> 'a list * 'b list" where
```
```   406   unzip_Nil: "unzip [] = ([],[])"
```
```   407 | unzip_Cons: "unzip (xy#xys) = (let zs = unzip xys in (fst xy # fst zs,snd xy # snd zs))"
```
```   408
```
```   409 lemma UNZIP: "(unzip [] = ([],[])) &
```
```   410          (!x l. unzip (x#l) = (fst x#fst (unzip l),snd x#snd (unzip l)))"
```
```   411   by (simp add: Let_def)
```
```   412
```
```   413 lemma REVERSE: "(rev [] = []) & (!h t. rev (h#t) = (rev t) @ [h])"
```
```   414   by simp
```
```   415
```
```   416 lemma REAL_SUP_ALLPOS: "\<lbrakk> ALL x. P (x::real) \<longrightarrow> 0 < x ; EX x. P x; EX z. ALL x. P x \<longrightarrow> x < z \<rbrakk> \<Longrightarrow> EX s. ALL y. (EX x. P x & y < x) = (y < s)"
```
```   417 proof safe
```
```   418   fix x z
```
```   419   assume allx: "ALL x. P x \<longrightarrow> 0 < x"
```
```   420   assume px: "P x"
```
```   421   assume allx': "ALL x. P x \<longrightarrow> x < z"
```
```   422   have "EX s. ALL y. (EX x : Collect P. y < x) = (y < s)"
```
```   423   proof (rule posreal_complete)
```
```   424     show "ALL x : Collect P. 0 < x"
```
```   425     proof safe
```
```   426       fix x
```
```   427       assume P: "P x"
```
```   428       from allx
```
```   429       have "P x \<longrightarrow> 0 < x"
```
```   430         ..
```
```   431       with P show "0 < x" by simp
```
```   432     qed
```
```   433   next
```
```   434     from px
```
```   435     show "EX x. x : Collect P"
```
```   436       by auto
```
```   437   next
```
```   438     from allx'
```
```   439     show "EX y. ALL x : Collect P. x < y"
```
```   440       apply simp
```
```   441       ..
```
```   442   qed
```
```   443   thus "EX s. ALL y. (EX x. P x & y < x) = (y < s)"
```
```   444     by simp
```
```   445 qed
```
```   446
```
```   447 lemma REAL_10: "~((1::real) = 0)"
```
```   448   by simp
```
```   449
```
```   450 lemma REAL_ADD_ASSOC: "(x::real) + (y + z) = x + y + z"
```
```   451   by simp
```
```   452
```
```   453 lemma REAL_MUL_ASSOC: "(x::real) * (y * z) = x * y * z"
```
```   454   by simp
```
```   455
```
```   456 lemma REAL_ADD_LINV:  "-x + x = (0::real)"
```
```   457   by simp
```
```   458
```
```   459 lemma REAL_MUL_LINV: "x ~= (0::real) ==> inverse x * x = 1"
```
```   460   by simp
```
```   461
```
```   462 lemma REAL_LT_TOTAL: "((x::real) = y) | x < y | y < x"
```
```   463   by auto
```
```   464
```
```   465 lemma [hol4rew]: "real (0::nat) = 0"
```
```   466   by simp
```
```   467
```
```   468 lemma [hol4rew]: "real (1::nat) = 1"
```
```   469   by simp
```
```   470
```
```   471 lemma [hol4rew]: "real (2::nat) = 2"
```
```   472   by simp
```
```   473
```
```   474 lemma real_lte: "((x::real) <= y) = (~(y < x))"
```
```   475   by auto
```
```   476
```
```   477 lemma real_of_num: "((0::real) = 0) & (!n. real (Suc n) = real n + 1)"
```
```   478   by (simp add: real_of_nat_Suc)
```
```   479
```
```   480 lemma abs: "abs (x::real) = (if 0 <= x then x else -x)"
```
```   481   by (simp add: abs_if)
```
```   482
```
```   483 lemma pow: "(!x::real. x ^ 0 = 1) & (!x::real. ALL n. x ^ (Suc n) = x * x ^ n)"
```
```   484   by simp
```
```   485
```
```   486 definition real_gt :: "real => real => bool" where
```
```   487   "real_gt == %x y. y < x"
```
```   488
```
```   489 lemma [hol4rew]: "real_gt x y = (y < x)"
```
```   490   by (simp add: real_gt_def)
```
```   491
```
```   492 lemma real_gt: "ALL x (y::real). (y < x) = (y < x)"
```
```   493   by simp
```
```   494
```
```   495 definition real_ge :: "real => real => bool" where
```
```   496   "real_ge x y == y <= x"
```
```   497
```
```   498 lemma [hol4rew]: "real_ge x y = (y <= x)"
```
```   499   by (simp add: real_ge_def)
```
```   500
```
```   501 lemma real_ge: "ALL x y. (y <= x) = (y <= x)"
```
```   502   by simp
```
```   503
```
```   504 end
```