[STATEMENT]
lemma polymul_commute:
  assumes "SORT_CONSTRAINT('a::field_char_0)"
    and np: "isnpolyh p n0"
    and nq: "isnpolyh q n1"
  shows "p *\<^sub>p q = q *\<^sub>p p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p *\<^sub>p q = q *\<^sub>p p
[PROOF STEP]
using isnpolyh_unique[OF polymul_normh[OF np nq] polymul_normh[OF nq np],
    where ?'a = "'a::{field_char_0, power}"]
[PROOF STATE]
proof (prove)
using this:
(\<forall>bs. \<lparr>p *\<^sub>p q\<rparr>\<^sub>p\<^bsup>bs\<^esup> = \<lparr>q *\<^sub>p p\<rparr>\<^sub>p\<^bsup>bs\<^esup>) = (p *\<^sub>p q = q *\<^sub>p p)

goal (1 subgoal):
 1. p *\<^sub>p q = q *\<^sub>p p
[PROOF STEP]
by simp


[STATEMENT]
lemma list_take_induct_tl2:
  "\<lbrakk>length xs = length ys; \<forall>n<length xs. P (ys ! n) (xs ! n)\<rbrakk>
    \<Longrightarrow> \<forall>n < length (tl xs). P ((tl ys) ! n) ((tl xs) ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; \<forall>n<length xs. P (ys ! n) (xs ! n)\<rbrakk> \<Longrightarrow> \<forall>n<length (tl xs). P (tl ys ! n) (tl xs ! n)
[PROOF STEP]
by (induct xs ys rule: list_induct2) auto


[STATEMENT]
lemma moebius_inv_mk_moebus [simp]:
  assumes "mat_det (a, b, c, d) \<noteq> 0"
  shows "moebius_inv (mk_moebius a b c d) =
         mk_moebius (d/(a*d-b*c)) (-b/(a*d-b*c)) (-c/(a*d-b*c)) (a/(a*d-b*c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_inv (mk_moebius a b c d) = mk_moebius (d / (a * d - b * c)) (- b / (a * d - b * c)) (- c / (a * d - b * c)) (a / (a * d - b * c))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det (a, b, c, d) \<noteq> 0

goal (1 subgoal):
 1. moebius_inv (mk_moebius a b c d) = mk_moebius (d / (a * d - b * c)) (- b / (a * d - b * c)) (- c / (a * d - b * c)) (a / (a * d - b * c))
[PROOF STEP]
by (transfer, transfer) (auto, rule_tac x=1 in exI, simp_all add: field_simps)


[STATEMENT]
lemma interval_expand:
  "x < y \<Longrightarrow> (z::int) \<in> {x..<y} = (z = x \<or> z \<in> {x+1..<y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> (z \<in> {x..<y}) = (z = x \<or> z \<in> {x + 1..<y})
[PROOF STEP]
by auto


[STATEMENT]
lemma DDH_advantage_bound: "ddh.DDH_advantage \<G> \<A> \<le> ddh.advantage \<G> \<A> + ddh.advantage \<G> (ddh.DDH_\<A>' \<G> \<A>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DDH_advantage \<A> \<le> advantage \<A> + advantage (DDH_\<A>' \<A>)
[PROOF STEP]
using DDH_bound2 DDH_\<A>'_bound DDH_advantage_def
[PROOF STATE]
proof (prove)
using this:
\<bar>spmf (DDH0 ?\<A>) True - spmf (DDH1 ?\<A>) True\<bar> \<le> advantage ?\<A> + \<bar>spmf (ddh_1 ?\<A>) True - spmf (DDH1 ?\<A>) True\<bar>
advantage (DDH_\<A>' ?\<A>) = \<bar>spmf (ddh_1 ?\<A>) True - spmf (DDH1 ?\<A>) True\<bar>
DDH_advantage ?\<A> = \<bar>spmf (DDH0 ?\<A>) True - spmf (DDH1 ?\<A>) True\<bar>

goal (1 subgoal):
 1. DDH_advantage \<A> \<le> advantage \<A> + advantage (DDH_\<A>' \<A>)
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_on_closure_sequentially:
  fixes f :: "'a::metric_space \<Rightarrow> 'b :: metric_space"
  shows
   "continuous_on (closure S) f \<longleftrightarrow>
    (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)"
   (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
have "continuous_on (closure S) f \<longleftrightarrow>
           (\<forall>x \<in> closure S. continuous (at x within S) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x\<in>closure S. continuous (at x within S) f)
[PROOF STEP]
by (force simp: continuous_on_closure continuous_within_eps_delta)
[PROOF STATE]
proof (state)
this:
continuous_on (closure S) f = (\<forall>x\<in>closure S. continuous (at x within S) f)

goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
continuous_on (closure S) f = (\<forall>x\<in>closure S. continuous (at x within S) f)

goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>closure S. continuous (at x within S) f) = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
by (force simp: continuous_within_sequentially)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>closure S. continuous (at x within S) f) = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)

goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)

goal (1 subgoal):
 1. continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
continuous_on (closure S) f = (\<forall>x a. a \<in> closure S \<and> (\<forall>n. x n \<in> S) \<and> x \<longlonglongrightarrow> a \<longrightarrow> (f \<circ> x) \<longlonglongrightarrow> f a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_coplanar_implies_upper_dim:
  assumes "all_coplanar_axiom"
  shows "upper_dim_axiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UpperDimAxiom
[PROOF STEP]
using all_coplanar_axiom_def assms upper_dim_axiom_def
[PROOF STATE]
proof (prove)
using this:
AllCoplanarAxiom \<equiv> \<forall>A B C P Q. P \<noteq> Q \<and> Cong A P A Q \<and> Cong B P B Q \<and> Cong C P C Q \<longrightarrow> Bet A B C \<or> Bet B C A \<or> Bet C A B
AllCoplanarAxiom
UpperDimAxiom \<equiv> \<forall>A B C P Q. P \<noteq> Q \<and> Cong A P A Q \<and> Cong B P B Q \<and> Cong C P C Q \<longrightarrow> Bet A B C \<or> Bet B C A \<or> Bet C A B

goal (1 subgoal):
 1. UpperDimAxiom
[PROOF STEP]
by auto


[STATEMENT]
lemma equal_ket:
  fixes A B :: \<open>('a ell2, 'b::complex_normed_vector) cblinfun\<close>
  assumes \<open>\<And> x. A *\<^sub>V ket x = B *\<^sub>V ket x\<close>
  shows \<open>A = B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
apply (rule cblinfun_eq_gen_eqI[where G=\<open>range ket\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> range ket \<Longrightarrow> A *\<^sub>V x = B *\<^sub>V x
 2. ccspan (range ket) = \<top>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>V ket ?x = B *\<^sub>V ket ?x

goal (2 subgoals):
 1. \<And>x. x \<in> range ket \<Longrightarrow> A *\<^sub>V x = B *\<^sub>V x
 2. ccspan (range ket) = \<top>
[PROOF STEP]
by auto


[STATEMENT]
lemma image_mset_remove1_mset_if:
  "image_mset f (remove1_mset a M) =
   (if a \<in># M then remove1_mset (f a) (image_mset f M) else image_mset f M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (remove1_mset a M) = (if a \<in># M then remove1_mset (f a) (image_mset f M) else image_mset f M)
[PROOF STEP]
by (auto simp: image_mset_Diff)


[STATEMENT]
theorem (in HMM4) likelihood_compute:
  "likelihood_compute s os = Some x \<longleftrightarrow> s \<in> \<S> \<and> x = likelihood s os"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (likelihood_compute s os = Some x) = (s \<in> \<S> \<and> x = likelihood s os)
[PROOF STEP]
unfolding likelihood_compute_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if s \<in> set state_list then Some (\<Sum>t\<leftarrow>state_list. forward s t os) else None) = Some x) = (s \<in> \<S> \<and> x = likelihood s os)
[PROOF STEP]
by (auto simp: states_distinct state_list_\<S> sum_list_distinct_conv_sum_set likelihood_forward)


[STATEMENT]
lemma opar_comp_def':
  "s \<langle>\<langle>\<^bsub>i\<^esub> t = \<lparr> init = {(\<sigma>, (s\<^sub>l, t\<^sub>l))|\<sigma> s\<^sub>l t\<^sub>l. (\<sigma>, s\<^sub>l) \<in> init s \<and> t\<^sub>l \<in> init t},
                trans = oparp_sos i (trans s) (trans t) \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<langle>\<langle>\<^bsub>i\<^esub> t = \<lparr>init = {(\<sigma>, s\<^sub>l, t\<^sub>l) |\<sigma> s\<^sub>l t\<^sub>l. (\<sigma>, s\<^sub>l) \<in> init s \<and> t\<^sub>l \<in> init t}, trans = oparp_sos i (automaton.trans s) (automaton.trans t)\<rparr>
[PROOF STEP]
unfolding opar_comp_def extg_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>init = {y. \<exists>x\<in>init s \<times> init t. y = (case x of (x, xa) \<Rightarrow> (case x of (\<sigma>, l1) \<Rightarrow> \<lambda>l2. (\<sigma>, l1, l2)) xa)}, trans = oparp_sos i (automaton.trans s) (automaton.trans t)\<rparr> = \<lparr>init = {(\<sigma>, s\<^sub>l, t\<^sub>l) |\<sigma> s\<^sub>l t\<^sub>l. (\<sigma>, s\<^sub>l) \<in> init s \<and> t\<^sub>l \<in> init t}, trans = oparp_sos i (automaton.trans s) (automaton.trans t)\<rparr>
[PROOF STEP]
by (auto split: prod.split)


[STATEMENT]
lemma netlimit_at_right: "netlimit (at_right x) = x" for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. netlimit (at_right x) = x
[PROOF STEP]
by (rule Lim_ident_at) simp


[STATEMENT]
lemma expands_to_arctan_ms_pos_exp_neg:
  assumes "e > 0" "trimmed_neg (MS (MSLCons (C, e) xs) g)" "basis_wf basis"
          "(f expands_to MS (MSLCons (C, e) xs) g) basis"
  shows   "((\<lambda>x. arctan (f x)) expands_to MS (minus_ms_aux (const_ms_aux (-pi/2))
             (arctan_ms_aux (inverse_ms_aux (MSLCons (C, e) xs))))
               (\<lambda>x. arctan (g x))) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arctan (f x)) expands_to MS (minus_ms_aux (const_ms_aux (- pi / 2)) (arctan_ms_aux (inverse_ms_aux (MSLCons (C, e) xs)))) (\<lambda>x. arctan (g x))) basis
[PROOF STEP]
using arctan_ms_aux_neg_inf[of "MSLCons (C, e) xs" basis g] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<exists>ea>0. ms_aux_hd_exp (MSLCons (C, e) xs) = Some ea; fst (dominant_term_ms_aux (MSLCons (C, e) xs)) < 0; trimmed_ms_aux (MSLCons (C, e) xs); basis_wf basis; is_expansion_aux (MSLCons (C, e) xs) g basis\<rbrakk> \<Longrightarrow> is_expansion_aux (minus_ms_aux (const_ms_aux (- pi / 2)) (arctan_ms_aux (inverse_ms_aux (MSLCons (C, e) xs)))) (\<lambda>x. arctan (g x)) basis
0 < e
trimmed_neg (MS (MSLCons (C, e) xs) g)
basis_wf basis
(f expands_to MS (MSLCons (C, e) xs) g) basis

goal (1 subgoal):
 1. ((\<lambda>x. arctan (f x)) expands_to MS (minus_ms_aux (const_ms_aux (- pi / 2)) (arctan_ms_aux (inverse_ms_aux (MSLCons (C, e) xs)))) (\<lambda>x. arctan (g x))) basis
[PROOF STEP]
by (auto simp: expands_to.simps snd_dominant_term_ms_aux_MSLCons o_def
                 dominant_term_ms_aux_MSLCons trimmed_neg_def elim: eventually_mono)


[STATEMENT]
lemma [import_const BIT0]:
  "bit0 = (SOME fn. fn (id 0) = id 0 \<and> (\<forall>n. fn (Suc n) = Suc (Suc (fn n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit0 = (SOME fn. fn (id 0) = id 0 \<and> (\<forall>n. fn (Suc n) = Suc (Suc (fn n))))
[PROOF STEP]
apply (auto intro!: some_equality[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>fn. \<lbrakk>fn 0 = 0; \<forall>n. fn (Suc n) = Suc (Suc (fn n))\<rbrakk> \<Longrightarrow> fn = bit0
[PROOF STEP]
apply (auto simp add: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>fn x. \<lbrakk>fn 0 = 0; \<forall>n. fn (Suc n) = Suc (Suc (fn n))\<rbrakk> \<Longrightarrow> fn x = 2 * x
[PROOF STEP]
apply (induct_tac x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>fn x. \<lbrakk>fn 0 = 0; \<forall>n. fn (Suc n) = Suc (Suc (fn n))\<rbrakk> \<Longrightarrow> fn 0 = 2 * 0
 2. \<And>fn x n. \<lbrakk>fn 0 = 0; \<forall>n. fn (Suc n) = Suc (Suc (fn n)); fn n = 2 * n\<rbrakk> \<Longrightarrow> fn (Suc n) = 2 * Suc n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Re_Arcsin_bound: "\<bar>Re(Arcsin z)\<bar> \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re (Arcsin z)\<bar> \<le> pi
[PROOF STEP]
by (meson Re_Arcsin_bounds abs_le_iff less_eq_real_def minus_less_iff)


[STATEMENT]
lemma is_mset_setD[dest]: "is_mset_set X \<Longrightarrow> x \<in># X \<Longrightarrow> count X x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct_mset X; x \<in># X\<rbrakk> \<Longrightarrow> count X x = 1
[PROOF STEP]
unfolding is_mset_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>#X. count X x = 1; x \<in># X\<rbrakk> \<Longrightarrow> count X x = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma \<L>\<^sub>b_eq_L\<^sub>a_max: "\<L>\<^sub>b v s = L\<^sub>a (arg_max_on (\<lambda>a. L\<^sub>a a v s) (A s)) v s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apply_bfun (\<L>\<^sub>b v) s = L\<^sub>a (arg_max_on (\<lambda>a. L\<^sub>a a (apply_bfun v) s) (A s)) (apply_bfun v) s
[PROOF STEP]
using app_arg_max_eq_SUP[symmetric] Sup_att max_L_ex_def
[PROOF STATE]
proof (prove)
using this:
has_arg_max ?f ?X \<Longrightarrow> \<Squnion> (?f ` ?X) = ?f (arg_max_on ?f ?X)
max_L_ex ?s ?v
max_L_ex ?s ?v \<equiv> has_arg_max (\<lambda>a. L\<^sub>a a ?v ?s) (A ?s)

goal (1 subgoal):
 1. apply_bfun (\<L>\<^sub>b v) s = L\<^sub>a (arg_max_on (\<lambda>a. L\<^sub>a a (apply_bfun v) s) (A s)) (apply_bfun v) s
[PROOF STEP]
by (auto simp: \<L>\<^sub>b_eq_SUP_det SUP_step_det_eq)


[STATEMENT]
lemma length_enum_word_eq:
  \<open>length (Enum.enum :: 'a::len word list) = 2 ^ LENGTH('a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length enum_class.enum = 2 ^ LENGTH('a)
[PROOF STEP]
by (simp add: enum_word_def)


[STATEMENT]
lemma coplanar_4_ter :
  assumes "rk {A, B, C} = 3" and "rk {A, B, \<gamma>} = 2"
  shows "rk {A, B, C, \<gamma>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<gamma>} = 3
[PROOF STEP]
by (smt assms(1) assms(2) coplanar_4 insert_commute)


[STATEMENT]
lemma (in Order) fTo_conditional_Un_Chain_mem2:" \<lbrakk>C \<in> carrier (fTo D);
       Chain (Iod (fTo D) {S \<in> carrier fTo D. C \<subseteq> S}) Ca; Ca = {}\<rbrakk> \<Longrightarrow>
       C \<in> upper_bounds (Iod (fTo D) {S \<in> carrier (fTo D). C \<subseteq> S}) Ca"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> carrier fTo D; Chain (Iod fTo D {S \<in> carrier fTo D. C \<subseteq> S}) Ca; Ca = {}\<rbrakk> \<Longrightarrow> C \<in> upper_bounds (Iod fTo D {S \<in> carrier fTo D. C \<subseteq> S}) Ca
[PROOF STEP]
apply (cut_tac fTOrder,
       cut_tac conditional_subset[of "carrier (fTo D)" "(\<subseteq>) C"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> carrier fTo D; Chain (Iod fTo D {S \<in> carrier fTo D. C \<subseteq> S}) Ca; Ca = {}; Order fTo D; {x \<in> carrier fTo D. C \<subseteq> x} \<subseteq> carrier fTo D\<rbrakk> \<Longrightarrow> C \<in> upper_bounds (Iod fTo D {S \<in> carrier fTo D. C \<subseteq> S}) Ca
[PROOF STEP]
apply (simp add:upper_bounds_def upper_bound_def, simp add:Order.Iod_carrier)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Im_Reals_divide: "r \<in> \<real> \<Longrightarrow> Im (r / z) = -Re r * Im z / (norm z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> \<real> \<Longrightarrow> Im (r / z) = - Re r * Im z / (cmod z)\<^sup>2
[PROOF STEP]
by (simp add: Im_divide complex_is_Real_iff cmod_power2)


[STATEMENT]
lemma br_list_set_rel: "\<langle>br f P\<rangle> list_set_rel = br (set \<circ> map f) (\<lambda> s. list_all P s \<and> distinct (map f s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>br f P\<rangle>list_set_rel = br ((set \<circ>\<circ> map) f) (\<lambda>s. list_all P s \<and> distinct (map f s))
[PROOF STEP]
unfolding list_set_rel_def br_list_rel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. br (map f) (list_all P) O br set distinct = br ((set \<circ>\<circ> map) f) (\<lambda>s. list_all P s \<and> distinct (map f s))
[PROOF STEP]
unfolding br_chain
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. br ((set \<circ>\<circ> map) f) (\<lambda>s. list_all P s \<and> distinct (map f s)) = br ((set \<circ>\<circ> map) f) (\<lambda>s. list_all P s \<and> distinct (map f s))
[PROOF STEP]
by rule


[STATEMENT]
lemma tuple_partial_pullback_union:
"tuple_partial_pullback m f l (S1 \<union> S2) = (tuple_partial_pullback m f l S1) \<union> (tuple_partial_pullback m f l S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_pullback m f l (S1 \<union> S2) = tuple_partial_pullback m f l S1 \<union> tuple_partial_pullback m f l S2
[PROOF STEP]
unfolding tuple_partial_pullback_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image m f -` (S1 \<union> S2) \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>) = tuple_partial_image m f -` S1 \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>) \<union> tuple_partial_image m f -` S2 \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma assoc_ell2_tensor: \<open>assoc_ell2 *\<^sub>V tensor_ell2 (tensor_ell2 a b) c = tensor_ell2 a (tensor_ell2 b c)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assoc_ell2 *\<^sub>V (a \<otimes>\<^sub>s b) \<otimes>\<^sub>s c = a \<otimes>\<^sub>s b \<otimes>\<^sub>s c
[PROOF STEP]
apply (rule clinear_equal_ket[THEN fun_cong, where x=a])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. clinear (\<lambda>a. assoc_ell2 *\<^sub>V (a \<otimes>\<^sub>s b) \<otimes>\<^sub>s c)
 2. clinear (\<lambda>a. a \<otimes>\<^sub>s b \<otimes>\<^sub>s c)
 3. \<And>i. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s b) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s b \<otimes>\<^sub>s c
[PROOF STEP]
apply (simp add: cblinfun.add_right clinearI tensor_ell2_add1 tensor_ell2_scaleC1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. clinear (\<lambda>a. a \<otimes>\<^sub>s b \<otimes>\<^sub>s c)
 2. \<And>i. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s b) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s b \<otimes>\<^sub>s c
[PROOF STEP]
apply (simp add: clinear_tensor_ell22)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s b) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s b \<otimes>\<^sub>s c
[PROOF STEP]
apply (rule clinear_equal_ket[THEN fun_cong, where x=b])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. clinear (\<lambda>a. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s a) \<otimes>\<^sub>s c)
 2. \<And>i. clinear (\<lambda>a. ket i \<otimes>\<^sub>s a \<otimes>\<^sub>s c)
 3. \<And>i ia. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s c
[PROOF STEP]
apply (simp add: cblinfun.add_right clinearI tensor_ell2_add1 tensor_ell2_add2 tensor_ell2_scaleC1 tensor_ell2_scaleC2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. clinear (\<lambda>a. ket i \<otimes>\<^sub>s a \<otimes>\<^sub>s c)
 2. \<And>i ia. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s c
[PROOF STEP]
apply (simp add: clinearI tensor_ell2_add1 tensor_ell2_add2 tensor_ell2_scaleC1 tensor_ell2_scaleC2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s c = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s c
[PROOF STEP]
apply (rule clinear_equal_ket[THEN fun_cong, where x=c])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i ia. clinear (\<lambda>a. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s a)
 2. \<And>i ia. clinear (\<lambda>a. ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s a)
 3. \<And>i ia ib. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s ket ib = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s ket ib
[PROOF STEP]
apply (simp add: cblinfun.add_right clinearI tensor_ell2_add2 tensor_ell2_scaleC2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i ia. clinear (\<lambda>a. ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s a)
 2. \<And>i ia ib. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s ket ib = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s ket ib
[PROOF STEP]
apply (simp add: clinearI tensor_ell2_add2 tensor_ell2_scaleC2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia ib. assoc_ell2 *\<^sub>V (ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s ket ib = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s ket ib
[PROOF STEP]
unfolding assoc_ell2.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia ib. assoc_ell20 ((ket i \<otimes>\<^sub>s ket ia) \<otimes>\<^sub>s ket ib) = ket i \<otimes>\<^sub>s ket ia \<otimes>\<^sub>s ket ib
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia ib. (\<lambda>(a, b, c). case ((a, b), c) of (ic, j) \<Rightarrow> (case ic of (ib, j) \<Rightarrow> (if i = ib then 1 else 0) * (if ia = j then 1 else 0)) * (if ib = j then 1 else 0)) = (\<lambda>(ic, j). (if i = ic then 1 else 0) * (case j of (i, j) \<Rightarrow> (if ia = i then 1 else 0) * (if ib = j then 1 else 0)))
[PROOF STEP]
by auto


[STATEMENT]
lemma set_of_interval_union: "set_of A \<union> set_of B \<subseteq> set_of (sup A B)" for A::"'a::lattice interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of A \<union> set_of B \<subseteq> set_of (sup A B)
[PROOF STEP]
by (auto simp: set_of_eq)


[STATEMENT]
lemma exists_nat_var:
  "\<exists> f::nat\<Rightarrow>'var. inj f \<and> range f \<subseteq> var"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj f \<and> range f \<subseteq> var
[PROOF STEP]
by (simp add: infinite_countable_subset infinite_var)


[STATEMENT]
lemma closest_point_lt:
  assumes "convex S" "closed S" "x \<in> S" "x \<noteq> closest_point S a"
  shows "dist a (closest_point S a) < dist a x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist a (closest_point S a) < dist a x
[PROOF STEP]
using closest_point_unique[where a=a] closest_point_le[where a=a] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex ?S; closed ?S; ?x \<in> ?S; \<forall>z\<in>?S. dist a ?x \<le> dist a z\<rbrakk> \<Longrightarrow> ?x = closest_point ?S a
\<lbrakk>closed ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> dist a (closest_point ?S a) \<le> dist a ?x
convex S
closed S
x \<in> S
x \<noteq> closest_point S a

goal (1 subgoal):
 1. dist a (closest_point S a) < dist a x
[PROOF STEP]
by fastforce


[STATEMENT]
lemma dotprod_Cons [simp]:
  "(x # xs) \<bullet> (y # ys) = x * y + xs \<bullet> ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs) \<bullet> (y # ys) = x * y + xs \<bullet> ys
[PROOF STEP]
unfolding dotprod_def and length_Cons and min_Suc_Suc and sum.lessThan_Suc_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs) ! 0 * (y # ys) ! 0 + (\<Sum>i<min (length xs) (length ys). (x # xs) ! Suc i * (y # ys) ! Suc i) = x * y + (\<Sum>i<min (length xs) (length ys). xs ! i * ys ! i)
[PROOF STEP]
by auto


[STATEMENT]
lemma eint_ord_simps [simp]:
  "eint m \<le> eint n \<longleftrightarrow> m \<le> n"
  "eint m < eint n \<longleftrightarrow> m < n"
  "q \<le> (\<infinity>::eint)"
  "q < (\<infinity>::eint) \<longleftrightarrow> q \<noteq> \<infinity>"
  "(\<infinity>::eint) \<le> q \<longleftrightarrow> q = \<infinity>"
  "(\<infinity>::eint) < q \<longleftrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((eint m \<le> eint n) = (m \<le> n) &&& (eint m < eint n) = (m < n) &&& q \<le> \<infinity>) &&& (q < \<infinity>) = (q \<noteq> \<infinity>) &&& (\<infinity> \<le> q) = (q = \<infinity>) &&& (\<infinity> < q) = False
[PROOF STEP]
by (simp_all add: less_eq_eint_def less_eint_def split: eint.splits)


[STATEMENT]
lemma MOST_nat: "(\<forall>\<^sub>\<infinity>n. P n) \<longleftrightarrow> (\<exists>m. \<forall>n>m. P n)"
  for P :: "nat \<Rightarrow> bool"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>\<infinity>n. P n) = (\<exists>m. \<forall>n>m. P n)
[PROOF STEP]
by (auto simp add: eventually_cofinite finite_nat_iff_bounded_le subset_eq simp flip: not_le)


[STATEMENT]
lemma get_distinguishing_sequence_from_ofsm_tables_precomputed:
  "get_distinguishing_sequence_from_ofsm_tables M = (let
      tables = (compute_ofsm_tables M (size M - 1));
      distMap = mapping_of (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2))
                        (filter (\<lambda> qq . fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M))));
      distHelper = (\<lambda> q1 q2 . if q1 \<in> states M \<and> q2 \<in> states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1,q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2)
    in distHelper)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
define distStates where "distStates = (filter (\<lambda> qq . fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))"
[PROOF STATE]
proof (state)
this:
distStates = filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M))

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
define distMap where distMap_orig: "distMap = mapping_of (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables (compute_ofsm_tables M (size M - 1)) M q1 q2))
                                    distStates)"
[PROOF STATE]
proof (state)
this:
distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables (compute_ofsm_tables M (FSM.size M - 1)) M q1 q2)) distStates)

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
have "distinct distStates"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct distStates
[PROOF STEP]
unfolding distStates_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))
[PROOF STEP]
using states_as_list_distinct
[PROOF STATE]
proof (prove)
using this:
distinct (states_as_list ?M)

goal (1 subgoal):
 1. distinct (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))
[PROOF STEP]
using distinct_filter distinct_product
[PROOF STATE]
proof (prove)
using this:
distinct (states_as_list ?M)
distinct ?xs \<Longrightarrow> distinct (filter ?P ?xs)
\<lbrakk>distinct ?xs; distinct ?ys\<rbrakk> \<Longrightarrow> distinct (List.product ?xs ?ys)

goal (1 subgoal):
 1. distinct (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distinct distStates

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct distStates
[PROOF STEP]
have "distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))"
[PROOF STATE]
proof (prove)
using this:
distinct distStates

goal (1 subgoal):
 1. distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
unfolding map_pair_fst_helper
[PROOF STATE]
proof (prove)
using this:
distinct distStates

goal (1 subgoal):
 1. distinct distStates
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
have distMap_def: "Mapping.lookup distMap = map_of (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2))
                                          distStates)"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))

goal (1 subgoal):
 1. Mapping.lookup distMap = map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
unfolding distMap_orig get_distinguishing_sequence_from_ofsm_tables_with_provided_tables_simp
              get_distinguishing_sequence_from_ofsm_tables_refined_alt_def
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))

goal (1 subgoal):
 1. Mapping.lookup (mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)) = map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
using mapping_of_map_of
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
distinct (map fst ?kvs) \<Longrightarrow> Mapping.lookup (mapping_of ?kvs) = map_of ?kvs

goal (1 subgoal):
 1. Mapping.lookup (mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)) = map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Mapping.lookup distMap = map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
define distHelper where "distHelper = (\<lambda> q1 q2 . if q1 \<in> states M \<and> q2 \<in> states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1,q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2)"
[PROOF STATE]
proof (state)
this:
distHelper = (\<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2)

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
have "distHelper = get_distinguishing_sequence_from_ofsm_tables M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distHelper = get_distinguishing_sequence_from_ofsm_tables M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distHelper = get_distinguishing_sequence_from_ofsm_tables M
[PROOF STEP]
have "\<And> q1 q2 . distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q1 q2. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q1 q2. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
fix q1 q2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q1 q2. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
show "distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
proof (cases "q1 \<in> states M \<and> q2 \<in> states M \<and> q1 \<noteq> q2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
 2. \<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2) \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2)

goal (2 subgoals):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
 2. \<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2) \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2)

goal (1 subgoal):
 1. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
unfolding distHelper_def
[PROOF STATE]
proof (prove)
using this:
\<not> (q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2)

goal (1 subgoal):
 1. (if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2
[PROOF STEP]
have *:"(q1,q2) \<in> list.set distStates"
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2

goal (1 subgoal):
 1. (q1, q2) \<in> set distStates
[PROOF STEP]
using states_as_list_set
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2
set (states_as_list ?M) = FSM.states ?M

goal (1 subgoal):
 1. (q1, q2) \<in> set distStates
[PROOF STEP]
unfolding distStates_def
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2
set (states_as_list ?M) = FSM.states ?M

goal (1 subgoal):
 1. (q1, q2) \<in> set (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(q1, q2) \<in> set distStates

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
have "distinct (map fst (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
have **: "(map fst (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)) = distStates"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates
[PROOF STEP]
proof (induction distStates)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) []) = []
 2. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) []) = []
 2. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) []) = []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) []) = []

goal (1 subgoal):
 1. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
case (Cons a distStates)
[PROOF STATE]
proof (state)
this:
map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates

goal (1 subgoal):
 1. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
obtain x y where "a = (x,y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. a = (x, y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using surjective_pairing
[PROOF STATE]
proof (prove)
using this:
?t = (fst ?t, snd ?t)

goal (1 subgoal):
 1. (\<And>x y. a = (x, y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = (x, y)

goal (1 subgoal):
 1. \<And>a distStates. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates \<Longrightarrow> map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates

goal (1 subgoal):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates
[PROOF STEP]
unfolding \<open>a = (x,y)\<close>
[PROOF STATE]
proof (prove)
using this:
map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates

goal (1 subgoal):
 1. map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) ((x, y) # distStates)) = (x, y) # distStates
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map fst (map (\<lambda>a. case a of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) (a # distStates)) = a # distStates

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) = distStates

goal (1 subgoal):
 1. distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))
[PROOF STEP]
unfolding **
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct distStates
[PROOF STEP]
unfolding distStates_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))
[PROOF STEP]
by (simp add: distinct_product)
[PROOF STATE]
proof (state)
this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distinct (map fst (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
have "((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> list.set (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
using Util.map_set[OF *, of "(\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2))"]
[PROOF STATE]
proof (prove)
using this:
(case (q1, q2) of (q1, q2) \<Rightarrow> ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)

goal (1 subgoal):
 1. ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)
[PROOF STEP]
have "the (Mapping.lookup distMap (q1,q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2"
[PROOF STATE]
proof (prove)
using this:
((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)

goal (1 subgoal):
 1. the (Mapping.lookup distMap (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
unfolding distMap_def
[PROOF STATE]
proof (prove)
using this:
((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<in> set (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates)

goal (1 subgoal):
 1. the (map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
unfolding Map.map_of_eq_Some_iff[OF \<open>distinct (map fst (map (\<lambda> (q1,q2) . ((q1,q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates))\<close>, symmetric]
[PROOF STATE]
proof (prove)
using this:
map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) (q1, q2) = Some (get_distinguishing_sequence_from_ofsm_tables M q1 q2)

goal (1 subgoal):
 1. the (map_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables M q1 q2)) distStates) (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
by (metis option.sel)
[PROOF STATE]
proof (state)
this:
the (Mapping.lookup distMap (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
the (Mapping.lookup distMap (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
have "distHelper q1 q2 = the (Mapping.lookup distMap (q1,q2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distHelper q1 q2 = the (Mapping.lookup distMap (q1, q2))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2

goal (1 subgoal):
 1. distHelper q1 q2 = the (Mapping.lookup distMap (q1, q2))
[PROOF STEP]
unfolding distHelper_def
[PROOF STATE]
proof (prove)
using this:
q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2

goal (1 subgoal):
 1. (if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2) = the (Mapping.lookup distMap (q1, q2))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
distHelper q1 q2 = the (Mapping.lookup distMap (q1, q2))

goal (1 subgoal):
 1. q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 \<Longrightarrow> distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
the (Mapping.lookup distMap (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
distHelper q1 q2 = the (Mapping.lookup distMap (q1, q2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
the (Mapping.lookup distMap (q1, q2)) = get_distinguishing_sequence_from_ofsm_tables M q1 q2
distHelper q1 q2 = the (Mapping.lookup distMap (q1, q2))

goal (1 subgoal):
 1. distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distHelper q1 q2 = get_distinguishing_sequence_from_ofsm_tables M q1 q2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distHelper ?q1.0 ?q2.0 = get_distinguishing_sequence_from_ofsm_tables M ?q1.0 ?q2.0

goal (1 subgoal):
 1. distHelper = get_distinguishing_sequence_from_ofsm_tables M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distHelper ?q1.0 ?q2.0 = get_distinguishing_sequence_from_ofsm_tables M ?q1.0 ?q2.0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distHelper ?q1.0 ?q2.0 = get_distinguishing_sequence_from_ofsm_tables M ?q1.0 ?q2.0

goal (1 subgoal):
 1. distHelper = get_distinguishing_sequence_from_ofsm_tables M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distHelper = get_distinguishing_sequence_from_ofsm_tables M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distHelper = get_distinguishing_sequence_from_ofsm_tables M

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distHelper = get_distinguishing_sequence_from_ofsm_tables M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distHelper = get_distinguishing_sequence_from_ofsm_tables M

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)
[PROOF STEP]
unfolding distHelper_def distMap_orig distStates_def Let_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup (mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables (compute_ofsm_tables M (FSM.size M - 1)) M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M))))) (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2) = get_distinguishing_sequence_from_ofsm_tables M

goal (1 subgoal):
 1. get_distinguishing_sequence_from_ofsm_tables M = (\<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup (mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables (compute_ofsm_tables M (FSM.size M - 1)) M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M))))) (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
get_distinguishing_sequence_from_ofsm_tables M = (let tables = compute_ofsm_tables M (FSM.size M - 1); distMap = mapping_of (map (\<lambda>(q1, q2). ((q1, q2), get_distinguishing_sequence_from_ofsm_tables_with_provided_tables tables M q1 q2)) (filter (\<lambda>qq. fst qq \<noteq> snd qq) (List.product (states_as_list M) (states_as_list M)))); distHelper = \<lambda>q1 q2. if q1 \<in> FSM.states M \<and> q2 \<in> FSM.states M \<and> q1 \<noteq> q2 then the (Mapping.lookup distMap (q1, q2)) else get_distinguishing_sequence_from_ofsm_tables M q1 q2 in distHelper)

goal:
No subgoals!
[PROOF STEP]
qed