| 
6882
 | 
     1  | 
(*  Title:      HOL/Isar_examples/KnasterTarski.thy
  | 
| 
 | 
     2  | 
    ID:         $Id$
  | 
| 
 | 
     3  | 
    Author:     Markus Wenzel, TU Muenchen
  | 
| 
 | 
     4  | 
  | 
| 
 | 
     5  | 
Typical textbook proof example.
  | 
| 
 | 
     6  | 
*)
  | 
| 
 | 
     7  | 
  | 
| 
 | 
     8  | 
  | 
| 
 | 
     9  | 
theory KnasterTarski = Main:;
  | 
| 
 | 
    10  | 
  | 
| 
6883
 | 
    11  | 
  | 
| 
 | 
    12  | 
theorems [dest] = monoD;  (* FIXME [dest!!] *)
  | 
| 
6882
 | 
    13  | 
  | 
| 
6893
 | 
    14  | 
text {*
 | 
| 
6898
 | 
    15  | 
 The proofs of Knaster-Tarski below closely follows the presentation in
  | 
| 
6883
 | 
    16  | 
 'Introduction to Lattices' and Order by Davey/Priestley, pages
  | 
| 
6884
 | 
    17  | 
 93--94.  All of their narration has been rephrased in terms of formal
  | 
| 
6897
 | 
    18  | 
 Isar language elements.  Just as many textbook-style proofs, there is
  | 
| 
 | 
    19  | 
 a strong bias towards forward reasoning, and little hierarchical
  | 
| 
 | 
    20  | 
 structure.
  | 
| 
6893
 | 
    21  | 
*};
  | 
| 
6882
 | 
    22  | 
  | 
| 
6898
 | 
    23  | 
theorem KnasterTarski1: "mono f ==> EX a::'a set. f a = a";
  | 
| 
6882
 | 
    24  | 
proof;
  | 
| 
 | 
    25  | 
  let ??H = "{u. f u <= u}";
 | 
| 
 | 
    26  | 
  let ??a = "Inter ??H";
  | 
| 
 | 
    27  | 
  | 
| 
6897
 | 
    28  | 
  assume mono: "mono f";
  | 
| 
 | 
    29  | 
  show "f ??a = ??a";
  | 
| 
6882
 | 
    30  | 
  proof same;
  | 
| 
6897
 | 
    31  | 
    {{;
 | 
| 
 | 
    32  | 
      fix x;
  | 
| 
 | 
    33  | 
      assume mem: "x : ??H";
  | 
| 
 | 
    34  | 
      hence "??a <= x"; by (rule Inter_lower);
  | 
| 
 | 
    35  | 
      with mono; have "f ??a <= f x"; ..;
  | 
| 
 | 
    36  | 
      also; from mem; have "... <= x"; ..;
  | 
| 
 | 
    37  | 
      finally (order_trans); have "f ??a <= x"; .;
  | 
| 
 | 
    38  | 
    }};
  | 
| 
6882
 | 
    39  | 
    hence ge: "f ??a <= ??a"; by (rule Inter_greatest);
  | 
| 
6897
 | 
    40  | 
    thus ??thesis;
  | 
| 
 | 
    41  | 
    proof (rule order_antisym);
  | 
| 
 | 
    42  | 
      from mono ge; have "f (f ??a) <= f ??a"; ..;
  | 
| 
 | 
    43  | 
      hence "f ??a : ??H"; ..;
  | 
| 
 | 
    44  | 
      thus "??a <= f ??a"; by (rule Inter_lower);
  | 
| 
 | 
    45  | 
    qed;
  | 
| 
6882
 | 
    46  | 
  qed;
  | 
| 
 | 
    47  | 
qed;
  | 
| 
 | 
    48  | 
  | 
| 
 | 
    49  | 
  | 
| 
6898
 | 
    50  | 
theorem KnasterTarski2: "mono f ==> EX a::'a set. f a = a";
  | 
| 
 | 
    51  | 
proof;
  | 
| 
 | 
    52  | 
  let ??H = "{u. f u <= u}";
 | 
| 
 | 
    53  | 
  let ??a = "Inter ??H";
  | 
| 
 | 
    54  | 
  | 
| 
 | 
    55  | 
  assume mono: "mono f";
  | 
| 
 | 
    56  | 
  show "f ??a = ??a";
  | 
| 
 | 
    57  | 
  proof same;
  | 
| 
 | 
    58  | 
    {{;
 | 
| 
 | 
    59  | 
      fix x;
  | 
| 
 | 
    60  | 
      assume mem: "x : ??H";
  | 
| 
 | 
    61  | 
      hence "??a <= x"; by (rule Inter_lower);
  | 
| 
 | 
    62  | 
      with mono; have "f ??a <= f x"; ..;
  | 
| 
 | 
    63  | 
      also; from mem; have "... <= x"; ..;
  | 
| 
 | 
    64  | 
      finally (order_trans); have "f ??a <= x"; .;
  | 
| 
 | 
    65  | 
    }};
  | 
| 
 | 
    66  | 
    hence ge: "f ??a <= ??a"; by (rule Inter_greatest);
  | 
| 
 | 
    67  | 
    {{;
 | 
| 
 | 
    68  | 
      also; presume "... <= f ??a";
  | 
| 
 | 
    69  | 
      finally (order_antisym); show ??thesis; .;
  | 
| 
 | 
    70  | 
    }};
  | 
| 
 | 
    71  | 
    from mono ge; have "f (f ??a) <= f ??a"; ..;
  | 
| 
 | 
    72  | 
    hence "f ??a : ??H"; ..;
  | 
| 
 | 
    73  | 
    thus "??a <= f ??a"; by (rule Inter_lower);
  | 
| 
 | 
    74  | 
  qed;
  | 
| 
 | 
    75  | 
qed;
  | 
| 
 | 
    76  | 
  | 
| 
 | 
    77  | 
  | 
| 
6882
 | 
    78  | 
end;
  |