src/ZF/indrule.ML
changeset 751 f0aacbcedb77
parent 724 36c0ac2f4935
child 1104 141f73abbafc
equal deleted inserted replaced
750:019aadf0e315 751:f0aacbcedb77
   137 (*Mutual induction follows by freeness of Inl/Inr.*)
   137 (*Mutual induction follows by freeness of Inl/Inr.*)
   138 
   138 
   139 (*Simplification largely reduces the mutual induction rule to the 
   139 (*Simplification largely reduces the mutual induction rule to the 
   140   standard rule*)
   140   standard rule*)
   141 val mut_ss = 
   141 val mut_ss = 
   142     FOL_ss addcongs [Collect_cong]
   142     FOL_ss addsimps   [Su.distinct, Su.distinct', Su.inl_iff, Su.inr_iff];
   143 	   addsimps [Su.distinct, Su.distinct', Su.inl_iff, Su.inr_iff];
       
   144 
   143 
   145 val all_defs = con_defs@part_rec_defs;
   144 val all_defs = con_defs@part_rec_defs;
   146 
   145 
   147 (*Removes Collects caused by M-operators in the intro rules.  It is very
   146 (*Removes Collects caused by M-operators in the intro rules.  It is very
   148   hard to simplify
   147   hard to simplify
   157   | mutual_ind_tac(prem::prems) i = 
   156   | mutual_ind_tac(prem::prems) i = 
   158       DETERM
   157       DETERM
   159        (SELECT_GOAL 
   158        (SELECT_GOAL 
   160 	  (
   159 	  (
   161 	   (*Simplify the assumptions and goal by unfolding Part and
   160 	   (*Simplify the assumptions and goal by unfolding Part and
   162 	     using freeness of the Sum constructors*)
   161 	     using freeness of the Sum constructors; proves all but one
       
   162              conjunct by contradiction*)
   163 	   rewrite_goals_tac all_defs  THEN
   163 	   rewrite_goals_tac all_defs  THEN
   164 	   simp_tac (mut_ss addsimps [Part_iff]) 1  THEN
   164 	   simp_tac (mut_ss addsimps [Part_iff]) 1  THEN
   165 	   IF_UNSOLVED (*simp_tac may have finished it off!*)
   165 	   IF_UNSOLVED (*simp_tac may have finished it off!*)
   166 	     (asm_full_simp_tac mut_ss 1  THEN
   166 	     ((*simplify assumptions, but don't accept new rewrite rules!*)
       
   167 	      asm_full_simp_tac (mut_ss setmksimps K[]) 1  THEN
   167 	      (*unpackage and use "prem" in the corresponding place*)
   168 	      (*unpackage and use "prem" in the corresponding place*)
   168 	      REPEAT (rtac impI 1)  THEN
   169 	      REPEAT (rtac impI 1)  THEN
   169 	      rtac (rewrite_rule all_defs prem) 1  THEN
   170 	      rtac (rewrite_rule all_defs prem) 1  THEN
   170 	      (*prem must not be REPEATed below: could loop!*)
   171 	      (*prem must not be REPEATed below: could loop!*)
   171 	      DEPTH_SOLVE (FIRSTGOAL (ares_tac [impI] ORELSE' 
   172 	      DEPTH_SOLVE (FIRSTGOAL (ares_tac [impI] ORELSE' 
   172 			      eresolve_tac ([conjE]@cmonos))))
   173 				      eresolve_tac (conjE::mp::cmonos))))
   173 	  ) i)
   174 	  ) i)
   174        THEN mutual_ind_tac prems (i-1);
   175        THEN mutual_ind_tac prems (i-1);
   175 
   176 
   176 val _ = writeln "  Proving the mutual induction rule...";
   177 val _ = writeln "  Proving the mutual induction rule...";
   177 
   178