src/HOL/Nominal/nominal_inductive.ML
changeset 60801 7664e0916eec
parent 60787 12cd198f07af
child 61144 5e94dfead1c2
equal deleted inserted replaced
60799:57dd0b45fc21 60801:7664e0916eec
   201         ("fs_" ^ Long_Name.base_name (fst (dest_Type T)))) atomTs));
   201         ("fs_" ^ Long_Name.base_name (fst (dest_Type T)))) atomTs));
   202     val (fs_ctxt_tyname, _) = Name.variant "'n" (Variable.names_of ctxt');
   202     val (fs_ctxt_tyname, _) = Name.variant "'n" (Variable.names_of ctxt');
   203     val ([fs_ctxt_name], ctxt'') = Variable.variant_fixes ["z"] ctxt';
   203     val ([fs_ctxt_name], ctxt'') = Variable.variant_fixes ["z"] ctxt';
   204     val fsT = TFree (fs_ctxt_tyname, ind_sort);
   204     val fsT = TFree (fs_ctxt_tyname, ind_sort);
   205 
   205 
   206     val inductive_forall_def' = Drule.instantiate'
   206     val inductive_forall_def' = Thm.instantiate'
   207       [SOME (Thm.global_ctyp_of thy fsT)] [] inductive_forall_def;
   207       [SOME (Thm.global_ctyp_of thy fsT)] [] inductive_forall_def;
   208 
   208 
   209     fun lift_pred' t (Free (s, T)) ts =
   209     fun lift_pred' t (Free (s, T)) ts =
   210       list_comb (Free (s, fsT --> T), t :: ts);
   210       list_comb (Free (s, fsT --> T), t :: ts);
   211     val lift_pred = lift_pred' (Bound 0);
   211     val lift_pred = lift_pred' (Bound 0);
   486                     in
   486                     in
   487                       (map (fn th =>
   487                       (map (fn th =>
   488                          let
   488                          let
   489                            val (cf, ct) =
   489                            val (cf, ct) =
   490                              Thm.dest_comb (Thm.dest_arg (Thm.cprop_of th));
   490                              Thm.dest_comb (Thm.dest_arg (Thm.cprop_of th));
   491                            val arg_cong' = Drule.instantiate'
   491                            val arg_cong' = Thm.instantiate'
   492                              [SOME (Thm.ctyp_of_cterm ct)]
   492                              [SOME (Thm.ctyp_of_cterm ct)]
   493                              [NONE, SOME ct, SOME cf] (arg_cong RS iffD2);
   493                              [NONE, SOME ct, SOME cf] (arg_cong RS iffD2);
   494                            val inst = Thm.first_order_match (ct,
   494                            val inst = Thm.first_order_match (ct,
   495                              Thm.dest_arg (Thm.dest_arg (Thm.cprop_of th')))
   495                              Thm.dest_arg (Thm.dest_arg (Thm.cprop_of th')))
   496                          in [th', th] MRS Thm.instantiate inst arg_cong'
   496                          in [th', th] MRS Thm.instantiate inst arg_cong'