src/HOL/Lambda/Confluence.ML
author nipkow
Thu, 29 Jun 1995 10:43:07 +0200
changeset 1161 1831ba01c90c
parent 1153 5c5daf97cf2d
child 1266 3ae9fe3c0f68
permissions -rw-r--r--
Minimal proof tuning.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1120
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/Lambda/Confluence.thy
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     4
    Copyright   1995 TU Muenchen
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     5
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     6
Basic confluence lemmas.
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     7
*)
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     8
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
     9
open Confluence;
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    10
1153
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    11
goal Confluence.thy
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    12
  "!!R. [| !x y z. (x,y):R --> (x,z):S --> (? u. (y,u):S & (z,u):R); \
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    13
\          (x,y):R; (x,z):S^* |] ==> ? u. (y,u):S^* & (z,u):R";
1124
a6233ea105a4 Polished the presentation making it completely definitional.
nipkow
parents: 1120
diff changeset
    14
be rtrancl_induct 1;
1131
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    15
by(fast_tac trancl_cs 1);
1124
a6233ea105a4 Polished the presentation making it completely definitional.
nipkow
parents: 1120
diff changeset
    16
by(fast_tac (HOL_cs addSEs [rtrancl_into_rtrancl]) 1);
1153
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    17
qed "commute_rtrancl";
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    18
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    19
goal HOL.thy "!!P. ? x.P(x) & Q(x) ==> ? x. Q(x) & P(x)";
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    20
by(fast_tac HOL_cs 1);
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    21
val lemma = result();
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    22
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    23
goalw Confluence.thy [diamond_def]
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    24
  "!!R. diamond(R) ==> diamond(R^*)";
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    25
by(best_tac (HOL_cs addIs [commute_rtrancl,commute_rtrancl RS lemma]) 1);
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    26
qed "diamond_diamond_rtrancl";
1120
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    27
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    28
goalw Confluence.thy [confluent_def]
1124
a6233ea105a4 Polished the presentation making it completely definitional.
nipkow
parents: 1120
diff changeset
    29
  "!!R.[| diamond(R); T <= R; R <= T^* |] ==> confluent(T)";
1120
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    30
bd rtrancl_mono 1;
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    31
bd rtrancl_mono 1;
1153
5c5daf97cf2d Simplified the confluence proofs.
nipkow
parents: 1131
diff changeset
    32
by(fast_tac (HOL_cs addIs [diamond_diamond_rtrancl]
1120
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    33
                    addDs [subset_antisym]
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    34
                    addss (HOL_ss addsimps [rtrancl_idemp])) 1);
ff7dd80513e6 Lambda calculus in de Bruijn notation.
nipkow
parents:
diff changeset
    35
qed "diamond_to_confluence";
1131
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    36
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    37
goalw Confluence.thy [confluent_def,diamond_def,Church_Rosser_def]
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    38
  "Church_Rosser(R) = confluent(R)";
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    39
br iffI 1;
1161
1831ba01c90c Minimal proof tuning.
nipkow
parents: 1153
diff changeset
    40
 by(fast_tac (HOL_cs addIs
1831ba01c90c Minimal proof tuning.
nipkow
parents: 1153
diff changeset
    41
      [Un_upper2 RS rtrancl_mono RS subsetD RS rtrancl_trans,
1831ba01c90c Minimal proof tuning.
nipkow
parents: 1153
diff changeset
    42
       rtrancl_converseI, converseI, Un_upper1 RS rtrancl_mono RS subsetD])1);
1831ba01c90c Minimal proof tuning.
nipkow
parents: 1153
diff changeset
    43
by(safe_tac HOL_cs);
1131
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    44
be rtrancl_induct 1;
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    45
 by(fast_tac trancl_cs 1);
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    46
 by(slow_tac (rel_cs addIs [r_into_rtrancl]
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    47
                     addEs [rtrancl_trans,r_into_rtrancl RS rtrancl_trans]) 1);
8e81ad0c6f12 Added Church-Rosser
nipkow
parents: 1124
diff changeset
    48
qed "Church_Rosser_confluent";