[STATEMENT]
lemma test_suite_from_io_tree_refined[code] :
  fixes M :: "('a,'b :: ccompare, 'c :: ccompare) fsm"
    and m :: "(('b\<times>'c), ('b\<times>'c) prefix_tree) mapping_rbt"
  shows "test_suite_from_io_tree M q (MPT (RBT_Mapping m))
          = (case ID CCOMPARE(('b \<times> 'c)) of
              None \<Rightarrow> Code.abort (STR ''test_suite_from_io_tree RBT_set: ccompare = None'') (\<lambda>_ . test_suite_from_io_tree M q (MPT (RBT_Mapping m))) |
              Some _ \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda> ((x,y),b) . case h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x,y) of Some t' \<Rightarrow> t'))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
proof (cases "ID CCOMPARE(('b \<times> 'c))")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ID ccompare = None \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
 2. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
ID ccompare = None

goal (2 subgoals):
 1. ID ccompare = None \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
 2. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ID ccompare = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ID ccompare = None

goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
case (Some a)
[PROOF STATE]
proof (state)
this:
ID ccompare = Some a

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ID ccompare = Some a
[PROOF STEP]
have "ID CCOMPARE(('b \<times> 'c)) \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
ID ccompare = Some a

goal (1 subgoal):
 1. ID ccompare \<noteq> None
[PROOF STEP]
using Some
[PROOF STATE]
proof (prove)
using this:
ID ccompare = Some a
ID ccompare = Some a

goal (1 subgoal):
 1. ID ccompare \<noteq> None
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ID ccompare \<noteq> None

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
have "distinct (map fst (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (RBT_Mapping2.entries m))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. ord.is_rbt cless m \<or> ID ccompare = None \<Longrightarrow> distinct (map fst (RBT_Impl.entries m))
[PROOF STEP]
using linorder.distinct_entries[OF ID_ccompare[OF Some]]
          ord.is_rbt_rbt_sorted
          Some
[PROOF STATE]
proof (prove)
using this:
ord.rbt_sorted (lt_of_comp a) ?t \<Longrightarrow> distinct (map fst (RBT_Impl.entries ?t))
ord.is_rbt ?less ?t \<Longrightarrow> ord.rbt_sorted ?less ?t
ID ccompare = Some a

goal (1 subgoal):
 1. \<And>m. ord.is_rbt cless m \<or> ID ccompare = None \<Longrightarrow> distinct (map fst (RBT_Impl.entries m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (map fst (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
have "\<And> a b . (RBT_Mapping2.lookup m a = Some b) = ((a,b) \<in> List.set (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (RBT_Mapping2.lookup m a = Some b) = ((a, b) \<in> list.set (RBT_Mapping2.entries m))
[PROOF STEP]
using map_of_entries[OF \<open>ID CCOMPARE(('b \<times> 'c)) \<noteq> None\<close>, of m]
[PROOF STATE]
proof (prove)
using this:
map_of (RBT_Mapping2.entries m) = RBT_Mapping2.lookup m

goal (1 subgoal):
 1. \<And>a b. (RBT_Mapping2.lookup m a = Some b) = ((a, b) \<in> list.set (RBT_Mapping2.entries m))
[PROOF STEP]
using map_of_eq_Some_iff[OF \<open>distinct (map fst (RBT_Mapping2.entries m))\<close>]
[PROOF STATE]
proof (prove)
using this:
map_of (RBT_Mapping2.entries m) = RBT_Mapping2.lookup m
(map_of (RBT_Mapping2.entries m) ?x = Some ?y) = ((?x, ?y) \<in> list.set (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. \<And>a b. (RBT_Mapping2.lookup m a = Some b) = ((a, b) \<in> list.set (RBT_Mapping2.entries m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(RBT_Mapping2.lookup m ?a = Some ?b) = ((?a, ?b) \<in> list.set (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
let ?f2 = "Mapping.tabulate (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda> ((x,y),b) . case h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x,y) of Some t' \<Rightarrow> t'))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
let ?f1 = "\<lambda> xs . \<lambda> ((x,y),b) . case map_of xs (x,y) of
    None \<Rightarrow> None |
    Some t \<Rightarrow> (case h_obs M q x y of
      None \<Rightarrow> (if b then None else Some empty) |
      Some q' \<Rightarrow> (if b then Some (test_suite_from_io_tree M q' t) else None))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
have "Mapping.lookup ?f2 = ?f1 (RBT_Mapping2.entries m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) x = (case x of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) x = (case x of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
show "Mapping.lookup ?f2 k = ?f1 (RBT_Mapping2.entries m) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
obtain x y b where "k = ((x,y),b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y b. k = ((x, y), b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis prod.exhaust_sel)
[PROOF STATE]
proof (state)
this:
k = ((x, y), b)

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
proof (cases "RBT_Mapping2.lookup m (x,y)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
RBT_Mapping2.lookup m (x, y) = None

goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
RBT_Mapping2.lookup m (x, y) = None
[PROOF STEP]
have "((x,y),b) \<notin> List.set (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = None

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
using \<open>\<And> a b . (RBT_Mapping2.lookup m a = Some b) = ((a,b) \<in> List.set (RBT_Mapping2.entries m))\<close>[of "(x,y)"]
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = None
(RBT_Mapping2.lookup m (x, y) = Some ?b) = (((x, y), ?b) \<in> list.set (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
have "Mapping.lookup ?f2 ((x,y),b) = None"
[PROOF STATE]
proof (prove)
using this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
[PROOF STEP]
by (metis (mono_tags, lifting) Mapping.lookup.rep_eq map_of_map_Pair_key tabulate.rep_eq)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
have "?f1 (RBT_Mapping2.entries m) ((x,y),b) = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
using \<open>\<And> a b . (RBT_Mapping2.lookup m a = Some b) = ((a,b) \<in> List.set (RBT_Mapping2.entries m))\<close>[of "(x,y)"]
                None
[PROOF STATE]
proof (prove)
using this:
(RBT_Mapping2.lookup m (x, y) = Some ?b) = (((x, y), ?b) \<in> list.set (RBT_Mapping2.entries m))
RBT_Mapping2.lookup m (x, y) = None

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
by (metis (no_types, lifting) map_of_SomeD not_None_eq old.prod.case option.simps(4))
[PROOF STATE]
proof (state)
this:
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (2 subgoals):
 1. RBT_Mapping2.lookup m (x, y) = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
unfolding \<open>k = ((x,y),b)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal (1 subgoal):
 1. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case (Some t')
[PROOF STATE]
proof (state)
this:
RBT_Mapping2.lookup m (x, y) = Some t'

goal (1 subgoal):
 1. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
RBT_Mapping2.lookup m (x, y) = Some t'
[PROOF STEP]
have "((x,y),t') \<in> List.set (RBT_Mapping2.entries m)"
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'

goal (1 subgoal):
 1. ((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
[PROOF STEP]
using \<open>\<And> a b . (RBT_Mapping2.lookup m a = Some b) = ((a,b) \<in> List.set (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
(RBT_Mapping2.lookup m ?a = Some ?b) = ((?a, ?b) \<in> list.set (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. ((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)

goal (1 subgoal):
 1. \<And>a. RBT_Mapping2.lookup m (x, y) = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
proof (cases "h_obs M q x y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. FSM.h_obs M q x y = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. FSM.h_obs M q x y = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q x y = None

goal (2 subgoals):
 1. FSM.h_obs M q x y = None \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<And>a. FSM.h_obs M q x y = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
proof (cases b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b
[PROOF STEP]
have "((x,y),b) \<notin> List.set (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
using this:
b

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
using None
[PROOF STATE]
proof (prove)
using this:
b
FSM.h_obs M q x y = None

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
have "Mapping.lookup ?f2 ((x,y),b) = None"
[PROOF STATE]
proof (prove)
using this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
[PROOF STEP]
by (metis (mono_tags, lifting) Mapping.lookup.rep_eq map_of_map_Pair_key tabulate.rep_eq)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
have "?f1 (RBT_Mapping2.entries m) ((x,y),b) = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
using Some None True
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
FSM.h_obs M q x y = None
b

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
using \<open>((x, y), t') \<in> list.set (RBT_Mapping2.entries m)\<close> \<open>distinct (map fst (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
FSM.h_obs M q x y = None
b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
distinct (map fst (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
unfolding \<open>k = ((x,y),b)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> b
[PROOF STEP]
have "((x,y),b) \<in> List.set (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
using this:
\<not> b

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
using None \<open>((x,y),t') \<in> List.set (RBT_Mapping2.entries m)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> b
FSM.h_obs M q x y = None
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
have "Mapping.lookup ?f2 ((x,y),b) = Some empty"
[PROOF STATE]
proof (prove)
using this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
[PROOF STEP]
have "\<And>p ps f. (p::('b \<times> 'c) \<times> bool) \<notin> list.set ps \<or> Mapping.lookup (Mapping.tabulate ps f) p = Some (f p::(('b \<times> 'c) \<times> bool) prefix_tree)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p ps f. p \<notin> list.set ps \<or> Mapping.lookup (Mapping.tabulate ps f) p = Some (f p)
[PROOF STEP]
by (simp add: Mapping.lookup.rep_eq map_of_map_Pair_key tabulate.rep_eq)
[PROOF STATE]
proof (state)
this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
[PROOF STEP]
using None \<open>((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)
FSM.h_obs M q x y = None
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
have "?f1 (RBT_Mapping2.entries m) ((x,y),b) = Some empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty
[PROOF STEP]
using Some None False
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
FSM.h_obs M q x y = None
\<not> b

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty
[PROOF STEP]
using \<open>((x, y), t') \<in> list.set (RBT_Mapping2.entries m)\<close>
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
FSM.h_obs M q x y = None
\<not> b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty
[PROOF STEP]
using \<open>distinct (map fst (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
RBT_Mapping2.lookup m (x, y) = Some t'
FSM.h_obs M q x y = None
\<not> b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
distinct (map fst (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
unfolding \<open>k = ((x,y),b)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some Prefix_Tree.empty
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some Prefix_Tree.empty

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal (1 subgoal):
 1. \<And>a. FSM.h_obs M q x y = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. FSM.h_obs M q x y = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case (Some q')
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q x y = Some q'

goal (1 subgoal):
 1. \<And>a. FSM.h_obs M q x y = Some a \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
proof (cases b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b
[PROOF STEP]
have "((x,y),b) \<in> List.set (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
using this:
b

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
using Some \<open>((x,y),t') \<in> List.set (RBT_Mapping2.entries m)\<close>
[PROOF STATE]
proof (prove)
using this:
b
FSM.h_obs M q x y = Some q'
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
have "Mapping.lookup ?f2 ((x,y),b) = Some (test_suite_from_io_tree M q' t')"
[PROOF STATE]
proof (prove)
using this:
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
have "\<And>p ps f. (p::('b \<times> 'c) \<times> bool) \<notin> list.set ps \<or> Mapping.lookup (Mapping.tabulate ps f) p = Some (f p::(('b \<times> 'c) \<times> bool) prefix_tree)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p ps f. p \<notin> list.set ps \<or> Mapping.lookup (Mapping.tabulate ps f) p = Some (f p)
[PROOF STEP]
by (simp add: Mapping.lookup.rep_eq map_of_map_Pair_key tabulate.rep_eq)
[PROOF STATE]
proof (state)
this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)

goal (1 subgoal):
 1. ((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
using Some \<open>RBT_Mapping2.lookup m (x, y) = Some t'\<close> \<open>((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
?p \<notin> list.set ?ps \<or> Mapping.lookup (Mapping.tabulate ?ps ?f) ?p = Some (?f ?p)
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
((x, y), b) \<in> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
have "?f1 (RBT_Mapping2.entries m) ((x,y),b) = Some (test_suite_from_io_tree M q' t')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
using Some \<open>RBT_Mapping2.lookup m (x, y) = Some t'\<close> True
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
b

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
using \<open>((x, y), t') \<in> list.set (RBT_Mapping2.entries m)\<close>
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
using \<open>distinct (map fst (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
distinct (map fst (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')

goal (2 subgoals):
 1. b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
 2. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
unfolding \<open>k = ((x,y),b)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = Some (test_suite_from_io_tree M q' t')
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = Some (test_suite_from_io_tree M q' t')

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> b
[PROOF STEP]
have "((x,y),b) \<notin> List.set (map (\<lambda>((x,y),t) . ((x,y),h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))"
[PROOF STATE]
proof (prove)
using this:
\<not> b

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
using Some
[PROOF STATE]
proof (prove)
using this:
\<not> b
FSM.h_obs M q x y = Some q'

goal (1 subgoal):
 1. ((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))
[PROOF STEP]
have "Mapping.lookup ?f2 ((x,y),b) = None"
[PROOF STATE]
proof (prove)
using this:
((x, y), b) \<notin> list.set (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
[PROOF STEP]
by (metis (mono_tags, lifting) Mapping.lookup.rep_eq map_of_map_Pair_key tabulate.rep_eq)
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
have "?f1 (RBT_Mapping2.entries m) ((x,y),b) = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
using Some \<open>RBT_Mapping2.lookup m (x, y) = Some t'\<close> False
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
\<not> b

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
using \<open>((x, y), t') \<in> list.set (RBT_Mapping2.entries m)\<close> \<open>distinct (map fst (RBT_Mapping2.entries m))\<close>
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q x y = Some q'
RBT_Mapping2.lookup m (x, y) = Some t'
\<not> b
((x, y), t') \<in> list.set (RBT_Mapping2.entries m)
distinct (map fst (RBT_Mapping2.entries m))

goal (1 subgoal):
 1. (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. \<not> b \<Longrightarrow> Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
unfolding \<open>k = ((x,y),b)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = None
(case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa) = None

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) ((x, y), b) = (case ((x, y), b) of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) k = (case k of (x, xa) \<Rightarrow> (case x of (x, y) \<Rightarrow> \<lambda>b. case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None) xa)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
obtain m' where "test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m'. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: test_suite_from_io_tree_MPT)
[PROOF STATE]
proof (state)
this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'
[PROOF STEP]
have "test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = PT (Mapping.lookup m')"
[PROOF STATE]
proof (prove)
using this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'

goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = PT (Mapping.lookup m')
[PROOF STEP]
using MPT_def
[PROOF STATE]
proof (prove)
using this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'
MPT ?m = PT (Mapping.lookup ?m)

goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = PT (Mapping.lookup m')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = PT (Mapping.lookup m')

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
have "Mapping.lookup m' = (\<lambda> ((x,y),b) . case RBT_Mapping2.lookup m (x,y) of
    None \<Rightarrow> None |
    Some t \<Rightarrow> (case h_obs M q x y of
      None \<Rightarrow> (if b then None else Some empty) |
      Some q' \<Rightarrow> (if b then Some (test_suite_from_io_tree M q' t) else None)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
have "test_suite_from_io_tree M q (PT (Mapping.lookup (RBT_Mapping m))) = PT (Mapping.lookup m')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. test_suite_from_io_tree M q (PT (Mapping.lookup (RBT_Mapping m))) = PT (Mapping.lookup m')
[PROOF STEP]
by (metis MPT_def \<open>test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = PT (Mapping.lookup m')\<close>)
[PROOF STATE]
proof (state)
this:
test_suite_from_io_tree M q (PT (Mapping.lookup (RBT_Mapping m))) = PT (Mapping.lookup m')

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
test_suite_from_io_tree M q (PT (Mapping.lookup (RBT_Mapping m))) = PT (Mapping.lookup m')
[PROOF STEP]
have "Mapping.lookup m' = (\<lambda>((b, c), ba). case Mapping.lookup (RBT_Mapping m) (b, c) of None \<Rightarrow> None | Some p \<Rightarrow> (case h_obs M q b c of None \<Rightarrow> if ba then None else Some Prefix_Tree.empty | Some a \<Rightarrow> if ba then Some (test_suite_from_io_tree M a p) else None))"
[PROOF STATE]
proof (prove)
using this:
test_suite_from_io_tree M q (PT (Mapping.lookup (RBT_Mapping m))) = PT (Mapping.lookup m')

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((b, c), ba). case Mapping.lookup (RBT_Mapping m) (b, c) of None \<Rightarrow> None | Some p \<Rightarrow> case FSM.h_obs M q b c of None \<Rightarrow> if ba then None else Some Prefix_Tree.empty | Some a \<Rightarrow> if ba then Some (test_suite_from_io_tree M a p) else None)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Mapping.lookup m' = (\<lambda>((b, c), ba). case Mapping.lookup (RBT_Mapping m) (b, c) of None \<Rightarrow> None | Some p \<Rightarrow> case FSM.h_obs M q b c of None \<Rightarrow> if ba then None else Some Prefix_Tree.empty | Some a \<Rightarrow> if ba then Some (test_suite_from_io_tree M a p) else None)

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup m' = (\<lambda>((b, c), ba). case Mapping.lookup (RBT_Mapping m) (b, c) of None \<Rightarrow> None | Some p \<Rightarrow> case FSM.h_obs M q b c of None \<Rightarrow> if ba then None else Some Prefix_Tree.empty | Some a \<Rightarrow> if ba then Some (test_suite_from_io_tree M a p) else None)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m' = (\<lambda>((b, c), ba). case Mapping.lookup (RBT_Mapping m) (b, c) of None \<Rightarrow> None | Some p \<Rightarrow> case FSM.h_obs M q b c of None \<Rightarrow> if ba then None else Some Prefix_Tree.empty | Some a \<Rightarrow> if ba then Some (test_suite_from_io_tree M a p) else None)

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
by (metis (no_types) lookup_Mapping_code(2))
[PROOF STATE]
proof (state)
this:
Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
have "Mapping.lookup m' = ?f1 (RBT_Mapping2.entries m)"
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
unfolding map_of_entries[OF \<open>ID CCOMPARE(('b \<times> 'c)) \<noteq> None\<close>, of m]
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. Mapping.lookup m' = (\<lambda>((x, y), b). case RBT_Mapping2.lookup m (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup m' = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup m' = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
[PROOF STEP]
have "Mapping.lookup ?f2 = Mapping.lookup m'"
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m' = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'
[PROOF STEP]
using \<open>Mapping.lookup ?f2 = ?f1 (RBT_Mapping2.entries m)\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m' = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = (\<lambda>((x, y), b). case map_of (RBT_Mapping2.entries m) (x, y) of None \<Rightarrow> None | Some t \<Rightarrow> case FSM.h_obs M q x y of None \<Rightarrow> if b then None else Some Prefix_Tree.empty | Some q' \<Rightarrow> if b then Some (test_suite_from_io_tree M q' t) else None)

goal (1 subgoal):
 1. Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'

goal (1 subgoal):
 1. \<And>a. ID ccompare = Some a \<Longrightarrow> test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'

goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
using Some
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'
ID ccompare = Some a

goal (1 subgoal):
 1. test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
unfolding \<open>test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = MPT m'\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))) = Mapping.lookup m'
ID ccompare = Some a

goal (1 subgoal):
 1. MPT m' = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. MPT m') | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))
[PROOF STEP]
by (simp add: MPT_def)
[PROOF STATE]
proof (state)
this:
test_suite_from_io_tree M q (MPT (RBT_Mapping m)) = (case ID ccompare of None \<Rightarrow> Code.abort STR ''test_suite_from_io_tree RBT_set: ccompare = None'' (\<lambda>_. test_suite_from_io_tree M q (MPT (RBT_Mapping m))) | Some x \<Rightarrow> MPT (Mapping.tabulate (map (\<lambda>((x, y), t). ((x, y), FSM.h_obs M q x y \<noteq> None)) (RBT_Mapping2.entries m)) (\<lambda>((x, y), b). case FSM.h_obs M q x y of None \<Rightarrow> Prefix_Tree.empty | Some q' \<Rightarrow> test_suite_from_io_tree M q' (case RBT_Mapping2.lookup m (x, y) of Some t' \<Rightarrow> t'))))

goal:
No subgoals!
[PROOF STEP]
qed