src/HOL/HOLCF/IOA/meta_theory/Sequence.thy
changeset 62002 f1599e98c4d0
parent 62001 1f2788fb0b8b
child 62005 68db98c2cd97
equal deleted inserted replaced
62001:1f2788fb0b8b 62002:f1599e98c4d0
    91 
    91 
    92 lemma Map_cons: "Map f$(x\<leadsto>xs)=(f x) \<leadsto> Map f$xs"
    92 lemma Map_cons: "Map f$(x\<leadsto>xs)=(f x) \<leadsto> Map f$xs"
    93 by (simp add: Map_def Consq_def flift2_def)
    93 by (simp add: Map_def Consq_def flift2_def)
    94 
    94 
    95 
    95 
    96 subsubsection {* Filter *}
    96 subsubsection \<open>Filter\<close>
    97 
    97 
    98 lemma Filter_UU: "Filter P$UU =UU"
    98 lemma Filter_UU: "Filter P$UU =UU"
    99 by (simp add: Filter_def)
    99 by (simp add: Filter_def)
   100 
   100 
   101 lemma Filter_nil: "Filter P$nil =nil"
   101 lemma Filter_nil: "Filter P$nil =nil"
   104 lemma Filter_cons:
   104 lemma Filter_cons:
   105   "Filter P$(x\<leadsto>xs)= (if P x then x\<leadsto>(Filter P$xs) else Filter P$xs)"
   105   "Filter P$(x\<leadsto>xs)= (if P x then x\<leadsto>(Filter P$xs) else Filter P$xs)"
   106 by (simp add: Filter_def Consq_def flift2_def If_and_if)
   106 by (simp add: Filter_def Consq_def flift2_def If_and_if)
   107 
   107 
   108 
   108 
   109 subsubsection {* Forall *}
   109 subsubsection \<open>Forall\<close>
   110 
   110 
   111 lemma Forall_UU: "Forall P UU"
   111 lemma Forall_UU: "Forall P UU"
   112 by (simp add: Forall_def sforall_def)
   112 by (simp add: Forall_def sforall_def)
   113 
   113 
   114 lemma Forall_nil: "Forall P nil"
   114 lemma Forall_nil: "Forall P nil"
   116 
   116 
   117 lemma Forall_cons: "Forall P (x\<leadsto>xs)= (P x & Forall P xs)"
   117 lemma Forall_cons: "Forall P (x\<leadsto>xs)= (P x & Forall P xs)"
   118 by (simp add: Forall_def sforall_def Consq_def flift2_def)
   118 by (simp add: Forall_def sforall_def Consq_def flift2_def)
   119 
   119 
   120 
   120 
   121 subsubsection {* Conc *}
   121 subsubsection \<open>Conc\<close>
   122 
   122 
   123 lemma Conc_cons: "(x\<leadsto>xs) @@ y = x\<leadsto>(xs @@y)"
   123 lemma Conc_cons: "(x\<leadsto>xs) @@ y = x\<leadsto>(xs @@y)"
   124 by (simp add: Consq_def)
   124 by (simp add: Consq_def)
   125 
   125 
   126 
   126 
   127 subsubsection {* Takewhile *}
   127 subsubsection \<open>Takewhile\<close>
   128 
   128 
   129 lemma Takewhile_UU: "Takewhile P$UU =UU"
   129 lemma Takewhile_UU: "Takewhile P$UU =UU"
   130 by (simp add: Takewhile_def)
   130 by (simp add: Takewhile_def)
   131 
   131 
   132 lemma Takewhile_nil: "Takewhile P$nil =nil"
   132 lemma Takewhile_nil: "Takewhile P$nil =nil"
   135 lemma Takewhile_cons:
   135 lemma Takewhile_cons:
   136   "Takewhile P$(x\<leadsto>xs)= (if P x then x\<leadsto>(Takewhile P$xs) else nil)"
   136   "Takewhile P$(x\<leadsto>xs)= (if P x then x\<leadsto>(Takewhile P$xs) else nil)"
   137 by (simp add: Takewhile_def Consq_def flift2_def If_and_if)
   137 by (simp add: Takewhile_def Consq_def flift2_def If_and_if)
   138 
   138 
   139 
   139 
   140 subsubsection {* DropWhile *}
   140 subsubsection \<open>DropWhile\<close>
   141 
   141 
   142 lemma Dropwhile_UU: "Dropwhile P$UU =UU"
   142 lemma Dropwhile_UU: "Dropwhile P$UU =UU"
   143 by (simp add: Dropwhile_def)
   143 by (simp add: Dropwhile_def)
   144 
   144 
   145 lemma Dropwhile_nil: "Dropwhile P$nil =nil"
   145 lemma Dropwhile_nil: "Dropwhile P$nil =nil"
   148 lemma Dropwhile_cons:
   148 lemma Dropwhile_cons:
   149   "Dropwhile P$(x\<leadsto>xs)= (if P x then Dropwhile P$xs else x\<leadsto>xs)"
   149   "Dropwhile P$(x\<leadsto>xs)= (if P x then Dropwhile P$xs else x\<leadsto>xs)"
   150 by (simp add: Dropwhile_def Consq_def flift2_def If_and_if)
   150 by (simp add: Dropwhile_def Consq_def flift2_def If_and_if)
   151 
   151 
   152 
   152 
   153 subsubsection {* Last *}
   153 subsubsection \<open>Last\<close>
   154 
   154 
   155 lemma Last_UU: "Last$UU =UU"
   155 lemma Last_UU: "Last$UU =UU"
   156 by (simp add: Last_def)
   156 by (simp add: Last_def)
   157 
   157 
   158 lemma Last_nil: "Last$nil =UU"
   158 lemma Last_nil: "Last$nil =UU"
   163 apply (cases xs)
   163 apply (cases xs)
   164 apply simp_all
   164 apply simp_all
   165 done
   165 done
   166 
   166 
   167 
   167 
   168 subsubsection {* Flat *}
   168 subsubsection \<open>Flat\<close>
   169 
   169 
   170 lemma Flat_UU: "Flat$UU =UU"
   170 lemma Flat_UU: "Flat$UU =UU"
   171 by (simp add: Flat_def)
   171 by (simp add: Flat_def)
   172 
   172 
   173 lemma Flat_nil: "Flat$nil =nil"
   173 lemma Flat_nil: "Flat$nil =nil"
   175 
   175 
   176 lemma Flat_cons: "Flat$(x##xs)= x @@ (Flat$xs)"
   176 lemma Flat_cons: "Flat$(x##xs)= x @@ (Flat$xs)"
   177 by (simp add: Flat_def Consq_def)
   177 by (simp add: Flat_def Consq_def)
   178 
   178 
   179 
   179 
   180 subsubsection {* Zip *}
   180 subsubsection \<open>Zip\<close>
   181 
   181 
   182 lemma Zip_unfold:
   182 lemma Zip_unfold:
   183 "Zip = (LAM t1 t2. case t1 of
   183 "Zip = (LAM t1 t2. case t1 of
   184                 nil   => nil
   184                 nil   => nil
   185               | x##xs => (case t2 of
   185               | x##xs => (case t2 of
  1073     take_lemma_in_eq_out [THEN mp])
  1073     take_lemma_in_eq_out [THEN mp])
  1074 apply auto
  1074 apply auto
  1075 done
  1075 done
  1076 
  1076 
  1077 
  1077 
  1078 ML {*
  1078 ML \<open>
  1079 
  1079 
  1080 fun Seq_case_tac ctxt s i =
  1080 fun Seq_case_tac ctxt s i =
  1081   Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_cases} i
  1081   Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_cases} i
  1082   THEN hyp_subst_tac ctxt i THEN hyp_subst_tac ctxt (i+1) THEN hyp_subst_tac ctxt (i+2);
  1082   THEN hyp_subst_tac ctxt i THEN hyp_subst_tac ctxt (i+1) THEN hyp_subst_tac ctxt (i+2);
  1083 
  1083 
  1107   Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_induct} i
  1107   Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_induct} i
  1108   THEN pair_tac ctxt "a" (i+3)
  1108   THEN pair_tac ctxt "a" (i+3)
  1109   THEN (REPEAT_DETERM (CHANGED (simp_tac ctxt (i+1))))
  1109   THEN (REPEAT_DETERM (CHANGED (simp_tac ctxt (i+1))))
  1110   THEN simp_tac (ctxt addsimps rws) i;
  1110   THEN simp_tac (ctxt addsimps rws) i;
  1111 
  1111 
  1112 *}
  1112 \<close>
  1113 
  1113 
  1114 end
  1114 end