FSet.thy
changeset 423 2f0ad33f0241
parent 420 dcfe009c98aa
child 430 123877af04ed
child 432 9c33c0809733
equal deleted inserted replaced
422:1f2c8be84be7 423:2f0ad33f0241
   339 
   339 
   340 lemma "FUNION (FUNION x xa) xb = FUNION x (FUNION xa xb)"
   340 lemma "FUNION (FUNION x xa) xb = FUNION x (FUNION xa xb)"
   341 apply (tactic {* lift_tac_fset @{context} @{thm append_assoc} 1 *})
   341 apply (tactic {* lift_tac_fset @{context} @{thm append_assoc} 1 *})
   342 done
   342 done
   343 
   343 
       
   344 ML {* fun r_mk_comb_tac_fset lthy = r_mk_comb_tac' lthy rty [quot] [rel_refl] [trans2] rsp_thms *}
       
   345 
   344 lemma cheat: "P" sorry
   346 lemma cheat: "P" sorry
   345 
   347 
   346 lemma "\<lbrakk>P EMPTY; \<And>a x. P x \<Longrightarrow> P (INSERT a x)\<rbrakk> \<Longrightarrow> P l"
   348 lemma "\<lbrakk>P EMPTY; \<And>a x. P x \<Longrightarrow> P (INSERT a x)\<rbrakk> \<Longrightarrow> P l"
   347 apply(tactic {* procedure_tac @{context} @{thm list.induct} 1 *})
   349 apply(tactic {* procedure_tac @{context} @{thm list.induct} 1 *})
   348 apply(tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *})
   350 apply(tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *})
   349 prefer 2
   351 prefer 2
   350 apply (tactic {* clean_tac @{context} [quot] defs 
   352 apply(rule cheat)
   351                  [(@{typ "('a list \<Rightarrow> bool)"},@{typ "('a fset \<Rightarrow> bool)"})] 1 *})
   353 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 3 *) (* Ball-Ball *)
   352 apply(tactic {* r_mk_comb_tac' @{context} rty [quot] rel_refl trans2 rsp_thms 1*})
   354 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
   353 done
   355 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 2 *) (* lam-lam-elim for R = (===>) *) 
   354 
   356 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 3 *) (* Ball-Ball *)
   355 
   357 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   358 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 2 *) (* lam-lam-elim for R = (===>) *) 
       
   359 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   360 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   361 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 8 *) (* = reflexivity arising from cong *)
       
   362 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   363 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   364 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   365 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   366 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* D *) (* reflexivity of basic relations *)
       
   367 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   368 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   369 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 8 *) (* = reflexivity arising from cong *)
       
   370 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   371 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 8 *) (* = reflexivity arising from cong *)
       
   372 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* C *) (* = and extensionality *)
       
   373 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 3 *) (* Ball-Ball *)
       
   374 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   375 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 2 *) (* lam-lam-elim for R = (===>) *) 
       
   376 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   377 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* B *) (* Cong *)
       
   378 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 8 *) (* = reflexivity arising from cong *)
       
   379 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   380 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   381 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   382 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   383 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   384 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   385 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   386 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   387 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   388 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   389 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   390 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 7 *) (* respectfulness *)
       
   391 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 8 *) (* = reflexivity arising from cong *)
       
   392 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   393 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   394 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* A *) (* application if type needs lifting *)
       
   395 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   396 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   397 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* 9 *) (* Rep-Abs-elim - can be complex Rep-Abs *)
       
   398 apply(tactic {* r_mk_comb_tac_fset @{context} 1*}) (* E *) (* R x y assumptions *)
       
   399 done
   356 
   400 
   357 
   401 
   358 quotient_def
   402 quotient_def
   359   fset_rec::"'a \<Rightarrow> ('b \<Rightarrow> 'b fset \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'b fset \<Rightarrow> 'a"
   403   fset_rec::"'a \<Rightarrow> ('b \<Rightarrow> 'b fset \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> 'b fset \<Rightarrow> 'a"
   360 where
   404 where
   398   apply (rule a)
   442   apply (rule a)
   399   apply (rule b)
   443   apply (rule b)
   400   apply (assumption)
   444   apply (assumption)
   401   done
   445   done
   402 
   446 
   403 
       
   404 ML {* fun r_mk_comb_tac_fset lthy = r_mk_comb_tac lthy rty [quot] [rel_refl] [trans2] rsp_thms *}
   447 ML {* fun r_mk_comb_tac_fset lthy = r_mk_comb_tac lthy rty [quot] [rel_refl] [trans2] rsp_thms *}
   405 
       
   406 
       
   407 
       
   408 
   448 
   409 (* Construction site starts here *)
   449 (* Construction site starts here *)
   410 lemma "P (x :: 'a list) (EMPTY :: 'c fset) \<Longrightarrow> (\<And>e t. P x t \<Longrightarrow> P x (INSERT e t)) \<Longrightarrow> P x l"
   450 lemma "P (x :: 'a list) (EMPTY :: 'c fset) \<Longrightarrow> (\<And>e t. P x t \<Longrightarrow> P x (INSERT e t)) \<Longrightarrow> P x l"
   411 apply (tactic {* procedure_tac @{context} @{thm list_induct_part} 1 *})
   451 apply (tactic {* procedure_tac @{context} @{thm list_induct_part} 1 *})
   412 apply (tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *})
   452 apply (tactic {* regularize_tac @{context} [rel_eqv] [rel_refl] 1 *})