src/HOL/AxClasses/Lattice/Order.ML
author wenzelm
Tue, 27 May 1997 15:45:07 +0200
changeset 3362 0b268cff9344
parent 2606 27cdd600a3b1
child 4091 771b1f6422a8
permissions -rw-r--r--
NJ 1.09.2x as factory default!
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
open Order;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     3
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     4
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     5
(** basic properties of limits **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     6
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     7
(* uniqueness *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     8
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
     9
val tac =
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    10
  rtac impI 1 THEN
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    11
  rtac (le_antisym RS mp) 1 THEN
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    12
  Fast_tac 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    13
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    14
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    15
goalw thy [is_inf_def] "is_inf x y inf & is_inf x y inf' --> inf = inf'";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    16
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    17
qed "is_inf_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    18
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    19
goalw thy [is_sup_def] "is_sup x y sup & is_sup x y sup' --> sup = sup'";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    20
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    21
qed "is_sup_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    22
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    23
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    24
goalw thy [is_Inf_def] "is_Inf A inf & is_Inf A inf' --> inf = inf'";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    25
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    26
qed "is_Inf_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    27
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    28
goalw thy [is_Sup_def] "is_Sup A sup & is_Sup A sup' --> sup = sup'";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    29
  by tac;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    30
qed "is_Sup_uniq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    31
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    32
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    33
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    34
(* commutativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    35
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    36
goalw thy [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
    37
  by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    38
qed "is_inf_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    39
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    40
goalw thy [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
    41
  by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    42
qed "is_sup_commut";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    43
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    44
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    45
(* associativity *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    46
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    47
goalw thy [is_inf_def] "is_inf x y xy & is_inf y z yz & is_inf xy z xyz --> is_inf x yz xyz";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    48
  by (safe_tac (!claset));
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    49
  (*level 1*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    50
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    51
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    52
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    53
  (*level 4*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    54
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    55
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    56
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    57
    br conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    58
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    59
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    60
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    61
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    62
  (*level 11*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    63
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    64
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    65
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    66
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    67
    br conjI 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    68
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    69
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    70
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    71
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    72
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    73
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    74
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    75
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    76
    back();     (* !! *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    77
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    78
qed "is_inf_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    79
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    80
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    81
goalw thy [is_sup_def] "is_sup x y xy & is_sup y z yz & is_sup xy z xyz --> is_sup x yz xyz";
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    82
  by (safe_tac (!claset));
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    83
  (*level 1*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    84
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    85
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    86
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    87
  (*level 4*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    88
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    89
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    90
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    91
    br conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    92
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    93
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    94
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    95
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    96
  (*level 11*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
    97
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    98
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
    99
    back();
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   100
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   101
    br conjI 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   102
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   103
    be mp 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   104
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   105
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   106
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   107
    back();     (* !! *)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   108
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   109
    br (le_trans RS mp) 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   110
    be conjI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   111
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   112
qed "is_sup_assoc";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   113
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   114
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   115
(** limits in linear orders **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   116
2606
27cdd600a3b1 tuned names: partial order, linear order;
wenzelm
parents: 1899
diff changeset
   117
goalw thy [minimum_def, is_inf_def] "is_inf (x::'a::linear_order) y (minimum x y)";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   118
  by (stac expand_if 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   119
  by (REPEAT_FIRST (resolve_tac [conjI, impI]));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   120
  (*case "x [= y"*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   121
    br le_refl 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   122
    ba 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   123
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   124
  (*case "~ x [= y"*)
2606
27cdd600a3b1 tuned names: partial order, linear order;
wenzelm
parents: 1899
diff changeset
   125
    br (le_linear RS disjE) 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   126
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   127
    be notE 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   128
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   129
    br le_refl 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   130
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   131
qed "min_is_inf";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   132
2606
27cdd600a3b1 tuned names: partial order, linear order;
wenzelm
parents: 1899
diff changeset
   133
goalw thy [maximum_def, is_sup_def] "is_sup (x::'a::linear_order) y (maximum x y)";
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   134
  by (stac expand_if 1);
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   135
  by (REPEAT_FIRST (resolve_tac [conjI, impI]));
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   136
  (*case "x [= y"*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   137
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   138
    br le_refl 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   139
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   140
  (*case "~ x [= y"*)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   141
    br le_refl 1;
2606
27cdd600a3b1 tuned names: partial order, linear order;
wenzelm
parents: 1899
diff changeset
   142
    br (le_linear RS disjE) 1;
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   143
    ba 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   144
    be notE 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   145
    ba 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   146
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   147
qed "max_is_sup";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   148
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   149
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   150
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   151
(** general vs. binary limits **)
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   152
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   153
goalw thy [is_inf_def, is_Inf_def] "is_Inf {x, y} inf = is_inf x y inf";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   154
  br iffI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   155
  (*==>*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   156
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   157
  (*<==*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   158
    by (safe_tac (!claset));
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   159
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   160
    be mp 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   161
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   162
qed "bin_is_Inf_eq";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   163
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   164
goalw thy [is_sup_def, is_Sup_def] "is_Sup {x, y} sup = is_sup x y sup";
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   165
  br iffI 1;
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   166
  (*==>*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   167
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   168
  (*<==*)
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   169
    by (safe_tac (!claset));
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   170
    by (Step_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   171
    be mp 1;
1899
0075a8d26a80 Classical tactics now use default claset.
berghofe
parents: 1440
diff changeset
   172
    by (Fast_tac 1);
1440
de6f18da81bb added this stuff;
wenzelm
parents:
diff changeset
   173
qed "bin_is_Sup_eq";