[STATEMENT]
lemma aform_val_msum_aform:
  assumes "degree_aform f \<le> n"
  shows "aform_val e (msum_aform n f g) = aform_val e f + aform_val (\<lambda>i. e (i + n)) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_val e (msum_aform n f g) = aform_val e f + aform_val (\<lambda>i. e (i + n)) g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree_aform f \<le> n

goal (1 subgoal):
 1. aform_val e (msum_aform n f g) = aform_val e f + aform_val (\<lambda>i. e (i + n)) g
[PROOF STEP]
by (auto simp: pdevs_val_msum_pdevs aform_val_def)


[STATEMENT]
lemma pochhammer_product': "pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m
[PROOF STEP]
proof (induct n arbitrary: z)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>z. pochhammer z (0 + m) = pochhammer z 0 * pochhammer (z + of_nat 0) m
 2. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>z. pochhammer z (0 + m) = pochhammer z 0 * pochhammer (z + of_nat 0) m
 2. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer z (0 + m) = pochhammer z 0 * pochhammer (z + of_nat 0) m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer z (0 + m) = pochhammer z 0 * pochhammer (z + of_nat 0) m

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
case (Suc n z)
[PROOF STATE]
proof (state)
this:
pochhammer ?z (n + m) = pochhammer ?z n * pochhammer (?z + of_nat n) m

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
have "pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m =
      z * (pochhammer (z + 1) n * pochhammer (z + 1 + of_nat n) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m = z * (pochhammer (z + (1::'a)) n * pochhammer (z + (1::'a) + of_nat n) m)
[PROOF STEP]
by (simp add: pochhammer_rec ac_simps)
[PROOF STATE]
proof (state)
this:
pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m = z * (pochhammer (z + (1::'a)) n * pochhammer (z + (1::'a) + of_nat n) m)

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m = z * (pochhammer (z + (1::'a)) n * pochhammer (z + (1::'a) + of_nat n) m)

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
note Suc[symmetric]
[PROOF STATE]
proof (state)
this:
pochhammer ?z n * pochhammer (?z + of_nat n) m = pochhammer ?z (n + m)

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pochhammer ?z n * pochhammer (?z + of_nat n) m = pochhammer ?z (n + m)

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
have "z * pochhammer (z + 1) (n + m) = pochhammer z (Suc (n + m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * pochhammer (z + (1::'a)) (n + m) = pochhammer z (Suc (n + m))
[PROOF STEP]
by (subst pochhammer_rec) simp
[PROOF STATE]
proof (state)
this:
z * pochhammer (z + (1::'a)) (n + m) = pochhammer z (Suc (n + m))

goal (1 subgoal):
 1. \<And>n z. (\<And>z. pochhammer z (n + m) = pochhammer z n * pochhammer (z + of_nat n) m) \<Longrightarrow> pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m = pochhammer z (Suc (n + m))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m = pochhammer z (Suc (n + m))

goal (1 subgoal):
 1. pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer z (Suc n + m) = pochhammer z (Suc n) * pochhammer (z + of_nat (Suc n)) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trivial_subset_non_empty: assumes "trivial t" "t \<inter> X \<noteq> {}"
            shows   "t \<subseteq> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<subseteq> X
[PROOF STEP]
using trivial_def assms in_mono
[PROOF STATE]
proof (prove)
using this:
trivial ?x = (?x \<subseteq> {the_elem ?x})
trivial t
t \<inter> X \<noteq> {}
?A \<subseteq> ?B \<Longrightarrow> ?x \<in> ?A \<longrightarrow> ?x \<in> ?B

goal (1 subgoal):
 1. t \<subseteq> X
[PROOF STEP]
by fast


[STATEMENT]
lemma vars_Plus [simp]: "vars (Plus X Y) = vars X \<union> vars Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
have "\<And>U V. \<lbrakk>X = Abs_Exp (exprel``{U}); Y = Abs_Exp (exprel``{V})\<rbrakk>
               \<Longrightarrow> vars (Plus X Y) = vars X \<union> vars Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U V. \<lbrakk>X = Abs_Exp (exprel `` {U}); Y = Abs_Exp (exprel `` {V})\<rbrakk> \<Longrightarrow> vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
by (simp add: vars_def Plus UN_equiv_class [OF equiv_exprel vars_respects])
[PROOF STATE]
proof (state)
this:
\<lbrakk>X = Abs_Exp (exprel `` {?U}); Y = Abs_Exp (exprel `` {?V})\<rbrakk> \<Longrightarrow> vars (Plus X Y) = vars X \<union> vars Y

goal (1 subgoal):
 1. vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>X = Abs_Exp (exprel `` {?U}); Y = Abs_Exp (exprel `` {?V})\<rbrakk> \<Longrightarrow> vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>X = Abs_Exp (exprel `` {?U}); Y = Abs_Exp (exprel `` {?V})\<rbrakk> \<Longrightarrow> vars (Plus X Y) = vars X \<union> vars Y

goal (1 subgoal):
 1. vars (Plus X Y) = vars X \<union> vars Y
[PROOF STEP]
by (meson eq_Abs_Exp)
[PROOF STATE]
proof (state)
this:
vars (Plus X Y) = vars X \<union> vars Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iter_tensor_of_H_is_gate:
  assumes "n \<ge> 1"
  shows "gate n (H \<otimes>\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gate n (H \<otimes>\<^bsup>n\<^esup>)
[PROOF STEP]
using iter_tensor_of_gate_is_gate H_is_gate assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>gate ?m ?A; 1 \<le> ?n\<rbrakk> \<Longrightarrow> gate (?m * ?n) (?A \<otimes>\<^bsup>?n\<^esup>)
gate 1 H
1 \<le> n

goal (1 subgoal):
 1. gate n (H \<otimes>\<^bsup>n\<^esup>)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma eq_nodes_dfa_trans:
  assumes "eq_nodes M v p q"
  and "is_alph v bs"
  shows "eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs) \<Longrightarrow> False
[PROOF STEP]
assume H: "\<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)"
[PROOF STATE]
proof (state)
this:
\<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)

goal (1 subgoal):
 1. \<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)
[PROOF STEP]
obtain n w where "length w = n" "list_all (is_alph v) w" "dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)"
[PROOF STATE]
proof (prove)
using this:
\<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs)

goal (1 subgoal):
 1. (\<And>w n. \<lbrakk>length w = n; list_all (is_alph v) w; dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eq_nodes_def dist_nodes_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<nexists>n w. length w = n \<and> list_all (is_alph v) w \<and> dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w))

goal (1 subgoal):
 1. (\<And>w n. \<lbrakk>length w = n; list_all (is_alph v) w; dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length w = n
list_all (is_alph v) w
dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)

goal (1 subgoal):
 1. \<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs) \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
eq_nodes M v p q
is_alph v bs
length w = n
list_all (is_alph v) w
dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)
[PROOF STEP]
have "length (bs # w) = Suc n" "list_all (is_alph v) (bs # w)" "dfa_accepting M (dfa_steps M p (bs # w)) \<noteq> dfa_accepting M (dfa_steps M q (bs # w))"
[PROOF STATE]
proof (prove)
using this:
eq_nodes M v p q
is_alph v bs
length w = n
list_all (is_alph v) w
dfa_accepting M (dfa_steps M (dfa_trans M p bs) w) \<noteq> dfa_accepting M (dfa_steps M (dfa_trans M q bs) w)

goal (1 subgoal):
 1. length (bs # w) = Suc n &&& list_all (is_alph v) (bs # w) &&& dfa_accepting M (dfa_steps M p (bs # w)) \<noteq> dfa_accepting M (dfa_steps M q (bs # w))
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
length (bs # w) = Suc n
list_all (is_alph v) (bs # w)
dfa_accepting M (dfa_steps M p (bs # w)) \<noteq> dfa_accepting M (dfa_steps M q (bs # w))

goal (1 subgoal):
 1. \<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs) \<Longrightarrow> False
[PROOF STEP]
hence "\<not> eq_nodes M v p q"
[PROOF STATE]
proof (prove)
using this:
length (bs # w) = Suc n
list_all (is_alph v) (bs # w)
dfa_accepting M (dfa_steps M p (bs # w)) \<noteq> dfa_accepting M (dfa_steps M q (bs # w))

goal (1 subgoal):
 1. \<not> eq_nodes M v p q
[PROOF STEP]
unfolding eq_nodes_def dist_nodes_def
[PROOF STATE]
proof (prove)
using this:
length (bs # w) = Suc n
list_all (is_alph v) (bs # w)
dfa_accepting M (dfa_steps M p (bs # w)) \<noteq> dfa_accepting M (dfa_steps M q (bs # w))

goal (1 subgoal):
 1. \<not> (\<nexists>n w. length w = n \<and> list_all (is_alph v) w \<and> dfa_accepting M (dfa_steps M p w) \<noteq> dfa_accepting M (dfa_steps M q w))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> eq_nodes M v p q

goal (1 subgoal):
 1. \<not> eq_nodes M v (dfa_trans M p bs) (dfa_trans M q bs) \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
eq_nodes M v p q
is_alph v bs
\<not> eq_nodes M v p q
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
eq_nodes M v p q
is_alph v bs
\<not> eq_nodes M v p q

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arc_reversepath:
  assumes "arc g" shows "arc(reversepath g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
have injg: "inj_on g {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on g {0..1}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
arc g

goal (1 subgoal):
 1. inj_on g {0..1}
[PROOF STEP]
by (simp add: arc_def)
[PROOF STATE]
proof (state)
this:
inj_on g {0..1}

goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
have **: "\<And>x y::real. 1-x = 1-y \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. 1 - x = 1 - y \<Longrightarrow> x = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 - ?x = 1 - ?y \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
arc g

goal (1 subgoal):
 1. arc (reversepath g)
[PROOF STEP]
by (clarsimp simp: arc_def intro!: inj_onI) (simp add: inj_onD reversepath_def **)
[PROOF STATE]
proof (state)
this:
arc (reversepath g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sig_red_single_regular_lt:
  assumes "sig_red_single (\<prec>\<^sub>t) top_tail p q f t"
  shows "lt q = lt p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
let ?f = "monom_mult ((lookup (rep_list p) (t + punit.lt (rep_list f))) / punit.lc (rep_list f)) t f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
sig_red_single (\<prec>\<^sub>t) top_tail p q f t
[PROOF STEP]
have lt: "t \<oplus> lt f \<prec>\<^sub>t lt p" and q: "q = p - ?f"
[PROOF STATE]
proof (prove)
using this:
sig_red_single (\<prec>\<^sub>t) top_tail p q f t

goal (1 subgoal):
 1. t \<oplus> lt f \<prec>\<^sub>t lt p &&& q = p - monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f
[PROOF STEP]
by (rule sig_red_singleD6, rule sig_red_singleD3)
[PROOF STATE]
proof (state)
this:
t \<oplus> lt f \<prec>\<^sub>t lt p
q = p - monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f

goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
from lt_monom_mult_le lt
[PROOF STATE]
proof (chain)
picking this:
lt (monom_mult ?c ?t ?p) \<preceq>\<^sub>t ?t \<oplus> lt ?p
t \<oplus> lt f \<prec>\<^sub>t lt p
[PROOF STEP]
have "lt ?f \<prec>\<^sub>t lt p"
[PROOF STATE]
proof (prove)
using this:
lt (monom_mult ?c ?t ?p) \<preceq>\<^sub>t ?t \<oplus> lt ?p
t \<oplus> lt f \<prec>\<^sub>t lt p

goal (1 subgoal):
 1. lt (monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f) \<prec>\<^sub>t lt p
[PROOF STEP]
by (rule ord_term_lin.order.strict_trans1)
[PROOF STATE]
proof (state)
this:
lt (monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f) \<prec>\<^sub>t lt p

goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lt (monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f) \<prec>\<^sub>t lt p

goal (1 subgoal):
 1. lt q = lt p
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
lt (monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f) \<prec>\<^sub>t lt p

goal (1 subgoal):
 1. lt (p - monom_mult (lookup (rep_list p) (t + punit.lt (rep_list f)) / punit.lc (rep_list f)) t f) = lt p
[PROOF STEP]
by (rule lt_minus_eqI_2)
[PROOF STATE]
proof (state)
this:
lt q = lt p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_map_imp_closed_graph:
  assumes f: "continuous_map X Y f" and Y: "Hausdorff_space Y"
  shows "closedin (prod_topology X Y) ((\<lambda>x. (x,f x)) ` topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (prod_topology X Y) ((\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
unfolding closedin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y) \<and> openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y)
 2. openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
show "(\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y)
[PROOF STEP]
using continuous_map_def f
[PROOF STATE]
proof (prove)
using this:
continuous_map ?X ?Y ?f \<equiv> (\<forall>x\<in>topspace ?X. ?f x \<in> topspace ?Y) \<and> (\<forall>U. openin ?Y U \<longrightarrow> openin ?X {x \<in> topspace ?X. ?f x \<in> U})
continuous_map X Y f

goal (1 subgoal):
 1. (\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (x, f x)) ` topspace X \<subseteq> topspace (prod_topology X Y)

goal (1 subgoal):
 1. openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
show "openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
unfolding openin_prod_topology_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X \<longrightarrow> (\<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X \<Longrightarrow> \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
show "\<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X"
      if "(x,y) \<in> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X"
      for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
have "x \<in> topspace X" "y \<in> topspace Y" "y \<noteq> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> topspace X &&& y \<in> topspace Y &&& y \<noteq> f x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X

goal (1 subgoal):
 1. x \<in> topspace X &&& y \<in> topspace Y &&& y \<noteq> f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> topspace X
y \<in> topspace Y
y \<noteq> f x

goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> topspace X
y \<in> topspace Y
y \<noteq> f x

goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
have "f x \<in> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> topspace Y
[PROOF STEP]
by (meson \<open>x \<in> topspace X\<close> continuous_map_def f)
[PROOF STATE]
proof (state)
this:
f x \<in> topspace Y

goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> topspace X
y \<in> topspace Y
y \<noteq> f x
f x \<in> topspace Y
[PROOF STEP]
obtain U V where UV: "openin Y U" "openin Y V" "f x \<in> U" "y \<in> V" "disjnt U V"
[PROOF STATE]
proof (prove)
using this:
x \<in> topspace X
y \<in> topspace Y
y \<noteq> f x
f x \<in> topspace Y

goal (1 subgoal):
 1. (\<And>U V. \<lbrakk>openin Y U; openin Y V; f x \<in> U; y \<in> V; disjnt U V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Y Hausdorff_space_def
[PROOF STATE]
proof (prove)
using this:
x \<in> topspace X
y \<in> topspace Y
y \<noteq> f x
f x \<in> topspace Y
Hausdorff_space Y
Hausdorff_space ?X \<equiv> \<forall>x y. x \<in> topspace ?X \<and> y \<in> topspace ?X \<and> x \<noteq> y \<longrightarrow> (\<exists>U V. openin ?X U \<and> openin ?X V \<and> x \<in> U \<and> y \<in> V \<and> disjnt U V)

goal (1 subgoal):
 1. (\<And>U V. \<lbrakk>openin Y U; openin Y V; f x \<in> U; y \<in> V; disjnt U V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
openin Y U
openin Y V
f x \<in> U
y \<in> V
disjnt U V

goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. openin X ?U
 2. openin Y ?V1
 3. x \<in> ?U
 4. y \<in> ?V1
 5. ?U \<times> ?V1 \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
show "openin X {x \<in> topspace X. f x \<in> U}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
using \<open>openin Y U\<close> f openin_continuous_map_preimage
[PROOF STATE]
proof (prove)
using this:
openin Y U
continuous_map X Y f
\<lbrakk>continuous_map ?X ?Y ?f; openin ?Y ?U\<rbrakk> \<Longrightarrow> openin ?X {x \<in> topspace ?X. ?f x \<in> ?U}

goal (1 subgoal):
 1. openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin X {x \<in> topspace X. f x \<in> U}

goal (4 subgoals):
 1. openin Y ?V1
 2. x \<in> {x \<in> topspace X. f x \<in> U}
 3. y \<in> ?V1
 4. {x \<in> topspace X. f x \<in> U} \<times> ?V1 \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
show "{x \<in> topspace X. f x \<in> U} \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> topspace X. f x \<in> U} \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
using UV
[PROOF STATE]
proof (prove)
using this:
openin Y U
openin Y V
f x \<in> U
y \<in> V
disjnt U V

goal (1 subgoal):
 1. {x \<in> topspace X. f x \<in> U} \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X
[PROOF STEP]
by (auto simp: disjnt_iff dest: openin_subset)
[PROOF STATE]
proof (state)
this:
{x \<in> topspace X. f x \<in> U} \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X

goal (3 subgoals):
 1. openin Y V
 2. x \<in> {x \<in> topspace X. f x \<in> U}
 3. y \<in> V
[PROOF STEP]
qed (use UV \<open>x \<in> topspace X\<close> in auto)
[PROOF STATE]
proof (state)
this:
\<exists>U V. openin X U \<and> openin Y V \<and> x \<in> U \<and> y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(?x, ?y) \<in> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X \<Longrightarrow> \<exists>U V. openin X U \<and> openin Y V \<and> ?x \<in> U \<and> ?y \<in> V \<and> U \<times> V \<subseteq> topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
openin (prod_topology X Y) (topspace (prod_topology X Y) - (\<lambda>x. (x, f x)) ` topspace X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_set_cyc_permutationss:
  assumes "distincts xss"
  shows "yss \<in> set (cyc_permutationss xss) \<longleftrightarrow> distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
assume A: "list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)"
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)
[PROOF STEP]
have "length yss = length xss"
[PROOF STATE]
proof (prove)
using this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)

goal (1 subgoal):
 1. length yss = length xss
[PROOF STEP]
by (auto simp: list_all2_lengthD)
[PROOF STATE]
proof (state)
this:
length yss = length xss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length yss = length xss
[PROOF STEP]
have "\<Union>(sset xss) = \<Union>(sset yss)" "distincts yss" "map set xss = map set yss" "map hd xss = map hd yss"
[PROOF STATE]
proof (prove)
using this:
length yss = length xss

goal (1 subgoal):
 1. (\<Union> (sset xss) = \<Union> (sset yss) &&& distincts yss) &&& map set xss = map set yss &&& map hd xss = map hd yss
[PROOF STEP]
using A assms
[PROOF STATE]
proof (prove)
using this:
length yss = length xss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)
distincts xss

goal (1 subgoal):
 1. (\<Union> (sset xss) = \<Union> (sset yss) &&& distincts yss) &&& map set xss = map set yss &&& map hd xss = map hd yss
[PROOF STEP]
by (induct yss xss rule: list_induct2) (auto simp: distincts_Cons in_set_cyc_permutations)
[PROOF STATE]
proof (state)
this:
\<Union> (sset xss) = \<Union> (sset yss)
distincts yss
map set xss = map set yss
map hd xss = map hd yss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> \<Union> (sset xss) = \<Union> (sset yss)
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> distincts yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map set xss = map set yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map hd xss = map hd yss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
note X = this
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> \<Union> (sset xss) = \<Union> (sset yss)
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> distincts yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map set xss = map set yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map hd xss = map hd yss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> \<Union> (sset xss) = \<Union> (sset yss)
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> distincts yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map set xss = map set yss
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss) \<Longrightarrow> map hd xss = map hd yss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
assume A: "distincts yss" "map set xss = map set yss" "map hd xss = map hd yss"
[PROOF STATE]
proof (state)
this:
distincts yss
map set xss = map set yss
map hd xss = map hd yss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distincts yss
map set xss = map set yss
map hd xss = map hd yss
[PROOF STEP]
have "length yss = length xss"
[PROOF STATE]
proof (prove)
using this:
distincts yss
map set xss = map set yss
map hd xss = map hd yss

goal (1 subgoal):
 1. length yss = length xss
[PROOF STEP]
by (auto dest: map_eq_imp_length_eq)
[PROOF STATE]
proof (state)
this:
length yss = length xss

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length yss = length xss
[PROOF STEP]
have "list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)"
[PROOF STATE]
proof (prove)
using this:
length yss = length xss

goal (1 subgoal):
 1. list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)
[PROOF STEP]
using A assms
[PROOF STATE]
proof (prove)
using this:
length yss = length xss
distincts yss
map set xss = map set yss
map hd xss = map hd yss
distincts xss

goal (1 subgoal):
 1. list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)
[PROOF STEP]
by (induct yss xss rule: list_induct2) (auto simp: distincts_Cons in_set_cyc_permutations)
[PROOF STATE]
proof (state)
this:
list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>distincts yss; map set xss = map set yss; map hd xss = map hd yss\<rbrakk> \<Longrightarrow> list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
note Y = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>distincts yss; map set xss = map set yss; map hd xss = map hd yss\<rbrakk> \<Longrightarrow> list_all2 (\<lambda>x ys. x \<in> set ys) yss (map cyc_permutations xss)

goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
unfolding cyc_permutationss_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (yss \<in> set ((product_lists \<circ> map cyc_permutations) xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)
[PROOF STEP]
by (auto simp: product_lists_set intro: X Y)
[PROOF STATE]
proof (state)
this:
(yss \<in> set (cyc_permutationss xss)) = (distincts yss \<and> map set xss = map set yss \<and> map hd xss = map hd yss)

goal:
No subgoals!
[PROOF STEP]
qed