[STATEMENT]
lemma real_polynomial_function_eq: "real_polynomial_function p = polynomial_function p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function p = polynomial_function p
[PROOF STEP]
unfolding polynomial_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function p = (\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_polynomial_function p \<Longrightarrow> \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)
 2. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p) \<Longrightarrow> real_polynomial_function p
[PROOF STEP]
assume "real_polynomial_function p"
[PROOF STATE]
proof (state)
this:
real_polynomial_function p

goal (2 subgoals):
 1. real_polynomial_function p \<Longrightarrow> \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)
 2. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p) \<Longrightarrow> real_polynomial_function p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function p
[PROOF STEP]
show " \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)"
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)
[PROOF STEP]
proof (induction p rule: real_polynomial_function.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>f. bounded_linear f \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f)
 2. \<And>c. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. c))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 4. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
case (linear h)
[PROOF STATE]
proof (state)
this:
bounded_linear h

goal (4 subgoals):
 1. \<And>f. bounded_linear f \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f)
 2. \<And>c. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. c))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 4. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear h
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bounded_linear h

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
[PROOF STEP]
by (auto simp: bounded_linear_compose real_polynomial_function.linear)
[PROOF STATE]
proof (state)
this:
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)

goal (3 subgoals):
 1. \<And>c. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. c))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. c))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
case (const h)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>c. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. c))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h))
[PROOF STEP]
by (simp add: real_polynomial_function.const)
[PROOF STATE]
proof (state)
this:
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h))

goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
case (add h)
[PROOF STATE]
proof (state)
this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)

goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a + g a))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h a + g_ a))
[PROOF STEP]
by (force simp add: bounded_linear_def linear_add real_polynomial_function.add)
[PROOF STATE]
proof (state)
this:
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h a + g_ a))

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
case (mult h)
[PROOF STATE]
proof (state)
this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> f); real_polynomial_function g; \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g)\<rbrakk> \<Longrightarrow> \<forall>fa. bounded_linear fa \<longrightarrow> real_polynomial_function (fa \<circ> (\<lambda>a. f a * g a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function h
real_polynomial_function g_
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> h)
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> g_)

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h a * g_ a))
[PROOF STEP]
by (force simp add: real_bounded_linear const real_polynomial_function.mult)
[PROOF STATE]
proof (state)
this:
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> (\<lambda>a. h a * g_ a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p) \<Longrightarrow> real_polynomial_function p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p) \<Longrightarrow> real_polynomial_function p
[PROOF STEP]
assume [rule_format, OF bounded_linear_ident]: "\<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p)"
[PROOF STATE]
proof (state)
this:
real_polynomial_function ((\<lambda>x. x) \<circ> p)

goal (1 subgoal):
 1. \<forall>f. bounded_linear f \<longrightarrow> real_polynomial_function (f \<circ> p) \<Longrightarrow> real_polynomial_function p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function ((\<lambda>x. x) \<circ> p)
[PROOF STEP]
show "real_polynomial_function p"
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function ((\<lambda>x. x) \<circ> p)

goal (1 subgoal):
 1. real_polynomial_function p
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
real_polynomial_function p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_dens_ctxt_measure_dens_ctxt_measure':
  assumes "x \<in> V"
  shows "space (state_measure V \<Gamma>) =
             {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V-{x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
[PROOF STEP]
have "insert x (V-{x}) = V"
[PROOF STATE]
proof (prove)
using this:
x \<in> V

goal (1 subgoal):
 1. insert x (V - {x}) = V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert x (V - {x}) = V

goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
hence "state_measure V \<Gamma> = Pi\<^sub>M (insert x (V-{x})) (\<lambda>y. stock_measure (\<Gamma> y))"
[PROOF STATE]
proof (prove)
using this:
insert x (V - {x}) = V

goal (1 subgoal):
 1. state_measure V \<Gamma> = Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))
[PROOF STEP]
unfolding state_measure_def
[PROOF STATE]
proof (prove)
using this:
insert x (V - {x}) = V

goal (1 subgoal):
 1. Pi\<^sub>M V (\<lambda>x. stock_measure (\<Gamma> x)) = Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
state_measure V \<Gamma> = Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))

goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
state_measure V \<Gamma> = Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))

goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
have "space ... = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V-{x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
unfolding state_measure_def space_PiM PiE_insert_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(y, g). g(x := y)) ` (space (stock_measure (\<Gamma> x)) \<times> (\<Pi>\<^sub>E i\<in>V - {x}. space (stock_measure (\<Gamma> i)))) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> (\<Pi>\<^sub>E i\<in>V - {x}. space (stock_measure (\<Gamma> i))) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
by (simp add: image_def Bex_def) blast
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>M (insert x (V - {x})) (\<lambda>y. stock_measure (\<Gamma> y))) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}

goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
space (state_measure V \<Gamma>) = {uu_. \<exists>\<sigma> y. uu_ = \<sigma>(x := y) \<and> \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
space (state_measure V \<Gamma>) = {uu_. \<exists>\<sigma> y. uu_ = \<sigma>(x := y) \<and> \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}

goal (1 subgoal):
 1. space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
space (state_measure V \<Gamma>) = {\<sigma>(x := y) |\<sigma> y. \<sigma> \<in> space (state_measure (V - {x}) \<Gamma>) \<and> y \<in> type_universe (\<Gamma> x)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sort_rev_eq_sort: "distinct xs \<Longrightarrow> sort (rev xs) = sort xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> sort (rev xs) = sort xs
[PROOF STEP]
by (rule sorted_distinct_set_unique) auto


[STATEMENT]
lemma distinct_permute_list [simp]:
  assumes "f permutes {..<length xs}"
  shows "distinct (permute_list f xs) = distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (permute_list f xs) = distinct xs
[PROOF STEP]
by (simp add: distinct_count_atmost_1 assms)


[STATEMENT]
lemma tllist_all2_TCons2:
  "tllist_all2 P Q ts' (TCons x ts) \<longleftrightarrow> (\<exists>x' ts''. ts' = TCons x' ts'' \<and> P x' x \<and> tllist_all2 P Q ts'' ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tllist_all2 P Q ts' (TCons x ts) = (\<exists>x' ts''. ts' = TCons x' ts'' \<and> P x' x \<and> tllist_all2 P Q ts'' ts)
[PROOF STEP]
by transfer(fastforce simp add: llist_all2_LCons2 dest: llist_all2_lfiniteD)


[STATEMENT]
lemma no_bounded_connected_component_imp_winding_number_zero:
  assumes g: "path g" "path_image g \<subseteq> S" "pathfinish g = pathstart g" "z \<notin> S"
      and nb: "\<And>z. bounded (connected_component_set (- S) z) \<Longrightarrow> z \<in> S"
    shows "winding_number g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
have "z \<in> outside (path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> outside (path_image g)
[PROOF STEP]
by (metis nb [of z] \<open>path_image g \<subseteq> S\<close> \<open>z \<notin> S\<close> subsetD mem_Collect_eq outside outside_mono)
[PROOF STATE]
proof (state)
this:
z \<in> outside (path_image g)

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> outside (path_image g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> outside (path_image g)

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
by (simp add: g winding_number_zero_in_outside)
[PROOF STATE]
proof (state)
this:
winding_number g z = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_over_permutations_insert:
  assumes fS: "finite S"
    and aS: "a \<notin> S"
  shows "sum f {p. p permutes (insert a S)} =
    sum (\<lambda>b. sum (\<lambda>q. f (transpose a b \<circ> q)) {p. p permutes S}) (insert a S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))
[PROOF STEP]
have *: "\<And>f a b. (\<lambda>(b, p). f (transpose a b \<circ> p)) = f \<circ> (\<lambda>(b,p). transpose a b \<circ> p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f a b. (\<lambda>(b, p). f (Transposition.transpose a b \<circ> p)) = f \<circ> (\<lambda>(b, p). Transposition.transpose a b \<circ> p)
[PROOF STEP]
by (simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>(b, p). ?f (Transposition.transpose ?a b \<circ> p)) = ?f \<circ> (\<lambda>(b, p). Transposition.transpose ?a b \<circ> p)

goal (1 subgoal):
 1. sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))
[PROOF STEP]
have **: "\<And>P Q. {(a, b). a \<in> P \<and> b \<in> Q} = P \<times> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P Q. {(a, b). a \<in> P \<and> b \<in> Q} = P \<times> Q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{(a, b). a \<in> ?P1 \<and> b \<in> ?Q1} = ?P1 \<times> ?Q1

goal (1 subgoal):
 1. sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))
[PROOF STEP]
unfolding * ** sum.cartesian_product permutes_insert
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f ((\<lambda>(b, y). Transposition.transpose a b \<circ> y) ` (insert a S \<times> {p. p permutes S})) = sum (f \<circ> (\<lambda>(b, y). Transposition.transpose a b \<circ> y)) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
proof (rule sum.reindex)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
let ?f = "(\<lambda>(b, y). transpose a b \<circ> y)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
let ?P = "{p. p permutes S}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
fix b c p q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
assume b: "b \<in> insert a S"
[PROOF STATE]
proof (state)
this:
b \<in> insert a S

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
assume c: "c \<in> insert a S"
[PROOF STATE]
proof (state)
this:
c \<in> insert a S

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
assume p: "p permutes S"
[PROOF STATE]
proof (state)
this:
p permutes S

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
assume q: "q permutes S"
[PROOF STATE]
proof (state)
this:
q permutes S

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
assume eq: "transpose a b \<circ> p = transpose a c \<circ> q"
[PROOF STATE]
proof (state)
this:
Transposition.transpose a b \<circ> p = Transposition.transpose a c \<circ> q

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
from p q aS
[PROOF STATE]
proof (chain)
picking this:
p permutes S
q permutes S
a \<notin> S
[PROOF STEP]
have pa: "p a = a" and qa: "q a = a"
[PROOF STATE]
proof (prove)
using this:
p permutes S
q permutes S
a \<notin> S

goal (1 subgoal):
 1. p a = a &&& q a = a
[PROOF STEP]
unfolding permutes_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x. x \<notin> S \<longrightarrow> p x = x) \<and> (\<forall>y. \<exists>!x. p x = y)
(\<forall>x. x \<notin> S \<longrightarrow> q x = x) \<and> (\<forall>y. \<exists>!x. q x = y)
a \<notin> S

goal (1 subgoal):
 1. p a = a &&& q a = a
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
p a = a
q a = a

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose a b \<circ> p = Transposition.transpose a c \<circ> q
[PROOF STEP]
have "(transpose a b \<circ> p) a  = (transpose a c \<circ> q) a"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose a b \<circ> p = Transposition.transpose a c \<circ> q

goal (1 subgoal):
 1. (Transposition.transpose a b \<circ> p) a = (Transposition.transpose a c \<circ> q) a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Transposition.transpose a b \<circ> p) a = (Transposition.transpose a c \<circ> q) a

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Transposition.transpose a b \<circ> p) a = (Transposition.transpose a c \<circ> q) a
[PROOF STEP]
have bc: "b = c"
[PROOF STATE]
proof (prove)
using this:
(Transposition.transpose a b \<circ> p) a = (Transposition.transpose a c \<circ> q) a

goal (1 subgoal):
 1. b = c
[PROOF STEP]
by (simp add: permutes_def pa qa o_def fun_upd_def id_def
            cong del: if_weak_cong split: if_split_asm)
[PROOF STATE]
proof (state)
this:
b = c

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
from eq[unfolded bc]
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose a c \<circ> p = Transposition.transpose a c \<circ> q
[PROOF STEP]
have "(\<lambda>p. transpose a c \<circ> p) (transpose a c \<circ> p) =
        (\<lambda>p. transpose a c \<circ> p) (transpose a c \<circ> q)"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose a c \<circ> p = Transposition.transpose a c \<circ> q

goal (1 subgoal):
 1. Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> p) = Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> p) = Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> q)

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> p) = Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> q)
[PROOF STEP]
have "p = q"
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> p) = Transposition.transpose a c \<circ> (Transposition.transpose a c \<circ> q)

goal (1 subgoal):
 1. p = q
[PROOF STEP]
unfolding o_assoc swap_id_idempotent
[PROOF STATE]
proof (prove)
using this:
Transposition.transpose a c \<circ> Transposition.transpose a c \<circ> p = Transposition.transpose a c \<circ> Transposition.transpose a c \<circ> q

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

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
with bc
[PROOF STATE]
proof (chain)
picking this:
b = c
p = q
[PROOF STEP]
have "b = c \<and> p = q"
[PROOF STATE]
proof (prove)
using this:
b = c
p = q

goal (1 subgoal):
 1. b = c \<and> p = q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = c \<and> p = q

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b5 \<in> insert a S; ?c5 \<in> insert a S; ?p5 permutes S; ?q5 permutes S; Transposition.transpose a ?b5 \<circ> ?p5 = Transposition.transpose a ?c5 \<circ> ?q5\<rbrakk> \<Longrightarrow> ?b5 = ?c5 \<and> ?p5 = ?q5

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?b5 \<in> insert a S; ?c5 \<in> insert a S; ?p5 permutes S; ?q5 permutes S; Transposition.transpose a ?b5 \<circ> ?p5 = Transposition.transpose a ?c5 \<circ> ?q5\<rbrakk> \<Longrightarrow> ?b5 = ?c5 \<and> ?p5 = ?q5
[PROOF STEP]
show "inj_on ?f (insert a S \<times> ?P)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b5 \<in> insert a S; ?c5 \<in> insert a S; ?p5 permutes S; ?q5 permutes S; Transposition.transpose a ?b5 \<circ> ?p5 = Transposition.transpose a ?c5 \<circ> ?q5\<rbrakk> \<Longrightarrow> ?b5 = ?c5 \<and> ?p5 = ?q5

goal (1 subgoal):
 1. inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b5 \<in> insert a S; ?c5 \<in> insert a S; ?p5 permutes S; ?q5 permutes S; Transposition.transpose a ?b5 \<circ> ?p5 = Transposition.transpose a ?c5 \<circ> ?q5\<rbrakk> \<Longrightarrow> ?b5 = ?c5 \<and> ?p5 = ?q5

goal (1 subgoal):
 1. \<forall>x\<in>insert a S \<times> {p. p permutes S}. \<forall>y\<in>insert a S \<times> {p. p permutes S}. (case x of (b, x) \<Rightarrow> Transposition.transpose a b \<circ> x) = (case y of (b, x) \<Rightarrow> Transposition.transpose a b \<circ> x) \<longrightarrow> x = y
[PROOF STEP]
by clarify metis
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>(b, y). Transposition.transpose a b \<circ> y) (insert a S \<times> {p. p permutes S})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum f {p. p permutes insert a S} = (\<Sum>b\<in>insert a S. \<Sum>q\<in>{p. p permutes S}. f (Transposition.transpose a b \<circ> q))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ord_recp_total: "\<exists>y. ord_recp T G H x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. ord_recp T G H x y
[PROOF STEP]
proof (cases "Ord x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
 2. \<not> Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Ord x

goal (2 subgoals):
 1. Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
 2. \<not> Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Ord x

goal (1 subgoal):
 1. \<exists>y. ord_recp T G H x y
[PROOF STEP]
proof (induct x rule: Ord_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>y. ord_recp T G H 0 y
 2. \<And>k. \<lbrakk>Ord k; \<exists>y. ord_recp T G H k y\<rbrakk> \<Longrightarrow> \<exists>y. ord_recp T G H (succ k) y
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>y. ord_recp T G H 0 y
 2. \<And>k. \<lbrakk>Ord k; \<exists>y. ord_recp T G H k y\<rbrakk> \<Longrightarrow> \<exists>y. ord_recp T G H (succ k) y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. ord_recp T G H 0 y
[PROOF STEP]
by (simp add: ord_recp_def)
[PROOF STATE]
proof (state)
this:
\<exists>y. ord_recp T G H 0 y

goal (1 subgoal):
 1. \<And>k. \<lbrakk>Ord k; \<exists>y. ord_recp T G H k y\<rbrakk> \<Longrightarrow> \<exists>y. ord_recp T G H (succ k) y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>Ord k; \<exists>y. ord_recp T G H k y\<rbrakk> \<Longrightarrow> \<exists>y. ord_recp T G H (succ k) y
[PROOF STEP]
case (succ x)
[PROOF STATE]
proof (state)
this:
Ord x
\<exists>y. ord_recp T G H x y

goal (1 subgoal):
 1. \<And>k. \<lbrakk>Ord k; \<exists>y. ord_recp T G H k y\<rbrakk> \<Longrightarrow> \<exists>y. ord_recp T G H (succ k) y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Ord x
\<exists>y. ord_recp T G H x y

goal (1 subgoal):
 1. \<exists>y. ord_recp T G H (succ x) y
[PROOF STEP]
by (metis ord_recp_succ_iff)
[PROOF STATE]
proof (state)
this:
\<exists>y. ord_recp T G H (succ x) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y. ord_recp T G H x y

goal (1 subgoal):
 1. \<not> Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> Ord x

goal (1 subgoal):
 1. \<not> Ord x \<Longrightarrow> \<exists>y. ord_recp T G H x y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> Ord x

goal (1 subgoal):
 1. \<exists>y. ord_recp T G H x y
[PROOF STEP]
by (auto simp: ord_recp_def)
[PROOF STATE]
proof (state)
this:
\<exists>y. ord_recp T G H x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma well_founded_singleton:
  assumes "\<not>r x x" shows "well_founded {x} r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_founded {x} r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> r x x

goal (1 subgoal):
 1. well_founded {x} r
[PROOF STEP]
by (auto simp: well_founded_iff_ex_extremal)


[STATEMENT]
lemma "(Abs_perm id :: 'a perm) \<bullet> id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. atom_fun_permute.permute_fun (Abs_perm id) id = id
[PROOF STEP]
unfolding atom_fun_permute.permute_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. permute_atom (Abs_perm id) (id (permute_atom (- Abs_perm id) x))) = id
[PROOF STEP]
unfolding permute_atom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Rep_perm (Abs_perm id) (id (Rep_perm (- Abs_perm id) x))) = id
[PROOF STEP]
by (metis Rep_perm_0 id_def inj_imp_inv_eq inj_on_id uminus_perm_def zero_perm_def)


[STATEMENT]
lemma comp_unique: "unique (comp G) = unique G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unique (TranslComp.comp G) = unique G
[PROOF STEP]
apply (simp add: comp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unique (map (compClass G) G) = unique G
[PROOF STEP]
apply (rule unique_map_fst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set G \<Longrightarrow> fst x = fst (compClass G x)
[PROOF STEP]
apply (simp add: compClass_def split_beta)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done