src/HOL/ZF/Games.thy
changeset 26304 02fbd0e7954a
parent 25764 878c37886eed
child 27679 6392b92c3536
equal deleted inserted replaced
26303:e4f40a0ea2e1 26304:02fbd0e7954a
   373                           else (if zin x (left_options H) then \<not> (ge_game (x, G)) else True))"
   373                           else (if zin x (left_options H) then \<not> (ge_game (x, G)) else True))"
   374 (hints simp: gprod_2_1_def)
   374 (hints simp: gprod_2_1_def)
   375 
   375 
   376 declare ge_game.simps [simp del]
   376 declare ge_game.simps [simp del]
   377 
   377 
   378 lemma ge_game_def: "ge_game (G, H) = (\<forall> x. (zin x (right_options G) \<longrightarrow> \<not> ge_game (H, x)) \<and> (zin x (left_options H) \<longrightarrow> \<not> ge_game (x, G)))"
   378 lemma ge_game_eq: "ge_game (G, H) = (\<forall> x. (zin x (right_options G) \<longrightarrow> \<not> ge_game (H, x)) \<and> (zin x (left_options H) \<longrightarrow> \<not> ge_game (x, G)))"
   379   apply (subst ge_game.simps[where G=G and H=H])
   379   apply (subst ge_game.simps[where G=G and H=H])
   380   apply (auto)
   380   apply (auto)
   381   done
   381   done
   382 
   382 
   383 lemma ge_game_leftright_refl[rule_format]: 
   383 lemma ge_game_leftright_refl[rule_format]: 
   389     assume y: "zin y (right_options g)"
   389     assume y: "zin y (right_options g)"
   390     have "\<not> ge_game (g, y)"
   390     have "\<not> ge_game (g, y)"
   391     proof -
   391     proof -
   392       have "(y, g) \<in> option_of" by (auto intro: y)
   392       have "(y, g) \<in> option_of" by (auto intro: y)
   393       with 1 have "ge_game (y, y)" by auto
   393       with 1 have "ge_game (y, y)" by auto
   394       with y show ?thesis by (subst ge_game_def, auto)
   394       with y show ?thesis by (subst ge_game_eq, auto)
   395     qed
   395     qed
   396   }
   396   }
   397   note right = this
   397   note right = this
   398   { 
   398   { 
   399     fix y
   399     fix y
   400     assume y: "zin y (left_options g)"
   400     assume y: "zin y (left_options g)"
   401     have "\<not> ge_game (y, g)"
   401     have "\<not> ge_game (y, g)"
   402     proof -
   402     proof -
   403       have "(y, g) \<in> option_of" by (auto intro: y)
   403       have "(y, g) \<in> option_of" by (auto intro: y)
   404       with 1 have "ge_game (y, y)" by auto
   404       with 1 have "ge_game (y, y)" by auto
   405       with y show ?thesis by (subst ge_game_def, auto)
   405       with y show ?thesis by (subst ge_game_eq, auto)
   406     qed
   406     qed
   407   } 
   407   } 
   408   note left = this
   408   note left = this
   409   from left right show ?case
   409   from left right show ?case
   410     by (auto, subst ge_game_def, auto)
   410     by (auto, subst ge_game_eq, auto)
   411 qed
   411 qed
   412 
   412 
   413 lemma ge_game_refl: "ge_game (x,x)" by (simp add: ge_game_leftright_refl)
   413 lemma ge_game_refl: "ge_game (x,x)" by (simp add: ge_game_leftright_refl)
   414 
   414 
   415 lemma "\<forall> y. (zin y (right_options x) \<longrightarrow> \<not> ge_game (x, y)) \<and> (zin y (left_options x) \<longrightarrow> \<not> (ge_game (y, x))) \<and> ge_game (x, x)"
   415 lemma "\<forall> y. (zin y (right_options x) \<longrightarrow> \<not> ge_game (x, y)) \<and> (zin y (left_options x) \<longrightarrow> \<not> (ge_game (y, x))) \<and> ge_game (x, x)"
   419   proof (auto)
   419   proof (auto)
   420     {case (goal1 y) 
   420     {case (goal1 y) 
   421       from goal1 have "(y, g) \<in> option_of" by (auto)
   421       from goal1 have "(y, g) \<in> option_of" by (auto)
   422       with 1 have "ge_game (y, y)" by auto
   422       with 1 have "ge_game (y, y)" by auto
   423       with goal1 have "\<not> ge_game (g, y)" 
   423       with goal1 have "\<not> ge_game (g, y)" 
   424 	by (subst ge_game_def, auto)
   424 	by (subst ge_game_eq, auto)
   425       with goal1 show ?case by auto}
   425       with goal1 show ?case by auto}
   426     note right = this
   426     note right = this
   427     {case (goal2 y)
   427     {case (goal2 y)
   428       from goal2 have "(y, g) \<in> option_of" by (auto)
   428       from goal2 have "(y, g) \<in> option_of" by (auto)
   429       with 1 have "ge_game (y, y)" by auto
   429       with 1 have "ge_game (y, y)" by auto
   430       with goal2 have "\<not> ge_game (y, g)" 
   430       with goal2 have "\<not> ge_game (y, g)" 
   431 	by (subst ge_game_def, auto)
   431 	by (subst ge_game_eq, auto)
   432       with goal2 show ?case by auto}
   432       with goal2 show ?case by auto}
   433     note left = this
   433     note left = this
   434     {case goal3
   434     {case goal3
   435       from left right show ?case
   435       from left right show ?case
   436 	by (subst ge_game_def, auto)
   436 	by (subst ge_game_eq, auto)
   437     }
   437     }
   438   qed
   438   qed
   439 qed
   439 qed
   440 	
   440 	
   441 constdefs
   441 constdefs
   471 	    have "ge_game (y, xr)"
   471 	    have "ge_game (y, xr)"
   472 	      apply (rule 1[rule_format, where y="[y,z,xr]"])
   472 	      apply (rule 1[rule_format, where y="[y,z,xr]"])
   473 	      apply (auto intro: xr lprod_3_1 simp add: prems)
   473 	      apply (auto intro: xr lprod_3_1 simp add: prems)
   474 	      done
   474 	      done
   475 	    moreover from xr have "\<not> ge_game (y, xr)"
   475 	    moreover from xr have "\<not> ge_game (y, xr)"
   476 	      by (simp add: goal1(2)[simplified ge_game_def[of x y], rule_format, of xr, simplified xr])
   476 	      by (simp add: goal1(2)[simplified ge_game_eq[of x y], rule_format, of xr, simplified xr])
   477 	    ultimately have "False" by auto      
   477 	    ultimately have "False" by auto      
   478 	  }
   478 	  }
   479 	  note xr = this
   479 	  note xr = this
   480 	  { fix zl
   480 	  { fix zl
   481 	    assume zl:"zin zl (left_options z)"
   481 	    assume zl:"zin zl (left_options z)"
   483 	    have "ge_game (zl, y)"
   483 	    have "ge_game (zl, y)"
   484 	      apply (rule 1[rule_format, where y="[zl,x,y]"])
   484 	      apply (rule 1[rule_format, where y="[zl,x,y]"])
   485 	      apply (auto intro: zl lprod_3_2 simp add: prems)
   485 	      apply (auto intro: zl lprod_3_2 simp add: prems)
   486 	      done
   486 	      done
   487 	    moreover from zl have "\<not> ge_game (zl, y)"
   487 	    moreover from zl have "\<not> ge_game (zl, y)"
   488 	      by (simp add: goal1(3)[simplified ge_game_def[of y z], rule_format, of zl, simplified zl])
   488 	      by (simp add: goal1(3)[simplified ge_game_eq[of y z], rule_format, of zl, simplified zl])
   489 	    ultimately have "False" by auto
   489 	    ultimately have "False" by auto
   490 	  }
   490 	  }
   491 	  note zl = this
   491 	  note zl = this
   492 	  show ?thesis
   492 	  show ?thesis
   493 	    by (auto simp add: ge_game_def[of x z] intro: xr zl)
   493 	    by (auto simp add: ge_game_eq[of x z] intro: xr zl)
   494 	qed
   494 	qed
   495       qed
   495       qed
   496     qed
   496     qed
   497   } 
   497   } 
   498   note trans = this[of "[x, y, z]", simplified, rule_format]    
   498   note trans = this[of "[x, y, z]", simplified, rule_format]    
   706 	have "ge_game (y, z)"
   706 	have "ge_game (y, z)"
   707 	proof -
   707 	proof -
   708 	  { fix yr
   708 	  { fix yr
   709 	    assume yr: "zin yr (right_options y)"
   709 	    assume yr: "zin yr (right_options y)"
   710 	    from hyp have "\<not> (ge_game (plus_game (x, z), plus_game (x, yr)))"
   710 	    from hyp have "\<not> (ge_game (plus_game (x, z), plus_game (x, yr)))"
   711 	      by (auto simp add: ge_game_def[of "plus_game (x,y)" "plus_game(x,z)"]
   711 	      by (auto simp add: ge_game_eq[of "plus_game (x,y)" "plus_game(x,z)"]
   712 		right_options_plus zunion zimage_iff intro: yr)
   712 		right_options_plus zunion zimage_iff intro: yr)
   713 	    then have "\<not> (ge_game (z, yr))"
   713 	    then have "\<not> (ge_game (z, yr))"
   714 	      apply (subst induct_hyp[where y="[x, z, yr]", of "x" "z" "yr"])
   714 	      apply (subst induct_hyp[where y="[x, z, yr]", of "x" "z" "yr"])
   715 	      apply (simp_all add: yr lprod_3_6)
   715 	      apply (simp_all add: yr lprod_3_6)
   716 	      done
   716 	      done
   717 	  }
   717 	  }
   718 	  note yr = this
   718 	  note yr = this
   719 	  { fix zl
   719 	  { fix zl
   720 	    assume zl: "zin zl (left_options z)"
   720 	    assume zl: "zin zl (left_options z)"
   721 	    from hyp have "\<not> (ge_game (plus_game (x, zl), plus_game (x, y)))"
   721 	    from hyp have "\<not> (ge_game (plus_game (x, zl), plus_game (x, y)))"
   722 	      by (auto simp add: ge_game_def[of "plus_game (x,y)" "plus_game(x,z)"]
   722 	      by (auto simp add: ge_game_eq[of "plus_game (x,y)" "plus_game(x,z)"]
   723 		left_options_plus zunion zimage_iff intro: zl)
   723 		left_options_plus zunion zimage_iff intro: zl)
   724 	    then have "\<not> (ge_game (zl, y))"
   724 	    then have "\<not> (ge_game (zl, y))"
   725 	      apply (subst goal1(1)[rule_format, where y="[x, zl, y]", of "x" "zl" "y"])
   725 	      apply (subst goal1(1)[rule_format, where y="[x, zl, y]", of "x" "zl" "y"])
   726 	      apply (simp_all add: goal1(2) zl lprod_3_7)
   726 	      apply (simp_all add: goal1(2) zl lprod_3_7)
   727 	      done
   727 	      done
   728 	  }	
   728 	  }	
   729 	  note zl = this
   729 	  note zl = this
   730 	  show "ge_game (y, z)"
   730 	  show "ge_game (y, z)"
   731 	    apply (subst ge_game_def)
   731 	    apply (subst ge_game_eq)
   732 	    apply (auto simp add: yr zl)
   732 	    apply (auto simp add: yr zl)
   733 	    done
   733 	    done
   734 	qed      
   734 	qed      
   735       }
   735       }
   736       note right_imp_left = this
   736       note right_imp_left = this
   739 	{
   739 	{
   740 	  fix x'
   740 	  fix x'
   741 	  assume x': "zin x' (right_options x)"
   741 	  assume x': "zin x' (right_options x)"
   742 	  assume hyp: "ge_game (plus_game (x, z), plus_game (x', y))"
   742 	  assume hyp: "ge_game (plus_game (x, z), plus_game (x', y))"
   743 	  then have n: "\<not> (ge_game (plus_game (x', y), plus_game (x', z)))"
   743 	  then have n: "\<not> (ge_game (plus_game (x', y), plus_game (x', z)))"
   744 	    by (auto simp add: ge_game_def[of "plus_game (x,z)" "plus_game (x', y)"] 
   744 	    by (auto simp add: ge_game_eq[of "plus_game (x,z)" "plus_game (x', y)"] 
   745 	      right_options_plus zunion zimage_iff intro: x')
   745 	      right_options_plus zunion zimage_iff intro: x')
   746 	  have t: "ge_game (plus_game (x', y), plus_game (x', z))"
   746 	  have t: "ge_game (plus_game (x', y), plus_game (x', z))"
   747 	    apply (subst induct_hyp[symmetric])
   747 	    apply (subst induct_hyp[symmetric])
   748 	    apply (auto intro: lprod_3_3 x' yz)
   748 	    apply (auto intro: lprod_3_3 x' yz)
   749 	    done
   749 	    done
   753 	{
   753 	{
   754 	  fix x'
   754 	  fix x'
   755 	  assume x': "zin x' (left_options x)"
   755 	  assume x': "zin x' (left_options x)"
   756 	  assume hyp: "ge_game (plus_game (x', z), plus_game (x, y))"
   756 	  assume hyp: "ge_game (plus_game (x', z), plus_game (x, y))"
   757 	  then have n: "\<not> (ge_game (plus_game (x', y), plus_game (x', z)))"
   757 	  then have n: "\<not> (ge_game (plus_game (x', y), plus_game (x', z)))"
   758 	    by (auto simp add: ge_game_def[of "plus_game (x',z)" "plus_game (x, y)"] 
   758 	    by (auto simp add: ge_game_eq[of "plus_game (x',z)" "plus_game (x, y)"] 
   759 	      left_options_plus zunion zimage_iff intro: x')
   759 	      left_options_plus zunion zimage_iff intro: x')
   760 	  have t: "ge_game (plus_game (x', y), plus_game (x', z))"
   760 	  have t: "ge_game (plus_game (x', y), plus_game (x', z))"
   761 	    apply (subst induct_hyp[symmetric])
   761 	    apply (subst induct_hyp[symmetric])
   762 	    apply (auto intro: lprod_3_3 x' yz)
   762 	    apply (auto intro: lprod_3_3 x' yz)
   763 	    done
   763 	    done
   789 	    by (blast intro: ge_game_trans)      
   789 	    by (blast intro: ge_game_trans)      
   790 	  with z' have "False" by (auto simp add: ge_game_leftright_refl)
   790 	  with z' have "False" by (auto simp add: ge_game_leftright_refl)
   791 	}
   791 	}
   792 	note case4 = this   
   792 	note case4 = this   
   793 	have "ge_game(plus_game (x, y), plus_game (x, z))"
   793 	have "ge_game(plus_game (x, y), plus_game (x, z))"
   794 	  apply (subst ge_game_def)
   794 	  apply (subst ge_game_eq)
   795 	  apply (auto simp add: right_options_plus left_options_plus zunion zimage_iff)
   795 	  apply (auto simp add: right_options_plus left_options_plus zunion zimage_iff)
   796 	  apply (auto intro: case1 case2 case3 case4)
   796 	  apply (auto intro: case1 case2 case3 case4)
   797 	  done
   797 	  done
   798       }
   798       }
   799       note left_imp_right = this
   799       note left_imp_right = this
   829 	  apply (auto simp add: lprod_2_2 yr)
   829 	  apply (auto simp add: lprod_2_2 yr)
   830 	  done
   830 	  done
   831       }
   831       }
   832       note yr = this
   832       note yr = this
   833       show ?case
   833       show ?case
   834 	by (auto simp add: ge_game_def[of "neg_game x" "neg_game y"] ge_game_def[of "y" "x"]
   834 	by (auto simp add: ge_game_eq[of "neg_game x" "neg_game y"] ge_game_eq[of "y" "x"]
   835 	  right_options_neg left_options_neg zimage_iff  xl yr)
   835 	  right_options_neg left_options_neg zimage_iff  xl yr)
   836     qed
   836     qed
   837   }
   837   }
   838   note a = this[of "[x,y]"]
   838   note a = this[of "[x,y]"]
   839   then show ?thesis by blast
   839   then show ?thesis by blast