src/HOL/AxClasses/Lattice/Order.ML
author wenzelm
Mon, 29 Nov 1999 15:52:49 +0100
changeset 8039 a901bafe4578
parent 5711 5a1cd4b4b20e
permissions -rw-r--r--
Goal: tuned pris;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     1
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     2
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     3
(** basic properties of limits **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     4
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     5
(* uniqueness *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     6
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     7
val tac =
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     8
  rtac impI 1 THEN
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     9
  rtac (le_antisym RS mp) 1 THEN
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    10
  Fast_tac 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    11
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    12
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    13
Goalw [is_inf_def] "is_inf x y inf & is_inf x y inf' --> inf = inf'";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    14
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    15
qed "is_inf_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    16
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    17
Goalw [is_sup_def] "is_sup x y sup & is_sup x y sup' --> sup = sup'";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    18
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    19
qed "is_sup_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    20
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    21
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    22
Goalw [is_Inf_def] "is_Inf A inf & is_Inf A inf' --> inf = inf'";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    23
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    24
qed "is_Inf_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    25
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    26
Goalw [is_Sup_def] "is_Sup A sup & is_Sup A sup' --> sup = sup'";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    27
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    28
qed "is_Sup_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    29
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    30
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    31
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    32
(* commutativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    33
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    34
Goalw [is_inf_def] "is_inf x y inf = is_inf y x inf";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    35
  by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    36
qed "is_inf_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    37
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    38
Goalw [is_sup_def] "is_sup x y sup = is_sup y x sup";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    39
  by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    40
qed "is_sup_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    41
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    42
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    43
(* associativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    44
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    45
Goalw [is_inf_def] "is_inf x y xy & is_inf y z yz & is_inf xy z xyz --> is_inf x yz xyz";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    46
  by Safe_tac;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    47
  (*level 1*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    48
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    49
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    50
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    51
  (*level 4*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    52
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    53
    back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    54
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    55
    by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    56
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    57
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    58
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    59
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    60
  (*level 11*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    61
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    62
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    63
    back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    64
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    65
    by (rtac conjI 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    66
    by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    67
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    68
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    69
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    70
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    71
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    72
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    73
    by (etac conjI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    74
    back();     (* !! *)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    75
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    76
qed "is_inf_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    77
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    78
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
    79
Goalw [is_sup_def] "is_sup x y xy & is_sup y z yz & is_sup xy z xyz --> is_sup x yz xyz";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    80
  by Safe_tac;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    81
  (*level 1*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    82
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    83
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    84
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    85
  (*level 4*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    86
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    87
    back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    88
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    89
    by (rtac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    90
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    91
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    92
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    93
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    94
  (*level 11*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    95
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    96
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    97
    back();
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    98
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
    99
    by (rtac conjI 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   100
    by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   101
    by (etac mp 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   102
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   103
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   104
    by (etac conjI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   105
    back();     (* !! *)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   106
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   107
    by (rtac (le_trans RS mp) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   108
    by (etac conjI 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   109
    by (assume_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   110
qed "is_sup_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   111
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   112
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   113
(** limits in linear orders **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   114
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   115
Goalw [minimum_def, is_inf_def] "is_inf (x::'a::linear_order) y (minimum x y)";
4831
dae4d63a1318 Renamed expand_const -> split_const.
nipkow
parents: 4153
diff changeset
   116
  by (stac split_if 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   117
  by (REPEAT_FIRST (resolve_tac [conjI, impI]));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   118
  (*case "x [= y"*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   119
    by (rtac le_refl 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   120
    by (assume_tac 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   121
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   122
  (*case "~ x [= y"*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   123
    by (rtac (le_linear RS disjE) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   124
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   125
    by (etac notE 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   126
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   127
    by (rtac le_refl 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   128
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   129
qed "min_is_inf";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   130
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   131
Goalw [maximum_def, is_sup_def] "is_sup (x::'a::linear_order) y (maximum x y)";
4831
dae4d63a1318 Renamed expand_const -> split_const.
nipkow
parents: 4153
diff changeset
   132
  by (stac split_if 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   133
  by (REPEAT_FIRST (resolve_tac [conjI, impI]));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   134
  (*case "x [= y"*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   135
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   136
    by (rtac le_refl 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   137
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   138
  (*case "~ x [= y"*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   139
    by (rtac le_refl 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   140
    by (rtac (le_linear RS disjE) 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   141
    by (assume_tac 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   142
    by (etac notE 1);
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   143
    by (assume_tac 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   144
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   145
qed "max_is_sup";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   146
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   147
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   148
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   149
(** general vs. binary limits **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   150
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   151
Goalw [is_inf_def, is_Inf_def] "is_Inf {x, y} inf = is_inf x y inf";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   152
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   153
  (*==>*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   154
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   155
  (*<==*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   156
    by Safe_tac;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   157
    by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   158
    by (etac mp 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   159
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   160
qed "bin_is_Inf_eq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   161
5069
3ea049f7979d isatool fixgoal;
wenzelm
parents: 4831
diff changeset
   162
Goalw [is_sup_def, is_Sup_def] "is_Sup {x, y} sup = is_sup x y sup";
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   163
  by (rtac iffI 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   164
  (*==>*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   165
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   166
  (*<==*)
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   167
    by Safe_tac;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   168
    by (Step_tac 1);
4153
e534c4c32d54 Ran expandshort, especially to introduce Safe_tac
paulson
parents: 4091
diff changeset
   169
    by (etac mp 1);
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   170
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   171
qed "bin_is_Sup_eq";