src/HOL/ZF/LProd.thy
changeset 35416 d8d7d1b785af
parent 29667 53103fc8ffa3
child 35422 e74b6f3b950c
equal deleted inserted replaced
35342:4dc65845eab3 35416:d8d7d1b785af
     1 (*  Title:      HOL/ZF/LProd.thy
     1 (*  Title:      HOL/ZF/LProd.thy
     2     ID:         $Id$
       
     3     Author:     Steven Obua
     2     Author:     Steven Obua
     4 
     3 
     5     Introduces the lprod relation.
     4     Introduces the lprod relation.
     6     See "Partizan Games in Isabelle/HOLZF", available from http://www4.in.tum.de/~obua/partizan
     5     See "Partizan Games in Isabelle/HOLZF", available from http://www4.in.tum.de/~obua/partizan
     7 *)
     6 *)
    93     OF wf_mult[OF wf_trancl[OF wf_R]]], OF subset]
    92     OF wf_mult[OF wf_trancl[OF wf_R]]], OF subset]
    94   note lprod = wf_subset[OF lprodtrancl, where p="lprod R", OF lprod_subset, simplified]
    93   note lprod = wf_subset[OF lprodtrancl, where p="lprod R", OF lprod_subset, simplified]
    95   show ?thesis by (auto intro: lprod)
    94   show ?thesis by (auto intro: lprod)
    96 qed
    95 qed
    97 
    96 
    98 constdefs
    97 definition gprod_2_2 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" where
    99   gprod_2_2 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set"
       
   100   "gprod_2_2 R \<equiv> { ((a,b), (c,d)) . (a = c \<and> (b,d) \<in> R) \<or> (b = d \<and> (a,c) \<in> R) }"
    98   "gprod_2_2 R \<equiv> { ((a,b), (c,d)) . (a = c \<and> (b,d) \<in> R) \<or> (b = d \<and> (a,c) \<in> R) }"
   101   gprod_2_1 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set"
    99 
       
   100 definition gprod_2_1 :: "('a * 'a) set \<Rightarrow> (('a * 'a) * ('a * 'a)) set" where
   102   "gprod_2_1 R \<equiv>  { ((a,b), (c,d)) . (a = d \<and> (b,c) \<in> R) \<or> (b = c \<and> (a,d) \<in> R) }"
   101   "gprod_2_1 R \<equiv>  { ((a,b), (c,d)) . (a = d \<and> (b,c) \<in> R) \<or> (b = c \<and> (a,d) \<in> R) }"
   103 
   102 
   104 lemma lprod_2_3: "(a, b) \<in> R \<Longrightarrow> ([a, c], [b, c]) \<in> lprod R"
   103 lemma lprod_2_3: "(a, b) \<in> R \<Longrightarrow> ([a, c], [b, c]) \<in> lprod R"
   105   by (auto intro: lprod_list[where a=c and b=c and 
   104   by (auto intro: lprod_list[where a=c and b=c and 
   106     ah = "[a]" and at = "[]" and bh="[b]" and bt="[]", simplified]) 
   105     ah = "[a]" and at = "[]" and bh="[b]" and bt="[]", simplified]) 
   168 lemma lprod_3_7: assumes z': "(z',z) \<in> R" shows "([x, z', y], [x, y, z]) \<in> lprod R"
   167 lemma lprod_3_7: assumes z': "(z',z) \<in> R" shows "([x, z', y], [x, y, z]) \<in> lprod R"
   169   apply (rule lprod_list[where a="y" and b="y" and ah="[x, z']" and at="[]" and bh="[x]" and bt="[z]", simplified])
   168   apply (rule lprod_list[where a="y" and b="y" and ah="[x, z']" and at="[]" and bh="[x]" and bt="[z]", simplified])
   170   apply (simp add: z' lprod_2_4)
   169   apply (simp add: z' lprod_2_4)
   171   done
   170   done
   172 
   171 
   173 constdefs
   172 definition perm :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set \<Rightarrow> bool" where
   174    perm :: "('a \<Rightarrow> 'a) \<Rightarrow> 'a set \<Rightarrow> bool"
       
   175    "perm f A \<equiv> inj_on f A \<and> f ` A = A"
   173    "perm f A \<equiv> inj_on f A \<and> f ` A = A"
   176 
   174 
   177 lemma "((as,bs) \<in> lprod R) = 
   175 lemma "((as,bs) \<in> lprod R) = 
   178   (\<exists> f. perm f {0 ..< (length as)} \<and> 
   176   (\<exists> f. perm f {0 ..< (length as)} \<and> 
   179   (\<forall> j. j < length as \<longrightarrow> ((nth as j, nth bs (f j)) \<in> R \<or> (nth as j = nth bs (f j)))) \<and> 
   177   (\<forall> j. j < length as \<longrightarrow> ((nth as j, nth bs (f j)) \<in> R \<or> (nth as j = nth bs (f j)))) \<and> 
   181 oops
   179 oops
   182 
   180 
   183 lemma "trans R \<Longrightarrow> (ah@a#at, bh@b#bt) \<in> lprod R \<Longrightarrow> (b, a) \<in> R \<or> a = b \<Longrightarrow> (ah@at, bh@bt) \<in> lprod R" 
   181 lemma "trans R \<Longrightarrow> (ah@a#at, bh@b#bt) \<in> lprod R \<Longrightarrow> (b, a) \<in> R \<or> a = b \<Longrightarrow> (ah@at, bh@bt) \<in> lprod R" 
   184 oops
   182 oops
   185 
   183 
   186 
       
   187 
       
   188 end
   184 end