src/HOL/Ord.thy
author wenzelm
Wed, 29 Aug 2001 21:17:24 +0200
changeset 11506 244a02a2968b
parent 11454 7514e5e21cb8
child 11653 93aaafb6431b
permissions -rw-r--r--
avoid ML bindings;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title:      HOL/Ord.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author:     Tobias Nipkow, Cambridge University Computer Laboratory
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
2624
ab311b6e5e29 fixed comment;
wenzelm
parents: 2608
diff changeset
     6
Type classes for order signatures and orders.
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
     9
theory Ord = HOL:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
5889
d3ecef6b5682 Classical.setup, attrib_setup;
wenzelm
parents: 4640
diff changeset
    11
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
axclass
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    13
  ord < "term"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3143
diff changeset
    15
syntax
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    16
  "op <"        :: "['a::ord, 'a] => bool"             ("op <")
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    17
  "op <="       :: "['a::ord, 'a] => bool"             ("op <=")
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3143
diff changeset
    18
8882
9df44a4f1bf7 fewer consts declared as global;
wenzelm
parents: 7357
diff changeset
    19
global
9df44a4f1bf7 fewer consts declared as global;
wenzelm
parents: 7357
diff changeset
    20
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
consts
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    22
  "op <"        :: "['a::ord, 'a] => bool"             ("(_/ < _)"  [50, 51] 50)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    23
  "op <="       :: "['a::ord, 'a] => bool"             ("(_/ <= _)" [50, 51] 50)
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
8882
9df44a4f1bf7 fewer consts declared as global;
wenzelm
parents: 7357
diff changeset
    25
local
2608
450c9b682a92 New class "order" and accompanying changes.
nipkow
parents: 2259
diff changeset
    26
3820
46b255e140dc fixed infix syntax;
wenzelm
parents: 3143
diff changeset
    27
syntax (symbols)
11451
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
    28
  "op <="       :: "['a::ord, 'a] => bool"             ("op \\<le>")
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
    29
  "op <="       :: "['a::ord, 'a] => bool"             ("(_/ \\<le> _)"  [50, 51] 50)
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    30
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    31
(*Tell Blast_tac about overloading of < and <= to reduce the risk of
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    32
  its applying a rule for the wrong type*)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    33
ML {*
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    34
Blast.overloaded ("op <" , domain_type);
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    35
Blast.overloaded ("op <=", domain_type);
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    36
*}
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    37
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    38
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    39
constdefs
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    40
  mono          :: "['a::ord => 'b::ord] => bool"      (*monotonicity*)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    41
                "mono(f)   == (!A B. A <= B --> f(A) <= f(B))"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    42
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    43
lemma monoI [intro?]: "[| !!A B. A <= B ==> f(A) <= f(B) |] ==> mono(f)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    44
apply (unfold mono_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    45
apply fast
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    46
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    47
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    48
lemma monoD [dest?]: "[| mono(f);  A <= B |] ==> f(A) <= f(B)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    49
apply (unfold mono_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    50
apply fast
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    51
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    52
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    53
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    54
constdefs
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    55
  min     :: "['a::ord, 'a] => 'a"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    56
             "min a b   == (if a <= b then a else b)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    57
  max     :: "['a::ord, 'a] => 'a"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    58
             "max a b   == (if a <= b then b else a)"
2259
e6d738f2b9a9 fixed comment;
wenzelm
parents: 2006
diff changeset
    59
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    60
lemma min_leastL: "(!!x. least <= x) ==> min least x = least"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    61
apply (simp add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    62
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    63
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    64
lemma min_of_mono: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    65
  "!x y. (f x <= f y) = (x <= y) ==> min (f m) (f n) = f (min m n)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    66
apply (simp add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    67
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    68
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    69
lemma max_leastL: "(!!x. least <= x) ==> max least x = x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    70
apply (simp add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    71
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    72
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    73
lemma max_of_mono: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    74
  "!x y. (f x <= f y) = (x <= y) ==> max (f m) (f n) = f (max m n)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    75
apply (simp add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    76
done
3947
eb707467f8c5 adapted to qualified names;
wenzelm
parents: 3820
diff changeset
    77
11367
7b2dbfb5cc3d addition of the GREATEST quantifier
paulson
parents: 11144
diff changeset
    78
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    79
section "Orders"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    80
2608
450c9b682a92 New class "order" and accompanying changes.
nipkow
parents: 2259
diff changeset
    81
axclass order < ord
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    82
  order_refl [iff]:                          "x <= x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    83
  order_trans:      "[| x <= y; y <= z |] ==> x <= z"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    84
  order_antisym:    "[| x <= y; y <= x |] ==> x = y"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    85
  order_less_le:    "x < y = (x <= y & x ~= y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    86
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    87
(** Reflexivity **)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    88
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    89
(*This form is useful with the classical reasoner*)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    90
lemma order_eq_refl: "!!x::'a::order. x = y ==> x <= y"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    91
apply (erule ssubst)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    92
apply (rule order_refl)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    93
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    94
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    95
lemma order_less_irrefl [simp]: "~ x < (x::'a::order)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    96
apply (simp (no_asm) add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    97
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    98
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
    99
lemma order_le_less: "(x::'a::order) <= y = (x < y | x = y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   100
apply (simp (no_asm) add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   101
   (*NOT suitable for AddIffs, since it can cause PROOF FAILED*)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   102
apply (blast intro!: order_refl)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   103
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   104
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   105
lemmas order_le_imp_less_or_eq = order_le_less [THEN iffD1, standard]
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   106
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   107
lemma order_less_imp_le: "!!x::'a::order. x < y ==> x <= y"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   108
apply (simp add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   109
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   110
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   111
(** Asymmetry **)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   112
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   113
lemma order_less_not_sym: "(x::'a::order) < y ==> ~ (y<x)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   114
apply (simp add: order_less_le order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   115
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   116
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   117
(* [| n<m;  ~P ==> m<n |] ==> P *)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   118
lemmas order_less_asym = order_less_not_sym [THEN contrapos_np, standard]
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   119
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   120
(* Transitivity *)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   121
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   122
lemma order_less_trans: "!!x::'a::order. [| x < y; y < z |] ==> x < z"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   123
apply (simp add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   124
apply (blast intro: order_trans order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   125
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   126
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   127
lemma order_le_less_trans: "!!x::'a::order. [| x <= y; y < z |] ==> x < z"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   128
apply (simp add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   129
apply (blast intro: order_trans order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   130
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   131
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   132
lemma order_less_le_trans: "!!x::'a::order. [| x < y; y <= z |] ==> x < z"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   133
apply (simp add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   134
apply (blast intro: order_trans order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   135
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   136
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   137
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   138
(** Useful for simplification, but too risky to include by default. **)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   139
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   140
lemma order_less_imp_not_less: "(x::'a::order) < y ==>  (~ y < x) = True"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   141
apply (blast elim: order_less_asym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   142
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   143
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   144
lemma order_less_imp_triv: "(x::'a::order) < y ==>  (y < x --> P) = True"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   145
apply (blast elim: order_less_asym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   146
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   147
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   148
lemma order_less_imp_not_eq: "(x::'a::order) < y ==>  (x = y) = False"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   149
apply auto
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   150
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   151
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   152
lemma order_less_imp_not_eq2: "(x::'a::order) < y ==>  (y = x) = False"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   153
apply auto
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   154
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   155
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   156
(* Other operators *)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   157
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   158
lemma min_leastR: "(!!x::'a::order. least <= x) ==> min x least = least"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   159
apply (simp (no_asm_simp) add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   160
apply (blast intro: order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   161
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   162
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   163
lemma max_leastR: "(!!x::'a::order. least <= x) ==> max x least = x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   164
apply (simp add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   165
apply (blast intro: order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   166
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   167
11451
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   168
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   169
(** Least value operator **)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   170
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   171
(*We can no longer use LeastM because the latter requires Hilbert-AC*)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   172
constdefs
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   173
  Least    :: "('a::ord => bool) => 'a"               (binder "LEAST " 10)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   174
    "Least P == THE x. P x & (ALL y. P y --> x <= y)"
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   175
11454
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   176
lemma LeastI2:
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   177
  "[| P (x::'a::order); 
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   178
      !!y. P y ==> x <= y;
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   179
      !!x. [| P x; \\<forall>y. P y --> x \\<le> y |] ==> Q x |]
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   180
   ==> Q (Least P)";
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   181
apply (unfold Least_def)
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   182
apply (rule theI2)
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   183
  apply (blast intro: order_antisym)+
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   184
done
7514e5e21cb8 Hilbert restructuring: Wellfounded_Relations no longer needs Hilbert_Choice
paulson
parents: 11451
diff changeset
   185
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   186
lemma Least_equality:
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   187
  "[| P (k::'a::order); !!x. P x ==> k <= x |] ==> (LEAST x. P x) = k";
11451
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   188
apply (simp add: Least_def)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   189
apply (rule the_equality)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   190
apply (auto intro!: order_antisym) 
11367
7b2dbfb5cc3d addition of the GREATEST quantifier
paulson
parents: 11144
diff changeset
   191
done
7b2dbfb5cc3d addition of the GREATEST quantifier
paulson
parents: 11144
diff changeset
   192
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   193
section "Linear/Total Orders"
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   194
4640
ac6cf9f18653 Congruence rules use == in premises now.
nipkow
parents: 3947
diff changeset
   195
axclass linorder < order
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   196
  linorder_linear: "x <= y | y <= x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   197
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   198
lemma linorder_less_linear: "!!x::'a::linorder. x<y | x=y | y<x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   199
apply (simp (no_asm) add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   200
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   201
apply blast
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   202
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   203
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   204
lemma linorder_less_split: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   205
  "[| (x::'a::linorder)<y ==> P; x=y ==> P; y<x ==> P |] ==> P"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   206
apply (cut_tac linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   207
apply blast
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   208
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   209
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   210
lemma linorder_not_less: "!!x::'a::linorder. (~ x < y) = (y <= x)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   211
apply (simp (no_asm) add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   212
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   213
apply (blast intro: order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   214
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   215
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   216
lemma linorder_not_le: "!!x::'a::linorder. (~ x <= y) = (y < x)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   217
apply (simp (no_asm) add: order_less_le)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   218
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   219
apply (blast intro: order_antisym)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   220
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   221
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   222
lemma linorder_neq_iff: "!!x::'a::linorder. (x ~= y) = (x<y | y<x)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   223
apply (cut_tac x = "x" and y = "y" in linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   224
apply auto
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   225
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   226
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   227
(* eliminates ~= in premises *)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   228
lemmas linorder_neqE = linorder_neq_iff [THEN iffD1, THEN disjE, standard]
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   229
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   230
section "min & max on (linear) orders"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   231
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   232
lemma min_same [simp]: "min (x::'a::order) x = x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   233
apply (simp add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   234
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   235
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   236
lemma max_same [simp]: "max (x::'a::order) x = x"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   237
apply (simp add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   238
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   239
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   240
lemma le_max_iff_disj: "!!z::'a::linorder. (z <= max x y) = (z <= x | z <= y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   241
apply (unfold max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   242
apply (simp (no_asm))
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   243
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   244
apply (blast intro: order_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   245
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   246
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   247
lemma le_maxI1: "(x::'a::linorder) <= max x y"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   248
apply (simp (no_asm) add: le_max_iff_disj)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   249
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   250
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   251
lemma le_maxI2: "(y::'a::linorder) <= max x y"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   252
apply (simp (no_asm) add: le_max_iff_disj)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   253
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   254
(*CANNOT use with AddSIs because blast_tac will give PROOF FAILED.*)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   255
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   256
lemma less_max_iff_disj: "!!z::'a::linorder. (z < max x y) = (z < x | z < y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   257
apply (simp (no_asm) add: max_def order_le_less)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   258
apply (cut_tac linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   259
apply (blast intro: order_less_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   260
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   261
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   262
lemma max_le_iff_conj [simp]: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   263
  "!!z::'a::linorder. (max x y <= z) = (x <= z & y <= z)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   264
apply (simp (no_asm) add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   265
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   266
apply (blast intro: order_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   267
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   268
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   269
lemma max_less_iff_conj [simp]: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   270
  "!!z::'a::linorder. (max x y < z) = (x < z & y < z)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   271
apply (simp (no_asm) add: order_le_less max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   272
apply (cut_tac linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   273
apply (blast intro: order_less_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   274
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   275
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   276
lemma le_min_iff_conj [simp]: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   277
  "!!z::'a::linorder. (z <= min x y) = (z <= x & z <= y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   278
apply (simp (no_asm) add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   279
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   280
apply (blast intro: order_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   281
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   282
(* AddIffs screws up a blast_tac in MiniML *)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   283
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   284
lemma min_less_iff_conj [simp]:
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   285
  "!!z::'a::linorder. (z < min x y) = (z < x & z < y)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   286
apply (simp (no_asm) add: order_le_less min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   287
apply (cut_tac linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   288
apply (blast intro: order_less_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   289
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   290
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   291
lemma min_le_iff_disj: "!!z::'a::linorder. (min x y <= z) = (x <= z | y <= z)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   292
apply (unfold min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   293
apply (simp (no_asm))
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   294
apply (cut_tac linorder_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   295
apply (blast intro: order_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   296
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   297
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   298
lemma min_less_iff_disj: "!!z::'a::linorder. (min x y < z) = (x < z | y < z)"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   299
apply (unfold min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   300
apply (simp (no_asm) add: order_le_less)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   301
apply (cut_tac linorder_less_linear)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   302
apply (blast intro: order_less_trans)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   303
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   304
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   305
lemma split_min: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   306
 "P(min (i::'a::linorder) j) = ((i <= j --> P(i)) & (~ i <= j --> P(j)))"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   307
apply (simp (no_asm) add: min_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   308
done
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   309
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   310
lemma split_max: 
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   311
 "P(max (i::'a::linorder) j) = ((i <= j --> P(j)) & (~ i <= j --> P(i)))"
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   312
apply (simp (no_asm) add: max_def)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   313
done
4640
ac6cf9f18653 Congruence rules use == in premises now.
nipkow
parents: 3947
diff changeset
   314
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   315
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   316
section "bounded quantifiers"
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   317
6402
2b23e14dd386 New bounded quantifier syntax: !x<i. P etc
nipkow
parents: 5953
diff changeset
   318
syntax
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   319
  "_lessAll" :: "[idt, 'a, bool] => bool"  ("(3ALL _<_./ _)"  [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   320
  "_lessEx"  :: "[idt, 'a, bool] => bool"  ("(3EX _<_./ _)"  [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   321
  "_leAll"   :: "[idt, 'a, bool] => bool"  ("(3ALL _<=_./ _)" [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   322
  "_leEx"    :: "[idt, 'a, bool] => bool"  ("(3EX _<=_./ _)" [0, 0, 10] 10)
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   323
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   324
syntax (symbols)
11451
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   325
  "_lessAll" :: "[idt, 'a, bool] => bool"  ("(3\\<forall>_<_./ _)"  [0, 0, 10] 10)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   326
  "_lessEx"  :: "[idt, 'a, bool] => bool"  ("(3\\<exists>_<_./ _)"  [0, 0, 10] 10)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   327
  "_leAll"   :: "[idt, 'a, bool] => bool"  ("(3\\<forall>_\\<le>_./ _)" [0, 0, 10] 10)
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   328
  "_leEx"    :: "[idt, 'a, bool] => bool"  ("(3\\<exists>_\\<le>_./ _)" [0, 0, 10] 10)
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   329
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   330
syntax (HOL)
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   331
  "_lessAll" :: "[idt, 'a, bool] => bool"  ("(3! _<_./ _)"  [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   332
  "_lessEx"  :: "[idt, 'a, bool] => bool"  ("(3? _<_./ _)"  [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   333
  "_leAll"   :: "[idt, 'a, bool] => bool"  ("(3! _<=_./ _)" [0, 0, 10] 10)
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   334
  "_leEx"    :: "[idt, 'a, bool] => bool"  ("(3? _<=_./ _)" [0, 0, 10] 10)
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   335
6402
2b23e14dd386 New bounded quantifier syntax: !x<i. P etc
nipkow
parents: 5953
diff changeset
   336
translations
7238
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   337
 "ALL x<y. P"   =>  "ALL x. x < y --> P"
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   338
 "EX x<y. P"    =>  "EX x. x < y  & P"
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   339
 "ALL x<=y. P"  =>  "ALL x. x <= y --> P"
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   340
 "EX x<=y. P"   =>  "EX x. x <= y & P"
36e58620ffc8 replaced HOL_quantifiers flag by "HOL" print mode;
wenzelm
parents: 6855
diff changeset
   341
6402
2b23e14dd386 New bounded quantifier syntax: !x<i. P etc
nipkow
parents: 5953
diff changeset
   342
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   343
ML
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   344
{*
11451
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   345
val Least_def = thm "Least_def";
8abfb4f7bd02 partial restructuring to reduce dependence on Axiom of Choice
paulson
parents: 11367
diff changeset
   346
val Least_equality = thm "Least_equality";
11140
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   347
val mono_def = thm "mono_def";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   348
val monoI = thm "monoI";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   349
val monoD = thm "monoD";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   350
val min_def = thm "min_def";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   351
val min_of_mono = thm "min_of_mono";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   352
val max_def = thm "max_def";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   353
val max_of_mono = thm "max_of_mono";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   354
val min_leastL = thm "min_leastL";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   355
val max_leastL = thm "max_leastL";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   356
val min_leastR = thm "min_leastR";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   357
val max_leastR = thm "max_leastR";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   358
val order_eq_refl = thm "order_eq_refl";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   359
val order_less_irrefl = thm "order_less_irrefl";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   360
val order_le_less = thm "order_le_less";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   361
val order_le_imp_less_or_eq = thm "order_le_imp_less_or_eq";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   362
val order_less_imp_le = thm "order_less_imp_le";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   363
val order_less_not_sym = thm "order_less_not_sym";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   364
val order_less_asym = thm "order_less_asym";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   365
val order_less_trans = thm "order_less_trans";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   366
val order_le_less_trans = thm "order_le_less_trans";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   367
val order_less_le_trans = thm "order_less_le_trans";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   368
val order_less_imp_not_less = thm "order_less_imp_not_less";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   369
val order_less_imp_triv = thm "order_less_imp_triv";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   370
val order_less_imp_not_eq = thm "order_less_imp_not_eq";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   371
val order_less_imp_not_eq2 = thm "order_less_imp_not_eq2";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   372
val linorder_less_linear = thm "linorder_less_linear";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   373
val linorder_less_split = thm "linorder_less_split";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   374
val linorder_not_less = thm "linorder_not_less";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   375
val linorder_not_le = thm "linorder_not_le";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   376
val linorder_neq_iff = thm "linorder_neq_iff";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   377
val linorder_neqE = thm "linorder_neqE";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   378
val min_same = thm "min_same";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   379
val max_same = thm "max_same";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   380
val le_max_iff_disj = thm "le_max_iff_disj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   381
val le_maxI1 = thm "le_maxI1";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   382
val le_maxI2 = thm "le_maxI2";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   383
val less_max_iff_disj = thm "less_max_iff_disj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   384
val max_le_iff_conj = thm "max_le_iff_conj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   385
val max_less_iff_conj = thm "max_less_iff_conj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   386
val le_min_iff_conj = thm "le_min_iff_conj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   387
val min_less_iff_conj = thm "min_less_iff_conj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   388
val min_le_iff_disj = thm "min_le_iff_disj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   389
val min_less_iff_disj = thm "min_less_iff_disj";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   390
val split_min = thm "split_min";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   391
val split_max = thm "split_max";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   392
val order_refl = thm "order_refl";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   393
val order_trans = thm "order_trans";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   394
val order_antisym = thm "order_antisym";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   395
val order_less_le = thm "order_less_le";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   396
val linorder_linear = thm "linorder_linear";
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   397
*}
a46eaedbeb2d Ord.thy/.ML converted to Isar
oheimb
parents: 10460
diff changeset
   398
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   399
end