[STATEMENT]
lemma assemble_distinguishing_sequence_from_ofsm_table_distinguishes :
  assumes "observable M"
  and     "q1 \<in> states M"
  and     "q2 \<in> states M"
  and     "ofsm_table M (\<lambda>q . states M) k q1 \<noteq> ofsm_table M (\<lambda>q . states M) k q2"
shows "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2"
and   "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2"
and   "butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 &&& assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 &&& butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2
 2. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2
 3. butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2
        \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2
        \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
using assms(2,3,4)
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M
ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
proof (induction k arbitrary: q1 q2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) 0 q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0) \<in> LS M q1 \<inter> LS M q2
 2. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M
ofsm_table M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) 0 q2

goal (2 subgoals):
 1. \<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) 0 q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0) \<in> LS M q1 \<inter> LS M q2
 2. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M
ofsm_table M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) 0 q2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M
ofsm_table M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) 0 q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0 \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 0) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?q1.0 \<in> FSM.states M; ?q2.0 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k ?q1.0 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k ?q2.0\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M ?q1.0 ?q2.0 k \<in> LS M ?q1.0 \<union> LS M ?q2.0 \<and> assemble_distinguishing_sequence_from_ofsm_table M ?q1.0 ?q2.0 k \<notin> LS M ?q1.0 \<inter> LS M ?q2.0 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M ?q1.0 ?q2.0 k) \<in> LS M ?q1.0 \<inter> LS M ?q2.0
q1 \<in> FSM.states M
q2 \<in> FSM.states M
ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2

goal (1 subgoal):
 1. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
obtain x y where s1: "select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x,y),(h_obs M q1 x y, h_obs M q2 x y))"
                 and s2: "\<And> q1' q2' . h_obs M q1 x y = Some q1' \<Longrightarrow> h_obs M q2 x y = Some q2' \<Longrightarrow> ofsm_table M (\<lambda>q . states M) k q1' \<noteq> ofsm_table M (\<lambda>q . states M) k q2'"
                 and s3: "h_obs M q1 x y \<noteq> None \<or> h_obs M q2 x y \<noteq> None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y); \<And>q1' q2'. \<lbrakk>FSM.h_obs M q1 x y = Some q1'; FSM.h_obs M q2 x y = Some q2'\<rbrakk> \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) k q1' \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2'; FSM.h_obs M q1 x y \<noteq> None \<or> FSM.h_obs M q2 x y \<noteq> None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using select_diverging_ofsm_table_io_Some[OF assms(1) Suc.prems]
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. \<lbrakk>select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y); \<And>q1' q2'. \<lbrakk>FSM.h_obs M q1 x y = Some q1'; FSM.h_obs M q2 x y = Some q2'\<rbrakk> \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) k q1' \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2'; FSM.h_obs M q1 x y \<noteq> None \<or> FSM.h_obs M q2 x y \<noteq> None\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y); \<And>q1' q2'. \<lbrakk>FSM.h_obs M q1 x y = Some q1'; FSM.h_obs M q2 x y = Some q2'\<rbrakk> \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) k q1' \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2'; FSM.h_obs M q1 x y \<noteq> None \<or> FSM.h_obs M q2 x y \<noteq> None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y)
\<lbrakk>FSM.h_obs M q1 x y = Some ?q1'; FSM.h_obs M q2 x y = Some ?q2'\<rbrakk> \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) k ?q1' \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k ?q2'
FSM.h_obs M q1 x y \<noteq> None \<or> FSM.h_obs M q2 x y \<noteq> None

goal (1 subgoal):
 1. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
consider (a) "h_obs M q1 x y = None \<and> h_obs M q2 x y \<noteq> None" |
             (b) "h_obs M q1 x y \<noteq> None \<and> h_obs M q2 x y = None" |
             (c) "h_obs M q1 x y \<noteq> None \<and> h_obs M q2 x y \<noteq> None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using s3
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y \<noteq> None \<or> FSM.h_obs M q2 x y \<noteq> None

goal (1 subgoal):
 1. \<lbrakk>FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>k q1 q2. \<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) k q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) k q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2; q1 \<in> FSM.states M; q2 \<in> FSM.states M; ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (Suc k) q2\<rbrakk> \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> ?thesis; FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
case a
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None
[PROOF STEP]
obtain q2' where "h_obs M q1 x y = None" and "h_obs M q2 x y = Some q2'"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None

goal (1 subgoal):
 1. (\<And>q2'. \<lbrakk>FSM.h_obs M q1 x y = None; FSM.h_obs M q2 x y = Some q2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q1 x y = None
FSM.h_obs M q2 x y = Some q2'

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q1 x y = None
FSM.h_obs M q2 x y = Some q2'
[PROOF STEP]
have "select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x,y),(None, Some q2'))"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = None
FSM.h_obs M q2 x y = Some q2'

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), None, Some q2')
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = None
FSM.h_obs M q2 x y = Some q2'
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y)

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), None, Some q2')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), None, Some q2')

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), None, Some q2')
[PROOF STEP]
have *:"assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x,y)]"
[PROOF STATE]
proof (prove)
using this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), None, Some q2')

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x, y)]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x, y)]

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "[(x,y)] \<in> LS M q1 \<union> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
using \<open>h_obs M q2 x y = Some q2'\<close> LS_single_transition[of x y M]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q2 x y = Some q2'
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
by (metis UnI2 h_obs_None[OF \<open>observable M\<close>] a fst_conv snd_conv)
[PROOF STATE]
proof (state)
this:
[(x, y)] \<in> LS M q1 \<union> LS M q2

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[(x, y)] \<in> LS M q1 \<union> LS M q2

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "[(x,y)] \<notin> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
using \<open>h_obs M q1 x y = None\<close> LS_single_transition[of x y M]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = None
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding h_obs_None[OF \<open>observable M\<close>]
[PROOF STATE]
proof (prove)
using this:
\<nexists>q'. (q1, x, y, q') \<in> FSM.transitions M
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
[(x, y)] \<notin> LS M q1 \<inter> LS M q2

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[(x, y)] \<notin> LS M q1 \<inter> LS M q2

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "butlast [(x,y)] \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
using Suc.prems(1,2)
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M

goal (1 subgoal):
 1. butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (3 subgoals):
 1. FSM.h_obs M q1 x y = None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 3. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2 \<and> [(x, y)] \<notin> LS M q1 \<inter> LS M q2 \<and> butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
case b
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None
[PROOF STEP]
obtain q1' where "h_obs M q2 x y = None" and "h_obs M q1 x y = Some q1'"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None

goal (1 subgoal):
 1. (\<And>q1'. \<lbrakk>FSM.h_obs M q2 x y = None; FSM.h_obs M q1 x y = Some q1'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q2 x y = None
FSM.h_obs M q1 x y = Some q1'

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q2 x y = None
FSM.h_obs M q1 x y = Some q1'
[PROOF STEP]
have "select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x,y),(Some q1',None))"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q2 x y = None
FSM.h_obs M q1 x y = Some q1'

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', None)
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q2 x y = None
FSM.h_obs M q1 x y = Some q1'
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y)

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', None)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', None)

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', None)
[PROOF STEP]
have *:"assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x,y)]"
[PROOF STATE]
proof (prove)
using this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', None)

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x, y)]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = [(x, y)]

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "[(x,y)] \<in> LS M q1 \<union> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
using \<open>h_obs M q1 x y = Some q1'\<close> LS_single_transition[of x y M]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = Some q1'
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
by (metis UnI1 assms(1) b fst_conv h_obs_None snd_conv)
[PROOF STATE]
proof (state)
this:
[(x, y)] \<in> LS M q1 \<union> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[(x, y)] \<in> LS M q1 \<union> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "[(x,y)] \<notin> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
using \<open>h_obs M q2 x y = None\<close> LS_single_transition[of x y M]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q2 x y = None
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding h_obs_None[OF \<open>observable M\<close>]
[PROOF STATE]
proof (prove)
using this:
\<nexists>q'. (q2, x, y, q') \<in> FSM.transitions M
([(x, y)] \<in> LS M ?q) = (\<exists>t\<in>FSM.transitions M. t_source t = ?q \<and> t_input t = x \<and> t_output t = y)

goal (1 subgoal):
 1. [(x, y)] \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
[(x, y)] \<notin> LS M q1 \<inter> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[(x, y)] \<notin> LS M q1 \<inter> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "butlast [(x,y)] \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
using Suc.prems(1,2)
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M
q2 \<in> FSM.states M

goal (1 subgoal):
 1. butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (2 subgoals):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y = None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
 2. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
[(x, y)] \<in> LS M q1 \<union> LS M q2
[(x, y)] \<notin> LS M q1 \<inter> LS M q2
butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. [(x, y)] \<in> LS M q1 \<union> LS M q2 \<and> [(x, y)] \<notin> LS M q1 \<inter> LS M q2 \<and> butlast [(x, y)] \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
case c
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None
[PROOF STEP]
obtain q1' q2' where "h_obs M q1 x y = Some q1'" and "h_obs M q2 x y = Some q2'"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None

goal (1 subgoal):
 1. (\<And>q1' q2'. \<lbrakk>FSM.h_obs M q1 x y = Some q1'; FSM.h_obs M q2 x y = Some q2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
FSM.h_obs M q1 x y = Some q1'
FSM.h_obs M q2 x y = Some q2'

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.h_obs M q1 x y = Some q1'
FSM.h_obs M q2 x y = Some q2'
[PROOF STEP]
have "select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x,y),(Some q1', Some q2'))"
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = Some q1'
FSM.h_obs M q2 x y = Some q2'

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', Some q2')
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = Some q1'
FSM.h_obs M q2 x y = Some q2'
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), FSM.h_obs M q1 x y, FSM.h_obs M q2 x y)

goal (1 subgoal):
 1. select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', Some q2')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', Some q2')

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', Some q2')
[PROOF STEP]
have "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x,y) # (assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k)"
[PROOF STATE]
proof (prove)
using this:
select_diverging_ofsm_table_io M q1 q2 (Suc k) = ((x, y), Some q1', Some q2')

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
define subseq where subseq: "subseq = (assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k)"
[PROOF STATE]
proof (state)
this:
subseq = assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k
subseq = assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k
[PROOF STEP]
have *:"assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x,y) # subseq"
[PROOF STATE]
proof (prove)
using this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k
subseq = assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # subseq
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) = (x, y) # subseq

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "(q1,x,y,q1') \<in> transitions M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (q1, x, y, q1') \<in> FSM.transitions M
[PROOF STEP]
using \<open>h_obs M q1 x y = Some q1'\<close> h_obs_Some[OF \<open>observable M\<close>]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q1 x y = Some q1'
(FSM.h_obs M ?q ?x ?y = Some ?q') = ({q'. (?q, ?x, ?y, q') \<in> FSM.transitions M} = {?q'})

goal (1 subgoal):
 1. (q1, x, y, q1') \<in> FSM.transitions M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(q1, x, y, q1') \<in> FSM.transitions M

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(q1, x, y, q1') \<in> FSM.transitions M
[PROOF STEP]
have "q1' \<in> states M"
[PROOF STATE]
proof (prove)
using this:
(q1, x, y, q1') \<in> FSM.transitions M

goal (1 subgoal):
 1. q1' \<in> FSM.states M
[PROOF STEP]
using fsm_transition_target
[PROOF STATE]
proof (prove)
using this:
(q1, x, y, q1') \<in> FSM.transitions M
?t \<in> FSM.transitions ?M \<Longrightarrow> t_target ?t \<in> FSM.states ?M

goal (1 subgoal):
 1. q1' \<in> FSM.states M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q1' \<in> FSM.states M

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "(q2,x,y,q2') \<in> transitions M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (q2, x, y, q2') \<in> FSM.transitions M
[PROOF STEP]
using \<open>h_obs M q2 x y = Some q2'\<close> h_obs_Some[OF \<open>observable M\<close>]
[PROOF STATE]
proof (prove)
using this:
FSM.h_obs M q2 x y = Some q2'
(FSM.h_obs M ?q ?x ?y = Some ?q') = ({q'. (?q, ?x, ?y, q') \<in> FSM.transitions M} = {?q'})

goal (1 subgoal):
 1. (q2, x, y, q2') \<in> FSM.transitions M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(q2, x, y, q2') \<in> FSM.transitions M

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(q2, x, y, q2') \<in> FSM.transitions M
[PROOF STEP]
have "q2' \<in> states M"
[PROOF STATE]
proof (prove)
using this:
(q2, x, y, q2') \<in> FSM.transitions M

goal (1 subgoal):
 1. q2' \<in> FSM.states M
[PROOF STEP]
using fsm_transition_target
[PROOF STATE]
proof (prove)
using this:
(q2, x, y, q2') \<in> FSM.transitions M
?t \<in> FSM.transitions ?M \<Longrightarrow> t_target ?t \<in> FSM.states ?M

goal (1 subgoal):
 1. q2' \<in> FSM.states M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q2' \<in> FSM.states M

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have i1: "subseq \<in> LS M q1' \<union> LS M q2'"
      and  i2: "subseq \<notin> LS M q1' \<inter> LS M q2'"
      and  i3: "butlast subseq \<in> LS M q1' \<inter> LS M q2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseq \<in> LS M q1' \<union> LS M q2' &&& subseq \<notin> LS M q1' \<inter> LS M q2' &&& butlast subseq \<in> LS M q1' \<inter> LS M q2'
[PROOF STEP]
using Suc.IH[OF \<open>q1' \<in> states M\<close> \<open>q2' \<in> states M\<close> s2[OF \<open>h_obs M q1 x y = Some q1'\<close> \<open>h_obs M q2 x y = Some q2'\<close>]]
[PROOF STATE]
proof (prove)
using this:
assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<in> LS M q1' \<union> LS M q2' \<and> assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<notin> LS M q1' \<inter> LS M q2' \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k) \<in> LS M q1' \<inter> LS M q2'

goal (1 subgoal):
 1. subseq \<in> LS M q1' \<union> LS M q2' &&& subseq \<notin> LS M q1' \<inter> LS M q2' &&& butlast subseq \<in> LS M q1' \<inter> LS M q2'
[PROOF STEP]
unfolding subseq
[PROOF STATE]
proof (prove)
using this:
assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<in> LS M q1' \<union> LS M q2' \<and> assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<notin> LS M q1' \<inter> LS M q2' \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k) \<in> LS M q1' \<inter> LS M q2'

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<in> LS M q1' \<union> LS M q2' &&& assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k \<notin> LS M q1' \<inter> LS M q2' &&& butlast (assemble_distinguishing_sequence_from_ofsm_table M q1' q2' k) \<in> LS M q1' \<inter> LS M q2'
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
subseq \<in> LS M q1' \<union> LS M q2'
subseq \<notin> LS M q1' \<inter> LS M q2'
butlast subseq \<in> LS M q1' \<inter> LS M q2'

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "(x,y) # subseq \<in> LS M q1 \<union> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) # subseq \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
using i1 \<open>(q1,x,y,q1') \<in> transitions M\<close> \<open>(q2,x,y,q2') \<in> transitions M\<close>
[PROOF STATE]
proof (prove)
using this:
subseq \<in> LS M q1' \<union> LS M q2'
(q1, x, y, q1') \<in> FSM.transitions M
(q2, x, y, q2') \<in> FSM.transitions M

goal (1 subgoal):
 1. (x, y) # subseq \<in> LS M q1 \<union> LS M q2
[PROOF STEP]
by (metis LS_prepend_transition Un_iff fst_conv snd_conv)
[PROOF STATE]
proof (state)
this:
(x, y) # subseq \<in> LS M q1 \<union> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(x, y) # subseq \<in> LS M q1 \<union> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "(x,y) # subseq \<notin> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
using observable_language_transition_target[OF \<open>observable M\<close> \<open>(q1,x,y,q1') \<in> transitions M\<close>, of subseq]
              observable_language_transition_target[OF \<open>observable M\<close> \<open>(q2,x,y,q2') \<in> transitions M\<close>, of subseq]
              i2
[PROOF STATE]
proof (prove)
using this:
(t_input (q1, x, y, q1'), t_output (q1, x, y, q1')) # subseq \<in> LS M (t_source (q1, x, y, q1')) \<Longrightarrow> subseq \<in> LS M (t_target (q1, x, y, q1'))
(t_input (q2, x, y, q2'), t_output (q2, x, y, q2')) # subseq \<in> LS M (t_source (q2, x, y, q2')) \<Longrightarrow> subseq \<in> LS M (t_target (q2, x, y, q2'))
subseq \<notin> LS M q1' \<inter> LS M q2'

goal (1 subgoal):
 1. (x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
(x, y) # subseq \<in> LS M q1 \<Longrightarrow> subseq \<in> LS M q1'
(x, y) # subseq \<in> LS M q2 \<Longrightarrow> subseq \<in> LS M q2'
subseq \<notin> LS M q1' \<inter> LS M q2'

goal (1 subgoal):
 1. (x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, y) # subseq \<notin> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(x, y) # subseq \<notin> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
have "butlast ((x,y) # subseq) \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
using i3 \<open>(q1,x,y,q1') \<in> transitions M\<close> \<open>(q2,x,y,q2') \<in> transitions M\<close>
[PROOF STATE]
proof (prove)
using this:
butlast subseq \<in> LS M q1' \<inter> LS M q2'
(q1, x, y, q1') \<in> FSM.transitions M
(q2, x, y, q2') \<in> FSM.transitions M

goal (1 subgoal):
 1. butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by (metis Int_iff LS_prepend_transition LS_single_transition append_butlast_last_id butlast.simps(2) fst_conv language_prefix snd_conv)
[PROOF STATE]
proof (state)
this:
butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. FSM.h_obs M q1 x y \<noteq> None \<and> FSM.h_obs M q2 x y \<noteq> None \<Longrightarrow> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(x, y) # subseq \<in> LS M q1 \<union> LS M q2
(x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x, y) # subseq \<in> LS M q1 \<union> LS M q2
(x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
(x, y) # subseq \<in> LS M q1 \<union> LS M q2
(x, y) # subseq \<notin> LS M q1 \<inter> LS M q2
butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. (x, y) # subseq \<in> LS M q1 \<union> LS M q2 \<and> (x, y) # subseq \<notin> LS M q1 \<inter> LS M q2 \<and> butlast ((x, y) # subseq) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k) \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 (Suc k)) \<in> LS M q1 \<inter> LS M q2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2

goal (3 subgoals):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2
 2. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2
 3. butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
show "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2"
       and  "assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2"
       and  "butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2"
[PROOF STATE]
proof (prove)
using this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 \<and> assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 \<and> butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2 &&& assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2 &&& butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<in> LS M q1 \<union> LS M q2
assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k \<notin> LS M q1 \<inter> LS M q2
butlast (assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k) \<in> LS M q1 \<inter> LS M q2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_eq_dim: "B \<subseteq> V \<Longrightarrow> card B = dim V \<Longrightarrow> finite B \<Longrightarrow> independent B \<longleftrightarrow> V \<subseteq> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> V; card B = dim V; finite B\<rbrakk> \<Longrightarrow> independent B = (V \<subseteq> span B)
[PROOF STEP]
by (metis order_eq_iff card_le_dim_spanning card_ge_dim_independent)


[STATEMENT]
lemma simplex_minus_1 [simp]: "-1 simplex S \<longleftrightarrow> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1 simplex S) = (S = {})
[PROOF STEP]
by (metis simplex cancel_comm_monoid_add_class.diff_cancel card_0_eq diff_minus_eq_add of_nat_eq_0_iff simplex_empty)


[STATEMENT]
lemma (in Group) trivial_FGModule :
  fixes   smult :: "('f::field, 'g) aezfun \<Rightarrow> 'v::ab_group_add \<Rightarrow> 'v"
  assumes smult_zero: "\<forall>a\<in>group_ring. smult a (0::'v) = 0"
  shows   "FGModule G smult (0::'v set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FGModule G smult 0
[PROOF STEP]
proof (rule FGModule.intro)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group G
 2. RModule group_ring smult 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)
[PROOF STEP]
show "RModule group_ring  smult 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)

goal (1 subgoal):
 1. RModule group_ring smult 0
[PROOF STEP]
using Ring1_RG trivial_RModule
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>group_ring. smult a (0::'v) = (0::'v)
Ring1 group_ring
\<lbrakk>Ring1 ?R; \<forall>r\<in>?R. ?smult r (0::?'m) = (0::?'m)\<rbrakk> \<Longrightarrow> RModule ?R ?smult 0

goal (1 subgoal):
 1. RModule group_ring smult 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
RModule group_ring smult 0

goal (1 subgoal):
 1. Group G
[PROOF STEP]
qed (unfold_locales)


[STATEMENT]
lemma rev_removeAll_removeAll_rev: "rev (removeAll x xs) = removeAll x (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (removeAll x xs) = removeAll x (rev xs)
[PROOF STEP]
by (simp add: removeAll_filter_not_eq rev_filter)


[STATEMENT]
lemma kth_obs_le_iff: assumes \<open>is_kth_obs \<pi> k i\<close> \<open>is_kth_obs \<pi> l j\<close>  shows \<open>k < l \<longleftrightarrow> i < j\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k < l) = (i < j)
[PROOF STEP]
by (metis assms kth_obs_unique kth_obs_mono not_less_iff_gr_or_eq)


[STATEMENT]
lemma hd_distinct_neq_last: "distinct xs \<Longrightarrow> length xs > 1 \<Longrightarrow> hd xs \<noteq> last xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; 1 < length xs\<rbrakk> \<Longrightarrow> hd xs \<noteq> last xs
[PROOF STEP]
by (metis One_nat_def add_Suc_right distinct.simps(2) last.simps last_in_set less_irrefl
    list.exhaust list.sel(1) list.size(3) list.size(4) add.right_neutral nat_neq_iff not_less0)


[STATEMENT]
lemma union_fold_mset_add_mset: "A + B = fold_mset add_mset A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B = fold_mset add_mset A B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A + B = fold_mset add_mset A B
[PROOF STEP]
interpret comp_fun_commute add_mset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute add_mset
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A + B = fold_mset add_mset A B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B = fold_mset add_mset A B
[PROOF STEP]
by (induction B) auto
[PROOF STATE]
proof (state)
this:
A + B = fold_mset add_mset A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eheight_exp_bound: "eheight_exp n \<le> real ((n + 3) choose 3) / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
proof (induction n rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> eheight_exp y \<le> real (y + 3 choose 3) / 4) \<Longrightarrow> eheight_exp x \<le> real (x + 3 choose 3) / 4
[PROOF STEP]
case (less n)
[PROOF STATE]
proof (state)
this:
?y < n \<Longrightarrow> eheight_exp ?y \<le> real (?y + 3 choose 3) / 4

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> eheight_exp y \<le> real (y + 3 choose 3) / 4) \<Longrightarrow> eheight_exp x \<le> real (x + 3 choose 3) / 4
[PROOF STEP]
consider "n = 0" | "n = 1" | "n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n = 0 \<Longrightarrow> thesis; n = 1 \<Longrightarrow> thesis; 1 < n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = 0 \<Longrightarrow> ?thesis; n = 1 \<Longrightarrow> ?thesis; 1 < n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> eheight_exp y \<le> real (y + 3 choose 3) / 4) \<Longrightarrow> eheight_exp x \<le> real (x + 3 choose 3) / 4
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = 0 \<Longrightarrow> ?thesis; n = 1 \<Longrightarrow> ?thesis; 1 < n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
case 3
[PROOF STATE]
proof (state)
this:
1 < n

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
hence "eheight_exp n \<le> 4 / n * (\<Sum>k<n. eheight_exp k)"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. eheight_exp n \<le> 4 / real n * sum eheight_exp {..<n}
[PROOF STEP]
by (rule eheight_exp_reduce_bound)
[PROOF STATE]
proof (state)
this:
eheight_exp n \<le> 4 / real n * sum eheight_exp {..<n}

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eheight_exp n \<le> 4 / real n * sum eheight_exp {..<n}

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
have "(\<Sum>k<n. eheight_exp k) \<le> (\<Sum>k<n. real ((k + 3) choose 3) / 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum eheight_exp {..<n} \<le> (\<Sum>k<n. real (k + 3 choose 3) / 4)
[PROOF STEP]
by (intro sum_mono less.IH) auto
[PROOF STATE]
proof (state)
this:
sum eheight_exp {..<n} \<le> (\<Sum>k<n. real (k + 3 choose 3) / 4)

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum eheight_exp {..<n} \<le> (\<Sum>k<n. real (k + 3 choose 3) / 4)

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
have "\<dots> = real (\<Sum>k<n. ((k + 3) choose 3)) / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. real (k + 3 choose 3) / 4) = real (\<Sum>k<n. k + 3 choose 3) / 4
[PROOF STEP]
by (simp add: sum_divide_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. real (k + 3 choose 3) / 4) = real (\<Sum>k<n. k + 3 choose 3) / 4

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. real (k + 3 choose 3) / 4) = real (\<Sum>k<n. k + 3 choose 3) / 4

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
have "(\<Sum>k<n. ((k + 3) choose 3)) = (\<Sum>k\<le>n - 1. ((k + 3) choose 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. k + 3 choose 3) = (\<Sum>k\<le>n - 1. k + 3 choose 3)
[PROOF STEP]
using \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. (\<Sum>k<n. k + 3 choose 3) = (\<Sum>k\<le>n - 1. k + 3 choose 3)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. k + 3 choose 3) = (\<Sum>k\<le>n - 1. k + 3 choose 3)

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. k + 3 choose 3) = (\<Sum>k\<le>n - 1. k + 3 choose 3)

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
have "\<dots> = ((n + 3) choose 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n - 1. k + 3 choose 3) = n + 3 choose 4
[PROOF STEP]
using choose_rising_sum(1)[of 3 "n - 1"] and \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<le>n - 1. 3 + j choose 3) = 3 + (n - 1) + 1 choose (3 + 1)
1 < n

goal (1 subgoal):
 1. (\<Sum>k\<le>n - 1. k + 3 choose 3) = n + 3 choose 4
[PROOF STEP]
by (simp add: add_ac Suc3_eq_add_3)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n - 1. k + 3 choose 3) = n + 3 choose 4

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n - 1. k + 3 choose 3) = n + 3 choose 4

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
have "4 / real n * (\<dots> / 4) = real ((n + 3) choose 3) / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 / real n * (real (n + 3 choose 4) / 4) = real (n + 3 choose 3) / 4
[PROOF STEP]
using \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. 4 / real n * (real (n + 3 choose 4) / 4) = real (n + 3 choose 3) / 4
[PROOF STEP]
by (cases n) (simp_all add: binomial_fact fact_numeral divide_simps)
[PROOF STATE]
proof (state)
this:
4 / real n * (real (n + 3 choose 4) / 4) = real (n + 3 choose 3) / 4

goal (3 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 3. 1 < n \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> 4 / real n * x \<le> 4 / real n * y) \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> 4 / real n * x \<le> 4 / real n * y) \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4

goal (1 subgoal):
 1. eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
using \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> 4 / real n * x \<le> 4 / real n * y) \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
1 < n

goal (1 subgoal):
 1. eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
by (simp add: mult_left_mono divide_right_mono)
[PROOF STATE]
proof (state)
this:
eheight_exp n \<le> real (n + 3 choose 3) / 4

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
 2. n = 1 \<Longrightarrow> eheight_exp n \<le> real (n + 3 choose 3) / 4
[PROOF STEP]
qed (auto simp: eval_nat_numeral)
[PROOF STATE]
proof (state)
this:
eheight_exp n \<le> real (n + 3 choose 3) / 4

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Div_ge_inext_nth: "
  \<lbrakk> I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y \<rbrakk> \<Longrightarrow>
  (I \<oslash> k) \<rightarrow> n = (I \<rightarrow> n) div k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y\<rbrakk> \<Longrightarrow> (I \<oslash> k) \<rightarrow> n = (I \<rightarrow> n) div k
[PROOF STEP]
apply (case_tac "k = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y; k = 0\<rbrakk> \<Longrightarrow> (I \<oslash> k) \<rightarrow> n = (I \<rightarrow> n) div k
 2. \<lbrakk>I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y; k \<noteq> 0\<rbrakk> \<Longrightarrow> (I \<oslash> k) \<rightarrow> n = (I \<rightarrow> n) div k
[PROOF STEP]
apply (simp add: iT_Div_0 iTILL_0 inext_nth_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y; k \<noteq> 0\<rbrakk> \<Longrightarrow> (I \<oslash> k) \<rightarrow> n = (I \<rightarrow> n) div k
[PROOF STEP]
apply (simp add: iT_Div_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; \<forall>x\<in>I. \<forall>y\<in>I. x < y \<longrightarrow> x + k \<le> y; 0 < k\<rbrakk> \<Longrightarrow> ((\<lambda>n. n div k) ` I) \<rightarrow> n = (I \<rightarrow> n) div k
[PROOF STEP]
by (rule inext_nth_image[OF _ div_right_strict_mono_on])


[STATEMENT]
lemma filter_nth: "i < length (filter P xs) \<Longrightarrow> P (filter P xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (filter P xs) \<Longrightarrow> P (filter P xs ! i)
[PROOF STEP]
using nth_mem
[PROOF STATE]
proof (prove)
using this:
?n < length ?xs \<Longrightarrow> ?xs ! ?n \<in> set ?xs

goal (1 subgoal):
 1. i < length (filter P xs) \<Longrightarrow> P (filter P xs ! i)
[PROOF STEP]
by force


[STATEMENT]
lemma bijective_closed_imp_homeomorphic_map:
   "\<lbrakk>continuous_map X Y f; closed_map X Y f; f ` (topspace X) = topspace Y; inj_on f (topspace X)\<rbrakk>
        \<Longrightarrow> homeomorphic_map X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f; closed_map X Y f; f ` topspace X = topspace Y; inj_on f (topspace X)\<rbrakk> \<Longrightarrow> homeomorphic_map X Y f
[PROOF STEP]
by (simp add: continuous_closed_quotient_map homeomorphic_map_def)


[STATEMENT]
lemma wordinterval_to_set_ipcidr_tuple_to_wordinterval:
    "wordinterval_to_set (ipcidr_tuple_to_wordinterval (b, m)) = ipset_from_cidr b m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (ipcidr_tuple_to_wordinterval (b, m)) = ipset_from_cidr b m
[PROOF STEP]
unfolding ipcidr_tuple_to_wordinterval_def ipset_from_cidr_ipcidr_to_interval
              ipcidr_to_interval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (iprange_interval (ipcidr_to_interval_start (b, m), ipcidr_to_interval_end (b, m))) = {ipcidr_to_interval_start (b, m)..ipcidr_to_interval_end (b, m)}
[PROOF STEP]
by(simp add: iprange_interval.simps)


[STATEMENT]
lemma fractrel_iff [simp]:
  "fractrel x y \<longleftrightarrow> snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fractrel x y = (snd x \<noteq> (0::'a) \<and> snd y \<noteq> (0::'a) \<and> fst x * snd y = fst y * snd x)
[PROOF STEP]
by (simp add: fractrel_def)


[STATEMENT]
lemma field_poly_prod_mset_prime_factorization:
  "prod_mset (field_poly.prime_factorization p) = smult (inverse (lead_coeff p)) p"
  if "p \<noteq> 0" for p :: "'a :: field poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>\<^sub># (field_poly.prime_factorization p) = smult (inverse (lead_coeff p)) p
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. \<Prod>\<^sub># (field_poly.prime_factorization p) = smult (inverse (lead_coeff p)) p
[PROOF STEP]
by (fact field_poly.prod_mset_prime_factorization)


[STATEMENT]
lemma tendsto_add [tendsto_intros]:
  fixes a b :: "'a::topological_monoid_add"
  shows "(f \<longlongrightarrow> a) F \<Longrightarrow> (g \<longlongrightarrow> b) F \<Longrightarrow> ((\<lambda>x. f x + g x) \<longlongrightarrow> a + b) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; (g \<longlongrightarrow> b) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) \<longlongrightarrow> a + b) F
[PROOF STEP]
using filterlim_compose[OF tendsto_add_Pair, of "\<lambda>x. (f x, g x)" a b F]
[PROOF STATE]
proof (prove)
using this:
LIM x F. (f x, g x) :> nhds a \<times>\<^sub>F nhds b \<Longrightarrow> ((\<lambda>x. fst (f x, g x) + snd (f x, g x)) \<longlongrightarrow> a + b) F

goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; (g \<longlongrightarrow> b) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x + g x) \<longlongrightarrow> a + b) F
[PROOF STEP]
by (simp add: nhds_prod[symmetric] tendsto_Pair)


[STATEMENT]
lemma plog2_simps [simp]:
  "plog2 0 = 0" "plog2 (Suc 0) = 0"
  "0 < n \<Longrightarrow> plog2 (2 * n) = 1 + plog2 n"
  "0 < n \<Longrightarrow> plog2 (Suc (2 * n)) = 1 + plog2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (plog2 0 = 0 &&& plog2 (Suc 0) = 0) &&& (0 < n \<Longrightarrow> plog2 (2 * n) = 1 + plog2 n) &&& (0 < n \<Longrightarrow> plog2 (Suc (2 * n)) = 1 + plog2 n)
[PROOF STEP]
by(subst plog2.simps, simp add: Suc_double_half)+


[STATEMENT]
lemma countable_preimage:
  "\<lbrakk> countable A; inj_on f (preimage f A) \<rbrakk> \<Longrightarrow> countable (preimage f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; inj_on f (preimage f A)\<rbrakk> \<Longrightarrow> countable (preimage f A)
[PROOF STEP]
apply (auto simp add: countable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>fa. \<lbrakk>inj_on f (preimage f A); inj_on fa A\<rbrakk> \<Longrightarrow> \<exists>fa. inj_on fa (preimage f A)
[PROOF STEP]
apply (rename_tac g)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>inj_on f (preimage f A); inj_on g A\<rbrakk> \<Longrightarrow> \<exists>fa. inj_on fa (preimage f A)
[PROOF STEP]
apply (rule_tac x="g \<circ> the \<circ> f" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>inj_on f (preimage f A); inj_on g A\<rbrakk> \<Longrightarrow> inj_on (g \<circ> the \<circ> f) (preimage f A)
[PROOF STEP]
apply (rule inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g x y. \<lbrakk>inj_on f (preimage f A); inj_on g A; x \<in> preimage f A; y \<in> preimage f A; (g \<circ> the \<circ> f) x = (g \<circ> the \<circ> f) y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (drule inj_onD)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>g x y. \<lbrakk>inj_on g A; x \<in> preimage f A; y \<in> preimage f A; (g \<circ> the \<circ> f) x = (g \<circ> the \<circ> f) y\<rbrakk> \<Longrightarrow> f (?x4 g x y) = f (?y4 g x y)
 2. \<And>g x y. \<lbrakk>inj_on g A; x \<in> preimage f A; y \<in> preimage f A; (g \<circ> the \<circ> f) x = (g \<circ> the \<circ> f) y\<rbrakk> \<Longrightarrow> ?x4 g x y \<in> preimage f A
 3. \<And>g x y. \<lbrakk>inj_on g A; x \<in> preimage f A; y \<in> preimage f A; (g \<circ> the \<circ> f) x = (g \<circ> the \<circ> f) y\<rbrakk> \<Longrightarrow> ?y4 g x y \<in> preimage f A
 4. \<And>g x y. \<lbrakk>inj_on g A; x \<in> preimage f A; y \<in> preimage f A; (g \<circ> the \<circ> f) x = (g \<circ> the \<circ> f) y; ?x4 g x y = ?y4 g x y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (auto simp add: preimage_def inj_onD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fls_deriv_power:
  fixes f :: "'a::comm_ring_1 fls"
  shows "fls_deriv (f^n) = of_nat n * f^(n-1) * fls_deriv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
n = Suc m

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
have "fls_deriv (f^Suc m) = of_nat (Suc m) * f^m * fls_deriv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_deriv (f ^ Suc m) = of_nat (Suc m) * f ^ m * fls_deriv f
[PROOF STEP]
by (induct m) (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
fls_deriv (f ^ Suc m) = of_nat (Suc m) * f ^ m * fls_deriv f

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
 2. \<And>nat. n = Suc nat \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
n = Suc m
fls_deriv (f ^ Suc m) = of_nat (Suc m) * f ^ m * fls_deriv f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc m
fls_deriv (f ^ Suc m) = of_nat (Suc m) * f ^ m * fls_deriv f

goal (1 subgoal):
 1. fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> fls_deriv (f ^ n) = of_nat n * f ^ (n - 1) * fls_deriv f
[PROOF STEP]
qed simp


[STATEMENT]
lemma dvd_prime_power_iff:
  fixes p::nat
  assumes prime: "prime p"
  shows "{d. d dvd p^n} = (\<lambda>k. p^k) ` {0..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {d. d dvd p ^ n} = (^) p ` {0..n}
[PROOF STEP]
using divides_primepow_nat prime
[PROOF STATE]
proof (prove)
using this:
prime ?p \<Longrightarrow> (?d dvd ?p ^ ?k) = (\<exists>i\<le>?k. ?d = ?p ^ i)
prime p

goal (1 subgoal):
 1. {d. d dvd p ^ n} = (^) p ` {0..n}
[PROOF STEP]
by (auto simp add: le_imp_power_dvd)


[STATEMENT]
lemma hrealpow_sum_square_expand:
  "(x + y) ^ Suc (Suc 0) =
    x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + (hypreal_of_nat (Suc (Suc 0))) * x * y"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) ^ Suc (Suc 0) = x ^ Suc (Suc 0) + y ^ Suc (Suc 0) + hypreal_of_nat (Suc (Suc 0)) * x * y
[PROOF STEP]
by (simp add: distrib_left distrib_right)