src/HOL/Auth/OtwayRees.ML
author paulson
Fri Oct 18 11:38:17 1996 +0200 (1996-10-18)
changeset 2104 f5c9a91e4b50
parent 2071 0debdc018d26
child 2134 04a71407089d
permissions -rw-r--r--
Replaced excluded_middle_tac by case_tac; tidied proofs
paulson@1941
     1
(*  Title:      HOL/Auth/OtwayRees
paulson@1941
     2
    ID:         $Id$
paulson@1941
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@1941
     4
    Copyright   1996  University of Cambridge
paulson@1941
     5
paulson@1941
     6
Inductive relation "otway" for the Otway-Rees protocol.
paulson@1941
     7
paulson@2014
     8
Version that encrypts Nonce NB
paulson@2014
     9
paulson@1941
    10
From page 244 of
paulson@1941
    11
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@1941
    12
  Proc. Royal Soc. 426 (1989)
paulson@1941
    13
*)
paulson@1941
    14
paulson@1941
    15
open OtwayRees;
paulson@1941
    16
paulson@1941
    17
proof_timing:=true;
paulson@1941
    18
HOL_quantifiers := false;
paulson@1941
    19
paulson@1996
    20
paulson@2014
    21
(*Weak liveness: there are traces that reach the end*)
paulson@1996
    22
goal thy 
paulson@1996
    23
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
paulson@2032
    24
\        ==> EX K. EX NA. EX evs: otway lost.          \
paulson@2014
    25
\               Says B A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|} \
paulson@2014
    26
\                 : set_of_list evs";
paulson@1996
    27
by (REPEAT (resolve_tac [exI,bexI] 1));
paulson@2032
    28
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2);
paulson@1996
    29
by (ALLGOALS (simp_tac (!simpset setsolver safe_solver)));
paulson@1996
    30
by (REPEAT_FIRST (resolve_tac [refl, conjI]));
paulson@2104
    31
by (REPEAT_FIRST (fast_tac (!claset addss (!simpset setsolver safe_solver))));
paulson@2014
    32
result();
paulson@1996
    33
paulson@1996
    34
paulson@1941
    35
(**** Inductive proofs about otway ****)
paulson@1941
    36
paulson@2104
    37
(*Monotonicity*)
paulson@2032
    38
goal thy "!!evs. lost' <= lost ==> otway lost' <= otway lost";
paulson@2032
    39
by (rtac subsetI 1);
paulson@2032
    40
by (etac otway.induct 1);
paulson@2032
    41
by (REPEAT_FIRST
paulson@2032
    42
    (best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono)
paulson@2032
    43
                              :: otway.intrs))));
paulson@2032
    44
qed "otway_mono";
paulson@2032
    45
paulson@1941
    46
(*Nobody sends themselves messages*)
paulson@2032
    47
goal thy "!!evs. evs : otway lost ==> ALL A X. Says A A X ~: set_of_list evs";
paulson@2032
    48
by (etac otway.induct 1);
paulson@1941
    49
by (Auto_tac());
paulson@1941
    50
qed_spec_mp "not_Says_to_self";
paulson@1941
    51
Addsimps [not_Says_to_self];
paulson@1941
    52
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
paulson@1941
    53
paulson@1941
    54
paulson@1941
    55
(** For reasoning about the encrypted portion of messages **)
paulson@1941
    56
paulson@1996
    57
goal thy "!!evs. Says A' B {|N, Agent A, Agent B, X|} : set_of_list evs ==> \
paulson@2032
    58
\                X : analz (sees lost Spy evs)";
paulson@2032
    59
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
paulson@2032
    60
qed "OR2_analz_sees_Spy";
paulson@1941
    61
paulson@1996
    62
goal thy "!!evs. Says S B {|N, X, X'|} : set_of_list evs ==> \
paulson@2032
    63
\                X : analz (sees lost Spy evs)";
paulson@2032
    64
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
paulson@2032
    65
qed "OR4_analz_sees_Spy";
paulson@1941
    66
paulson@1996
    67
goal thy "!!evs. Says B' A {|N, Crypt {|N,K|} K'|} : set_of_list evs ==> \
paulson@2032
    68
\                K : parts (sees lost Spy evs)";
paulson@1941
    69
by (fast_tac (!claset addSEs partsEs
paulson@2032
    70
                      addSDs [Says_imp_sees_Spy RS parts.Inj]) 1);
paulson@2032
    71
qed "Reveal_parts_sees_Spy";
paulson@1941
    72
paulson@1941
    73
(*OR2_analz... and OR4_analz... let us treat those cases using the same 
paulson@1964
    74
  argument as for the Fake case.  This is possible for most, but not all,
paulson@1964
    75
  proofs: Fake does not invent new nonces (as in OR2), and of course Fake
paulson@2032
    76
  messages originate from the Spy. *)
paulson@1964
    77
paulson@2032
    78
bind_thm ("OR2_parts_sees_Spy",
paulson@2032
    79
          OR2_analz_sees_Spy RS (impOfSubs analz_subset_parts));
paulson@2032
    80
bind_thm ("OR4_parts_sees_Spy",
paulson@2032
    81
          OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
paulson@2032
    82
paulson@2032
    83
(*We instantiate the variable to "lost".  Leaving it as a Var makes proofs
paulson@2032
    84
  harder to complete, since simplification does less for us.*)
paulson@2014
    85
val parts_Fake_tac = 
paulson@2032
    86
    let val tac = forw_inst_tac [("lost","lost")] 
paulson@2032
    87
    in  tac OR2_parts_sees_Spy 4 THEN 
paulson@2032
    88
        tac OR4_parts_sees_Spy 6 THEN
paulson@2032
    89
        tac Reveal_parts_sees_Spy 7
paulson@2032
    90
    end;
paulson@1941
    91
paulson@2064
    92
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
paulson@2064
    93
fun parts_induct_tac i = SELECT_GOAL
paulson@2064
    94
    (DETERM (etac otway.induct 1 THEN parts_Fake_tac THEN
paulson@2064
    95
	     (*Fake message*)
paulson@2064
    96
	     TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
paulson@2064
    97
					   impOfSubs Fake_parts_insert]
paulson@2064
    98
                                    addss (!simpset)) 2)) THEN
paulson@2064
    99
     (*Base case*)
paulson@2064
   100
     fast_tac (!claset addss (!simpset)) 1 THEN
paulson@2064
   101
     ALLGOALS Asm_simp_tac) i;
paulson@1941
   102
paulson@2032
   103
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
paulson@2014
   104
    sends messages containing X! **)
paulson@1941
   105
paulson@2064
   106
(*Spy never sees another agent's shared key! (unless it's lost at start)*)
paulson@1941
   107
goal thy 
paulson@2032
   108
 "!!evs. [| evs : otway lost;  A ~: lost |]    \
paulson@2032
   109
\        ==> Key (shrK A) ~: parts (sees lost Spy evs)";
paulson@2064
   110
by (parts_induct_tac 1);
paulson@1941
   111
by (Auto_tac());
paulson@2032
   112
qed "Spy_not_see_shrK";
paulson@1941
   113
paulson@2032
   114
bind_thm ("Spy_not_analz_shrK",
paulson@2032
   115
          [analz_subset_parts, Spy_not_see_shrK] MRS contra_subsetD);
paulson@1941
   116
paulson@2032
   117
Addsimps [Spy_not_see_shrK, Spy_not_analz_shrK];
paulson@1941
   118
paulson@1964
   119
(*We go to some trouble to preserve R in the 3rd and 4th subgoals
paulson@1964
   120
  As usual fast_tac cannot be used because it uses the equalities too soon*)
paulson@1941
   121
val major::prems = 
paulson@2032
   122
goal thy  "[| Key (shrK A) : parts (sees lost Spy evs);       \
paulson@2032
   123
\             evs : otway lost;                                 \
paulson@2032
   124
\             A:lost ==> R                                  \
paulson@1941
   125
\           |] ==> R";
paulson@2032
   126
by (rtac ccontr 1);
paulson@2032
   127
by (rtac ([major, Spy_not_see_shrK] MRS rev_notE) 1);
paulson@1941
   128
by (swap_res_tac prems 2);
paulson@1967
   129
by (ALLGOALS (fast_tac (!claset addIs prems)));
paulson@2032
   130
qed "Spy_see_shrK_E";
paulson@1941
   131
paulson@2032
   132
bind_thm ("Spy_analz_shrK_E", 
paulson@2032
   133
          analz_subset_parts RS subsetD RS Spy_see_shrK_E);
paulson@1941
   134
paulson@2032
   135
AddSEs [Spy_see_shrK_E, Spy_analz_shrK_E];
paulson@1941
   136
paulson@1941
   137
paulson@1941
   138
(*** Future keys can't be seen or used! ***)
paulson@1941
   139
paulson@1941
   140
(*Nobody can have SEEN keys that will be generated in the future.
paulson@1941
   141
  This has to be proved anew for each protocol description,
paulson@1941
   142
  but should go by similar reasoning every time.  Hardest case is the
paulson@1941
   143
  standard Fake rule.  
paulson@2014
   144
      The Union over C is essential for the induction! *)
paulson@2032
   145
goal thy "!!evs. evs : otway lost ==> \
paulson@1941
   146
\                length evs <= length evs' --> \
paulson@2032
   147
\                          Key (newK evs') ~: (UN C. parts (sees lost C evs))";
paulson@2064
   148
by (parts_induct_tac 1);
paulson@1941
   149
by (REPEAT_FIRST (best_tac (!claset addDs [impOfSubs analz_subset_parts,
paulson@2032
   150
                                           impOfSubs parts_insert_subset_Un,
paulson@2032
   151
                                           Suc_leD]
paulson@2032
   152
                                    addss (!simpset))));
paulson@1941
   153
val lemma = result();
paulson@1941
   154
paulson@1941
   155
(*Variant needed for the main theorem below*)
paulson@1941
   156
goal thy 
paulson@2032
   157
 "!!evs. [| evs : otway lost;  length evs <= length evs' |]    \
paulson@2032
   158
\        ==> Key (newK evs') ~: parts (sees lost C evs)";
paulson@1941
   159
by (fast_tac (!claset addDs [lemma]) 1);
paulson@1941
   160
qed "new_keys_not_seen";
paulson@1941
   161
Addsimps [new_keys_not_seen];
paulson@1941
   162
paulson@1941
   163
(*Another variant: old messages must contain old keys!*)
paulson@1941
   164
goal thy 
paulson@1941
   165
 "!!evs. [| Says A B X : set_of_list evs;  \
paulson@1941
   166
\           Key (newK evt) : parts {X};    \
paulson@2032
   167
\           evs : otway lost                 \
paulson@1941
   168
\        |] ==> length evt < length evs";
paulson@2032
   169
by (rtac ccontr 1);
paulson@2032
   170
by (dtac leI 1);
paulson@2032
   171
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy]
paulson@2014
   172
                      addIs  [impOfSubs parts_mono]) 1);
paulson@1941
   173
qed "Says_imp_old_keys";
paulson@1941
   174
paulson@1941
   175
paulson@2014
   176
(*** Future nonces can't be seen or used! [proofs resemble those above] ***)
paulson@2014
   177
paulson@2032
   178
goal thy "!!evs. evs : otway lost ==> \
paulson@2014
   179
\                length evs <= length evt --> \
paulson@2032
   180
\                Nonce (newN evt) ~: (UN C. parts (sees lost C evs))";
paulson@2032
   181
by (etac otway.induct 1);
paulson@2014
   182
(*auto_tac does not work here, as it performs safe_tac first*)
paulson@2032
   183
by (ALLGOALS (asm_simp_tac (!simpset addsimps [parts_insert2]
paulson@2014
   184
                                     addcongs [disj_cong])));
paulson@2014
   185
by (REPEAT_FIRST (fast_tac (!claset 
paulson@2032
   186
                              addSEs partsEs
paulson@2032
   187
                              addSDs  [Says_imp_sees_Spy RS parts.Inj]
paulson@2032
   188
                              addDs  [impOfSubs analz_subset_parts,
paulson@2032
   189
                                      impOfSubs parts_insert_subset_Un,
paulson@2032
   190
                                      Suc_leD]
paulson@2032
   191
                              addss (!simpset))));
paulson@2014
   192
val lemma = result();
paulson@2014
   193
paulson@2014
   194
(*Variant needed for the main theorem below*)
paulson@2014
   195
goal thy 
paulson@2032
   196
 "!!evs. [| evs : otway lost;  length evs <= length evs' |]    \
paulson@2032
   197
\        ==> Nonce (newN evs') ~: parts (sees lost C evs)";
paulson@2014
   198
by (fast_tac (!claset addDs [lemma]) 1);
paulson@2014
   199
qed "new_nonces_not_seen";
paulson@2014
   200
Addsimps [new_nonces_not_seen];
paulson@2014
   201
paulson@2014
   202
(*Another variant: old messages must contain old nonces!*)
paulson@2014
   203
goal thy 
paulson@2014
   204
 "!!evs. [| Says A B X : set_of_list evs;  \
paulson@2014
   205
\           Nonce (newN evt) : parts {X};    \
paulson@2032
   206
\           evs : otway lost                 \
paulson@2014
   207
\        |] ==> length evt < length evs";
paulson@2032
   208
by (rtac ccontr 1);
paulson@2032
   209
by (dtac leI 1);
paulson@2032
   210
by (fast_tac (!claset addSDs [new_nonces_not_seen, Says_imp_sees_Spy]
paulson@2032
   211
                      addIs  [impOfSubs parts_mono]) 1);
paulson@2014
   212
qed "Says_imp_old_nonces";
paulson@2014
   213
paulson@2014
   214
paulson@1941
   215
(*Nobody can have USED keys that will be generated in the future.
paulson@1941
   216
  ...very like new_keys_not_seen*)
paulson@2032
   217
goal thy "!!evs. evs : otway lost ==> \
paulson@1941
   218
\                length evs <= length evs' --> \
paulson@2032
   219
\                newK evs' ~: keysFor (UN C. parts (sees lost C evs))";
paulson@2064
   220
by (parts_induct_tac 1);
paulson@1941
   221
(*OR1 and OR3*)
paulson@1941
   222
by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,2]));
paulson@1941
   223
(*Fake, OR2, OR4: these messages send unknown (X) components*)
paulson@2104
   224
by (REPEAT
paulson@2104
   225
    (best_tac
paulson@1996
   226
      (!claset addDs [impOfSubs (analz_subset_parts RS keysFor_mono),
paulson@2032
   227
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono),
paulson@2032
   228
                      Suc_leD]
paulson@2032
   229
               addEs [new_keys_not_seen RS not_parts_not_analz RSN(2,rev_notE)]
paulson@2104
   230
               addss (!simpset)) 1));
paulson@1941
   231
val lemma = result();
paulson@1941
   232
paulson@1941
   233
goal thy 
paulson@2032
   234
 "!!evs. [| evs : otway lost;  length evs <= length evs' |]    \
paulson@2032
   235
\        ==> newK evs' ~: keysFor (parts (sees lost C evs))";
paulson@1941
   236
by (fast_tac (!claset addSDs [lemma] addss (!simpset)) 1);
paulson@1941
   237
qed "new_keys_not_used";
paulson@1941
   238
paulson@1941
   239
bind_thm ("new_keys_not_analzd",
paulson@2032
   240
          [analz_subset_parts RS keysFor_mono,
paulson@2032
   241
           new_keys_not_used] MRS contra_subsetD);
paulson@1941
   242
paulson@1941
   243
Addsimps [new_keys_not_used, new_keys_not_analzd];
paulson@1941
   244
paulson@1941
   245
paulson@2064
   246
paulson@2064
   247
(*** Proofs involving analz ***)
paulson@2064
   248
paulson@2064
   249
(*Describes the form of Key K when the following message is sent.  The use of
paulson@2064
   250
  "parts" strengthens the induction hyp for proving the Fake case.  The
paulson@2064
   251
  assumption A ~: lost prevents its being a Faked message.  (Based
paulson@2064
   252
  on NS_Shared/Says_S_message_form) *)
paulson@2064
   253
goal thy
paulson@2064
   254
 "!!evs. evs: otway lost ==>                                           \
paulson@2064
   255
\          Crypt {|N, Key K|} (shrK A) : parts (sees lost Spy evs) &   \
paulson@2064
   256
\          A ~: lost -->                                               \
paulson@2064
   257
\        (EX evt: otway lost. K = newK evt)";
paulson@2064
   258
by (parts_induct_tac 1);
paulson@2064
   259
by (Auto_tac());
paulson@2064
   260
qed_spec_mp "Reveal_message_lemma";
paulson@2064
   261
paulson@2064
   262
(*EITHER describes the form of Key K when the following message is sent, 
paulson@2064
   263
  OR     reduces it to the Fake case.*)
paulson@2064
   264
paulson@2064
   265
goal thy 
paulson@2064
   266
 "!!evs. [| Says B' A {|N, Crypt {|N, Key K|} (shrK A)|} : set_of_list evs;  \
paulson@2064
   267
\           evs : otway lost |]                      \
paulson@2064
   268
\        ==> (EX evt: otway lost. K = newK evt)          \
paulson@2064
   269
\          | Key K : analz (sees lost Spy evs)";
paulson@2064
   270
br (Reveal_message_lemma RS disjCI) 1;
paulson@2064
   271
ba 1;
paulson@2064
   272
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]
paulson@2064
   273
                      addDs [impOfSubs analz_subset_parts]
paulson@2064
   274
                      addss (!simpset)) 1);
paulson@2064
   275
qed "Reveal_message_form";
paulson@2064
   276
paulson@2064
   277
paulson@2064
   278
(*For proofs involving analz.  We again instantiate the variable to "lost".*)
paulson@2064
   279
val analz_Fake_tac = 
paulson@2064
   280
    dres_inst_tac [("lost","lost")] OR2_analz_sees_Spy 4 THEN 
paulson@2064
   281
    dres_inst_tac [("lost","lost")] OR4_analz_sees_Spy 6 THEN
paulson@2064
   282
    forw_inst_tac [("lost","lost")] Reveal_message_form 7;
paulson@1941
   283
paulson@1941
   284
paulson@1941
   285
(****
paulson@1941
   286
 The following is to prove theorems of the form
paulson@1941
   287
paulson@2032
   288
          Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) ==>
paulson@2032
   289
          Key K : analz (sees lost Spy evs)
paulson@1941
   290
paulson@1941
   291
 A more general formula must be proved inductively.
paulson@1941
   292
paulson@1941
   293
****)
paulson@1941
   294
paulson@1941
   295
paulson@1941
   296
(** Session keys are not used to encrypt other session keys **)
paulson@1941
   297
paulson@2014
   298
(*The equality makes the induction hypothesis easier to apply*)
paulson@1941
   299
goal thy  
paulson@2032
   300
 "!!evs. evs : otway lost ==> \
paulson@2032
   301
\  ALL K E. (Key K : analz (Key``(newK``E) Un (sees lost Spy evs))) = \
paulson@2032
   302
\           (K : newK``E | Key K : analz (sees lost Spy evs))";
paulson@2032
   303
by (etac otway.induct 1);
paulson@2064
   304
by analz_Fake_tac;
paulson@2045
   305
by (REPEAT_FIRST (ares_tac [allI, analz_image_newK_lemma]));
paulson@2014
   306
by (REPEAT ((eresolve_tac [bexE, disjE] ORELSE' hyp_subst_tac) 7));
paulson@2014
   307
by (ALLGOALS (*Takes 28 secs*)
paulson@1941
   308
    (asm_simp_tac 
paulson@1941
   309
     (!simpset addsimps ([insert_Key_singleton, insert_Key_image, pushKey_newK]
paulson@2032
   310
                         @ pushes)
paulson@1941
   311
               setloop split_tac [expand_if])));
paulson@2104
   312
(** LEVEL 5 **)
paulson@2014
   313
(*Reveal case 2, OR4, OR2, Fake*) 
paulson@2032
   314
by (EVERY (map spy_analz_tac [7,5,3,2]));
paulson@2014
   315
(*Reveal case 1, OR3, Base*)
paulson@2064
   316
by (REPEAT (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1));
paulson@1941
   317
qed_spec_mp "analz_image_newK";
paulson@1941
   318
paulson@1941
   319
paulson@1941
   320
goal thy
paulson@2032
   321
 "!!evs. evs : otway lost ==>                               \
paulson@2032
   322
\        Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) = \
paulson@2032
   323
\        (K = newK evt | Key K : analz (sees lost Spy evs))";
paulson@1941
   324
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, 
paulson@2032
   325
                                   insert_Key_singleton]) 1);
paulson@1941
   326
by (Fast_tac 1);
paulson@1941
   327
qed "analz_insert_Key_newK";
paulson@1941
   328
paulson@1941
   329
paulson@2026
   330
(*** The Key K uniquely identifies the Server's  message. **)
paulson@2014
   331
paulson@2014
   332
fun ex_strip_tac i = REPEAT (ares_tac [exI, conjI] i) THEN assume_tac (i+1);
paulson@2014
   333
paulson@2014
   334
goal thy 
paulson@2032
   335
 "!!evs. evs : otway lost ==>                      \
paulson@2014
   336
\      EX A' B' NA' NB'. ALL A B NA NB.                    \
paulson@2014
   337
\       Says Server B \
paulson@2014
   338
\            {|NA, Crypt {|NA, K|} (shrK A),                      \
paulson@2014
   339
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs --> \
paulson@2014
   340
\       A=A' & B=B' & NA=NA' & NB=NB'";
paulson@2032
   341
by (etac otway.induct 1);
paulson@2014
   342
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib])));
paulson@2014
   343
by (Step_tac 1);
paulson@2014
   344
(*Remaining cases: OR3 and OR4*)
paulson@2014
   345
by (ex_strip_tac 2);
paulson@2014
   346
by (Fast_tac 2);
paulson@2064
   347
by (expand_case_tac "K = ?y" 1);
paulson@2064
   348
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
paulson@2014
   349
(*...we assume X is a very new message, and handle this case by contradiction*)
paulson@2014
   350
by (fast_tac (!claset addEs [Says_imp_old_keys RS less_irrefl]
paulson@2032
   351
                      delrules [conjI]    (*prevent split-up into 4 subgoals*)
paulson@2032
   352
                      addss (!simpset addsimps [parts_insertI])) 1);
paulson@2014
   353
val lemma = result();
paulson@2014
   354
paulson@2014
   355
goal thy 
paulson@2014
   356
 "!!evs. [| Says Server B                                          \
paulson@2014
   357
\              {|NA, Crypt {|NA, K|} (shrK A),                     \
paulson@2014
   358
\                    Crypt {|NB, K|} (shrK B)|}                    \
paulson@2014
   359
\            : set_of_list evs;                                    \ 
paulson@2014
   360
\           Says Server B'                                         \
paulson@2014
   361
\              {|NA', Crypt {|NA', K|} (shrK A'),                  \
paulson@2014
   362
\                     Crypt {|NB', K|} (shrK B')|}                 \
paulson@2014
   363
\            : set_of_list evs;                                    \
paulson@2032
   364
\           evs : otway lost |]                                         \
paulson@2014
   365
\        ==> A=A' & B=B' & NA=NA' & NB=NB'";
paulson@2032
   366
by (dtac lemma 1);
paulson@2014
   367
by (REPEAT (etac exE 1));
paulson@2014
   368
(*Duplicate the assumption*)
paulson@2014
   369
by (forw_inst_tac [("psi", "ALL C.?P(C)")] asm_rl 1);
paulson@2014
   370
by (fast_tac (!claset addSDs [spec]) 1);
paulson@2014
   371
qed "unique_session_keys";
paulson@2014
   372
paulson@2014
   373
paulson@2014
   374
paulson@2048
   375
(**** Authenticity properties relating to NA ****)
paulson@2014
   376
paulson@2014
   377
(*Only OR1 can have caused such a part of a message to appear.*)
paulson@2014
   378
goal thy 
paulson@2064
   379
 "!!evs. [| A ~: lost;  evs : otway lost |]                        \
paulson@2064
   380
\        ==> Crypt {|NA, Agent A, Agent B|} (shrK A)               \
paulson@2064
   381
\             : parts (sees lost Spy evs) -->                      \
paulson@2064
   382
\            Says A B {|NA, Agent A, Agent B,                      \
paulson@2014
   383
\                       Crypt {|NA, Agent A, Agent B|} (shrK A)|}  \
paulson@2014
   384
\             : set_of_list evs";
paulson@2064
   385
by (parts_induct_tac 1);
paulson@2014
   386
qed_spec_mp "Crypt_imp_OR1";
paulson@2014
   387
paulson@2014
   388
paulson@2064
   389
(** The Nonce NA uniquely identifies A's message. **)
paulson@2014
   390
paulson@2014
   391
goal thy 
paulson@2032
   392
 "!!evs. [| evs : otway lost; A ~: lost |]               \
paulson@2014
   393
\ ==> EX B'. ALL B.    \
paulson@2048
   394
\        Crypt {|NA, Agent A, Agent B|} (shrK A) : parts (sees lost Spy evs) \
paulson@2048
   395
\        --> B = B'";
paulson@2064
   396
by (parts_induct_tac 1);
paulson@2064
   397
by (simp_tac (!simpset addsimps [all_conj_distrib]) 1); 
paulson@2026
   398
(*OR1: creation of new Nonce.  Move assertion into global context*)
paulson@2064
   399
by (expand_case_tac "NA = ?y" 1);
paulson@2014
   400
by (best_tac (!claset addSEs partsEs
paulson@2032
   401
                      addEs  [new_nonces_not_seen RSN(2,rev_notE)]) 1);
paulson@2014
   402
val lemma = result();
paulson@2014
   403
paulson@2014
   404
goal thy 
paulson@2048
   405
 "!!evs.[| Crypt {|NA, Agent A, Agent B|} (shrK A): parts(sees lost Spy evs); \
paulson@2048
   406
\          Crypt {|NA, Agent A, Agent C|} (shrK A): parts(sees lost Spy evs); \
paulson@2048
   407
\          evs : otway lost;  A ~: lost |]                                    \
paulson@2014
   408
\        ==> B = C";
paulson@2032
   409
by (dtac lemma 1);
paulson@2032
   410
by (assume_tac 1);
paulson@2014
   411
by (etac exE 1);
paulson@2014
   412
(*Duplicate the assumption*)
paulson@2014
   413
by (forw_inst_tac [("psi", "ALL C.?P(C)")] asm_rl 1);
paulson@2014
   414
by (fast_tac (!claset addSDs [spec]) 1);
paulson@2048
   415
qed "unique_NA";
paulson@2014
   416
paulson@2014
   417
paulson@2014
   418
val nonce_not_seen_now = le_refl RSN (2, new_nonces_not_seen) RSN (2,rev_notE);
paulson@2014
   419
paulson@2014
   420
(*It is impossible to re-use a nonce in both OR1 and OR2.  This holds because
paulson@2014
   421
  OR2 encrypts Nonce NB.  It prevents the attack that can occur in the
paulson@2014
   422
  over-simplified version of this protocol: see OtwayRees_Bad.*)
paulson@2014
   423
goal thy 
paulson@2032
   424
 "!!evs. [| A ~: lost;  evs : otway lost |]                            \
paulson@2014
   425
\        ==> Crypt {|NA, Agent A, Agent B|} (shrK A)             \
paulson@2032
   426
\             : parts (sees lost Spy evs) -->                       \
paulson@2014
   427
\            Crypt {|NA', NA, Agent A', Agent A|} (shrK A)       \
paulson@2032
   428
\             ~: parts (sees lost Spy evs)";
paulson@2071
   429
by (parts_induct_tac 1);
paulson@2071
   430
by (REPEAT (fast_tac (!claset addSEs (partsEs@[nonce_not_seen_now])
paulson@2026
   431
                              addSDs  [impOfSubs parts_insert_subset_Un]
paulson@2071
   432
                              addss (!simpset)) 1));
paulson@2014
   433
qed_spec_mp"no_nonce_OR1_OR2";
paulson@2014
   434
paulson@2014
   435
paulson@2053
   436
(*Crucial property: If the encrypted message appears, and A has used NA
paulson@2053
   437
  to start a run, then it originated with the Server!*)
paulson@2014
   438
goal thy 
paulson@2048
   439
 "!!evs. [| A ~: lost;  A ~= Spy;  evs : otway lost |]                 \
paulson@2048
   440
\    ==> Crypt {|NA, Key K|} (shrK A) : parts (sees lost Spy evs)      \
paulson@2048
   441
\        --> Says A B {|NA, Agent A, Agent B,                          \
paulson@2048
   442
\                       Crypt {|NA, Agent A, Agent B|} (shrK A)|}      \
paulson@2048
   443
\             : set_of_list evs -->                                    \
paulson@2048
   444
\            (EX NB. Says Server B                                     \
paulson@2048
   445
\                 {|NA,                                                \
paulson@2048
   446
\                   Crypt {|NA, Key K|} (shrK A),                      \
paulson@2048
   447
\                   Crypt {|NB, Key K|} (shrK B)|}                     \
paulson@2014
   448
\                   : set_of_list evs)";
paulson@2064
   449
by (parts_induct_tac 1);
paulson@2014
   450
(*OR1: it cannot be a new Nonce, contradiction.*)
paulson@2014
   451
by (fast_tac (!claset addSIs [parts_insertI]
paulson@2032
   452
                      addSEs partsEs
paulson@2032
   453
                      addEs [Says_imp_old_nonces RS less_irrefl]
paulson@2032
   454
                      addss (!simpset)) 1);
paulson@2064
   455
(*OR3 and OR4*) 
paulson@2014
   456
(*OR4*)
paulson@2014
   457
by (REPEAT (Safe_step_tac 2));
paulson@2014
   458
by (REPEAT (best_tac (!claset addSDs [parts_cut]) 3));
paulson@2014
   459
by (fast_tac (!claset addSIs [Crypt_imp_OR1]
paulson@2032
   460
                      addEs  partsEs
paulson@2032
   461
                      addDs [Says_imp_sees_Spy RS parts.Inj]) 2);
paulson@2064
   462
(*OR3*)  (** LEVEL 5 **)
paulson@2064
   463
by (asm_simp_tac (!simpset addsimps [ex_disj_distrib]) 1);
paulson@2014
   464
by (step_tac (!claset delrules [disjCI, impCE]) 1);
paulson@2014
   465
by (fast_tac (!claset addSEs [MPair_parts]
paulson@2032
   466
                      addSDs [Says_imp_sees_Spy RS parts.Inj]
paulson@2014
   467
                      addEs  [no_nonce_OR1_OR2 RSN (2, rev_notE)]
paulson@2048
   468
                      delrules [conjI] (*stop split-up into 4 subgoals*)) 2);
paulson@2048
   469
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj]
paulson@2048
   470
                      addSEs [MPair_parts]
paulson@2048
   471
                      addEs  [unique_NA]) 1);
paulson@2048
   472
qed_spec_mp "NA_Crypt_imp_Server_msg";
paulson@2014
   473
paulson@2014
   474
paulson@2053
   475
(*Corollary: if A receives B's OR4 message and the nonce NA agrees
paulson@2014
   476
  then the key really did come from the Server!  CANNOT prove this of the
paulson@2048
   477
  bad form of this protocol, even though we can prove
paulson@2032
   478
  Spy_not_see_encrypted_key*)
paulson@2014
   479
goal thy 
paulson@2053
   480
 "!!evs. [| Says B' A {|NA, Crypt {|NA, Key K|} (shrK A)|}         \
paulson@2053
   481
\            : set_of_list evs;                                    \
paulson@2053
   482
\           Says A B {|NA, Agent A, Agent B,                       \
paulson@2053
   483
\                      Crypt {|NA, Agent A, Agent B|} (shrK A)|}   \
paulson@2053
   484
\            : set_of_list evs;                                    \
paulson@2053
   485
\           A ~: lost;  A ~= Spy;  evs : otway lost |]             \
paulson@2053
   486
\        ==> EX NB. Says Server B                                  \
paulson@2048
   487
\                     {|NA,                                        \
paulson@2048
   488
\                       Crypt {|NA, Key K|} (shrK A),              \
paulson@2048
   489
\                       Crypt {|NB, Key K|} (shrK B)|}             \
paulson@2053
   490
\                       : set_of_list evs";
paulson@2048
   491
by (fast_tac (!claset addSIs [NA_Crypt_imp_Server_msg]
paulson@2032
   492
                      addEs  partsEs
paulson@2032
   493
                      addDs  [Says_imp_sees_Spy RS parts.Inj]) 1);
paulson@2064
   494
qed "A_trust_OR4";
paulson@2014
   495
paulson@2014
   496
paulson@2014
   497
(*Describes the form of K and NA when the Server sends this message.*)
paulson@1941
   498
goal thy 
paulson@1941
   499
 "!!evs. [| Says Server B \
paulson@1941
   500
\            {|NA, Crypt {|NA, K|} (shrK A),                      \
paulson@1941
   501
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs;  \
paulson@2032
   502
\           evs : otway lost |]                                        \
paulson@2032
   503
\        ==> (EX evt: otway lost. K = Key(newK evt)) &                  \
paulson@2048
   504
\            (EX i. NA = Nonce i) &                  \
paulson@2048
   505
\            (EX j. NB = Nonce j)";
paulson@2032
   506
by (etac rev_mp 1);
paulson@2032
   507
by (etac otway.induct 1);
paulson@2048
   508
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
paulson@1941
   509
qed "Says_Server_message_form";
paulson@1941
   510
paulson@1941
   511
paulson@2048
   512
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3
paulson@2048
   513
    Does not in itself guarantee security: an attack could violate 
paulson@2048
   514
    the premises, e.g. by having A=Spy **)
paulson@2014
   515
paulson@1941
   516
goal thy 
paulson@2032
   517
 "!!evs. [| A ~: lost;  B ~: lost;  evs : otway lost;  evt : otway lost |] \
paulson@2048
   518
\        ==> Says Server B                                                 \
paulson@2048
   519
\              {|NA, Crypt {|NA, Key K|} (shrK A),                         \
paulson@2048
   520
\                Crypt {|NB, Key K|} (shrK B)|} : set_of_list evs -->      \
paulson@2048
   521
\            Says A Spy {|NA, Key K|} ~: set_of_list evs -->               \
paulson@2048
   522
\            Key K ~: analz (sees lost Spy evs)";
paulson@2032
   523
by (etac otway.induct 1);
paulson@2064
   524
by analz_Fake_tac;
paulson@2014
   525
by (REPEAT_FIRST (eresolve_tac [asm_rl, bexE, disjE] ORELSE' hyp_subst_tac));
paulson@1964
   526
by (ALLGOALS
paulson@1941
   527
    (asm_full_simp_tac 
paulson@1941
   528
     (!simpset addsimps ([analz_subset_parts RS contra_subsetD,
paulson@2032
   529
                          analz_insert_Key_newK] @ pushes)
paulson@1941
   530
               setloop split_tac [expand_if])));
paulson@1941
   531
(*OR3*)
paulson@2014
   532
by (fast_tac (!claset addSIs [parts_insertI]
paulson@2032
   533
                      addEs [Says_imp_old_keys RS less_irrefl]
paulson@2048
   534
                      addss (!simpset addsimps [parts_insert2])) 3);
paulson@2014
   535
(*Reveal case 2, OR4, OR2, Fake*) 
paulson@2032
   536
by (REPEAT_FIRST (resolve_tac [conjI, impI] ORELSE' spy_analz_tac));
paulson@2104
   537
(*Reveal case 1*) (** LEVEL 6 **)
paulson@2104
   538
by (case_tac "Aa : lost" 1);
paulson@2048
   539
(*But this contradicts Key K ~: analz (sees lost Spy evsa) *)
paulson@2104
   540
by (dtac (Says_imp_sees_Spy RS analz.Inj) 1);
paulson@2104
   541
by (fast_tac (!claset addSDs [analz.Decrypt] addss (!simpset)) 1);
paulson@2032
   542
(*So now we have  Aa ~: lost *)
paulson@2064
   543
by (dtac A_trust_OR4 1);
paulson@2014
   544
by (REPEAT (assume_tac 1));
paulson@2014
   545
by (fast_tac (!claset addDs [unique_session_keys] addss (!simpset)) 1);
paulson@2014
   546
val lemma = result() RS mp RS mp RSN(2,rev_notE);
paulson@2014
   547
paulson@2014
   548
goal thy 
paulson@2014
   549
 "!!evs. [| Says Server B \
paulson@2048
   550
\            {|NA, Crypt {|NA, K|} (shrK A),                             \
paulson@2048
   551
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs;         \
paulson@2048
   552
\           Says A Spy {|NA, K|} ~: set_of_list evs;                     \
paulson@2032
   553
\           A ~: lost;  B ~: lost;  evs : otway lost |]                  \
paulson@2032
   554
\        ==> K ~: analz (sees lost Spy evs)";
paulson@2014
   555
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
paulson@2014
   556
by (fast_tac (!claset addSEs [lemma]) 1);
paulson@2032
   557
qed "Spy_not_see_encrypted_key";
paulson@2032
   558
paulson@1945
   559
paulson@2032
   560
goal thy 
paulson@2048
   561
 "!!evs. [| C ~: {A,B,Server};                                           \
paulson@2048
   562
\           Says Server B                                                \
paulson@2048
   563
\            {|NA, Crypt {|NA, K|} (shrK A),                             \
paulson@2048
   564
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs;         \
paulson@2048
   565
\           Says A Spy {|NA, K|} ~: set_of_list evs;                     \
paulson@2032
   566
\           A ~: lost;  B ~: lost;  evs : otway lost |]                  \
paulson@2032
   567
\        ==> K ~: analz (sees lost C evs)";
paulson@2032
   568
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1);
paulson@2032
   569
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1);
paulson@2032
   570
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key));
paulson@2032
   571
by (REPEAT_FIRST (fast_tac (!claset addIs [otway_mono RS subsetD])));
paulson@2032
   572
qed "Agent_not_see_encrypted_key";
paulson@1945
   573
paulson@1945
   574
paulson@2048
   575
(**** Authenticity properties relating to NB ****)
paulson@2048
   576
paulson@2048
   577
(*Only OR2 can have caused such a part of a message to appear.  We do not
paulson@2048
   578
  know anything about X'.*)
paulson@2048
   579
goal thy 
paulson@2048
   580
 "!!evs. [| B ~: lost;  evs : otway lost |]                    \
paulson@2048
   581
\        ==> Crypt {|NA, NB, Agent A, Agent B|} (shrK B)       \
paulson@2048
   582
\             : parts (sees lost Spy evs) -->                  \
paulson@2048
   583
\            (EX X'. Says B Server                             \
paulson@2048
   584
\             {|NA, Agent A, Agent B, X',                      \
paulson@2048
   585
\               Crypt {|NA, NB, Agent A, Agent B|} (shrK B)|}  \
paulson@2048
   586
\             : set_of_list evs)";
paulson@2064
   587
by (parts_induct_tac 1);
paulson@2064
   588
by (auto_tac (!claset, !simpset addcongs [conj_cong]));
paulson@2048
   589
qed_spec_mp "Crypt_imp_OR2";
paulson@2048
   590
paulson@2048
   591
paulson@2048
   592
(** The Nonce NB uniquely identifies B's  message. **)
paulson@2048
   593
paulson@2048
   594
goal thy 
paulson@2048
   595
 "!!evs. [| evs : otway lost; B ~: lost |]               \
paulson@2064
   596
\ ==> EX NA' A'. ALL NA A.                               \
paulson@2048
   597
\      Crypt {|NA, NB, Agent A, Agent B|} (shrK B) : parts(sees lost Spy evs) \
paulson@2048
   598
\      --> NA = NA' & A = A'";
paulson@2064
   599
by (parts_induct_tac 1);
paulson@2064
   600
by (simp_tac (!simpset addsimps [all_conj_distrib]) 1); 
paulson@2048
   601
(*OR2: creation of new Nonce.  Move assertion into global context*)
paulson@2064
   602
by (expand_case_tac "NB = ?y" 1);
paulson@2048
   603
by (fast_tac (!claset addSEs (nonce_not_seen_now::partsEs)) 1);
paulson@2048
   604
val lemma = result();
paulson@2048
   605
paulson@2048
   606
goal thy 
paulson@2048
   607
 "!!evs.[| Crypt {|NA, NB, Agent A, Agent B|} (shrK B) \
paulson@2048
   608
\                  : parts(sees lost Spy evs);         \
paulson@2048
   609
\          Crypt {|NC, NB, Agent C, Agent B|} (shrK B) \
paulson@2048
   610
\                  : parts(sees lost Spy evs);         \
paulson@2048
   611
\          evs : otway lost;  B ~: lost |]             \
paulson@2048
   612
\        ==> NC = NA & C = A";
paulson@2048
   613
by (dtac lemma 1);
paulson@2048
   614
by (assume_tac 1);
paulson@2048
   615
by (REPEAT (etac exE 1));
paulson@2048
   616
(*Duplicate the assumption*)
paulson@2048
   617
by (forw_inst_tac [("psi", "ALL C.?P(C)")] asm_rl 1);
paulson@2048
   618
by (fast_tac (!claset addSDs [spec]) 1);
paulson@2048
   619
qed "unique_NB";
paulson@2048
   620
paulson@2048
   621
paulson@2048
   622
(*If the encrypted message appears, and B has used Nonce NB,
paulson@2048
   623
  then it originated with the Server!*)
paulson@2048
   624
goal thy 
paulson@2048
   625
 "!!evs. [| B ~: lost;  B ~= Spy;  evs : otway lost |]                   \
paulson@2048
   626
\    ==> Crypt {|NB, Key K|} (shrK B) : parts (sees lost Spy evs)        \
paulson@2048
   627
\        --> (ALL X'. Says B Server                                      \
paulson@2048
   628
\                       {|NA, Agent A, Agent B, X',                      \
paulson@2048
   629
\                         Crypt {|NA, NB, Agent A, Agent B|} (shrK B)|}  \
paulson@2048
   630
\             : set_of_list evs                                          \
paulson@2048
   631
\             --> Says Server B                                          \
paulson@2048
   632
\                  {|NA, Crypt {|NA, Key K|} (shrK A),                   \
paulson@2048
   633
\                        Crypt {|NB, Key K|} (shrK B)|}                  \
paulson@2048
   634
\                   : set_of_list evs)";
paulson@2064
   635
by (parts_induct_tac 1);
paulson@2048
   636
(*OR1: it cannot be a new Nonce, contradiction.*)
paulson@2048
   637
by (fast_tac (!claset addSIs [parts_insertI]
paulson@2048
   638
                      addSEs partsEs
paulson@2048
   639
                      addEs [Says_imp_old_nonces RS less_irrefl]
paulson@2048
   640
                      addss (!simpset)) 1);
paulson@2048
   641
(*OR3 and OR4*)  (** LEVEL 5 **)
paulson@2048
   642
(*OR4*)
paulson@2048
   643
by (REPEAT (Safe_step_tac 2));
paulson@2048
   644
br (Crypt_imp_OR2 RS exE) 2;
paulson@2048
   645
by (REPEAT (fast_tac (!claset addEs partsEs) 2));
paulson@2048
   646
(*OR3*)  (** LEVEL 8 **)
paulson@2048
   647
by (step_tac (!claset delrules [disjCI, impCE]) 1);
paulson@2048
   648
by (fast_tac (!claset delrules [conjI] (*stop split-up*)) 3); 
paulson@2048
   649
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj]
paulson@2048
   650
                      addSEs [MPair_parts]
paulson@2048
   651
                      addDs  [unique_NB]) 2);
paulson@2048
   652
by (fast_tac (!claset addSEs [MPair_parts]
paulson@2048
   653
                      addSDs [Says_imp_sees_Spy RS parts.Inj]
paulson@2048
   654
                      addSEs  [no_nonce_OR1_OR2 RSN (2, rev_notE)]
paulson@2048
   655
                      delrules [conjI, impCE] (*stop split-up*)) 1);
paulson@2048
   656
qed_spec_mp "NB_Crypt_imp_Server_msg";
paulson@2048
   657
paulson@2048
   658
paulson@2048
   659
(*Guarantee for B: if it gets a message with matching NB then the Server
paulson@2048
   660
  has sent the correct message.*)
paulson@2048
   661
goal thy 
paulson@2048
   662
 "!!evs. [| B ~: lost;  B ~= Spy;  evs : otway lost;               \
paulson@2048
   663
\           Says S B {|NA, X, Crypt {|NB, Key K|} (shrK B)|}       \
paulson@2048
   664
\            : set_of_list evs;                                    \
paulson@2048
   665
\           Says B Server {|NA, Agent A, Agent B, X',              \
paulson@2048
   666
\                           Crypt {|NA, NB, Agent A, Agent B|}     \
paulson@2048
   667
\                                 (shrK B)|}                       \
paulson@2048
   668
\            : set_of_list evs |]                                  \
paulson@2048
   669
\        ==> Says Server B                                         \
paulson@2048
   670
\                 {|NA,                                            \
paulson@2048
   671
\                   Crypt {|NA, Key K|} (shrK A),                  \
paulson@2048
   672
\                   Crypt {|NB, Key K|} (shrK B)|}                 \
paulson@2048
   673
\                   : set_of_list evs";
paulson@2048
   674
by (fast_tac (!claset addSIs [NB_Crypt_imp_Server_msg]
paulson@2048
   675
                      addEs  partsEs
paulson@2048
   676
                      addDs  [Says_imp_sees_Spy RS parts.Inj]) 1);
paulson@2064
   677
qed "B_trust_OR3";
paulson@2048
   678
paulson@2048
   679
paulson@2064
   680
B_trust_OR3 RS Spy_not_see_encrypted_key;
paulson@2048
   681
paulson@2048
   682
paulson@2026
   683
(** A session key uniquely identifies a pair of senders in the message
paulson@2048
   684
    encrypted by a good agent C.  NEEDED?  INTERESTING?**)
paulson@1945
   685
goal thy 
paulson@2032
   686
 "!!evs. evs : otway lost ==>                                           \
paulson@2026
   687
\      EX A B. ALL C N.                                            \
paulson@2032
   688
\         C ~: lost -->                                             \
paulson@2032
   689
\         Crypt {|N, Key K|} (shrK C) : parts (sees lost Spy evs) --> \
paulson@2026
   690
\         C=A | C=B";
paulson@2032
   691
by (Simp_tac 1);        (*Miniscoping*)
paulson@2032
   692
by (etac otway.induct 1);
paulson@2064
   693
by analz_Fake_tac;
paulson@2032
   694
(*spy_analz_tac just does not work here: it is an entirely different proof!*)
paulson@1945
   695
by (ALLGOALS 
paulson@2026
   696
    (asm_simp_tac (!simpset addsimps [all_conj_distrib, ex_disj_distrib,
paulson@2032
   697
                                      imp_conj_distrib, parts_insert_sees,
paulson@2032
   698
                                      parts_insert2])));
paulson@1945
   699
by (REPEAT_FIRST (etac exE));
paulson@2026
   700
(*OR3: extraction of K = newK evsa to global context...*) (** LEVEL 6 **)
paulson@2064
   701
by (expand_case_tac "K = ?y" 4);
paulson@2064
   702
by (REPEAT (ares_tac [exI] 5));
paulson@1945
   703
(*...we prove this case by contradiction: the key is too new!*)
paulson@2026
   704
by (fast_tac (!claset addSEs partsEs
paulson@2032
   705
                      addEs [Says_imp_old_keys RS less_irrefl]
paulson@2032
   706
                      addss (!simpset)) 4);
paulson@2026
   707
(*Base, Fake, OR2, OR4*)
paulson@2026
   708
by (REPEAT_FIRST ex_strip_tac);
paulson@2032
   709
by (dtac synth.Inj 4);
paulson@2032
   710
by (dtac synth.Inj 3);
paulson@2026
   711
(*Now in effect there are three Fake cases*)
paulson@2026
   712
by (REPEAT_FIRST (best_tac (!claset addDs [impOfSubs Fake_parts_insert]
paulson@2032
   713
                                    delrules [disjCI, disjE]
paulson@2032
   714
                                    addss (!simpset))));
paulson@2014
   715
qed "key_identifies_senders";
paulson@2032
   716
paulson@2032
   717