src/HOL/BNF_Wellorder_Constructions.thy
changeset 67613 ce654b0e6d69
parent 67091 1393c2340eec
child 72127 a0768f16bccd
equal deleted inserted replaced
67610:4939494ed791 67613:ce654b0e6d69
   836 
   836 
   837 definition ord_to_filter :: "'a rel \<Rightarrow> 'a rel \<Rightarrow> 'a set"
   837 definition ord_to_filter :: "'a rel \<Rightarrow> 'a rel \<Rightarrow> 'a set"
   838 where "ord_to_filter r0 r \<equiv> (SOME f. embed r r0 f) ` (Field r)"
   838 where "ord_to_filter r0 r \<equiv> (SOME f. embed r r0 f) ` (Field r)"
   839 
   839 
   840 lemma ord_to_filter_compat:
   840 lemma ord_to_filter_compat:
   841 "compat (ordLess Int (ordLess^-1``{r0} \<times> ordLess^-1``{r0}))
   841 "compat (ordLess Int (ordLess\<inverse>``{r0} \<times> ordLess\<inverse>``{r0}))
   842         (ofilterIncl r0)
   842         (ofilterIncl r0)
   843         (ord_to_filter r0)"
   843         (ord_to_filter r0)"
   844 proof(unfold compat_def ord_to_filter_def, clarify)
   844 proof(unfold compat_def ord_to_filter_def, clarify)
   845   fix r1::"'a rel" and r2::"'a rel"
   845   fix r1::"'a rel" and r2::"'a rel"
   846   let ?A1 = "Field r1"  let ?A2 ="Field r2" let ?A0 ="Field r0"
   846   let ?A1 = "Field r1"  let ?A2 ="Field r2" let ?A0 ="Field r0"
   857 theorem wf_ordLess: "wf ordLess"
   857 theorem wf_ordLess: "wf ordLess"
   858 proof-
   858 proof-
   859   {fix r0 :: "('a \<times> 'a) set"
   859   {fix r0 :: "('a \<times> 'a) set"
   860    (* need to annotate here!*)
   860    (* need to annotate here!*)
   861    let ?ordLess = "ordLess::('d rel * 'd rel) set"
   861    let ?ordLess = "ordLess::('d rel * 'd rel) set"
   862    let ?R = "?ordLess Int (?ordLess^-1``{r0} \<times> ?ordLess^-1``{r0})"
   862    let ?R = "?ordLess Int (?ordLess\<inverse>``{r0} \<times> ?ordLess\<inverse>``{r0})"
   863    {assume Case1: "Well_order r0"
   863    {assume Case1: "Well_order r0"
   864     hence "wf ?R"
   864     hence "wf ?R"
   865     using wf_ofilterIncl[of r0]
   865     using wf_ofilterIncl[of r0]
   866           compat_wf[of ?R "ofilterIncl r0" "ord_to_filter r0"]
   866           compat_wf[of ?R "ofilterIncl r0" "ord_to_filter r0"]
   867           ord_to_filter_compat[of r0] by auto
   867           ord_to_filter_compat[of r0] by auto
   932                          2: "(a,b1) \<in> r \<and> (b2,c) \<in> r"
   932                          2: "(a,b1) \<in> r \<and> (b2,c) \<in> r"
   933   unfolding dir_image_def by blast
   933   unfolding dir_image_def by blast
   934   hence "b1 \<in> Field r \<and> b2 \<in> Field r"
   934   hence "b1 \<in> Field r \<and> b2 \<in> Field r"
   935   unfolding Field_def by auto
   935   unfolding Field_def by auto
   936   hence "b1 = b2" using 1 INJ unfolding inj_on_def by auto
   936   hence "b1 = b2" using 1 INJ unfolding inj_on_def by auto
   937   hence "(a,c): r" using 2 TRANS unfolding trans_def by blast
   937   hence "(a,c) \<in> r" using 2 TRANS unfolding trans_def by blast
   938   thus "(a',c') \<in> dir_image r f"
   938   thus "(a',c') \<in> dir_image r f"
   939   unfolding dir_image_def using 1 by auto
   939   unfolding dir_image_def using 1 by auto
   940 qed
   940 qed
   941 
   941 
   942 lemma Preorder_dir_image:
   942 lemma Preorder_dir_image: