[STATEMENT]
lemma retrieve_stored_tval_u32:
  assumes "val = Uint32_v v"
  shows "retrieve_tval (store_tval obj off val) off (memval_type val) b = val"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. retrieve_tval (store_tval obj off val) off (memval_type val) b = val
[PROOF STEP]
unfolding retrieve_tval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if is_contiguous_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau> then case memval_type val of Uint8 \<Rightarrow> Uint8_v (decode_u8_list (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Sint8 \<Rightarrow> Sint8_v (UCAST(8 \<rightarrow> 8 signed) (decode_u8_list (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>))) | Uint16 \<Rightarrow> Uint16_v (cat_u16 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Sint16 \<Rightarrow> Sint16_v (cat_s16 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Uint32 \<Rightarrow> Uint32_v (cat_u32 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Sint32 \<Rightarrow> Sint32_v (cat_s32 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Uint64 \<Rightarrow> Uint64_v (cat_u64 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Sint64 \<Rightarrow> Sint64_v (cat_s64 (retrieve_bytes (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau>)) | Cap \<Rightarrow> if is_contiguous_zeros (content (store_tval obj off val)) off |memval_type val|\<^sub>\<tau> then Cap_v NULL else Undef else if is_cap (content (store_tval obj off val)) off then let cap = get_cap (content (store_tval obj off val)) off; tv = the (Mapping.lookup (tags (store_tval obj off val)) (cap_offset off)); t = case b of True \<Rightarrow> tv | False \<Rightarrow> False; cv = mem_capability.extend cap \<lparr>tag = t\<rparr>; nth_frag = of_nth (the (Mapping.lookup (content (store_tval obj off val)) off)) in case memval_type val of Uint8 \<Rightarrow> Cap_v_frag (mem_capability.extend cap \<lparr>tag = False\<rparr>) nth_frag | Sint8 \<Rightarrow> Cap_v_frag (mem_capability.extend cap \<lparr>tag = False\<rparr>) nth_frag | Cap \<Rightarrow> if is_contiguous_cap (content (store_tval obj off val)) cap off |memval_type val|\<^sub>\<tau> then Cap_v cv else Undef | _ \<Rightarrow> Undef else Undef) = val
[PROOF STEP]
proof (clarsimp simp add: assms stored_tval_contiguous_bytes; safe)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 2. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk> \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 3. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 4. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 5. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 6. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "\<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off));
     is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk>
    \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
[PROOF STEP]
by (presburger add: decode_encoded_u32_in_mem)
[PROOF STATE]
proof (state)
this:
\<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v

goal (5 subgoals):
 1. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk> \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 2. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 3. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 4. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 5. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk> \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 2. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 3. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 4. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 5. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "\<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk>
    \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk> \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
by (metis ccval.distinct(75) ccval.distinct(77) ccval.distinct(79) is_contiguous_bytes.simps(2) memval_size_u32 numeral_4_eq_4 stored_tval_contiguous_bytes)
[PROOF STATE]
proof (state)
this:
\<lbrakk>off \<in> Mapping.keys (content (store_tval obj off (Uint32_v v))); memval_is_cap (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off))\<rbrakk> \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>

goal (4 subgoals):
 1. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 2. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 3. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 4. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 2. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 3. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 4. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "\<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk>
    \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
[PROOF STEP]
by (presburger add: decode_encoded_u32_in_mem)
[PROOF STATE]
proof (state)
this:
\<lbrakk>off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v

goal (3 subgoals):
 1. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 2. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 3. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
 2. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 3. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
by (metis ccval.distinct(77) ccval.distinct(79) is_cap.elims(2) is_contiguous_bytes.simps(2) memval_size_u32 numeral_4_eq_4 stored_tval_contiguous_bytes stored_tval_is_cap)
[PROOF STATE]
proof (state)
this:
off \<notin> Mapping.keys (content (store_tval obj off (Uint32_v v))) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>

goal (2 subgoals):
 1. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 2. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
 2. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "\<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk>
    \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v
[PROOF STEP]
by (presburger add: decode_encoded_u32_in_mem)
[PROOF STATE]
proof (state)
this:
\<lbrakk>memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)); is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>\<rbrakk> \<Longrightarrow> cat_u32 (retrieve_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>) = v

goal (1 subgoal):
 1. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
show "memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>
[PROOF STEP]
by (metis cctype.simps(77) ccval.distinct(75) ccval.distinct(77) ccval.distinct(79) memval_size_u32 sizeof_def stored_tval_contiguous_bytes)
[PROOF STATE]
proof (state)
this:
memval_is_byte (the (Mapping.lookup (content (store_tval obj off (Uint32_v v))) off)) \<Longrightarrow> is_contiguous_bytes (content (store_tval obj off (Uint32_v v))) off |Uint32|\<^sub>\<tau>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma optimize_matches_option_generic:
  assumes "\<forall> r \<in> set rs. P (get_match r) (get_action r)"
      and "(\<And>m m' a. P m a \<Longrightarrow> f m = Some m' \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p)"
      and "(\<And>m a. P m a \<Longrightarrow> f m = None \<Longrightarrow> \<not> matches \<gamma> m a p)"
  shows "approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) s = approximating_bigstep_fun \<gamma> p rs s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) s = approximating_bigstep_fun \<gamma> p rs s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set rs. P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (1 subgoal):
 1. approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) s = approximating_bigstep_fun \<gamma> p rs s
[PROOF STEP]
proof(induction \<gamma> p rs s rule: approximating_bigstep_fun_induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p r rs X. \<lbrakk>\<forall>r\<in>set (r # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (r # rs)) (Decision X) = approximating_bigstep_fun \<gamma> p (r # rs) (Decision X)
 3. \<And>\<gamma> p m a rs. \<lbrakk>\<not> matches \<gamma> m a p; \<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 4. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
case Decision
[PROOF STATE]
proof (state)
this:
\<forall>r\<in>set (r_ # rs_). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma>_ ?m' ?a p_ = matches \<gamma>_ ?m ?a p_
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma>_ ?m ?a p_

goal (4 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p r rs X. \<lbrakk>\<forall>r\<in>set (r # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (r # rs)) (Decision X) = approximating_bigstep_fun \<gamma> p (r # rs) (Decision X)
 3. \<And>\<gamma> p m a rs. \<lbrakk>\<not> matches \<gamma> m a p; \<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 4. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set (r_ # rs_). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma>_ ?m' ?a p_ = matches \<gamma>_ ?m ?a p_
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma>_ ?m ?a p_

goal (1 subgoal):
 1. approximating_bigstep_fun \<gamma>_ p_ (optimize_matches_option f (r_ # rs_)) (Decision X_) = approximating_bigstep_fun \<gamma>_ p_ (r_ # rs_) (Decision X_)
[PROOF STEP]
by (simp add: Decision_approximating_bigstep_fun)
[PROOF STATE]
proof (state)
this:
approximating_bigstep_fun \<gamma>_ p_ (optimize_matches_option f (r_ # rs_)) (Decision X_) = approximating_bigstep_fun \<gamma>_ p_ (r_ # rs_) (Decision X_)

goal (3 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>\<not> matches \<gamma> m a p; \<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 3. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>\<not> matches \<gamma> m a p; \<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 3. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
case (Nomatch \<gamma> p m a rs)
[PROOF STATE]
proof (state)
this:
\<not> matches \<gamma> m a p
\<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (3 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>\<not> matches \<gamma> m a p; \<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 3. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<not> matches \<gamma> m a p
\<lbrakk>\<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (1 subgoal):
 1. approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (case f m of None \<Rightarrow> optimize_matches_option f rs | Some m \<Rightarrow> Rule m a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
[PROOF STEP]
apply(cases "f m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = None\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (case f m of None \<Rightarrow> optimize_matches_option f rs | Some m \<Rightarrow> Rule m a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
 2. \<And>aa. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (case f m of None \<Rightarrow> optimize_matches_option f rs | Some m \<Rightarrow> Rule m a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (case f m of None \<Rightarrow> optimize_matches_option f rs | Some m \<Rightarrow> Rule m a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
[PROOF STEP]
apply(simp del: approximating_bigstep_fun.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule aa a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
[PROOF STEP]
apply(rename_tac m')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m'. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule m' a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
[PROOF STEP]
apply(subgoal_tac "\<not> matches \<gamma> m' a p")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m'. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'; \<not> matches \<gamma> m' a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule m' a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
 2. \<And>m'. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m' a p
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m'. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m' a p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set rs. P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (1 subgoal):
 1. \<And>m'. \<lbrakk>\<not> matches \<gamma> m a p; approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m' a p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided

goal (2 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
case (Match \<gamma> p m a rs)
[PROOF STATE]
proof (state)
this:
matches \<gamma> m a p
\<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (2 subgoals):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
 2. \<And>\<gamma> p m a rs. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
matches \<gamma> m a p
\<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided
\<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (1 subgoal):
 1. approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(cases "f m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = None\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 2. \<And>aa. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>matches \<gamma> m a p; \<lbrakk>a = Log; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<lbrakk>a = Empty; \<forall>r\<in>set rs. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; \<forall>r\<in>set (Rule m a # rs). P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(simp del: approximating_bigstep_fun.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some aa\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule aa a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(rename_tac m')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m'. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule m' a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
[PROOF STEP]
apply(subgoal_tac "matches \<gamma> m' a p")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m'. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'; matches \<gamma> m' a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (Rule m' a # optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided
 2. \<And>m'. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p
[PROOF STEP]
apply(simp split: action.split; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m'. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set rs. P (get_match r) (get_action r)
\<lbrakk>P ?m ?a; f ?m = Some ?m'\<rbrakk> \<Longrightarrow> matches \<gamma> ?m' ?a p = matches \<gamma> ?m ?a p
\<lbrakk>P ?m ?a; f ?m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> ?m ?a p

goal (1 subgoal):
 1. \<And>m'. \<lbrakk>matches \<gamma> m a p; a = Log \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; a = Empty \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f rs) Undecided = approximating_bigstep_fun \<gamma> p rs Undecided; P m a \<and> (\<forall>r\<in>set rs. P (get_match r) (get_action r)); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
approximating_bigstep_fun \<gamma> p (optimize_matches_option f (Rule m a # rs)) Undecided = approximating_bigstep_fun \<gamma> p (Rule m a # rs) Undecided

goal (1 subgoal):
 1. \<And>\<gamma> p s. \<lbrakk>\<forall>r\<in>set []. P (get_match r) (get_action r); \<And>m a m'. \<lbrakk>P m a; f m = Some m'\<rbrakk> \<Longrightarrow> matches \<gamma> m' a p = matches \<gamma> m a p; \<And>m a. \<lbrakk>P m a; f m = None\<rbrakk> \<Longrightarrow> \<not> matches \<gamma> m a p\<rbrakk> \<Longrightarrow> approximating_bigstep_fun \<gamma> p (optimize_matches_option f []) s = approximating_bigstep_fun \<gamma> p [] s
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma type_wf_drop: "type_wf h \<Longrightarrow> type_wf (Heap (fmdrop ptr (the_heap h)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ShadowRootClass.type_wf h \<Longrightarrow> ShadowRootClass.type_wf (Heap (fmdrop ptr (the_heap h)))
[PROOF STEP]
apply(auto simp add: type_wf_defs)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>DocumentClass.type_wf h; \<forall>shadow_root_ptr\<in>fset (shadow_root_ptr_kinds h). \<exists>y. get shadow_root_ptr h = Some y\<rbrakk> \<Longrightarrow> DocumentClass.type_wf (Heap (fmdrop ptr (the_heap h)))
 2. \<And>shadow_root_ptr. \<lbrakk>DocumentClass.type_wf h; \<forall>shadow_root_ptr\<in>fset (shadow_root_ptr_kinds h). \<exists>y. get shadow_root_ptr h = Some y; shadow_root_ptr |\<in>| shadow_root_ptr_kinds (Heap (fmdrop ptr (the_heap h)))\<rbrakk> \<Longrightarrow> \<exists>y. get shadow_root_ptr (Heap (fmdrop ptr (the_heap h))) = Some y
[PROOF STEP]
using type_wf_drop
[PROOF STATE]
proof (prove)
using this:
DocumentClass.type_wf ?h \<Longrightarrow> DocumentClass.type_wf (Heap (fmdrop ?ptr (the_heap ?h)))

goal (2 subgoals):
 1. \<lbrakk>DocumentClass.type_wf h; \<forall>shadow_root_ptr\<in>fset (shadow_root_ptr_kinds h). \<exists>y. get shadow_root_ptr h = Some y\<rbrakk> \<Longrightarrow> DocumentClass.type_wf (Heap (fmdrop ptr (the_heap h)))
 2. \<And>shadow_root_ptr. \<lbrakk>DocumentClass.type_wf h; \<forall>shadow_root_ptr\<in>fset (shadow_root_ptr_kinds h). \<exists>y. get shadow_root_ptr h = Some y; shadow_root_ptr |\<in>| shadow_root_ptr_kinds (Heap (fmdrop ptr (the_heap h)))\<rbrakk> \<Longrightarrow> \<exists>y. get shadow_root_ptr (Heap (fmdrop ptr (the_heap h))) = Some y
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>shadow_root_ptr. \<lbrakk>DocumentClass.type_wf h; \<forall>shadow_root_ptr\<in>fset (shadow_root_ptr_kinds h). \<exists>y. get shadow_root_ptr h = Some y; shadow_root_ptr |\<in>| shadow_root_ptr_kinds (Heap (fmdrop ptr (the_heap h)))\<rbrakk> \<Longrightarrow> \<exists>y. get shadow_root_ptr (Heap (fmdrop ptr (the_heap h))) = Some y
[PROOF STEP]
by (metis (no_types, lifting) DocumentClass.type_wf\<^sub>E\<^sub>l\<^sub>e\<^sub>m\<^sub>e\<^sub>n\<^sub>t ElementClass.get\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t_type_wf
      ElementMonad.type_wf_drop fmember.rep_eq fmlookup_drop get\<^sub>O\<^sub>b\<^sub>j\<^sub>e\<^sub>c\<^sub>t_def get\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t_def
      object_ptr_kinds_code5 shadow_root_ptr_kinds_commutes)


[STATEMENT]
lemma substT_substT:
  "i \<le> j \<Longrightarrow>
     T[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = T[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>"
  "i \<le> j \<Longrightarrow>
     rT[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = rT[i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>"
  "i \<le> j \<Longrightarrow>
     fT[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>f\<^sub>\<tau> = fT[i \<mapsto>\<^sub>\<tau> U]\<^sub>f\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<le> j \<Longrightarrow> T[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = T[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>) &&& (i \<le> j \<Longrightarrow> rT[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = rT[i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>) &&& (i \<le> j \<Longrightarrow> fT[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>f\<^sub>\<tau> = fT[i \<mapsto>\<^sub>\<tau> U]\<^sub>f\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>)
[PROOF STEP]
apply (induct T and rT and fT arbitrary: i j U V and i j U V and i j U V
    rule: liftT.induct liftrT.induct liftfT.induct)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>x i j U V. i \<le> j \<Longrightarrow> TVar x[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = TVar x[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
 2. \<And>i j U V. i \<le> j \<Longrightarrow> Top[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = Top[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
 3. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x1[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x1[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; \<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> (x1 \<rightarrow> x2)[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = (x1 \<rightarrow> x2)[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
 4. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x1[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x1[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; \<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> (\<forall><:x1. x2)[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = (\<forall><:x1. x2)[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
 5. \<And>x i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = x[i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> RcdT x[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = RcdT x[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
 6. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> (x1, x2)[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>f\<^sub>\<tau> = (x1, x2)[i \<mapsto>\<^sub>\<tau> U]\<^sub>f\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>
 7. \<And>i j U V. i \<le> j \<Longrightarrow> [][Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = [][i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>
 8. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x1[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>f\<^sub>\<tau> = x1[i \<mapsto>\<^sub>\<tau> U]\<^sub>f\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>f\<^sub>\<tau>; \<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> (x1 \<Colon> x2)[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>r\<^sub>\<tau> = (x1 \<Colon> x2)[i \<mapsto>\<^sub>\<tau> U]\<^sub>r\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>r\<^sub>\<tau>
[PROOF STEP]
apply (simp_all add: diff_Suc split: nat.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x1[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x1[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; \<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> x2[Suc (Suc j) \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
[PROOF STEP]
apply (thin_tac "\<And>x. PROP P x" for P :: "_ \<Rightarrow> prop")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 i j U V. \<lbrakk>\<And>i j U V. i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>; i \<le> j\<rbrakk> \<Longrightarrow> x2[Suc (Suc j) \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
[PROOF STEP]
apply (drule_tac x="Suc i" in meta_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 i j U V. \<lbrakk>i \<le> j; \<And>j U V. Suc i \<le> j \<Longrightarrow> x2[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[j - Suc i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>\<rbrakk> \<Longrightarrow> x2[Suc (Suc j) \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
[PROOF STEP]
apply (drule_tac x="Suc j" in meta_spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 i j U V. \<lbrakk>i \<le> j; \<And>U V. Suc i \<le> Suc j \<Longrightarrow> x2[Suc (Suc j) \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[Suc j - Suc i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>\<rbrakk> \<Longrightarrow> x2[Suc (Suc j) \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>[Suc i \<mapsto>\<^sub>\<tau> U[j - i \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>]\<^sub>\<tau> = x2[Suc i \<mapsto>\<^sub>\<tau> U]\<^sub>\<tau>[Suc j \<mapsto>\<^sub>\<tau> V]\<^sub>\<tau>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done